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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 597d03494d8a7feeff8bae4c0be19c2afe9852a05499afd17ab59010257cdfc2
4
- data.tar.gz: 7055195b1511df649ab20ff16e06dd14a385fcd7b44f2c0acf51c844559a457f
3
+ metadata.gz: 880d0912909e0a73c114fb30870f6fbcfed113ee2f8b0d4503ad00ad4312bc8c
4
+ data.tar.gz: 35b13baed25a489f93569882e475d3a33df69c2b0f57c919db0676ccc7d475c6
5
5
  SHA512:
6
- metadata.gz: 441e0939dd260e0cd05505cdbd38bcf638f65f5eec6ec15588698eaa9b8a354f0776bd89a2596732346e9a40e426fcac4cf3f951c67b742259af3ddd0d70c8bf
7
- data.tar.gz: 566ffe365478924633f4ad7ceb2cb0b7739c22040527342727853af18e071189b5ed3b0d50ad80cd07aa4ccefb32bc9bfcf834c84f483a6bcb98925fd6d5db9f
6
+ metadata.gz: c72d762a74b7a5a599e7fb3d975d265ef29be217d511fb9ef6233f2303cc36601f27efeb4ce3b4e8383d31cc71a62a41564569b3c5db7e616c17ffabec0a7422
7
+ data.tar.gz: eb80a249c2b07d4765805ca13ceff9acd8275065a498b6a57e699758fa9bb40390903d8ab5fec71a2e974165a2183996812ec08b79c65ae15cb85fbeccc4d9c2
@@ -15,6 +15,7 @@ gemfile:
15
15
  rvm:
16
16
  - 2.4.4
17
17
  - 2.5.1
18
+ - jruby
18
19
 
19
20
  notifications:
20
21
  email: false
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,3 @@
1
+ // Place all the styles related to the <%= name %> controller here.
2
+ // They will automatically be included in application.css.
3
+ // You can use Sass here: http://sass-lang.com/
@@ -0,0 +1,9 @@
1
+ require "rails/generators/sass_scaffold"
2
+
3
+ module Sass
4
+ module Generators
5
+ class ScaffoldGenerator < ::Sass::Generators::ScaffoldBase
6
+ def syntax() :sass end
7
+ end
8
+ end
9
+ 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
@@ -0,0 +1,3 @@
1
+ // Place all the styles related to the <%= name %> controller here.
2
+ // They will automatically be included in application.css.
3
+ // You can use Sass (SCSS) here: http://sass-lang.com/
@@ -0,0 +1,10 @@
1
+ require "rails/generators/sass_scaffold"
2
+
3
+ module Scss
4
+ module Generators
5
+ class ScaffoldGenerator < ::Sass::Generators::ScaffoldBase
6
+ def syntax() :scss end
7
+ end
8
+ end
9
+ end
10
+
@@ -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.exists?(try_path)
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
@@ -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) { |*args| safe_merge(*args) }
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(key, left, right)
73
+ def safe_merge(_key, left, right)
74
74
  if [left, right].all? { |v| v.is_a? Hash }
75
- left.merge(right) { |*args| safe_merge *args }
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module SassC
4
4
  module Rails
5
- VERSION = "2.0.0"
5
+ VERSION = "2.1.0"
6
6
  end
7
7
  end
@@ -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.exists?("#{app_root}/log/development.log")
253
+ # if File.exist?("#{app_root}/log/development.log")
254
254
  # log_file = "#{app_root}/log/development.log"
255
- # elsif File.exists?("#{app_root}/log/test.log")
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.0.0
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-10-30 00:00:00.000000000 Z
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