spyke 6.1.1 → 6.1.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: d8a623ec5e619581883a58962e9961e7bc04f889e7c4dfdfd5712d2e7e82953b
4
- data.tar.gz: e9730e060fbcd6cfb3bf4a718a779d9de490878da0728d1643fbb18f2004968f
3
+ metadata.gz: 10bea427bfa06776d0a764b34c1259215b730c9f06275ff50feeb29dd99dd9bb
4
+ data.tar.gz: b8fbfce6f60b4818db3a260fb2b18a76c9a296fdde55e9183c0c12def9e8599f
5
5
  SHA512:
6
- metadata.gz: ec2cacb0215d0d780484fb184e5e06aab71cc06e5b7312c41cbf337830e3ad5e1167a00fd255c0354d4293409763e03d076a53362654512f4da19fa925980485
7
- data.tar.gz: 80607d11d9501f9b6f69cfbf311a099130c0904e37879b58a30df4794f758f131360b6c19eadd9d3086e5b8c284c4eed7399219f2edf82f8a260625c992a7997
6
+ metadata.gz: a5da8c94843a8e150d10ac52a135bb6ab273894fefe83ebbda9cba47f7274b6a04da966066c454887ff905be73f626a36642ef02e92737c7a7f88883e5ae38d2
7
+ data.tar.gz: d315a1efe8885fdbe78739dc53aedfd545095e09db8fddc205f038a06918b815f28b3da30ac5ff7a303cc1bbca2151f70d1a021cbe4ca50e855d960e8ed10777
@@ -0,0 +1,54 @@
1
+ # Use the latest 2.1 version of CircleCI pipeline process engine.
2
+ # See: https://circleci.com/docs/2.0/configuration-reference
3
+ version: 2.1
4
+
5
+ # Orbs are reusable packages of CircleCI configuration that you may share across projects, enabling you to create encapsulated, parameterized commands, jobs, and executors that can be used across multiple projects.
6
+ # See: https://circleci.com/docs/2.0/orb-intro/
7
+ orbs:
8
+ ruby: circleci/ruby@0.1.2
9
+
10
+ # Define a job to be invoked later in a workflow.
11
+ # See: https://circleci.com/docs/2.0/configuration-reference/#jobs
12
+ jobs:
13
+ build:
14
+ parameters:
15
+ ruby_version:
16
+ type: string
17
+ rails_version:
18
+ type: string
19
+ docker:
20
+ - image: cimg/ruby:<< parameters.ruby_version >>
21
+ executor: ruby/default
22
+ environment:
23
+ RAILS_TEST_VERSION: << parameters.rails_version >>
24
+ steps:
25
+ - checkout
26
+ - run:
27
+ name: Which ruby?
28
+ command: ruby -v
29
+ - run:
30
+ name: Which bundler?
31
+ command: bundle -v
32
+ - ruby/bundle-install
33
+ - run:
34
+ name: Run tests
35
+ command: bundle exec rake
36
+
37
+ workflows:
38
+ tests:
39
+ jobs:
40
+ - build:
41
+ matrix:
42
+ parameters:
43
+ rails_version: ["~> 5.0"]
44
+ ruby_version: ["2.6.6", "2.7.2"]
45
+ - build:
46
+ matrix:
47
+ parameters:
48
+ rails_version: ["~> 6.0"]
49
+ ruby_version: ["2.6.6", "2.7.2", "3.0.0"]
50
+ - build:
51
+ matrix:
52
+ parameters:
53
+ rails_version: ["~> 7.0"]
54
+ ruby_version: ["2.7.2", "3.0.0"]
data/README.md CHANGED
@@ -7,8 +7,8 @@
7
7
  <br /><br />
8
8
  <a href="https://rubygems.org/gems/spyke"><img src="https://badge.fury.io/rb/spyke.svg?style=flat" alt="Gem Version"></a>
9
9
  <a href="https://codeclimate.com/github/balvig/spyke"><img src="https://codeclimate.com/github/balvig/spyke/badges/gpa.svg" /></a>
10
- <a href='https://coveralls.io/r/balvig/spyke?branch=master'><img src='https://img.shields.io/coveralls/balvig/spyke.svg?style=flat' /></a>
11
- <a href="https://travis-ci.org/balvig/spyke"><img src="https://travis-ci.org/balvig/spyke.svg?branch=master" /></a>
10
+ <a href='https://coveralls.io/github/balvig/spyke'><img src="https://coveralls.io/repos/github/balvig/spyke/badge.svg" /></a>
11
+ <a href="https://circleci.com/gh/balvig/spyke"><img src="https://circleci.com/gh/balvig/spyke.svg?style=shield" /></a>
12
12
  </p>
13
13
 
14
14
  ---
@@ -244,9 +244,3 @@ Completed 200 OK in 75ms (Views: 64.6ms | Spyke: 40.3ms | ActiveRecord: 0ms)
244
244
 
