rsmart_toolbox 0.11 → 0.12
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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/bin/transform_CSV_to_HR_XML +20 -0
- data/lib/rsmart_toolbox/etl.rb +3 -3
- data/lib/rsmart_toolbox/version.rb +1 -1
- data/rsmart_toolbox.gemspec +1 -1
- data.tar.gz.sig +0 -0
- metadata +5 -5
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9df84131abe73171ab6f69048fdf14d029dd14c0
|
4
|
+
data.tar.gz: 704b9cd5c78da9f72c3be53f062bcbf0f640a34c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ebe50b00afa63097e166a83ac0ac170198e1d22e2ca1d2761077037f46206ab9007a629659bde252bdde87496975446b16c1273fba0cc6e70a81e7c2e6992be
|
7
|
+
data.tar.gz: 4a8ac96dbd5f97dde57c4f84699e1c6209465205be08c0a5b3af1b1192882e531c52eef06622faeb81fbd98db86383a90aa6ea5f9f7edba6aca3c32a15e98a0c
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/bin/transform_CSV_to_HR_XML
CHANGED
@@ -81,6 +81,8 @@ end
|
|
81
81
|
|
82
82
|
opt = parse_command_line_options (File.basename $0), ARGF.argv
|
83
83
|
|
84
|
+
text_parse_errors = []
|
85
|
+
|
84
86
|
CSV.open(opt[:csv_filename], opt[:csv_options]) do |csv|
|
85
87
|
record_count = csv.readlines.count
|
86
88
|
csv.rewind # go back to first row
|
@@ -293,6 +295,7 @@ CSV.open(opt[:csv_filename], opt[:csv_options]) do |csv|
|
|
293
295
|
|
294
296
|
rescue TextParseError => e
|
295
297
|
puts e.message
|
298
|
+
text_parse_errors.push e
|
296
299
|
end
|
297
300
|
end # row
|
298
301
|
end # record
|
@@ -300,6 +303,23 @@ CSV.open(opt[:csv_filename], opt[:csv_options]) do |csv|
|
|
300
303
|
end # xml_file
|
301
304
|
end # csv
|
302
305
|
|
306
|
+
def number_of_errors(parse_errors_array)
|
307
|
+
num_errors = 0
|
308
|
+
unless parse_errors_array.empty?
|
309
|
+
parse_errors_array.each do |err|
|
310
|
+
num_errors += 1 if err.message.start_with? "ERROR"
|
311
|
+
end
|
312
|
+
end
|
313
|
+
return num_errors
|
314
|
+
end
|
315
|
+
|
316
|
+
num_errors = number_of_errors text_parse_errors
|
317
|
+
if num_errors > 0
|
318
|
+
puts "\n#{num_errors} errors found and must be corrected.\n\n"
|
319
|
+
File.unlink opt[:xml_filename]
|
320
|
+
exit 1
|
321
|
+
end
|
322
|
+
|
303
323
|
puts "\nXML file written to #{opt[:xml_filename]}\n\n"
|
304
324
|
|
305
325
|
exit 1 unless GRM.validate_hr_xml opt[:xml_filename]
|
data/lib/rsmart_toolbox/etl.rb
CHANGED
@@ -297,13 +297,13 @@ module Rsmart::ETL
|
|
297
297
|
} )
|
298
298
|
optparse = OptionParser.new do |opts|
|
299
299
|
opts.banner = "Usage: #{executable} [options] csv_file"
|
300
|
-
opts.on( '-o
|
300
|
+
opts.on( '-o' ,'--output SQL_FILE_OUTPUT', 'The file the SQL data will be writen to... (defaults to <csv_file>.sql)') do |f|
|
301
301
|
opt[:sql_filename] = f
|
302
302
|
end
|
303
|
-
opts.on( '-s
|
303
|
+
opts.on( '-s' ,'--separator SEPARATOR_CHARACTER', 'The character that separates each column of the CSV file.') do |s|
|
304
304
|
opt[:csv_options][:col_sep] = s
|
305
305
|
end
|
306
|
-
opts.on( '-q
|
306
|
+
opts.on( '-q' ,'--quote QUOTE_CHARACTER', 'The character used to quote fields.') do |q|
|
307
307
|
opt[:csv_options][:quote_char] = q
|
308
308
|
end
|
309
309
|
opts.on( '-h', '--help', 'Display this screen' ) do
|
data/rsmart_toolbox.gemspec
CHANGED
@@ -42,7 +42,7 @@ Gem::Specification.new do |spec|
|
|
42
42
|
spec.required_ruby_version = '>= 1.9'
|
43
43
|
spec.add_development_dependency "bundler", "~> 1.6"
|
44
44
|
spec.add_development_dependency "rake", "~> 10.0"
|
45
|
-
spec.add_development_dependency "rspec", "~> 3.0"
|
45
|
+
spec.add_development_dependency "rspec", "~> 3.0.0"
|
46
46
|
# spec.add_development_dependency "simplecov"
|
47
47
|
spec.add_development_dependency "codeclimate-test-reporter"
|
48
48
|
end
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rsmart_toolbox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.12'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lance Speelmon
|
@@ -30,7 +30,7 @@ cert_chain:
|
|
30
30
|
sKRWzEtHFamxQaIspOja5O4oQKiCbWa90fEuIoCtwyy1rQtL9VKoDTs4vZASXNuc
|
31
31
|
F/lEyekXSjN36uTtlt4LkKLn/k7k5gRbt4+C9Q==
|
32
32
|
-----END CERTIFICATE-----
|
33
|
-
date: 2014-
|
33
|
+
date: 2014-10-15 00:00:00.000000000 Z
|
34
34
|
dependencies:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: builder
|
@@ -108,14 +108,14 @@ dependencies:
|
|
108
108
|
requirements:
|
109
109
|
- - "~>"
|
110
110
|
- !ruby/object:Gem::Version
|
111
|
-
version:
|
111
|
+
version: 3.0.0
|
112
112
|
type: :development
|
113
113
|
prerelease: false
|
114
114
|
version_requirements: !ruby/object:Gem::Requirement
|
115
115
|
requirements:
|
116
116
|
- - "~>"
|
117
117
|
- !ruby/object:Gem::Version
|
118
|
-
version:
|
118
|
+
version: 3.0.0
|
119
119
|
- !ruby/object:Gem::Dependency
|
120
120
|
name: codeclimate-test-reporter
|
121
121
|
requirement: !ruby/object:Gem::Requirement
|
@@ -177,7 +177,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
177
177
|
version: '0'
|
178
178
|
requirements: []
|
179
179
|
rubyforge_project:
|
180
|
-
rubygems_version: 2.4.
|
180
|
+
rubygems_version: 2.4.2
|
181
181
|
signing_key:
|
182
182
|
specification_version: 4
|
183
183
|
summary: Client library and command-line tools to help interact with rSmart's cloud
|
metadata.gz.sig
CHANGED
Binary file
|