book 0.0.1 → 0.1.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.
@@ -0,0 +1,5 @@
1
+ # Book
2
+
3
+ An ephemeral book model we use for consuming various book APIs.
4
+
5
+ Extend according to your needs.
@@ -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 = ["code@papercavalier.com"]
10
+ s.email = "code@papercavalier.com"
11
11
  s.homepage = ""
12
- s.summary = %q{Stub}
13
- s.description = %q{Stub}
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
@@ -0,0 +1,4 @@
1
+ class Author < Structure
2
+ key :name
3
+ key :role
4
+ end
@@ -1,3 +1,22 @@
1
- module Book
2
- # Your code goes here...
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
@@ -1,3 +1,3 @@
1
- module Book
2
- VERSION = "0.0.1"
1
+ class Book
2
+ VERSION = '0.1.0'
3
3
  end
@@ -0,0 +1,4 @@
1
+ class Identifier < Structure
2
+ key :name
3
+ key :value
4
+ end
@@ -0,0 +1,6 @@
1
+ class Image < Structure
2
+ key :name
3
+ key :url
4
+ key :height, :type => Integer
5
+ key :width, :type => Integer
6
+ end
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
- version: 0.0.1
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: 2010-12-09 00:00:00 +00:00
17
+ date: 2011-06-29 00:00:00 +01:00
18
18
  default_executable:
19
- dependencies: []
20
-
21
- description: Stub
22
- email:
23
- - code@papercavalier.com
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: Stub
99
+ summary: A book model
69
100
  test_files: []
70
101