kuali_toolbox 0.20 → 0.30
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
- data/bin/transform_CSV_to_HR_XML +7 -7
- data/kuali_toolbox.gemspec +2 -2
- data/lib/kuali_toolbox/etl/grm.rb +1 -0
- data/lib/kuali_toolbox/etl.rb +3 -1
- data/lib/kuali_toolbox/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 564392095ff5166b7637d290d9cc47c252152ec7
|
4
|
+
data.tar.gz: 688dc11bb6e722a1d659343eee03ce09c4de31e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ce2e112072f920778f1dceae3385a772b1d8384aab7f99f9ada956dff1a574ffed4dac121e38132f9fc4f07cd68ca63c31f6f5887312bc2d49a4883bfae448f
|
7
|
+
data.tar.gz: 8fb83d65016d3d23badda6fb57286a394be2c9426e9245d5e15dd31ed22ba01bcf50beee43ef71ff7b7b4f84b3784477ab0c2f1c0925651c48359e904c71ed8a
|
data/bin/transform_CSV_to_HR_XML
CHANGED
@@ -91,9 +91,9 @@ CSV.open(opt[:csv_filename], opt[:csv_options]) do |csv|
|
|
91
91
|
xml = Builder::XmlMarkup.new target: xml_file, indent: 2
|
92
92
|
xml.instruct! :xml, encoding: "UTF-8"
|
93
93
|
xml.hrmanifest "xmlns:xsi" => "http://www.w3.org/2001/XMLSchema-instance",
|
94
|
-
"xsi:schemaLocation" => "https://github.com/KualiCo/ce-tech-docs/tree/master/
|
95
|
-
xmlns: "https://github.com/rSmart/ce-tech-docs/tree/master/
|
96
|
-
schemaVersion: "
|
94
|
+
"xsi:schemaLocation" => "https://github.com/KualiCo/ce-tech-docs/tree/master/v2_0 https://raw.github.com/rSmart/ce-tech-docs/master/v2_0/hrmanifest.xsd",
|
95
|
+
xmlns: "https://github.com/rSmart/ce-tech-docs/tree/master/v2_0",
|
96
|
+
schemaVersion: "2.0",
|
97
97
|
statusEmailRecipient: opt[:email_recipients],
|
98
98
|
reportDate: Time.now.iso8601,
|
99
99
|
recordCount: record_count do |hrmanifest|
|
@@ -226,8 +226,8 @@ CSV.open(opt[:csv_filename], opt[:csv_options]) do |csv|
|
|
226
226
|
school = ETL.parse_string( row[:school], length: 50, name: 'SCHOOL' )
|
227
227
|
year_graduated = GRM.parse_year( row[:year_graduated], name: 'YEAR_GRADUATED' )
|
228
228
|
directory_department = ETL.parse_string( row[:directory_department], length: 30, name: 'DIRECTORY_DEPARTMENT' )
|
229
|
-
directory_title = ETL.parse_string( row[:directory_title], length: 50, name: 'DIRECTORY_TITLE' )
|
230
|
-
primary_title = ETL.parse_string( row[:primary_title], length: 51, name: 'PRIMARY_TITLE' )
|
229
|
+
directory_title = ETL.parse_string( row[:directory_title], length: 50, name: 'DIRECTORY_TITLE', strict: false )
|
230
|
+
primary_title = ETL.parse_string( row[:primary_title], length: 51, name: 'PRIMARY_TITLE', strict: false )
|
231
231
|
vacation_accural = ETL.parse_boolean( row[:vacation_accural], name: 'VACATION_ACCURAL' )
|
232
232
|
is_on_sabbatical = ETL.parse_boolean( row[:is_on_sabbatical], name: 'IS_ON_SABBATICAL' )
|
233
233
|
id_provided = ETL.parse_string( row[:id_provided], length: 30, name: 'ID_PROVIDED' )
|
@@ -275,8 +275,8 @@ CSV.open(opt[:csv_filename], opt[:csv_options]) do |csv|
|
|
275
275
|
salary = ETL.parse_float( row[:salary], length: 15, name: 'SALARY' )
|
276
276
|
appointment_start_date = ETL.parse_string( row[:appointment_start_date], name: 'APPOINTMENT_START_DATE' )
|
277
277
|
appointment_end_date = ETL.parse_string( row[:appointment_end_date], name: 'APPOINTMENT_END_DATE' )
|
278
|
-
job_title = ETL.parse_string( row[:job_title], length: 50, name: 'JOB_TITLE' )
|
279
|
-
prefered_job_title = ETL.parse_string( row[:prefered_job_title], length: 51, name: 'PREFERED_JOB_TITLE' )
|
278
|
+
job_title = ETL.parse_string( row[:job_title], length: 50, name: 'JOB_TITLE', strict: false )
|
279
|
+
prefered_job_title = ETL.parse_string( row[:prefered_job_title], length: 51, name: 'PREFERED_JOB_TITLE', strict: false )
|
280
280
|
ap[:unitNumber] = unit_number unless unit_number.empty?
|
281
281
|
ap[:appointmentType] = appointment_type_code unless appointment_type_code.empty?
|
282
282
|
ap[:jobCode] = job_code unless job_code.empty?
|
data/kuali_toolbox.gemspec
CHANGED
@@ -22,8 +22,8 @@ require 'kuali_toolbox/version'
|
|
22
22
|
Gem::Specification.new do |spec|
|
23
23
|
spec.name = "kuali_toolbox"
|
24
24
|
spec.version = KualiCo::VERSION
|
25
|
-
spec.authors = ["
|
26
|
-
spec.email = ["
|
25
|
+
spec.authors = ["KualiCo"]
|
26
|
+
spec.email = ["dpace@kuali.co"]
|
27
27
|
spec.summary = %q{Client library and command-line tools to help interact with KualiCo's cloud APIs.}
|
28
28
|
# spec.description = %q{TODO: Write a longer description. Optional.}
|
29
29
|
spec.homepage = "http://kualico.github.io/kuali_toolbox/"
|
@@ -312,6 +312,7 @@ module KualiCo::ETL::GRM
|
|
312
312
|
def self.parse_citizenship_type(str, opt={ name: 'CITIZENSHIP_TYPE_CODE', valid_values: /^([1-5])$/ })
|
313
313
|
opt[:name] = "CITIZENSHIP_TYPE_CODE" if opt[:name].nil?
|
314
314
|
opt[:valid_values] = /^([1-5])$/ if opt[:valid_values].nil?
|
315
|
+
opt[:default] = 1
|
315
316
|
return KualiCo::ETL::parse_flag str, opt
|
316
317
|
end
|
317
318
|
|
data/lib/kuali_toolbox/etl.rb
CHANGED
@@ -158,6 +158,7 @@ module KualiCo::ETL
|
|
158
158
|
# @option opt [String, #to_s] :default the default return value if str is empty. Must respond to #to_s
|
159
159
|
# @option opt [Boolean] :escape_single_quotes escape single quote characters.
|
160
160
|
# @option opt [Integer] :length raise a TextParseError if str.length > :length.
|
161
|
+
# @option opt [Boolean] :truncate string if longer than length.
|
161
162
|
# @option opt [String] :name the name of the field being parsed. Used only for error handling.
|
162
163
|
# @option opt [Boolean] :required raise a TextParseError if str is empty.
|
163
164
|
# @option opt [Boolean] :strict strict length checking will produce errors instead of warnings.
|
@@ -187,7 +188,8 @@ module KualiCo::ETL
|
|
187
188
|
if opt[:strict]
|
188
189
|
raise KualiCo::ETL::error TextParseError.new "Data exceeds maximum field length: #{detail}"
|
189
190
|
end
|
190
|
-
KualiCo::ETL::warning "Data will be truncated: #{detail}"
|
191
|
+
puts KualiCo::ETL::warning "Data will be truncated: #{detail}"
|
192
|
+
retval = retval[0..(opt[:length]-1)];
|
191
193
|
end
|
192
194
|
if opt[:valid_values] && ! valid_value(retval, opt[:valid_values], opt)
|
193
195
|
raise KualiCo::ETL::error TextParseError.new "Illegal #{opt[:name]}: value '#{str}' not found in: #{opt[:valid_values]}"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kuali_toolbox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.30'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- KualiCo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-06-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: builder
|
@@ -110,7 +110,7 @@ dependencies:
|
|
110
110
|
version: '0'
|
111
111
|
description:
|
112
112
|
email:
|
113
|
-
-
|
113
|
+
- dpace@kuali.co
|
114
114
|
executables:
|
115
115
|
- transform_CSV_to_HR_XML
|
116
116
|
- validate_HR_XML
|