-
Notifications
You must be signed in to change notification settings - Fork 354
[v4] Cleaning up test environment for Rails 5.0+ #366
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
Changes from all commits
2f47961
10d877a
88545a7
ddeab7e
c133775
e059614
1568244
650d88b
9648ebf
9a0df05
1e2134b
828e478
5a5a3f4
ee31b85
8576643
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,5 +7,5 @@ test/dummy/tmp/ | |
| *.gem | ||
| .rbenv-gemsets | ||
| *.swp | ||
| gemfiles/*.lock | ||
| Gemfile.lock | ||
| .ruby-version | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,28 +1,29 @@ | ||
| sudo: false | ||
| language: ruby | ||
| rvm: | ||
| - 1.9 | ||
| - 2.0 | ||
| - 2.1 | ||
| - 2.2 | ||
| - 2.3.1 | ||
| - 2.2.9 | ||
| - 2.3.6 | ||
| - 2.4.3 | ||
| - 2.5.0 | ||
| gemfile: | ||
| - gemfiles/4.0.gemfile | ||
| - gemfiles/4.1.gemfile | ||
| - gemfiles/4.2.gemfile | ||
| - test/gemfiles/5.0.gemfile | ||
| - test/gemfiles/5.1.gemfile | ||
| - test/gemfiles/5.2.gemfile | ||
| before_install: | ||
| - gem update --system | ||
| - gem install bundler --no-document | ||
|
|
||
| matrix: | ||
| include: | ||
| - rvm: 2.2.2 | ||
| gemfile: gemfiles/5.0.gemfile | ||
| - rvm: 2.3.1 | ||
| gemfile: gemfiles/5.0.gemfile | ||
| # Run Danger only once | ||
| script: bundle exec danger | ||
| - rvm: 2.2.2 | ||
| gemfile: gemfiles/5.1.gemfile | ||
| - rvm: 2.3.1 | ||
| gemfile: gemfiles/5.1.gemfile | ||
| before_install: | ||
| - gem install bundler --conservative --version '~> 1.10' | ||
| before_script: | ||
| - bundle exec rake -f test/dummy/Rakefile db:create db:migrate RAILS_ENV=test | ||
| # Bleeding edge | ||
| - rvm: ruby-head | ||
| gemfile: test/gemfiles/5.2.gemfile | ||
|
|
||
| # Running one job to execute DANGER bot | ||
| - rvm: 2.5.0 | ||
| gemfile: test/gemfiles/5.2.gemfile | ||
| script: | ||
| - gem install danger | ||
| - danger | ||
|
|
||
| allow_failures: | ||
| - rvm: ruby-head |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,53 +1,57 @@ | ||
| # Contributing | ||
|
|
||
| The release of Bootstrap 4 and Rails 5.1 have implications | ||
| for the future direction of `bootstrap_form`. | ||
| Don't worry. | ||
| We plan to move this gem forward to Bootstrap 4 | ||
| and to support Rails 5.1 and beyond. | ||
| If you're thinking of contributing to `bootstrap_form`, | ||
| please read [issue #361](https://github.com/bootstrap-ruby/rails-bootstrap-forms/issues/361). | ||
| The release of Bootstrap 4 and Rails 5.1 have implications for the future | ||
| direction of `bootstrap_form`. Don't worry. We plan to move this gem forward to | ||
| Bootstrap 4 and to support Rails 5.1 and beyond. If you're thinking of | ||
| contributing to `bootstrap_form`, please read | ||
| [issue #361](https://github.com/bootstrap-ruby/rails-bootstrap-forms/issues/361). | ||
|
|
||
| Your comments are welcome. | ||
|
|
||
| Thanks so much for considering contributing to bootstrap_form! | ||
| We love pull requests! | ||
| Thanks so much for considering a contribution to bootstrap_form. We love pull requests! | ||
|
|
||
| Here's a quick guide for contributing: | ||
|
|
||
| 1. Make sure no one else is working on the same issue or feature. | ||
| Search the issues and pull requests for anything | ||
| that looks like the issue or feature you want to address. | ||
| If no one else is working on your issue or feature, | ||
| carry on with the following steps. | ||
| ### 1. Check if issue or feature is available to work on | ||
|
|
||
| Make sure no one else is working on the same issue or feature. Search the issues | ||
| and pull requests for anything that looks like the issue or feature you want to | ||
| address. If no one else is working on your issue or feature, carry on with the | ||
| following steps. | ||
|
|
||
| ### 2. Fork the repo | ||
|
|
||
| For the project. Optionally, create a branch you want to work on | ||
|
|
||
| 2. Fork the repo. | ||
| ### 3. Get it running locally | ||
|
|
||
| 2. Install the required dependencies. | ||
| - Install the required dependencies with `bundle install` | ||
| - Run tests via: `bundle exec rake` | ||
|
|
||
| ``` | ||
| bundle install | ||
| bundle exec appraisal install | ||
| ``` | ||
| ### 4. Hack away | ||
|
|
||
| 3. Run the existing test suite: | ||
| - Try to keep your changes small. Consider making several smaller pull requests. | ||
| - Don't forget to add necessary tests. | ||
| - Update the README if necessary. | ||
| - Add a line to the CHANGELOG for your bug fix or feature. | ||
|
|
||
| ``` | ||
| $ bundle exec rake -f test/dummy/Rakefile db:create db:migrate RAILS_ENV=test | ||
| $ bundle exec appraisal rake test | ||
| ``` | ||
| You may find using test/dummy application useful for development and debugging. | ||
|
|
||
| 4. Add tests for your change. | ||
| - `cd test/dummy` | ||
| - `rake db:schema:load` | ||
| - `rails s` | ||
| - Navigate to http://localhost:3000 | ||
|
|
||
| 5. Add your changes and make your test(s) pass. Following the conventions you | ||
| see used in the source will increase the chance that your pull request is | ||
| accepted right away. | ||
| ### 5. Make a Pull Request | ||
|
|
||
| 6. Update the README if necessary. | ||
| - If you never done it before read this: https://help.github.com/articles/about-pull-requests/ | ||
| - When PR is submitted check if TravisCI ran all tests successfully didn't raise any issues | ||
|
|
||
| 7. Add a line to the CHANGELOG for your bug fix or feature. | ||
| ### 6. Done! | ||
|
|
||
| 8. Push to your fork and submit a pull request. | ||
| Somebody will shortly review your pull request and if everything is good will be | ||
| merged into master brach. Eventually gem will be published with your changes. | ||
|
|
||
| ## Contributors | ||
| --- | ||
|
|
||
| Thanks to all the great contributors over the years: https://github.com/bootstrap-ruby/rails-bootstrap-forms/graphs/contributors | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,17 +1,18 @@ | ||
| source "http://rubygems.org" | ||
|
|
||
| # Declare your gem's dependencies in bootstrap_form.gemspec. | ||
| # Bundler will treat runtime dependencies like base dependencies, and | ||
| # development dependencies will be added by default to the :development group. | ||
| gemspec | ||
|
|
||
| # jquery-rails is used by the dummy application | ||
| gem "jquery-rails" | ||
| # Uncomment and change rails version for testing purposes | ||
| # gem "rails", "~> 5.2.0.beta2" | ||
|
|
||
| # Declare any dependencies that are still in development here instead of in | ||
| # your gemspec. These might include edge Rails or gems from your path or | ||
| # Git. Remember to move these dependencies to your gemspec before releasing | ||
| # your gem to rubygems.org. | ||
| group :development do | ||
| gem "htmlbeautifier" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice addition ✨ |
||
| end | ||
|
|
||
| # To use debugger | ||
| # gem 'ruby-debug19', :require => 'ruby-debug' | ||
| group :test do | ||
| gem "diffy" | ||
| gem "equivalent-xml" | ||
| gem "mocha" | ||
| gem "sqlite3" | ||
| gem "timecop", "~> 0.7.1" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you explain further why these dependencies belong in the Gemfile and not as dev dependencies in the gemspec? It means that we have to repeat these in each of the test gemfiles, and I don't see much benefit.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is mostly to keep gemspec clean. Unless you're directly working on the gem you don't need to install or even care about those dev dependencies. Gives you flexibility to cram whatever you want into your own Gemfile. See what Rails does: https://github.com/rails/rails/blob/master/rails.gemspec Million of gems used for development and testing are defined in Gemfile instead.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Interesting, I had no idea that was a common practice! I am still confused because the definition of gemspec dev dependencies is that they "aren't installed by default and aren't activated when a gem is required". In other words, they are not considered at all unless you are working directly on the gem, which is exactly the behavior we want. Other popular Ruby projects like capybara, sprockets, and rack do it the gemspec way, so maybe it is just personal preference?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. BTW I don't mean to be argumentative or wish to hold up this PR in any way. I am honestly just really curious why the Ruby community seems to have two different ways of accomplishing the same thing. Maybe the Gemfile is preferable when you have to platform-specific dependencies, and in that case the Gemfile DSL is more expressive? Feel free to ignore my ramblings. 😀
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't remember where I picked it up. Maybe the biggest benefit when you're running tests on different environments that cannot use the same dependencies defined in the gemspec. So it's easier to keep that stuff in Gemfile.
|
||
| end | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,37 +1,27 @@ | ||
| #!/usr/bin/env rake | ||
| begin | ||
| require 'bundler/setup' | ||
| rescue LoadError | ||
| puts 'You must `gem install bundler` and `bundle install` to run rake tasks' | ||
| end | ||
| begin | ||
| require 'rdoc/task' | ||
| rescue LoadError | ||
| require 'rdoc/rdoc' | ||
| require 'rake/rdoctask' | ||
| RDoc::Task = Rake::RDocTask | ||
| end | ||
|
|
||
| require 'rdoc/task' | ||
|
|
||
| RDoc::Task.new(:rdoc) do |rdoc| | ||
| rdoc.rdoc_dir = 'rdoc' | ||
| rdoc.title = 'BootstrapForm' | ||
| rdoc.options << '--line-numbers' | ||
| rdoc.rdoc_files.include('README.rdoc') | ||
| rdoc.rdoc_files.include('README.md') | ||
| rdoc.rdoc_files.include('lib/**/*.rb') | ||
| end | ||
|
|
||
|
|
||
|
|
||
| Bundler::GemHelper.install_tasks | ||
| require 'bundler/gem_tasks' | ||
|
|
||
| require 'rake/testtask' | ||
|
|
||
| Rake::TestTask.new(:test) do |t| | ||
| t.libs << 'lib' | ||
| t.libs << 'test' | ||
| t.pattern = 'test/**/*_test.rb' | ||
| t.verbose = false | ||
| end | ||
|
|
||
|
|
||
| task :default => :test | ||
| task default: :test |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to keep the friendly and welcoming attitude (perhaps with some grammar edits):
Any reason to remove it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we want to make the CONTRIBUTING document more complete, rather than less.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Felt like it was kinda redundant. I'll add it back.