diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 56d38f0..c5bacb1 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -7,17 +7,19 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ruby: [ '2.5', '2.6.x', '2.x'] - name: Test gem in ruby version ${{ matrix.ruby }} + ruby: [ '2.5', '2.6.5'] + name: Test gem in ruby v${{ matrix.ruby }} + container: + image: ruby:${{ matrix.ruby }}-alpine steps: - uses: actions/checkout@v1 - - name: Set up Ruby ${{ matrix.ruby }} - uses: actions/setup-ruby@v1 - with: - ruby-version: ${{ matrix.ruby }} + - name: Install make and gcc + run: | + apk add --update make + apk add build-base - name: Build with dependencies run: | - gem install bundler -v 1.17 + gem install bundler -v 2.1 bundle install - name: Test with rspec run: | diff --git a/.gitignore b/.gitignore index 46f276e..4f9f3f1 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ /spec/reports/ /tmp/ .DS_Store +/.tool-versions/ # Gemfile.lock should not be under version control # https://yehudakatz.com/2010/12/16/clarifying-the-roles-of-the-gemspec-and-gemfile/ diff --git a/.rubocop.yml b/.rubocop.yml index cc63f2d..a9bf9b5 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,10 +1,13 @@ +AllCops: + TargetRubyVersion: 2.5 + Style/Documentation: Enabled: false Style/FrozenStringLiteralComment: Enabled: false -Metrics/LineLength: +Layout/LineLength: Max: 120 IgnoreCopDirectives: true diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 4b9a1f6..7cfb717 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2017-04-18 13:12:12 -0700 using RuboCop version 0.48.1. +# on 2019-12-18 15:48:47 -0800 using RuboCop version 0.78.0. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new @@ -8,14 +8,9 @@ # Offense count: 2 Metrics/AbcSize: - Max: 29 - -# Offense count: 3 -# Configuration parameters: CountComments. -Metrics/MethodLength: Max: 19 -# Offense count: 1 -# Configuration parameters: CountComments. -Metrics/ModuleLength: - Max: 111 +# Offense count: 2 +# Configuration parameters: CountComments, ExcludedMethods. +Metrics/MethodLength: + Max: 18 \ No newline at end of file diff --git a/.ruby-version b/.ruby-version index aedc15b..57cf282 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.5.3 +2.6.5 diff --git a/.tool-versions b/.tool-versions new file mode 100644 index 0000000..7811505 --- /dev/null +++ b/.tool-versions @@ -0,0 +1 @@ +ruby 2.6.5 diff --git a/Dockerfile b/Dockerfile index ef33fc6..2bdc418 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ruby:2.5-alpine +FROM ruby:2.6.5-alpine RUN mkdir -p /usr/src/app WORKDIR /usr/src/app diff --git a/spec/vrt/node_spec.rb b/spec/vrt/node_spec.rb index 4ff5f46..7649687 100644 --- a/spec/vrt/node_spec.rb +++ b/spec/vrt/node_spec.rb @@ -78,9 +78,9 @@ context 'cwe' do it 'has the exepected (concatenated) CWE IDs' do - expect(mappings[:cwe]).to eq [ - 'CWE-942', - 'CWE-933' + expect(mappings[:cwe]).to eq %w[ + CWE-942 + CWE-933 ] end end diff --git a/vrt.gemspec b/vrt.gemspec index de64ae4..c89102f 100644 --- a/vrt.gemspec +++ b/vrt.gemspec @@ -17,10 +17,9 @@ Gem::Specification.new do |spec| spec.require_paths = ['lib'] spec.required_ruby_version = '>= 2.5' - spec.add_development_dependency 'bundler', '~> 1.14' - spec.add_development_dependency 'pry', '~> 0.11' - spec.add_development_dependency 'rake', '~> 12.3' - spec.add_development_dependency 'rspec', '~> 3.6' - # TODO: investigate why rubocop's jaro-winkler dependency fails to install in our alpine linux image - spec.add_development_dependency 'rubocop', '0.56.0' + spec.add_development_dependency 'bundler', '~> 2.1' + spec.add_development_dependency 'pry', '~> 0.12' + spec.add_development_dependency 'rake', '~> 13.0' + spec.add_development_dependency 'rspec', '~> 3.9' + spec.add_development_dependency 'rubocop', '~> 0.78' end