assembly-objectfile 1.8.1 → 1.8.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9340849c0c7e9473a7f64cdbc2882ced45df4b127851f7f39b2ec7617392a23d
4
- data.tar.gz: 9b7b9240d7b66e59c25cf812da864f9ad5bed47d384138517e9f931b7f22d519
3
+ metadata.gz: 4d550fdcd3d1b11ba39b106dd5077eb953c77244f05771e65163af4ca0cab776
4
+ data.tar.gz: 8d0325c5c2df7c695bca6d34f4f12ffc2ef8792cd0d12ec9f26f2af51b001be5
5
5
  SHA512:
6
- metadata.gz: 74bc38ddbc94dd288eaca87caa1c0e1f8f4c0f64a815adf1ec88d88b94145152cb40cbb479509ec987e450ac343d7ee7f9d693ef403c83a13c7349c7f09562a9
7
- data.tar.gz: 467ac07058e4b354f3132e651eba1e9149ef0f7bbbd70ef77f1ab0b4d4f4fe09f39d62868879c2daa16cf4d10fe1dd532ba37bb6b9d0be9a3066aef0448e1f8b
6
+ metadata.gz: 00f9c88860bb1a3b584b4d63c9f7fec2376a0aa8ea631e574acd34da1d029fc9d5e8c84966616fc3fee7223bb2dd4ae599359c3cdfa4339d64aa32d54ef6db55
7
+ data.tar.gz: 118869ec9a74f54e009849ef1035c130f02c5ce3402ca47aa30a454add2ad4fc7ce942b39e1058a27b736005efdeaf1da70993771d0bbe11819ed34c5db4a1b3
data/.gitignore CHANGED
@@ -4,10 +4,10 @@
4
4
  .bundle
