pairtree 0.1.0 → 0.3.0
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 +7 -0
- data/.github/workflows/tests.yml +22 -0
- data/.gitignore +3 -0
- data/Gemfile +8 -2
- data/README.md +56 -0
- data/Rakefile +32 -22
- data/lib/pairtree/identifier.rb +23 -6
- data/lib/pairtree/obj.rb +20 -21
- data/lib/pairtree/path.rb +14 -16
- data/lib/pairtree/root.rb +13 -14
- data/lib/pairtree.rb +33 -28
- data/lib/tasks/rdoc.rake +13 -14
- data/pairtree.gemspec +13 -20
- data/spec/pairtree/pairtree_encoding_spec.rb +26 -22
- data/spec/pairtree/pairtree_obj_spec.rb +28 -30
- data/spec/pairtree/pairtree_path_spec.rb +13 -15
- data/spec/pairtree/pairtree_root_spec.rb +32 -34
- data/spec/pairtree/pairtree_spec.rb +24 -28
- data/spec/spec_helper.rb +17 -5
- metadata +47 -47
- data/README.textile +0 -37
data/README.textile
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
h1. pairtree
|
2
|
-
|
3
|
-
Ruby implementation of the "Pairtree":https://confluence.ucop.edu/display/Curation/PairTree microservice specification from the California Digital Library
|
4
|
-
|
5
|
-
h2. Usage
|
6
|
-
|
7
|
-
<pre><code>
|
8
|
-
# Initiate a tree
|
9
|
-
pairtree = Pairtree.at('./data', :prefix => 'pfx:', :create => true)
|
10
|
-
|
11
|
-
# Create a ppath
|
12
|
-
obj = pairtree.mk('pfx:abc123def')
|
13
|
-
|
14
|
-
# Access an existing ppath
|
15
|
-
obj = pairtree['pfx:abc123def']
|
16
|
-
obj = pairtree.get('pfx:abc123def')
|
17
|
-
|
18
|
-
# ppaths are Dir instances with some File and Dir class methods mixed in
|
19
|
-
obj.read('content.xml')
|
20
|
-
=> "<content/>"
|
21
|
-
obj.open('my_file.txt','w') { |io| io.write("Write text to file") }
|
22
|
-
obj.entries
|
23
|
-
=> ["content.xml","my_file.txt"]
|
24
|
-
obj['*.xml']
|
25
|
-
=> ["content.xml"]
|
26
|
-
obj.each { |file| ... }
|
27
|
-
obj.unlink('my_file.txt')
|
28
|
-
|
29
|
-
# Delete a ppath and all its contents
|
30
|
-
pairtree.purge!('pfx:abc123def')
|
31
|
-
</code></pre>
|
32
|
-
|
33
|
-
h2. Copyright
|
34
|
-
|
35
|
-
Copyright (c) 2010 Chris Beer. See LICENSE.txt for
|
36
|
-
further details.
|
37
|
-
|