Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ test/dummy/tmp/
*.gem
.rbenv-gemsets
*.swp
gemfiles/*.lock
Gemfile.lock
.ruby-version
47 changes: 24 additions & 23 deletions .travis.yml
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
28 changes: 0 additions & 28 deletions Appraisals

This file was deleted.

70 changes: 37 additions & 33 deletions CONTRIBUTING.md
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).
Copy link
Copy Markdown
Contributor

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):

Your comments are welcome.

Thanks so much for considering a contribution to bootstrap_form.
We love pull requests!

Any reason to remove it?

Copy link
Copy Markdown
Contributor

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.

Copy link
Copy Markdown
Contributor Author

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.


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
23 changes: 12 additions & 11 deletions Gemfile
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"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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"
Copy link
Copy Markdown
Contributor

@mattbrictson mattbrictson Jan 9, 2018

Choose a reason for hiding this comment

The 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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The 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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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. 😀

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The 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.

sqlite3 and jruby immidiately come to mind.

end
20 changes: 5 additions & 15 deletions Rakefile
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
22 changes: 9 additions & 13 deletions bootstrap_form.gemspec
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
lib = File.expand_path("../lib", __FILE__)
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)

require "bootstrap_form/version"

# Describe your gem and declare its dependencies:
Gem::Specification.new do |s|
s.name = "bootstrap_form"
s.version = BootstrapForm::VERSION
Expand All @@ -16,17 +16,13 @@ Gem::Specification.new do |s|
s.license = "MIT"

s.files = `git ls-files -z`.split("\x0").reject do |f|
f.match(%r{^(test|spec|features)/})
f.match(%r{^(test)/})
end
s.bindir = "exe"

s.add_development_dependency "appraisal"
s.add_development_dependency "diffy"
s.add_development_dependency "equivalent-xml"
s.add_development_dependency "mime-types", "~> 2.6.2"
s.add_development_dependency "mocha"
s.add_development_dependency "nokogiri"
s.add_development_dependency "rails", ">= 4.0"
s.add_development_dependency "sqlite3"
s.add_development_dependency "timecop", "~> 0.7.1"
s.bindir = "exe"
s.require_paths = ["lib"]

s.required_ruby_version = ">= 2.2.2"

s.add_dependency "rails", ">= 5.0"
end
9 changes: 0 additions & 9 deletions gemfiles/4.0.gemfile

This file was deleted.

9 changes: 0 additions & 9 deletions gemfiles/4.1.gemfile

This file was deleted.

9 changes: 0 additions & 9 deletions gemfiles/4.2.gemfile

This file was deleted.

10 changes: 0 additions & 10 deletions gemfiles/5.0.gemfile

This file was deleted.

9 changes: 0 additions & 9 deletions gemfiles/5.1.gemfile

This file was deleted.

16 changes: 0 additions & 16 deletions test/dummy/.gitignore

This file was deleted.

Loading