wow_community_api 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2011 eddie cianci
1
+ Copyright (c) 2011 eddie cianci and contributors (see http://github.com/defeated/wow_community_api/contributors)
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
4
 
@@ -2,6 +2,15 @@
2
2
 
3
3
  A Ruby library for Blizzard's World of Warcraft Community Platform API. <http://blizzard.github.com/api-wow-docs>
4
4
 
5
+ ## Installation
6
+
7
+ `gem install wow_community_api` or if you're using Bundler (of course you're using Bundler), just add
8
+ `gem "wow_community_api"` to your `Gemfile`, then run the `bundle` command!
9
+
10
+ ## Usage
11
+
12
+ TODO
13
+
5
14
  ## Contributing to the WoW Community Platform API Ruby library
6
15
 
7
16
  * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
@@ -12,6 +21,6 @@ A Ruby library for Blizzard's World of Warcraft Community Platform API. <http://
12
21
  * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
13
22
  * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
14
23
 
15
- ## Copyright
24
+ ## License
16
25
 
17
- Copyright (c) 2011 eddie cianci. Released under the MIT license. See LICENSE for further details.
26
+ Copyright (c) 2011 eddie cianci [and contributors](http://github.com/defeated/wow_community_api/contributors). Released under the MIT license. See [LICENSE](https://github.com/defeated/wow_community_api/blob/master/LICENSE) for further details.
@@ -1,6 +1,5 @@
1
1
  require 'httparty'
2
2
  require 'ostruct'
3
- require 'webmock/rspec'
4
3
 
5
4
  require "wow_community_api/version"
6
5
  require "wow_community_api/regions"
@@ -1,3 +1,3 @@
1
1
  module WowCommunityApi
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -2,13 +2,8 @@ require 'spec_helper'
2
2
 
3
3
  describe Character do
4
4
  describe "#find_by_realm_and_name" do
5
- before do
6
- expected_uri = "http://us.battle.net/api/wow/character/uther/malkyth"
7
- expected_body = '{ lastModified: 1310338638000, name: "Malkyth", realm: "Uther", class: 9, race: 5, gender: 0, level: 85, achievementPoints: 10970, thumbnail: "uther/243/6004211-avatar.jpg" }'
8
- stub_request(:get, expected_uri).to_return(:body => expected_body, :headers => { 'Content-Type' => 'application/json' })
9
- end
10
-
11
5
  it "gets character by realm and name" do
6
+ stub_json "http://us.battle.net/api/wow/character/uther/malkyth", 'character.json'
12
7
  character = Character.find_by_realm_and_name("uther", "malkyth")
13
8
  character.name.should == "Malkyth"
14
9
  end
@@ -0,0 +1,11 @@
1
+ {
2
+ lastModified: 1310338638000,
3
+ name: "Malkyth",
4
+ realm: "Uther",
5
+ class: 9,
6
+ race: 5,
7
+ gender: 0,
8
+ level: 85,
9
+ achievementPoints: 10970,
10
+ thumbnail: "uther/243/6004211-avatar.jpg"
11
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ lastModified: 1310345452000,
3
+ name: "Nova",
4
+ realm: "Uther",
5
+ level: 22,
6
+ side: 0,
7
+ achievementPoints: 510
8
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "realms":[
3
+ {
4
+ "type":"pve",
5
+ "queue":false,
6
+ "status":true,
7
+ "population":"medium",
8
+ "name":"Medivh",
9
+ "slug":"medivh"
10
+ }
11
+ ]
12
+ }
data/spec/guild_spec.rb CHANGED
@@ -2,13 +2,8 @@ require 'spec_helper'
2
2
 
3
3
  describe Guild do
4
4
  describe "#find_by_realm_and_name" do
5
- before do
6
- expected_uri = "http://us.battle.net/api/wow/guild/uther/nova"
7
- expected_body = '{ lastModified: 1310345452000, name: "Nova", realm: "Uther", level: 22, side: 0, achievementPoints: 510 }'
8
- stub_request(:get, expected_uri).to_return(:body => expected_body, :headers => { 'Content-Type' => 'application/json' })
9
- end
10
-
11
5
  it "gets guild by realm and name" do
6
+ stub_json 'http://us.battle.net/api/wow/guild/uther/nova', 'guild.json'
12
7
  guild = Guild.find_by_realm_and_name("uther", "nova")
13
8
  guild.name.should == "Nova"
14
9
  end
data/spec/realm_spec.rb CHANGED
@@ -2,13 +2,8 @@ require 'spec_helper'
2
2
 
3
3
  describe Realm do
4
4
  describe "#find_by_name" do
5
- before do
6
- expected_uri = "http://us.battle.net/api/wow/realm/status?realms=medivh"
7
- expected_body = '{ "realms":[{ "type":"pve", "queue":false, "status":true, "population":"medium", "name":"Medivh", "slug":"medivh" }] }'
8
- stub_request(:get, expected_uri).to_return(:body => expected_body, :headers => { 'Content-Type' => 'application/json' })
9
- end
10
-
11
5
  it "gets the status of a realm by name" do
6
+ stub_json 'http://us.battle.net/api/wow/realm/status?realms=medivh', 'realms.json'
12
7
  realm = Realm.find_by_name("medivh")
13
8
  realm.status.should be_true
14
9
  end
data/spec/spec_helper.rb CHANGED
@@ -1,3 +1,9 @@
1
1
  require 'wow_community_api'
2
+ require 'webmock/rspec'
2
3
 
3
4
  include WowCommunityApi
5
+
6
+ def stub_json(uri, filename)
7
+ body = open("spec/fixtures/#{filename}")
8
+ stub_request(:get, uri).to_return(:body => body, :headers => { 'Content-Type' => 'application/json' })
9
+ end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: wow_community_api
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.1
5
+ version: 0.0.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - eddie cianci
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-07-11 00:00:00 Z
13
+ date: 2011-07-18 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: httparty
@@ -60,7 +60,7 @@ files:
60
60
  - .rspec
61
61
  - Gemfile
62
62
  - LICENSE
63
- - README.mdown
63
+ - README.md
64
64
  - Rakefile
65
65
  - lib/wow_community_api.rb
66
66
  - lib/wow_community_api/battle_net.rb
@@ -71,6 +71,9 @@ files:
71
71
  - lib/wow_community_api/version.rb
72
72
  - spec/battle_net_spec.rb
73
73
  - spec/character_spec.rb
74
+ - spec/fixtures/character.json
75
+ - spec/fixtures/guild.json
76
+ - spec/fixtures/realms.json
74
77
  - spec/guild_spec.rb
75
78
  - spec/realm_spec.rb
76
79
  - spec/regions_spec.rb
@@ -106,6 +109,9 @@ summary: World of Warcraft Community Platform API
106
109
  test_files:
107
110
  - spec/battle_net_spec.rb
108
111
  - spec/character_spec.rb
112
+ - spec/fixtures/character.json
113
+ - spec/fixtures/guild.json
114
+ - spec/fixtures/realms.json
109
115
  - spec/guild_spec.rb
110
116
  - spec/realm_spec.rb
111
117
  - spec/regions_spec.rb