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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e61e4ebbb4c8128ba09169d18a8cd5f2d65116df
4
- data.tar.gz: 31439fd0fb7a12504f52c381d8a50dd7b91cffc3
3
+ metadata.gz: ac8457e8aaeb0c0ebf47ab69bd684ef53c39aa06
4
+ data.tar.gz: f2d8519577d2eca73c369c4523ebf34ccf1b034d
5
5
  SHA512:
6
- metadata.gz: 56522faf0dbac8705ec25ca2c8332ace8223eeac23361168b23070c44c78226b402af8488ca0e1b83a76d0ae52e5ec3d9fc533e479337f60298c76f6479a169f
7
- data.tar.gz: ec107432518a390e9c5793cf2f0ce7704f06b48bb1fef06e7079ad3cc8a38dca8320422f711e66a90200cd86efedad454f602dd16021a89b94d1b818aa8141c3
6
+ metadata.gz: 4b57162bc669f4ae8a739d51a3907f1b053b3980cc5b3331521b2419e21ecc10e12eb32a561ed233955920276ba9ee5e7e5af1baf28a705b84df36b3a6c28008
7
+ data.tar.gz: 0ab1ee1aa64b9917bb493aaf94976ab5459680d1fde980dca3632684ddee968320d821c8cb00bc041b3905261db7335d7b2592d33fab557616a1f5fbed940b9c
data/.gitignore CHANGED
File without changes
File without changes
data/Gemfile CHANGED
File without changes
File without changes
data/README.md CHANGED
File without changes
data/Rakefile CHANGED
File without changes
File without changes
File without changes
@@ -56,10 +56,10 @@ module BagIt
56
56
  files
57
57
  end
58
58
 
59
- # Add a bag file
60
- def add_file(base_path, src_path=nil)
61
- path = File.join(data_dir, base_path)
62
- raise "Bag file exists: #{base_path}" if File.exist? path
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(base_path)
76
- path = File.join(data_dir, base_path)
77
- raise "Bag file does not exist: #{base_path}" unless File.exist? path
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
- def get(base_path)
83
- path = File.join(data_dir, base_path)
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
File without changes
File without changes
File without changes
File without changes
@@ -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
File without changes
File without changes
@@ -1,3 +1,3 @@
1
1
  module BagIt
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1"
3
3
  end
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
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.0
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: 2016-12-14 00:00:00.000000000 Z
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.5.1
150
+ rubygems_version: 2.6.12
151
151
  signing_key:
152
152
  specification_version: 4
153
153
  summary: BagIt package generation and validation