artk 0.3.0 → 0.3.1

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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZDE3MGM0Mjc4NzFkOTc1NTk5ZTNhZWRmODkzN2ExNWEzZTMxMGY5OQ==
4
+ MWFjNGMyOWUwMWE1ZmNmOTJkMDY0ZTE5ZGNjYmJjNjAwZTU2Y2U4OQ==
5
5
  data.tar.gz: !binary |-
6
- NGMyZWRmMDk0OTY1YzMwY2M2YjU3ZTkzYmE1NTIwYmM3MmQ2ZGM0Mg==
6
+ OGU0YTQxMWQ1ZDUzYjQ3NzU4MmY4OGM3YmVlYjVkZTMzNDdlNjBiMw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MzQ4YTBiYjlmMjcxYmQ5MDZhYjFjNGNkYjY2NGI1MzE2YzJkNzJkNjY3ODUz
10
- ZjgxNjkzNGE2ZDEyZTZkNGIyOGMwOTM2NTNlZjdkYzE2Y2ZjZDZjNzdlMjQy
11
- N2NkMzQ2MmRkMzQzMWY3NmVlOGIwMzdjOWNjN2NiZGM0Njc1ODk=
9
+ MjljNDFhMmJjMjczYWViN2M1ZDQ3MDAxMDUxYTkyY2QwN2FmODUwOTllOWNi
10
+ ZDhjNzMyMWRiNTkxY2Q5NTVlZjk4MGYyYzRlOGEzMDM0MTkyYWI3MjliZjEz
11
+ MjFiZGNjMjM1NDY2N2RlYjM2NmIzZTVkY2Y5NDdiMGU3N2YxODg=
12
12
  data.tar.gz: !binary |-
13
- NDA1YWMwYWZlNGE4ZWJmZmY4ZWM1NmExNjIyOTA1OTc2MmY3ODRiYTIwZTNi
14
- NWExZmM1YzkzNTE3YjM4YzA5ZmExYzhjMWQzZjVjZDQ0ODMyYTY5MTIyZmQ5
15
- Njg5MWU1MDc2YmUwZmRmNTk0MWI4OWU0YzliZjMwZTI2Y2IyZGI=
13
+ ZTgwMTNkMzE3OTBkMTU1NGM1Nzg2NDBhZjgyOGExMWRhOTBmYjkxYWE0ZjZl
14
+ NjlkZWM5ZGY3MThkODA2NGE5MWYxNThlMzQ5YWJiZDg4ZjkzZTFiZjhhNjIx
15
+ ZDY4MGFmNWQ4ZTM3YjhkODM4NDQ0ODdmNDY0NTlkYjJhOGJlYjI=
@@ -20,10 +20,10 @@ class Resource < Artk::Base
20
20
  self.where("eadFaUniqueIdentifier = '#{id}'").first
21
21
  end
22
22
 
23
- # Returns all Artk::Component objects that have children components attached to them
24
- # and are not just the first level of <c> nodes in the finding aid
23
+ # Returns all Artk::Component objects or <c> nodes that are in the collection.
24
+ # We have to build the component levels one by one, limited to 6 levels.
25
25
  def all_series
26
- first = retrieve_initial_series
26
+ first = self.components
27
27
  second = []
28
28
  third = []
29
29
  fourth = []
@@ -31,11 +31,11 @@ class Resource < Artk::Base
31
31
  sixth = []
32
32
 
33
33
  # Get additional series, second through sixth
34
- second = first.collect { |r| retrieve_additional_series(r) }.flatten unless first.empty?
35
- third = second.collect { |r| retrieve_additional_series(r) }.flatten unless second.empty?
36
- fourth = third.collect { |r| retrieve_additional_series(r) }.flatten unless third.empty?
37
- fifth = fourth.collect { |r| retrieve_additional_series(r) }.flatten unless fourth.empty?
38
- sixth = fifth.collect { |r| retrieve_additional_series(r) }.flatten unless fifth.empty?
34
+ second = first.collect { |r| r.sub_components }.flatten unless first.empty?
35
+ third = second.collect { |r| r.sub_components }.flatten unless second.empty?
36
+ fourth = third.collect { |r| r.sub_components }.flatten unless third.empty?
37
+ fifth = fourth.collect { |r| r.sub_components }.flatten unless fourth.empty?
38
+ sixth = fifth.collect { |r| r.sub_components }.flatten unless fifth.empty?
39
39
 
40
40
  return (first + second + third + fourth + fifth + sixth).sort
41
41
  end
@@ -51,10 +51,12 @@ class Resource < Artk::Base
51
51
 
52
52
  private
53
53
 
54
+ # not used because we're returning all components and not just those that have sub-components
54
55
  def retrieve_initial_series
55
56
  self.components.keep_if{ |c| c.has_child? }
56
57
  end
57
58
 
59
+ # not used because we're returning all components and not just those that have sub-components
58
60
  def retrieve_additional_series component
59
61
  component.sub_components.keep_if{ |c| c.has_child? }
60
62
  end
@@ -1,3 +1,3 @@
1
1
  module Artk
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: artk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Wead
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-29 00:00:00.000000000 Z
11
+ date: 2013-12-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -131,7 +131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
131
131
  version: '0'
132
132
  requirements: []
133
133
  rubyforge_project:
134
- rubygems_version: 2.1.8
134
+ rubygems_version: 2.1.11
135
135
  signing_key:
136
136
  specification_version: 4
137
137
  summary: Provides a Rails interface to Archivist's Toolkit