hanami-assets 1.3.1 → 1.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +3 -3
- data/hanami-assets.gemspec +1 -1
- data/lib/hanami/assets/bundler/compressor.rb +3 -3
- data/lib/hanami/assets/compilers/sass.rb +14 -10
- data/lib/hanami/assets/compressors/sass_stylesheet.rb +9 -11
- data/lib/hanami/assets/configuration.rb +2 -2
- data/lib/hanami/assets/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 72e4862475bc1ff37c766b05a9a08bb3ce9da8a2cf10aed7d01299cbe7178025
|
4
|
+
data.tar.gz: 99ee3de7d08606a05597e10ad263f22366190b428ff9901155d67493af8c3bcf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b640e6812aa38cd807fddb0c2a0319d667acfd431cb60f15176a3c62cfbd96c1e1962a9f57032b11d663bd694f3e8bb71d4c3ca393ebaaf0f2ca3c81b83d44b
|
7
|
+
data.tar.gz: f83efc99e3720db13b6d7fc621022c38e719734fff57fd304dbcf93b950c3bc1920753bab902d18088974f5397ba7b03a5cca0c990981f2cc2d1b29ddd56c7f9
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
# Hanami::Assets
|
2
2
|
Assets management for Ruby web applications
|
3
3
|
|
4
|
+
## v1.3.2 - 2019-08-02
|
5
|
+
### Added
|
6
|
+
- [Landon Grindheim & Sean Collins] Added support for `sassc` gem, because `sass` is no longer maintained
|
7
|
+
|
4
8
|
## v1.3.1 - 2019-01-18
|
5
9
|
### Added
|
6
10
|
- [Luca Guidi] Official support for Ruby: MRI 2.6
|
data/README.md
CHANGED
@@ -15,7 +15,7 @@ Assets management for Ruby web projects
|
|
15
15
|
|
16
16
|
* Home page: http://hanamirb.org
|
17
17
|
* Community: http://hanamirb.org/community
|
18
|
-
* Guides:
|
18
|
+
* Guides: https://guides.hanamirb.org
|
19
19
|
* Mailing List: http://hanamirb.org/mailing-list
|
20
20
|
* API Doc: http://rdoc.info/gems/hanami-assets
|
21
21
|
* Bugs/Issues: https://github.com/hanami/assets/issues
|
@@ -200,7 +200,7 @@ handling: `.css` for stylesheets.
|
|
200
200
|
The second one is optional and it's for a preprocessor: `.scss` for Sass.
|
201
201
|
|
202
202
|
```ruby
|
203
|
-
require '
|
203
|
+
require 'sassc'
|
204
204
|
require 'hanami/assets'
|
205
205
|
|
206
206
|
Hanami::Assets.configure do
|
@@ -353,7 +353,7 @@ Hanami can use the following compressors (aka minifiers) for stylesheets.
|
|
353
353
|
|
354
354
|
* `:builtin` - Ruby based compressor. It doesn't require any external gem. It's fast, but not an efficient compressor.
|
355
355
|
* `:yui` - [YUI Compressor](http://yui.github.io/yuicompressor), it depends on [`yui-compressor`](https://rubygems.org/gems/yui-compressor) gem and it requires Java 1.4+
|
356
|
-
* `:sass` - [Sass](http://sass-lang.com/), it depends on [`
|
356
|
+
* `:sass` - [Sass](http://sass-lang.com/), it depends on [`sassc`](https://rubygems.org/gems/sassc) gem
|
357
357
|
|
358
358
|
```ruby
|
359
359
|
Hanami::Assets.configure do
|
data/hanami-assets.gemspec
CHANGED
@@ -31,7 +31,7 @@ Gem::Specification.new do |spec|
|
|
31
31
|
spec.add_development_dependency 'yui-compressor', '~> 0.12'
|
32
32
|
spec.add_development_dependency 'uglifier', '~> 2.7'
|
33
33
|
spec.add_development_dependency 'closure-compiler', '~> 1.1'
|
34
|
-
spec.add_development_dependency '
|
34
|
+
spec.add_development_dependency 'sassc', '~> 2.0'
|
35
35
|
|
36
36
|
spec.add_development_dependency 'coffee-script', '~> 2.3'
|
37
37
|
spec.add_development_dependency 'babel-transpiler', '~> 0.7'
|
@@ -46,12 +46,12 @@ module Hanami
|
|
46
46
|
# @api private
|
47
47
|
def _compress(compressor)
|
48
48
|
compressor.compress(@path)
|
49
|
-
rescue =>
|
49
|
+
rescue => exception # rubocop:disable Style/RescueStandardError
|
50
50
|
warn(
|
51
51
|
[
|
52
52
|
"Skipping compression of: `#{@path}'",
|
53
|
-
"Reason: #{
|
54
|
-
"\t#{
|
53
|
+
"Reason: #{exception}\n",
|
54
|
+
"\t#{exception.backtrace.join("\n\t")}\n\n"
|
55
55
|
].join("\n")
|
56
56
|
)
|
57
57
|
end
|
@@ -10,11 +10,6 @@ module Hanami
|
|
10
10
|
# @api private
|
11
11
|
EXTENSIONS = /\.(sass|scss)\z/.freeze
|
12
12
|
|
13
|
-
# @since 0.1.0
|
14
|
-
# @api private
|
15
|
-
CACHE_LOCATION = Pathname(Hanami.respond_to?(:root) ? # rubocop:disable Style/MultilineTernaryOperator
|
16
|
-
Hanami.root : Dir.pwd).join('tmp', 'sass-cache')
|
17
|
-
|
18
13
|
# @since 0.3.0
|
19
14
|
# @api private
|
20
15
|
def self.eligible?(name)
|
@@ -26,19 +21,28 @@ module Hanami
|
|
26
21
|
# @since 0.3.0
|
27
22
|
# @api private
|
28
23
|
def renderer
|
29
|
-
|
24
|
+
@renderer ||=
|
25
|
+
::SassC::Engine.new(
|
26
|
+
source.read,
|
27
|
+
syntax: target_syntax,
|
28
|
+
load_paths: load_paths
|
29
|
+
)
|
30
30
|
end
|
31
31
|
|
32
32
|
# @since 0.3.0
|
33
33
|
# @api private
|
34
34
|
def dependencies
|
35
|
-
|
35
|
+
renderer.dependencies.map(&:filename)
|
36
36
|
end
|
37
37
|
|
38
|
-
# @since
|
38
|
+
# @since 1.3.2
|
39
39
|
# @api private
|
40
|
-
def
|
41
|
-
|
40
|
+
def target_syntax
|
41
|
+
if source.extname =~ /sass\z/.freeze
|
42
|
+
:sass
|
43
|
+
else
|
44
|
+
:scss
|
45
|
+
end
|
42
46
|
end
|
43
47
|
end
|
44
48
|
end
|
@@ -1,12 +1,12 @@
|
|
1
1
|
require 'hanami/assets/compressors/stylesheet'
|
2
|
-
require '
|
2
|
+
require 'sassc'
|
3
3
|
|
4
4
|
module Hanami
|
5
5
|
module Assets
|
6
6
|
module Compressors
|
7
7
|
# Sass compressor for stylesheet
|
8
8
|
#
|
9
|
-
# It depends on <tt>
|
9
|
+
# It depends on <tt>sassc</tt> gem.
|
10
10
|
#
|
11
11
|
# @since 0.1.0
|
12
12
|
# @api private
|
@@ -16,21 +16,19 @@ module Hanami
|
|
16
16
|
class SassStylesheet < Stylesheet
|
17
17
|
# @since 0.1.0
|
18
18
|
# @api private
|
19
|
-
#
|
20
|
-
# FIXME This is the same logic that we have for Hanami::Assets::Compiler
|
21
|
-
SASS_CACHE_LOCATION = Pathname(Hanami.respond_to?(:root) ? # rubocop:disable Style/MultilineTernaryOperator
|
22
|
-
Hanami.root : Dir.pwd).join('tmp', 'sass-cache')
|
23
|
-
# @since 0.1.0
|
24
|
-
# @api private
|
25
19
|
def initialize
|
26
|
-
@compressor =
|
20
|
+
@compressor = SassC::Engine
|
27
21
|
end
|
28
22
|
|
29
23
|
# @since 0.1.0
|
30
24
|
# @api private
|
31
25
|
def compress(filename)
|
32
|
-
compressor.new(
|
33
|
-
|
26
|
+
compressor.new(
|
27
|
+
read(filename),
|
28
|
+
filename: filename,
|
29
|
+
syntax: :scss,
|
30
|
+
style: :compressed
|
31
|
+
).render
|
34
32
|
end
|
35
33
|
end
|
36
34
|
end
|
@@ -233,7 +233,7 @@ module Hanami
|
|
233
233
|
#
|
234
234
|
# * <tt>:builtin</tt> - Ruby based compressor. It doesn't require any external gem. It's fast, but not an efficient compressor.
|
235
235
|
# * <tt>:yui</tt> - YUI-Compressor, it depends on <tt>yui-compressor</tt> gem and requires Java 1.4+
|
236
|
-
# * <tt>:sass</tt> - Sass, it depends on <tt>
|
236
|
+
# * <tt>:sass</tt> - Sass, it depends on <tt>sassc</tt> gem
|
237
237
|
#
|
238
238
|
# @param value [Symbol,#compress] the compressor
|
239
239
|
#
|
@@ -243,7 +243,7 @@ module Hanami
|
|
243
243
|
# @see https://rubygems.org/gems/yui-compressor
|
244
244
|
#
|
245
245
|
# @see http://sass-lang.com
|
246
|
-
# @see https://rubygems.org/gems/
|
246
|
+
# @see https://rubygems.org/gems/sassc
|
247
247
|
#
|
248
248
|
# @example YUI Compressor
|
249
249
|
# require 'hanami/assets'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hanami-assets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luca Guidi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-08-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hanami-utils
|
@@ -149,19 +149,19 @@ dependencies:
|
|
149
149
|
- !ruby/object:Gem::Version
|
150
150
|
version: '1.1'
|
151
151
|
- !ruby/object:Gem::Dependency
|
152
|
-
name:
|
152
|
+
name: sassc
|
153
153
|
requirement: !ruby/object:Gem::Requirement
|
154
154
|
requirements:
|
155
155
|
- - "~>"
|
156
156
|
- !ruby/object:Gem::Version
|
157
|
-
version: '
|
157
|
+
version: '2.0'
|
158
158
|
type: :development
|
159
159
|
prerelease: false
|
160
160
|
version_requirements: !ruby/object:Gem::Requirement
|
161
161
|
requirements:
|
162
162
|
- - "~>"
|
163
163
|
- !ruby/object:Gem::Version
|
164
|
-
version: '
|
164
|
+
version: '2.0'
|
165
165
|
- !ruby/object:Gem::Dependency
|
166
166
|
name: coffee-script
|
167
167
|
requirement: !ruby/object:Gem::Requirement
|
@@ -250,7 +250,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
250
250
|
- !ruby/object:Gem::Version
|
251
251
|
version: '0'
|
252
252
|
requirements: []
|
253
|
-
rubygems_version: 3.0.
|
253
|
+
rubygems_version: 3.0.3
|
254
254
|
signing_key:
|
255
255
|
specification_version: 4
|
256
256
|
summary: Assets management
|