4me-sdk 1.1.6 → 2.0.0.pre.rc.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.
@@ -1,10 +1,10 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Sdk4me do
4
- it "should define a default configuration" do
4
+ it 'should define a default configuration' do
5
5
  conf = Sdk4me.configuration.current
6
6
 
7
- expect(conf.keys.sort).to eq([:account, :api_token, :api_version, :block_at_rate_limit, :ca_file, :host, :logger, :max_retry_time, :max_throttle_time, :proxy_host, :proxy_password, :proxy_port, :proxy_user, :read_timeout, :source])
7
+ expect(conf.keys.sort).to eq(%i[access_token account api_token api_version block_at_rate_limit ca_file host logger max_retry_time max_throttle_time proxy_host proxy_password proxy_port proxy_user read_timeout source])
8
8
 
9
9
  expect(conf[:logger].class).to eq(::Logger)
10
10
  expect(conf[:host]).to eq('https://api.4me.com')
@@ -16,18 +16,18 @@ describe Sdk4me do
16
16
 
17
17
  expect(conf[:proxy_port]).to eq(8080)
18
18
 
19
- [:api_token, :account, :source, :proxy_host, :proxy_user, :proxy_password].each do |no_default|
19
+ %i[access_token api_token account source proxy_host proxy_user proxy_password].each do |no_default|
20
20
  expect(conf[no_default]).to be_nil
21
21
  end
22
22
 
23
23
  expect(conf[:ca_file]).to eq('../ca-bundle.crt')
24
24
  end
25
25
 
26
- it "should define a logger" do
26
+ it 'should define a logger' do
27
27
  expect(Sdk4me.logger.class).to eq(::Logger)
28
28
  end
29
29
 
30
- it "should define an exception class" do
31
- expect { raise ::Sdk4me::Exception.new('test') }.to raise_error('test')
30
+ it 'should define an exception class' do
31
+ expect { raise ::Sdk4me::Exception, 'test' }.to raise_error('test')
32
32
  end
33
- end
33
+ end
@@ -1,9 +1,8 @@
1
- # -*- encoding : utf-8 -*-
2
1
  dir = File.dirname(__FILE__)
3
- $LOAD_PATH.unshift dir + '/../lib'
2
+ $LOAD_PATH.unshift "#{dir}/../lib"
4
3
  $LOAD_PATH.unshift dir
5
4
 
6
- STDERR.puts("Running specs using ruby version #{RUBY_VERSION}")
5
+ warn("Running specs using ruby version #{RUBY_VERSION}")
7
6
 
8
7
  require 'simplecov'
9
8
  SimpleCov.start
@@ -26,12 +25,12 @@ require 'sdk4me/client'
26
25
 
27
26
  # Requires supporting ruby files with custom matchers and macros, etc,
28
27
  # in spec/support/ and its subdirectories.
29
- Dir["#{dir}/support/**/*.rb"].each { |f| require f }
28
+ Dir["#{dir}/support/**/*.rb"].sort.each { |f| require f }
30
29
 
31
30
  RSpec.configure do |config|
32
31
  config.before(:each) do
33
- log_dir = File.dirname(__FILE__) + '/log'
34
- Dir.mkdir(log_dir) unless File.exists?(log_dir)
32
+ log_dir = "#{File.dirname(__FILE__)}/log"
33
+ Dir.mkdir(log_dir) unless File.exist?(log_dir)
35
34
  Sdk4me.configuration.logger = Logger.new("#{log_dir}/test.log")
36
35
  @spec_dir = dir
37
36
  @fixture_dir = "#{dir}/support/fixtures"
@@ -43,6 +42,4 @@ RSpec.configure do |config|
43
42
  # the seed, which is printed after each run.
44
43
  # --seed 1234
45
44
  config.order = 'random'
46
-
47
45
  end
48
-
@@ -19,28 +19,23 @@ RSpec::Matchers.define :never_raise do |exception_class|
19
19
  end
20
20
 
21
21
  match do |block|
