bagit 0.4.0 → 0.4.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 +4 -4
- data/.gitignore +0 -0
- data/.travis.yml +0 -0
- data/Gemfile +0 -0
- data/LICENSE.txt +0 -0
- data/README.md +0 -0
- data/Rakefile +0 -0
- data/bagit.gemspec +0 -0
- data/lib/bagit.rb +0 -0
- data/lib/bagit/bag.rb +12 -11
- data/lib/bagit/fetch.rb +0 -0
- data/lib/bagit/file.rb +0 -0
- data/lib/bagit/info.rb +0 -0
- data/lib/bagit/log.rb +0 -0
- data/lib/bagit/manifest.rb +2 -2
- data/lib/bagit/string.rb +0 -0
- data/lib/bagit/valid.rb +0 -0
- data/lib/bagit/version.rb +1 -1
- data/spec/bagit_spec.rb +0 -0
- data/spec/fetch_spec.rb +0 -0
- data/spec/manifest_spec.rb +0 -0
- data/spec/spec_helper.rb +0 -0
- data/spec/tag_info_spec.rb +0 -0
- data/spec/tag_spec.rb +0 -0
- data/spec/util/bagit_matchers.rb +0 -0
- data/spec/validation_spec.rb +0 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac8457e8aaeb0c0ebf47ab69bd684ef53c39aa06
|
4
|
+
data.tar.gz: f2d8519577d2eca73c369c4523ebf34ccf1b034d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b57162bc669f4ae8a739d51a3907f1b053b3980cc5b3331521b2419e21ecc10e12eb32a561ed233955920276ba9ee5e7e5af1baf28a705b84df36b3a6c28008
|
7
|
+
data.tar.gz: 0ab1ee1aa64b9917bb493aaf94976ab5459680d1fde980dca3632684ddee968320d821c8cb00bc041b3905261db7335d7b2592d33fab557616a1f5fbed940b9c
|
data/.gitignore
CHANGED
File without changes
|
data/.travis.yml
CHANGED
File without changes
|
data/Gemfile
CHANGED
File without changes
|
data/LICENSE.txt
CHANGED
File without changes
|
data/README.md
CHANGED
File without changes
|
data/Rakefile
CHANGED
File without changes
|
data/bagit.gemspec
CHANGED
File without changes
|
data/lib/bagit.rb
CHANGED
File without changes
|
data/lib/bagit/bag.rb
CHANGED
@@ -56,10 +56,10 @@ module BagIt
|
|
56
56
|
files
|
57
57
|
end
|
58
58
|
|
59
|
-
# Add a bag file
|
60
|
-
def add_file(
|
61
|
-
path = File.join(data_dir,
|
62
|
-
raise "Bag file exists: #{
|
59
|
+
# Add a bag file at the given path relative to data_dir
|
60
|
+
def add_file(relative_path, src_path=nil)
|
61
|
+
path = File.join(data_dir, relative_path)
|
62
|
+
raise "Bag file exists: #{relative_path}" if File.exist? path
|
63
63
|
FileUtils::mkdir_p File.dirname(path)
|
64
64
|
|
65
65
|
if src_path.nil?
|
@@ -71,16 +71,17 @@ module BagIt
|
|
71
71
|
return f
|
72
72
|
end
|
73
73
|
|
74
|
-
# Remove a bag file
|
75
|
-
def remove_file(
|
76
|
-
path = File.join(data_dir,
|
77
|
-
raise "Bag file does not exist: #{
|
74
|
+
# Remove a bag file at the given path relative to data_dir
|
75
|
+
def remove_file(relative_path)
|
76
|
+
path = File.join(data_dir, relative_path)
|
77
|
+
raise "Bag file does not exist: #{relative_path}" unless File.exist? path
|
78
78
|
FileUtils::rm path
|
79
79
|
end
|
80
80
|
|
81
|
-
# Retrieve the IO handle for a file in the bag
|
82
|
-
|
83
|
-
|
81
|
+
# Retrieve the IO handle for a file in the bag at a given path relative to
|
82
|
+
# data_dir
|
83
|
+
def get(relative_path)
|
84
|
+
path = File.join(data_dir, relative_path)
|
84
85
|
return nil unless File.exist?(path)
|
85
86
|
File.open(path)
|
86
87
|
end
|
data/lib/bagit/fetch.rb
CHANGED
File without changes
|
data/lib/bagit/file.rb
CHANGED
File without changes
|
data/lib/bagit/info.rb
CHANGED
File without changes
|
data/lib/bagit/log.rb
CHANGED
File without changes
|
data/lib/bagit/manifest.rb
CHANGED
@@ -16,7 +16,7 @@ module BagIt
|
|
16
16
|
# All tag files that are bag manifest files (manifest-[algorithm].txt)
|
17
17
|
def manifest_files
|
18
18
|
files = Dir[File.join(@bag_dir, '*')].select { |f|
|
19
|
-
File.file? f and File.basename(f) =~ /^manifest-.*.txt
|
19
|
+
File.file? f and File.basename(f) =~ /^manifest-.*.txt$/
|
20
20
|
}
|
21
21
|
files
|
22
22
|
end
|
@@ -50,7 +50,7 @@ module BagIt
|
|
50
50
|
# All tag files that are bag manifest files (tagmanifest-[algorithm].txt)
|
51
51
|
def tagmanifest_files
|
52
52
|
files = Dir[File.join(@bag_dir, '*')].select { |f|
|
53
|
-
File.file? f and File.basename(f) =~ /^tagmanifest-.*.txt
|
53
|
+
File.file? f and File.basename(f) =~ /^tagmanifest-.*.txt$/
|
54
54
|
}
|
55
55
|
files
|
56
56
|
end
|
data/lib/bagit/string.rb
CHANGED
File without changes
|
data/lib/bagit/valid.rb
CHANGED
File without changes
|
data/lib/bagit/version.rb
CHANGED
data/spec/bagit_spec.rb
CHANGED
File without changes
|
data/spec/fetch_spec.rb
CHANGED
File without changes
|
data/spec/manifest_spec.rb
CHANGED
File without changes
|
data/spec/spec_helper.rb
CHANGED
File without changes
|
data/spec/tag_info_spec.rb
CHANGED
File without changes
|
data/spec/tag_spec.rb
CHANGED
File without changes
|
data/spec/util/bagit_matchers.rb
CHANGED
File without changes
|
data/spec/validation_spec.rb
CHANGED
File without changes
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bagit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Johnson, Francesco Lazzarino, Jamie Little
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-09-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: validatable
|
@@ -147,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
147
147
|
version: '0'
|
148
148
|
requirements: []
|
149
149
|
rubyforge_project:
|
150
|
-
rubygems_version: 2.
|
150
|
+
rubygems_version: 2.6.12
|
151
151
|
signing_key:
|
152
152
|
specification_version: 4
|
153
153
|
summary: BagIt package generation and validation
|