ach_client 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ach_client/providers/sftp/ach_status_checker.rb +15 -3
- data/lib/ach_client/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b69772760ba5db940b5e5a34f96fbc0e10fe90e
|
4
|
+
data.tar.gz: d2d61066a1bbfb8b7f85f857feff8addeb390cd4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f1c25889b39ddc37490d764623c0f009345de7471286d44c15ecaed61d9c3af7678ec381dc81eac55eb7f7727b929ae44a984f0618f1e08027418f777d00798
|
7
|
+
data.tar.gz: 3efbb4b67303d23ff41e075f7c20511d9416c91d9dc1c4d6e3fbd2cfbf28d37da751ca115ee4e11735e3c51ffc696b4875c6dd5042f23e452e1fbc57ed162efa
|
@@ -99,7 +99,7 @@ module AchClient
|
|
99
99
|
# Get info on all files - equivalent to `ls`
|
100
100
|
connection.dir.entries(self.parent.incoming_path)
|
101
101
|
.select do |file|
|
102
|
-
last_modified_time = Time.at(file.attributes.mtime)
|
102
|
+
last_modified_time = Time.at(file.attributes.mtime) - 1.minute
|
103
103
|
# Filter to files modified in date range
|
104
104
|
last_modified_time > start_date && (
|
105
105
|
!end_date || last_modified_time < end_date
|
@@ -121,6 +121,18 @@ module AchClient
|
|
121
121
|
'r'
|
122
122
|
).read
|
123
123
|
DateTime.parse(most_recent_string)
|
124
|
+
rescue Net::SFTP::StatusException => e
|
125
|
+
# If code is 2 ("no such file"), then we need to create the file
|
126
|
+
# otherwise, something else went wrong and the exception should
|
127
|
+
# bubble up
|
128
|
+
if e.code == 2
|
129
|
+
# Create the file and write the current date
|
130
|
+
update_most_recent_check_date(connection: connection)
|
131
|
+
# Return the earliest possible date as the last check
|
132
|
+
Time.at(0).to_datetime
|
133
|
+
else
|
134
|
+
raise e
|
135
|
+
end
|
124
136
|
end
|
125
137
|
|
126
138
|
# Leave file with last grabbed date
|
@@ -137,9 +149,9 @@ module AchClient
|
|
137
149
|
connection: connection,
|
138
150
|
start_date: last_most_recent_check_date(connection: connection)
|
139
151
|
)
|
140
|
-
|
152
|
+
update_most_recent_check_date(connection: connection)
|
141
153
|
end
|
142
|
-
files
|
154
|
+
files || []
|
143
155
|
end
|
144
156
|
end
|
145
157
|
end
|
data/lib/ach_client/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ach_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Zach Cotter
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-02-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ach
|