22
- begin
23
- block.call
24
- rescue exception_class => e
25
- global_result = "expected #{block.source_location[0]}:#{block.source_location[1]} to never raise #{exception_class.name}, but did: #{e.message}"
26
- false # we did NOT never raise this exception
27
-
28
- rescue RSpec::Expectations::ExpectationNotMetError => exception
29
- global_result = "expectation failed inside block at #{block.source_location[0]}:#{block.source_location[1]}: #{exception}"
30
- # give us a pretty error message in addition to the error message from the exception
31
- raise exception
32
-
33
- rescue
34
- # handle other exceptions by reraising them. They are exceptional!!!
35
- # (also, no pretty error messages here)
36
- raise
37
-
38
- else
39
- true # everything ran, nothing raised at all, thus code did in fact not raise anything
40
- end
22
+ block.call
23
+ rescue exception_class => e
24
+ global_result = "expected #{block.source_location[0]}:#{block.source_location[1]} to never raise #{exception_class.name}, but did: #{e.message}"
25
+ false # we did NOT never raise this exception
26
+ rescue RSpec::Expectations::ExpectationNotMetError => e
27
+ global_result = "expectation failed inside block at #{block.source_location[0]}:#{block.source_location[1]}: #{e}"
28
+ # give us a pretty error message in addition to the error message from the exception
29
+ raise e
30
+ rescue StandardError
31
+ # handle other exceptions by reraising them. They are exceptional!!!
32
+ # (also, no pretty error messages here)
33
+ raise
34
+ else
35
+ true # everything ran, nothing raised at all, thus code did in fact not raise anything
41
36
  end
42
37
 
43
- failure_message do |player|
38
+ failure_message do |_player|
44
39
  global_result
45
40
  end
46
- end
41
+ end
@@ -1,3 +1,3 @@
1
1
  def expect_log(text, level = :info, logger = Sdk4me.configuration.logger)
2
- expect(logger).to receive(level).ordered { |&args| expect(args.call).to eq(text) }
3
- end
2
+ expect(logger).to(receive(level).ordered { |&args| expect(args.call).to eq(text) })
3
+ end
metadata CHANGED
@@ -1,43 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: 4me-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.6
4
+ version: 2.0.0.pre.rc.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - 4me
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-11 00:00:00.000000000 Z
11
+ date: 2020-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: gem_config
14
+ name: activesupport
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '0.3'
19
+ version: '4.2'
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.3'
26
+ version: '4.2'
27
27
  - !ruby/object:Gem::Dependency
28
- name: activesupport
28
+ name: gem_config
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '4.2'
33
+ version: '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: '4.2'
40
+ version: '0.3'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: mime-types
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -95,19 +95,19 @@ dependencies:
95
95
  - !ruby/object:Gem::Version
96
96
  version: '3.3'
97
97
  - !ruby/object:Gem::Dependency
98
- name: webmock
98
+ name: rubocop
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - "~>"
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
- version: '2'
103
+ version: 0.49.0
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'
110
+ version: 0.49.0
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: simplecov
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -122,7 +122,21 @@ dependencies:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
- description: SDK for accessing the 4me API
125
+ - !ruby/object:Gem::Dependency
126
+ name: webmock
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '3'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: '3'
139
+ description: SDK for accessing the 4me REST API
126
140
  email: developers@4me.com
127
141
  executables: []
128
142
  extensions: []
@@ -154,7 +168,7 @@ homepage: https://github.com/code4me/4me-sdk-ruby
154
168
  licenses:
155
169
  - MIT
156
170
  metadata: {}
157
- post_install_message:
171
+ post_install_message:
158
172
  rdoc_options:
159
173
  - "--charset=UTF-8"
160
174
  require_paths:
@@ -163,19 +177,19 @@ required_ruby_version: !ruby/object:Gem::Requirement
163
177
  requirements:
164
178
  - - ">="
165
179
  - !ruby/object:Gem::Version
166
- version: 2.0.0
180
+ version: 2.5.0
167
181
  required_rubygems_version: !ruby/object:Gem::Requirement
168
182
  requirements:
169
- - - ">="
183
+ - - ">"
170
184
  - !ruby/object:Gem::Version
171
- version: '0'
185
+ version: 1.3.1
172
186
  requirements: []
173
- rubyforge_project:
174
- rubygems_version: 2.4.6
175
- signing_key:
187
+ rubyforge_project:
188
+ rubygems_version: 2.7.9
189
+ signing_key:
176
190
  specification_version: 4
177
- summary: The official 4me SDK for Ruby. Provides easy access to the APIs found at
178
- https://developer.4me.com
191
+ summary: The official 4me SDK for Ruby. Provides easy access to the REST APIs found
192
+ at https://developer.4me.com
179
193
  test_files:
180
194
  - spec/lib/sdk4me/attachments_spec.rb
181
195
  - spec/lib/sdk4me/certificate_spec.rb