diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 522b986..593ec00 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ruby: ['2.5', '2.6', '2.7'] + ruby: ['3.1', '3.2', '3.3'] name: Test ruby v${{ matrix.ruby }} support steps: - uses: actions/checkout@v1 diff --git a/.github/workflows/publish-gem.yml b/.github/workflows/publish-gem.yml index ec0a968..50f619c 100644 --- a/.github/workflows/publish-gem.yml +++ b/.github/workflows/publish-gem.yml @@ -10,11 +10,11 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Set up Ruby 2.7 - uses: actions/setup-ruby@v1 + - uses: actions/checkout@v4 + - name: Set up Ruby 3.1 + uses: ruby/setup-ruby@v1 with: - ruby-version: 2.7.x + ruby-version: '3.1.x' - name: Publish to GPR run: | mkdir -p $HOME/.gem diff --git a/.rubocop.yml b/.rubocop.yml index 415a919..74860c7 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,5 +1,6 @@ AllCops: - TargetRubyVersion: 2.5 + TargetRubyVersion: 3.1 + NewCops: enable Style/Documentation: Enabled: false @@ -7,12 +8,11 @@ Style/Documentation: Style/FrozenStringLiteralComment: Enabled: false -Metrics/LineLength: +Layout/LineLength: Max: 120 - IgnoreCopDirectives: true Metrics/BlockLength: - ExcludedMethods: + AllowedMethods: - configure - context - define diff --git a/.ruby-version b/.ruby-version index 37c2961..15a2799 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.7.2 +3.3.0 diff --git a/CHANGELOG.md b/CHANGELOG.md index ea54e1c..bb943dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,15 +3,31 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/) -## [Unreleased] +## [0.6.0] - 2024-07-23 + +### Added +- AI LLM Testing Methodology + +## [0.5.2] - 2023-05-08 + +### Changed +- Title of API Methodology updated + +## [0.5.1] - 2023-04-06 + +### Changes +- None; Version bump because we forgot to update the git submodule + +## [0.5.0] - 2023-04-05 + +### Added +- API Testing Methodology included + +## [0.4.0] - 2023-03-03 + ### Added - support for methodologies v0.1 - Added new methodology for mobile_ios - Added new methodology for mobile_android - Added new methodology for binaries - Added new methodology for network -- Added new methodology for Api Testing - -### Changed - -### Removed diff --git a/Gemfile b/Gemfile index b73a005..94db4f2 100644 --- a/Gemfile +++ b/Gemfile @@ -2,3 +2,12 @@ source 'https://rubygems.org' # Specify your gem's dependencies in bmt-ruby.gemspec gemspec + +group :development do + gem 'bundler', require: false + gem 'pry', require: false + gem 'rake', require: false + gem 'rspec', require: false + gem 'rubocop', require: false + gem 'rubocop-performance', require: false +end diff --git a/bmt.gemspec b/bmt.gemspec index b07bbce..b33a90e 100644 --- a/bmt.gemspec +++ b/bmt.gemspec @@ -7,26 +7,20 @@ Gem::Specification.new do |spec| spec.name = 'bmt' spec.version = Bmt::VERSION spec.platform = Gem::Platform::RUBY - spec.authors = ['Federico Tagliabue'] - spec.email = ['federico.tagliabue@bugcrowd.com'] - spec.date = Date.today.to_s + spec.authors = ['Federico Tagliabue', 'Andy White'] + spec.email = ['federico.tagliabue@bugcrowd.com', 'arcwhite@arcwhite.org'] spec.summary = 'Ruby wrapper for Bugcrowd\'s Methodology Taxonomy' spec.homepage = 'https://github.com/bugcrowd/bmt-ruby' spec.license = 'MIT' spec.files = Dir['lib/**/*.{rb,json}'] spec.require_paths = ['lib'] - spec.required_ruby_version = '>= 2.5' - - spec.add_development_dependency 'bundler', '~> 2.1' - spec.add_development_dependency 'pry', '~> 0.11' - spec.add_development_dependency 'rake', '~> 12.3' - spec.add_development_dependency 'rspec', '~> 3.6' - spec.add_development_dependency 'rubocop', '0.56.0' + spec.required_ruby_version = '>= 3.1' spec.metadata = { 'homepage_uri' => 'https://github.com/bugcrowd/bmt-ruby', 'changelog_uri' => 'https://github.com/bugcrowd/bmt-ruby/blob/main/CHANGELOG.md', 'source_code_uri' => 'https://github.com/bugcrowd/bmt-ruby', - 'bug_tracker_uri' => 'https://github.com/bugcrowd/bmt-ruby/issues' + 'bug_tracker_uri' => 'https://github.com/bugcrowd/bmt-ruby/issues', + 'rubygems_mfa_required' => 'true' } end diff --git a/lib/bmt.rb b/lib/bmt.rb index 1e72357..6b69451 100644 --- a/lib/bmt.rb +++ b/lib/bmt.rb @@ -20,14 +20,14 @@ class MethodologyNotFoundError < StandardError; end # returns a Methodology object given a key and a version def find(key, version: current_version) raise VersionNotFoundError unless versions.include?(version) - raise MethodologyNotFoundError unless methodology_keys(version: version).include?(key) + raise MethodologyNotFoundError unless methodology_keys(version:).include?(key) @methodologies[version].nil? && @methodologies[version] = {} @methodologies[version][key] ||= Methodology.new( - key: key, - version: version, - attributes: methodology_json(key, version: version) + key:, + version:, + attributes: methodology_json(key, version:) ) @methodologies[version][key] @@ -43,7 +43,7 @@ def methodology_keys(version: current_version) DATA_DIR.join(version, 'methodologies').entries .map(&:basename) .map(&:to_s) - .select { |dirname| dirname =~ /json/ } + .grep(/json/) .map { |filepath| File.basename(filepath, File.extname(filepath)) } end @@ -55,7 +55,7 @@ def versions end def methodology_json(key, version: current_version) - JSON.parse(methodology_pathname(key, version: version).read) + JSON.parse(methodology_pathname(key, version:).read) end def methodology_pathname(key, version: current_version) @@ -67,6 +67,6 @@ def json_dir_names DATA_DIR.entries .map(&:basename) .map(&:to_s) - .select { |dirname| dirname =~ /^[0-9]+\.[0-9]/ }.sort + .grep(/^[0-9]+\.[0-9]/).sort end end diff --git a/lib/bmt/version.rb b/lib/bmt/version.rb index 4649af3..29f9da6 100644 --- a/lib/bmt/version.rb +++ b/lib/bmt/version.rb @@ -1,3 +1,3 @@ module Bmt - VERSION = '0.5.2'.freeze + VERSION = '0.6.0'.freeze end diff --git a/lib/data/0.1 b/lib/data/0.1 index 66ff3c2..c5e61dd 160000 --- a/lib/data/0.1 +++ b/lib/data/0.1 @@ -1 +1 @@ -Subproject commit 66ff3c2373cb82652e4097ffe06e1c380fd1a803 +Subproject commit c5e61dd7b41f5021b392dac872765008c21391a3 diff --git a/spec/bmt/item_spec.rb b/spec/bmt/item_spec.rb index 6808a00..f84dd0e 100644 --- a/spec/bmt/item_spec.rb +++ b/spec/bmt/item_spec.rb @@ -12,8 +12,8 @@ describe '#new' do subject do described_class.new( - step: step, - attributes: attributes + step:, + attributes: ) end diff --git a/spec/bmt/methodology_spec.rb b/spec/bmt/methodology_spec.rb index 64d995d..6c8af8f 100644 --- a/spec/bmt/methodology_spec.rb +++ b/spec/bmt/methodology_spec.rb @@ -6,7 +6,7 @@ describe '#new' do subject do described_class.new(key: methodology_key, - version: version, + version:, attributes: methodology_json) end @@ -28,7 +28,7 @@ describe '#steps' do subject do described_class.new(key: methodology_key, - version: version, + version:, attributes: methodology_json).steps end diff --git a/spec/bmt/step_spec.rb b/spec/bmt/step_spec.rb index 54c0f47..71f96d6 100644 --- a/spec/bmt/step_spec.rb +++ b/spec/bmt/step_spec.rb @@ -11,8 +11,8 @@ describe '#new' do subject do described_class.new( - methodology: methodology, - attributes: attributes + methodology:, + attributes: ) end @@ -29,8 +29,8 @@ describe '#items' do subject do described_class.new( - methodology: methodology, - attributes: attributes + methodology:, + attributes: ).items end @@ -48,15 +48,15 @@ end context 'with an executive_summary step type' do - let(:attributes) { methodology_json.dig('content', 'steps', 2) } - subject do described_class.new( - methodology: methodology, - attributes: attributes + methodology:, + attributes: ) end + let(:attributes) { methodology_json.dig('content', 'steps', 2) } + it 'returns the correct type' do expect(subject.type).to eq 'executive_summary' end diff --git a/spec/bmt_spec.rb b/spec/bmt_spec.rb index 6ece431..bc14f6b 100644 --- a/spec/bmt_spec.rb +++ b/spec/bmt_spec.rb @@ -5,7 +5,7 @@ subject { described_class.versions } it 'return all of the versions in the filesystem in reverse semver order' do - is_expected.to eq(['2.1', '1.0']) + expect(subject).to eq(['2.1', '1.0']) end end @@ -13,7 +13,7 @@ subject { described_class.current_version } it 'return the most recent version number for the vrt' do - is_expected.to eq('2.1') + expect(subject).to eq('2.1') end end @@ -22,7 +22,7 @@ subject { described_class.methodology_keys } it 'returns methodologies for the latest version' do - is_expected.to match_array(['website-testing', 'outback-animal-testing']) + expect(subject).to match_array(%w[website-testing outback-animal-testing]) end end @@ -30,7 +30,7 @@ subject { described_class.methodology_keys(version: '1.0') } it 'returns methodologies for the specified version' do - is_expected.to match_array(['website-testing']) + expect(subject).to match_array(['website-testing']) end end end @@ -51,7 +51,7 @@ end context 'specifing version' do - subject(:methodology) { described_class.find(key, version: version) } + subject(:methodology) { described_class.find(key, version:) } let(:key) { 'website-testing' } diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index ab7bee0..aaeb1ad 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -6,7 +6,7 @@ c.syntax = :expect end - config.before(:each) do + config.before do # The following adds a new, test-only BMT versions stub_const('BMT::DATA_DIR', Pathname.new('spec/sample')) end