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

Drop Compass support, bump minimum Sass version #122

Merged
merged 1 commit into from
Oct 12, 2017
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ The changelog only includes changes specific to the RubyGem.
The Bootstrap framework changes can be found in [the Releases section of twbs/bootstrap](https://github.com/twbs/bootstrap/releases).
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.

# 4.0.0.beta

Compass is no longer supported.

# 4.0.0.alpha3.1

Expand Down
49 changes: 8 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 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)

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

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

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

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


### a. Ruby on Rails
Expand Down Expand Up @@ -73,47 +73,14 @@ the concatenated `bootstrap` for faster compilation:
//= require bootstrap
```

### b. Compass without Rails
### b. Other Ruby frameworks

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

```console
$ gem install bootstrap -v 4.0.0.beta
```

**If you have an existing Compass project:**

1. Require `bootstrap` in `config.rb`:

```ruby
require 'bootstrap'
```

2. Install Bootstrap with:

```console
$ bundle exec compass install bootstrap
```

**If you are creating a new Compass project, you can generate it with bootstrap support:**

```console
$ bundle exec compass create my-new-project -r bootstrap --using bootstrap
```

or, alternatively, if you're not using a Gemfile for your dependencies:

```console
$ compass create my-new-project -r bootstrap --using bootstrap
```

This will create a new Compass project with the following files in it:

* [styles.scss](/templates/project/styles.scss) - main project Sass file, imports Bootstrap and variables.
* [_bootstrap-variables.scss](/templates/project/_bootstrap-variables.scss) - all of Bootstrap variables, override them here.

Some bootstrap mixins may conflict with the Compass ones.
If this happens, change the import order so that Compass mixins are loaded later.
Otherwise you may need to register the assets manually.
Refer to your framework's documentation on the subject.

## Configuration

Expand Down
3 changes: 1 addition & 2 deletions bootstrap.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@ Gem::Specification.new do |s|

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

s.add_runtime_dependency 'sass', '>= 3.4.19'
s.add_runtime_dependency 'sass', '>= 3.5.2'
s.add_runtime_dependency 'autoprefixer-rails', '>= 6.0.3'

# Testing dependencies
s.add_development_dependency 'minitest', '~> 5.8.0'
s.add_development_dependency 'minitest-reporters', '~> 1.0.5'
s.add_development_dependency 'compass', '~> 1.0.3'
s.add_development_dependency 'term-ansicolor'
# Integration testing
s.add_development_dependency 'capybara', '>= 2.6.0'
Expand Down
16 changes: 0 additions & 16 deletions lib/bootstrap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ module Bootstrap
class << self
# Inspired by Kaminari
def load!
register_compass_extension if compass?

if rails?
register_rails_engine
elsif hanami?
Expand Down Expand Up @@ -40,10 +38,6 @@ def sprockets?
defined?(::Sprockets)
end

def compass?
defined?(::Compass::Frameworks)
end

def rails?
defined?(::Rails)
end
Expand All @@ -60,16 +54,6 @@ def configure_sass
::Sass.load_paths << stylesheets_path
end

def register_compass_extension
::Compass::Frameworks.register(
'bootstrap',
:version => Bootstrap::VERSION,
:path => gem_path,
:stylesheets_directory => stylesheets_path,
:templates_directory => File.join(gem_path, 'templates')
)
end

def register_rails_engine
require 'bootstrap/engine'
end
Expand Down
12 changes: 0 additions & 12 deletions tasks/updater/scss.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,6 @@ def update_scss_assets
# As we moved the files, adjust imports accordingly.
File.write to, File.read(to).gsub(/ "/, ' "bootstrap/')
end

log_status 'Generating variable template file'
save_file 'templates/project/_bootstrap-variables.scss',
"// Override Bootstrap variables here (defaults from bootstrap v#{upstream_version}):\n" +
File.read("#{save_to}/_variables.scss").
# The instructions in the file header are replaced with the line above
lines[4..-1].
join.
# Comment out the assignments
gsub(/^(?=[$@)}]|[ ]{2})/, '// ').
# Remove the !default modifier
gsub(/ !default/, '')
end
end
end
Loading