kosher 0.2.14 → 0.2.15

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  Kosher
2
2
  ======
3
3
 
4
- Kosher is a somewhat overengineered attempt to abstract bookselling
4
+ Kosher is a somewhat overengineered attempt to abstract bookdealing
5
5
  into a set of models.
6
6
 
7
7
  Kosher knows if an offer is good or bad. It is also able to compare
@@ -1,5 +1,5 @@
1
1
  module Kosher
2
- class Snapshot < Struct.new(:venue, :isbn, :asin, :sales_rank, :offers_count, :offers, :created_at)
2
+ class Book < Struct.new(:venue, :isbn, :asin, :sales_rank, :offers_count, :offers, :created_at)
3
3
  def best_kosher_offer
4
4
  offer = offers.sort.first
5
5
 
@@ -1,3 +1,3 @@
1
1
  module Kosher
2
- VERSION = '0.2.14'
2
+ VERSION = '0.2.15'
3
3
  end
data/lib/kosher.rb CHANGED
@@ -3,6 +3,7 @@ require 'money'
3
3
  require 'kosher/threshold'
4
4
 
5
5
  require 'kosher/availability'
6
+ require 'kosher/book'
6
7
  require 'kosher/condition'
7
8
  require 'kosher/description'
8
9
  require 'kosher/item'
@@ -10,4 +11,3 @@ require 'kosher/location'
10
11
  require 'kosher/offer'
11
12
  require 'kosher/seller'
12
13
  require 'kosher/shipping'
13
- require 'kosher/snapshot'
@@ -1,11 +1,11 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  module Kosher
4
- describe Snapshot do
4
+ describe Book do
5
5
  describe "#best_kosher_offer" do
6
6
  before do
7
- @snapshot = Snapshot.new
8
- @snapshot.offers = []
7
+ @book = Book.new
8
+ @book.offers = []
9
9
 
10
10
  @offer1 = Offer.new
11
11
  @offer2 = Offer.new
@@ -15,15 +15,15 @@ module Kosher
15
15
  before do
16
16
  @offer1.stub!(:kosher?).and_return(true)
17
17
  @offer1.stub!(:price).and_return(Money.new(200, 'EUR'))
18
- @snapshot.offers << @offer1
18
+ @book.offers << @offer1
19
19
 
20
20
  @offer2.stub!(:kosher?).and_return(true)
21
21
  @offer2.stub!(:price).and_return(Money.new(100, 'EUR'))
22
- @snapshot.offers << @offer2
22
+ @book.offers << @offer2
23
23
  end
24
24
 
25
25
  it "returns the kosher offer with the lower price" do
26
- @snapshot.best_kosher_offer.should eql @offer2
26
+ @book.best_kosher_offer.should eql @offer2
27
27
  end
28
28
  end
29
29
 
@@ -31,15 +31,15 @@ module Kosher
31
31
  before do
32
32
  @offer1.stub!(:kosher?).and_return(true)
33
33
  @offer1.stub!(:price).and_return(Money.new(200, 'EUR'))
34
- @snapshot.offers << @offer1
34
+ @book.offers << @offer1
35
35
 
36
36
  @offer2.stub!(:kosher?).and_return(false)
37
37
  @offer2.stub!(:price).and_return(Money.new(100, 'EUR'))
38
- @snapshot.offers << @offer2
38
+ @book.offers << @offer2
39
39
  end
40
40
 
41
41
  it "returns the best kosher offer" do
42
- @snapshot.best_kosher_offer.should eql @offer1
42
+ @book.best_kosher_offer.should eql @offer1
43
43
  end
44
44
  end
45
45
 
@@ -47,11 +47,11 @@ module Kosher
47
47
  before do
48
48
  @offer1.stub!(:kosher?).and_return(true)
49
49
  @offer1.stub!(:price).and_return(Money.new(100, 'EUR'))
50
- @snapshot.offers << @offer1
50
+ @book.offers << @offer1
51
51
  end
52
52
 
53
53
  it "returns the kosher offer" do
54
- @snapshot.best_kosher_offer.should eql @offer1
54
+ @book.best_kosher_offer.should eql @offer1
55
55
  end
56
56
  end
57
57
 
@@ -59,11 +59,11 @@ module Kosher
59
59
  before do
60
60
  @offer1.stub!(:kosher?).and_return(false)
61
61
  @offer1.stub!(:price).and_return(Money.new(100, 'EUR'))
62
- @snapshot.offers << @offer1
62
+ @book.offers << @offer1
63
63
  end
64
64
 
65
65
  it "returns nil" do
66
- @snapshot.best_kosher_offer.should be_nil
66
+ @book.best_kosher_offer.should be_nil
67
67
  end
68
68
  end
69
69
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: kosher
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.2.14
5
+ version: 0.2.15
6
6
  platform: ruby
7
7
  authors:
8
8
  - Paper Cavalier
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-03-16 00:00:00 +00:00
13
+ date: 2011-03-17 00:00:00 +00:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -63,6 +63,7 @@ files:
63
63
  - kosher.gemspec
64
64
  - lib/kosher.rb
65
65
  - lib/kosher/availability.rb
66
+ - lib/kosher/book.rb
66
67
  - lib/kosher/condition.rb
67
68
  - lib/kosher/description.rb
68
69
  - lib/kosher/item.rb
@@ -70,10 +71,10 @@ files:
70
71
  - lib/kosher/offer.rb
71
72
  - lib/kosher/seller.rb
72
73
  - lib/kosher/shipping.rb
73
- - lib/kosher/snapshot.rb
74
74
  - lib/kosher/threshold.rb
75
75
  - lib/kosher/version.rb
76
76
  - spec/kosher/availability_spec.rb
77
+ - spec/kosher/book_spec.rb
77
78
  - spec/kosher/condition_spec.rb
78
79
  - spec/kosher/description_spec.rb
79
80
  - spec/kosher/item_spec.rb
@@ -81,7 +82,6 @@ files:
81
82
  - spec/kosher/offer_spec.rb
82
83
  - spec/kosher/seller_spec.rb
83
84
  - spec/kosher/shipping_spec.rb
84
- - spec/kosher/snapshot_spec.rb
85
85
  - spec/spec_helper.rb
86
86
  has_rdoc: true
87
87
  homepage: https://rubygems.org/gems/kosher
@@ -113,6 +113,7 @@ specification_version: 3
113
113
  summary: A somewhat overengineered attempt to abstract bookdealing into a set of models
114
114
  test_files:
115
115
  - spec/kosher/availability_spec.rb
116
+ - spec/kosher/book_spec.rb
116
117
  - spec/kosher/condition_spec.rb
117
118
  - spec/kosher/description_spec.rb
118
119
  - spec/kosher/item_spec.rb
@@ -120,5 +121,4 @@ test_files:
120
121
  - spec/kosher/offer_spec.rb
121
122
  - spec/kosher/seller_spec.rb
122
123
  - spec/kosher/shipping_spec.rb
123
- - spec/kosher/snapshot_spec.rb
124
124
  - spec/spec_helper.rb