Skip to content

Commit 97e647a

Browse files
committed
Update to rails 7.1
1 parent a23db37 commit 97e647a

File tree

8 files changed

+15
-36
lines changed

8 files changed

+15
-36
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313
strategy:
1414
matrix:
15-
ruby-version: ['3.0', '3.1', '3.2']
15+
ruby-version: ['3.1', '3.2']
1616
haml: [true, false]
1717
steps:
1818
- uses: actions/checkout@v4
@@ -34,7 +34,7 @@ jobs:
3434
- name: Set up Ruby
3535
uses: ruby/setup-ruby@v1
3636
with:
37-
ruby-version: 3.0
37+
ruby-version: 3.1
3838
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
3939
- name: Run rubocop
4040
run: bundle exec rubocop
@@ -47,7 +47,7 @@ jobs:
4747
- name: Set up Ruby
4848
uses: ruby/setup-ruby@v1
4949
with:
50-
ruby-version: 3.0
50+
ruby-version: 3.1
5151
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
5252
- uses: paambaati/[email protected]
5353
env:

Gemfile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
source 'https://rubygems.org'
22

3-
gem 'rails', '~> 7.0.0'
3+
gem 'rails', '~> 7.1.0'
44

55
gem 'puma'
66

@@ -19,11 +19,9 @@ gem "cssbundling-rails"
1919
gem "turbo-rails"
2020
gem "stimulus-rails"
2121

22-
gem 'sassc-rails'
23-
2422
gem 'bootsnap', require: false
2523

26-
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
24+
gem 'tzinfo-data', platforms: [:windows, :jruby]
2725

2826
group :development do
2927
gem 'web-console'
@@ -33,7 +31,7 @@ group :development do
3331
end
3432

3533
gem 'simplecov', require: false
36-
gem 'byebug', platforms: [:mri]
34+
gem 'debug', platforms: [:mri, :windows]
3735

3836
# platform specific gems
3937

README.rdoc

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,11 @@ To integrate dry_crud into your code, only a few additions are required:
3535
* Optionally define a +list+ scope in your models to be used in the +index+ action.
3636
* Optionally define a +options_list+ scope in your models to be used in select dropdowns.
3737

38-
From version 5.0 onwards, the major and minor version numbers will be kept in sync with Rails, and only the matching Rails version is supported. Version 3.0 is compatible 4.2, Version 2.0 and higher are compatible with Rails 4 and Rails 3.2. dry_crud is tested with Ruby 2.5. If you are using Ruby 1.9.3, please refer to version 3.0.0.
39-
38+
From version 5.0 onwards, the major and minor version numbers will be kept in sync with Rails, and only the matching Rails version is supported.
4039

4140
== Background
4241

