rsr_group 2.2.1 → 2.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rsr_group/response_file.rb +26 -6
- data/lib/rsr_group/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6f09fece5c75d3d9d1304a2d8fbc7d4c60eb2b0c
|
4
|
+
data.tar.gz: 9f0d50ae67fd3b89d4c3bd20293ab05a4d63e111
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 477a47be32795c951af6483f39a2c814ea35b8bfcf3736fdb7bd1338f1e96819aa4eb87c0739b30d60f24f1ebe6e288f8e95a19bb4de241b5c0d4d39a358fb09
|
7
|
+
data.tar.gz: 661cce484e55dd430d658952a8275408fa347ac25455e370c6e80f24e10815d8c7297cb0e77a08e2785d87961d65d7877df9876f10095614dd55aebc4ecf393d
|
@@ -1,9 +1,8 @@
|
|
1
1
|
module RsrGroup
|
2
2
|
class ResponseFile < Base
|
3
3
|
|
4
|
-
attr_reader :content
|
5
4
|
attr_reader :filename
|
6
|
-
|
5
|
+
attr_accessor :content, :mtime
|
7
6
|
|
8
7
|
def initialize(options = {})
|
9
8
|
requires!(options, :username, :password, :filename)
|
@@ -17,6 +16,26 @@ module RsrGroup
|
|
17
16
|
define_method("#{value.downcase}?".to_sym) do
|
18
17
|
response_type == value
|
19
18
|
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.get_each(options = {}, &block)
|
22
|
+
requires!(options, :username, :password)
|
23
|
+
|
24
|
+
Base.connect(options) do |ftp|
|
25
|
+
ftp.chdir(RsrGroup.config.response_dir)
|
26
|
+
|
27
|
+
@list = ftp.nlst("*.txt")
|
28
|
+
@list.each do |file|
|
29
|
+
resource = new(options.merge(filename: file))
|
30
|
+
resource.content = ftp.gettextfile(file, nil)
|
31
|
+
resource.mtime = ftp.mtime(file)
|
32
|
+
yield(resource)
|
33
|
+
end
|
34
|
+
|
35
|
+
ftp.close
|
36
|
+
end
|
37
|
+
|
38
|
+
@list
|
20
39
|
end
|
21
40
|
|
22
41
|
def self.all(options = {})
|
@@ -35,8 +54,8 @@ module RsrGroup
|
|
35
54
|
return @content if @content
|
36
55
|
connect(@credentials) do |ftp|
|
37
56
|
ftp.chdir(RsrGroup.config.response_dir)
|
38
|
-
|
39
|
-
@content
|
57
|
+
@mtime = ftp.mtime(@filename)
|
58
|
+
@content = ftp.gettextfile(@filename, nil)
|
40
59
|
ftp.close
|
41
60
|
end
|
42
61
|
end
|
@@ -55,9 +74,11 @@ module RsrGroup
|
|
55
74
|
|
56
75
|
@json = {
|
57
76
|
response_type: response_type,
|
58
|
-
identifier: @content.lines[1].split(";")[0],
|
59
77
|
filename: @filename,
|
60
78
|
account_number: @account_number,
|
79
|
+
rsr_order_number: nil,
|
80
|
+
details: [],
|
81
|
+
errors: [],
|
61
82
|
}
|
62
83
|
|
63
84
|
return parse_eerr if error?
|
@@ -94,7 +115,6 @@ module RsrGroup
|
|
94
115
|
end.compact
|
95
116
|
|
96
117
|
@json.merge!({
|
97
|
-
rsr_order_number: @content.lines[0].split(";")[3].chomp,
|
98
118
|
details: details
|
99
119
|
})
|
100
120
|
end
|
data/lib/rsr_group/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rsr_group
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dale Campbell
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-05-
|
11
|
+
date: 2018-05-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: smarter_csv
|
@@ -135,7 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
135
135
|
version: '0'
|
136
136
|
requirements: []
|
137
137
|
rubyforge_project:
|
138
|
-
rubygems_version: 2.
|
138
|
+
rubygems_version: 2.6.12
|
139
139
|
signing_key:
|
140
140
|
specification_version: 4
|
141
141
|
summary: RSR Group Ruby library
|