ruby-pota-csv-to-adif 0.0.1 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 88b6691fc7f3ae4eaf7f54422b5db20a2fdb50653a30bc6a431c93da04329cd3
4
- data.tar.gz: '0688ff4ce576e0a54b69a6b3ab1133a0d6937d783356602cc38e775b14517ada'
3
+ metadata.gz: cb1a1a3aeb3e476b1f589af9de8b8719f403c816a487df9ec7b9cf4803889d02
4
+ data.tar.gz: 70a7023956df5210add62ebeed0d2b86a3a6297203a91365a57a96b2078fedd5
5
5
  SHA512:
6
- metadata.gz: 10268ce00497132bb11871cc4e41236af6fd48fa02156b8e3fab92e98fbc48ef8da3e97fccb1959f636a10c8a17e7cf315a9067cdf27f6e0b08d9d14bd41dae7
7
- data.tar.gz: 2c17835f5ca7faa66a32dcacbd8aad922384925e56dad4b3f92f61cf2b7cbe1aec4b4bb7271ae1104435d43c1f4cfcacf4db99f5cbe0895b2128cc3d94ea0a9d
6
+ metadata.gz: b2b61e684614cd6cb75c78f45558ffc189b656dbd27d025875fb3c0b06efc4b9b3b96284090a0e14d8609e70796435d65b64b0acdeb494fb601e2ea3396f047c
7
+ data.tar.gz: 7ec048afa9fa2d82682e7144f4f1e75adb45e8aa814ef129202482e4aa90e0854faada07bc0b8750ce827e9d90f0c744d831238082bd384211f8844eaf70fad5
@@ -1,4 +1,23 @@
1
1
  #!/usr/bin/env ruby
2
+ # Copyright (c) 2021-2022 Edward Copony
3
+ #
4
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ # of this software and associated documentation files (the "Software"), to deal
6
+ # in the Software without restriction, including without limitation the rights
7
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ # copies of the Software, and to permit persons to whom the Software is
9
+ # furnished to do so, subject to the following conditions:
10
+ #
11
+ # The above copyright notice and this permission notice shall be included in all
12
+ # copies or substantial portions of the Software.
13
+ #
14
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ # SOFTWARE.
2
21
 
3
22
  require 'ruby-pota-csv-to-adif'
4
23
 
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2021 Edward Copony
1
+ # Copyright (c) 2021-2022 Edward Copony
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  # of this software and associated documentation files (the "Software"), to deal
@@ -29,12 +29,12 @@ module PotaCsvToAdif
29
29
  def convert
30
30
  file = File.open(file_path)
31
31
  csv = CSV.new(file, headers: true)
32
- adif_file = File.new("#{file_path[0...file_path.rindex('.')]}.adi", 'w')
32
+ File.open("#{file_path[0...file_path.rindex('.')]}.adi", 'w') do |adif_file|
33
+ adif_file.puts header
33
34
 
34
- adif_file.puts header
35
-
36
- csv.each do |row|
37
- adif_file.puts "#{field('CALL', row)}#{field('QSO_DATE', row)}#{field('TIME_ON', row)}#{field('BAND', row)}#{field('MODE', row)}#{field('OPERATOR', row)}<MY_SIG:4>POTA #{field('MY_SIG_INFO', row)}#{field('SIG_INFO', row)}#{field('STATION_CALLSIGN', row)}<EOR>"
35
+ csv.each do |row|
36
+ adif_file.puts "#{field('CALL', row)}#{field('QSO_DATE', row)}#{field('TIME_ON', row)}#{field('BAND', row)}#{field('MODE', row)}#{field('OPERATOR', row)}<MY_SIG:4>POTA #{field('MY_SIG_INFO', row)}#{field('SIG_INFO', row)}#{field('STATION_CALLSIGN', row)}<EOR>"
37
+ end
38
38
  end
39
39
  end
40
40
 
@@ -44,20 +44,20 @@ module PotaCsvToAdif
44
44
 
45
45
  def header
46
46
  <<-ADIF_HEAD
47
- ADIF Export from ruby-pota-csv-to-adif v[0.1]
47
+ ADIF Export from ruby-pota-csv-to-adif v[0.0.4]
48
48
  https://github.com/ecopony/ruby-pota-csv-to-adif
49
- Copyright (C) 2021 Edward Copony
50
- File generated on #{Time.now.getutc.strftime('%d %b, %Y at %I:%M')}
49
+ Copyright (C) 2021-2022 Edward Copony
50
+ File generated on #{Time.now.getutc.strftime('%d %b, %Y at %H:%M')}
51
51
  <ADIF_VER:5>3.1.0
52
52
  <PROGRAMID:21>ruby-pota-csv-to-adif
53
- <PROGRAMVERSION:3>0.1
53
+ <PROGRAMVERSION:3>0.0.4
54
54
  <EOH>
55
55
 
56
56
  ADIF_HEAD
57
57
  end
58
58
 
59
59
  def field(name, row)
60
- value = row[name]
60
+ value = row[name]&.strip
61
61
  return if value.nil?
62
62
  "<#{name.upcase}:#{value.size}>#{value} "
63
63
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-pota-csv-to-adif
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Edward Copony
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-27 00:00:00.000000000 Z
11
+ date: 2022-08-12 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Converts a CSV file of a Parks on the Air log to ADIF
14
14
  email: ecopony@gmail.com
@@ -23,7 +23,7 @@ homepage: https://rubygems.org/gems/ruby-pota-csv-to-adif
23
23
  licenses:
24
24
  - MIT
25
25
  metadata: {}
26
- post_install_message:
26
+ post_install_message:
27
27
  rdoc_options: []
28
28
  require_paths:
29
29
  - lib
@@ -38,8 +38,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
38
38
  - !ruby/object:Gem::Version
39
39
  version: '0'
40
40
  requirements: []
41
- rubygems_version: 3.1.4
42
- signing_key:
41
+ rubygems_version: 3.3.7
42
+ signing_key:
43
43
  specification_version: 4
44
44
  summary: Converts a CSV file of a Parks on the Air log to ADIF
45
45
  test_files: []