kosher 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,10 +1,4 @@
1
1
  Kosher
2
2
  ======
3
3
 
4
- Kosher is a somewhat overengineered attempt to abstract bookdealing
5
- into a set of models.
6
-
7
- Kosher knows if an offer is good or bad. It is also able to compare
8
- offers.
9
-
10
- ![Booksellers](http://upload.wikimedia.org/wikipedia/commons/thumb/b/b9/Bucharest_booksellers_2.jpg/600px-Bucharest_booksellers_2.jpg)
4
+ Kosher abstracts online book trading into a set of models.
data/Rakefile CHANGED
@@ -5,7 +5,6 @@ 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)
9
8
  spec.pattern = 'spec/**/*_spec.rb'
10
9
  end
11
10
 
data/kosher.gemspec CHANGED
@@ -9,21 +9,21 @@ Gem::Specification.new do |s|
9
9
  s.authors = ['Paper Cavalier']
10
10
  s.email = 'code@papercavalier.com'
11
11
  s.homepage = 'https://rubygems.org/gems/kosher'
12
- s.summary = %q{A somewhat overengineered attempt to abstract bookselling into a set of models}
13
- s.description = %q{Kosher is a somewhat overengineered attempt to abstract bookselling into a set of models.}
12
+ s.summary = %q{An overengineered attempt to abstract bookselling into a set of models}
13
+ s.description = %q{Kosher is an overengineered attempt to abstract bookselling into a set of models.}
14
14
 
15
15
  s.rubyforge_project = 'kosher'
16
16
 
17
17
  {
18
- 'rspec' => '~> 2.6.0',
18
+ 'rspec' => '~> 2.6',
19
19
  'ruby-debug19' => '~> 0.11.6'
20
20
  }.each do |lib, version|
21
21
  s.add_development_dependency lib, version
22
22
  end
23
23
 
24
24
  {
25
- 'money' => '~> 3.6.1',
26
- 'structure' => '~> 0.7.0'
25
+ 'money' => '~> 3.6',
26
+ 'structure' => '~> 0.7.1'
27
27
  }.each do |lib, version|
28
28
  s.add_runtime_dependency lib, version
29
29
  end
data/lib/kosher/item.rb CHANGED
@@ -4,11 +4,11 @@ module Kosher
4
4
  #
5
5
  # An item has a price, quantity, condition, and description.
6
6
  class Item < Structure
7
- key :cents, :type => Integer
8
- key :currency
9
- key :quantity, :type => Integer
10
- key :condition, :type => Structure
11
- key :description, :type => Structure
7
+ key :cents, :type => Integer
8
+ key :currency
9
+ key :quantity, :type => Integer
10
+ has_one :condition
11
+ has_one :description
12
12
 
13
13
  def kosher?
14
14
  condition.kosher? && description.kosher?
data/lib/kosher/offer.rb CHANGED
@@ -6,11 +6,11 @@ module Kosher
6
6
  class Offer < Structure
7
7
  include Comparable
8
8
 
9
- key :id
10
- key :venue
11
- key :item, :type => Structure
12
- key :seller, :type => Structure
13
- key :shipping, :type => Structure
9
+ key :id
10
+ has_one :venue
11
+ has_one :item
12
+ has_one :seller
13
+ has_one :shipping
14
14
 
15
15
  # Compares offer with another offer.
16
16
  #
data/lib/kosher/seller.rb CHANGED
@@ -6,10 +6,10 @@ module Kosher
6
6
  class Seller < Structure
7
7
  include Threshold
8
8
 
9
- key :id
10
- key :name
11
- key :rating, :type => Float
12
- key :location, :type => Structure
9
+ key :id
10
+ key :name
11
+ key :rating, :type => Float
12
+ has_one :location
13
13
 
14
14
  # Returns whether we blacklist the seller.
15
15
  def blacklisted?
@@ -3,9 +3,9 @@ module Kosher
3
3
  #
4
4
  # Shipping costs something (or nothing) and is subject to availability.
5
5
  class Shipping < Structure
6
- key :cents, :type => Integer
7
- key :currency
8
- key :availability, :type => Structure
6
+ key :cents, :type => Integer
7
+ key :currency
8
+ has_one :availability
9
9
 
