diff options
| -rw-r--r-- | Gemfile | 7 | ||||
| -rw-r--r-- | Gemfile.lock | 33 | ||||
| -rw-r--r-- | Rakefile | 13 | ||||
| -rwxr-xr-x | bin/cibuild | 18 | ||||
| -rwxr-xr-x | bin/console | 7 | ||||
| -rwxr-xr-x | bin/lint | 11 | ||||
| -rwxr-xr-x | bin/shipit | 10 | ||||
| -rwxr-xr-x | bin/test | 17 | ||||
| -rw-r--r-- | lib/spandx/gitlab.rb | 4 | ||||
| -rw-r--r-- | lib/spandx/gitlab/version.rb | 4 | ||||
| -rw-r--r-- | spandx-gitlab.gemspec | 38 | ||||
| -rw-r--r-- | spec/spandx/gitlab_spec.rb | 2 | ||||
| -rw-r--r-- | spec/spec_helper.rb | 8 |
13 files changed, 138 insertions, 34 deletions
@@ -1,7 +1,6 @@ -source "https://rubygems.org" +# frozen_string_literal: true + +source 'https://rubygems.org' # Specify your gem's dependencies in spandx-gitlab.gemspec gemspec - -gem "rake", "~> 12.0" -gem "rspec", "~> 3.0" diff --git a/Gemfile.lock b/Gemfile.lock index d4ca53b..3074a65 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -9,13 +9,24 @@ GEM specs: addressable (2.7.0) public_suffix (>= 2.0.2, < 5.0) + ast (2.4.0) + bundler-audit (0.6.1) + bundler (>= 1.2.0, < 3) + thor (~> 0.18) + byebug (11.1.1) diff-lcs (1.3) + jaro_winkler (1.5.4) mini_portile2 (2.4.0) net-hippie (0.3.2) nokogiri (1.10.9) mini_portile2 (~> 2.4.0) + parallel (1.19.1) + parser (2.7.1.0) + ast (~> 2.4.0) public_suffix (4.0.4) - rake (12.3.3) + rainbow (3.0.0) + rake (13.0.1) + rexml (3.2.4) rspec (3.9.0) rspec-core (~> 3.9.0) rspec-expectations (~> 3.9.0) @@ -29,20 +40,36 @@ GEM diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.9.0) rspec-support (3.9.2) + rubocop (0.81.0) + jaro_winkler (~> 1.5.1) + parallel (~> 1.10) + parser (>= 2.7.0.1) + rainbow (>= 2.2.2, < 4.0) + rexml + ruby-progressbar (~> 1.7) + unicode-display_width (>= 1.4.0, < 2.0) + rubocop-rspec (1.38.1) + rubocop (>= 0.68.1) + ruby-progressbar (1.10.1) spandx (0.11.0) addressable (~> 2.7) bundler (>= 1.16, < 3.0.0) net-hippie (~> 0.3) nokogiri (~> 1.10) thor - thor (1.0.1) + thor (0.20.3) + unicode-display_width (1.7.0) PLATFORMS ruby DEPENDENCIES - rake (~> 12.0) + bundler-audit (~> 0.6) + byebug (~> 11.1) + rake (~> 13.0) rspec (~> 3.0) + rubocop (~> 0.52) + rubocop-rspec (~> 1.22) spandx-gitlab! BUNDLED WITH @@ -1,6 +1,13 @@ -require "bundler/gem_tasks" -require "rspec/core/rake_task" +# frozen_string_literal: true + +require 'bundler/audit/task' +require 'bundler/gem_tasks' +require 'rspec/core/rake_task' +require 'rubocop/rake_task' RSpec::Core::RakeTask.new(:spec) +RuboCop::RakeTask.new(:rubocop) +Bundler::Audit::Task.new -task :default => :spec +task lint: [:rubocop, 'bundle:audit'] +task default: :spec diff --git a/bin/cibuild b/bin/cibuild new file mode 100755 index 0000000..44eda04 --- /dev/null +++ b/bin/cibuild @@ -0,0 +1,18 @@ +#!/bin/sh + +set -e + +cd "$(dirname "$0")/.." + +echo ["$(date "+%H:%M:%S")"] "==> Started at…" + +# GC customizations +export RUBY_GC_MALLOC_LIMIT=79000000 +export RUBY_GC_HEAP_INIT_SLOTS=800000 +export RUBY_HEAP_FREE_MIN=100000 +export RUBY_HEAP_SLOTS_INCREMENT=400000 +export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1 + +gem install bundler --conservative -v '~> 2.0' +bin/test +bin/lint diff --git a/bin/console b/bin/console index bee4fa0..3ea9255 100755 --- a/bin/console +++ b/bin/console @@ -1,7 +1,8 @@ #!/usr/bin/env ruby +# frozen_string_literal: true -require "bundler/setup" -require "spandx/gitlab" +require 'bundler/setup' +require 'spandx/gitlab' # You can add fixtures and/or initialization code here to make experimenting # with your gem easier. You can also use a different console, if you like. @@ -10,5 +11,5 @@ require "spandx/gitlab" # require "pry" # Pry.start -require "irb" +require 'irb' IRB.start(__FILE__) diff --git a/bin/lint b/bin/lint new file mode 100755 index 0000000..857904b --- /dev/null +++ b/bin/lint @@ -0,0 +1,11 @@ +#!/bin/sh + +set -e + +[ -z "$DEBUG" ] || set -x + +echo ["$(date "+%H:%M:%S")"] "==> Running setup…" +bin/setup + +echo ["$(date "+%H:%M:%S")"] "==> Running linters…" +bundle exec rake lint diff --git a/bin/shipit b/bin/shipit new file mode 100755 index 0000000..5271880 --- /dev/null +++ b/bin/shipit @@ -0,0 +1,10 @@ +#!/bin/sh + +set -e + +cd "$(dirname "$0")/.." + +[ -z "$DEBUG" ] || set -x + +bin/cibuild +bundle exec rake release diff --git a/bin/test b/bin/test new file mode 100755 index 0000000..3c7439d --- /dev/null +++ b/bin/test @@ -0,0 +1,17 @@ +#!/bin/sh + +set -e + +cd "$(dirname "$0")/.." + +[ -z "$DEBUG" ] || set -x + +echo ["$(date "+%H:%M:%S")"] "==> Running setup…" +bin/setup + +echo ["$(date "+%H:%M:%S")"] "==> Running tests…" +if [ $# -eq 0 ]; then + bundle exec rspec spec +else + bundle exec rspec "$@" +fi diff --git a/lib/spandx/gitlab.rb b/lib/spandx/gitlab.rb index e5b2c21..f0e97ae 100644 --- a/lib/spandx/gitlab.rb +++ b/lib/spandx/gitlab.rb @@ -1,5 +1,7 @@ +# frozen_string_literal: true + require 'spandx' -require "spandx/gitlab/version" +require 'spandx/gitlab/version' module Spandx module Gitlab diff --git a/lib/spandx/gitlab/version.rb b/lib/spandx/gitlab/version.rb index f17ac36..ebf557f 100644 --- a/lib/spandx/gitlab/version.rb +++ b/lib/spandx/gitlab/version.rb @@ -1,5 +1,7 @@ +# frozen_string_literal: true + module Spandx module Gitlab - VERSION = "0.1.0" + VERSION = '0.1.0' end end diff --git a/spandx-gitlab.gemspec b/spandx-gitlab.gemspec index 22720dd..5bbd3c1 100644 --- a/spandx-gitlab.gemspec +++ b/spandx-gitlab.gemspec @@ -1,29 +1,35 @@ +# frozen_string_literal: true + require_relative 'lib/spandx/gitlab/version' Gem::Specification.new do |spec| - spec.name = "spandx-gitlab" + spec.name = 'spandx-gitlab' spec.version = Spandx::Gitlab::VERSION - spec.authors = ["mo khan"] - spec.email = ["mkhan@gitlab.com"] + spec.authors = ['mo khan'] + spec.email = ['mkhan@gitlab.com'] - spec.summary = %q{A plugin to generate GitLab compatible license scanning reports.} - spec.description = %q{A plugin to generate GitLab compatible license scanning reports.} - spec.homepage = "https://gitlab.com/xlgmokha/spandx-gitlab" - spec.license = "MIT" - spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0") + spec.summary = 'A plugin to generate GitLab license scanning reports.' + spec.description = 'A plugin to generate GitLab license scanning reports.' + spec.homepage = 'https://gitlab.com/xlgmokha/spandx-gitlab' + spec.license = 'MIT' + spec.required_ruby_version = Gem::Requirement.new('>= 2.5.0') - spec.metadata["homepage_uri"] = spec.homepage - spec.metadata["source_code_uri"] = "https://gitlab.com/xlgmokha/spandx-gitlab" + spec.metadata['homepage_uri'] = spec.homepage + spec.metadata['source_code_uri'] = 'https://gitlab.com/xlgmokha/spandx-gitlab' spec.metadata['changelog_uri'] = 'https://github.com/mokhan/spandx/blob/master/CHANGELOG.md' - # Specify which files should be added to the gem when it is released. - # The `git ls-files -z` loads the files in the RubyGem that have been added into git. - spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do - `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } + spec.files = Dir.chdir(File.expand_path(__dir__)) do + `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec)/}) } end - spec.bindir = "exe" + spec.bindir = 'exe' spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } - spec.require_paths = ["lib"] + spec.require_paths = ['lib'] spec.add_dependency 'spandx', '~> 0.1' + spec.add_development_dependency 'bundler-audit', '~> 0.6' + spec.add_development_dependency 'byebug', '~> 11.1' + spec.add_development_dependency 'rake', '~> 13.0' + spec.add_development_dependency 'rspec', '~> 3.0' + spec.add_development_dependency 'rubocop', '~> 0.52' + spec.add_development_dependency 'rubocop-rspec', '~> 1.22' end diff --git a/spec/spandx/gitlab_spec.rb b/spec/spandx/gitlab_spec.rb index b564b45..997c067 100644 --- a/spec/spandx/gitlab_spec.rb +++ b/spec/spandx/gitlab_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + RSpec.describe Spandx::Gitlab do specify { expect(Spandx::Gitlab::VERSION).not_to be_nil } end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index d641367..8dd5ce7 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,9 +1,11 @@ -require "bundler/setup" -require "spandx/gitlab" +# frozen_string_literal: true + +require 'bundler/setup' +require 'spandx/gitlab' RSpec.configure do |config| # Enable flags like --only-failures and --next-failure - config.example_status_persistence_file_path = ".rspec_status" + config.example_status_persistence_file_path = '.rspec_status' # Disable RSpec exposing methods globally on `Module` and `main` config.disable_monkey_patching! |
