mywowarmory-ruby 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +4 -0
- data/Gemfile.lock +7 -0
- data/VERSION +1 -1
- data/lib/mywowarmory.rb +2 -1
- data/mywowarmory-ruby.gemspec +13 -1
- data/test/test_mywowarmory.rb +2 -9
- metadata +69 -13
data/Gemfile
CHANGED
@@ -4,6 +4,10 @@ source "http://rubygems.org"
|
|
4
4
|
# gem "activesupport", ">= 2.3.5"
|
5
5
|
gem 'httparty'
|
6
6
|
gem 'wow_community_api'
|
7
|
+
gem 'multi_json'
|
8
|
+
gem 'yajl-ruby'
|
9
|
+
gem 'json'
|
10
|
+
gem 'json_pure'
|
7
11
|
|
8
12
|
# Add dependencies to develop your gem here.
|
9
13
|
# Include everything needed to run rake, tests, features, etc.
|
data/Gemfile.lock
CHANGED
@@ -13,6 +13,8 @@ GEM
|
|
13
13
|
bundler (~> 1.0)
|
14
14
|
git (>= 1.2.5)
|
15
15
|
rake
|
16
|
+
json (1.6.1)
|
17
|
+
json_pure (1.6.0)
|
16
18
|
multi_json (1.0.3)
|
17
19
|
rake (0.9.2)
|
18
20
|
rcov (0.9.9)
|
@@ -23,6 +25,7 @@ GEM
|
|
23
25
|
hash-to-ostruct
|
24
26
|
httparty
|
25
27
|
i18n
|
28
|
+
yajl-ruby (0.8.2)
|
26
29
|
|
27
30
|
PLATFORMS
|
28
31
|
ruby
|
@@ -31,7 +34,11 @@ DEPENDENCIES
|
|
31
34
|
bundler (~> 1.0.0)
|
32
35
|
httparty
|
33
36
|
jeweler (~> 1.6.4)
|
37
|
+
json
|
38
|
+
json_pure
|
39
|
+
multi_json
|
34
40
|
rcov
|
35
41
|
rdoc
|
36
42
|
shoulda
|
37
43
|
wow_community_api
|
44
|
+
yajl-ruby
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.4
|
data/lib/mywowarmory.rb
CHANGED
@@ -2,6 +2,7 @@ require 'httparty'
|
|
2
2
|
require 'ostruct'
|
3
3
|
require 'open-uri'
|
4
4
|
require 'wow_community_api'
|
5
|
+
require 'multi_json'
|
5
6
|
|
6
7
|
class MyWoWArmory
|
7
8
|
include HTTParty
|
@@ -20,7 +21,7 @@ class MyWoWArmory
|
|
20
21
|
realm = WowCommunityApi::Realm.find_by_name(realm).slug
|
21
22
|
|
22
23
|
options.merge!(:query => {:name => character_name, :server => realm, :country => country})
|
23
|
-
self.class.get("/api/getprofile.php", options).parsed_response
|
24
|
+
MultiJson.decode(self.class.get("/api/getprofile.php", options).parsed_response)
|
24
25
|
end
|
25
26
|
class Profile < OpenStruct
|
26
27
|
end
|
data/mywowarmory-ruby.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{mywowarmory-ruby}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.4"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Benjamin Wong"]
|
@@ -42,6 +42,10 @@ Gem::Specification.new do |s|
|
|
42
42
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
43
43
|
s.add_runtime_dependency(%q<httparty>, [">= 0"])
|
44
44
|
s.add_runtime_dependency(%q<wow_community_api>, [">= 0"])
|
45
|
+
s.add_runtime_dependency(%q<multi_json>, [">= 0"])
|
46
|
+
s.add_runtime_dependency(%q<yajl-ruby>, [">= 0"])
|
47
|
+
s.add_runtime_dependency(%q<json>, [">= 0"])
|
48
|
+
s.add_runtime_dependency(%q<json_pure>, [">= 0"])
|
45
49
|
s.add_development_dependency(%q<shoulda>, [">= 0"])
|
46
50
|
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
|
47
51
|
s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
|
@@ -50,6 +54,10 @@ Gem::Specification.new do |s|
|
|
50
54
|
else
|
51
55
|
s.add_dependency(%q<httparty>, [">= 0"])
|
52
56
|
s.add_dependency(%q<wow_community_api>, [">= 0"])
|
57
|
+
s.add_dependency(%q<multi_json>, [">= 0"])
|
58
|
+
s.add_dependency(%q<yajl-ruby>, [">= 0"])
|
59
|
+
s.add_dependency(%q<json>, [">= 0"])
|
60
|
+
s.add_dependency(%q<json_pure>, [">= 0"])
|
53
61
|
s.add_dependency(%q<shoulda>, [">= 0"])
|
54
62
|
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
55
63
|
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
@@ -59,6 +67,10 @@ Gem::Specification.new do |s|
|
|
59
67
|
else
|
60
68
|
s.add_dependency(%q<httparty>, [">= 0"])
|
61
69
|
s.add_dependency(%q<wow_community_api>, [">= 0"])
|
70
|
+
s.add_dependency(%q<multi_json>, [">= 0"])
|
71
|
+
s.add_dependency(%q<yajl-ruby>, [">= 0"])
|
72
|
+
s.add_dependency(%q<json>, [">= 0"])
|
73
|
+
s.add_dependency(%q<json_pure>, [">= 0"])
|
62
74
|
s.add_dependency(%q<shoulda>, [">= 0"])
|
63
75
|
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
64
76
|
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
data/test/test_mywowarmory.rb
CHANGED
@@ -13,14 +13,7 @@ class TestMywowarmory < Test::Unit::TestCase
|
|
13
13
|
puts response.inspect
|
14
14
|
response = api.get_profile("us", "Mal'Ganis", 'gary')
|
15
15
|
puts response.inspect
|
16
|
-
|
17
|
-
|
18
|
-
# require 'uri'
|
19
|
-
# string = 'Iñtërnâtiônàlizætiøn'
|
20
|
-
# puts URI.encode(string)
|
21
|
-
# puts URI.escape(string, Regexp.new("[^#{URI::PATTERN::UNRESERVED}]"))
|
22
|
-
# puts URI.escape(string.force_encoding('ascii'))
|
23
|
-
# puts CGI.escape(string)
|
24
|
-
# assert(response.path)
|
16
|
+
response = api.get_profile("us", "Kel'Thuzad", 'Chaoticblade')
|
17
|
+
puts response.inspect
|
25
18
|
end
|
26
19
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mywowarmory-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 4
|
10
|
+
version: 0.1.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Benjamin Wong
|
@@ -48,8 +48,8 @@ dependencies:
|
|
48
48
|
requirement: *id002
|
49
49
|
- !ruby/object:Gem::Dependency
|
50
50
|
prerelease: false
|
51
|
-
type: :
|
52
|
-
name:
|
51
|
+
type: :runtime
|
52
|
+
name: multi_json
|
53
53
|
version_requirements: &id003 !ruby/object:Gem::Requirement
|
54
54
|
none: false
|
55
55
|
requirements:
|
@@ -60,11 +60,67 @@ dependencies:
|
|
60
60
|
- 0
|
61
61
|
version: "0"
|
62
62
|
requirement: *id003
|
63
|
+
- !ruby/object:Gem::Dependency
|
64
|
+
prerelease: false
|
65
|
+
type: :runtime
|
66
|
+
name: yajl-ruby
|
67
|
+
version_requirements: &id004 !ruby/object:Gem::Requirement
|
68
|
+
none: false
|
69
|
+
requirements:
|
70
|
+
- - ">="
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
hash: 3
|
73
|
+
segments:
|
74
|
+
- 0
|
75
|
+
version: "0"
|
76
|
+
requirement: *id004
|
77
|
+
- !ruby/object:Gem::Dependency
|
78
|
+
prerelease: false
|
79
|
+
type: :runtime
|
80
|
+
name: json
|
81
|
+
version_requirements: &id005 !ruby/object:Gem::Requirement
|
82
|
+
none: false
|
83
|
+
requirements:
|
84
|
+
- - ">="
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
hash: 3
|
87
|
+
segments:
|
88
|
+
- 0
|
89
|
+
version: "0"
|
90
|
+
requirement: *id005
|
91
|
+
- !ruby/object:Gem::Dependency
|
92
|
+
prerelease: false
|
93
|
+
type: :runtime
|
94
|
+
name: json_pure
|
95
|
+
version_requirements: &id006 !ruby/object:Gem::Requirement
|
96
|
+
none: false
|
97
|
+
requirements:
|
98
|
+
- - ">="
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
hash: 3
|
101
|
+
segments:
|
102
|
+
- 0
|
103
|
+
version: "0"
|
104
|
+
requirement: *id006
|
105
|
+
- !ruby/object:Gem::Dependency
|
106
|
+
prerelease: false
|
107
|
+
type: :development
|
108
|
+
name: shoulda
|
109
|
+
version_requirements: &id007 !ruby/object:Gem::Requirement
|
110
|
+
none: false
|
111
|
+
requirements:
|
112
|
+
- - ">="
|
113
|
+
- !ruby/object:Gem::Version
|
114
|
+
hash: 3
|
115
|
+
segments:
|
116
|
+
- 0
|
117
|
+
version: "0"
|
118
|
+
requirement: *id007
|
63
119
|
- !ruby/object:Gem::Dependency
|
64
120
|
prerelease: false
|
65
121
|
type: :development
|
66
122
|
name: bundler
|
67
|
-
version_requirements: &
|
123
|
+
version_requirements: &id008 !ruby/object:Gem::Requirement
|
68
124
|
none: false
|
69
125
|
requirements:
|
70
126
|
- - ~>
|
@@ -75,12 +131,12 @@ dependencies:
|
|
75
131
|
- 0
|
76
132
|
- 0
|
77
133
|
version: 1.0.0
|
78
|
-
requirement: *
|
134
|
+
requirement: *id008
|
79
135
|
- !ruby/object:Gem::Dependency
|
80
136
|
prerelease: false
|
81
137
|
type: :development
|
82
138
|
name: jeweler
|
83
|
-
version_requirements: &
|
139
|
+
version_requirements: &id009 !ruby/object:Gem::Requirement
|
84
140
|
none: false
|
85
141
|
requirements:
|
86
142
|
- - ~>
|
@@ -91,12 +147,12 @@ dependencies:
|
|
91
147
|
- 6
|
92
148
|
- 4
|
93
149
|
version: 1.6.4
|
94
|
-
requirement: *
|
150
|
+
requirement: *id009
|
95
151
|
- !ruby/object:Gem::Dependency
|
96
152
|
prerelease: false
|
97
153
|
type: :development
|
98
154
|
name: rcov
|
99
|
-
version_requirements: &
|
155
|
+
version_requirements: &id010 !ruby/object:Gem::Requirement
|
100
156
|
none: false
|
101
157
|
requirements:
|
102
158
|
- - ">="
|
@@ -105,12 +161,12 @@ dependencies:
|
|
105
161
|
segments:
|
106
162
|
- 0
|
107
163
|
version: "0"
|
108
|
-
requirement: *
|
164
|
+
requirement: *id010
|
109
165
|
- !ruby/object:Gem::Dependency
|
110
166
|
prerelease: false
|
111
167
|
type: :development
|
112
168
|
name: rdoc
|
113
|
-
version_requirements: &
|
169
|
+
version_requirements: &id011 !ruby/object:Gem::Requirement
|
114
170
|
none: false
|
115
171
|
requirements:
|
116
172
|
- - ">="
|
@@ -119,7 +175,7 @@ dependencies:
|
|
119
175
|
segments:
|
120
176
|
- 0
|
121
177
|
version: "0"
|
122
|
-
requirement: *
|
178
|
+
requirement: *id011
|
123
179
|
description: "This library uses HTTParty to provide simple, reliable access to the MyWoWArmory API. Good for building reporting scripts and simple apps. Note that this library does not support the complete MyWoWArmory API at this time. See Features/Issues below for details. "
|
124
180
|
email: tkwong@railsant.com
|
125
181
|
executables: []
|