diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index a0119f0..78a8bea 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ruby-version: ['2.5', '2.6', '2.7', '3.0', truffleruby-head] + ruby-version: ['2.6', '2.7', '3.0', truffleruby-head] steps: - uses: actions/checkout@v2 diff --git a/.rubocop.yml b/.rubocop.yml index a2ed66d..4e6ba52 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,7 +1,7 @@ --- AllCops: NewCops: enable - TargetRubyVersion: 2.5 + TargetRubyVersion: 2.6 Naming/FileName: Enabled: true diff --git a/Gemfile.lock b/Gemfile.lock index f7f733b..b3f52eb 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,53 +1,53 @@ PATH remote: . specs: - asciidoctor-plantuml (0.0.15) - asciidoctor (>= 1.5.6, < 3.0.0) + asciidoctor-plantuml (0.0.16) + asciidoctor (>= 2.0.17, < 3.0.0) GEM remote: https://rubygems.org/ specs: - asciidoctor (2.0.12) - ast (2.4.1) - mini_portile2 (2.6.1) - nokogiri (1.12.5) - mini_portile2 (~> 2.6.1) + asciidoctor (2.0.17) + ast (2.4.2) + mini_portile2 (2.8.0) + nokogiri (1.13.4) + mini_portile2 (~> 2.8.0) racc (~> 1.4) - parallel (1.20.1) - parser (3.0.0.0) + parallel (1.22.1) + parser (3.1.2.0) ast (~> 2.4.1) - power_assert (1.1.4) - racc (1.5.2) - rainbow (3.0.0) - rake (13.0.1) - regexp_parser (2.0.3) + power_assert (2.0.1) + racc (1.6.0) + rainbow (3.1.1) + rake (13.0.6) + regexp_parser (2.3.1) rexml (3.2.5) - rubocop (1.8.0) + rubocop (1.28.2) parallel (~> 1.10) - parser (>= 3.0.0.0) + parser (>= 3.1.0.0) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml - rubocop-ast (>= 1.2.0, < 2.0) + rubocop-ast (>= 1.17.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.4.0) - parser (>= 2.7.1.5) + rubocop-ast (1.17.0) + parser (>= 3.1.1.0) ruby-progressbar (1.11.0) - test-unit (3.3.3) + test-unit (3.5.3) power_assert - unicode-display_width (2.0.0) + unicode-display_width (2.1.0) PLATFORMS ruby DEPENDENCIES asciidoctor-plantuml! - bundler (>= 2.2.10) - nokogiri (~> 1.11) + bundler (~> 2.2) + nokogiri (~> 1.13.4) rake (~> 13.0) - rubocop (~> 1.7) - test-unit (~> 3.3) + rubocop (~> 1.28) + test-unit (~> 3.5) BUNDLED WITH 2.2.27 diff --git a/asciidoctor-plantuml.gemspec b/asciidoctor-plantuml.gemspec index 22e52ce..0dd8aee 100644 --- a/asciidoctor-plantuml.gemspec +++ b/asciidoctor-plantuml.gemspec @@ -5,26 +5,27 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'asciidoctor_plantuml/version' Gem::Specification.new do |s| - s.name = 'asciidoctor-plantuml' - s.version = Asciidoctor::PlantUML::VERSION - s.authors = ['Horacio Sanson'] - s.email = ['hsanson@gmail.com'] - s.description = 'Asciidoctor PlantUML extension' - s.summary = 'Asciidoctor support for PlantUML diagrams.' - s.platform = Gem::Platform::RUBY - s.homepage = 'https://github.com/hsanson/asciidoctor-plantuml' - s.license = 'MIT' + s.name = 'asciidoctor-plantuml' + s.version = Asciidoctor::PlantUML::VERSION + s.authors = ['Horacio Sanson'] + s.email = ['hsanson@gmail.com'] + s.description = 'Asciidoctor PlantUML extension' + s.summary = 'Asciidoctor support for PlantUML diagrams.' + s.platform = Gem::Platform::RUBY + s.homepage = 'https://github.com/hsanson/asciidoctor-plantuml' + s.license = 'MIT' s.files = `git ls-files -z -- */* {LICENSE,README,Rakefile}*`.split "\x0" - s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) } - s.test_files = s.files.grep(%r{^(test|spec|features)/}) + s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) } + s.test_files = s.files.grep(%r{^(test|spec|features)/}) s.require_paths = ['lib'] - s.required_ruby_version = '>= 2.5' - s.add_development_dependency 'bundler', '>= 2.2.10' - s.add_development_dependency 'nokogiri', '~> 1.11' + s.required_ruby_version = '>= 2.6' + s.add_development_dependency 'bundler', '~> 2.2' + s.add_development_dependency 'nokogiri', '~> 1.13.4' s.add_development_dependency 'rake', '~> 13.0' - s.add_development_dependency 'rubocop', '~> 1.7' - s.add_development_dependency 'test-unit', '~> 3.3' - s.add_runtime_dependency 'asciidoctor', '>= 1.5.6', '< 3.0.0' + s.add_development_dependency 'rubocop', '~> 1.28' + s.add_development_dependency 'test-unit', '~> 3.5' + s.add_runtime_dependency 'asciidoctor', '>= 2.0.17', '< 3.0.0' + s.metadata['rubygems_mfa_required'] = 'true' end diff --git a/lib/asciidoctor_plantuml/plantuml.rb b/lib/asciidoctor_plantuml/plantuml.rb index f101473..9077e60 100644 --- a/lib/asciidoctor_plantuml/plantuml.rb +++ b/lib/asciidoctor_plantuml/plantuml.rb @@ -10,8 +10,8 @@ module Asciidoctor module PlantUml # PlantUML Configuration class Configuration - DEFAULT_URL = ENV['PLANTUML_URL'] || '' - DEFAULT_ENCODING = ENV['PLANTUML_ENCODING'] || 'legacy' + DEFAULT_URL = ENV.fetch('PLANTUML_URL', '') + DEFAULT_ENCODING = ENV.fetch('PLANTUML_ENCODING', 'legacy') attr_accessor :url, :txt_enable, :svg_enable, :png_enable, :encoding @@ -246,7 +246,7 @@ def join_paths(*paths, separator: '/') end def expand_path(path, current, last, separator) - path = path[1..-1] if path.start_with?(separator) && current.zero? + path = path[1..] if path.start_with?(separator) && current.zero? path = [path, separator] unless path.end_with?(separator) || current == last diff --git a/lib/asciidoctor_plantuml/version.rb b/lib/asciidoctor_plantuml/version.rb index ea1e7d6..ee35038 100644 --- a/lib/asciidoctor_plantuml/version.rb +++ b/lib/asciidoctor_plantuml/version.rb @@ -2,6 +2,6 @@ module Asciidoctor module PlantUML - VERSION = '0.0.15' + VERSION = '0.0.16' end end