pasrb 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,10 @@
1
+ v0.0.3. Changes:
2
+ * get_member_tracker_stats no longer keeps three forms of keys.
3
+ Now it only uses "identifier" => data scheme, because it was
4
+ quite difficult to iterate otherwise.
5
+ * Same for all_members
6
+
7
+
1
8
  v0.0.2. Changes:
2
9
  * website_offers api method call
3
10
 
data/Rakefile CHANGED
@@ -1,10 +1,10 @@
1
1
  require 'echoe'
2
- Echoe.new('pasrb', '0.0.2') do |g|
2
+ Echoe.new('pasrb', '0.0.3') do |g|
3
3
  g.description = "PokerAffiliateSupport api querying via ruby"
4
4
  g.url = "http://github.com/markiz/pasrb"
5
5
  g.author = "Markiz"
6
6
  g.email = "markizko@gmail.com"
7
- g.ignore_pattern = ['spec/*/public/**/*']
7
+ g.ignore_pattern = ['spec/*/public/**/*', 'nbproject/**/*']
8
8
  g.runtime_dependencies = ["mechanize", "xml-simple"]
9
9
  g.development_dependencies = []
10
10
  g.use_sudo = false
data/lib/pas.rb CHANGED
@@ -50,7 +50,6 @@ class PAS
50
50
  def list_all_members!
51
51
  members = (1..member_page_count).inject([]) {|result, page| result + member_page(page) }
52
52
  members.inject({}) do |result, member|
53
- result[member[:id]] = member
54
53
  result[member[:login]] = member
55
54
  result
56
55
  end
@@ -106,15 +105,13 @@ class PAS
106
105
  trackers = [response["statistics"]["member_trackers"]["member_tracker"]].flatten
107
106
  trackers.inject({}) do |result, tracker|
108
107
  id = tracker["id"].to_i
109
- result[id] = {
108
+ result[tracker["identifier"]] = {
110
109
  :identifier => tracker["identifier"],
111
- :poker_room_id => tracker["poker_room_id"],
110
+ :poker_room_id => tracker["poker_room_id"].to_i,
112
111
  :poker_room => tracker["poker_room"],
113
112
  :mgr => tracker["mgr"].to_f,
114
113
  :rakeback => tracker["rakeback"].to_f
115
114
  }
116
- result[id.to_s] = result[id]
117
- result[tracker["identifier"]] = result[id]
118
115
  result
119
116
  end
120
117
  rescue
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{pasrb}
5
- s.version = "0.0.2"
5
+ s.version = "0.0.3"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Markiz"]
9
- s.date = %q{2010-10-19}
9
+ s.date = %q{2010-10-21}
10
10
  s.description = %q{PokerAffiliateSupport api querying via ruby}
11
11
  s.email = %q{markizko@gmail.com}
12
12
  s.extra_rdoc_files = ["CHANGELOG", "LICENSE", "README", "lib/pas.rb"]
@@ -191,12 +191,13 @@ describe PAS do
191
191
  subject.all_members
192
192
  end
193
193
 
194
- it "should return a hash accessible by member id" do
195
- subject.all_members[26380][:first_name].should == "Dumbo"
194
+ it "should return a hash inaccessible by member id" do
195
+ subject.all_members[26380].should be_nil
196
196
  end
197
197
 
198
198
  it "should return a hash accessible by member login" do
199
199
  subject.all_members["durachok"][:first_name].should == "Dumbo"
200
+ subject.all_members.should have_exactly(2).items
200
201
  end
201
202
 
202
203
  it "should return empty hash on failures" do
@@ -297,9 +298,11 @@ describe PAS do
297
298
 
298
299
  it "should parse out members" do
299
300
  members = subject.get_member_trackers_stats(member_id, Date.parse("2010-08-01"), Date.parse("2010-08-18"))
300
- members[6][:identifier].should == "qq124"
301
- members[2195][:identifier].should == "qq1244343"
302
- members["qq124"].should == members[6]
301
+ members[6].should be_nil
302
+ members[2195].should be_nil
303
+ members.should have_exactly(2).items
304
+ members["qq124"][:poker_room_id].should == 293
305
+ members["qq1244343"][:poker_room_id].should == 293
303
306
  end
304
307
 
305
308
  it "should return nil on terrible, terrible failures" do
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pasrb
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 2
10
- version: 0.0.2
9
+ - 3
10
+ version: 0.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Markiz
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-10-19 00:00:00 +04:00
18
+ date: 2010-10-21 00:00:00 +04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency