yarrow 0.2.0 → 0.2.1
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 +30 -8
- data/lib/yarrow/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZDcyYTlkMDhjYTY3YjYzMGE3MzgwODM1MGNhY2Y2ZWFjNTdlY2Y4MQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NjQ5MzE1N2RhMTkwNmU1YTQwMDhiOWVhM2FhZjNiYmRkZGQ0MDY5OA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MmZhNDRjMWMyOTlhZmNiZDFhZGM5NzBlMGJjYmQ5NWNmN2QzZTk5NjA5NzM1
|
10
|
+
OTY4NDU3NjBkNGY3M2RlNTdjNmU3MzIyZjQ1YjU5MDkxZjIzMTYzZGFiZDU5
|
11
|
+
ZTJlZGMyNjkxYjJjYWJhYjQ5NWE0Zjg3MDI4YTYwMGM1M2U5MjA=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YmVlZTdjNzRiZWQ5NjlmNzc2MmViNGMwYTY1MTM4MDViZDNkYTU3ZWI4NjMx
|
14
|
+
ZDE3Yjk5MzcxNDEyYzM5N2JjYjI2MTAyNGRlNDJiNjBjYmFjMDRiZjMyZjZi
|
15
|
+
ZTM1NGQzMDBjOWYyNTBkYzU0ZmExOWUxYTI2ZDgwOWUwOWI5M2Q=
|
@@ -9,11 +9,24 @@ module Yarrow
|
|
9
9
|
attr_reader :input_dir, :output_dir, :bundles, :assets
|
10
10
|
|
11
11
|
# TODO: handle configuration
|
12
|
-
def initialize(options
|
13
|
-
|
14
|
-
|
12
|
+
def initialize(options)
|
13
|
+
raise "Missing asset configuration" unless options[:assets]
|
14
|
+
|
15
|
+
@input_dir = options[:assets][:input_dir] || default_input_dir
|
16
|
+
@output_dir = options[:assets][:input_dir] || default_output_dir
|
15
17
|
|
16
|
-
|
18
|
+
case options[:assets][:append_paths]
|
19
|
+
when Array
|
20
|
+
@append_paths = options[:assets][:append_paths]
|
21
|
+
when "*"
|
22
|
+
@append_paths = Dir[@input_dir + "/*"].select do |path|
|
23
|
+
File.directory?(path)
|
24
|
+
end.map do |path|
|
25
|
+
File.basename(path)
|
26
|
+
end
|
27
|
+
else
|
28
|
+
@append_paths = []
|
29
|
+
end
|
17
30
|
end
|
18
31
|
|
19
32
|
def compile(assets=[])
|
@@ -29,17 +42,26 @@ module Yarrow
|
|
29
42
|
|
30
43
|
private
|
31
44
|
|
45
|
+
def default_input_dir
|
46
|
+
Dir.pwd + "/assets"
|
47
|
+
end
|
48
|
+
|
49
|
+
def default_output_dir
|
50
|
+
@output_dir = Dir.pwd + "/web/ui"
|
51
|
+
end
|
52
|
+
|
32
53
|
def manifest_file_path
|
33
54
|
"#{@output_dir}/manifest.json"
|
34
55
|
end
|
35
56
|
|
36
57
|
def create_environment
|
37
58
|
environment = Sprockets::Environment.new(@input_dir)
|
38
|
-
|
39
|
-
|
59
|
+
|
60
|
+
@append_paths.each do |path|
|
61
|
+
environment.append_path path
|
62
|
+
end
|
40
63
|
|
41
|
-
# configure
|
42
|
-
environment.append_path 'css'
|
64
|
+
# configure css compressor
|
43
65
|
environment.css_compressor = :scss
|
44
66
|
|
45
67
|
environment
|
data/lib/yarrow/version.rb
CHANGED