Skip to content

Conversation

roramirez
Copy link
Contributor

If using one-dash the alias for stylesheet_engine wont work.

This patch change the se alias to two dash makes work for this option alias.

@rails-bot rails-bot bot added the railties label Mar 24, 2020
If using one-dash the alias for stylesheet_engine wont work.

This patch change the `se` alias to two dash makes work for this option alias.
@roramirez roramirez force-pushed the stylesheet_engine_alias branch from 512f95d to a790251 Compare April 6, 2020 14:42
@p8
Copy link
Member

p8 commented Jun 12, 2020

Does the same thing apply to javascript_engine -je and scaffold_stylesheet -ss?

@p8
Copy link
Member

p8 commented Jun 12, 2020

When i run bin/rails g scaffold cat -se=scss against Rails master I get the following:

      invoke  assets
      invoke    scss
      create      app/assets/stylesheets/cats.scss

@roramirez
Copy link
Contributor Author

Hi @p8 !This change should applied for the aliases with more than one character. So at this time for you example this wont work

bin/rails g scaffold cat -se=css

If this MR is accept I'll can do for other aliases.

@p8
Copy link
Member

p8 commented Jun 12, 2020

@roramirez Ah, sorry, scss is the default. I can confirm this PR fixes the problem.

@roramirez
Copy link
Contributor Author

:)

Comment on lines +434 to +438
def test_scaffold_generator_alias_nocss_stylesheets_engine
output = run_generator [ "posts", "--se=NOCSS" ]
assert_no_file "app/assets/stylesheets/posts.css"
assert_match(/NOCSS \[not found\]/, output)
end
Copy link
Member

@p8 p8 Jun 15, 2020

Choose a reason for hiding this comment

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

I'm not sure this test adds anything to this PR. It's also the only one in ScaffoldGeneratorTest that tests for "not found".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is a reverse way for test_scaffold_generator_alias_css_stylesheets_engine I'll try to use a default scss but for this test don't have sense.

@rails-bot
Copy link

rails-bot bot commented Sep 14, 2020

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Thank you for your contributions.

@rails-bot rails-bot bot added the stale label Sep 14, 2020
@rails-bot rails-bot bot closed this Sep 21, 2020
@p8
Copy link
Member

p8 commented Sep 22, 2020

@jonathanhefner This is a tiny fix. Basically generator aliases with two-letters (se, ss, je) require a double dash but are shown with single dash.

@jonathanhefner
Copy link
Member

Thank you for the pull request. I think a better fix might be to ensure all single-dash options use single letters, since that is conventionally expected. However, I also question how much utility some of these aliases provide. So if it's too difficult to think of sensible single-letter replacements, my inclination would be to remove them altogether.

@rails-bot rails-bot bot removed the stale label Sep 22, 2020
@rails-bot
Copy link

rails-bot bot commented Dec 21, 2020

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Thank you for your contributions.

@rails-bot rails-bot bot added the stale label Dec 21, 2020
@rails-bot rails-bot bot closed this Dec 28, 2020
@rafaelfranca rafaelfranca reopened this Dec 29, 2020
@rails-bot rails-bot bot removed the stale label Dec 29, 2020
@rafaelfranca
Copy link
Member

I agree with @jonathanhefner and I believe the best thing would be to remove those aliases. Maybe we should go further and even change the :javascripts and :stylesheets options to receive a value with the engine we want to use. scaffold_stylesheet we can just remove the alias.

@rafaelfranca
Copy link
Member

@roramirez are you interested in working on this?

@roramirez
Copy link
Contributor Author

roramirez commented Dec 30, 2020

Sure, I'll remove them a push a new commit... I'm not really sure is move into a new PR, amend the current commit or add new one, what do you think?

@rafaelfranca
Copy link
Member

You call. A new PR could be easier to deal with

Base automatically changed from master to main January 14, 2021 17:01
@rails-bot
Copy link

rails-bot bot commented Apr 14, 2021

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Thank you for your contributions.

@rails-bot rails-bot bot added the stale label Apr 14, 2021
@rails-bot rails-bot bot closed this Apr 21, 2021
zzak pushed a commit that referenced this pull request May 10, 2021
There a issues is use more than one character to use as aliases
https://github.com/erikhuda/thor/blob/a5cbed8/lib/thor/base.rb#L307

So, for this change the convention is remove the two letters aliases
#38813
stefannibrasil pushed a commit to hexdevs/rails that referenced this pull request May 27, 2021
There a issues is use more than one character to use as aliases
https://github.com/erikhuda/thor/blob/a5cbed8/lib/thor/base.rb#L307

So, for this change the convention is remove the two letters aliases
rails#38813
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants