asset 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/asset.gemspec +2 -3
- data/lib/asset.rb +4 -2
- data/lib/assets/item.rb +4 -5
- metadata +2 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f17565f109c0b351777b0d7cfa88144524534ed
|
4
|
+
data.tar.gz: be03e366951fb2b26382bc2b07b4ed64f1973779
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 284bbb2daa6970e6b1f90a812b19120a7d77d857f5b338bfdc69610c868da2ce684933e2f19258ec1b8fdb4c6e38e89ecfa5fd9a744ede4f7a7dab22e31b3088
|
7
|
+
data.tar.gz: f86dbc037a1e5f703a674ad1f7b604b5ae3fa26660c9aaa62372a440c79f049b343c64a9555d36cd40ff6b36b20c844272413b2a86030db9176cdb7e8c2a4327
|
data/CHANGELOG.md
CHANGED
data/asset.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'asset'
|
3
|
-
s.version = '0.1.
|
4
|
-
s.date = '2017-01-
|
3
|
+
s.version = '0.1.8'
|
4
|
+
s.date = '2017-01-19'
|
5
5
|
s.summary = "Compress and serve your CSS and JS assets automatically"
|
6
6
|
s.description = "The only thing you need for your assets."
|
7
7
|
s.authors = ["Fugroup Limited"]
|
@@ -14,7 +14,6 @@ Gem::Specification.new do |s|
|
|
14
14
|
|
15
15
|
s.add_development_dependency 'sinatra', '>= 0'
|
16
16
|
s.add_development_dependency 'puma', '>= 0'
|
17
|
-
s.add_development_dependency 'tilt', '>= 0'
|
18
17
|
s.add_development_dependency 'liquid', '>= 0'
|
19
18
|
s.add_development_dependency 'erubis', '>= 0'
|
20
19
|
s.add_development_dependency 'rest-client', '>= 0'
|
data/lib/asset.rb
CHANGED
@@ -1,13 +1,15 @@
|
|
1
1
|
require 'rack'
|
2
2
|
require 'yaml'
|
3
|
-
autoload :Uglifier, 'uglifier'
|
4
|
-
autoload :Tilt, 'tilt'
|
5
3
|
|
6
4
|
# Asset packer, middleware and helpers
|
7
5
|
# @homepage: https://github.com/fugroup/asset
|
8
6
|
# @author: Vidar <vidar@fugroup.net>, Fugroup Ltd.
|
9
7
|
# @license: MIT, contributions are welcome.
|
10
8
|
module Asset
|
9
|
+
|
10
|
+
autoload :Uglifier, 'uglifier'
|
11
|
+
autoload :Sass, 'sass'
|
12
|
+
|
11
13
|
class << self; attr_accessor :mode, :path, :cache, :favicon, :robots, :manifest, :bundle, :images, :debug; end
|
12
14
|
|
13
15
|
# Default is development
|
data/lib/assets/item.rb
CHANGED
@@ -26,15 +26,14 @@ module Asset
|
|
26
26
|
File.join('/assets', @type, (p? ? @kpath : @path))
|
27
27
|
end
|
28
28
|
|
29
|
-
# Get the content. Pass
|
29
|
+
# Get the content. Pass key = false to fetch from disk instead of the cache.
|
30
30
|
def content(key = nil)
|
31
|
-
|
31
|
+
key ? (@cached ||= cached) : (@joined ||= joined)
|
32
32
|
end
|
33
33
|
|
34
34
|
# The cached content
|
35
35
|
def cached
|
36
|
-
File.read(cache_path).tap{|
|
37
|
-
compressed.tap{|r| write_cache(r)}
|
36
|
+
return File.read(cache_path) rescue compressed.tap{|r| write_cache(r)}
|
38
37
|
end
|
39
38
|
|
40
39
|
# Store in cache
|
@@ -56,7 +55,7 @@ module Asset
|
|
56
55
|
def compressed
|
57
56
|
@compressed ||= case @type
|
58
57
|
when 'css'
|
59
|
-
|
58
|
+
Sass::Engine.new(joined, :syntax => :scss, :cache => false, :style => :compressed).render rescue joined
|
60
59
|
when 'js'
|
61
60
|
Uglifier.compile(joined, {}) rescue joined
|
62
61
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: asset
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fugroup Limited
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-01-
|
11
|
+
date: 2017-01-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
@@ -80,20 +80,6 @@ dependencies:
|
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: tilt
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - ">="
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '0'
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - ">="
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '0'
|
97
83
|
- !ruby/object:Gem::Dependency
|
98
84
|
name: liquid
|
99
85
|
requirement: !ruby/object:Gem::Requirement
|