board-game-gem 0.3.7 → 0.3.8

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2c3e0fa45e3189984d4d424a96ce0456fff79e6d
4
- data.tar.gz: ad86d9f0acb69d0868e0832faf22825ac2285bd8
3
+ metadata.gz: 8074cddb2b896c2bfa2c3d21d4bbee3962449c24
4
+ data.tar.gz: 2ab14ed94bc525bcb97189a1d31a9b5e82ac365d
5
5
  SHA512:
6
- metadata.gz: 7186b16e34ab46758272f8f52f3e4ddc0a05ad8b8d12ae34b4b5c0d86e30f73887644802142edd1f175b9aa9d7eb657a2c546e02da4050fbf01796e9e94d2fff
7
- data.tar.gz: 0dd412ee4a6e553d0b245ac51c6a4891113d6e93c579cd20aaa7c5736f40b5cf6f134ef94000cc34d76d7c14347e4d9d4dac636630c733c1472792966981cb9d
6
+ metadata.gz: 78350989da050ee1fb068ef351acf3095ced7b4fb6a8455b4fa5bf46fa4706308e01ddba294661ef3abe97c8d8a38811b9229bd37e832984d989acbe170281e5
7
+ data.tar.gz: 41a47828a4cd327ebe0c9353feb81578492578f6b0b88160f505be28743441078af7455fc926d937610577f4490b09f6de23de401852c0ac3eb93b682ddede31
data/README.md CHANGED
@@ -1,12 +1,12 @@
1
- # BoardGameGem
2
- BoardGameGem provides a Ruby interface to the [BoardGameGeek XML API](http://www.boardgamegeek.com/xmlapi2) (version 2). It's designed to work with the Rails cache to reduce the number of requests when working with Rails.
1
+ # board-game-gem
2
+ board-game-gem provides a Ruby interface to the [BoardGameGeek XML API](http://www.boardgamegeek.com/xmlapi2) (version 2). It's designed to work with the Rails cache to reduce the number of requests when working with Rails.
3
3
 
4
4
  ## Installation
5
5
 
6
6
  Add this line to your application's Gemfile:
7
7
 
8
8
  ```ruby
9
- gem 'boardgamegem'
9
+ gem 'board-game-gem'
10
10
  ```
11
11
 
12
12
  And then execute:
@@ -15,7 +15,7 @@ And then execute:
15
15
 
16
16
  Or install it yourself as:
17
17
 
18
- $ gem install boardgamegem
18
+ $ gem install board-game-gem
19
19
 
20
20
  ## Usage
21
21
 
@@ -87,11 +87,11 @@ A `BGGItem` version of this object can be requested with `to_item([statistics])`
87
87
 
88
88
  ### But the BGG API has more than just this!
89
89
 
90
- I made this gem to help make requests for another one of my projects, [Math Trade Manager](http://www.github.com/acceptableice/math-trade-manager), and thus haven't finished implementing the other BGG API features that Math Trade Manager didn't require. If you need something specific for your application, log an issue, message me on Twitter ([@AcceptableIce](http://www.twitter.com/acceptableice)), or email me at [jakeroussel@mac.com](mailto:jakeroussel@mac.com). This is my first gem, so there are probably some issues. Let me know!
90
+ I made this gem to help make requests for another one of my projects, [Acceptable Trader](http://www.github.com/acceptableice/acceptable-trader), and thus haven't finished implementing the other BGG API features that Acceptable Trader didn't require. If you need something specific for your application, log an issue, message me on Twitter ([@AcceptableIce](http://www.twitter.com/acceptableice)), or email me at [jakeroussel@mac.com](mailto:jakeroussel@mac.com). This is my first gem, so there are probably some issues. Let me know!
91
91
 
92
92
  ## Contributing
93
93
 
94
- Bug reports and pull requests are welcome on GitHub at https://github.com/acceptableice/boardgamegem. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
94
+ Bug reports and pull requests are welcome on GitHub at https://github.com/acceptableice/board-game-gem. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
95
95
 
96
96
 
97
97
  ## License
@@ -16,6 +16,11 @@ module BoardGameGem
16
16
  end
17
17
  end
18
18
 
19
+ def status_of(id)
20
+ item = @items.first { |x| x.id == id}
21
+ item ? item.status : nil
22
+ end
23
+
19
24
  def get_owned
20
25
  return filter_by(:own)
21
26
  end
@@ -60,6 +60,7 @@ module BoardGameGem
60
60
  def self.request_xml(method, hash, attempt = 0)
61
61
  params = BoardGameGem.hash_to_uri(hash)
62
62
  value = BoardGameGem.retryable(tries: MAX_ATTEMPTS, on: OpenURI::HTTPError) do
63
+ #p "#{API_ROOT}/#{method}?#{params}"
63
64
  open("#{API_ROOT}/#{method}?#{params}") do |file|
64
65
  if file.status[0] != "200"
65
66
  sleep 0.05
@@ -1,3 +1,3 @@
1
1
  module BoardGameGem
2
- VERSION = "0.3.7"
2
+ VERSION = "0.3.8"
3
3
  end
data/test.rb CHANGED
@@ -1,2 +1,4 @@
1
1
  require_relative 'lib/board-game-gem'
2
- p BoardGameGem.get_items([1,2,3,4,5])
2
+ collection = BoardGameGem.get_collection("AcceptableIce")
3
+
4
+ p collection.status_of(68448)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: board-game-gem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.7
4
+ version: 0.3.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jake Roussel
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-05-17 00:00:00.000000000 Z
11
+ date: 2016-05-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake