wow 0.0.1 → 0.0.2
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/wow/base.rb +3 -0
- data/lib/wow/features/achievement.rb +0 -1
- data/lib/wow/features/battle_pet.rb +0 -3
- data/lib/wow/features/challenge_mode.rb +1 -2
- data/lib/wow/features/character_profile.rb +2 -2
- data/lib/wow/features/guild.rb +0 -1
- data/lib/wow/features/item.rb +0 -1
- data/lib/wow/features/leaderboard.rb +0 -1
- data/lib/wow/features/quest.rb +0 -1
- data/lib/wow/features/recipe.rb +0 -1
- data/lib/wow/features/spell.rb +0 -1
- data/lib/wow/version.rb +1 -1
- data/spec/features/character_profile_spec.rb +50 -0
- data/spec/spec_helper.rb +8 -0
- metadata +7 -3
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: a459381f372b915a5ef250d8d89e7b0b6efa5f4b
         | 
| 4 | 
            +
              data.tar.gz: 83d7cd9c31aceb3a72833b46861167ddb0d676aa
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 4ab1380abba450a73d3915866b1661ea3623ec2e861df3916d3d11af7e6986b60d8f65d8ccf0b7010c03a038044a6903c25fb082aa9a971c5011bde26cb73d94
         | 
| 7 | 
            +
              data.tar.gz: 67d43dbfbb9d9cbcc1af64c86afc57f73d83b540d23c83bae172306e6486e4c62d0780fd2bdf39d195ba439af657e143cfaa09c7ae4fa6545ddd884246c207b1
         | 
    
        data/lib/wow/base.rb
    CHANGED
    
    
| @@ -2,7 +2,6 @@ module WoW | |
| 2 2 | 
             
              module BattlePet
         | 
| 3 3 |  | 
| 4 4 | 
             
                class Ability < Base
         | 
| 5 | 
            -
                  include HTTParty
         | 
| 6 5 | 
             
                  base_uri "#{WoW.host}/api/wow/battlePet/ability"
         | 
| 7 6 |  | 
| 8 7 | 
             
                  def initialize(id, params = {})
         | 
| @@ -18,7 +17,6 @@ module WoW | |
| 18 17 | 
             
                end
         | 
| 19 18 |  | 
| 20 19 | 
             
                class Species < Base
         | 
| 21 | 
            -
                  include HTTParty
         | 
| 22 20 | 
             
                  base_uri "#{WoW.host}/api/wow/battlePet/species"
         | 
| 23 21 |  | 
| 24 22 | 
             
                  def initialize(id, params = {})
         | 
| @@ -34,7 +32,6 @@ module WoW | |
| 34 32 | 
             
                end
         | 
| 35 33 |  | 
| 36 34 | 
             
                class Stats < Base
         | 
| 37 | 
            -
                  include HTTParty
         | 
| 38 35 | 
             
                  base_uri "#{WoW.host}/api/wow/battlePet/stats"
         | 
| 39 36 |  | 
| 40 37 | 
             
                  # This API accepts optional parameters.
         | 
| @@ -14,7 +14,6 @@ module WoW | |
| 14 14 | 
             
                  11 => :druid,
         | 
| 15 15 | 
             
                }
         | 
| 16 16 |  | 
| 17 | 
            -
                include HTTParty
         | 
| 18 17 | 
             
                base_uri "#{WoW.host}/api/wow/character"
         | 
| 19 18 |  | 
| 20 19 | 
             
                def initialize(realm, character_name, fields = [], params = {})
         | 
| @@ -34,7 +33,8 @@ module WoW | |
| 34 33 | 
             
                class << self
         | 
| 35 34 | 
             
                  def data(realm, character_name, params = {})
         | 
| 36 35 | 
             
                    params.merge!({locale: WoW.locale})
         | 
| 37 | 
            -
                    get("/#{realm}/#{character_name}", | 
| 36 | 
            +
                    get("/#{CGI::escape(realm)}/#{CGI::escape(character_name)}",
         | 
| 37 | 
            +
                      query: params).parsed_response
         | 
| 38 38 | 
             
                  end
         | 
| 39 39 | 
             
                end
         | 
| 40 40 | 
             
              end
         | 
    
        data/lib/wow/features/guild.rb
    CHANGED
    
    
    
        data/lib/wow/features/item.rb
    CHANGED
    
    
    
        data/lib/wow/features/quest.rb
    CHANGED
    
    
    
        data/lib/wow/features/recipe.rb
    CHANGED
    
    
    
        data/lib/wow/features/spell.rb
    CHANGED
    
    
    
        data/lib/wow/version.rb
    CHANGED
    
    
| @@ -0,0 +1,50 @@ | |
| 1 | 
            +
            require "spec_helper"
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            describe WoW::CharacterProfile do
         | 
| 4 | 
            +
              subject { WoW::CharacterProfile.new("Stormreaver", "Epicgrim") }
         | 
| 5 | 
            +
             | 
| 6 | 
            +
              describe "#initialize" do
         | 
| 7 | 
            +
                it "is valid server, and name" do
         | 
| 8 | 
            +
                  expect {
         | 
| 9 | 
            +
                    subject
         | 
| 10 | 
            +
                  }.not_to raise_error
         | 
| 11 | 
            +
                end
         | 
| 12 | 
            +
             | 
| 13 | 
            +
                it "is valid with special characters in name" do
         | 
| 14 | 
            +
                  expect {
         | 
| 15 | 
            +
                    WoW::CharacterProfile.new("Stormreaver", "Disciplíne")
         | 
| 16 | 
            +
                  }.not_to raise_error
         | 
| 17 | 
            +
                end
         | 
| 18 | 
            +
             | 
| 19 | 
            +
                it "is invalid server" do
         | 
| 20 | 
            +
                  expect {
         | 
| 21 | 
            +
                    WoW::CharacterProfile.new("Notaserver", "Epicgrim")
         | 
| 22 | 
            +
                  }.to raise_error
         | 
| 23 | 
            +
                end
         | 
| 24 | 
            +
             | 
| 25 | 
            +
                it "is invalid name" do
         | 
| 26 | 
            +
                  expect {
         | 
| 27 | 
            +
                    WoW::CharacterProfile.new("Stormreaver", "Imnotaguyatalllolplz")
         | 
| 28 | 
            +
                  }.to raise_error
         | 
| 29 | 
            +
                end
         | 
| 30 | 
            +
             | 
| 31 | 
            +
                it "is invalid server and name" do
         | 
| 32 | 
            +
                  expect {
         | 
| 33 | 
            +
                    WoW::CharacterProfile.new("Notaserver", "Imnotaguyatalllolplz")
         | 
| 34 | 
            +
                  }.to raise_error
         | 
| 35 | 
            +
                end
         | 
| 36 | 
            +
              end
         | 
| 37 | 
            +
             | 
| 38 | 
            +
              describe "#lookup" do
         | 
| 39 | 
            +
                it "looks up class" do
         | 
| 40 | 
            +
                  subject.lookup(:class).should eq(:druid)
         | 
| 41 | 
            +
                end
         | 
| 42 | 
            +
              end
         | 
| 43 | 
            +
             | 
| 44 | 
            +
              describe "#[]" do
         | 
| 45 | 
            +
                it "acts as a hash" do
         | 
| 46 | 
            +
                  subject[:name].should eq("Epicgrim")
         | 
| 47 | 
            +
                end
         | 
| 48 | 
            +
              end
         | 
| 49 | 
            +
             | 
| 50 | 
            +
            end
         | 
    
        data/spec/spec_helper.rb
    ADDED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: wow
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.0. | 
| 4 | 
            +
              version: 0.0.2
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Nathan Lilienthal
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2014-01- | 
| 11 | 
            +
            date: 2014-01-22 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: bundler
         | 
| @@ -92,6 +92,8 @@ files: | |
| 92 92 | 
             
            - lib/wow/features/recipe.rb
         | 
| 93 93 | 
             
            - lib/wow/features/spell.rb
         | 
| 94 94 | 
             
            - lib/wow/version.rb
         | 
| 95 | 
            +
            - spec/features/character_profile_spec.rb
         | 
| 96 | 
            +
            - spec/spec_helper.rb
         | 
| 95 97 | 
             
            - wow.gemspec
         | 
| 96 98 | 
             
            homepage: https://github.com/nixpulvis/wow
         | 
| 97 99 | 
             
            licenses:
         | 
| @@ -117,4 +119,6 @@ rubygems_version: 2.2.0 | |
| 117 119 | 
             
            signing_key: 
         | 
| 118 120 | 
             
            specification_version: 4
         | 
| 119 121 | 
             
            summary: World of Warcraft API Access.
         | 
| 120 | 
            -
            test_files: | 
| 122 | 
            +
            test_files:
         | 
| 123 | 
            +
            - spec/features/character_profile_spec.rb
         | 
| 124 | 
            +
            - spec/spec_helper.rb
         |