Skip to content

Commit

Permalink
a simpler solution to #523 rails 3 compat
Browse files Browse the repository at this point in the history
  • Loading branch information
glebm committed Feb 6, 2014
1 parent a0077ef commit 2e1ca4e
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 14 deletions.
13 changes: 2 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,7 @@ gem 'bootstrap-sass', '~> 3.1.0'

#### Rails 3.2.x

bootstrap-sass requires a newer version of the asset pipeline than the one that ships with Rails 3.2.x.
You can use these backports of the new pipeline on Rails 3.2.x:

```ruby
gem 'sprockets-rails', '~> 2.0.0.backport1'
gem 'sprockets', '~> 2.2.2.backport2'
gem 'sass-rails', github: 'guilleiguaran/sass-rails', branch: 'backport'
```

Make sure that all the gems are moved out of the `:assets` group, and `config.assets.initialize_on_precompile` is set to `true`.
For Rails 3.2.x, make sure that all the gems are moved out of the `:assets` group, and `config.assets.initialize_on_precompile` is set to `true`.


### b. Compass without Rails
Expand Down Expand Up @@ -149,7 +140,7 @@ You can also import components explicitly. To start with a full list of modules
```bash
# copy and prepend "bootstrap/" to the @import paths:
sed 's/@import "/@import "bootstrap\//' \
$(bundle show bootstrap-sass)/vendor/assets/stylesheets/bootstrap/bootstrap.scss > \
$(bundle show bootstrap-sass)/vendor/assets/stylesheets/bootstrap.scss > \
app/assets/stylesheets/bootstrap-custom.scss
```
Comment out components you do not want from `bootstrap-custom`.
Expand Down
2 changes: 1 addition & 1 deletion lib/bootstrap-sass/version.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Bootstrap
VERSION = '3.1.0.1'
BOOTSTRAP_SHA = '7861f6e8a50bc50d737366f1c89f248321383875'
BOOTSTRAP_SHA = '7eb532262fbd1112215b5a547b9285794b5360ab'
end
6 changes: 5 additions & 1 deletion tasks/converter/less_conversion.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def load_shared
def process_stylesheet_assets
log_status 'Processing stylesheets...'
files = read_files('less', bootstrap_less_files)
save_to = @save_to[:scss]

log_status ' Converting LESS files to Scss:'
files.each do |name, file|
Expand Down Expand Up @@ -118,11 +119,14 @@ def process_stylesheet_assets
end

name = name.sub(/\.less$/, '.scss')
save_to = @save_to[:scss]
path = "#{save_to}/#{'_' unless name == 'bootstrap.scss'}#{name}"
save_file(path, file)
log_processed File.basename(path)
end

# generate imports valid relative to both load path and file directory
save_file File.expand_path("#{save_to}/../bootstrap.scss"),
File.read("#{save_to}/bootstrap.scss").gsub(/ "/, ' "bootstrap/')
end

def bootstrap_less_files
Expand Down
50 changes: 49 additions & 1 deletion vendor/assets/stylesheets/bootstrap.scss
Original file line number Diff line number Diff line change
@@ -1 +1,49 @@
@import "bootstrap/bootstrap";
// Core variables and mixins
@import "bootstrap/variables";
@import "bootstrap/mixins";

// Reset
@import "bootstrap/normalize";
@import "bootstrap/print";

// Core CSS
@import "bootstrap/scaffolding";
@import "bootstrap/type";
@import "bootstrap/code";
@import "bootstrap/grid";
@import "bootstrap/tables";
@import "bootstrap/forms";
@import "bootstrap/buttons";

// Components
@import "bootstrap/component-animations";
@import "bootstrap/glyphicons";
@import "bootstrap/dropdowns";
@import "bootstrap/button-groups";
@import "bootstrap/input-groups";
@import "bootstrap/navs";
@import "bootstrap/navbar";
@import "bootstrap/breadcrumbs";
@import "bootstrap/pagination";
@import "bootstrap/pager";
@import "bootstrap/labels";
@import "bootstrap/badges";
@import "bootstrap/jumbotron";
@import "bootstrap/thumbnails";
@import "bootstrap/alerts";
@import "bootstrap/progress-bars";
@import "bootstrap/media";
@import "bootstrap/list-group";
@import "bootstrap/panels";
@import "bootstrap/wells";
@import "bootstrap/close";

// Components w/ JavaScript
@import "bootstrap/modals";
@import "bootstrap/tooltip";
@import "bootstrap/popovers";
@import "bootstrap/carousel";

// Utility classes
@import "bootstrap/utilities";
@import "bootstrap/responsive-utilities";

0 comments on commit 2e1ca4e

Please sign in to comment.