Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #18 from Ruberto/update_gemfile
Browse files Browse the repository at this point in the history
Fix dependency issues
  • Loading branch information
Chase Lee authored Mar 14, 2017
2 parents 8fd5487 + 3b78632 commit 029e4c8
Show file tree
Hide file tree
Showing 6 changed files with 89 additions and 79 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ gemspec

group :debug do
gem 'debugger', :platforms => [:mri_19]
gem 'byebug', :platforms => [:mri_20, :mri_21]
gem 'byebug', :platforms => [:mri_20, :mri_21, :mri_22, :mri_23, :mri_24]
end
101 changes: 55 additions & 46 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,71 +1,80 @@
PATH
remote: .
specs:
mbsy (1.0.4)
httparty (>= 0.8.3)
json (>= 1.7.3)
mbsy (1.1.4)
httparty (= 0.14.0)
json (= 2.0.3)

GEM
remote: https://rubygems.org/
specs:
activesupport (4.1.1)
i18n (~> 0.6, >= 0.6.9)
json (~> 1.7, >= 1.7.7)
activesupport (5.0.2)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (~> 0.7)
minitest (~> 5.1)
thread_safe (~> 0.1)
tzinfo (~> 1.1)
addressable (2.3.6)
byebug (3.1.2)
columnize (~> 0.8)
debugger-linecache (~> 1.2)
columnize (0.8.9)
crack (0.4.2)
addressable (2.5.0)
public_suffix (~> 2.0, >= 2.0.2)
byebug (9.0.6)
columnize (0.9.0)
concurrent-ruby (1.0.5)
crack (0.4.3)
safe_yaml (~> 1.0.0)
debugger (1.6.6)
debugger (1.6.8)
columnize (>= 0.3.1)
debugger-linecache (~> 1.2.0)
debugger-ruby_core_source (~> 1.3.2)
debugger-ruby_core_source (~> 1.3.5)
debugger-linecache (1.2.0)
debugger-ruby_core_source (1.3.4)
diff-lcs (1.2.5)
faker (1.3.0)
debugger-ruby_core_source (1.3.8)
diff-lcs (1.3)
faker (1.7.3)
i18n (~> 0.5)
httparty (0.13.1)
json (~> 1.8)
hashdiff (0.3.2)
httparty (0.14.0)
multi_xml (>= 0.5.2)
i18n (0.6.9)
json (1.8.1)
minitest (5.3.3)
multi_xml (0.5.5)
rake (10.3.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)
safe_yaml (1.0.3)
shoulda-matchers (2.6.1)
activesupport (>= 3.0.0)
thread_safe (0.3.3)
tzinfo (1.1.0)
i18n (0.8.1)
json (2.0.3)
minitest (5.10.1)
multi_xml (0.6.0)
public_suffix (2.0.5)
rake (12.0.0)
rspec (3.5.0)
rspec-core (~> 3.5.0)
rspec-expectations (~> 3.5.0)
rspec-mocks (~> 3.5.0)
rspec-core (3.5.4)
rspec-support (~> 3.5.0)
rspec-expectations (3.5.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.5.0)
rspec-mocks (3.5.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.5.0)
rspec-support (3.5.0)
safe_yaml (1.0.4)
shoulda-matchers (3.1.1)
activesupport (>= 4.0.0)
thread_safe (0.3.6)
tzinfo (1.2.2)
thread_safe (~> 0.1)
webmock (1.17.4)
addressable (>= 2.2.7)
webmock (2.3.2)
addressable (>= 2.3.6)
crack (>= 0.3.2)
hashdiff

PLATFORMS
ruby

DEPENDENCIES
activesupport (>= 3.2.18)
activesupport (= 5.0.2)
byebug
debugger
faker (~> 1.3.0)
faker (= 1.7.3)
mbsy!
rake (>= 0.9.2)
rspec (~> 2.14.1)
shoulda-matchers (= 2.6.1)
webmock (~> 1.17.4)
rake (= 12.0.0)
rspec (= 3.5.0)
shoulda-matchers (= 3.1.1)
webmock (= 2.3.2)

BUNDLED WITH
1.13.7
46 changes: 24 additions & 22 deletions lib/mbsy/resources/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,33 @@ class Base
default_timeout 30
default_params :output => 'json'

def self.element_name
name.split(/::/).last.underscore
end
class << self
def element_name
name.split(/::/).last.underscore
end

def self.api_url(method)
Mbsy.site_uri + self.element_name + '/' + method
end

def self.call(method, params = {})
response = JSON.parse(self.get(api_url(method), :query => params).body)['response']
case response['code']
when '200' # Nothing to do here...
when '400'
raise BadRequestError.new(response['errors']['error'])
when '401'
raise UnauthorizedError.new(response['errors']['error'])
when '404'
raise RecordNotFound.new(response['errors']['error'])
when '500'
raise ServerError.new(response['errors']['error'])
else
raise BadResponse.new(response: response)
def api_url(method)
Mbsy.site_uri + element_name + '/' + method
end

response['data']
def call(method, params = {})
response = JSON.parse(self.get(api_url(method), :query => params).body)['response']
case response['code']
when '200' # Nothing to do here...
when '400'
raise BadRequestError.new(response['errors']['error'])
when '401'
raise UnauthorizedError.new(response['errors']['error'])
when '404'
raise RecordNotFound.new(response['errors']['error'])
when '500'
raise ServerError.new(response['errors']['error'])
else
raise BadResponse.new(response: response)
end

response['data']
end
end
end
end
2 changes: 1 addition & 1 deletion lib/mbsy/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Mbsy
VERSION = '1.1.3'
VERSION = '2.0.0'
end
16 changes: 8 additions & 8 deletions mbsy.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ Gem::Specification.new do |s|

s.required_ruby_version = ">= 1.9.2"

s.add_runtime_dependency('httparty', '>= 0.8.3')
s.add_runtime_dependency('json', '>= 1.7.3')
s.add_runtime_dependency('httparty', '0.14.0')
s.add_runtime_dependency('json', '2.0.3')

s.add_development_dependency('rake', '>= 0.9.2')
s.add_development_dependency('rspec', '~> 2.14.1')
s.add_development_dependency('webmock', '~> 1.17.4')
s.add_development_dependency('faker', '~> 1.3.0')
s.add_development_dependency('shoulda-matchers', '2.6.1')
s.add_development_dependency('activesupport', '>= 3.2.18')
s.add_development_dependency('rake', '12.0.0')
s.add_development_dependency('rspec', '3.5.0')
s.add_development_dependency('webmock', '2.3.2')
s.add_development_dependency('faker', '1.7.3')
s.add_development_dependency('shoulda-matchers', '3.1.1')
s.add_development_dependency('activesupport', '5.0.2')
end
1 change: 0 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ def configure_mbsy!

# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
RSpec.configure do |config|
config.treat_symbols_as_metadata_keys_with_true_values = true
config.run_all_when_everything_filtered = true
config.filter_run :focus

Expand Down

0 comments on commit 029e4c8

Please sign in to comment.