b2b_center_api 0.0.9 → 0.0.10

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: 62e93111fec7e3b2edd4597f19eda832a993bfb7
4
- data.tar.gz: 2b2937db55aeb22269f3849aca4505897409fb76
3
+ metadata.gz: 6eb31ba452e396f531335ea7373d030f77588acc
4
+ data.tar.gz: 1cd4bd9323c11bde6a8fe6495021f2935243cb09
5
5
  SHA512:
6
- metadata.gz: 5103a9202ae98cc68f78b8c0637edeb6a60334c116d536662b2bc19987e24f887d5273283415a8a4c9324e1e22464b567fddee445c7e9e74be9fe20ddcc12a41
7
- data.tar.gz: d4e161d8f716f1382ff1ac796a8adb311c98bff4e2738962af3ab2dad29510e9593f6bc74dfbd1ffa4cfb76b610797e21869d1a33cafa8bdeb9528df2eb380f8
6
+ metadata.gz: 8303322fece0cf926a6240384ad133efc7019db9e338a0fe3fb9e0b326c4f9caaad87c3cfd7e4d58bf99bd29013a7d5530ba20640bd3228e91e13290014be623
7
+ data.tar.gz: c94337a66a04f11df0fb6aa9225506a42c54648ecd51de848c25b4534051dc805e4a5f2ee046f176711406c51b109b1cdf01bab8cf66dd038d32dcef57585503
data/.rubocop.yml CHANGED
@@ -1,10 +1,19 @@
1
+ AllCops:
2
+ RunRailsCops: false
3
+
1
4
  AsciiComments:
2
5
  Enabled: false
3
6
 
4
- PercentLiteralDelimiters:
7
+ StringLiterals:
8
+ Enabled: false
9
+
10
+ ClassLength:
11
+ Enabled: false
12
+
13
+ MethodLength:
5
14
  Enabled: false
6
15
 
7
- UnneededPercentQ:
16
+ Documentation:
8
17
  Enabled: false
9
18
 
10
19
  LineLength:
@@ -23,4 +23,5 @@ Gem::Specification.new do |spec|
23
23
  spec.add_development_dependency 'rspec'
24
24
 
25
25
  spec.add_dependency 'savon', '~> 2.10.0'
26
+ spec.add_dependency 'socksify'
26
27
  end
@@ -0,0 +1,27 @@
1
+ require 'net/ftp'
2
+ require 'socksify'
3
+ require 'b2b_center_api/settings'
4
+
5
+ module B2bCenterApi
6
+ class Ftp
7
+ class << self
8
+ def open
9
+ setup_socks
10
+ Net::FTP.open(Settings.ftp_options[:host],
11
+ Settings.ftp_options[:user],
12
+ Settings.ftp_options[:password]) do |ftp|
13
+ ftp.passive = true
14
+ yield ftp
15
+ end
16
+ end
17
+
18
+ private
19
+
20
+ def setup_socks
21
+ return if Settings.socks_options.blank?
22
+ TCPSocket::socks_server = Settings.socks_options[:host] if Settings.socks_options[:host]
23
+ TCPSocket::socks_port = Settings.socks_options[:port] if Settings.socks_options[:port]
24
+ end
25
+ end
26
+ end
27
+ end
@@ -3,6 +3,8 @@ module B2bCenterApi
3
3
  class Settings
4
4
  @soap_options = {}
5
5
  @auth_options = {}
6
+ @ftp_options = {}
7
+ @socks_options = {}
6
8
 
7
9
  # Configure through hash
8
10
  def self.soap_configure(opts = {})
@@ -13,8 +15,16 @@ module B2bCenterApi
13
15
  opts.each { |k, v| @auth_options[k.to_sym] = v }
14
16
  end
15
17
 
18
+ def self.ftp_configure(opts = {})
19
+ opts.each { |k, v| @ftp_options[k.to_sym] = v }
20
+ end
21
+
22
+ def self.socks_configure(opts = {})
23
+ opts.each { |k, v| @socks_options[k.to_sym] = v }
24
+ end
25
+
16
26
  class << self
17
- attr_reader :soap_options, :auth_options
27
+ attr_reader :soap_options, :auth_options, :ftp_options, :socks_options
18
28
  end
19
29
  end
20
30
  end
@@ -1,3 +1,3 @@
1
1
  module B2bCenterApi
2
- VERSION = '0.0.9'
2
+ VERSION = '0.0.10'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: b2b_center_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Archakov Aleksandr
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-01 00:00:00.000000000 Z
11
+ date: 2015-09-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: 2.10.0
69
+ - !ruby/object:Gem::Dependency
70
+ name: socksify
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
69
83
  description: API for b2b-center.
70
84
  email:
71
85
  - archakov@gmail.com
@@ -82,6 +96,7 @@ files:
82
96
  - b2b_center_api.gemspec
83
97
  - lib/b2b_center_api.rb
84
98
  - lib/b2b_center_api/client.rb
99
+ - lib/b2b_center_api/ftp.rb
85
100
  - lib/b2b_center_api/remote_auction.rb
86
101
  - lib/b2b_center_api/remote_market.rb
87
102
  - lib/b2b_center_api/remote_tender.rb