Skip to content

Switch template task name depending on Rails version #1796

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

yui-knk
Copy link
Contributor

@yui-knk yui-knk commented Mar 23, 2017

Rake tasks rails:update or rails:template and so on were
deprecated on Rails 5.0, and will be removed on Rails 5.1.
So we should switch a task name.

ref:

Rake tasks `rails:update` or `rails:template` and so on were
deprecated on Rails 5.0, and will be removed on Rails 5.1.
So we should switch a task name.

ref:
* rails/rails#23439
* rails/rails@f778281
def template_task_name
gem 'rails'

if Gem.loaded_specs['rails'].version >= Gem::Version.create('5.0')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should just be able to check the rails version from it's constant, we try to avoid using rubygems where possible.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does "check the rails version from it's constant" mean ?

require 'rails'

if Rails.version >= '5.0'
...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

@fables-tales
Copy link
Member

worth noting, I have patches for this in this PR also: #1790.

@fables-tales
Copy link
Member

@yui-knk if you're interested in collaborating on rails 5.1 compatibility in RSpec, I'd welcome commits on top of my WIP PR, would you be interested in helping there?

@yui-knk
Copy link
Contributor Author

yui-knk commented Mar 23, 2017

Yes I'm interested in RSpec on Rails 5.1 :) I will send PR for #1790.

@fables-tales
Copy link
Member

Closing this in favour of #1790

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants