partridge 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.circleci/config.yml +23 -0
- data/.gitignore +11 -0
- data/.rspec +3 -0
- data/Gemfile +8 -0
- data/Gemfile.lock +83 -0
- data/LICENSE.txt +21 -0
- data/README.md +42 -0
- data/Rakefile +8 -0
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/lib/partridge.rb +18 -0
- data/lib/partridge/version.rb +5 -0
- data/partridge.gemspec +33 -0
- metadata +91 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: f457a4cbecfea718f8a033fdc9791aba6212c483358e24330f607ec1101afafe
|
4
|
+
data.tar.gz: 123bfc763c3d533a4b774a33a1bd67fb4ee365f914ae817e37fb80159e11e0b6
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: adc9d9e786c7a3573c37072664dcb0850bc0680811aad0d034f5bb042509d7d07f190655d33f3e7bc52acb5a7726f1033c8324ecd1de0250cf6b726cd98e8fb6
|
7
|
+
data.tar.gz: d2f439f222c79a9a7b9695c65aa97761bb0317d5f5174a3cf39421ef3b6dc8ea8e3a4075784033ab7c901208be28f708efd1867ae0ac46af8de5f2c293c88417
|
@@ -0,0 +1,23 @@
|
|
1
|
+
version: 2.1
|
2
|
+
orbs:
|
3
|
+
ruby: circleci/ruby@0.1.2
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
build:
|
7
|
+
docker:
|
8
|
+
- image: circleci/ruby:2.6.3-stretch-node
|
9
|
+
executor: ruby/default
|
10
|
+
steps:
|
11
|
+
- checkout
|
12
|
+
- run:
|
13
|
+
name: Bundler
|
14
|
+
command: |
|
15
|
+
gem install bundler -v 2.1.4 && bundle
|
16
|
+
- run:
|
17
|
+
name: Rubocop
|
18
|
+
command: |
|
19
|
+
bundle exec rubocop --parallel
|
20
|
+
- run:
|
21
|
+
name: rspec
|
22
|
+
command: |
|
23
|
+
bundle exec rspec
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,83 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
partridge (0.1.0)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
activesupport (6.0.3.2)
|
10
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
11
|
+
i18n (>= 0.7, < 2)
|
12
|
+
minitest (~> 5.1)
|
13
|
+
tzinfo (~> 1.1)
|
14
|
+
zeitwerk (~> 2.2, >= 2.2.2)
|
15
|
+
ast (2.4.1)
|
16
|
+
bixby (3.0.1)
|
17
|
+
rubocop (= 0.85.1)
|
18
|
+
rubocop-performance
|
19
|
+
rubocop-rails
|
20
|
+
rubocop-rspec
|
21
|
+
concurrent-ruby (1.1.7)
|
22
|
+
diff-lcs (1.4.4)
|
23
|
+
i18n (1.8.5)
|
24
|
+
concurrent-ruby (~> 1.0)
|
25
|
+
minitest (5.14.2)
|
26
|
+
parallel (1.19.2)
|
27
|
+
parser (2.7.1.4)
|
28
|
+
ast (~> 2.4.1)
|
29
|
+
rack (2.2.3)
|
30
|
+
rainbow (3.0.0)
|
31
|
+
rake (12.3.3)
|
32
|
+
regexp_parser (1.7.1)
|
33
|
+
rexml (3.2.4)
|
34
|
+
rspec (3.9.0)
|
35
|
+
rspec-core (~> 3.9.0)
|
36
|
+
rspec-expectations (~> 3.9.0)
|
37
|
+
rspec-mocks (~> 3.9.0)
|
38
|
+
rspec-core (3.9.2)
|
39
|
+
rspec-support (~> 3.9.3)
|
40
|
+
rspec-expectations (3.9.2)
|
41
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
42
|
+
rspec-support (~> 3.9.0)
|
43
|
+
rspec-mocks (3.9.1)
|
44
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
45
|
+
rspec-support (~> 3.9.0)
|
46
|
+
rspec-support (3.9.3)
|
47
|
+
rubocop (0.85.1)
|
48
|
+
parallel (~> 1.10)
|
49
|
+
parser (>= 2.7.0.1)
|
50
|
+
rainbow (>= 2.2.2, < 4.0)
|
51
|
+
regexp_parser (>= 1.7)
|
52
|
+
rexml
|
53
|
+
rubocop-ast (>= 0.0.3)
|
54
|
+
ruby-progressbar (~> 1.7)
|
55
|
+
unicode-display_width (>= 1.4.0, < 2.0)
|
56
|
+
rubocop-ast (0.3.0)
|
57
|
+
parser (>= 2.7.1.4)
|
58
|
+
rubocop-performance (1.7.1)
|
59
|
+
rubocop (>= 0.82.0)
|
60
|
+
rubocop-rails (2.6.0)
|
61
|
+
activesupport (>= 4.2.0)
|
62
|
+
rack (>= 1.1)
|
63
|
+
rubocop (>= 0.82.0)
|
64
|
+
rubocop-rspec (1.41.0)
|
65
|
+
rubocop (>= 0.68.1)
|
66
|
+
ruby-progressbar (1.10.1)
|
67
|
+
thread_safe (0.3.6)
|
68
|
+
tzinfo (1.2.7)
|
69
|
+
thread_safe (~> 0.1)
|
70
|
+
unicode-display_width (1.7.0)
|
71
|
+
zeitwerk (2.4.0)
|
72
|
+
|
73
|
+
PLATFORMS
|
74
|
+
ruby
|
75
|
+
|
76
|
+
DEPENDENCIES
|
77
|
+
bixby
|
78
|
+
partridge!
|
79
|
+
rake (~> 12.0)
|
80
|
+
rspec (~> 3.0)
|
81
|
+
|
82
|
+
BUNDLED WITH
|
83
|
+
2.1.4
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2020 Max Kadel
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
# Partridge
|
2
|
+
|
3
|
+
Partridge is the gem for the shared pairtree for Yale Library's Digital Collections projects.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'partridge'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle install
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install partridge
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
TODO: Write usage instructions here
|
24
|
+
|
25
|
+
## Development
|
26
|
+
|
27
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. Put your Ruby code in the file `lib/partridge`.
|
28
|
+
|
29
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
30
|
+
|
31
|
+
### Running the tests
|
32
|
+
|
33
|
+
After setting up the gem, as above, run the rspec tests by running `bundle exec rspec`
|
34
|
+
|
35
|
+
## Contributing
|
36
|
+
|
37
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/yalelibrary/yul-dc-partridge.
|
38
|
+
|
39
|
+
|
40
|
+
## License
|
41
|
+
|
42
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require 'bundler/setup'
|
5
|
+
require 'partridge'
|
6
|
+
|
7
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
8
|
+
# with your gem easier. You can also use a different console, if you like.
|
9
|
+
|
10
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
11
|
+
# require "pry"
|
12
|
+
# Pry.start
|
13
|
+
|
14
|
+
require 'irb'
|
15
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
data/lib/partridge.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'partridge/version'
|
4
|
+
|
5
|
+
module Partridge
|
6
|
+
class Error < StandardError; end
|
7
|
+
# Takes an oid and returns a string representing a pairtree path
|
8
|
+
class Pairtree
|
9
|
+
def self.oid_to_pairtree(oid)
|
10
|
+
prefix = oid.to_s[-2..-1]
|
11
|
+
digest_path_structure = oid.to_s.scan(/../)
|
12
|
+
digest_path_structure.each do |oiddir|
|
13
|
+
prefix += "/#{oiddir}"
|
14
|
+
end
|
15
|
+
prefix
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/partridge.gemspec
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'lib/partridge/version'
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = 'partridge'
|
7
|
+
spec.version = Partridge::VERSION
|
8
|
+
spec.authors = ['Max Kadel', 'Lakeisha Robinson']
|
9
|
+
spec.email = ['max@curationexperts.com', 'lakeisha.robinson@yale.edu']
|
10
|
+
|
11
|
+
spec.summary = 'Create pairtree structure'
|
12
|
+
spec.description = 'Create a pairtree structure for a given OID for Yale Digital Collections projects.'
|
13
|
+
spec.homepage = 'https://github.com/yalelibrary/yul-dc-partridge'
|
14
|
+
spec.license = 'MIT'
|
15
|
+
spec.required_ruby_version = Gem::Requirement.new('>= 2.3.0')
|
16
|
+
|
17
|
+
spec.metadata['allowed_push_host'] = 'https://rubygems.org/'
|
18
|
+
|
19
|
+
spec.metadata['homepage_uri'] = spec.homepage
|
20
|
+
spec.metadata['source_code_uri'] = 'https://github.com/yalelibrary/yul-dc-partridge'
|
21
|
+
spec.metadata['changelog_uri'] = 'https://github.com/yalelibrary/yul-dc-partridge/blob/master/CHANGELOG.md'
|
22
|
+
|
23
|
+
# Specify which files should be added to the gem when it is released.
|
24
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
25
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
26
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
27
|
+
end
|
28
|
+
spec.bindir = 'exe'
|
29
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
30
|
+
spec.require_paths = ['lib']
|
31
|
+
spec.add_development_dependency 'bixby'
|
32
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
33
|
+
end
|
metadata
ADDED
@@ -0,0 +1,91 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: partridge
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Max Kadel
|
8
|
+
- Lakeisha Robinson
|
9
|
+
autorequire:
|
10
|
+
bindir: exe
|
11
|
+
cert_chain: []
|
12
|
+
date: 2020-09-01 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: bixby
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - ">="
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '0'
|
21
|
+
type: :development
|
22
|
+
prerelease: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '0'
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: rspec
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - "~>"
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '3.0'
|
35
|
+
type: :development
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - "~>"
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '3.0'
|
42
|
+
description: Create a pairtree structure for a given OID for Yale Digital Collections
|
43
|
+
projects.
|
44
|
+
email:
|
45
|
+
- max@curationexperts.com
|
46
|
+
- lakeisha.robinson@yale.edu
|
47
|
+
executables: []
|
48
|
+
extensions: []
|
49
|
+
extra_rdoc_files: []
|
50
|
+
files:
|
51
|
+
- ".circleci/config.yml"
|
52
|
+
- ".gitignore"
|
53
|
+
- ".rspec"
|
54
|
+
- Gemfile
|
55
|
+
- Gemfile.lock
|
56
|
+
- LICENSE.txt
|
57
|
+
- README.md
|
58
|
+
- Rakefile
|
59
|
+
- bin/console
|
60
|
+
- bin/setup
|
61
|
+
- lib/partridge.rb
|
62
|
+
- lib/partridge/version.rb
|
63
|
+
- partridge.gemspec
|
64
|
+
homepage: https://github.com/yalelibrary/yul-dc-partridge
|
65
|
+
licenses:
|
66
|
+
- MIT
|
67
|
+
metadata:
|
68
|
+
allowed_push_host: https://rubygems.org/
|
69
|
+
homepage_uri: https://github.com/yalelibrary/yul-dc-partridge
|
70
|
+
source_code_uri: https://github.com/yalelibrary/yul-dc-partridge
|
71
|
+
changelog_uri: https://github.com/yalelibrary/yul-dc-partridge/blob/master/CHANGELOG.md
|
72
|
+
post_install_message:
|
73
|
+
rdoc_options: []
|
74
|
+
require_paths:
|
75
|
+
- lib
|
76
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
77
|
+
requirements:
|
78
|
+
- - ">="
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: 2.3.0
|
81
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
82
|
+
requirements:
|
83
|
+
- - ">="
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '0'
|
86
|
+
requirements: []
|
87
|
+
rubygems_version: 3.0.8
|
88
|
+
signing_key:
|
89
|
+
specification_version: 4
|
90
|
+
summary: Create pairtree structure
|
91
|
+
test_files: []
|