yarrow 0.2.3 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/lib/yarrow/assets/pipeline.rb +29 -13
- data/lib/yarrow/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
OWVjNGNlZTBhY2MyNzA4YjI0OTVjZjVkYzQwOTZjODNjMmEyNTI1Yg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MDdiZTJhM2MxY2E2MDQxMTQ5OTZkMzRjODkwOWQ1NGI2ZGIwNjU5MQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
OGJjNTc4NjAwMzZhNmMzNTRkM2MzYTU2NmFlNGU4YTBiOThjN2FmMjYwYTgy
|
10
|
+
YjZiNmVjODdlMjFmY2E3MDM1MGI4MWJmYWQ4YmQ4MTkyZDhkMTE2YjZiNDEz
|
11
|
+
MmVlOTU0YjQxMTI3MThmYWNmZTQxODFkOTdjNjgzODM3NmEwZjk=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
OTFjNDJiNjQzZWNkNmY1NTk4MjE0NjE0NDdiYjdmYjNhODBlYzhmZmMyNDAy
|
14
|
+
MzA4YWM1YTg5OTg2ZDk4OTljZGVjMTZlYzE2OWI3MzgzOTZmMzk4NTdhYjUy
|
15
|
+
ZjhkN2QxNTZhODA0M2EzODhhNzJiYjYzYjMwOGU2NTJlYjE4NTc=
|
@@ -11,32 +11,51 @@ module Yarrow
|
|
11
11
|
|
12
12
|
# @param options [Hash, Hashie::Mash, Yarrow::Configuration]
|
13
13
|
def initialize(options)
|
14
|
-
raise 'Missing asset configuration' unless options[:assets]
|
15
14
|
|
16
|
-
@input_dir = options[:
|
17
|
-
@output_dir = options[:
|
15
|
+
@input_dir = options[:input_dir] || default_input_dir
|
16
|
+
@output_dir = options[:output_dir] || default_output_dir
|
18
17
|
|
19
|
-
|
18
|
+
@append_paths = []
|
19
|
+
|
20
|
+
case options[:append_paths]
|
20
21
|
when Array
|
21
|
-
@append_paths = options[:
|
22
|
+
@append_paths = options[:append_paths]
|
22
23
|
when '*'
|
23
24
|
@append_paths = Dir[@input_dir + '/*'].select do |path|
|
24
25
|
File.directory?(path)
|
25
26
|
end.map do |path|
|
26
27
|
File.basename(path)
|
27
28
|
end
|
28
|
-
|
29
|
-
@append_paths
|
29
|
+
when String
|
30
|
+
@append_paths << options[:append_paths]
|
30
31
|
end
|
31
32
|
end
|
32
33
|
|
33
|
-
|
34
|
+
# Compiles an asset manifest and processed output files from the given input bundles.
|
35
|
+
# Also generates a manifest linking each output bundle to its given input name.
|
36
|
+
# @param bundles [Array<String>]
|
37
|
+
def compile(bundles = [])
|
34
38
|
manifest = Sprockets::Manifest.new(environment, manifest_file_path)
|
35
|
-
|
36
|
-
|
39
|
+
bundles.each do |bundle|
|
40
|
+
if bundle.include? '*'
|
41
|
+
Dir["#{@input_dir}/#{bundle}"].each do |asset|
|
42
|
+
manifest.compile(File.basename(asset))
|
43
|
+
end
|
44
|
+
else
|
45
|
+
manifest.compile(bundle)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
# Copy the given files to the output path without processing or renaming.
|
51
|
+
# @param bundle [Array<String>]
|
52
|
+
def copy(bundles = [])
|
53
|
+
bundles.each do |bundle|
|
54
|
+
FileUtils.cp_r "#{@input_dir}/#{bundle}", "#{@output_dir}/#{bundle}"
|
37
55
|
end
|
38
56
|
end
|
39
57
|
|
58
|
+
# Access instance of the Sprockets environment.
|
40
59
|
def environment
|
41
60
|
@environment ||= create_environment
|
42
61
|
end
|
@@ -62,9 +81,6 @@ module Yarrow
|
|
62
81
|
environment.append_path path
|
63
82
|
end
|
64
83
|
|
65
|
-
# configure css compressor
|
66
|
-
environment.css_compressor = :scss
|
67
|
-
|
68
84
|
environment
|
69
85
|
end
|
70
86
|
|
data/lib/yarrow/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yarrow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Rickerby
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hashie
|