Skip to content

Commit

Permalink
Support sass-rails 6. Fixes #3129
Browse files Browse the repository at this point in the history
  • Loading branch information
mshibuya committed May 5, 2019
1 parent 0e341a4 commit e9a7ad6
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ end

appraise "rails-6.0" do
gem 'rails', '~> 6.0.0.rc1'
gem 'sass-rails', '~> 5.0'
gem 'sass-rails', ['>= 6.0.0.beta3', '< 7']
gem 'devise', '~> 4.4'

group :test do
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/rails_6.0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ gem "appraisal", ">= 2.0"
gem "rails", "~> 6.0.0.rc1"
gem "haml"
gem "devise", "~> 4.4"
gem "sass-rails", "~> 5.0"
gem "sass-rails", [">= 6.0.0.beta3", "< 7"]

group :active_record do
gem "paper_trail", ">= 5.0"
Expand Down
6 changes: 4 additions & 2 deletions lib/rails_admin/bootstrap-sass.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ def self.load!
raise(Bootstrap::FrameworkNotFound.new('bootstrap-sass requires either Rails > 3.1 or Compass, neither of which are loaded'))
end

stylesheets = File.expand_path(File.join('..', 'vendor', 'assets', 'stylesheets'))
::Sass.load_paths << stylesheets
if defined?(::Sass) && ::Sass.respond_to?(:load_paths)
stylesheets = File.expand_path(File.join('..', 'vendor', 'assets', 'stylesheets'))
::Sass.load_paths << stylesheets
end
end

def self.asset_pipeline?
Expand Down
4 changes: 1 addition & 3 deletions lib/rails_admin/bootstrap-sass/sass_functions.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
require 'sass'

module Sass
module Script
module Functions
Expand All @@ -12,7 +10,7 @@ def ie_hex_str(color)
alphastr = alpha.to_s(16).rjust(2, '0')
Sass::Script::String.new("##{alphastr}#{color.send(:hex_str)[1..-1]}".upcase)
end
declare :ie_hex_str, [:color]
declare :ie_hex_str, [:color] if respond_to?(:declare)
end
end
end
2 changes: 1 addition & 1 deletion rails_admin.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Gem::Specification.new do |spec|
spec.add_dependency 'rack-pjax', '>= 0.7'
spec.add_dependency 'rails', ['>= 5.0', '< 7']
spec.add_dependency 'remotipart', '~> 1.3'
spec.add_dependency 'sass-rails', ['>= 4.0', '< 6']
spec.add_dependency 'sass-rails', ['>= 4.0', '< 7']
spec.add_dependency 'activemodel-serializers-xml', '>= 1.0'
spec.add_development_dependency 'bundler', '>= 1.0'
spec.authors = ['Erik Michaels-Ober', 'Bogdan Gaza', 'Petteri Kaapa', 'Benoit Benezech', 'Mitsuhiro Shibuya']
Expand Down
12 changes: 6 additions & 6 deletions spec/dummy_app/Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
source 'https://rubygems.org'

gem 'rails', '~> 5.0'
gem 'rails', '>= 6.0.0.beta'
gem 'rack-cache', require: 'rack/cache'

group :active_record do
Expand All @@ -14,12 +14,12 @@ group :active_record do
end

platforms :ruby, :mswin, :mingw do
gem 'mysql2', '~> 0.3.14'
gem 'mysql2', '>= 0.3.14'
gem 'pg', '>= 0.14'
gem 'sqlite3', '~> 1.3.0'
gem 'sqlite3', '>= 1.3.0'
end

gem 'paper_trail', '~> 5.0'
gem 'paper_trail', '>= 5.0'
end

group :mongoid do
Expand All @@ -37,15 +37,15 @@ gem 'mlb', '>= 0.7'
gem 'paperclip', '>= 3.4'
gem 'rails_admin', path: '../../'

platforms :ruby_21, :ruby_22 do
platforms :mri do
# gem 'refile', '>= 0.5', require: 'refile/rails'
# gem 'refile-mini_magick', '>= 0.1.0'
end

# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '>= 4.0.3'
gem 'sass-rails', '>= 6.0.0.beta'
gem 'coffee-rails', '~> 4.0'

# See https://github.com/sstephenson/execjs#readme for more supported runtimes
Expand Down

0 comments on commit e9a7ad6

Please sign in to comment.