From fe4aaa4b8a98e8b2f32f2d2e7f1c616d68417087 Mon Sep 17 00:00:00 2001 From: Gleb Mazovetskiy Date: Sat, 6 Sep 2014 03:39:24 +0200 Subject: [PATCH] Drop Sprockets `depend_on` Sprockets does not require depend_on for our use case since v2.1.4 Drop the directives, and instruct Rails users to use sprockets-rails v2.1.4+. Profit: Bower package can now be used from Rails Related issues: #592, #689 --- README.md | 4 ++++ assets/stylesheets/bootstrap/_glyphicons.scss | 4 ---- tasks/converter/less_conversion.rb | 1 - tasks/converter/network.rb | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 148305c9..9cea5e27 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,10 @@ When using [bootstrap-sass Bower package](#c-bower) in Rails, ensure [minimum Sa `bootstrap-sprockets` must be imported before `bootstrap` for the icon fonts to work. +#### Rails 4.x + +Please make sure `sprockets-rails` is at least v2.1.4. + #### Rails 3.2.x Rails 3.2 is [no longer maintained for bugfixes](http://guides.rubyonrails.org/maintenance_policy.html), and you should upgrade as soon as possible. diff --git a/assets/stylesheets/bootstrap/_glyphicons.scss b/assets/stylesheets/bootstrap/_glyphicons.scss index 0f6ad345..c508835e 100644 --- a/assets/stylesheets/bootstrap/_glyphicons.scss +++ b/assets/stylesheets/bootstrap/_glyphicons.scss @@ -1,7 +1,3 @@ -//= depend_on "bootstrap/glyphicons-halflings-regular.eot" -//= depend_on "bootstrap/glyphicons-halflings-regular.svg" -//= depend_on "bootstrap/glyphicons-halflings-regular.ttf" -//= depend_on "bootstrap/glyphicons-halflings-regular.woff" // // Glyphicons for Bootstrap // diff --git a/tasks/converter/less_conversion.rb b/tasks/converter/less_conversion.rb index a903aec5..389ebf53 100644 --- a/tasks/converter/less_conversion.rb +++ b/tasks/converter/less_conversion.rb @@ -114,7 +114,6 @@ class Converter when 'thumbnails.less', 'labels.less', 'badges.less' file = extract_nested_rule file, 'a&' when 'glyphicons.less' - file = bootstrap_font_files.map { |p| %Q(//= depend_on "bootstrap/#{File.basename(p)}") } * "\n" + "\n" + file file = replace_rules(file, '@font-face') { |rule| rule = replace_all rule, /(\$icon-font(?:-\w+)+)/, '#{\1}' replace_asset_url rule, :font diff --git a/tasks/converter/network.rb b/tasks/converter/network.rb index 1404b65b..848778a4 100644 --- a/tasks/converter/network.rb +++ b/tasks/converter/network.rb @@ -60,7 +60,7 @@ class Converter # get sha of the branch (= the latest commit) def get_branch_sha @branch_sha ||= begin - if %x[git rev-parse #@branch].chomp == @branch + if @branch + "\n" == %x[git rev-parse #@branch] @branch else cmd = "git ls-remote #{Shellwords.escape "https://github.com/#@repo"} #@branch"