Skip to content

Commit

Permalink
Update dependencies.
Browse files Browse the repository at this point in the history
  • Loading branch information
vkononov committed Dec 30, 2020
1 parent 0bd5a6e commit 2df6ba8
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 12 deletions.
6 changes: 6 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
require:
- rubocop-minitest
- rubocop-performance
- rubocop-rake

AllCops:
NewCops: enable
Exclude:
- .git/**/*

Expand All @@ -16,6 +19,9 @@ Layout/LineLength:
Layout/SpaceInsideHashLiteralBraces:
Enabled: false

Metrics/MethodLength:
Max: 12

Naming/AccessorMethodName:
Enabled: false

Expand Down
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ sudo: false
language: ruby
cache: bundler
rvm:
- 2.6.4
- 3.0.0
jdk:
- openjdk8
before_install:
- gem install bundler -v 2.0.2
- gem install bundler
5 changes: 4 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
require 'bundler/gem_tasks'
require 'rake/testtask'
require 'rubocop/rake_task'

Rake::TestTask.new(:test) do |t|
t.libs << 'test'
t.libs << 'lib'
t.test_files = FileList['test/**/*_test.rb']
end

task default: :test
RuboCop::RakeTask.new

task default: %i[test rubocop]
2 changes: 1 addition & 1 deletion example/run.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@
pdf.save_as 'output.flat.pdf', flatten: true

# closing the document
pdf.close
pdf.close
12 changes: 9 additions & 3 deletions fillable-pdf.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Gem::Specification.new do |spec|
spec.description = 'FillablePDF is an extremely simple and lightweight utility that bridges iText and Ruby in order to fill out fillable PDF forms or extract field values from previously filled out PDF forms.'
spec.homepage = 'https://github.com/vkononov/fillable-pdf'
spec.license = 'MIT'
spec.required_ruby_version = Gem::Requirement.new('>= 2.4.0')

spec.files = Dir.chdir(File.expand_path(__dir__)) do
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(example|test|spec|features)/}) }
Expand All @@ -20,9 +21,14 @@ Gem::Specification.new do |spec|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = %w[ext lib]

spec.add_development_dependency 'bundler', '~> 2.0'
spec.add_development_dependency 'minitest', '~> 5.0'
spec.add_development_dependency 'rake', '~> 10.0'
spec.add_development_dependency 'bundler'
spec.add_development_dependency 'minitest'
spec.add_development_dependency 'rake'
spec.add_development_dependency 'rubocop'
spec.add_development_dependency 'rubocop-md'
spec.add_development_dependency 'rubocop-minitest'
spec.add_development_dependency 'rubocop-performance'
spec.add_development_dependency 'rubocop-rake'

spec.add_runtime_dependency 'rjb', '~> 1.6'
end
4 changes: 2 additions & 2 deletions lib/field.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ class Field
# between these constants and tries to create the same constant ("A") for both, which causes
# an annoying warning "already initialized constant Rjb::Com_itextpdf_kernel_pdf_PdfName::A".
# As long as RJB has not fixed this issue, this warning will remain suppressed.
suppress_warnings { PDF_NAME = Rjb.import('com.itextpdf.kernel.pdf.PdfName') }
suppress_warnings { PDF_NAME = Rjb.import('com.itextpdf.kernel.pdf.PdfName') } # rubocop:disable Lint/ConstantDefinitionInBlock

BUTTON = PDF_NAME.Btn.toString
CHOICE = PDF_NAME.Ch.toString
SIGNATURE = PDF_NAME.Sig.toString
TEXT = PDF_NAME.Tx.toString
end
end
4 changes: 2 additions & 2 deletions lib/fillable-pdf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ def initialize(file_path)
@pdf_doc = PDF_DOCUMENT.new @pdf_reader, @pdf_writer
@pdf_form = PDF_ACRO_FORM.getAcroForm(@pdf_doc, true)
@form_fields = @pdf_form.getFormFields
rescue StandardError => ex
raise "#{ex.message} (input file may be corrupt, incompatible, or may not have any forms)"
rescue StandardError => e
raise "#{e.message} (input file may be corrupt, incompatible, or may not have any forms)"
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/kernel.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ def suppress_warnings
$VERBOSE = original_verbosity
result
end
end
end

0 comments on commit 2df6ba8

Please sign in to comment.