mbsy 1.1.3 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6035a3e989602a86a5e528cd9826ef9814bfe985
4
- data.tar.gz: e44705941ef0a828969474b50913381cd155dc12
3
+ metadata.gz: 6d3618bdce8667625e910296777d7f28cf4aab7b
4
+ data.tar.gz: 49c3a9e7c2d35ef64634466093f3c83407596e5f
5
5
  SHA512:
6
- metadata.gz: dd60d1272c27c98be9286bad0b5d960902c03ca8523e753e63d0e961a4aa0ee13d11c4c8dce4d7d800840099955172248f7200307c7cd2dd7aee05be28723ab6
7
- data.tar.gz: 3a806d8207ebc69074f59ca90c34d3c7d74731389bb0eb8f40bb59bff68cd11fa0bb62cbf85ec2d7755a5ffe50cb994a9207c042a65c899a1adcc525273bd172
6
+ metadata.gz: 3ba3efedf178cba35d33221d83ec2edbd766ed977b818863119c7d9ab060304687a00f1a94fc35c5fe52ce520c8e64e4251d54213e54b541550ed1747d0a52dc
7
+ data.tar.gz: 84484d793561875f9c7ed6c1d7ecab67064c6362dd071187d4119059f894e4a51b68fd1f69c45f62236d123fe1beb251f5005f9341e8c4e362685206c770251c
data/Gemfile CHANGED
@@ -4,5 +4,5 @@ gemspec
4
4
 
5
5
  group :debug do
6
6
  gem 'debugger', :platforms => [:mri_19]
7
- gem 'byebug', :platforms => [:mri_20, :mri_21]
7
+ gem 'byebug', :platforms => [:mri_20, :mri_21, :mri_22, :mri_23, :mri_24]
8
8
  end
data/Gemfile.lock CHANGED
@@ -1,71 +1,80 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- mbsy (1.0.4)
5
- httparty (>= 0.8.3)
6
- json (>= 1.7.3)
4
+ mbsy (1.1.4)
5
+ httparty (= 0.14.0)
6
+ json (= 2.0.3)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- activesupport (4.1.1)
12
- i18n (~> 0.6, >= 0.6.9)
13
- json (~> 1.7, >= 1.7.7)
11
+ activesupport (5.0.2)
12
+ concurrent-ruby (~> 1.0, >= 1.0.2)
13
+ i18n (~> 0.7)
14
14
  minitest (~> 5.1)
15
- thread_safe (~> 0.1)
16
15
  tzinfo (~> 1.1)
17
- addressable (2.3.6)
18
- byebug (3.1.2)
19
- columnize (~> 0.8)
20
- debugger-linecache (~> 1.2)
21
- columnize (0.8.9)
22
- crack (0.4.2)
16
+ addressable (2.5.0)
17
+ public_suffix (~> 2.0, >= 2.0.2)
18
+ byebug (9.0.6)
19
+ columnize (0.9.0)
20
+ concurrent-ruby (1.0.5)
21
+ crack (0.4.3)
23
22
  safe_yaml (~> 1.0.0)
24
- debugger (1.6.6)
23
+ debugger (1.6.8)
25
24
  columnize (>= 0.3.1)
26
25
  debugger-linecache (~> 1.2.0)
27
- debugger-ruby_core_source (~> 1.3.2)
26
+ debugger-ruby_core_source (~> 1.3.5)
28
27
  debugger-linecache (1.2.0)
29
- debugger-ruby_core_source (1.3.4)
30
- diff-lcs (1.2.5)
31
- faker (1.3.0)
28
+ debugger-ruby_core_source (1.3.8)
29
+ diff-lcs (1.3)
30
+ faker (1.7.3)
32
31
  i18n (~> 0.5)
33
- httparty (0.13.1)
34
- json (~> 1.8)
32
+ hashdiff (0.3.2)
33
+ httparty (0.14.0)
35
34
  multi_xml (>= 0.5.2)
36
- i18n (0.6.9)
37
- json (1.8.1)
38
- minitest (5.3.3)
39
- multi_xml (0.5.5)
40
- rake (10.3.1)
41
- rspec (2.14.1)
42
- rspec-core (~> 2.14.0)
43
- rspec-expectations (~> 2.14.0)
44
- rspec-mocks (~> 2.14.0)
45
- rspec-core (2.14.8)
46
- rspec-expectations (2.14.5)
47
- diff-lcs (>= 1.1.3, < 2.0)
48
- rspec-mocks (2.14.6)
49
- safe_yaml (1.0.3)
50
- shoulda-matchers (2.6.1)
51
- activesupport (>= 3.0.0)
52
- thread_safe (0.3.3)
53
- tzinfo (1.1.0)
35
+ i18n (0.8.1)
36
+ json (2.0.3)
37
+ minitest (5.10.1)
38
+ multi_xml (0.6.0)
39
+ public_suffix (2.0.5)
40
+ rake (12.0.0)
41
+ rspec (3.5.0)
42
+ rspec-core (~> 3.5.0)
43
+ rspec-expectations (~> 3.5.0)
44
+ rspec-mocks (~> 3.5.0)
45
+ rspec-core (3.5.4)
46
+ rspec-support (~> 3.5.0)
47
+ rspec-expectations (3.5.0)
48
+ diff-lcs (>= 1.2.0, < 2.0)
49
+ rspec-support (~> 3.5.0)
50
+ rspec-mocks (3.5.0)
51
+ diff-lcs (>= 1.2.0, < 2.0)
52
+ rspec-support (~> 3.5.0)
53
+ rspec-support (3.5.0)
54
+ safe_yaml (1.0.4)
55
+ shoulda-matchers (3.1.1)
56
+ activesupport (>= 4.0.0)
57
+ thread_safe (0.3.6)
58
+ tzinfo (1.2.2)
54
59
  thread_safe (~> 0.1)
55
- webmock (1.17.4)
56
- addressable (>= 2.2.7)
60
+ webmock (2.3.2)
61
+ addressable (>= 2.3.6)
57
62
  crack (>= 0.3.2)
63
+ hashdiff
58
64
 
59
65
  PLATFORMS
60
66
  ruby
61
67
 
62
68
  DEPENDENCIES
63
- activesupport (>= 3.2.18)
69
+ activesupport (= 5.0.2)
64
70
  byebug
65
71
  debugger
66
- faker (~> 1.3.0)
72
+ faker (= 1.7.3)
67
73
  mbsy!
68
- rake (>= 0.9.2)
69
- rspec (~> 2.14.1)
70
- shoulda-matchers (= 2.6.1)
71
- webmock (~> 1.17.4)
74
+ rake (= 12.0.0)
75
+ rspec (= 3.5.0)
76
+ shoulda-matchers (= 3.1.1)
77
+ webmock (= 2.3.2)
78
+
79
+ BUNDLED WITH
80
+ 1.13.7
@@ -12,31 +12,33 @@ module Mbsy
12
12
  default_timeout 30
13
13
  default_params :output => 'json'
14
14
 
15
- def self.element_name
16
- name.split(/::/).last.underscore
17
- end
15
+ class << self
16
+ def element_name
17
+ name.split(/::/).last.underscore
18
+ end
18
19
 
19
- def self.api_url(method)
20
- Mbsy.site_uri + self.element_name + '/' + method
21
- end
22
-
23
- def self.call(method, params = {})
24
- response = JSON.parse(self.get(api_url(method), :query => params).body)['response']
25
- case response['code']
26
- when '200' # Nothing to do here...
27
- when '400'
28
- raise BadRequestError.new(response['errors']['error'])
29
- when '401'
30
- raise UnauthorizedError.new(response['errors']['error'])
31
- when '404'
32
- raise RecordNotFound.new(response['errors']['error'])
33
- when '500'
34
- raise ServerError.new(response['errors']['error'])
35
- else
36
- raise BadResponse.new(response: response)
20
+ def api_url(method)
21
+ Mbsy.site_uri + element_name + '/' + method
37
22
  end
38
23
 
39
- response['data']
24
+ def call(method, params = {})
25
+ response = JSON.parse(self.get(api_url(method), :query => params).body)['response']
26
+ case response['code']
27
+ when '200' # Nothing to do here...
28
+ when '400'
29
+ raise BadRequestError.new(response['errors']['error'])
30
+ when '401'
31
+ raise UnauthorizedError.new(response['errors']['error'])
32
+ when '404'
33
+ raise RecordNotFound.new(response['errors']['error'])
34
+ when '500'
35
+ raise ServerError.new(response['errors']['error'])
36
+ else
37
+ raise BadResponse.new(response: response)
38
+ end
39
+
40
+ response['data']
41
+ end
40
42
  end
41
43
  end
42
44
  end
data/lib/mbsy/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Mbsy
2
- VERSION = '1.1.3'
2
+ VERSION = '2.0.0'
3
3
  end
data/mbsy.gemspec CHANGED
@@ -19,13 +19,13 @@ Gem::Specification.new do |s|
19
19
 
20
20
  s.required_ruby_version = ">= 1.9.2"
21
21
 