5
5
  config/certs/*
6
6
  config/environments/*
7
+ coverage/*
7
8
  doc/*
8
9
  log/*
9
10
  pkg/*
10
11
  tags
11
12
  tmp
12
- .yardoc/*
13
- Gemfile.lock
13
+ Gemfile.lock
data/.travis.yml CHANGED
@@ -1,9 +1,20 @@
1
- notifications:
2
- email: false
3
- addons:
4
- apt:
5
- packages:
6
- - libimage-exiftool-perl
1
+
2
+ language: ruby
7
3
  rvm:
8
4
  - 2.2.5
9
5
  - 2.3.1
6
+ addons:
7
+ apt:
8
+ packages:
9
+ - libimage-exiftool-perl
10
+ before_script:
11
+ - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
12
+ - chmod +x ./cc-test-reporter
13
+ - ./cc-test-reporter before-build
14
+ script:
15
+ - bundle exec rake
16
+ after_script:
17
+ - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
18
+
19
+ notifications:
20
+ email: false
data/README.md ADDED
@@ -0,0 +1,46 @@
1
+ [![Build Status](https://travis-ci.org/sul-dlss/assembly-objectfile.svg?branch=master)](https://travis-ci.org/sul-dlss/assembly-objectfile)
2
+ [![Test Coverage](https://api.codeclimate.com/v1/badges/2310962acce78d78e76c/test_coverage)](https://codeclimate.com/github/sul-dlss/assembly-objectfile/test_coverage)
3
+ [![Maintainability](https://api.codeclimate.com/v1/badges/2310962acce78d78e76c/maintainability)](https://codeclimate.com/github/sul-dlss/assembly-objectfile/maintainability)
4
+
5
+ # Assembly-ObjectFile Gem
6
+
7
+ ## Overview
8
+ This gem contains classes used by the Stanford University Digital Library to
9
+ perform file operations necessary for accessioning of content. It is also
10
+ used by related gems to perform content type specific operations (such as jp2
11
+ generation).
12
+
13
+ ## Usage
14
+
15
+ The gem currently has methods for:
16
+ * filesize
17
+ * exif
18
+ * generate content metadata
19
+
20
+ ## Running tests
21
+
22
+ ```
23
+ bundle exec spec
24
+ ```
25
+
26
+ ## Releasing the gem
27
+
28
+ ```
29
+ rake release
30
+ ```
31
+
32
+ ## Prerequisites
33
+
34
+ 1. Exiftool
35
+
36
+ RHEL: (RPM to install comming soon) Download latest version from:
37
+ http://www.sno.phy.queensu.ca/~phil/exiftool
38
+
39
+ tar -xf Image-ExifTool-#.##.tar.gz
40
+ cd Image-ExifTool-#.##
41
+ perl Makefile.PL
42
+ make test
43
+ sudo make install
44
+
45
+ Mac users:
46
+ brew install exiftool
@@ -29,5 +29,5 @@ Gem::Specification.new do |s|
29
29
  s.add_development_dependency 'rspec', '~> 3.0'
30
30
  s.add_development_dependency 'rubocop'
31
31
  s.add_development_dependency 'rubocop-rspec'
32
- s.add_development_dependency 'yard'
32
+ s.add_development_dependency 'simplecov'
33
33
  end
@@ -2,6 +2,6 @@
2
2
  module Assembly
3
3
  class ObjectFile
4
4
  # Project version number
5
- VERSION = '1.8.1'.freeze
5
+ VERSION = '1.8.2'.freeze
6
6
  end
7
7
  end
@@ -172,7 +172,7 @@ describe Assembly::ObjectFile do
172
172
  expect(@ai.object_type).not_to eq(:image)
173
173
  expect(@ai.valid_image?).to eq(false)
174
174
 
175
- non_image_file = File.join(Assembly::PATH_TO_GEM, 'README.rdoc')
175
+ non_image_file = File.join(Assembly::PATH_TO_GEM, 'spec/test_data/input/file_with_no_exif.xml')
176
176
  expect(File.exist?(non_image_file)).to be true
177
177
  @ai = described_class.new(non_image_file)
178
178
  expect(@ai.image?).to eq(false)
data/spec/spec_helper.rb CHANGED
@@ -1,3 +1,6 @@
1
+ require 'simplecov'
2
+ SimpleCov.start
3
+
1
4
  bootfile = File.expand_path(File.dirname(__FILE__) + '/../config/boot')
2
5
  require bootfile
3
6
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: assembly-objectfile
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.1
4
+ version: 1.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Mangiafico
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: exe
13
13
  cert_chain: []
14
- date: 2019-08-21 00:00:00.000000000 Z
14
+ date: 2019-08-23 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: mime-types
@@ -126,7 +126,7 @@ dependencies:
126
126
  - !ruby/object:Gem::Version
127
127
  version: '0'
128
128
  - !ruby/object:Gem::Dependency
129
- name: yard
129
+ name: simplecov
130
130
  requirement: !ruby/object:Gem::Requirement
131
131
  requirements:
132
132
  - - ">="
@@ -153,7 +153,7 @@ files:
153
153
  - ".travis.yml"
154
154
  - Gemfile
155
155
  - LICENSE
156
- - README.rdoc
156
+ - README.md
157
157
  - Rakefile
158
158
  - assembly-objectfile.gemspec
159
159
  - bin/console
data/README.rdoc DELETED
@@ -1,117 +0,0 @@
1
- {<img src="https://travis-ci.org/sul-dlss/assembly-objectfile.svg?branch=master" alt="Build Status" />}[https://travis-ci.org/sul-dlss/assembly-objectfile]
2
-
3
- = Assembly-ObjectFile Gem
4
-
5
- ==Overview
6
- This gem contains classes used by the Stanford University Digital Library to perform
7
- file operations necessary for accessioning of content. It is also used by related gems to perform
8
- content type specific operations (such as jp2 generation).
9
-
10
- ==Releases
11
-
12
- - 1.0.0 initial release
13
- - 1.0.1 add in a valid_image? method
14
- - 1.0.2 add new mimetype and encoding methods
15
- - 1.0.3 add new object_type method
16
- - 1.0.4 add additional configuration parameters that are used by assembly and other consumers of the gem
17
- - 1.0.5 try and get mimetype from exif before resorting to unix level file command
18
- - 1.1.0 add methods to compute sha1 and md5 for object using checksum-tools gem
19
- - 1.1.1 change computation of mimetype and encoding to work in more situations
20
- - 1.1.2 change jp2able? and image? methods so they return a file not found error if the file is not supplied, added a method to indicate if a file is found
21
- - 1.1.3 prepare for release listing on DLSS release board
22
- - 1.1.4 valid_image? will now return true for jp2 mimetypes
23
- - 1.1.5 valid_image? should be false if mimetype is correct but profile is not found
24
- - 1.1.6 add jp2able? method
25
- - 1.1.7 change the behavior of jp2able? and valid_image?
26
- - 1.1.8 update how the version number is set to allow users to see the gem version # more easily
27
- - 1.1.9 switch jpeg mimetype temporarily to publish=no, preserve=yes
28
- - 1.2.0 move content metadata generation method to this gem from assembly-image
29
- - 1.2.1 allow content metadata to add user supplied checksums
30
- - 1.2.2 allow content metadata to bundle files into resources by filename or DPG filename specification, add book_as_image and file style content metadata generation
31
- - 1.2.3 small change to a parameter passed to content metadata generation
32
- - 1.2.4 allow user to control how file ID paths are generated in content metadata by using a 'relative_path' attribute
33
- - 1.2.5 add a class method to find the common directory between an array of filenames passed in
34
- - 1.2.6 bug fix in content metadata generation, and allow book types to have single <file> resource nodes if they do not contain any images
35
- - 1.2.8 remove dependency on ChecksumTools gem to make it Ruby 1.9 compatible
36
- - 1.2.9 automatically strip druid: prefix in content metadata generation method
37
- - 1.2.10 bug fix
38
- - 1.2.11 add ability to suppress <xml> tag from generated contentMetadata
39
- - 1.3.0 continued refinement of content metadata generation for objects with download
40
- - 1.3.1 allow the user specify a label with the ObjectFile object that is picked up when generating content metadata (in specifying resource labels)
41
- - 1.3.2 allow the user to set the label on object creation
42
- - 1.3.3 update tests to avoid dependency on kakadu; contentMetadata will now generate new resources of type=object when files are present in special DPG folders
43
- - 1.3.4 fix rspec test to have it run on CI server
44
- - 1.3.5 add a parameter to flatten folder structure when creating file IDs; increment resource labels by object type
45
- - 1.3.6 allow user to supply default file attributes as well as by mimetype --- useful if file attributes should be added and are the same regardless of mimetype
46
- - 1.3.7 add a new bundle style called "prebundled" which allows users to pass in an array of arrays
47
- - 1.3.8 update to latest lyberteam devel gems
48
- - 1.3.9 compute md5 and sha1 separately when needed
49
- - 1.4.0 compute mimetype correctly even if exif information in a file is damaged
50
- - 1.4.1 fix errors that could error if there was a space in the filename
51
- - 1.4.2 Support map style content metadata; don't compute mimetype when generating content metadata unless its needed
52
- - 1.4.3 object_type method should return :other if it is an unknown mimetype
53
- - 1.4.4 produce blank content metadata if no objects are passed in
54
- - 1.4.5 allow the user to supply optional file specific attributes for publish, preserve, shelve for creating content metadata
55
- - 1.4.6 add dirname attribute to objectfile class
56
- - 1.4.7 add an additional default mimetype for file perservation attributes
57
- - 1.4.8 compute mimetype with file unix command by default, and then check for existence of mimetype in exif unless we have a "trusted" mimetype
58
- - 1.4.9 update list of trusted mimetypes
59
- - 1.5.0 add the ability to skip auto label generation for resources if no labels are supplied
60
- - 1.5.1 Pin mini_exiftool to 1.x and Nokogiri to 1.5.x branch for Ruby 1.8.7, added image/png and application/zip
61
- - 1.5.2 Fix for Rails 4 and support for 'rake console'
62
- - 1.5.3 More gemfile updates
63
- - 1.5.4 jp2able? method now returns true even if profile description is missing; add new method which does a check for existing color profile in an image
64
- - 1.5.5 do not allow jp2s to have jp2s derivatives generated
65
- - 1.5.6 do a further check for alternate existence of color profile in exif
66
- - 1.5.7 include Gemfile.lock, pin Nokogiri to 1.5.x and ActiveSupport to 3.2.x
67
- - 1.6.1 remove dependencies on sulgems
68
- - 1.6.2 Added APLv2 artifacts
69
- - 1.6.3 Integrate with TravisCI
70
- - 1.6.4 Try and solve UTF-8 encoding issues with exif data in images
71
- - 1.6.5 Just use mime-types extension by default to compute mimetype to prevent calling to shell all the time (and avoid potential memory problems). A new method allows you to call out to shell if you really want to.
72
- - 1.7.0 Support the `role` attribute on files
73
- - 1.7.1 Don't produce empty XML attributes
74
- - 1.7.2 Allow for 3d content metadata generation
75
- - 1.8.0 Add in mime-type generation from the shell again to correctly set 3D and other mimetypes (if exif data does not exist)
76
- - 1.8.1 Adds style to error message when style is invalid
77
-
78
- ==Usage
79
-
80
- The gem currently has methods for:
81
- - filesize
82
- - exif
83
- - generate content metadata
84
-
85
- ==Running tests
86
-
87
- bundle exec rspec spec
88
-
89
- ==Releasing the gem
90
-
91
- gem build assembly-objectfile.gemspec
92
- gem push assembly-objectfile-x.y.z.gem # replace x-y-z with the version number, you'll need a ruby gems account to do this
93
-
94
- ==Generate documentation
95
- To generate documentation into the "doc" folder:
96
-
97
- yard
98
-
99
- To keep a local server running with up to date code documentation that you can view in your browser:
100
-
101
- yard server --reload
102
-
103
- ==Prerequisites
104
-
105
- 1. Exiftool
106
-
107
- RHEL: (RPM to install comming soon)
108
- Download latest version from: http://www.sno.phy.queensu.ca/~phil/exiftool
109
-
110
- tar -xf Image-ExifTool-#.##.tar.gz
111
- cd Image-ExifTool-#.##
112
- perl Makefile.PL
113
- make test
114
- sudo make install
115
-
116
- Mac users:
117
- brew install exiftool