From 6bb730e3059e4fea7d864bdba72d27df0dc1b0ee Mon Sep 17 00:00:00 2001 From: Nicolai Reuschling Date: Wed, 25 Jan 2017 09:21:03 +0100 Subject: [PATCH 01/10] updated to conform to latest RuboCop version --- indoctrinatr-tools.gemspec | 8 ++++---- lib/indoctrinatr/tools/content_for_tex_files.rb | 2 +- lib/indoctrinatr/tools/template_pack_helpers.rb | 2 +- spec/redcloth_latex_formatter_patch/patch_spec.rb | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/indoctrinatr-tools.gemspec b/indoctrinatr-tools.gemspec index 5bc1ec6..e1b8788 100644 --- a/indoctrinatr-tools.gemspec +++ b/indoctrinatr-tools.gemspec @@ -3,7 +3,7 @@ lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'indoctrinatr/tools/version' -Gem::Specification.new do |spec| +Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength spec.name = 'indoctrinatr-tools' spec.version = Indoctrinatr::Tools::VERSION spec.authors = ['Nicolai Reuschling', 'Luka Lüdicke'] @@ -20,12 +20,12 @@ Gem::Specification.new do |spec| spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ['lib'] - spec.add_development_dependency 'bundler', '~> 1.13' - spec.add_development_dependency 'rake', '~> 11.2' + spec.add_development_dependency 'bundler', '~> 1.14' + spec.add_development_dependency 'rake', '~> 12.0' spec.add_development_dependency 'rspec', '~> 3.5' spec.add_development_dependency 'cucumber', '~> 2.4' spec.add_development_dependency 'aruba', '~> 0.14' - spec.add_development_dependency 'rubocop', '~> 0.42' + spec.add_development_dependency 'rubocop', '~> 0.47' spec.add_development_dependency 'pry', '~> 0.10' spec.add_development_dependency 'coveralls', '~> 0.8' diff --git a/lib/indoctrinatr/tools/content_for_tex_files.rb b/lib/indoctrinatr/tools/content_for_tex_files.rb index d555337..0003db3 100644 --- a/lib/indoctrinatr/tools/content_for_tex_files.rb +++ b/lib/indoctrinatr/tools/content_for_tex_files.rb @@ -19,7 +19,7 @@ def retrieve_binding end def customized_output_file_name - @_customized_output_file_name ||= eval('"' + @_output_file_name + '"') # rubocop:disable Lint/Eval + @_customized_output_file_name ||= eval('"' + @_output_file_name + '"') # rubocop:disable Security/Eval end def template_asset_path diff --git a/lib/indoctrinatr/tools/template_pack_helpers.rb b/lib/indoctrinatr/tools/template_pack_helpers.rb index 82fac31..f4709a5 100644 --- a/lib/indoctrinatr/tools/template_pack_helpers.rb +++ b/lib/indoctrinatr/tools/template_pack_helpers.rb @@ -35,7 +35,7 @@ def pdf_with_default_values_file_path configuration # rubocop:disable Metrics/Ab if default_values.customized_output_file_name == default_values.default_file_name Pathname.new(Dir.pwd).join pack_documentation_examples_dir_path + default_values.customized_output_file_name else - Pathname.new(Dir.pwd).join pack_documentation_examples_dir_path + eval('"' + default_values.output_file_name + '"') # rubocop:disable Lint/Eval + Pathname.new(Dir.pwd).join pack_documentation_examples_dir_path + eval('"' + default_values.output_file_name + '"') # rubocop:disable Security/Eval # usage of eval to execute the interpolation of a custom filename string with interpolation - e.g. a filename with the current date end end diff --git a/spec/redcloth_latex_formatter_patch/patch_spec.rb b/spec/redcloth_latex_formatter_patch/patch_spec.rb index 28b3687..9fae4b3 100644 --- a/spec/redcloth_latex_formatter_patch/patch_spec.rb +++ b/spec/redcloth_latex_formatter_patch/patch_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' require 'redcloth_latex_formatter_patch/patch' -describe 'patches for RedCloth::LATEX::Formatter' do +describe 'patches for RedCloth::LATEX::Formatter' do # rubocop:disable Metrics/BlockLength it 'tranforms a h1. headline to LaTeX chapter notation' do text = 'h1. Headline' expect(RedCloth.new(text).to_latex).to eq "\\chapter{Headline}\n\n" From 7aadea10c8855f33f026f711c1df995f9b15d972 Mon Sep 17 00:00:00 2001 From: Nicolai Reuschling Date: Wed, 25 Jan 2017 09:24:11 +0100 Subject: [PATCH 02/10] updated Travis CI configuration to run RuboCop --- .travis.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 368213c..04a5b92 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,15 +1,16 @@ -sudo: true +sudo: false language: ruby rvm: + - '2.4' - '2.3' - '2.2' - '2.1' cache: - bundler - - apt + before_install: - - sudo apt-get update && sudo wget https://github.com/scottkosty/install-tl-ubuntu/raw/master/install-tl-ubuntu && sudo chmod +x ./install-tl-ubuntu && sudo ./install-tl-ubuntu - - gem install bundler -v 1.10.6 + - gem install bundler --version 1.14.3 --no-document + script: + - bundle exec rubocop - bundle exec indoctrinatr demo - - bundle exec rake test_with_coveralls From 9edb6f0b3b94cfb8d243a0726281b46cd225b838 Mon Sep 17 00:00:00 2001 From: Nicolai Reuschling Date: Wed, 25 Jan 2017 09:30:06 +0100 Subject: [PATCH 03/10] show RuboCop version during build --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 04a5b92..8db96e6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,5 +12,6 @@ before_install: - gem install bundler --version 1.14.3 --no-document script: + - bundle exec rubocop --version - bundle exec rubocop - - bundle exec indoctrinatr demo + - bundle exec indoctrinatr new demo From 9468713a00970dc7dc5ed97cf34fc270976b1b7a Mon Sep 17 00:00:00 2001 From: Nicolai Reuschling Date: Wed, 25 Jan 2017 09:32:16 +0100 Subject: [PATCH 04/10] exclude vendor directory --- .rubocop.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.rubocop.yml b/.rubocop.yml index 91ccb8e..3d3111b 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,6 +1,7 @@ AllCops: Exclude: - tmp/**/* + - vendor/**/* Metrics/LineLength: Max: 240 Style/MethodDefParentheses: From d8bd181ff02f56dac996d8ec1a0d31579f40c812 Mon Sep 17 00:00:00 2001 From: Nicolai Reuschling Date: Wed, 25 Jan 2017 09:41:59 +0100 Subject: [PATCH 05/10] added precise version numbers for Travis CI RVM to pick up --- .travis.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8db96e6..4570a5b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,10 @@ sudo: false language: ruby rvm: - - '2.4' - - '2.3' - - '2.2' - - '2.1' + - '2.4.0' + - '2.3.3' + - '2.2.6' + - '2.1.10' cache: - bundler From ea3433f3bb6c8cfe8d984cc6877387bd80ef2ce4 Mon Sep 17 00:00:00 2001 From: Nicolai Reuschling Date: Wed, 25 Jan 2017 09:44:18 +0100 Subject: [PATCH 06/10] removed recent Ruby versions --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4570a5b..85d0277 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,6 @@ sudo: false language: ruby rvm: - - '2.4.0' - - '2.3.3' - '2.2.6' - '2.1.10' cache: From 623f85e6538cb7fff99d09e885049d821dc71812 Mon Sep 17 00:00:00 2001 From: Nicolai Reuschling Date: Fri, 7 Apr 2017 11:30:27 +0200 Subject: [PATCH 07/10] updated dependencies, Ruby syntax --- .rubocop.yml | 2 ++ .rvmrc | 2 +- .travis.yml | 12 +++++++----- LICENSE | 2 +- indoctrinatr-tools.gemspec | 10 ++++++---- lib/indoctrinatr/tools/directory_helpers.rb | 2 +- lib/indoctrinatr/tools/field_name_values.rb | 2 +- .../tools/template_pack_error_checker.rb | 4 ++-- .../templates/configuration_file_spec.rb | 4 ++-- spec/indoctrinatr/templates/tex_file_spec.rb | 4 ++-- spec/indoctrinatr/tools/textile_support_spec.rb | 2 +- spec/indoctrinatr/tools/version_spec.rb | 2 +- spec/redcloth_latex_formatter_patch/patch_spec.rb | 6 +----- 13 files changed, 28 insertions(+), 26 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 3d3111b..f14f460 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,3 +1,5 @@ +require: rubocop-rspec + AllCops: Exclude: - tmp/**/* diff --git a/.rvmrc b/.rvmrc index 65c7858..aee1aab 100644 --- a/.rvmrc +++ b/.rvmrc @@ -1,4 +1,4 @@ -rvm use 2.1.9 +rvm use 2.3.4 alias brake='bundle exec' alias rubocop='bundle exec rubocop' diff --git a/.travis.yml b/.travis.yml index 85d0277..aa962c8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,15 +1,17 @@ sudo: false language: ruby rvm: - - '2.2.6' + - '2.4.1' + - '2.3.4' + - '2.2.7' - '2.1.10' -cache: - - bundler + - '2.1.9' +cache: bundler before_install: - - gem install bundler --version 1.14.3 --no-document + - gem install bundler --no-document script: - bundle exec rubocop --version - - bundle exec rubocop + - bundle exec rubocop --display-cop-names --extra-details - bundle exec indoctrinatr new demo diff --git a/LICENSE b/LICENSE index 21ba047..d3b15d4 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2014 Indoctrinatr Development Team +Copyright (c) 2014-2017 Indoctrinatr Development Team, dkd Internet Service GmbH, Frankfurt am Main Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/indoctrinatr-tools.gemspec b/indoctrinatr-tools.gemspec index e1b8788..02239c3 100644 --- a/indoctrinatr-tools.gemspec +++ b/indoctrinatr-tools.gemspec @@ -1,4 +1,5 @@ # coding: utf-8 + lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'indoctrinatr/tools/version' @@ -13,7 +14,7 @@ Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength spec.homepage = '' spec.license = 'MIT' - spec.required_ruby_version = '~> 2.0' + spec.required_ruby_version = '~> 2.3' spec.files = `git ls-files -z`.split("\x0") spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } @@ -25,12 +26,13 @@ Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength spec.add_development_dependency 'rspec', '~> 3.5' spec.add_development_dependency 'cucumber', '~> 2.4' spec.add_development_dependency 'aruba', '~> 0.14' - spec.add_development_dependency 'rubocop', '~> 0.47' + spec.add_development_dependency 'rubocop', '~> 0.48' + spec.add_development_dependency 'rubocop-rspec', '~> 1.15' spec.add_development_dependency 'pry', '~> 0.10' spec.add_development_dependency 'coveralls', '~> 0.8' - spec.add_dependency 'gli', '~> 2.12' - spec.add_dependency 'rubyzip', '~> 1.1' + spec.add_dependency 'gli', '~> 2.16' + spec.add_dependency 'rubyzip', '~> 1.2' spec.add_dependency 'erubis', '~> 2.7' spec.add_dependency 'to_latex', '~> 0.5' spec.add_dependency 'RedCloth', '~> 4.3' diff --git a/lib/indoctrinatr/tools/directory_helpers.rb b/lib/indoctrinatr/tools/directory_helpers.rb index e4a8829..f3acd4e 100644 --- a/lib/indoctrinatr/tools/directory_helpers.rb +++ b/lib/indoctrinatr/tools/directory_helpers.rb @@ -9,7 +9,7 @@ def print_dirtree_style directory = '.' end end - def list_files_of_type directory = '.', types = %w(erb rb yaml sty tex) # default file types for template docs + def list_files_of_type directory = '.', types = %w[erb rb yaml sty tex] # default file types for template docs # found and modified from http://stackoverflow.com/a/3504307/1796645 Dir.glob("#{directory}/**/*.{#{types.join(',')}}") # recursively list files of type in types array end diff --git a/lib/indoctrinatr/tools/field_name_values.rb b/lib/indoctrinatr/tools/field_name_values.rb index 5091564..c305dd5 100644 --- a/lib/indoctrinatr/tools/field_name_values.rb +++ b/lib/indoctrinatr/tools/field_name_values.rb @@ -5,7 +5,7 @@ module Tools # This class defines the content for a document that has the field names as content. class FieldNameValues < ContentForTexFiles # TODO: extensive list of possibilities - PICTURE_FILE_ENDINGS = %w(.png .jpeg .jpg .bmp .gif .pdf).freeze + PICTURE_FILE_ENDINGS = %w[.png .jpeg .jpg .bmp .gif .pdf].freeze def _field_names_as_values # rubocop:disable Metrics/AbcSize @_configuration.attributes_as_hashes_in_array.each do |attribute_hash| # Usage of \textless to avoid issues with the < > characters. diff --git a/lib/indoctrinatr/tools/template_pack_error_checker.rb b/lib/indoctrinatr/tools/template_pack_error_checker.rb index 479bcee..cd3ca97 100644 --- a/lib/indoctrinatr/tools/template_pack_error_checker.rb +++ b/lib/indoctrinatr/tools/template_pack_error_checker.rb @@ -7,8 +7,8 @@ class TemplatePackErrorChecker # class wide constants # needs to match indoctrinatr's TemplateField model - VALID_PRESENTATIONS = %w(text textarea checkbox radiobutton dropdown date range file).freeze - REQUIRES_AVAILABLE_OPTIONS = %w(dropdown checkbox radiobutton).freeze + VALID_PRESENTATIONS = %w[text textarea checkbox radiobutton dropdown date range file].freeze + REQUIRES_AVAILABLE_OPTIONS = %w[dropdown checkbox radiobutton].freeze attr_accessor :template_pack_name, :config_file def initialize template_pack_name diff --git a/spec/indoctrinatr/templates/configuration_file_spec.rb b/spec/indoctrinatr/templates/configuration_file_spec.rb index 5f979b9..012803a 100644 --- a/spec/indoctrinatr/templates/configuration_file_spec.rb +++ b/spec/indoctrinatr/templates/configuration_file_spec.rb @@ -1,8 +1,8 @@ require 'spec_helper' require 'pathname' -describe 'configuration.yaml' do - it 'should exist' do +context 'configuration.yaml' do + it 'exists' do configuration_file = Pathname.new(__FILE__).join '..', '..', '..', '..', 'lib', 'indoctrinatr', 'templates', 'configuration.yaml' expect(File.exist?(configuration_file)).to eq true end diff --git a/spec/indoctrinatr/templates/tex_file_spec.rb b/spec/indoctrinatr/templates/tex_file_spec.rb index a63eb6e..13cb251 100644 --- a/spec/indoctrinatr/templates/tex_file_spec.rb +++ b/spec/indoctrinatr/templates/tex_file_spec.rb @@ -1,8 +1,8 @@ require 'spec_helper' require 'pathname' -describe 'template.tex.erb' do - it 'should exist' do +context 'template.tex.erb' do + it 'exists' do template_file = Pathname.new(__FILE__).join '..', '..', '..', '..', 'lib', 'indoctrinatr', 'templates', 'template.tex.erb' expect(File.exist?(template_file)).to eq true end diff --git a/spec/indoctrinatr/tools/textile_support_spec.rb b/spec/indoctrinatr/tools/textile_support_spec.rb index da151ec..e2989c7 100644 --- a/spec/indoctrinatr/tools/textile_support_spec.rb +++ b/spec/indoctrinatr/tools/textile_support_spec.rb @@ -2,7 +2,7 @@ require 'indoctrinatr/tools/default_values' require 'indoctrinatr/tools/template_pack_configuration' -describe "support for Textile with 'textilize' function" do +context "support for Textile with 'textilize' function" do let(:configuration) do c = Indoctrinatr::Tools::TemplatePackConfiguration.new c.attributes_as_hashes_in_array = [] diff --git a/spec/indoctrinatr/tools/version_spec.rb b/spec/indoctrinatr/tools/version_spec.rb index db359c9..42ef917 100644 --- a/spec/indoctrinatr/tools/version_spec.rb +++ b/spec/indoctrinatr/tools/version_spec.rb @@ -3,6 +3,6 @@ describe Indoctrinatr::Tools do it 'defines a VERSION constant' do - expect(Indoctrinatr::Tools::VERSION).to eq '0.13.0' + expect(Indoctrinatr::Tools::VERSION).to eq '0.14.0' end end diff --git a/spec/redcloth_latex_formatter_patch/patch_spec.rb b/spec/redcloth_latex_formatter_patch/patch_spec.rb index 9fae4b3..8426fe4 100644 --- a/spec/redcloth_latex_formatter_patch/patch_spec.rb +++ b/spec/redcloth_latex_formatter_patch/patch_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' require 'redcloth_latex_formatter_patch/patch' -describe 'patches for RedCloth::LATEX::Formatter' do # rubocop:disable Metrics/BlockLength +context 'patches for RedCloth::LATEX::Formatter' do it 'tranforms a h1. headline to LaTeX chapter notation' do text = 'h1. Headline' expect(RedCloth.new(text).to_latex).to eq "\\chapter{Headline}\n\n" @@ -31,8 +31,4 @@ it 'transforms -text- to to LaTeX \st{}' do expect(RedCloth.new('-no no no-').to_latex).to eq "\\st{no no no}\n\n" end - - it 'transforms *text* to to LaTeX \st{}' do - expect(RedCloth.new('-no no no-').to_latex).to eq "\\st{no no no}\n\n" - end end From 5241a80bc87e5205c0816b659af4691c301e1c59 Mon Sep 17 00:00:00 2001 From: Nicolai Reuschling Date: Fri, 7 Apr 2017 11:36:19 +0200 Subject: [PATCH 08/10] dropped support for Ruby v2.1 --- .travis.yml | 2 -- indoctrinatr-tools.gemspec | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index aa962c8..727761b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,8 +4,6 @@ rvm: - '2.4.1' - '2.3.4' - '2.2.7' - - '2.1.10' - - '2.1.9' cache: bundler before_install: diff --git a/indoctrinatr-tools.gemspec b/indoctrinatr-tools.gemspec index 02239c3..0a0423c 100644 --- a/indoctrinatr-tools.gemspec +++ b/indoctrinatr-tools.gemspec @@ -14,7 +14,7 @@ Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength spec.homepage = '' spec.license = 'MIT' - spec.required_ruby_version = '~> 2.3' + spec.required_ruby_version = '~> 2.2' spec.files = `git ls-files -z`.split("\x0") spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } From b132a7c31aff48d18f2d9287b6c556874766fc1c Mon Sep 17 00:00:00 2001 From: Nicolai Reuschling Date: Sun, 16 Apr 2017 14:58:28 +0200 Subject: [PATCH 09/10] removed obsolete .rvmrc file, move intent into .rubocop.yml --- .rubocop.yml | 2 ++ .rvmrc | 5 ----- 2 files changed, 2 insertions(+), 5 deletions(-) delete mode 100644 .rvmrc diff --git a/.rubocop.yml b/.rubocop.yml index f14f460..52b01eb 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,6 +1,8 @@ require: rubocop-rspec AllCops: +AllCops: + TargetRubyVersion: 2.2 Exclude: - tmp/**/* - vendor/**/* diff --git a/.rvmrc b/.rvmrc deleted file mode 100644 index aee1aab..0000000 --- a/.rvmrc +++ /dev/null @@ -1,5 +0,0 @@ -rvm use 2.3.4 - -alias brake='bundle exec' -alias rubocop='bundle exec rubocop' -alias cucumber='brake cucumber' From 24d0970686e4fdbaf1dcbe5d020e8509baaf1327 Mon Sep 17 00:00:00 2001 From: Nicolai Reuschling Date: Sun, 16 Apr 2017 15:05:03 +0200 Subject: [PATCH 10/10] updated relevant files for release of v0.15.0 --- CHANGELOG.md | 7 +++++++ features/version.feature | 2 +- lib/indoctrinatr/tools/version.rb | 2 +- spec/indoctrinatr/tools/version_spec.rb | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ad991b..407ee12 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # indoctrinatr-tools +## v0.15.0 (2017-04-16) + +### changes + +* updated dependencies +* removed support for Ruby v2.1 + ## v0.14.0 (2016-09-14) ### changes diff --git a/features/version.feature b/features/version.feature index f93b39b..fbb12d4 100644 --- a/features/version.feature +++ b/features/version.feature @@ -2,4 +2,4 @@ Feature: Running the "version" command Scenario: When I successfully run `indoctrinatr version` - Then the output should contain "0.13.0" + Then the output should contain "0.15.0" diff --git a/lib/indoctrinatr/tools/version.rb b/lib/indoctrinatr/tools/version.rb index f066144..249d689 100644 --- a/lib/indoctrinatr/tools/version.rb +++ b/lib/indoctrinatr/tools/version.rb @@ -1,5 +1,5 @@ module Indoctrinatr module Tools - VERSION = '0.14.0'.freeze + VERSION = '0.15.0'.freeze end end diff --git a/spec/indoctrinatr/tools/version_spec.rb b/spec/indoctrinatr/tools/version_spec.rb index 42ef917..f0a3510 100644 --- a/spec/indoctrinatr/tools/version_spec.rb +++ b/spec/indoctrinatr/tools/version_spec.rb @@ -3,6 +3,6 @@ describe Indoctrinatr::Tools do it 'defines a VERSION constant' do - expect(Indoctrinatr::Tools::VERSION).to eq '0.14.0' + expect(Indoctrinatr::Tools::VERSION).to eq '0.15.0' end end