sassc-rails 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/README.md +3 -0
- data/lib/rails/generators/sass/assets/assets_generator.rb +13 -0
- data/lib/rails/generators/sass/assets/templates/stylesheet.sass +3 -0
- data/lib/rails/generators/sass/scaffold/scaffold_generator.rb +9 -0
- data/lib/rails/generators/sass_scaffold.rb +15 -0
- data/lib/rails/generators/scss/assets/assets_generator.rb +13 -0
- data/lib/rails/generators/scss/assets/templates/stylesheet.scss +3 -0
- data/lib/rails/generators/scss/scaffold/scaffold_generator.rb +10 -0
- data/lib/sassc/rails/importer.rb +1 -1
- data/lib/sassc/rails/template.rb +3 -3
- data/lib/sassc/rails/version.rb +1 -1
- data/test/sassc_rails_test.rb +2 -2
- metadata +9 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 880d0912909e0a73c114fb30870f6fbcfed113ee2f8b0d4503ad00ad4312bc8c
|
4
|
+
data.tar.gz: 35b13baed25a489f93569882e475d3a33df69c2b0f57c919db0676ccc7d475c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c72d762a74b7a5a599e7fb3d975d265ef29be217d511fb9ef6233f2303cc36601f27efeb4ce3b4e8383d31cc71a62a41564569b3c5db7e616c17ffabec0a7422
|
7
|
+
data.tar.gz: eb80a249c2b07d4765805ca13ceff9acd8275065a498b6a57e699758fa9bb40390903d8ab5fec71a2e974165a2183996812ec08b79c65ae15cb85fbeccc4d9c2
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -85,6 +85,9 @@ is maintained by [Ryan Boland](https://ryanboland.com) and [awesome contributors
|
|
85
85
|
|
86
86
|
## Changelog
|
87
87
|
|
88
|
+
- **2.1.0**
|
89
|
+
- [JRuby support](https://github.com/sass/sassc-rails/pull/113)
|
90
|
+
- [SCSS / SASS scaffolding](https://github.com/sass/sassc-rails/pull/112)
|
88
91
|
- **2.0.0**
|
89
92
|
- [Drop support for Sprockets 2](https://github.com/sass/sassc-rails/pull/109)
|
90
93
|
- [Remove dependency on Ruby Sass](https://github.com/sass/sassc-rails/pull/109)
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require "rails/generators/named_base"
|
2
|
+
|
3
|
+
module Sass
|
4
|
+
module Generators
|
5
|
+
class AssetsGenerator < ::Rails::Generators::NamedBase
|
6
|
+
source_root File.expand_path("../templates", __FILE__)
|
7
|
+
|
8
|
+
def copy_sass
|
9
|
+
template "stylesheet.sass", File.join('app/assets/stylesheets', class_path, "#{file_name}.sass")
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require "sass/css"
|
2
|
+
require "rails/generators/named_base"
|
3
|
+
|
4
|
+
module Sass
|
5
|
+
module Generators
|
6
|
+
class ScaffoldBase < ::Rails::Generators::NamedBase
|
7
|
+
def copy_stylesheet
|
8
|
+
dir = ::Rails::Generators::ScaffoldGenerator.source_root
|
9
|
+
file = File.join(dir, "scaffold.css")
|
10
|
+
converted_contents = ::Sass::CSS.new(File.read(file)).render(syntax)
|
11
|
+
create_file "app/assets/stylesheets/scaffolds.#{syntax}", converted_contents
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require "rails/generators/named_base"
|
2
|
+
|
3
|
+
module Scss
|
4
|
+
module Generators
|
5
|
+
class AssetsGenerator < ::Rails::Generators::NamedBase
|
6
|
+
source_root File.expand_path("../templates", __FILE__)
|
7
|
+
|
8
|
+
def copy_scss
|
9
|
+
template "stylesheet.scss", File.join('app/assets/stylesheets', class_path, "#{file_name}.scss")
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
data/lib/sassc/rails/importer.rb
CHANGED
@@ -113,7 +113,7 @@ module SassC
|
|
113
113
|
|
114
114
|
EXTENSIONS.each do |extension|
|
115
115
|
try_path = File.join(search_path, file_name + extension.postfix)
|
116
|
-
if File.
|
116
|
+
if File.exist?(try_path)
|
117
117
|
record_import_as_dependency try_path
|
118
118
|
return extension.import_for(try_path, parent_dir, options)
|
119
119
|
end
|
data/lib/sassc/rails/template.rb
CHANGED
@@ -32,7 +32,7 @@ module SassC::Rails
|
|
32
32
|
environment: input[:environment],
|
33
33
|
dependencies: context.metadata[:dependency_paths]
|
34
34
|
}
|
35
|
-
}.merge(config_options) {
|
35
|
+
}.merge!(config_options) { |key, left, right| safe_merge(key, left, right) }
|
36
36
|
|
37
37
|
engine = ::SassC::Engine.new(input[:data], options)
|
38
38
|
|
@@ -70,9 +70,9 @@ module SassC::Rails
|
|
70
70
|
Rails.application.config.sass.line_comments
|
71
71
|
end
|
72
72
|
|
73
|
-
def safe_merge(
|
73
|
+
def safe_merge(_key, left, right)
|
74
74
|
if [left, right].all? { |v| v.is_a? Hash }
|
75
|
-
left.merge(right) {
|
75
|
+
left.merge(right) { |k, l, r| safe_merge(k, l, r) }
|
76
76
|
elsif [left, right].all? { |v| v.is_a? Array }
|
77
77
|
(left + right).uniq
|
78
78
|
else
|
data/lib/sassc/rails/version.rb
CHANGED
data/test/sassc_rails_test.rb
CHANGED
@@ -250,9 +250,9 @@ class SassRailsTest < MiniTest::Test
|
|
250
250
|
# css_output = asset_output('css_application.css')
|
251
251
|
# assert_match /globbed/, css_output
|
252
252
|
|
253
|
-
# if File.
|
253
|
+
# if File.exist?("#{app_root}/log/development.log")
|
254
254
|
# log_file = "#{app_root}/log/development.log"
|
255
|
-
# elsif File.
|
255
|
+
# elsif File.exist?("#{app_root}/log/test.log")
|
256
256
|
# log_file = "#{app_root}/log/test.log"
|
257
257
|
# else
|
258
258
|
# flunk "log file was not created"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sassc-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Boland
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-12-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|
@@ -156,6 +156,13 @@ files:
|
|
156
156
|
- gemfiles/sprockets-rails_3_0.gemfile
|
157
157
|
- gemfiles/sprockets_3_0.gemfile
|
158
158
|
- gemfiles/sprockets_4_0.gemfile
|
159
|
+
- lib/rails/generators/sass/assets/assets_generator.rb
|
160
|
+
- lib/rails/generators/sass/assets/templates/stylesheet.sass
|
161
|
+
- lib/rails/generators/sass/scaffold/scaffold_generator.rb
|
162
|
+
- lib/rails/generators/sass_scaffold.rb
|
163
|
+
- lib/rails/generators/scss/assets/assets_generator.rb
|
164
|
+
- lib/rails/generators/scss/assets/templates/stylesheet.scss
|
165
|
+
- lib/rails/generators/scss/scaffold/scaffold_generator.rb
|
159
166
|
- lib/sassc-rails.rb
|
160
167
|
- lib/sassc/rails.rb
|
161
168
|
- lib/sassc/rails/compressor.rb
|