book_worm 0.0.2 → 0.0.3

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/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- book_worm (0.0.1)
4
+ book_worm (0.0.2)
5
5
  httparty
6
6
 
7
7
  GEM
@@ -1,6 +1,5 @@
1
1
  module BookWorm
2
2
  class Book
3
-
4
3
  attr_accessor :publisher, :authors, :isbn,
5
4
  :isbn13, :title, :long_title,
6
5
  :book_id
@@ -1,6 +1,12 @@
1
1
  module BookWorm
2
- class Configuration
3
- # supply your ISBNDB.com API key here
4
- API_KEY = ''
2
+ module Configuration
3
+ extend self
4
+
5
+ attr_accessor :config
6
+ @config = {}
7
+
8
+ def configure
9
+ yield @config
10
+ end
5
11
  end
6
12
  end
@@ -54,7 +54,7 @@ module BookWorm
54
54
  def query_isbndb(index, value)
55
55
  get(query_base, :query => { :index1 => index,
56
56
  :value1 => value,
57
- :access_key => Configuration::API_KEY, })
57
+ :access_key => Configuration.config[:api_key], })
58
58
  end
59
59
 
60
60
  def normalize(results)
@@ -1,3 +1,3 @@
1
1
  module BookWorm
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
data/lib/book_worm.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  module BookWorm
2
+ require 'book_worm/configuration'
2
3
  require 'book_worm/searchable'
3
4
  extend Searchable
4
5
  end
data/spec/spec_helper.rb CHANGED
@@ -1 +1,7 @@
1
1
  require 'rspec'
2
+ require 'book_worm'
3
+
4
+ BookWorm::Configuration.configure do |c|
5
+ c[:api_key] = "Your API key"
6
+ end
7
+
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 2
9
- version: 0.0.2
8
+ - 3
9
+ version: 0.0.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Tony Schneider