kosher 0.2.20 → 0.2.21

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -5,6 +5,7 @@ Bundler::GemHelper.install_tasks
5
5
 
6
6
  desc 'Run all specs in spec directory'
7
7
  RSpec::Core::RakeTask.new(:spec) do |spec|
8
+ spec.rspec_opts = %w(-fd -c)
8
9
  spec.pattern = 'spec/**/*_spec.rb'
9
10
  end
10
11
 
data/lib/kosher/book.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  module Kosher
2
- class Book < Struct.new(:venue, :isbn, :asin, :sales_rank, :offers_total, :offers, :created_at)
2
+ class Book < Struct.new(:venue, :isbn, :asin, :offers_total, :offers)
3
+
3
4
  def best_kosher_offer
4
5
  offer = offers.sort.first
5
6
 
@@ -1,5 +1,6 @@
1
1
  module Kosher
2
2
  class Description < Struct.new(:text)
3
+
3
4
  DAMAGED = "\\b(?:missing|torn|broken|split|discard|withdrawn|rent|stain|school|damaged|water)"
4
5
  EXLIB = "(?:e?x|discarded|retired|former|has|have)[\\s._-]*lib"
5
6
  MARKED = "(highlight|hilit|underlin)"
data/lib/kosher/offer.rb CHANGED
@@ -1,7 +1,8 @@
1
1
  module Kosher
2
2
 
3
- # A used or new offer of a book by a dealer or store.
4
- class Offer < Struct.new(:id, :item, :seller, :shipping, :human_readable)
3
+ # An offer by a book seller.
4
+ class Offer < Struct.new(:venue, :id, :item, :seller, :shipping, :readable)
5
+
5
6
  include Comparable
6
7
 
7
8
  class << self
@@ -0,0 +1,4 @@
1
+ module Kosher
2
+ class Readable < Struct.new(:price, :description)
3
+ end
4
+ end
@@ -1,3 +1,3 @@
1
1
  module Kosher
2
- VERSION = '0.2.20'
2
+ VERSION = '0.2.21'
3
3
  end
data/lib/kosher.rb CHANGED
@@ -8,7 +8,7 @@ require 'kosher/condition'
8
8
  require 'kosher/description'
9
9
  require 'kosher/item'
10
10
  require 'kosher/location'
11
- require 'kosher/human_readable'
12
11
  require 'kosher/offer'
12
+ require 'kosher/readable'
13
13
  require 'kosher/seller'
14
14
  require 'kosher/shipping'
@@ -22,7 +22,7 @@ module Kosher
22
22
  @book.offers << @offer2
23
23
  end
24
24
 
25
- it "returns the kosher offer with the lower price" do
25
+ it "returns the kosher offer with the lowest price" do
26
26
  @book.best_kosher_offer.should eql @offer2
27
27
  end
28
28
  end
@@ -38,7 +38,7 @@ module Kosher
38
38
  @book.offers << @offer2
39
39
  end
40
40
 
41
- it "returns the best kosher offer" do
41
+ it "returns the kosher offer" do
42
42
  @book.best_kosher_offer.should eql @offer1
43
43
  end
44
44
  end
@@ -1,5 +1,5 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  module Kosher
4
- describe HumanReadable
4
+ describe Readable
5
5
  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.20
5
+ version: 0.2.21
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-04-01 00:00:00 +01:00
13
+ date: 2011-04-15 00:00:00 +01:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -44,10 +44,10 @@ files:
44
44
  - lib/kosher/book.rb
45
45
  - lib/kosher/condition.rb
46
46
  - lib/kosher/description.rb
47
- - lib/kosher/human_readable.rb
48
47
  - lib/kosher/item.rb
49
48
  - lib/kosher/location.rb
50
49
  - lib/kosher/offer.rb
50
+ - lib/kosher/readable.rb
51
51
  - lib/kosher/seller.rb
52
52
  - lib/kosher/shipping.rb
53
53
  - lib/kosher/threshold.rb
@@ -56,10 +56,10 @@ files:
56
56
  - spec/kosher/book_spec.rb
57
57
  - spec/kosher/condition_spec.rb
58
58
  - spec/kosher/description_spec.rb
59
- - spec/kosher/human_readable_spec.rb
60
59
  - spec/kosher/item_spec.rb
61
60
  - spec/kosher/location_spec.rb
62
61
  - spec/kosher/offer_spec.rb
62
+ - spec/kosher/readable_spec.rb
63
63
  - spec/kosher/seller_spec.rb
64
64
  - spec/kosher/shipping_spec.rb
65
65
  - spec/spec_helper.rb
@@ -87,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
87
87
  requirements: []
88
88
 
89
89
  rubyforge_project: kosher
90
- rubygems_version: 1.5.2
90
+ rubygems_version: 1.6.2
91
91
  signing_key:
92
92
  specification_version: 3
93
93
  summary: A somewhat overengineered attempt to abstract bookselling into a set of models
@@ -96,10 +96,10 @@ test_files:
96
96
  - spec/kosher/book_spec.rb
97
97
  - spec/kosher/condition_spec.rb
98
98
  - spec/kosher/description_spec.rb
99
- - spec/kosher/human_readable_spec.rb
100
99
  - spec/kosher/item_spec.rb
101
100
  - spec/kosher/location_spec.rb
102
101
  - spec/kosher/offer_spec.rb
102
+ - spec/kosher/readable_spec.rb
103
103
  - spec/kosher/seller_spec.rb
104
104
  - spec/kosher/shipping_spec.rb
105
105
  - spec/spec_helper.rb
@@ -1,4 +0,0 @@
1
- module Kosher
2
- class HumanReadable < Struct.new(:price, :description)
3
- end
4
- end