rubyfocus 0.5.4 → 0.5.5
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/rubyfocus/fetchers/fetcher.rb +3 -3
- data/lib/rubyfocus/includes/searchable.rb +1 -0
- data/lib/rubyfocus/items/ranked_item.rb +5 -2
- data/version.txt +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: de422e59acb9621c98a7d22857f724261d3265c5
|
4
|
+
data.tar.gz: 9a47d0e985e3fc60b40811021d888bafc3e00b72
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec929d7e0f54bb5c5ddae2be7166ea4ffde03cfd452f0ef0390868cc1db40fcf4bbb7b0fe81b26e2f545eaa713bdef40ea6807e989a1d0f1cd4e0f4e4f11abcd
|
7
|
+
data.tar.gz: 4f39da21389954a53a31262fa5cc93df43950e0b51f210e58c6c849a47abc3ce0f2ed85b721d253bf51577c23ea26445568e40ff847bcd0df292b34d0060a009
|
@@ -38,9 +38,9 @@ class Rubyfocus::Fetcher
|
|
38
38
|
raise RuntimeError, "Method Fetcher#patch called for abstract class Fetcher."
|
39
39
|
end
|
40
40
|
|
41
|
-
# Returns the latest patch
|
41
|
+
# Returns the ID of head - the latest patch committed to the database.
|
42
42
|
def head
|
43
|
-
@head ||= patches.sort.last
|
43
|
+
@head ||= (patches.empty? ? base_id : patches.sort.last.to_id)
|
44
44
|
end
|
45
45
|
|
46
46
|
# Can you reach head from the given ID?
|
@@ -48,7 +48,7 @@ class Rubyfocus::Fetcher
|
|
48
48
|
patch_array = patches.select{ |p| p.from_ids.include?(id) }
|
49
49
|
until patch_array.empty?
|
50
50
|
p = patch_array.first
|
51
|
-
return true if p == self.head
|
51
|
+
return true if p.to_id == self.head
|
52
52
|
|
53
53
|
next_patches = patches.select{ |np| np.from_ids.include? p.to_id }
|
54
54
|
patch_array = patch_array[1..-1] + next_patches
|
@@ -16,8 +16,11 @@ class Rubyfocus::RankedItem < Rubyfocus::NamedItem
|
|
16
16
|
# Is this item contained within another? You may supply an object, string or integer ID, hash of properties,
|
17
17
|
# or proc to run on each item.
|
18
18
|
def contained_within?(object)
|
19
|
-
|
20
|
-
|
19
|
+
if [String, Fixnum, Hash, Proc].include?(object.class)
|
20
|
+
document.find_all(object).any?{ |o| ancestry.include?(o) }
|
21
|
+
else
|
22
|
+
ancestry.include?(object)
|
23
|
+
end
|
21
24
|
end
|
22
25
|
|
23
26
|
def apply_xml(n)
|
data/version.txt
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.5
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubyfocus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan-Yves Ruzicka
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-05-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|