platidoma 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,9 +2,8 @@ module Platidoma
2
2
 
3
3
  class ClientProxy < ::Weary::Client
4
4
 
5
- post :get_status, "https://pg-test.platidoma.ru/status.php" do |resource|
5
+ post :get_status, "https://#{Platidoma.configuration.host}/status.php" do |resource|
6
6
  resource.required :pd_shop_id, :pd_trans_id, :pd_rnd, :pd_sign
7
-
8
7
  end
9
8
 
10
9
  end
@@ -0,0 +1,10 @@
1
+ module Platidoma
2
+
3
+ class Configuration
4
+
5
+ OPTIONS = [:host].freeze
6
+
7
+ attr_accessor :host
8
+
9
+ end
10
+ end
@@ -1,3 +1,3 @@
1
1
  module Platidoma
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
data/lib/platidoma.rb CHANGED
@@ -7,4 +7,15 @@ module Platidoma
7
7
  autoload 'Client', 'platidoma/client'
8
8
  autoload 'ClientProxy', 'platidoma/client_proxy'
9
9
  autoload 'Response', 'platidoma/response/get_status'
10
+ autoload 'Configuration', 'platidoma/configuration'
11
+
12
+
13
+ def self.configure
14
+ yield(configuration)
15
+ end
16
+
17
+ def self.configuration
18
+ @configuration ||= Configuration.new
19
+ end
20
+
10
21
  end
@@ -2,6 +2,10 @@ require 'test_helper'
2
2
 
3
3
  class ClientTest < TestCase
4
4
  def setup
5
+ Platidoma.configure do |config|
6
+ config.host = 'pg-test.platidoma.ru'
7
+ end
8
+
5
9
  @stub = stub_request(:post, "https://pg-test.platidoma.ru/status.php").
6
10
  with(:headers => {'Accept'=>'*/*', 'User-Agent'=>'Ruby'}).
7
11
  to_return(:status => 200, :body => load_fixture('response.xml'), :headers => {})
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: platidoma
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -76,6 +76,7 @@ files:
76
76
  - lib/platidoma.rb
77
77
  - lib/platidoma/client.rb
78
78
  - lib/platidoma/client_proxy.rb
79
+ - lib/platidoma/configuration.rb
79
80
  - lib/platidoma/response/get_status.rb
80
81
  - lib/platidoma/version.rb
81
82
  - platidoma.gemspec