rsr_group 2.1.6 → 2.2.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/order.rb +16 -1
- data/lib/rsr_group/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: 467740abf8326fecad3f20cc809ef42cb313e0b3
|
4
|
+
data.tar.gz: e26c64746fe87e2cb0d98067b6811a5813771c8e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 948d5d2cead337fc4461473b044acc4b11e48fe877bdd09a96a7cd0ea4018dde67233180dbf8e11e3d0a52657118cd69bc6b3e36a9f4e73bd67e25e4f68be701
|
7
|
+
data.tar.gz: bed5c06fbbbb07c500bfccab57b17c086ff23b19c9761e1671fdc0255ef7ed6cf723512905c44918f9af4540f6cc3358f840b4c6a18395f5a5c144e702f331a0
|
data/lib/rsr_group/order.rb
CHANGED
@@ -7,6 +7,17 @@ module RsrGroup
|
|
7
7
|
# * Call {#submit!} to send the order
|
8
8
|
class Order < Base
|
9
9
|
|
10
|
+
class ResponseStruct < Struct.new(:success, :message, :data)
|
11
|
+
|
12
|
+
# Simple response object to pass along success/falure/messages of any process
|
13
|
+
# Usage:
|
14
|
+
# response = ResponseStruct.new(true)
|
15
|
+
# response = ResponseStruct.new(false, "You did the wrong thing")
|
16
|
+
# response = ResponseStruct.new(true, nil, { result: 200 })
|
17
|
+
|
18
|
+
alias success? success
|
19
|
+
end
|
20
|
+
|
10
21
|
# @param [Hash] options
|
11
22
|
# @option options [String] :merchant_number *required*
|
12
23
|
# @option options [Integer] :sequence_number *required*
|
@@ -87,12 +98,16 @@ module RsrGroup
|
|
87
98
|
io = StringIO.new(to_txt)
|
88
99
|
begin
|
89
100
|
ftp.storlines("STOR " + filename, io)
|
101
|
+
success = ftp.nlst.include?(filename)
|
102
|
+
@response = ResponseStruct.new(success, nil, modified: ftp.mtime(filename), size: ftp.size(filename))
|
90
103
|
ensure
|
91
104
|
io.close
|
92
105
|
end
|
93
106
|
ftp.close
|
94
107
|
end
|
95
|
-
|
108
|
+
@response || ResponseStruct.new(false)
|
109
|
+
rescue Net::FTPPermError => e
|
110
|
+
return ResponseStruct.new(false, e.message.chomp)
|
96
111
|
end
|
97
112
|
|
98
113
|
private
|
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.2.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-04-
|
11
|
+
date: 2018-04-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: smarter_csv
|