Skip to content

Commit

Permalink
chore(ver): bump to 6.0.0
Browse files Browse the repository at this point in the history
- include forkception
- add specs requirements
- fix rails version and edit CHANGELOG
  • Loading branch information
bivanalhar committed Jul 23, 2024
1 parent adcf394 commit 8c47abd
Show file tree
Hide file tree
Showing 9 changed files with 56 additions and 30 deletions.
4 changes: 2 additions & 2 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
appraise "rails-6.0" do
gem 'rails', '~> 6.0'
gem 'rails', '6.0.6.1'
end

appraise "rails-6.1" do
gem 'rails', '~> 6.1'
end

appraise "rails-7.0" do
gem 'rails', '~> 7.0'
gem 'rails', '7.0.8.4'
end

appraise "rails-7.1" do
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

### Unreleased

### Version 6.0.0

- Furthermore support Rails 7.0
- Removing the dependencies for sprocket-rails as a consequences of that gem no longer needed in Rails 7

### Version 5.0.0

- Add dependencies to support Rails 6.1
- parent_name is deprecated in rails 6 and gone in 6.1
- Update I18n translation function
- Change assertion function in spec
- Bump ruby version to be at least 3.0

### Version 4.0.0

- [Pull Request 28](https://github.com/winston/rails_utils/pull/28) - [Development] remove `.ruby-version` file - by @JuanitoFatas
Expand Down
47 changes: 29 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,20 @@
Rails helpers based on opinionated project practices. Useful for structuring CSS and JavaScript,
display title of the page, and flash messages with Bootstrap.

## Forkception

This repo is a fork of:

- The [fonglh](https://github.com/fonglh/rails_utils) gem
- which is the fork of the original gem maintained by [Winston](https://github.com/winston/rails_utils)

## Requirements

- Ruby >= 3.0, <= 3.2
- Rails >= 6.0, <= 7.1

The library might work for the higher version, however it's only tested for the specs mentioned above.

## Installation

Add rails_utils to your application's Gemfile:
Expand Down Expand Up @@ -36,7 +50,7 @@ you can use `page_class` to include the controller name and action name as CSS c
becomes

```html
<body class='animes show'>
<body class="animes show">
...
</body>
```
Expand Down Expand Up @@ -79,9 +93,7 @@ When controller and action is `animes#show` you can easily use `page_title` like
becomes

```html
<div class="page-title">
Animes Show
</div>
<div class="page-title">Animes Show</div>
```

Besides, it supports I18n and interpolation:
Expand All @@ -104,9 +116,7 @@ Pass in `anime_name`:
becomes

```html
<div class="page-title">
Showing anime of: Frozen
</div>
<div class="page-title">Showing anime of: Frozen</div>
```

### #`javascript_initialization`
Expand All @@ -130,13 +140,17 @@ compiles to:

```html
<script type="text/javascript">
//<![CDATA[
MyApp.init();
if(MyApp.animes) {
if(MyApp.animes.init) { MyApp.animes.init(); }
if(MyApp.animes.show && MyApp.animes.show.init) { MyApp.animes.show.init(); }
}
//]]>
//<![CDATA[
MyApp.init();
if (MyApp.animes) {
if (MyApp.animes.init) {
MyApp.animes.init();
}
if (MyApp.animes.show && MyApp.animes.show.init) {
MyApp.animes.show.init();
}
}
//]]>
</script>
```

Expand Down Expand Up @@ -196,16 +210,13 @@ Minitest-ed. To run all tests, just run `rake` or `rake test`.

## Author

Rails Utils is maintained by [Winston Teo](mailto:[email protected]).
Rails Utils is originally maintained by [Winston Teo](mailto:[email protected]).

[You should follow Winston on Twitter](https://www.twitter.com/winstonyw), or find out more on [WinstonYW](http://www.winstonyw.com) and [LinkedIn](http://sg.linkedin.com/in/winstonyw).

## License

Copyright © 2013-2016 Winston Teo Yong Wei. Free software, released under the MIT license.


[version-badge]: https://badge.fury.io/rb/rails_utils.svg
[rubygems]: https://rubygems.org/gems/rails_utils
[travis-badge]: https://travis-ci.org/winston/rails_utils.svg
[travis]: https://travis-ci.org/winston/rails_utils
2 changes: 1 addition & 1 deletion gemfiles/rails_6.0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

source "https://rubygems.org"

gem "rails", "~> 6.0"
gem "rails", "6.0.6.1"

gemspec path: "../"
2 changes: 1 addition & 1 deletion gemfiles/rails_7.0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

source "https://rubygems.org"

gem "rails", "~> 7.0"
gem "rails", "7.0.8.4"

gemspec path: "../"
2 changes: 1 addition & 1 deletion lib/rails_utils/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module RailsUtils
VERSION = "5.0.0"
VERSION = "6.0.0"
end
2 changes: 0 additions & 2 deletions rails_utils.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ Gem::Specification.new do |s|
s.add_dependency "rails", ">= 6"

s.add_development_dependency "minitest" , ">= 4.7.5"
s.add_development_dependency "sprockets-rails", '~>3.0'
s.add_development_dependency "sprockets", '~>3.0'
s.add_development_dependency "appraisal", "~> 2.1"
s.add_development_dependency "mocha"

Expand Down
6 changes: 2 additions & 4 deletions test/dummy/config/application.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
require File.expand_path('../boot', __FILE__)

# Pick the frameworks you want:
# require "active_record/railtie"
require "action_controller/railtie"
require "action_mailer/railtie"
require "sprockets/railtie"
require "rails/test_unit/railtie"

Bundler.require(*Rails.groups)
Expand Down Expand Up @@ -55,10 +53,10 @@ class Application < Rails::Application
# config.active_record.whitelist_attributes = true

# Enable the asset pipeline
config.assets.enabled = true
# config.assets.enabled = true

# Version of your assets, change this if you want to expire all your assets
config.assets.version = '1.0'
# config.assets.version = '1.0'
end
end

8 changes: 7 additions & 1 deletion test/rails_utils_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@
describe "RailsUtils::ActionViewExtensions" do
let(:controller) { ActionController::Base.new }
let(:request) { ActionDispatch::Request.new(flash: {}) }
let(:view) { ActionView::Base.new({}, {}, "") }
let(:view) do
if Rails::VERSION::MAJOR == 6 && Rails::VERSION::MINOR == 0
ActionView::Base.new
else
ActionView::Base.new({}, {}, "")
end
end

before do
controller.request = request
Expand Down

0 comments on commit 8c47abd

Please sign in to comment.