Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
File renamed without changes.
File renamed without changes.
32 changes: 32 additions & 0 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
@@ -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
26 changes: 0 additions & 26 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
46 changes: 23 additions & 23 deletions spec/lib/ruby_git/file_helpers_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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
Expand All @@ -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)
Expand Down