yarrow 0.2.7 → 0.2.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/yarrow/assets/manifest.rb +22 -0
- data/lib/yarrow/html/asset_tags.rb +14 -15
- data/lib/yarrow/version.rb +1 -1
- data/lib/yarrow.rb +18 -16
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NzRkODFhYjRmMDAyMTQ1OWJiOTdiYmJiNTZkMmJkOWM1NWEyODFmZQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MmZhNjI3NGRlMGI2ZGY5YTQ3ZmVhMTMyOWQ1YzZmNTg2NzEyYTQ5Yg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YTI2ZGMwNmMzOTg3N2Q0YTAxNmEyYzI3YWU4ZDE5YTAwMjM5YjJjYmQxZDMy
|
10
|
+
NzI2YjRhNjA4YTVkYTU1ZDkyMTU1M2YwNzJmMGZhZDYyOTc0ODg4YjliOWEy
|
11
|
+
MTNkYTYyZDE4YWI0MmU0NjdiNmU4Y2MwZGQ3MWE3ZmZjMGUzNWM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZjgyYjU1NWM4OWQ0YTdjYjUwYWY4ODFkYzA4MWJlMzMzMDM4YmJmMTUwMjYx
|
14
|
+
YmEyZjA0YjhhNjE4NDVmOGU3ZjE3YTBjOTM4MGYwZGViYmI0YzA2ZWI2ZDhm
|
15
|
+
MzYxMzg5MGVkMDUwNzkyNjYwMGU0ODdhY2ZmNDg5NTE0ZmZkYjI=
|
@@ -50,6 +50,28 @@ module Yarrow
|
|
50
50
|
@manifest_index['files'].values
|
51
51
|
end
|
52
52
|
|
53
|
+
def css_logical_paths
|
54
|
+
select_by_extension(logical_paths, '.css')
|
55
|
+
end
|
56
|
+
|
57
|
+
def js_logical_paths
|
58
|
+
select_by_extension(logical_paths, '.js')
|
59
|
+
end
|
60
|
+
|
61
|
+
def css_digest_paths
|
62
|
+
select_by_extension(digest_paths, '.css')
|
63
|
+
end
|
64
|
+
|
65
|
+
def js_digest_paths
|
66
|
+
select_by_extension(digest_paths, '.js')
|
67
|
+
end
|
68
|
+
|
69
|
+
private
|
70
|
+
|
71
|
+
def select_by_extension(collection, ext)
|
72
|
+
collection.select { |asset| asset.end_with?(ext) }
|
73
|
+
end
|
74
|
+
|
53
75
|
end
|
54
76
|
end
|
55
77
|
end
|
@@ -1,27 +1,23 @@
|
|
1
1
|
module Yarrow
|
2
2
|
module HTML
|
3
|
-
module AssetTags
|
4
|
-
|
5
|
-
def config
|
6
|
-
Yarrow::Configuration.instance
|
7
|
-
end
|
3
|
+
module AssetTags
|
4
|
+
include Yarrow::Configurable
|
8
5
|
|
9
6
|
# TODO: make sprockets manifest optional/pluggable
|
10
7
|
def manifest
|
11
8
|
Yarrow::Assets::Manifest.new(config || {})
|
12
9
|
end
|
13
10
|
|
14
|
-
def
|
15
|
-
|
16
|
-
manifest.digest_paths.each do |asset|
|
17
|
-
out << script_tag(:asset => asset)
|
18
|
-
end
|
19
|
-
out.join["\n"]
|
11
|
+
def script_tags
|
12
|
+
manifest.js_logical_paths.map { |asset_path| script_tag(asset: asset_path) }.join("\n")
|
20
13
|
end
|
21
14
|
|
15
|
+
# TODO: support asset path option?
|
22
16
|
def script_tag(options)
|
23
|
-
if options.has_key? :asset and manifest.exists?
|
24
|
-
|
17
|
+
if options.has_key? :asset and manifest.exists? options[:asset]
|
18
|
+
script_path = manifest.digest_path(options[:asset])
|
19
|
+
assets_path = config.assets_path || ''
|
20
|
+
src_path = [assets_path, script_path].join('/')
|
25
21
|
else
|
26
22
|
src_path = options[:src]
|
27
23
|
end
|
@@ -29,9 +25,12 @@ module Yarrow
|
|
29
25
|
"<script src=\"#{src_path}\"></script>"
|
30
26
|
end
|
31
27
|
|
28
|
+
# TODO: support asset path option?
|
32
29
|
def link_tag(options)
|
33
|
-
if options.has_key? :asset and manifest.exists?
|
34
|
-
|
30
|
+
if options.has_key? :asset and manifest.exists? options[:asset]
|
31
|
+
stylesheet_path = manifest.digest_path(options[:asset])
|
32
|
+
assets_path = config.assets_path || ''
|
33
|
+
href_path = [assets_path, stylesheet_path].join('/')
|
35
34
|
else
|
36
35
|
href_path = options[:href]
|
37
36
|
end
|
data/lib/yarrow/version.rb
CHANGED
data/lib/yarrow.rb
CHANGED
@@ -1,20 +1,22 @@
|
|
1
|
-
require
|
2
|
-
require
|
1
|
+
require 'hashie'
|
2
|
+
require 'yaml'
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
4
|
+
require 'yarrow/version'
|
5
|
+
require 'yarrow/logging'
|
6
|
+
require 'yarrow/configuration'
|
7
|
+
require 'yarrow/console_runner'
|
8
|
+
require 'yarrow/generator'
|
9
|
+
require 'yarrow/model/index'
|
10
|
+
require 'yarrow/model/base'
|
11
|
+
require 'yarrow/html/asset_tags'
|
12
|
+
require 'yarrow/output/mapper'
|
13
|
+
require 'yarrow/output/generator'
|
14
|
+
require 'yarrow/output/context'
|
15
|
+
require 'yarrow/content_map'
|
16
|
+
require 'yarrow/assets'
|
17
|
+
require 'yarrow/html'
|
18
|
+
require 'yarrow/tools/front_matter'
|
17
19
|
|
18
|
-
# Dir[File.dirname(__FILE__) +
|
20
|
+
# Dir[File.dirname(__FILE__) + '/yarrow/generators/*.rb'].each do |generator|
|
19
21
|
# require generator
|
20
22
|
# end
|
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.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Rickerby
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hashie
|