kosher 0.5.0 → 0.6.0
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.
- data/README.md +1 -7
- data/Rakefile +0 -1
- data/kosher.gemspec +5 -5
- data/lib/kosher/item.rb +5 -5
- data/lib/kosher/offer.rb +5 -5
- data/lib/kosher/seller.rb +4 -4
- data/lib/kosher/shipping.rb +3 -3
- data/lib/kosher/venue.rb +9 -0
- data/lib/kosher/version.rb +1 -1
- data/lib/kosher.rb +1 -0
- data/spec/kosher/venue_spec.rb +5 -0
- metadata +12 -11
data/README.md
CHANGED
@@ -1,10 +1,4 @@
|
|
1
1
|
Kosher
|
2
2
|
======
|
3
3
|
|
4
|
-
Kosher
|
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
|
-

|
4
|
+
Kosher abstracts online book trading into a set of models.
|
data/Rakefile
CHANGED
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{
|
13
|
-
s.description = %q{Kosher is
|
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
|
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
|
26
|
-
'structure' => '~> 0.7.
|
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
|
8
|
-
key
|
9
|
-
key
|
10
|
-
|
11
|
-
|
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
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
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
|
10
|
-
key
|
11
|
-
key
|
12
|
-
|
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?
|
data/lib/kosher/shipping.rb
CHANGED
@@ -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
|
7
|
-
key
|
8
|
-
|
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?
|
data/lib/kosher/venue.rb
ADDED
data/lib/kosher/version.rb
CHANGED
data/lib/kosher.rb
CHANGED
metadata
CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 0
|
7
|
-
-
|
7
|
+
- 6
|
8
8
|
- 0
|
9
|
-
version: 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-
|
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
|
-
|
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
|
-
|
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
|
-
-
|
77
|
-
version: 0.7.
|
74
|
+
- 1
|
75
|
+
version: 0.7.1
|
78
76
|
type: :runtime
|
79
77
|
version_requirements: *id004
|
80
|
-
description: Kosher is
|
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:
|
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
|