43-
In most Rails applications, you have some models that require basic CRUD (create, read, update, delete) functionality. There are various possibilities like Rails scaffolding, {Inherited Resources}[https://github.com/activeadmin/inherited_resources] or {Rails Admin}[https://github.com/sferik/rails_admin]. Still, various parts in your application remain duplicated. While you might pull up common methods into a common superclass controller, most views still contain very similar code. And then you also have to remember the entire API of these frameworks.
42+
In most Rails applications, you have some models that require basic CRUD (create, read, update, delete) functionality. There are various possibilities like Rails scaffolding, {Inherited Resources}[https://github.com/activeadmin/inherited_resources] or {Rails Admin}[https://github.com/railsadminteam/rails_admin]. Still, various parts in your application remain duplicated. While you might pull up common methods into a common superclass controller, most views still contain very similar code. And then you also have to remember the entire API of these frameworks.
4443

4544
Enter dry_crud.
4645

@@ -52,7 +51,7 @@ dry_crud is a Rails generator. All code resides in your application and is open
5251

5352
dry_crud does not depend on any other gems, but easily allows you to integrate them in order to unify the behavior of your CRUD controllers. You might even use the gems mentioned above to adapt your generated CrudController base class. All classes come with thorough tests that provide you with a solid foundation for implementing your own adaptions.
5453

55-
A basic CSS gets you started with your application's layout. For advanced needs, dry_crud supports the styles and classes used in {Bootstrap 4}[http://getbootstrap.com]. A great design never was so close.
54+
A basic CSS gets you started with your application's layout. For advanced needs, dry_crud supports the styles and classes used in {Bootstrap}[http://getbootstrap.com]. As the views are generated into your application code, you are free to change the styling to your needs.
5655

5756
If you find yourself adapting the same parts of dry_crud for your applications over and over, please feel free to {fork me on Github}[http://github.com/codez/dry_crud].
5857

@@ -163,7 +162,7 @@ To render custom columns, use the +col+ method with an appropriate block:
163162
t.sortable_attrs(:lastname, :firstname)
164163
t.col('', class: 'center') { |entry| image_tag(entry.picture) }
165164
t.attr(:street)
166-
t.col('Map') { |entry| link_to(entry.city, "http://maps.google.com/?q=#{entry.city}" }
165+
t.col('Map') { |entry| link_to(entry.city, "http://maps.google.com/?q=#{entry.city}") }
167166
end %>
168167

169168
For views of subclasses of ListController, you can directly use the +crud_table+ helper method, where you do not have to pass the <tt>@people</tt> list explicitly and actions are added automatically.

Rakefile

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ namespace :test do
5050
desc "Create a rails test application"
5151
task :create do
5252
unless File.exist?(TEST_APP_ROOT)
53-
sh "rails new #{TEST_APP_ROOT} --css=bootstrap"
53+
sh "rails new #{TEST_APP_ROOT} --css=bootstrap --js esbuild"
5454
file_replace(File.join(TEST_APP_ROOT, 'Gemfile'),
5555
/\z/,
5656
File.read(File.join(File.dirname(__FILE__),
@@ -142,24 +142,8 @@ namespace :test do
142142
"= paginate entries\n\n= render 'list'")
143143
end
144144

145-
desc "Use Boostrap Icons in the test app"
145+
desc "Remove sample scss in the test app"
146146
task :use_bootstrap do
147-
sh "cd #{TEST_APP_ROOT}; yarn add bootstrap-icons"
148-
149-
app_css = File.join(TEST_APP_ROOT, 'app', 'assets', 'stylesheets', 'application.bootstrap.scss')
150-
if File.exist?(app_css) && File.read(app_css) !~ /bootstrap-icons/
151-
file_replace(app_css,
152-
/\n\z/,
153-
"\n@import 'bootstrap-icons/font/bootstrap-icons';\n@import 'crud';\n")
154-
end
155-
156-
assets = File.join(TEST_APP_ROOT, 'config', 'initializers', 'assets.rb')
157-
if File.exist?(assets) && File.read(assets) !~ /bootstrap-icons/
158-
file_replace(assets,
159-
/\n\z/,
160-
"\nRails.application.config.assets.paths << Rails.root.join('node_modules/bootstrap-icons/font')\n")
161-
end
162-
163147
FileUtils.rm_f(File.join(TEST_APP_ROOT,
164148
'app', 'assets', 'stylesheets', 'sample.scss'))
165149
end

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.0.0
1+
7.1.0

app/views/layouts/application.html.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
= csrf_meta_tag
1212
= csp_meta_tag
1313

14-
= stylesheet_link_tag 'application', :media => 'all', 'data-turbo-track': 'reload'
14+
= stylesheet_link_tag 'application', 'data-turbo-track': 'reload'
1515
= javascript_include_tag 'application', 'data-turbo-track': 'reload', defer: true
1616

1717
= yield :head

dry_crud.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ to DRY up the CRUD code in your Rails project. Start with these elements and
2222
build a clean base to efficiently develop your application upon.
2323
END
2424

25-
spec.add_dependency 'rails', '>= 7.0'
25+
spec.add_dependency 'rails', '>= 7.1'
2626

2727
readmes = FileList.new('*') do |list|
2828
list.exclude(/(^|[^.a-z])[a-z]+/)

test/templates/Gemfile.append

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,3 @@ gem 'haml'
1414
gem 'kaminari'
1515

1616
gem 'rspec-rails'
17-
18-
gem 'sassc-rails'

0 commit comments

Comments
 (0)