vertebrae 0.6.0 → 0.6.2

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
  SHA256:
3
- metadata.gz: 8a127ed3c3ce7a22967fa09eae2b4bc98cf639fb9693649b2c1663416b468618
4
- data.tar.gz: 3f75cc3d7c14f548f32ab29b1ca5b6b6b46425ff5d4417496b22503d3e65e4a8
3
+ metadata.gz: cf3a9bf8bfca0580686334117e85642dd95ac68ccd6ed92970bc6b264ad8981c
4
+ data.tar.gz: b0a4495f29d0a76490661212d6309b09c42e13efc8f97836d5c6feb2382c6748
5
5
  SHA512:
6
- metadata.gz: a8499defca92293f4b1110dcc0422f0cb36a8e608bc5b2de86ec6c2a39c5dcb8f4f424717f93a97ce2c2afe4fcb4352800eddba995cfeaa97a11657aded50016
7
- data.tar.gz: 5480943d624d3aa6a612398eecff6c8356659bde77b1e4fc88ab0c4b38159268f1a00536a7fa6a31affb700607366ac01333053525e1519ae6c1adb53903d362
6
+ metadata.gz: c82f9f65cae54ccdc589f01c098c6f502bf33d11d31f9c2b47d9bacf348b7a2efc481b6655a8a9d253c5c24059eb71b0eca99e6e13b9e5071eb89a8886b09b38
7
+ data.tar.gz: 7319717ad0841ec271dfbc9333d4d86297ac6f5da70b65a4359c73d0f01758a62614dce82efac8219ed7895684acca3ea146c07bd9a84caed032473e0d85048e
@@ -0,0 +1,26 @@
1
+ AllCops:
2
+ DisabledByDefault: true
3
+
4
+ Security:
5
+ Enabled: true
6
+
7
+ Bundler/DuplicatedGem:
8
+ Enabled: true
9
+ Bundler/InsecureProtocolSource:
10
+ Enabled: true
11
+ Layout/IndentationStyle:
12
+ Enabled: true
13
+ Layout/SpaceInsideRangeLiteral:
14
+ Enabled: true
15
+ Lint:
16
+ Enabled: true
17
+ Lint/RaiseException:
18
+ Enabled: true
19
+ Naming/AsciiIdentifiers:
20
+ Enabled: true
21
+ Naming/ClassAndModuleCamelCase:
22
+ Enabled: true
23
+ Naming/ConstantName:
24
+ Enabled: true
25
+ Naming/FileName:
26
+ Enabled: true
@@ -1 +1 @@
1
- 2.6.5
1
+ 2.6.6
@@ -1,3 +1,9 @@
1
1
  language: ruby
2
2
  rvm:
3
- - "2.4.2"
3
+ - 2.6
4
+ cache: bundler
5
+ before_install:
6
+ - gem install bundler
7
+ script:
8
+ - bundle exec rspec
9
+ - bundle exec rubocop
data/Gemfile CHANGED
@@ -1,9 +1,9 @@
1
1
  source "http://rubygems.org"
2
2
 
3
- gem 'activesupport', '~> 5.1', '>= 5.1.4'
4
- gem 'faraday', '>= 0.9.2'
5
- gem 'faraday_middleware', '~> 0.12', '>= 0.12.2'
6
- gem 'hashie', '~> 3.5', '>= 3.5.7'
3
+ gem 'activesupport', '>= 5.1.4'
4
+ gem 'faraday', '> 0.9.2'
5
+ gem 'faraday_middleware', '> 0.12.2'
6
+ gem 'hashie', '> 3.5.7'
7
7
 
8
8
  # Add dependencies to develop your gem here.
9
9
  # Include everything needed to run rake, tests, features, etc.
@@ -12,5 +12,6 @@ group :development do
12
12
  gem "bundler"
13
13
  gem "webmock"
14
14
  gem "rspec-its"
15
- gem "juwelier"
15
+ gem "juwelier", git: 'git@github.com:flajann2/juwelier.git'
16
+ gem "rubocop"
16
17
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.0
1
+ 0.6.2
data/lib/api.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Vertebrae
2
4
  class API
