nanoc-core 4.11.5 → 4.11.6
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 +4 -4
- data/lib/nanoc/core/identifiable_collection.rb +8 -11
- data/lib/nanoc/core/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ed0faecd6f31e687fe951cdaf02582b3694975ec412aefbee976ca85d0a9aa36
|
4
|
+
data.tar.gz: 5d14bed7d4f0464aae7ad13fc0965e6ffcfa2d209e1d5012556f854e55c2aac9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
-
|
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
|
-
|
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 =
|
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 =
|
122
|
-
|
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
|
-
|
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
|
data/lib/nanoc/core/version.rb
CHANGED
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.
|
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-
|
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.
|
186
|
+
rubygems_version: 3.0.4
|
187
187
|
signing_key:
|
188
188
|
specification_version: 4
|
189
189
|
summary: Core of Nanoc
|