Skip to content
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

Refactoring for Rakefile to display cucumber task by "rake -T". #1088

Merged
merged 2 commits into from
Mar 12, 2017

Conversation

junaruga
Copy link
Contributor

@junaruga junaruga commented Mar 1, 2017

Summary

I want to display cucumber task by "rake -T".
It is not displayed because the cucumber task does not have a description.
This is a refactoring for Rakefile.

Details

Current situation

Display tasks with description.
cucumber task is not displayed.

$ bundle exec rake -T
rake build                 # Build cucumber-3.0.0.pre.1.gem into the pkg directory
rake clean                 # Remove any temporary products
rake clobber               # Remove any generated files
rake contributors          # List contributors
rake cov                   # Run all tests and collect code coverage
rake examples              # Run all exmples
rake features              # Run Cucumber features
rake fix_cr_lf             # Make all files use UNIX (\n) line endings
rake flog                  # Run flog over significant files
rake install               # Build and install cucumber-3.0.0.pre.1.gem into syst...
rake install:local         # Build and install cucumber-3.0.0.pre.1.gem into syst...
rake release[remote]       # Create tag v3.0.0.pre.1 and build and push cucumber-...
rake rubocop               # Run RuboCop
rake rubocop:auto_correct  # Auto-correct RuboCop offenses
rake sass                  # Generate the css for the html formatter from sass
rake spec                  # Run RSpec

Display all the tasks including tasks without description.
cucumber task is displayed.

$ bundle exec rake -AT
rake build                                # Build cucumber-3.0.0.pre.1.gem into t...
rake clean                                # Remove any temporary products
rake clobber                              # Remove any generated files
rake codeswarm                            #-
rake contributors                         # List contributors
rake cov                                  # Run all tests and collect code coverage
rake cucumber                             #-
rake default                              #-
rake examples                             # Run all exmples
rake features                             # Run Cucumber features
rake fix_cr_lf                            # Make all files use UNIX (\n) line end...
rake flog                                 # Run flog over significant files
rake install                              # Build and install cucumber-3.0.0.pre....
rake install:local                        # Build and install cucumber-3.0.0.pre....
rake release[remote]                      # Create tag v3.0.0.pre.1 and build and...
rake release:guard_clean                  #-
rake release:rubygem_push                 #-
rake release:source_control_push[remote]  #-
rake rubocop                              # Run RuboCop
rake rubocop:auto_correct                 # Auto-correct RuboCop offenses
rake ruby_env                             #-
rake sass                                 # Generate the css for the html formatt...
rake spec                                 # Run RSpec

After modification
cucumber task is displayed by "rake -T".

$ bundle exec rake -T
rake build                 # Build cucumber-3.0.0.pre.1.gem into the pkg directory
rake clean                 # Remove any temporary products
rake clobber               # Remove any generated files
rake contributors          # List contributors
rake cov                   # Run all tests and collect code coverage
rake cucumber              # Run Cucumber features
rake examples              # Run all exmples
rake features              # Run Cucumber features
rake fix_cr_lf             # Make all files use UNIX (\n) line endings
rake flog                  # Run flog over significant files
rake install               # Build and install cucumber-3.0.0.pre.1.gem into syst...
rake install:local         # Build and install cucumber-3.0.0.pre.1.gem into syst...
rake release[remote]       # Create tag v3.0.0.pre.1 and build and push cucumber-...
rake rubocop               # Run RuboCop
rake rubocop:auto_correct  # Auto-correct RuboCop offenses
rake sass                  # Generate the css for the html formatter from sass
rake spec                  # Run RSpec

Motivation and Context

I want to see cucumber task by "rake -T".

Also below codes can be improved to simplify it.

task :default => [:spec, :rubocop, :cucumber]
...
task :default => [:spec, :rubocop, :cucumber, 'coveralls:push']

How Has This Been Tested?

I tested my code running rake -T and rake -AT.
Travis tests it too.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • I've added tests for my code
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@mattwynne
Copy link
Member

There's a file in gem_tasks/cucumber.rake that this change is effectively making redundant.

One of the things that file does is set the correct profile for the platform. We're deprecating (or have removed) some of those platforms as you know, but not all of them.

Also that file sets the fork option on the rake task. I'm not sure what that does without looking it up, but it's worth some investigation.

In general I'd be delighted if we could remove that file and replace it with this, which looks much simpler. It might be that we need to carry over a little bit more though, for example to make sure the build works on a Windows machine.

@junaruga
Copy link
Contributor Author

junaruga commented Mar 5, 2017

@mattwynne ok I understood current situation. Let me check the source code more.

@junaruga junaruga force-pushed the feature/refactoring-Rakefile branch from 43af4f6 to 10e9967 Compare March 5, 2017 21:22
@junaruga
Copy link
Contributor Author

junaruga commented Mar 5, 2017

@mattwynne
I agree with you about it is redundant. I did not check gem_tasks/cucumber.rake.

/usr/local/ruby-2.4.0/bin/ruby -S bundle exec cucumber

or

/usr/local/ruby-2.4.0/bin/ruby -I load_path cucumber
  • there is profile setting in gem_tasks/cucumber.rake.
    I updated cucumber.yml too for that.

    I knew the profile is used like this, as you may know.

$ bundle exec rake cucumber
/usr/local/ruby-2.4.0/bin/ruby -S bundle exec cucumber --profile ruby_2_4

However I wonder that the profiles ruby_x_y are really needed for each Ruby version.
Because all the ruby_x_y profile has same value.
How do you think?

  • I added desc in gem_tasks/cucumber.rake right now.
    This looks better right now to display cucumber task with rake -T .

I did rebase my code on this PR.

@mattwynne
Copy link
Member

I think you're right that the ruby version profiles are mostly redundant now. They're certainly messy, so if we can remove them I think we should.

I also liked the way you'd simplified this in the original PR. If you were to remove gem_tasks/cucumber.rake I'd be happy, as long as nothing seriously broke.

This is only stuff for us devs to use anyway, so it's worth taking some risks if it helps us to clean things up.

@junaruga
Copy link
Contributor Author

junaruga commented Mar 6, 2017

@mattwynne
I pushed additional commit after your comment.
How do you think?

- Unify ruby_x_y profiles
@junaruga junaruga force-pushed the feature/refactoring-Rakefile branch from c8590a1 to 05715cc Compare March 6, 2017 13:34
@junaruga
Copy link
Contributor Author

If there is not any opposition, I am going to merge this PR after tomorrow.

@mattwynne
Copy link
Member

👍

@mattwynne
Copy link
Member

@junaruga please add a line in HISTORY.md after you merge.

@junaruga junaruga merged commit f13313a into cucumber:master Mar 12, 2017
@lock
Copy link

lock bot commented Oct 25, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants