ach_client 0.6.0 → 0.6.1

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
  SHA1:
3
- metadata.gz: 024419d28b691838a97c0b4d39907ce7da9aaeca
4
- data.tar.gz: 888e5e909fa6da9b7b8d58e60e02173b6532d94e
3
+ metadata.gz: 9b69772760ba5db940b5e5a34f96fbc0e10fe90e
4
+ data.tar.gz: d2d61066a1bbfb8b7f85f857feff8addeb390cd4
5
5
  SHA512:
6
- metadata.gz: 8e8ab463cd1335772d997f70c41a67f70e2fef4a54796c14d4a75617203888e6428579f9ea667fe225c5c3310f330e0dc09bb62dee5e7ef9aae725a06016728f
7
- data.tar.gz: b5c93c02b862444be3d7a5f6e76295ddf9254db5de435c2f76aff3efb1bd37aa26480d6bc82bee2ba076f26969e293ed6cac49dae358b7961b20b91033fdfa0b
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
- update_most_recent_check_date(connection: connection)
152
+ update_most_recent_check_date(connection: connection)
141
153
  end
142
- files
154
+ files || []
143
155
  end
144
156
  end
145
157
  end
@@ -1,4 +1,4 @@
1
1
  module AchClient
2
2
  # Increment this when changes are published
3
- VERSION = '0.6.0'
3
+ VERSION = '0.6.1'
4
4
  end
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.0
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-01-27 00:00:00.000000000 Z
11
+ date: 2017-02-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ach