diff --git a/CODEOWNERS b/.github/CODEOWNERS similarity index 100% rename from CODEOWNERS rename to .github/CODEOWNERS diff --git a/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md similarity index 100% rename from ISSUE_TEMPLATE.md rename to .github/ISSUE_TEMPLATE.md diff --git a/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md similarity index 100% rename from PULL_REQUEST_TEMPLATE.md rename to .github/PULL_REQUEST_TEMPLATE.md diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml new file mode 100644 index 0000000..2269353 --- /dev/null +++ b/.github/workflows/ruby.yml @@ -0,0 +1,32 @@ +# Download a prebuilt Ruby version, install dependencies, and run the default Rake task + +name: Ruby + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + matrix: + ruby: ['2.6', '2.7', 'head'] + + name: Build on Ruby ${{ matrix.ruby }} + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler-cache: true # runs 'bundle install' and caches installed gems automatically + + - name: Run rake + run: bundle exec rake diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 4584eb2..0000000 --- a/.travis.yml +++ /dev/null @@ -1,26 +0,0 @@ ---- -language: ruby - -env: - global: - secure: SSSOEixn3ZAtlFmDyczVFAn/a7r+oWt2Ji+CZsRyn3jaXGx27kv0jGVWiTEAjjdEpIjoTSGMoagkP2b0o/+G2ZJgWdlZrLZBI16vmQy/OK386aENKseVsWlH3L6FxDAMDOeK8jRMZEPZWBjfK3MbtG2sfTDqA+kxi1VradFRE/YeLaES8AefbqZvXQgsg9CpLw1rBJTjAxduHVmjS23KY26eNy7wu7Pun4kwHOfmYsT7B/9Dbe9TvB3j01mYHBDbHGK8I+i8qLxU9whB9YhvitgnAY7nvH6aiOTaMKwz81Pr16SdQV+IayG+0dZoY81smSwCjlDdWg9+m/3HtcwU6TAbFCo1TGqQiF6zcvlT3P7hKUEJeCdptXtQuf9PVIjU4AIB1CXAIz2sqWoqRSArAzRmLMjho8RW9Nv7JGz6tN2DCyBOa2G5/+y0knkd8zdXvslCMeBjMn+yf6Ot7NZe4ItTT6YMUqb+Sp3CZzXZtkUqZNYC7BtWn+hLZYj/J48tKYLbFY8wQZ/WswWK9V5SqOuGmIKl/vcLF0DMPcsVotTCvU5Masl+GjBjuzyyGRWViF6qcMXW1QFbuTiQxrF1Gz4jVPL7OA4lflpSOWub+bKzeca71VF8QuFC/pIJoNsnMu39TtCbFhHB7H1NOfqsC63XiWx3JJj/a8d/Z7U5qb8= - -cache: bundler - -rvm: - - 2.6 - - 2.7 - - ruby-head - -before_script: - - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter - - chmod +x ./cc-test-reporter - - ./cc-test-reporter before-build - -after_script: - - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT - -matrix: - allow_failures: - - rvm: ruby-head - fast_finish: true diff --git a/README.md b/README.md index 58699e3..454fe62 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ **THIS PROJECT IS A WORK IN PROGRESS AND IS NOT USEFUL IN ITS CURRENT STATE** [![Gem Version](https://badge.fury.io/rb/ruby_git.svg)](https://badge.fury.io/rb/ruby_git) -[![Build Status](https://travis-ci.org/main-branch/ruby_git.svg?branch=main)](https://travis-ci.org/main-branch/ruby_git) +[![Build Status](https://github.com/main-branch/ruby_git/workflows/Ruby/badge.svg?branch=main)](https://github.com/main-branch/ruby_git/actions?query=workflow%3ARuby) [![Maintainability](https://api.codeclimate.com/v1/badges/5403e4613b7518f70da7/maintainability)](https://codeclimate.com/github/main-branch/ruby_git/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/5403e4613b7518f70da7/test_coverage)](https://codeclimate.com/github/main-branch/ruby_git/test_coverage) [![Slack](https://img.shields.io/badge/slack-main--branch/ruby__git-yellow.svg?logo=slack)](https://main-branch.slack.com/archives/C01CHR7TMM2) diff --git a/spec/lib/ruby_git/file_helpers_spec.rb b/spec/lib/ruby_git/file_helpers_spec.rb index a0c4d23..0525e39 100644 --- a/spec/lib/ruby_git/file_helpers_spec.rb +++ b/spec/lib/ruby_git/file_helpers_spec.rb @@ -19,16 +19,16 @@ end context "when path is '/usr/bin:/usr/local/bin' and path_ext is nil" do - let(:path_dir_1) { File.join(root_dir, 'usr', 'bin') } - let(:path_dir_2) { File.join(root_dir, 'usr', 'local', 'bin') } - let(:path) { [path_dir_1, path_dir_2].join(File::PATH_SEPARATOR) } + let(:path_dir1) { File.join(root_dir, 'usr', 'bin') } + let(:path_dir2) { File.join(root_dir, 'usr', 'local', 'bin') } + let(:path) { [path_dir1, path_dir2].join(File::PATH_SEPARATOR) } context 'and command is not found in the path' do it { is_expected.to be_nil } end context 'and /usr/local/bin/command is NOT an executable file' do - let(:command_dir) { path_dir_1 } + let(:command_dir) { path_dir1 } let(:command_path) { File.join(command_dir, command) } before do FileUtils.mkdir_p(command_dir) @@ -39,7 +39,7 @@ end context 'and /usr/local/bin/command is a directory' do - let(:command_dir) { path_dir_1 } + let(:command_dir) { path_dir1 } let(:command_path) { File.join(command_dir, command) } before do FileUtils.mkdir_p(command_dir) @@ -50,7 +50,7 @@ end context 'and /usr/bin/command is an executable file' do - let(:command_dir) { path_dir_1 } + let(:command_dir) { path_dir1 } let(:command_path) { File.join(command_dir, command) } before do FileUtils.mkdir_p(command_dir) @@ -62,7 +62,7 @@ end context 'and /usr/local/bin/command is an executable file' do - let(:command_dir) { path_dir_2 } + let(:command_dir) { path_dir2 } let(:command_path) { File.join(command_dir, command) } before do FileUtils.mkdir_p(command_dir) @@ -74,7 +74,7 @@ end context 'and /usr/local/bin/command is a symlink to an executable file' do - let(:command_dir) { path_dir_2 } + let(:command_dir) { path_dir2 } let(:command_path) { File.join(command_dir, command) } let(:actual_command_path) { File.join(command_dir, "actual_#{command}") } before do @@ -88,33 +88,33 @@ end context 'and both /usr/bin/command and /usr/local/bin/command are executable files' do - let(:command_dir_1) { path_dir_1 } - let(:command_path_1) { File.join(command_dir_1, command) } + let(:command_dir1) { path_dir1 } + let(:command_path1) { File.join(command_dir1, command) } before do - FileUtils.mkdir_p(command_dir_1) - FileUtils.touch(command_path_1) - FileUtils.chmod(0o755, command_path_1) + FileUtils.mkdir_p(command_dir1) + FileUtils.touch(command_path1) + FileUtils.chmod(0o755, command_path1) end - let(:command_dir_2) { path_dir_2 } - let(:command_path_2) { File.join(command_dir_2, command) } + let(:command_dir2) { path_dir2 } + let(:command_path2) { File.join(command_dir2, command) } before do - FileUtils.mkdir_p(command_dir_2) - FileUtils.touch(command_path_2) - FileUtils.chmod(0o755, command_path_2) + FileUtils.mkdir_p(command_dir2) + FileUtils.touch(command_path2) + FileUtils.chmod(0o755, command_path2) end - it { is_expected.to eq(Pathname.new(command_path_1)) } + it { is_expected.to eq(Pathname.new(command_path1)) } end context "and path_ext is '.EXE:.BAT:.CMD'" do - let(:path_dir_1) { File.join(root_dir, 'usr', 'bin') } - let(:path_dir_2) { File.join(root_dir, 'usr', 'local', 'bin') } - let(:path) { [path_dir_1, path_dir_2].join(File::PATH_SEPARATOR) } + let(:path_dir1) { File.join(root_dir, 'usr', 'bin') } + let(:path_dir2) { File.join(root_dir, 'usr', 'local', 'bin') } + let(:path) { [path_dir1, path_dir2].join(File::PATH_SEPARATOR) } let(:path_ext) { %w[.EXE .BAT .CMD].join(File::PATH_SEPARATOR) } context 'and /usr/local/bin/command.BAT is an executable file' do - let(:command_dir) { path_dir_1 } + let(:command_dir) { path_dir1 } let(:command_path) { File.join(command_dir, "#{command}.BAT") } before do FileUtils.mkdir_p(command_dir)