book 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +5 -0
- data/book.gemspec +15 -3
- data/lib/author.rb +4 -0
- data/lib/book.rb +21 -2
- data/lib/book/version.rb +2 -2
- data/lib/identifier.rb +4 -0
- data/lib/image.rb +6 -0
- metadata +40 -9
data/README.md
ADDED
data/book.gemspec
CHANGED
@@ -7,10 +7,10 @@ Gem::Specification.new do |s|
|
|
7
7
|
s.version = Book::VERSION
|
8
8
|
s.platform = Gem::Platform::RUBY
|
9
9
|
s.authors = ["Paper Cavalier"]
|
10
|
-
s.email =
|
10
|
+
s.email = "code@papercavalier.com"
|
11
11
|
s.homepage = ""
|
12
|
-
s.summary = %q{
|
13
|
-
s.description = %q{
|
12
|
+
s.summary = %q{A book model}
|
13
|
+
s.description = %q{A book model for consuming various book APIs}
|
14
14
|
|
15
15
|
s.rubyforge_project = "book"
|
16
16
|
|
@@ -18,4 +18,16 @@ Gem::Specification.new do |s|
|
|
18
18
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
19
19
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
20
20
|
s.require_paths = ["lib"]
|
21
|
+
|
22
|
+
{
|
23
|
+
"structure" => "~> 0.9.0"
|
24
|
+
}.each do |lib, version|
|
25
|
+
s.add_runtime_dependency lib, version
|
26
|
+
end
|
27
|
+
|
28
|
+
{
|
29
|
+
"rspec" => "~> 2.6",
|
30
|
+
}.each do |lib, version|
|
31
|
+
s.add_development_dependency lib, version
|
32
|
+
end
|
21
33
|
end
|
data/lib/author.rb
ADDED
data/lib/book.rb
CHANGED
@@ -1,3 +1,22 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
class Book < Structure
|
2
|
+
key :edition
|
3
|
+
key :format
|
4
|
+
key :isbn
|
5
|
+
key :pages, :type => Integer
|
6
|
+
key :publisher
|
7
|
+
key :title
|
8
|
+
key :volumes, :type => Integer
|
9
|
+
key :year_published, :type => Integer
|
10
|
+
has_many :authors
|
11
|
+
has_many :identifiers
|
12
|
+
has_many :images
|
13
|
+
has_many :other_editions
|
14
|
+
|
15
|
+
def isbn
|
16
|
+
identifier =
|
17
|
+
identifiers.detect { |identifier| identifier.name == 'ISBN-13' } ||
|
18
|
+
identifiers.detect { |identifier| identifier.name == 'ISBN-10' }
|
19
|
+
|
20
|
+
identifier ? identifier.value : nil
|
21
|
+
end
|
3
22
|
end
|
data/lib/book/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
|
2
|
-
VERSION =
|
1
|
+
class Book
|
2
|
+
VERSION = '0.1.0'
|
3
3
|
end
|
data/lib/identifier.rb
ADDED
data/lib/image.rb
ADDED
metadata
CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 0
|
7
|
-
- 0
|
8
7
|
- 1
|
9
|
-
|
8
|
+
- 0
|
9
|
+
version: 0.1.0
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Paper Cavalier
|
@@ -14,13 +14,40 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date:
|
17
|
+
date: 2011-06-29 00:00:00 +01:00
|
18
18
|
default_executable:
|
19
|
-
dependencies:
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
name: structure
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
none: false
|
25
|
+
requirements:
|
26
|
+
- - ~>
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
segments:
|
29
|
+
- 0
|
30
|
+
- 9
|
31
|
+
- 0
|
32
|
+
version: 0.9.0
|
33
|
+
type: :runtime
|
34
|
+
version_requirements: *id001
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: rspec
|
37
|
+
prerelease: false
|
38
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ~>
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
segments:
|
44
|
+
- 2
|
45
|
+
- 6
|
46
|
+
version: "2.6"
|
47
|
+
type: :development
|
48
|
+
version_requirements: *id002
|
49
|
+
description: A book model for consuming various book APIs
|
50
|
+
email: code@papercavalier.com
|
24
51
|
executables: []
|
25
52
|
|
26
53
|
extensions: []
|
@@ -30,10 +57,14 @@ extra_rdoc_files: []
|
|
30
57
|
files:
|
31
58
|
- .gitignore
|
32
59
|
- Gemfile
|
60
|
+
- README.md
|
33
61
|
- Rakefile
|
34
62
|
- book.gemspec
|
63
|
+
- lib/author.rb
|
35
64
|
- lib/book.rb
|
36
65
|
- lib/book/version.rb
|
66
|
+
- lib/identifier.rb
|
67
|
+
- lib/image.rb
|
37
68
|
has_rdoc: true
|
38
69
|
homepage: ""
|
39
70
|
licenses: []
|
@@ -65,6 +96,6 @@ rubyforge_project: book
|
|
65
96
|
rubygems_version: 1.3.7
|
66
97
|
signing_key:
|
67
98
|
specification_version: 3
|
68
|
-
summary:
|
99
|
+
summary: A book model
|
69
100
|
test_files: []
|
70
101
|
|