assembly-objectfile 2.1.3 → 2.2.0

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
  SHA256:
3
- metadata.gz: 6743d03c8c75529ad425586ed16bece4858c1fd2394342918ab29c568199d4f7
4
- data.tar.gz: 16a79c4115124aae1402f1651076a85eb58912b4309f5a7503536246cd55076f
3
+ metadata.gz: cbf476be726445b2be5a1ff9f4787d12f7e8016a828d22937c488c51d53c5071
4
+ data.tar.gz: b4e1953bfee015bb956dbc20ab5ab1ce09dd6e953d50aeed81c2f7c8595a04d7
5
5
  SHA512:
6
- metadata.gz: f08d614455304c1d7c935bc5e69ca85400493b8ba4bb045d048dc519c5a78f401d2d7e1a62292a8048cc0e9b83bdd0bc3f9fa540e8021356f9929ba3ec72ef37
7
- data.tar.gz: 2340e0deff59c7e913272c6c18ce6f27513d2b1777e7d7da9120a4b3377f00c80ae2c59e31c3c29769ae763dc2cc4888b3bbdc76ce75f6962b81b2de713d4551
6
+ metadata.gz: 7b0f524f32a5082068cddec3d5bd8f98371d79ca5c76867a7f7b2f0125c0452b035fb9e6a424a2d6e734b5ef61380f8821bf0be012ce8ea3ccdb25a9249943bd
7
+ data.tar.gz: 1fc0f0b3937c254667c6428bbb26cd1f901d175f26a6c026e07c497ee4e24bf06566ef2640f0af3c851e8bca233e10f2be84e123b5655e6885db333c004e0ca1
data/.circleci/config.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  version: 2.1
2
2
  orbs:
3
- ruby-rails: sul-dlss/ruby-rails@3.1.2
3
+ ruby-rails: sul-dlss/ruby-rails@4.0.0
4
4
  workflows:
5
5
  build:
6
6
  jobs:
data/.gitignore CHANGED
@@ -2,8 +2,7 @@
2
2
  *.gem
3
3
  .DS_Store
4
4
  .bundle
5
- config/certs/*
6
- config/environments/*
5
+ .rspec_status
7
6
  coverage/*
8
7
  doc/*
9
8
  log/*
data/.rubocop.yml CHANGED
@@ -1,14 +1,26 @@
1
- inherit_from: .rubocop_todo.yml
2
1
  require: rubocop-rspec
3
2
 
3
+ inherit_from: .rubocop_todo.yml
4
+
4
5
  AllCops:
5
6
  TargetRubyVersion: 3.0
7
+ SuggestExtensions: false
6
8
  DisplayCopNames: true
9
+ Include:
10
+ - './Rakefile' # rake only
11
+ - '**/*.rb'
7
12
  Exclude:
13
+ # autogenerated files (that we don't change) should go here
8
14
  - 'Gemfile.lock'
9
15
  - '**/*.md'
16
+ - spec/spec_helper.rb
10
17
  - 'vendor/**/*' # avoid running rubocop on cached bundler
11
18
 
19
+ Bundler/GemComment:
20
+ OnlyFor:
21
+ - restrictive_version_specifiers
22
+ - branch
23
+
12
24
  Layout/LineLength:
13
25
  Max: 120
14
26
 
@@ -26,125 +38,93 @@ Metrics/BlockLength:
26
38
  - '**/*.gemspec'
27
39
 
28
40
  RSpec/ExampleLength:
29
- Max: 10
41
+ Enabled: false
30
42
 
31
43
  RSpec/MultipleExpectations:
32
- Max: 10
44
+ Max: 6 # default 1
45
+ Exclude:
46
+ - spec/features/**/*_spec.rb
47
+
48
+ RSpec/MultipleMemoizedHelpers:
49
+ Enabled: false
33
50
 
34
51
  RSpec/NestedGroups:
35
- Max: 4
52
+ Max: 4 # default: 3
36
53
 
37
54
  Gemspec/DeprecatedAttributeAssignment: # (new in 1.10)
38
55
  Enabled: true
39
-
40
56
  Layout/SpaceAroundMethodCallOperator:
41
57
  Enabled: true
42
-
43
58
  Layout/EmptyLinesAroundAttributeAccessor:
44
59
  Enabled: true
45
-
46
60
  Layout/SpaceBeforeBrackets: # (new in 1.7)
47
61
  Enabled: true
48
-
49
62
  Lint/AmbiguousAssignment: # (new in 1.7)
50
63
  Enabled: true
51
-
52
64
  Lint/DeprecatedConstants: # (new in 1.8)
53
65
  Enabled: true
54
-
55
66
  Lint/DuplicateBranch: # (new in 1.3)
56
67
  Enabled: true
57
-
58
68
  Lint/DuplicateRegexpCharacterClassElement: # (new in 1.1)
59
69
  Enabled: true
60
-
61
70
  Lint/EmptyBlock: # (new in 1.1)
62
71
  Enabled: true
63
-
64
72
  Lint/EmptyClass: # (new in 1.3)
65
73
  Enabled: true
66
-
67
74
  Lint/LambdaWithoutLiteralBlock: # (new in 1.8)
68
75
  Enabled: true
69
-
70
76
  Lint/NoReturnInBeginEndBlocks: # (new in 1.2)
71
77
  Enabled: true
72
-
73
78
  Lint/NumberedParameterAssignment: # (new in 1.9)
74
79
  Enabled: true
75
-
76
80
  Lint/OrAssignmentToConstant: # (new in 1.9)
77
81
  Enabled: true
78
-
79
82
  Lint/RedundantDirGlobSort: # (new in 1.8)
80
83
  Enabled: true
81
-
82
84
  Lint/SymbolConversion: # (new in 1.9)
83
85
  Enabled: true
84
-
85
86
  Lint/ToEnumArguments: # (new in 1.1)
86
87
  Enabled: true
87
-
88
88
  Lint/TripleQuotes: # (new in 1.9)
89
89
  Enabled: true
90
-
91
90
  Lint/UnexpectedBlockArity: # (new in 1.5)
92
91
  Enabled: true
93
-
94
92
  Lint/UnmodifiedReduceAccumulator: # (new in 1.1)
95
93
  Enabled: true
96
-
97
94
  Lint/RaiseException:
98
95
  Enabled: true
99
-
100
96
  Lint/StructNewOverride:
101
97
  Enabled: true
102
-
103
98
  Style/ExponentialNotation:
104
99
  Enabled: true
105
-
106
100
  Style/HashEachMethods:
107
101
  Enabled: true
108
-
109
102
  Style/HashTransformKeys:
110
103
  Enabled: true
111
-
112
104
  Style/HashTransformValues:
113
105
  Enabled: true
114
-
115
106
  Style/SlicingWithRange:
116
107
  Enabled: true
117
-
118
108
  Style/ArgumentsForwarding: # (new in 1.1)
119
109
  Enabled: true
120
-
121
110
  Style/CollectionCompact: # (new in 1.2)
122
111
  Enabled: true
123
-
124
112
  Style/DocumentDynamicEvalDefinition: # (new in 1.1)
125
113
  Enabled: true
126
-
127
114
  Style/EndlessMethod: # (new in 1.8)
128
115
  Enabled: true
129
-
130
116
  Style/HashConversion: # (new in 1.10)
131
117
  Enabled: true
132
-
133
118
  Style/HashExcept: # (new in 1.7)
134
119
  Enabled: true
135
-
136
120
  Style/IfWithBooleanLiteralBranches: # (new in 1.9)
137
121
  Enabled: true
138
-
139
122
  Style/NegatedIfElseCondition: # (new in 1.2)
140
123
  Enabled: true
141
-
142
124
  Style/NilLambda: # (new in 1.3)
143
125
  Enabled: true
144
-
145
126
  Style/RedundantArgument: # (new in 1.4)
146
127
  Enabled: true
147
-
148
128
  Style/SwapValues: # (new in 1.1)
149
129
  Enabled: true
150
130
 
@@ -240,3 +220,16 @@ RSpec/Capybara/SpecificMatcher: # new in 2.12
240
220
  Enabled: true
241
221
  RSpec/Rails/HaveHttpStatus: # new in 2.12
242
222
  Enabled: true
223
+
224
+ Lint/RequireRangeParentheses: # new in 1.32
225
+ Enabled: true
226
+ Style/EmptyHeredoc: # new in 1.32
227
+ Enabled: true
228
+ Style/MagicCommentFormat: # new in 1.35
229
+ Enabled: true
230
+ RSpec/ClassCheck: # new in 2.13
231
+ Enabled: true
232
+ RSpec/NoExpectationExample: # new in 2.13
233
+ Enabled: true
234
+ RSpec/Capybara/SpecificFinders: # new in 2.13
235
+ Enabled: true
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- assembly-objectfile (2.1.3)
4
+ assembly-objectfile (2.1.4)
5
5
  activesupport (>= 5.2.0)
6
6
  mime-types (> 3)
7
7
  mini_exiftool
@@ -9,7 +9,7 @@ PATH
9
9
  GEM
10
10
  remote: http://rubygems.org/
11
11
  specs:
12
- activesupport (7.0.3.1)
12
+ activesupport (7.0.4.3)
13
13
  concurrent-ruby (~> 1.0, >= 1.0.2)
14
14
  i18n (>= 1.6, < 2)
15
15
  minitest (>= 5.1)
@@ -17,22 +17,22 @@ GEM
17
17
  ast (2.4.2)
18
18
  byebug (11.1.3)
19
19
  coderay (1.1.3)
20
- concurrent-ruby (1.1.10)
20
+ concurrent-ruby (1.2.2)
21
21
  diff-lcs (1.5.0)
22
22
  docile (1.4.0)
23
- i18n (1.12.0)
23
+ i18n (1.13.0)
24
24
  concurrent-ruby (~> 1.0)
25
- json (2.6.2)
25
+ json (2.6.3)
26
26
  method_source (1.0.0)
27
27
  mime-types (3.4.1)
28
28
  mime-types-data (~> 3.2015)
29
- mime-types-data (3.2022.0105)
29
+ mime-types-data (3.2023.0218.1)
30
30
  mini_exiftool (2.10.2)
31
- minitest (5.16.3)
32
- parallel (1.22.1)
33
- parser (3.1.2.1)
31
+ minitest (5.18.0)
32
+ parallel (1.23.0)
33
+ parser (3.2.2.1)
34
34
  ast (~> 2.4.1)
35
- pry (0.14.1)
35
+ pry (0.14.2)
36
36
  coderay (~> 1.1)
37
37
  method_source (~> 1.0)
38
38
  pry-byebug (3.10.1)
@@ -40,45 +40,51 @@ GEM
40
40
  pry (>= 0.13, < 0.15)
41
41
  rainbow (3.1.1)
42
42
  rake (13.0.6)
43
- regexp_parser (2.5.0)
43
+ regexp_parser (2.8.0)
44
44
  rexml (3.2.5)
45
- rspec (3.11.0)
46
- rspec-core (~> 3.11.0)
47
- rspec-expectations (~> 3.11.0)
48
- rspec-mocks (~> 3.11.0)
49
- rspec-core (3.11.0)
50
- rspec-support (~> 3.11.0)
51
- rspec-expectations (3.11.0)
45
+ rspec (3.12.0)
46
+ rspec-core (~> 3.12.0)
47
+ rspec-expectations (~> 3.12.0)
48
+ rspec-mocks (~> 3.12.0)
49
+ rspec-core (3.12.2)
50
+ rspec-support (~> 3.12.0)
51
+ rspec-expectations (3.12.3)
52
52
  diff-lcs (>= 1.2.0, < 2.0)
53
- rspec-support (~> 3.11.0)
54
- rspec-mocks (3.11.1)
53
+ rspec-support (~> 3.12.0)
54
+ rspec-mocks (3.12.5)
55
55
  diff-lcs (>= 1.2.0, < 2.0)
56
- rspec-support (~> 3.11.0)
57
- rspec-support (3.11.0)
58
- rubocop (1.35.1)
56
+ rspec-support (~> 3.12.0)
57
+ rspec-support (3.12.0)
58
+ rubocop (1.51.0)
59
59
  json (~> 2.3)
60
60
  parallel (~> 1.10)
61
- parser (>= 3.1.2.1)
61
+ parser (>= 3.2.0.0)
62
62
  rainbow (>= 2.2.2, < 4.0)
63
63
  regexp_parser (>= 1.8, < 3.0)
64
64
  rexml (>= 3.2.5, < 4.0)
65
- rubocop-ast (>= 1.20.1, < 2.0)
65
+ rubocop-ast (>= 1.28.0, < 2.0)
66
66
  ruby-progressbar (~> 1.7)
67
- unicode-display_width (>= 1.4.0, < 3.0)
68
- rubocop-ast (1.21.0)
69
- parser (>= 3.1.1.0)
70
- rubocop-rspec (2.12.1)
71
- rubocop (~> 1.31)
72
- ruby-progressbar (1.11.0)
73
- simplecov (0.21.2)
67
+ unicode-display_width (>= 2.4.0, < 3.0)
68
+ rubocop-ast (1.28.1)
69
+ parser (>= 3.2.1.0)
70
+ rubocop-capybara (2.18.0)
71
+ rubocop (~> 1.41)
72
+ rubocop-factory_bot (2.23.0)
73
+ rubocop (~> 1.33)
74
+ rubocop-rspec (2.22.0)
75
+ rubocop (~> 1.33)
76
+ rubocop-capybara (~> 2.17)
77
+ rubocop-factory_bot (~> 2.22)
78
+ ruby-progressbar (1.13.0)
79
+ simplecov (0.22.0)
74
80
  docile (~> 1.1)