245
245
  For more examples of how Spyke can be used, check out [fixtures.rb](https://github.com/balvig/spyke/blob/master/test/support/fixtures.rb) and the
246
246
  [test suite](https://github.com/balvig/spyke/tree/master/test).
247
-
248
-
249
- ## Contributing
250
-
251
- If possible please take a look at the [tests marked "wishlisted"](https://github.com/balvig/spyke/search?l=ruby&q=wishlisted&utf8=%E2%9C%93)!
252
- These are features/fixes I'd like to implement but haven't gotten around to doing yet :)
data/bin/console ADDED
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'bundler/setup'
4
+ require 'spyke'
5
+ require 'pry'
6
+
7
+ # Require support files via `bin/console -t`
8
+ if ARGV.any? { |o| %w(-t --test).include? o }
9
+ require_relative '../test/support/fixtures.rb'
10
+ Spyke::Base.connection.response :logger
11
+ end
12
+
13
+ Pry.start
@@ -94,9 +94,9 @@ module Spyke
94
94
 
95
95
  def method_missing(name, *args, &block)
96
96
  case
97
- when association?(name) then association(name).load
98
- when attribute?(name) then attribute(name)
99
- when predicate?(name) then predicate(name)
97
+ when association?(name) then association(name, *args).load
98
+ when attribute?(name) then attribute(name, *args)
99
+ when predicate?(name) then predicate(name, *args)
100
100
  when setter?(name) then set_attribute(name, args.first)
101
101
  else super
102
102
  end
data/lib/spyke/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Spyke
2
- VERSION = '6.1.1'
2
+ VERSION = '6.1.2'
3
3
  end
data/spyke.gemspec CHANGED
@@ -18,15 +18,15 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_dependency 'activesupport', '>= 4.0.0'
22
- spec.add_dependency 'activemodel', '>= 4.0.0'
21
+ spec.add_dependency 'activesupport', ENV.fetch('RAILS_TEST_VERSION', '>= 4.0.0')
22
+ spec.add_dependency 'activemodel', ENV.fetch('RAILS_TEST_VERSION', '>= 4.0.0')
23
23
  spec.add_dependency 'faraday', '>= 0.9.0', '< 2.0'
24
24
  spec.add_dependency 'faraday_middleware', '>= 0.9.1', '< 2.0'
25
25
  spec.add_dependency 'addressable', '>= 2.5.2'
26
26
 
27
- spec.add_development_dependency 'actionpack', '>= 4.0.0'
27
+ spec.add_development_dependency 'actionpack', ENV.fetch('RAILS_TEST_VERSION', '>= 4.0.0')
28
28
  spec.add_development_dependency 'bundler', '>= 1.6'
29
- spec.add_development_dependency 'coveralls', '~> 0.7'
29
+ spec.add_development_dependency 'coveralls_reborn', '~> 0.23.0'
30
30
  spec.add_development_dependency 'minitest'
31
31
  spec.add_development_dependency 'minitest-line'
32
32
  spec.add_development_dependency 'minitest-reporters'
@@ -157,7 +157,6 @@ module Spyke
157
157
  end
158
158
 
159
159
  def test_rejecting_wrong_number_of_args
160
- skip 'wishlisted'
161
160
  stub_request(:any, /.*/)
162
161
  recipe = Recipe.new(description: 'Delicious')
163
162
  assert_raises ArgumentError do
@@ -1,3 +1,5 @@
1
+ require 'multi_json'
2
+
1
3
  # Dummy api
2
4
  class JSONParser < Faraday::Response::Middleware
3
5
  def parse(body)
data/test/test_helper.rb CHANGED
@@ -10,7 +10,6 @@ require 'spyke'
10
10
  require 'minitest/autorun'
11
11
  require 'minitest/reporters'
12
12
  require 'mocha/minitest'
13
- require 'multi_json'
14
13
  require 'pry'
15
14
 
16
15
  # Require support files
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spyke
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.1.1
4
+ version: 6.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jens Balvig
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-16 00:00:00.000000000 Z
11
+ date: 2021-12-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -121,19 +121,19 @@ dependencies:
121
121
  - !ruby/object:Gem::Version
122
122
  version: '1.6'
123
123
  - !ruby/object:Gem::Dependency
124
- name: coveralls
124
+ name: coveralls_reborn
125
125
  requirement: !ruby/object:Gem::Requirement
126
126
  requirements:
127
127
  - - "~>"
128
128
  - !ruby/object:Gem::Version
129
- version: '0.7'
129
+ version: 0.23.0
130
130
  type: :development
131
131
  prerelease: false
132
132
  version_requirements: !ruby/object:Gem::Requirement
133
133
  requirements:
134
134
  - - "~>"
135
135
  - !ruby/object:Gem::Version
136
- version: '0.7'
136
+ version: 0.23.0
137
137
  - !ruby/object:Gem::Dependency
138
138
  name: minitest
139
139
  requirement: !ruby/object:Gem::Requirement
@@ -249,16 +249,18 @@ dependencies:
249
249
  description: Interact with REST services in an ActiveRecord-like manner
250
250
  email:
251
251
  - jens@balvig.com
252
- executables: []
252
+ executables:
253
+ - console
253
254
  extensions: []
254
255
  extra_rdoc_files: []
255
256
  files:
257
+ - ".circleci/config.yml"
256
258
  - ".gitignore"
257
- - ".travis.yml"
258
259
  - Gemfile
259
260
  - LICENSE.txt
260
261
  - README.md
261
262
  - Rakefile
263
+ - bin/console
262
264
  - lib/spyke.rb
263
265
  - lib/spyke/associations.rb
264
266
  - lib/spyke/associations/association.rb
data/.travis.yml DELETED
@@ -1,7 +0,0 @@
1
- notifications:
2
- email: false
3
- rvm:
4
- - 2.6.6
5
- - 2.7.2
6
- - 3.0.0
7
- sudo: false