Skip to content

Commit 4970953

Browse files
committed
Drop Compass support, bump minimum Sass version
Compass is no longer maintained and hasn't seen a release for 3 years. The compass gem locks Sass to version < 3.5. However, we now need Sass v3.5+ due to sass/sass#2383 This commit removes compass support and bumps minimum Ruby Sass version to v3.5.2.
1 parent 6b91142 commit 4970953

10 files changed

Lines changed: 12 additions & 930 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ The changelog only includes changes specific to the RubyGem.
66
The Bootstrap framework changes can be found in [the Releases section of twbs/bootstrap](https://github.com/twbs/bootstrap/releases).
77
Release announcement posts on [the official Bootstrap blog](http://blog.getbootstrap.com) contain summaries of the most noteworthy changes made in each release of Bootstrap.
88

9+
# 4.0.0.beta
10+
11+
Compass is no longer supported.
912

1013
# 4.0.0.alpha3.1
1114

README.md

Lines changed: 8 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Bootstrap Ruby Gem [![Build Status](https://travis-ci.org/twbs/bootstrap-rubygem.svg?branch=master)](https://travis-ci.org/twbs/bootstrap-rubygem) [![Gem](https://img.shields.io/gem/v/bootstrap.svg)](https://rubygems.org/gems/bootstrap)
22

3-
[Bootstrap 4][bootstrap-home] ruby gem for Ruby on Rails (Sprockets), Hanami (formerly Lotus) and Compass.
3+
[Bootstrap 4][bootstrap-home] ruby gem for Ruby on Rails (Sprockets) and Hanami (formerly Lotus).
44

55
For Sass versions of Bootstrap 3 and 2 see [bootstrap-sass](https://github.com/twbs/bootstrap-sass) instead.
66

@@ -9,7 +9,7 @@ For Sass versions of Bootstrap 3 and 2 see [bootstrap-sass](https://github.com/t
99
Please see the appropriate guide for your environment of choice:
1010

1111
* [Ruby on Rails 4+](#a-ruby-on-rails) or other Sprockets environment.
12-
* [Compass](#b-compass-without-rails) not on Rails.
12+
* [Other Ruby frameworks](#b-other-ruby-frameworks) not on Rails.
1313

1414

1515
### a. Ruby on Rails
@@ -73,47 +73,14 @@ the concatenated `bootstrap` for faster compilation:
7373
//= require bootstrap
7474
```
7575

76-
### b. Compass without Rails
76+
### b. Other Ruby frameworks
7777

78-
Install the gem:
78+
If your framework uses Sprockets or Hanami,
79+
the assets will be registered with Sprockets when the gem is required,
80+
and you can use them as per the Rails section of the guide.
7981

80-
```console
81-
$ gem install bootstrap -v 4.0.0.beta
82-
```
83-
84-
**If you have an existing Compass project:**
85-
86-
1. Require `bootstrap` in `config.rb`:
87-
88-
```ruby
89-
require 'bootstrap'
90-
```
91-
92-
2. Install Bootstrap with:
93-
94-
```console
95-
$ bundle exec compass install bootstrap
96-
```
97-
98-
**If you are creating a new Compass project, you can generate it with bootstrap support:**
99-
100-
```console
101-
$ bundle exec compass create my-new-project -r bootstrap --using bootstrap
102-
```
103-
104-
or, alternatively, if you're not using a Gemfile for your dependencies:
105-
106-
```console
107-
$ compass create my-new-project -r bootstrap --using bootstrap
108-
```
109-
110-
This will create a new Compass project with the following files in it:
111-
112-
* [styles.scss](/templates/project/styles.scss) - main project Sass file, imports Bootstrap and variables.
113-
* [_bootstrap-variables.scss](/templates/project/_bootstrap-variables.scss) - all of Bootstrap variables, override them here.
114-
115-
Some bootstrap mixins may conflict with the Compass ones.
116-
If this happens, change the import order so that Compass mixins are loaded later.
82+
Otherwise you may need to register the assets manually.
83+
Refer to your framework's documentation on the subject.
11784

11885
## Configuration
11986

bootstrap.gemspec

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,12 @@ Gem::Specification.new do |s|
1313

1414
s.add_runtime_dependency 'popper_js', '>= 1.12.3', '< 2'
1515

16-
s.add_runtime_dependency 'sass', '>= 3.4.19'
16+
s.add_runtime_dependency 'sass', '>= 3.5.2'
1717
s.add_runtime_dependency 'autoprefixer-rails', '>= 6.0.3'
1818

1919
# Testing dependencies
2020
s.add_development_dependency 'minitest', '~> 5.8.0'
2121
s.add_development_dependency 'minitest-reporters', '~> 1.0.5'
22-
s.add_development_dependency 'compass', '~> 1.0.3'
2322
s.add_development_dependency 'term-ansicolor'
2423
# Integration testing
2524
s.add_development_dependency 'capybara', '>= 2.6.0'

lib/bootstrap.rb

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ module Bootstrap
55
class << self
66
# Inspired by Kaminari
77
def load!
8-
register_compass_extension if compass?
9-
108
if rails?
119
register_rails_engine
1210
elsif hanami?
@@ -40,10 +38,6 @@ def sprockets?
4038
defined?(::Sprockets)
4139
end
4240

43-
def compass?
44-
defined?(::Compass::Frameworks)
45-
end
46-
4741
def rails?
4842
defined?(::Rails)
4943
end
@@ -60,16 +54,6 @@ def configure_sass
6054
::Sass.load_paths << stylesheets_path
6155
end
6256

63-
def register_compass_extension
64-
::Compass::Frameworks.register(
65-
'bootstrap',
66-
:version => Bootstrap::VERSION,
67-
:path => gem_path,
68-
:stylesheets_directory => stylesheets_path,
69-
:templates_directory => File.join(gem_path, 'templates')
70-
)
71-
end
72-
7357
def register_rails_engine
7458
require 'bootstrap/engine'
7559
end

tasks/updater/scss.rb

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,6 @@ def update_scss_assets
2121
# As we moved the files, adjust imports accordingly.
2222
File.write to, File.read(to).gsub(/ "/, ' "bootstrap/')
2323
end
24-
25-
log_status 'Generating variable template file'
26-
save_file 'templates/project/_bootstrap-variables.scss',
27-
"// Override Bootstrap variables here (defaults from bootstrap v#{upstream_version}):\n" +
28-
File.read("#{save_to}/_variables.scss").
29-
# The instructions in the file header are replaced with the line above
30-
lines[4..-1].
31-
join.
32-
# Comment out the assignments
33-
gsub(/^(?=[$@)}]|[ ]{2})/, '// ').
34-
# Remove the !default modifier
35-
gsub(/ !default/, '')
3624
end
3725
end
3826
end

0 commit comments

Comments
 (0)