10
10
  # Returns whether the item ships for free.
11
11
  def free?
@@ -0,0 +1,9 @@
1
+ module Kosher
2
+
3
+ # A Venue.
4
+ class Venue < Structure
5
+ key :id, :type => Integer
6
+ key :name
7
+ key :locale
8
+ end
9
+ end
@@ -1,3 +1,3 @@
1
1
  module Kosher
2
- VERSION = '0.5.0'
2
+ VERSION = '0.6.0'
3
3
  end
data/lib/kosher.rb CHANGED
@@ -20,6 +20,7 @@ require 'kosher/location'
20
20
  require 'kosher/offer'
21
21
  require 'kosher/seller'
22
22
  require 'kosher/shipping'
23
+ require 'kosher/venue'
23
24
 
24
25
  module Kosher
25
26
  class << self
@@ -0,0 +1,5 @@
1
+ require 'spec_helper'
2
+
3
+ module Kosher
4
+ describe Venue
5
+ end
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 5
7
+ - 6
8
8
  - 0
9
- version: 0.5.0
9
+ version: 0.6.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Paper Cavalier
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-06-01 00:00:00 +01:00
17
+ date: 2011-06-14 00:00:00 +01:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -28,8 +28,7 @@ dependencies:
28
28
  segments:
29
29
  - 2
30
30
  - 6
31
- - 0
32
- version: 2.6.0
31
+ version: "2.6"
33
32
  type: :development
34
33
  version_requirements: *id001
35
34
  - !ruby/object:Gem::Dependency
@@ -58,8 +57,7 @@ dependencies:
58
57
  segments:
59
58
  - 3
60
59
  - 6
61
- - 1
62
- version: 3.6.1
60
+ version: "3.6"
63
61
  type: :runtime
64
62
  version_requirements: *id003
65
63
  - !ruby/object:Gem::Dependency
@@ -73,11 +71,11 @@ dependencies:
73
71
  segments:
74
72
  - 0
75
73
  - 7
76
- - 0
77
- version: 0.7.0
74
+ - 1
75
+ version: 0.7.1
78
76
  type: :runtime
79
77
  version_requirements: *id004
80
- description: Kosher is a somewhat overengineered attempt to abstract bookselling into a set of models.
78
+ description: Kosher is an overengineered attempt to abstract bookselling into a set of models.
81
79
  email: code@papercavalier.com
82
80
  executables: []
83
81
 
@@ -105,6 +103,7 @@ files:
105
103
  - lib/kosher/seller.rb
106
104
  - lib/kosher/shipping.rb
107
105
  - lib/kosher/threshold.rb
106
+ - lib/kosher/venue.rb
108
107
  - lib/kosher/version.rb
109
108
  - spec/kosher/availability_spec.rb
110
109
  - spec/kosher/book_spec.rb
@@ -115,6 +114,7 @@ files:
115
114
  - spec/kosher/offer_spec.rb
116
115
  - spec/kosher/seller_spec.rb
117
116
  - spec/kosher/shipping_spec.rb
117
+ - spec/kosher/venue_spec.rb
118
118
  - spec/kosher_spec.rb
119
119
  - spec/spec_helper.rb
120
120
  has_rdoc: true
@@ -148,7 +148,7 @@ rubyforge_project: kosher
148
148
  rubygems_version: 1.3.7
149
149
  signing_key:
150
150
  specification_version: 3
151
- summary: A somewhat overengineered attempt to abstract bookselling into a set of models
151
+ summary: An overengineered attempt to abstract bookselling into a set of models
152
152
  test_files:
153
153
  - spec/kosher/availability_spec.rb
154
154
  - spec/kosher/book_spec.rb
@@ -159,5 +159,6 @@ test_files:
159
159
  - spec/kosher/offer_spec.rb
160
160
  - spec/kosher/seller_spec.rb
161
161
  - spec/kosher/shipping_spec.rb
162
+ - spec/kosher/venue_spec.rb
162
163
  - spec/kosher_spec.rb
163
164
  - spec/spec_helper.rb