entangledstate-isbn 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/.gitignore +4 -0
  2. data/VERSION.yml +1 -1
  3. data/isbn.gemspec +46 -0
  4. data/lib/isbn.rb +9 -0
  5. metadata +6 -4
data/.gitignore ADDED
@@ -0,0 +1,4 @@
1
+ *.sw?
2
+ .DS_Store
3
+ coverage
4
+ pkg/*
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :patch: 0
3
3
  :major: 1
4
- :minor: 1
4
+ :minor: 2
data/isbn.gemspec ADDED
@@ -0,0 +1,46 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = %q{isbn}
5
+ s.version = "1.2.0"
6
+
7
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
+ s.authors = ["Tim Kersey"]
9
+ s.date = %q{2009-06-03}
10
+ s.description = %q{library to transform ISBN's from new to used, between 10 and 13, etc...}
11
+ s.email = %q{entangledstate@gmail.com}
12
+ s.extra_rdoc_files = [
13
+ "LICENSE",
14
+ "README"
15
+ ]
16
+ s.files = [
17
+ ".gitignore",
18
+ "LICENSE",
19
+ "README",
20
+ "Rakefile",
21
+ "VERSION.yml",
22
+ "isbn.gemspec",
23
+ "lib/isbn.rb",
24
+ "test/isbn_test.rb",
25
+ "test/test_helper.rb"
26
+ ]
27
+ s.homepage = %q{http://github.com/entangledstate/isbn}
28
+ s.rdoc_options = ["--charset=UTF-8"]
29
+ s.require_paths = ["lib"]
30
+ s.rubygems_version = %q{1.3.4}
31
+ s.summary = %q{a simple library of functions on ISBN's}
32
+ s.test_files = [
33
+ "test/isbn_test.rb",
34
+ "test/test_helper.rb"
35
+ ]
36
+
37
+ if s.respond_to? :specification_version then
38
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
39
+ s.specification_version = 3
40
+
41
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
42
+ else
43
+ end
44
+ else
45
+ end
46
+ end
data/lib/isbn.rb CHANGED
@@ -67,6 +67,15 @@ module ISBN
67
67
  end
68
68
  end
69
69
 
70
+ def book?(isbn)
71
+ begin
72
+ true if (isbn =~ /^(978|290)/i && ten(isbn)) || ten(isbn)
73
+ rescue InvalidISBNError => isbn_error
74
+ false
75
+ end
76
+
77
+ end
78
+
70
79
  class InvalidISBNError < RuntimeError
71
80
  end
72
81
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: entangledstate-isbn
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Kersey
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-04-26 00:00:00 -07:00
12
+ date: 2009-06-03 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -23,14 +23,16 @@ extra_rdoc_files:
23
23
  - LICENSE
24
24
  - README
25
25
  files:
26
+ - .gitignore
26
27
  - LICENSE
28
+ - README
27
29
  - Rakefile
28
30
  - VERSION.yml
31
+ - isbn.gemspec
29
32
  - lib/isbn.rb
30
33
  - test/isbn_test.rb
31
34
  - test/test_helper.rb
32
- - README
33
- has_rdoc: true
35
+ has_rdoc: false
34
36
  homepage: http://github.com/entangledstate/isbn
35
37
  post_install_message:
36
38
  rdoc_options: