rapa 0.4.3 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/rapa/browse_node.rb +18 -0
- data/lib/rapa/resources/item_resource.rb +3 -1
- data/lib/rapa/version.rb +1 -1
- data/rapa.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ba56ed4d0f79d06ce45915f60dc5ed2fd6ac38f3
|
4
|
+
data.tar.gz: 86c164c8995ab818595635f083ceaca0d35dda73
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f21d89d645bc4fd1946c65814c8d244c50f8a1e3e3c17a137e41e86853093b9e99e73f19f0a06ca0bb31eb37c05bf243a0f28658173238e9693b30649d241308
|
7
|
+
data.tar.gz: 529162027e85321d942ad5b792de862cc8c9044446d1cc05c0e23e082d3f81cd20c4549689f3f6ceca84533ec41d20abfd71004be4d755db2982f64648cd3b17
|
data/CHANGELOG.md
CHANGED
data/lib/rapa/browse_node.rb
CHANGED
@@ -8,12 +8,25 @@ module Rapa
|
|
8
8
|
@source = source
|
9
9
|
end
|
10
10
|
|
11
|
+
# @return [Array<Rapa::BrowseNode>]
|
12
|
+
def ancestors
|
13
|
+
array = []
|
14
|
+
current = self
|
15
|
+
while parent = current.parent do
|
16
|
+
array << parent
|
17
|
+
current = parent
|
18
|
+
end
|
19
|
+
array
|
20
|
+
end
|
21
|
+
|
11
22
|
# @return [Array<Rapa::BrowseNode>, nil]
|
12
23
|
def children
|
13
24
|
if child_sources = source.dig("Children", "BrowseNode")
|
14
25
|
child_sources.map do |child_source|
|
15
26
|
::Rapa::BrowseNode.new(child_source)
|
16
27
|
end
|
28
|
+
else
|
29
|
+
[]
|
17
30
|
end
|
18
31
|
end
|
19
32
|
|
@@ -34,6 +47,11 @@ module Rapa
|
|
34
47
|
end
|
35
48
|
end
|
36
49
|
|
50
|
+
# @return [Array<Rapa::BrowseNode>]
|
51
|
+
def self_or_ancestors
|
52
|
+
[self] + ancestors
|
53
|
+
end
|
54
|
+
|
37
55
|
# @return [String]
|
38
56
|
def title
|
39
57
|
source["Title"]
|
@@ -38,7 +38,9 @@ module Rapa
|
|
38
38
|
|
39
39
|
# @return [Array, nil]
|
40
40
|
def browse_nodes
|
41
|
-
source.dig("BrowseNodes", "BrowseNode")
|
41
|
+
source.dig("BrowseNodes", "BrowseNode").map do |browse_node_source|
|
42
|
+
::Rapa::BrowseNode.new(browse_node_source)
|
43
|
+
end
|
42
44
|
end
|
43
45
|
|
44
46
|
# @return [String, nil]
|
data/lib/rapa/version.rb
CHANGED
data/rapa.gemspec
CHANGED
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.add_development_dependency "bundler", "~> 1.13"
|
24
24
|
spec.add_development_dependency "petitest", "~> 0.3.1"
|
25
25
|
spec.add_development_dependency "petitest-power_assert"
|
26
|
-
spec.add_development_dependency "petitest-spec"
|
26
|
+
spec.add_development_dependency "petitest-spec", ">= 0.3.2"
|
27
27
|
spec.add_development_dependency "rake", "~> 10.0"
|
28
28
|
spec.add_development_dependency "timecop"
|
29
29
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rapa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryo Nakamura
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03-
|
11
|
+
date: 2017-03-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -100,14 +100,14 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
103
|
+
version: 0.3.2
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version:
|
110
|
+
version: 0.3.2
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: rake
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|