productwars-api 0.1.1 → 0.1.2

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/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.1.2
@@ -11,12 +11,11 @@ module ProductWars
11
11
  include HTTParty
12
12
 
13
13
  ### HTTParty Config ###
14
- #@base_uri = 'www.productwars.com/api/v1'
15
- base_uri 'productwars.com/api/v1'
16
14
  format :json
17
15
  #######################
18
16
 
19
17
  def self.dispatch(method, *args, &block)
18
+ base_uri "#{ProductWars.domain}/api/v1"
20
19
  response = self.send(method, *args, &block)
21
20
  self.handle(response)
22
21
  end
data/lib/productwars.rb CHANGED
@@ -1,6 +1,12 @@
1
1
  require 'productwars/client'
2
2
 
3
3
  module ProductWars
4
+ extend self
5
+
6
+ attr_accessor :domain
7
+
8
+ self.domain = 'productwars.com'
9
+
4
10
  def self.method_missing(method, *args, &block)
5
11
  return super unless Client.respond_to?(method)
6
12
  Client.dispatch(method, *args, &block)
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{productwars-api}
8
- s.version = "0.1.1"
8
+ s.version = "0.1.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Spencer Rogers"]
@@ -1,6 +1,4 @@
1
1
  require 'spec_helper'
2
- require 'product_wars'
3
- require 'errors'
4
2
 
5
3
  PRODUCT_KEYS = [
6
4
  "active",
data/spec/spec_helper.rb CHANGED
@@ -1,6 +1,9 @@
1
1
  require 'vcr'
2
2
  require 'ruby-debug'
3
3
 
4
+ require File.expand_path('../../lib/productwars', __FILE__)
5
+ require File.expand_path('../../lib/productwars/errors', __FILE__)
6
+
4
7
  VCR.config do |c|
5
8
  c.cassette_library_dir = 'spec/cassettes'
6
9
  c.stub_with :fakeweb
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: productwars-api
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 31
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 1
10
- version: 0.1.1
9
+ - 2
10
+ version: 0.1.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Spencer Rogers