3
5
  include Request
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Vertebrae
2
4
  module Authorization
3
5
  def username?
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Vertebrae
2
4
  module Base
3
5
  def logger
@@ -20,7 +22,7 @@ module Vertebrae
20
22
 
21
23
  # implement this in your api
22
24
  #
23
- def new(options = {}, &block)
25
+ def new(_options = {}, &_block)
24
26
  raise "implement me!"
25
27
  end
26
28
 
@@ -36,4 +38,4 @@ module Vertebrae
36
38
  new.respond_to?(method, include_private) || super(method, include_private)
37
39
  end
38
40
  end
39
- end
41
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Vertebrae
2
4
  class Configuration
3
5
  include Vertebrae::Constants
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'faraday'
2
4
  require 'faraday_middleware'
3
5
  require 'response/raise_error'
@@ -8,7 +10,7 @@ module Vertebrae
8
10
  include Vertebrae::Constants
9
11
  include Vertebrae::Authorization
10
12
 
11
- attr_accessor :options
13
+ attr_reader :options
12
14
  attr_accessor :configuration
13
15
 
14
16
  ALLOWED_OPTIONS = [
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Vertebrae
2
4
  module Constants
3
5
  extend self
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class Array
2
4
  def extract_options!
3
5
  last.is_a?(::Hash) ? pop : {}
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Vertebrae
2
4
  class Model
3
5
  attr_accessor :client
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Vertebrae
2
4
  class Railties < ::Rails::Railtie
3
5
  initializer 'Rails logger' do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Vertebrae
2
4
  module Request
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Vertebrae
2
4
  module Response
3
5
  class RaiseError < Faraday::Response::Middleware
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Vertebrae
2
4
  class ResponseError < StandardError
3
5
  attr_reader :status_code
@@ -10,7 +12,7 @@ module Vertebrae
10
12
  private
11
13
 
12
14
  def error_message(response)
13
- "#{response[:method].to_s.upcase} #{response[:url].to_s}: #{response[:status]} \n\n #{response[:body] if response[:body]}"
15
+ "#{response[:method].to_s.upcase} #{response[:url]}: #{response[:status]} \n\n #{response[:body] if response[:body]}"
14
16
  end
15
17
  end
16
- end
18
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'active_support/all'
2
4
 
3
5
  require 'constants'
@@ -10,10 +12,8 @@ require 'api'
10
12
  require 'base'
11
13
  require 'model'
12
14
 
13
-
14
15
  require 'railties' if defined? Rails
15
16
 
16
-
17
17
  module Vertebrae
18
18
 
19
19
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe Vertebrae::API do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe Vertebrae::Configuration do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe 'logging' do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe Vertebrae::Request do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
2
4
  $LOAD_PATH.unshift(File.dirname(__FILE__))
3
5
  require 'rspec'
@@ -10,7 +12,7 @@ require 'rspec/its'
10
12
 
11
13
  # Requires supporting files with custom matchers and macros, etc,
12
14
  # in ./support/ and its subdirectories.
13
- Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
15
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].sort.each {|f| require f}
14
16
 
15
17
  RSpec.configure do |config|
16
18
  config.mock_with :rspec do |mocks|
@@ -24,7 +26,7 @@ end
24
26
 
25
27
 
26
28
  def reset_authentication_for(object)
27
- ['username', 'password'].each do |item|
29
+ %w[username password].each do |item|
28
30
  Vertebrae::Base.send("#{item}=", nil)
29
31
  object.send("#{item}=", nil)
30
32
  end
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: vertebrae 0.6.0 ruby lib
5
+ # stub: vertebrae 0.6.2 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "vertebrae".freeze
9
- s.version = "0.6.0"
9
+ s.version = "0.6.2"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib".freeze]
13
13
  s.authors = ["Nathan Woodhull".freeze]
14
- s.date = "2020-04-27"
14
+ s.date = "2020-06-06"
15
15
  s.description = "A set of low level infrastructure and reusable code for building API clients".freeze
