diff options
author | Gleb Mazovetskiy <glex.spb@gmail.com> | 2017-05-29 16:50:53 +0300 |
---|---|---|
committer | Gleb Mazovetskiy <glex.spb@gmail.com> | 2017-05-29 16:54:51 +0300 |
commit | 8927eff0d7779cedd4fe773a9b8b5b7174d065c6 (patch) | |
tree | 406eaa3164458f4ccd81d363877ddb42c6e05ca5 | |
parent | f4ff7cc4b2d71c54d8809f546d2fd239e0016baf (diff) |
Promote Popper.js to gem dependency
-rw-r--r-- | README.md | 36 | ||||
-rw-r--r-- | bootstrap.gemspec | 2 | ||||
-rw-r--r-- | test/gemfiles/rails_4_2.gemfile | 4 | ||||
-rw-r--r-- | test/gemfiles/rails_5_0.gemfile | 4 | ||||
-rw-r--r-- | test/gemfiles/rails_5_1.gemfile | 4 |
5 files changed, 18 insertions, 32 deletions
@@ -44,37 +44,33 @@ Then, remove all the `*= require` and `*= require_tree` statements from the Sass Do not use `*= require` in Sass or your other stylesheets will not be able to access the Bootstrap mixins and variables. -If you're using Rails 5.1+, you'll need to add the jquery gem to your Gemfile: -``` +Bootstrap JavaScript depends on jQuery. +If you're using Rails 5.1+, add the `jquery-rails` gem to your Gemfile: + +```ruby gem 'jquery-rails' ``` -And you will need to include jquery into application.js: -```js -//= require jquery -//= require bootstrap-sprockets -``` +Bootstrap tooltips and popovers depend on [popper.js] for positioning. +The `bootstrap` gem already depends on the +[popper_js](https://github.com/glebm/popper_js-rubygem) gem. -While `bootstrap-sprockets` provides individual Bootstrap components for ease of debugging, you may alternatively require the concatenated `bootstrap` for faster compilation: +Add Bootstrap dependencies and Bootstrap to your `application.js`: ```js -//= require jquery -//= require bootstrap -``` - -Tooltips and popovers depend on [popper.js] for positioning. -If you use them, add popper.js to the Gemfile: - -```ruby -gem 'popper_js', '>= 1.9.9' +//= require jquery3 +//= require popper +//= require bootstrap-sprockets ``` -Then, run `bundle`, restart the server, and require popper before bootstrap but after jQuery: +While `bootstrap-sprockets` provides individual Bootstrap components +for ease of debugging, you may alternatively require +the concatenated `bootstrap` for faster compilation: ```js -//= require jquery +//= require jquery3 //= require popper -//= require bootstrap-sprockets +//= require bootstrap ``` ### b. Compass without Rails diff --git a/bootstrap.gemspec b/bootstrap.gemspec index f46a563..bab30a0 100644 --- a/bootstrap.gemspec +++ b/bootstrap.gemspec @@ -11,6 +11,8 @@ Gem::Specification.new do |s| s.homepage = 'https://github.com/twbs/bootstrap-rubygem' s.license = 'MIT' + s.add_runtime_dependency 'popper_js', '>= 1.9.9', '< 2.0' + s.add_runtime_dependency 'sass', '>= 3.4.19' s.add_runtime_dependency 'autoprefixer-rails', '>= 6.0.3' diff --git a/test/gemfiles/rails_4_2.gemfile b/test/gemfiles/rails_4_2.gemfile index 2f177cd..c126c00 100644 --- a/test/gemfiles/rails_4_2.gemfile +++ b/test/gemfiles/rails_4_2.gemfile @@ -3,9 +3,5 @@ source 'https://rubygems.org' gem 'actionpack', '~> 4.2.7' gem 'activesupport', '~> 4.2.7' -source 'https://rails-assets.org' do - gem 'popper_js', '>= 1.9.9' -end - gemspec path: '../../' diff --git a/test/gemfiles/rails_5_0.gemfile b/test/gemfiles/rails_5_0.gemfile index bcfab5f..397a0c7 100644 --- a/test/gemfiles/rails_5_0.gemfile +++ b/test/gemfiles/rails_5_0.gemfile @@ -4,9 +4,5 @@ gem 'actionpack', '~> 5.0.0' gem 'activesupport', '~> 5.0.0' gem 'autoprefixer-rails', '>= 6.3.6.1' -source 'https://rails-assets.org' do - gem 'popper_js', '>= 1.9.9' -end - gemspec path: '../../' diff --git a/test/gemfiles/rails_5_1.gemfile b/test/gemfiles/rails_5_1.gemfile index fb5fd59..61e9e13 100644 --- a/test/gemfiles/rails_5_1.gemfile +++ b/test/gemfiles/rails_5_1.gemfile @@ -4,9 +4,5 @@ gem 'actionpack', '~> 5.1.0' gem 'activesupport', '~> 5.1.0' gem 'autoprefixer-rails', '>= 7.1.1' -source 'https://rails-assets.org' do - gem 'popper_js', '>= 1.9.9' -end - gemspec path: '../../' |