75
81
  simplecov-html (~> 0.11)
76
82
  simplecov_json_formatter (~> 0.1)
77
83
  simplecov-html (0.12.3)
78
84
  simplecov_json_formatter (0.1.4)
79
- tzinfo (2.0.5)
85
+ tzinfo (2.0.6)
80
86
  concurrent-ruby (~> 1.0)
81
- unicode-display_width (2.2.0)
87
+ unicode-display_width (2.4.2)
82
88
 
83
89
  PLATFORMS
84
90
  ruby
@@ -94,4 +100,4 @@ DEPENDENCIES
94
100
  simplecov
95
101
 
96
102
  BUNDLED WITH
97
- 2.3.17
103
+ 2.4.13
@@ -4,6 +4,6 @@
4
4
  module Assembly
5
5
  class ObjectFile
6
6
  # Gem version
7
- VERSION = '2.1.3'
7
+ VERSION = '2.2.0'
8
8
  end
9
9
  end
@@ -11,8 +11,8 @@ module Assembly
11
11
  # @return [String] longest common initial path of filenames passed in
12
12
  #
13
13
  # Example:
14
- # puts Assembly::ObjectFile.common_prefix(['/Users/peter/00/test.tif','/Users/peter/05/test.jp2'])
15
- # # => '/Users/peter/0'
14
+ # puts Assembly::ObjectFile.common_path(['/Users/peter/00/test.tif','/Users/peter/05/test.jp2'])
15
+ # # => '/Users/peter/'
16
16
  def self.common_path(strings)
17
17
  return nil if strings.empty?
18
18
 
@@ -27,7 +27,7 @@ module Assembly
27
27
  end
28
28
  end
29
29
 
30
- attr_accessor :file_attributes, :label, :path, :provider_md5, :provider_sha1, :relative_path, :mime_type_order
30
+ attr_accessor :file_attributes, :label, :path, :provider_md5, :relative_path, :mime_type_order
31
31
 
32
32
  VALID_MIMETYPE_METHODS = %i[override exif file extension].freeze
33
33
 
@@ -39,7 +39,6 @@ module Assembly
39
39
  # @option params [String] :label a resource label (files bundled together will just get the first
40
40
  # file's label attribute if set)
41
41
  # @option params [String] :provider_md5 pre-computed MD5 checksum
42
- # @option params [String] :provider_sha1 pre-computed SHA1 checksum
43
42
  # @option params [String] :relative_path if you want the file ids in the content metadata it can be set,
44
43
  # otherwise content metadata will get the full path
45
44
  # @option params [Array] :mime_type_order can be set to the order in which you want mimetypes to be determined
@@ -55,7 +54,6 @@ module Assembly
55
54
  @file_attributes = params[:file_attributes]
56
55
  @relative_path = params[:relative_path]
57
56
  @provider_md5 = params[:provider_md5]
58
- @provider_sha1 = params[:provider_sha1]
59
57
  @mime_type_order = params[:mime_type_order] || default_mime_type_order
60
58
  end
61
59
 
@@ -90,13 +88,13 @@ module Assembly
90
88
  # @return [String] computed md5 checksum
91
89
  def md5
92
90
  check_for_file unless @md5
93
- @md5 ||= Digest::MD5.file(path).hexdigest
91
+ @md5 ||= Digest(:MD5).file(path).hexdigest
94
92
  end
95
93
 
96
94
  # @return [String] computed sha1 checksum
97
95
  def sha1
98
96
  check_for_file unless @sha1
99
- @sha1 ||= Digest::SHA1.file(path).hexdigest
97
+ @sha1 ||= Digest(:SHA1).file(path).hexdigest
100
98
  end
101
99
 
102
100
  # Returns mimetype information for the current file based on the ordering set in default_mime_type_order
@@ -18,7 +18,8 @@ module Assembly
18
18
  # the unix file system command returns the mapping format is "extension with period: returned mimetype",
19
19
  # e.g. for any .json file, you will always get `application/json`
20
20
  OVERRIDE_MIMETYPES = {
21
- '.json': 'application/json'
21
+ '.json': 'application/json',
22
+ '.vtt': 'text/vtt'
22
23
  }.freeze
23
24
  end
24
25