nanoc-core 4.11.5 → 4.11.6

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
  SHA256:
3
- metadata.gz: 92b6e637e84298375cd003e335ee6bf5226551e27cbe5113ab5d78696f57f68c
4
- data.tar.gz: 70ebd03b63bbbb75f3f40c3147c8db7d1805bbaa4242f96cc25e38184873494f
3
+ metadata.gz: ed0faecd6f31e687fe951cdaf02582b3694975ec412aefbee976ca85d0a9aa36
4
+ data.tar.gz: 5d14bed7d4f0464aae7ad13fc0965e6ffcfa2d209e1d5012556f854e55c2aac9
5
5
  SHA512:
6
- metadata.gz: 7c7c2f35bbd945c28e6d0a42e5f69a10545c892728230bd51d501ece35ba2b9016bd1ed4fbb401f9003703231f04064060c04933aae058cdf2c4c39a53779a46
7
- data.tar.gz: 07d70bd63c2d69ee64a214df9b7b8ecd57220232d53dfb89ad4c9e9ae34544cd373d66fce8f6ff7f27c31d6d59de2c99f5a228fb7ed9e5c651f30e4662ef0658
6
+ metadata.gz: f3d23ca85593f31887681b11cfe3ca391bb23da998d536033b99f9e49cbcd2bdb01a2a400400009f470c08e567d400a7dbbb9ea0549f4910c9377b3164af916b
7
+ data.tar.gz: ea81efc75e11a35b0cc7dc0434dce9edb75dc5b6a69fb7d8af451b184997d83849b92e6be2a80b653c93abc705f911e4a7d38ad0f78f952b0882a3928a2e86f2
@@ -13,7 +13,7 @@ module Nanoc
13
13
  def_delegator :@objects, :each
14
14
  def_delegator :@objects, :size
15
15
 
16
- def initialize(*)
16
+ def initialize
17
17
  raise 'IdentifiableCollection is abstract and cannot be instantiated'
18
18
  end
19
19
 
@@ -32,7 +32,7 @@ module Nanoc
32
32
  contract C::None => self
33
33
  def freeze
34
34
  @objects.freeze
35
- @objects.each(&:freeze)
35
+ each(&:freeze)
36
36
  build_mapping
37
37
  super
38
38
  end
@@ -80,7 +80,7 @@ module Nanoc
80
80
  if frozen?
81
81
  @mapping[identifier.to_s]
82
82
  else
83
- @objects.find { |i| i.identifier == identifier }
83
+ find { |i| i.identifier == identifier }
84
84
  end
85
85
  end
86
86
 
@@ -94,7 +94,7 @@ module Nanoc
94
94
  when String
95
95
  object_with_identifier(arg) || object_matching_glob(arg)
96
96
  when Regexp
97
- @objects.find { |i| i.identifier.to_s =~ arg }
97
+ find { |i| i.identifier.to_s =~ arg }
98
98
  else
99
99
  raise ArgumentError, "don’t know how to fetch objects by #{arg.inspect}"
100
100
  end
@@ -107,7 +107,7 @@ module Nanoc
107
107
 
108
108
  contract C::Any => C::IterOf[C::RespondTo[:identifier]]
109
109
  def find_all_unmemoized(arg)
110
- pat = Nanoc::Core::Pattern.from(arg)
110
+ pat = Pattern.from(arg)
111
111
  select { |i| pat.match?(i.identifier) }
112
112
  end
113
113
 
@@ -118,19 +118,16 @@ module Nanoc
118
118
 
119
119
  def object_matching_glob(glob)
120
120
  if use_globs?
121
- pat = Nanoc::Core::Pattern.from(glob)
122
- @objects.find { |i| pat.match?(i.identifier) }
123
- else
124
- nil
121
+ pat = Pattern.from(glob)
122
+ find { |i| pat.match?(i.identifier) }
125
123
  end
126
124
  end
127
125
 
128
126
  def build_mapping
129
127
  @mapping = {}
130
- @objects.each do |object|
128
+ each do |object|
131
129
  @mapping[object.identifier.to_s] = object
132
130
  end
133
- @mapping.freeze
134
131
  end
135
132
 
136
133
  contract C::None => C::Bool
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Nanoc
4
4
  module Core
5
- VERSION = '4.11.5'
5
+ VERSION = '4.11.6'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nanoc-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.11.5
4
+ version: 4.11.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Denis Defreyne
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-30 00:00:00.000000000 Z
11
+ date: 2019-07-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ddmemoize
@@ -183,7 +183,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
183
183
  - !ruby/object:Gem::Version
184
184
  version: '0'
185
185
  requirements: []
186
- rubygems_version: 3.0.3
186
+ rubygems_version: 3.0.4
187
187
  signing_key:
188
188
  specification_version: 4
189
189
  summary: Core of Nanoc