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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 759d4d0f396c2d4f816f504180a23aeef9b481e6
4
- data.tar.gz: 9d75777d712d2ba566694cf6cc454a3c2bd9d9ff
3
+ metadata.gz: b4f127738efe385eb906a01b8cdfd9b8f0060d4f
4
+ data.tar.gz: f7159cae4808cfcb3a50912de98f3047873a2d16
5
5
  SHA512:
6
- metadata.gz: 9645c419f3c60baf90263f42486fc511effbd3264af9af3210f64852f5806ff7d2bd38f6bcf3660fa64113067f05570ebfa2e5026203075609f061491f04ca7d
7
- data.tar.gz: 1da7f20aa2468976626c01730b0325442bfedefaac0bbbaedca326f801a9d5ccb13a0b97e727d1d94d92ab67d382c1826c93b00ef6c3fd9b75b1e2222409318f
6
+ metadata.gz: bab9a07ee1ca4e42e234851ac2ecb847b6a1be4abd55b82d92a5fe0b90b6c9762398b190720f809f032a338af4cafde7b09b9efd01c5955f85353c191e0af40e
7
+ data.tar.gz: 13f05bceedfb7770e7f5c89a9cbdf56243d8f55a5fab80d4bc0e1b842e211874a5a89ce8dc655d15a280023472f85a892cd87018004d369a30e394934acd0491
@@ -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(&:formats)
80
+ nodes.map{ |node| node.formats }
77
81
  when :same
78
- nodes.map{ |n| n.formats.ext(ext) }.flatten.compact
82
+ nodes.map{ |n| n.formats.ext(ext) }.flatten
79
83
  when String
80
- nodes.map{ |n| n.formats.ext(type) }.flatten.compact
84
+ nodes.map{ |n| n.formats.ext(type) }.flatten
81
85
  when MIME::Type
82
- nodes.map{ |n| n.formats.mime_type(type) }.flatten.compact
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
@@ -1,3 +1,3 @@
1
1
  module Sitepress
2
- VERSION = "0.1.18"
2
+ VERSION = "0.1.19"
3
3
  end
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.18
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-19 00:00:00.000000000 Z
11
+ date: 2016-09-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler