grape-path-helpers 1.3.0 → 1.4.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4d73093a0f054919e2ad15c91772f4e7efac0ce0197d49d3be5ad5175df80a98
4
- data.tar.gz: a1e486c0b0c076edc6c6bc5411184c97fbd2e5e861b83747e1d273faffdf0ba3
3
+ metadata.gz: e6a9a810d64b890207e58f89f7da7a104827f733953c85e8487d10f45caf14d6
4
+ data.tar.gz: b76980cef67c4967fc4b4f49bb736603e67d74579624738ed5affd11317fa681
5
5
  SHA512:
6
- metadata.gz: 5491f91f2177f6ee3ba5575255a1e693dd6edae69da9a1733a5479e8a2478007b2c07abe0f5d1ac8d01e234dfeae1f45c4ae1fcc3982bb23854a3da16f0def0a
7
- data.tar.gz: f93f9038b288580fe66cc166993eb58dcfb1fa34cde384c49c03fde0d6f1c33961a6b98622a1ab16099dcd92a40b5217ecce965ba6c0649d80db4f5d276fd8fd
6
+ metadata.gz: 990b3eebe65bae4d982c98900e7a44d9b5a5b992383354bb696612fd27ba90c1738ae28c06c3f679ca854098e03bfbdc2fa30a3471f1e7da03a19006f5262b2e
7
+ data.tar.gz: 27e9befba4f4a89a61372bceadc45c27f55d492012cdfa56519e1aed030690c1cdb97591635f317baf225ef6a63788adbcd091e7e37c3abd4ef919ee938bb177
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.4.0
4
+
5
+ * [Support using a base class other than Grape::API::Instance](https://gitlab.com/gitlab-org/grape-path-helpers/-/merge_requests/23)
6
+
3
7
  ## 1.3.0
4
8
 
5
9
  * [Upgrade to Grape 1.3.1](https://gitlab.com/gitlab-org/grape-path-helpers/-/merge_requests/21)
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- grape-path-helpers (1.3.0)
4
+ grape-path-helpers (1.4.0)
5
5
  activesupport
6
6
  grape (~> 1.3)
7
7
  rake (~> 12)
@@ -9,18 +9,18 @@ PATH
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- activesupport (6.0.2.1)
12
+ activesupport (6.0.3.4)
13
13
  concurrent-ruby (~> 1.0, >= 1.0.2)
14
14
  i18n (>= 0.7, < 2)
15
15
  minitest (~> 5.1)
16
16
  tzinfo (~> 1.1)
17
- zeitwerk (~> 2.2)
17
+ zeitwerk (~> 2.2, >= 2.2.2)
18
18
  ast (2.4.0)
19
19
  builder (3.2.4)
20
20
  coderay (1.1.2)
21
- concurrent-ruby (1.1.6)
21
+ concurrent-ruby (1.1.7)
22
22
  diff-lcs (1.3)
23
- dry-configurable (0.11.3)
23
+ dry-configurable (0.11.6)
24
24
  concurrent-ruby (~> 1.0)
25
25
  dry-core (~> 0.4, >= 0.4.7)
26
26
  dry-equalizer (~> 0.2)
@@ -31,7 +31,7 @@ GEM
31
31
  concurrent-ruby (~> 1.0)
32
32
  dry-equalizer (0.3.0)
33
33
  dry-inflector (0.2.0)
34
- dry-logic (1.0.6)
34
+ dry-logic (1.0.8)
35
35
  concurrent-ruby (~> 1.0)
36
36
  dry-core (~> 0.2)
37
37
  dry-equalizer (~> 0.2)
@@ -42,17 +42,17 @@ GEM
42
42
  dry-equalizer (~> 0.3)
43
43
  dry-inflector (~> 0.1, >= 0.1.2)
44
44
  dry-logic (~> 1.0, >= 1.0.2)
45
- grape (1.3.1)
45
+ grape (1.5.0)
46
46
  activesupport
47
47
  builder
48
48
  dry-types (>= 1.1)
49
49
  mustermann-grape (~> 1.0.0)
50
50
  rack (>= 1.3.0)
51
51
  rack-accept
52
- i18n (1.8.2)
52
+ i18n (1.8.5)
53
53
  concurrent-ruby (~> 1.0)
54
54
  method_source (0.9.0)
55
- minitest (5.14.0)
55
+ minitest (5.14.2)
56
56
  mustermann (1.1.1)
57
57
  ruby2_keywords (~> 0.0.1)
58
58
  mustermann-grape (1.0.1)
@@ -64,7 +64,7 @@ GEM
64
64
  pry (0.11.3)
65
65
  coderay (~> 1.1.0)
66
66
  method_source (~> 0.9.0)
67
- rack (2.2.2)
67
+ rack (2.2.3)
68
68
  rack-accept (0.4.5)
69
69
  rack (>= 0.4)
70
70
  rainbow (3.0.0)
@@ -92,10 +92,10 @@ GEM
92
92
  ruby-progressbar (1.9.0)
93
93
  ruby2_keywords (0.0.2)
94
94
  thread_safe (0.3.6)
95
- tzinfo (1.2.6)
95
+ tzinfo (1.2.7)
96
96
  thread_safe (~> 0.1)
97
97
  unicode-display_width (1.3.3)
98
- zeitwerk (2.3.0)
98
+ zeitwerk (2.4.0)
99
99
 
100
100
  PLATFORMS
101
101
  ruby
data/Rakefile CHANGED
@@ -1,5 +1,6 @@
1
1
  require 'rubygems'
2
2
  require 'bundler'
3
+ require 'bundler/gem_tasks'
3
4
 
4
5
  Bundler.setup :default, :test, :development
5
6
 
@@ -11,7 +11,7 @@ module GrapePathHelpers
11
11
  end
12
12
 
13
13
  def all_routes
14
- routes = subclasses.flat_map { |s| s.send(:prepare_routes) }
14
+ routes = descendants.flat_map { |s| s.send(:prepare_routes) }
15
15
  routes.uniq { |r| r.options.merge(path: r.path) }
16
16
  end
17
17
  end
@@ -1,4 +1,4 @@
1
1
  # Gem version
2
2
  module GrapePathHelpers
3
- VERSION = '1.3.0'.freeze
3
+ VERSION = '1.4.0'.freeze
4
4
  end
@@ -1,5 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
+ # rubocop:disable Metrics/BlockLength
3
4
  describe GrapePathHelpers::AllRoutes do
4
5
  Grape::API::Instance.extend described_class
5
6
 
@@ -32,6 +33,14 @@ describe GrapePathHelpers::AllRoutes do
32
33
  expect(all_routes.map(&:path)).to include(*expected_routes)
33
34
  end
34
35
  end
36
+
37
+ context 'when an API is created via an intermediate class' do
38
+ it 'includes those routes on both Grape::API::Instance and the base class' do
39
+ expect(Spec::Support::BaseAPI.all_routes.map(&:origin)).to include('/derived_ping')
40
+ expect(Grape::API::Instance.all_routes.map(&:origin)).to include('/derived_ping')
41
+ end
42
+ end
35
43
  # rubocop:enable Metrics/LineLength
36
44
  end
37
45
  end
46
+ # rubocop:enable Metrics/BlockLength
@@ -81,5 +81,14 @@ module Spec
81
81
  end
82
82
  end
83
83
  end
84
+
85
+ class BaseAPI < Grape::API::Instance
86
+ end
87
+
88
+ class DerivedAPI < BaseAPI
89
+ get 'derived_ping' do
90
+ 'pong'
91
+ end
92
+ end
84
93
  end
85
94
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grape-path-helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Drew Blessing
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-03-15 00:00:00.000000000 Z
12
+ date: 2020-10-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport