sitepress 0.1.18 → 0.1.19
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sitepress/resource.rb +10 -6
- data/lib/sitepress/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b4f127738efe385eb906a01b8cdfd9b8f0060d4f
|
4
|
+
data.tar.gz: f7159cae4808cfcb3a50912de98f3047873a2d16
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bab9a07ee1ca4e42e234851ac2ecb847b6a1be4abd55b82d92a5fe0b90b6c9762398b190720f809f032a338af4cafde7b09b9efd01c5955f85353c191e0af40e
|
7
|
+
data.tar.gz: 13f05bceedfb7770e7f5c89a9cbdf56243d8f55a5fab80d4bc0e1b842e211874a5a89ce8dc655d15a280023472f85a892cd87018004d369a30e394934acd0491
|
data/lib/sitepress/resource.rb
CHANGED
@@ -40,16 +40,20 @@ module Sitepress
|
|
40
40
|
"<#{self.class}:#{object_id} request_path=#{request_path.inspect} asset_path=#{@asset.path.to_s.inspect}>"
|
41
41
|
end
|
42
42
|
|
43
|
+
def parent(**args)
|
44
|
+
parents(**args).first
|
45
|
+
end
|
46
|
+
|
43
47
|
def parents(**args)
|
44
48
|
filter_resources(**args){ node.parents }
|
45
49
|
end
|
46
50
|
|
47
51
|
def siblings(**args)
|
48
|
-
filter_resources(**args){ node.siblings }
|
52
|
+
filter_resources(**args){ node.siblings }.compact
|
49
53
|
end
|
50
54
|
|
51
55
|
def children(**args)
|
52
|
-
filter_resources(**args){ node.children }
|
56
|
+
filter_resources(**args){ node.children }.compact
|
53
57
|
end
|
54
58
|
|
55
59
|
def ==(resource)
|
@@ -73,13 +77,13 @@ module Sitepress
|
|
73
77
|
|
74
78
|
case type
|
75
79
|
when :all
|
76
|
-
nodes.map
|
80
|
+
nodes.map{ |node| node.formats }
|
77
81
|
when :same
|
78
|
-
nodes.map{ |n| n.formats.ext(ext) }.flatten
|
82
|
+
nodes.map{ |n| n.formats.ext(ext) }.flatten
|
79
83
|
when String
|
80
|
-
nodes.map{ |n| n.formats.ext(type) }.flatten
|
84
|
+
nodes.map{ |n| n.formats.ext(type) }.flatten
|
81
85
|
when MIME::Type
|
82
|
-
nodes.map{ |n| n.formats.mime_type(type) }.flatten
|
86
|
+
nodes.map{ |n| n.formats.mime_type(type) }.flatten
|
83
87
|
else
|
84
88
|
raise ArgumentError, "Invalid type argument #{type}. Must be either :same, :all, an extension string, or a Mime::Type"
|
85
89
|
end
|
data/lib/sitepress/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sitepress
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.19
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brad Gessler
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09-
|
11
|
+
date: 2016-09-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|