orion_wholesale 1.0.0 → 1.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0f912eba82356f534ac1e312792ac9e0b97f861f3703ef51c6ed6627259977c8
4
- data.tar.gz: b227ce9f341ea67e794419c5fabfe3e447b76c582968a71cd241bc3195784805
3
+ metadata.gz: 42a25807711abdd8ecb8b79f27d62664c8c91d57f8ddd1e12ed29cb2c7f7c9d2
4
+ data.tar.gz: 746ae5c53c63c05b2b7c058b84b4e704b09a67b28773be729bbbed46c7e9dea3
5
5
  SHA512:
6
- metadata.gz: 8294e49274594cfc604879212042c2451cd5160562800c30eb3ffb1b05aa08369e04a1a31851266f4c7eb7db8d7cf4348c35bf6e258c00eeff3d5a148600856c
7
- data.tar.gz: 9df02007435a308a6649755711d4e75492e370068e189b02bd657b7ffae472ec21cfc77305ca4b25ea6c97de0dc0fe6e5a2625cdbeff0554fbffce38c79c2a7d
6
+ metadata.gz: ae4f799fe6745b7e1903ae4c374322fc412769a40d130dd353088aea108eaaba5ab0289d8514ae7f6b25f6eedeade61c4c752fa96e8b44dfce456cf67621e224
7
+ data.tar.gz: 0f627faa2a35a31bc2056e9ca3eb5e5b911058b24a99a00185534059e45cb0c427c942ea723c253767f9bf7c5e67332f7aebde08cf7d89b98c2be57327f4d975
@@ -1,22 +1,22 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- orion_wholesale (1.0.0)
4
+ orion_wholesale (1.1.3)
5
5
  activesupport (>= 5, < 7)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- activesupport (5.2.4.3)
10
+ activesupport (5.2.4.4)
11
11
  concurrent-ruby (~> 1.0, >= 1.0.2)
12
12
  i18n (>= 0.7, < 2)
13
13
  minitest (~> 5.1)
14
14
  tzinfo (~> 1.1)
15
- concurrent-ruby (1.1.6)
15
+ concurrent-ruby (1.1.7)
16
16
  diff-lcs (1.3)
17
17
  i18n (1.8.5)
18
18
  concurrent-ruby (~> 1.0)
19
- minitest (5.14.1)
19
+ minitest (5.14.2)
20
20
  net-sftp (2.1.2)
21
21
  net-ssh (>= 2.6.5)
22
22
  net-ssh (5.2.0)
@@ -1,14 +1,24 @@
1
1
  module OrionWholesale
2
2
  class User < Base
3
3
 
4
+ USER_DIR = '/ammoready'
5
+ USER_FILENAME_PREFIX = 'orion_ardy_cust_tab'
6
+
4
7
  def initialize(options = {})
5
- requires!(options, :username, :password)
8
+ requires!(options, :username, :password, :account_id)
6
9
  @options = options
7
10
  end
8
11
 
9
12
  def authenticated?
10
- connect(@options) { |ftp| ftp.pwd }
11
- true
13
+ tempfile = get_most_recent_file(USER_FILENAME_PREFIX, USER_DIR)
14
+
15
+ File.open(tempfile).each_with_index do |row, i|
16
+ row = row.split("\t")
17
+
18
+ return true if row[0].strip.downcase == @options[:account_id].strip.downcase
19
+ end
20
+
21
+ false
12
22
  rescue OrionWholesale::NotAuthenticated
13
23
  false
14
24
  end
@@ -1,3 +1,3 @@
1
1
  module OrionWholesale
2
- VERSION = '1.0.0'.freeze
2
+ VERSION = '1.1.3'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: orion_wholesale
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tony Beninate
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-07-29 00:00:00.000000000 Z
11
+ date: 2020-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport