wowr 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README +64 -0
  2. data/lib/wowr.rb +9 -6
  3. data/lib/wowr/classes.rb +1 -1
  4. metadata +16 -9
data/README ADDED
@@ -0,0 +1,64 @@
1
+ Wowr
2
+ ----
3
+
4
+ Ruby Library for the World of Warcraft Armory
5
+
6
+
7
+
8
+ Introduction
9
+ ------------
10
+
11
+ Wowr is an API for accessing data in the World of Warcraft Armory. Using the XML data provided by the armory, it allows developers to query World of Warcraft items, characters, guilds and arena teams. It is designed to support developers that wish to add WoW information to their Ruby-powered site, as well as larger guild or portal sites for many users.
12
+
13
+
14
+
15
+ Usage
16
+ -----
17
+
18
+ When initialising the library, it is possible to set a number of parameters to be used as defaults in other API functions.
19
+
20
+ # all parameters optional
21
+ api = Wowr::API.new(:character_name => 'Foo',
22
+ :guild_name => 'Bar',
23
+ :realm => 'Baz',
24
+ :locale => :eu) # defaults to US
25
+
26
+ # Character requests
27
+ my_char = api.get_character_sheet
28
+ char_boo = api.get_character_sheet(:character_name => 'Boo')
29
+ chars = api.search_characters(:search => 'Cake')
30
+
31
+ # Guild requests
32
+ guilds = api.search_guilds(:search => 'Cake')
33
+ cake_guild = api.get_guild(:guild_name => 'Cake', :realm => 'Silver Hand')
34
+
35
+ # Items
36
+ items = api.search_items(:search => 'Cake')
37
+ item_info = api.get_item_info(:item_id => 33924)
38
+ item_tooltip = api.get_item_tooltip(:item_id => 33924)
39
+
40
+ # Arena Teams
41
+ arena_teams = api.search_arena_teams(:search => 'Lemon')
42
+ arena_team = api.get_arena_team(:team_name => 'Lemon', :realm => 'Hakkar', :team_size => 5)
43
+
44
+ This API is under development, and is one of my first API projects, so I would greatly appreciate any feedback about it's usefulness or any requests for features/changes. Feel free to drop me a line at benhumphreys[at]gmail
45
+
46
+
47
+
48
+ Documentation
49
+ -------------
50
+
51
+ Please view the RubyDoc for more information on usage. http://wowr.rubyforge.org/doc/
52
+
53
+
54
+
55
+ Installation
56
+ ------------
57
+
58
+ Wowr can be installed through RubyGems using the command below:
59
+ gem install wowr
60
+
61
+ Alternatively, the latest version can be downloaded from SVN with:
62
+ svn checkout http://wowr.rubyforge.org/svn/trunk/lib/
63
+
64
+
@@ -12,11 +12,14 @@ rescue LoadError
12
12
  end
13
13
  require 'net/http'
14
14
  require 'cgi'
15
- require 'fileutils' # for making cache directories
15
+ require 'fileutils' # for making directories :S
16
16
 
17
- require 'wowr/exceptions.rb'
18
- require 'wowr/extensions.rb'
19
- require 'wowr/classes.rb'
17
+ # TODO: what does this do?
18
+ #$:.unshift(File.dirname(__FILE__)) unless $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
19
+
20
+ require 'lib/wowr/exceptions.rb'
21
+ require 'lib/wowr/extensions.rb'
22
+ require 'lib/wowr/classes.rb'
20
23
 
21
24
  module Wowr
22
25
  class API
@@ -149,7 +152,7 @@ module Wowr
149
152
 
150
153
  if (xml) && (xml%'armorySearch') && (xml%'armorySearch'%'searchResults')
151
154
  case options[:type]
152
-
155
+
153
156
  # TODO: Filter stuff
154
157
  when @@search_types[:item]
155
158
  (xml%'armorySearch'%'searchResults'%'items'/:item).each do |item|
@@ -195,7 +198,7 @@ module Wowr
195
198
  # @resistances[res] = Wowr::Classes::Resistance.new(xml%'resistances'%res)
196
199
  # end
197
200
  # puts @resistances.to_yaml
198
- # puts xml
201
+ puts xml
199
202
  return Wowr::Classes::CharacterSheet.new(xml)
200
203
  end
201
204
 
@@ -181,7 +181,7 @@ module Wowr
181
181
 
182
182
  @arena_teams = []
183
183
  (elem/:arenaTeam).each do |arena_team|
184
- @arena_team << ArenaTeam.new(arena_team)
184
+ @arena_teams << ArenaTeam.new(arena_team)
185
185
  end
186
186
 
187
187
  end
metadata CHANGED
@@ -1,33 +1,40 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wowr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Humphreys
8
8
  autorequire:
9
- - wowr
10
- - hpricot
11
9
  bindir: bin
12
10
  cert_chain: []
13
11
 
14
- date: 2008-03-18 00:00:00 +00:00
12
+ date: 2008-02-07 00:00:00 +00:00
15
13
  default_executable:
16
- dependencies: []
17
-
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: hpricot
17
+ version_requirement:
18
+ version_requirements: !ruby/object:Gem::Requirement
19
+ requirements:
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: "0.6"
23
+ version:
18
24
  description: Provides Ruby interface for retrieving item, character, guild and arena team info from the armory.
19
25
  email: benhumphreys @nospam@ gmail.com
20
26
  executables: []
21
27
 
22
28
  extensions: []
23
29
 
24
- extra_rdoc_files: []
25
-
30
+ extra_rdoc_files:
31
+ - README
26
32
  files:
27
33
  - lib/wowr.rb
28
34
  - lib/wowr/classes.rb
29
35
  - lib/wowr/exceptions.rb
30
36
  - lib/wowr/extensions.rb
37
+ - README
31
38
  has_rdoc: true
32
39
  homepage: http://wowr.rubyforge.org/
33
40
  post_install_message:
@@ -49,7 +56,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
49
56
  version:
50
57
  requirements: []
51
58
 
52
- rubyforge_project:
59
+ rubyforge_project: wowr
53
60
  rubygems_version: 1.0.1
54
61
  signing_key:
55
62
  specification_version: 2