wot_api 1.0.0 → 1.0.1

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
  SHA1:
3
- metadata.gz: 4586e3de28e0bacf291c1cbe01b18ff30fc2ace9
4
- data.tar.gz: 0cd304b95e69d48dc12509c91fd5b1496787423e
3
+ metadata.gz: f3848e885ae27100115d5dc680fc7e324ab263a3
4
+ data.tar.gz: fb68c14d09cbdeb8bf949098254f591964cca76a
5
5
  SHA512:
6
- metadata.gz: 43d4e887e6524d6671567387d364e317869f2d8fdfb6f4971154a07aced1e0bc9691aa7f00252657243b2737907b32326d1a465a2ab7a4e513e5b1c368fef79f
7
- data.tar.gz: 513b084b8a91ca13d245da5953f85692145b1de7f3ec9ee90ae66bc27f3abef0e2a8ba0cb80f25d5915f1aff684389ef5833bd79e4a09328038bedce6e79989b
6
+ metadata.gz: 0c57b498ddc1c262d9bf97d6912da17f6e7cffa4ba611b1e3f292a57706b7431966c172b02003fee6ed6e95623aa6179469f526a456068bd54d901961385de8e
7
+ data.tar.gz: a16f470099150997d5e45251efe6994bf6556684683c2d2e63ab8c5d42fd54d35a3452e6eab47b6fd643cc9c86a9e36f9a011566d764c70e7294b34fc1cfaf7a
data/lib/wot_api/base.rb CHANGED
@@ -78,8 +78,8 @@ module WotApi
78
78
  else
79
79
  config = @configuration[@default_region]
80
80
  end
81
- base_uri = config[:base_uri]
82
- application_id = config[:application_id]
81
+ base_uri = config[:base_uri] rescue nil
82
+ application_id = config[:application_id] rescue nil
83
83
  raise WotApi::InvalidRegionError unless base_uri && application_id
84
84
  self.base_uri base_uri
85
85
  params.merge({application_id: application_id})
@@ -1,3 +1,3 @@
1
1
  module WotApi
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
data/spec/base_spec.rb CHANGED
@@ -71,7 +71,7 @@ describe WotApi::Base do
71
71
  end
72
72
 
73
73
  describe ".merged_params" do
74
- context "with a region parameter" do
74
+ context "with a valid region parameter" do
75
75
  it "merges the params hash argument with the application_id from the specified region" do
76
76
  arguments = {a: 'hi', b: 'test', c: 3, region: 'na'}
77
77
  WotApi::Base.config(na: 'abc123')
@@ -79,6 +79,14 @@ describe WotApi::Base do
79
79
  end
80
80
  end
81
81
 
82
+ context "with an invalid region parameter" do
83
+ it "raises an exception" do
84
+ arguments = {a: 'hi', b: 'test', c: 3, region: 'banana'}
85
+ WotApi::Base.config(na: 'abc123')
86
+ expect{WotApi::Base.merged_params(arguments)}.to raise_error
87
+ end
88
+ end
89
+
82
90
  context "with no region parameter" do
83
91
  it "merges the params hash argument with the application_id from the default first region" do
84
92
  arguments = {a: 'hi', b: 'test', c: 3}
data/wot_api.gemspec CHANGED
@@ -27,4 +27,6 @@ Gem::Specification.new do |spec|
27
27
  spec.add_runtime_dependency "httparty", "~> 0.13"
28
28
 
29
29
  spec.requirements << "Application ID(s) from Wargaming developers portal."
30
+
31
+ spec.required_ruby_version = '>= 1.9.3'
30
32
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wot_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jesse Cantara
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-06 00:00:00.000000000 Z
11
+ date: 2014-08-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -161,7 +161,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
161
161
  requirements:
162
162
  - - ">="
163
163
  - !ruby/object:Gem::Version
164
- version: '0'
164
+ version: 1.9.3
165
165
  required_rubygems_version: !ruby/object:Gem::Requirement
166
166
  requirements:
167
167
  - - ">="