hybag 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MjEwZDk1ODkxNDQ4OThiMzhhM2U0ZDI3MDdkM2M3YTAwZjM0MzI1Yw==
4
+ YWMxNWM2NTA4Mzg0Mjg4N2ZmMTZkOTM1NjhlZmUyYzdjYTNkMWIwNA==
5
5
  data.tar.gz: !binary |-
6
- OTlmYmU4Y2UzMjBjY2Y1ODg0NmJhN2VjMzFkZTkyYjEyYzM3OGYzYQ==
6
+ YWVlZmFkMGU5MjRkMjM2MjM2Y2Y5Zjc4MWEzOGZiODc4YTA2YjkwYQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- NjhhZWY3NDczZmE2MzM4MDE2NjkyZGJjOWYxYzA0ZjgwYjhlMDAxM2Y0NWM0
10
- ZmVhNjYyYmVkNzM1NzMyZDAzYTNhNWZkYjY3ZjEzNzRhMTM0YzA2YzVlMjcx
11
- MTgzYjk1MzlmYzQxMTZmYTY0NmJhZWQxMjE4YmMxMWEyNjZhMWU=
9
+ ZTY0NzA4ZWY3ZTllOTcyZWJkYmFlMjAyZThmNjUyZWQ3NGJlYzIxMmYwNWEx
10
+ ODg1Mjc3OTc5Y2U3NzFkYjU3ODU4MjBkYjYyMTBhYzU4NTllY2YwNDE3ZTdj
11
+ Mzg3MDQ4MmVjNjhiMTE0MzExZmQ1YTQ0MTc4OWU4YTExYWE4OTc=
12
12
  data.tar.gz: !binary |-
13
- ZTNmMzdkNjJjNmE0MGQwYzA4NTU0NjM5Yzk1OTYwZGU2YmFmOWJkNTY0YzI5
14
- YzQ5MzRmNzM0MTg3NzhlZjhiYzI1NDJmOGRkMmRkNjc1MjhhZmYyNjhhNjY5
15
- OWNhMjIzMjIyMGU0MzE0ZjI4OGVjZTJkMjBlZmUyZjRkOThmYmM=
13
+ MjcxNjVkNzE5NTQ3NjQ2MmEyOGI2NTJiYmE1NGE5MWI5YzdlYzRmYjUzYzVi
14
+ ZGM2NThmZjZiZjkwNjMxMGZhMTU4Mjg5YTIzMzE3MThjNDExZWFiZmIwYmVj
15
+ ODYxN2JmYmE4MzNhOTEyMDFlZmYzZjU3MTk3ZTg4N2MzNjVkZTc=
@@ -36,7 +36,9 @@ module Hybag
36
36
  def add_bag_file_to_object(object, bag_file, binary=true)
37
37
  parsed_name = bag_filename_to_label(bag_file)
38
38
  found_datastream = object.datastreams.values.find{|x| x.dsid.downcase == bag_filename_to_label(bag_file).downcase}
39
- content = File.open(bag_file).read
39
+ open_tag = 'r'
40
+ open_tag = 'rb' if binary
41
+ content = File.open(bag_file, open_tag).read
40
42
  content = transform_content(content) unless binary
41
43
  if found_datastream
42
44
  found_datastream = replace_subject(content, found_datastream)
data/lib/hybag/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Hybag
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hybag
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Trey Terrell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-16 00:00:00.000000000 Z
11
+ date: 2013-09-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler