diff --git a/Gemfile b/Gemfile index 070d22b..1d27135 100644 --- a/Gemfile +++ b/Gemfile @@ -2,4 +2,4 @@ source "https://rubygems.org" gemspec gem 'rspec' -gem 'curly-lib' +gem 'curly-lib', '~> 0.0.1' diff --git a/Gemfile.lock b/Gemfile.lock index 81a94ef..5d1fac7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,28 +2,33 @@ PATH remote: . specs: webservice-swigclient (0.0.1) + curly-lib (~> 0.0.1) GEM remote: https://rubygems.org/ specs: curly-lib (0.0.1) diff-lcs (1.2.5) - rake (10.1.1) - rspec (2.14.1) - rspec-core (~> 2.14.0) - rspec-expectations (~> 2.14.0) - rspec-mocks (~> 2.14.0) - rspec-core (2.14.8) - rspec-expectations (2.14.5) - diff-lcs (>= 1.1.3, < 2.0) - rspec-mocks (2.14.6) + rake (10.3.2) + rspec (3.0.0) + rspec-core (~> 3.0.0) + rspec-expectations (~> 3.0.0) + rspec-mocks (~> 3.0.0) + rspec-core (3.0.1) + rspec-support (~> 3.0.0) + rspec-expectations (3.0.1) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.0.0) + rspec-mocks (3.0.1) + rspec-support (~> 3.0.0) + rspec-support (3.0.0) PLATFORMS ruby DEPENDENCIES bundler (~> 1.3) - curly-lib + curly-lib (~> 0.0.1) rake rspec webservice-swigclient! diff --git a/lib/WebService/SwigClient.rb b/lib/WebService/SwigClient.rb index 74d7384..4b95e9f 100644 --- a/lib/WebService/SwigClient.rb +++ b/lib/WebService/SwigClient.rb @@ -9,7 +9,7 @@ def initialize(params) end def render(path, data) - url = [@service_url, @api_key, path].join("/"); + url = (@api_key ? [@service_url, @api_key, path] : [@service_url, path]).join("/"); response = Curly::Request.post(url, headers: { 'Content-type' => 'application/json' }, body: data.to_json) if ( !response.success? ) diff --git a/webservice-swigclient-ruby.gemspec b/webservice-swigclient.gemspec similarity index 75% rename from webservice-swigclient-ruby.gemspec rename to webservice-swigclient.gemspec index 5e271a3..3446f43 100644 --- a/webservice-swigclient-ruby.gemspec +++ b/webservice-swigclient.gemspec @@ -1,11 +1,6 @@ -# coding: utf-8 -lib = File.expand_path('../lib', __FILE__) -$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) -require 'webservice/swigclient' - Gem::Specification.new do |spec| spec.name = "webservice-swigclient" - spec.version = WebServiceSwigClient::VERSION + spec.version = '0.0.1' spec.authors = ["Logan Bell"] spec.email = ["lbell@shutterstock.com"] spec.description = %q{A client for swig.io!} @@ -18,6 +13,7 @@ Gem::Specification.new do |spec| spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ["lib"] + spec.add_dependency "curly-lib", "~> 0.0.1" spec.add_development_dependency "bundler", "~> 1.3" spec.add_development_dependency "rake" end