File tree Expand file tree Collapse file tree 13 files changed +221
-41
lines changed Expand file tree Collapse file tree 13 files changed +221
-41
lines changed Original file line number Diff line number Diff line change 6
6
env :
7
7
RAILS_ENV : test
8
8
DATABASE_URL :
postgres://test:[email protected] :5432/grape_on_rails_test
9
+ BUNDLE_GEMFILE : ${{ github.workspace }}/gemfiles/${{ matrix.gemfile.file }}.gemfile
10
+ continue-on-error : ${{ matrix.gemfile.experimental }}
11
+ strategy :
12
+ fail-fast : false
13
+ matrix :
14
+ ruby :
15
+ - " 2.7"
16
+ - " 3.0"
17
+ - " 3.1"
18
+ - " 3.2"
19
+ gemfile :
20
+ - { file: rails_6, experimental: false }
21
+ - { file: rails_6_1, experimental: false }
22
+ - { file: rails_7, experimental: false }
23
+ - { file: rails_edge, experimental: true }
9
24
steps :
10
25
- uses : actions/checkout@v3
11
26
- name : Set up Ruby
12
27
uses : ruby/setup-ruby@v1
13
28
with :
14
- ruby-version : " 3.1.2 "
29
+ ruby-version : ${{ matrix.ruby }}
15
30
bundler-cache : true
16
31
- name : Setup Firefox
17
32
uses : browser-actions/setup-firefox@latest
Original file line number Diff line number Diff line change 29
29
30
30
# Ignore master key for decrypting credentials and more.
31
31
/config /master.key
32
+
33
+ # Appraisal gem
34
+ .bundle
35
+ /gemfiles /* .lock
Original file line number Diff line number Diff line change
1
+ # frozen_string_literal: true
2
+
3
+ appraise 'rails-6' do
4
+ gem 'rails' , '~> 6.0'
5
+ end
6
+
7
+ appraise 'rails-6-1' do
8
+ gem 'rails' , '~> 6.1'
9
+ end
10
+
11
+ appraise 'rails-7' do
12
+ gem 'rails' , '~> 7.0'
13
+ end
14
+
15
+ appraise 'rails-edge' do
16
+ gem 'rails' , github : 'rails/rails'
17
+ end
Original file line number Diff line number Diff line change 1
1
source 'https://rubygems.org'
2
2
git_source ( :github ) { |repo | "https://github.com/#{ repo } .git" }
3
3
4
- ruby '3.1.2'
5
-
6
4
# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
7
5
gem 'rails' , '~> 7.0.3'
8
6
@@ -48,14 +46,16 @@ gem 'bootsnap', require: false
48
46
# Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images]
49
47
# gem "image_processing", "~> 1.2"
50
48
51
- gem 'grape' , '~> 1.6' , '>= 1.6.2 '
49
+ gem 'grape' , '~> 1.7 '
52
50
53
51
group :development , :test do
54
52
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
55
53
gem 'debug' , platforms : %i[ mri mingw x64_mingw ]
56
54
end
57
55
58
56
group :development do
57
+ gem 'appraisal'
58
+
59
59
# Use console on exceptions pages [https://github.com/rails/web-console]
60
60
gem 'web-console'
61
61
Original file line number Diff line number Diff line change 68
68
tzinfo (~> 2.0 )
69
69
addressable (2.8.0 )
70
70
public_suffix (>= 2.0.2 , < 5.0 )
71
+ appraisal (2.4.1 )
72
+ bundler
73
+ rake
74
+ thor (>= 0.14.0 )
71
75
ast (2.4.2 )
72
76
bindex (0.8.1 )
73
77
bootsnap (1.12.0 )
90
94
reline (>= 0.2.7 )
91
95
diff-lcs (1.5.0 )
92
96
digest (3.1.0 )
93
- dry-configurable ( 0.15 .0 )
97
+ dry-core ( 1.0 .0 )
94
98
concurrent-ruby (~> 1.0 )
95
- dry-core (~> 0.6 )
96
- dry-container (0.9.0 )
99
+ zeitwerk (~> 2.6 )
100
+ dry-inflector (1.0.0 )
101
+ dry-logic (1.5.0 )
97
102
concurrent-ruby (~> 1.0 )
98
- dry-configurable (~> 0.13 , >= 0.13.0 )
99
- dry-core (0.7.1 )
103
+ dry-core (~> 1.0 , < 2 )
104
+ zeitwerk (~> 2.6 )
105
+ dry-types (1.7.1 )
100
106
concurrent-ruby (~> 1.0 )
101
- dry-inflector (0.2.1 )
102
- dry-logic (1.2.0 )
103
- concurrent-ruby (~> 1.0 )
104
- dry-core (~> 0.5 , >= 0.5 )
105
- dry-types (1.5.1 )
106
- concurrent-ruby (~> 1.0 )
107
- dry-container (~> 0.3 )
108
- dry-core (~> 0.5 , >= 0.5 )
109
- dry-inflector (~> 0.1 , >= 0.1.2 )
110
- dry-logic (~> 1.0 , >= 1.0.2 )
107
+ dry-core (~> 1.0 )
108
+ dry-inflector (~> 1.0 )
109
+ dry-logic (~> 1.4 )
110
+ zeitwerk (~> 2.6 )
111
111
erubi (1.10.0 )
112
112
globalid (1.0.1 )
113
113
activesupport (>= 5.0 )
114
- grape (1.6.2 )
114
+ grape (1.7.0 )
115
115
activesupport
116
116
builder
117
117
dry-types (>= 1.1 )
140
140
mini_mime (1.1.2 )
141
141
minitest (5.17.0 )
142
142
msgpack (1.5.2 )
143
- mustermann (1.1.1 )
143
+ mustermann (3.0.0 )
144
144
ruby2_keywords (~> 0.0.1 )
145
145
mustermann-grape (1.0.2 )
146
146
mustermann (>= 1.0.0 )
159
159
net-protocol
160
160
timeout
161
161
nio4r (2.5.8 )
162
+ nokogiri (1.13.10-arm64-darwin )
163
+ racc (~> 1.4 )
162
164
nokogiri (1.13.10-x86_64-darwin )
163
165
racc (~> 1.4 )
164
166
nokogiri (1.13.10-x86_64-linux )
@@ -285,14 +287,16 @@ GEM
285
287
zeitwerk (2.6.0 )
286
288
287
289
PLATFORMS
290
+ arm64-darwin-21
288
291
x86_64-darwin-20
289
292
x86_64-linux
290
293
291
294
DEPENDENCIES
295
+ appraisal
292
296
bootsnap
293
297
capybara
294
298
debug
295
- grape (~> 1.6 , >= 1.6.2 )
299
+ grape (~> 1.7 )
296
300
importmap-rails
297
301
jbuilder
298
302
pg (~> 1.1 )
@@ -309,8 +313,5 @@ DEPENDENCIES
309
313
web-console
310
314
webdrivers
311
315
312
- RUBY VERSION
313
- ruby 3.1.2p20
314
-
315
316
BUNDLED WITH
316
317
2.3.16
Original file line number Diff line number Diff line change 1
- Grape on Rails
2
- ==============
1
+ # Grape on Rails
3
2
4
3
[ ![ Test] ( https://github.com/ruby-grape/grape-on-rails/actions/workflows/test.yml/badge.svg?branch=master )] ( https://github.com/ruby-grape/grape-on-rails/actions/workflows/test.yml )
4
+ [ ![ Rubocop] ( https://github.com/ruby-grape/grape-on-rails/actions/workflows/test.yml/badge.svg?branch=master )] ( https://github.com/ruby-grape/grape-on-rails/actions/workflows/test.yml )
5
5
[ ![ Code Climate] ( https://codeclimate.com/github/ruby-grape/grape-on-rails.svg )] ( https://codeclimate.com/github/ruby-grape/grape-on-rails )
6
6
7
7
A [ Grape] ( http://github.com/ruby-grape/grape ) API mounted on Rails.
8
8
9
- * [ ping] ( app/api/acme/ping.rb ) : a hello world ` GET ` API
10
- * [ post] ( app/api/acme/post.rb ) : post JSON data
11
- * [ raise] ( app/api/acme/raise.rb ) : raise an error, Rails handling exceptions
12
- * [ protected] ( app/api/acme/protected.rb ) : API protected with rudimentary Basic Authentication
13
- * [ headers] ( app/api/acme/headers.rb ) : demonstrates header handling
9
+ - [ ping] ( app/api/acme/ping.rb ) : a hello world ` GET ` API
10
+ - [ post] ( app/api/acme/post.rb ) : post JSON data
11
+ - [ raise] ( app/api/acme/raise.rb ) : raise an error, Rails handling exceptions
12
+ - [ protected] ( app/api/acme/protected.rb ) : API protected with rudimentary Basic Authentication
13
+ - [ headers] ( app/api/acme/headers.rb ) : demonstrates header handling
14
14
15
- Run
16
- ---
15
+ ## Run
17
16
18
17
```
19
18
bundle install
20
19
rails s
21
20
```
22
21
23
22
Try http://localhost:3000/api/ping or http://localhost:3000/api/protected/ping with _ username_ and _ password_ .
24
-
Original file line number Diff line number Diff line change 1
1
class ApplicationRecord < ActiveRecord ::Base
2
- primary_abstract_class
2
+ if Gem ::Version . new ( Rails . version ) >= Gem ::Version . new ( '7.0' )
3
+ primary_abstract_class
4
+ else
5
+ self . abstract_class = true
6
+ end
3
7
end
Original file line number Diff line number Diff line change 8
8
9
9
module GrapeOnRails
10
10
class Application < Rails ::Application
11
- # Initialize configuration defaults for originally generated Rails version.
12
- config . load_defaults 7.0
13
-
11
+ # Since we're testing against multiple versions, initialize configuration defaults
12
+ # based upon the version we're using.
13
+ rails_version = Gem ::Version . new ( Rails . version )
14
+ if rails_version >= Gem ::Version . new ( '7.0' )
15
+ config . load_defaults 7.0
16
+ elsif rails_version >= Gem ::Version . new ( '6.1' )
17
+ config . load_defaults 6.1
18
+ else
19
+ config . load_defaults 6.0
20
+ end
14
21
# Configuration for the application, engines, and railties goes here.
15
22
#
16
23
# These settings can be overridden in specific environments using the files
Original file line number Diff line number Diff line change
1
+ # This file was generated by Appraisal
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ gem 'bootsnap', require: false
6
+ gem 'grape', '~> 1.7'
7
+ gem 'importmap-rails'
8
+ gem 'jbuilder'
9
+ gem 'pg', '~> 1.1'
10
+ gem 'puma', '~> 5.0'
11
+ gem 'rails', '~> 6.0'
12
+ gem 'sprockets-rails'
13
+ gem 'stimulus-rails'
14
+ gem 'turbo-rails'
15
+ gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby]
16
+
17
+ group :development, :test do
18
+ gem 'debug', platforms: %i[mri mingw x64_mingw]
19
+ end
20
+
21
+ group :development do
22
+ gem 'appraisal'
23
+ gem 'web-console'
24
+ end
25
+
26
+ group :test do
27
+ gem 'capybara'
28
+ gem 'rspec'
29
+ gem 'rspec-rails'
30
+ gem 'rubocop'
31
+ gem 'selenium-webdriver'
32
+ gem 'webdrivers'
33
+ end
Original file line number Diff line number Diff line change
1
+ # This file was generated by Appraisal
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ gem 'bootsnap', require: false
6
+ gem 'grape', '~> 1.7'
7
+ gem 'importmap-rails'
8
+ gem 'jbuilder'
9
+ gem 'pg', '~> 1.1'
10
+ gem 'puma', '~> 5.0'
11
+ gem 'rails', '~> 6.1'
12
+ gem 'sprockets-rails'
13
+ gem 'stimulus-rails'
14
+ gem 'turbo-rails'
15
+ gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby]
16
+
17
+ group :development, :test do
18
+ gem 'debug', platforms: %i[mri mingw x64_mingw]
19
+ end
20
+
21
+ group :development do
22
+ gem 'appraisal'
23
+ gem 'web-console'
24
+ end
25
+
26
+ group :test do
27
+ gem 'capybara'
28
+ gem 'rspec'
29
+ gem 'rspec-rails'
30
+ gem 'rubocop'
31
+ gem 'selenium-webdriver'
32
+ gem 'webdrivers'
33
+ end
You can’t perform that action at this time.
0 commit comments