Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the api key optional and set spec version #1

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ source "https://rubygems.org"

gemspec
gem 'rspec'
gem 'curly-lib'
gem 'curly-lib', '~> 0.0.1'
25 changes: 15 additions & 10 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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!
2 changes: 1 addition & 1 deletion lib/WebService/SwigClient.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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? )
Expand Down
Original file line number Diff line number Diff line change
@@ -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 = ["[email protected]"]
spec.description = %q{A client for swig.io!}
Expand All @@ -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