22
- s.add_runtime_dependency('httparty', '>= 0.8.3')
23
- s.add_runtime_dependency('json', '>= 1.7.3')
22
+ s.add_runtime_dependency('httparty', '0.14.0')
23
+ s.add_runtime_dependency('json', '2.0.3')
24
24
 
25
- s.add_development_dependency('rake', '>= 0.9.2')
26
- s.add_development_dependency('rspec', '~> 2.14.1')
27
- s.add_development_dependency('webmock', '~> 1.17.4')
28
- s.add_development_dependency('faker', '~> 1.3.0')
29
- s.add_development_dependency('shoulda-matchers', '2.6.1')
30
- s.add_development_dependency('activesupport', '>= 3.2.18')
25
+ s.add_development_dependency('rake', '12.0.0')
26
+ s.add_development_dependency('rspec', '3.5.0')
27
+ s.add_development_dependency('webmock', '2.3.2')
28
+ s.add_development_dependency('faker', '1.7.3')
29
+ s.add_development_dependency('shoulda-matchers', '3.1.1')
30
+ s.add_development_dependency('activesupport', '5.0.2')
31
31
  end
data/spec/spec_helper.rb CHANGED
@@ -19,7 +19,6 @@ configure_mbsy!
19
19
 
20
20
  # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
21
21
  RSpec.configure do |config|
22
- config.treat_symbols_as_metadata_keys_with_true_values = true
23
22
  config.run_all_when_everything_filtered = true
24
23
  config.filter_run :focus
25
24
 
metadata CHANGED
@@ -1,136 +1,136 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mbsy
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Mullen, Chase Lee
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-22 00:00:00.000000000 Z
11
+ date: 2017-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.8.3
19
+ version: 0.14.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 0.8.3
26
+ version: 0.14.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: json
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 1.7.3
33
+ version: 2.0.3
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 1.7.3
40
+ version: 2.0.3
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: 0.9.2
47
+ version: 12.0.0
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: 0.9.2
54
+ version: 12.0.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: 2.14.1
61
+ version: 3.5.0
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - '='
67
67
  - !ruby/object:Gem::Version
68
- version: 2.14.1
68
+ version: 3.5.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: webmock
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - '='
74
74
  - !ruby/object:Gem::Version
75
- version: 1.17.4
75
+ version: 2.3.2
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - '='
81
81
  - !ruby/object:Gem::Version
82
- version: 1.17.4
82
+ version: 2.3.2
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: faker
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - "~>"
87
+ - - '='
88
88
  - !ruby/object:Gem::Version
89
- version: 1.3.0
89
+ version: 1.7.3
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - "~>"
94
+ - - '='
95
95
  - !ruby/object:Gem::Version
96
- version: 1.3.0
96
+ version: 1.7.3
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: shoulda-matchers
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - '='
102
102
  - !ruby/object:Gem::Version
103
- version: 2.6.1
103
+ version: 3.1.1
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - '='
109
109
  - !ruby/object:Gem::Version
110
- version: 2.6.1
110
+ version: 3.1.1
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: activesupport
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - ">="
115
+ - - '='
116
116
  - !ruby/object:Gem::Version
117
- version: 3.2.18
117
+ version: 5.0.2
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - ">="
122
+ - - '='
123
123
  - !ruby/object:Gem::Version
124
- version: 3.2.18
124
+ version: 5.0.2
125
125
  description: ''
126
126
  email: support@getambassador.com
127
127
  executables: []
128
128
  extensions: []
129
129
  extra_rdoc_files: []
130
130
  files:
131
- - ".document"
132
- - ".gitignore"
133
- - ".rspec"
131
+ - .document
132
+ - .gitignore
133
+ - .rspec
134
134
  - Gemfile
135
135
  - Gemfile.lock
136
136
  - LICENSE
@@ -166,17 +166,17 @@ require_paths:
166
166
  - lib
167
167
  required_ruby_version: !ruby/object:Gem::Requirement
168
168
  requirements:
169
- - - ">="
169
+ - - '>='
170
170
  - !ruby/object:Gem::Version
171
171
  version: 1.9.2
172
172
  required_rubygems_version: !ruby/object:Gem::Requirement
173
173
  requirements:
174
- - - ">="
174
+ - - '>='
175
175
  - !ruby/object:Gem::Version
176
176
  version: '0'
177
177
  requirements: []
178
178
  rubyforge_project:
179
- rubygems_version: 2.4.3
179
+ rubygems_version: 2.0.14.1
180
180
  signing_key:
181
181
  specification_version: 4
182
182
  summary: A Ruby wrapper for the Ambassador API