16
16
  s.email = "nathan@controlshiftlabs.com".freeze
17
17
  s.extra_rdoc_files = [
@@ -21,6 +21,7 @@ Gem::Specification.new do |s|
21
21
  s.files = [
22
22
  ".document",
23
23
  ".rspec",
24
+ ".rubocop.yml",
24
25
  ".ruby-gemset",
25
26
  ".ruby-version",
26
27
  ".travis.yml",
@@ -60,36 +61,39 @@ Gem::Specification.new do |s|
60
61
  s.specification_version = 4
61
62
 
62
63
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
63
- s.add_runtime_dependency(%q<activesupport>.freeze, ["~> 5.1", ">= 5.1.4"])
64
- s.add_runtime_dependency(%q<faraday>.freeze, [">= 0.9.2"])
65
- s.add_runtime_dependency(%q<faraday_middleware>.freeze, ["~> 0.12", ">= 0.12.2"])
66
- s.add_runtime_dependency(%q<hashie>.freeze, ["~> 3.5", ">= 3.5.7"])
64
+ s.add_runtime_dependency(%q<activesupport>.freeze, [">= 5.1.4"])
65
+ s.add_runtime_dependency(%q<faraday>.freeze, ["> 0.9.2"])
66
+ s.add_runtime_dependency(%q<faraday_middleware>.freeze, ["> 0.12.2"])
67
+ s.add_runtime_dependency(%q<hashie>.freeze, ["> 3.5.7"])
67
68
  s.add_development_dependency(%q<rspec>.freeze, [">= 0"])
68
69
  s.add_development_dependency(%q<bundler>.freeze, [">= 0"])
69
70
  s.add_development_dependency(%q<webmock>.freeze, [">= 0"])
70
71
  s.add_development_dependency(%q<rspec-its>.freeze, [">= 0"])
71
72
  s.add_development_dependency(%q<juwelier>.freeze, [">= 0"])
73
+ s.add_development_dependency(%q<rubocop>.freeze, [">= 0"])
72
74
  else
73
- s.add_dependency(%q<activesupport>.freeze, ["~> 5.1", ">= 5.1.4"])
74
- s.add_dependency(%q<faraday>.freeze, [">= 0.9.2"])
75
- s.add_dependency(%q<faraday_middleware>.freeze, ["~> 0.12", ">= 0.12.2"])
76
- s.add_dependency(%q<hashie>.freeze, ["~> 3.5", ">= 3.5.7"])
75
+ s.add_dependency(%q<activesupport>.freeze, [">= 5.1.4"])
76
+ s.add_dependency(%q<faraday>.freeze, ["> 0.9.2"])
77
+ s.add_dependency(%q<faraday_middleware>.freeze, ["> 0.12.2"])
78
+ s.add_dependency(%q<hashie>.freeze, ["> 3.5.7"])
77
79
  s.add_dependency(%q<rspec>.freeze, [">= 0"])
78
80
  s.add_dependency(%q<bundler>.freeze, [">= 0"])
79
81
  s.add_dependency(%q<webmock>.freeze, [">= 0"])
80
82
  s.add_dependency(%q<rspec-its>.freeze, [">= 0"])
81
83
  s.add_dependency(%q<juwelier>.freeze, [">= 0"])
84
+ s.add_dependency(%q<rubocop>.freeze, [">= 0"])
82
85
  end
83
86
  else
84
- s.add_dependency(%q<activesupport>.freeze, ["~> 5.1", ">= 5.1.4"])
85
- s.add_dependency(%q<faraday>.freeze, [">= 0.9.2"])
86
- s.add_dependency(%q<faraday_middleware>.freeze, ["~> 0.12", ">= 0.12.2"])
87
- s.add_dependency(%q<hashie>.freeze, ["~> 3.5", ">= 3.5.7"])
87
+ s.add_dependency(%q<activesupport>.freeze, [">= 5.1.4"])
88
+ s.add_dependency(%q<faraday>.freeze, ["> 0.9.2"])
89
+ s.add_dependency(%q<faraday_middleware>.freeze, ["> 0.12.2"])
90
+ s.add_dependency(%q<hashie>.freeze, ["> 3.5.7"])
88
91
  s.add_dependency(%q<rspec>.freeze, [">= 0"])
89
92
  s.add_dependency(%q<bundler>.freeze, [">= 0"])
90
93
  s.add_dependency(%q<webmock>.freeze, [">= 0"])
91
94
  s.add_dependency(%q<rspec-its>.freeze, [">= 0"])
92
95
  s.add_dependency(%q<juwelier>.freeze, [">= 0"])
96
+ s.add_dependency(%q<rubocop>.freeze, [">= 0"])
93
97
  end
94
98
  end
95
99
 
metadata CHANGED
@@ -1,22 +1,19 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vertebrae
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Woodhull
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-27 00:00:00.000000000 Z
11
+ date: 2020-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '5.1'
20
17
  - - ">="
21
18
  - !ruby/object:Gem::Version
22
19
  version: 5.1.4
@@ -24,9 +21,6 @@ dependencies:
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
- - - "~>"
28
- - !ruby/object:Gem::Version
29
- version: '5.1'
30
24
  - - ">="
31
25
  - !ruby/object:Gem::Version
32
26
  version: 5.1.4
@@ -34,54 +28,42 @@ dependencies:
34
28
  name: faraday
35
29
  requirement: !ruby/object:Gem::Requirement
36
30
  requirements:
37
- - - ">="
31
+ - - ">"
38
32
  - !ruby/object:Gem::Version
39
33
  version: 0.9.2
40
34
  type: :runtime
41
35
  prerelease: false
42
36
  version_requirements: !ruby/object:Gem::Requirement
43
37
  requirements:
44
- - - ">="
38
+ - - ">"
45
39
  - !ruby/object:Gem::Version
46
40
  version: 0.9.2
47
41
  - !ruby/object:Gem::Dependency
48
42
  name: faraday_middleware
49
43
  requirement: !ruby/object:Gem::Requirement
50
44
  requirements:
51
- - - "~>"
52
- - !ruby/object:Gem::Version
53
- version: '0.12'
54
- - - ">="
45
+ - - ">"
55
46
  - !ruby/object:Gem::Version
56
47
  version: 0.12.2
57
48
  type: :runtime
58
49
  prerelease: false
59
50
  version_requirements: !ruby/object:Gem::Requirement
60
51
  requirements:
61
- - - "~>"
62
- - !ruby/object:Gem::Version
63
- version: '0.12'
64
- - - ">="
52
+ - - ">"
65
53
  - !ruby/object:Gem::Version
66
54
  version: 0.12.2
67
55
  - !ruby/object:Gem::Dependency
68
56
  name: hashie
69
57
  requirement: !ruby/object:Gem::Requirement
70
58
  requirements:
71
- - - "~>"
72
- - !ruby/object:Gem::Version
73
- version: '3.5'
74
- - - ">="
59
+ - - ">"
75
60
  - !ruby/object:Gem::Version
76
61
  version: 3.5.7
77
62
  type: :runtime
78
63
  prerelease: false
79
64
  version_requirements: !ruby/object:Gem::Requirement
80
65
  requirements:
81
- - - "~>"
82
- - !ruby/object:Gem::Version
83
- version: '3.5'
84
- - - ">="
66
+ - - ">"
85
67
  - !ruby/object:Gem::Version
86
68
  version: 3.5.7
87
69
  - !ruby/object:Gem::Dependency
@@ -154,6 +136,20 @@ dependencies:
154
136
  - - ">="
155
137
  - !ruby/object:Gem::Version
156
138
  version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: rubocop
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
157
153
  description: A set of low level infrastructure and reusable code for building API
158
154
  clients
159
155
  email: nathan@controlshiftlabs.com
@@ -165,6 +161,7 @@ extra_rdoc_files:
165
161
  files:
166
162
  - ".document"
167
163
  - ".rspec"
164
+ - ".rubocop.yml"
168
165
  - ".ruby-gemset"
169
166
  - ".ruby-version"
170
167
  - ".travis.yml"