wot_api 1.0.0 → 1.0.1
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 +4 -4
- data/lib/wot_api/base.rb +2 -2
- data/lib/wot_api/version.rb +1 -1
- data/spec/base_spec.rb +9 -1
- data/wot_api.gemspec +2 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f3848e885ae27100115d5dc680fc7e324ab263a3
|
4
|
+
data.tar.gz: fb68c14d09cbdeb8bf949098254f591964cca76a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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})
|
data/lib/wot_api/version.rb
CHANGED
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
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.
|
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-
|
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:
|
164
|
+
version: 1.9.3
|
165
165
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
166
166
|
requirements:
|
167
167
|
- - ">="
|