forked from square/git-fastclone
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
81 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,42 @@ | ||
# This configuration was generated by | ||
# `rubocop --auto-gen-config` | ||
# on 2016-03-29 21:03:41 -0700 using RuboCop version 0.35.1. | ||
# on 2019-01-17 09:38:07 -0800 using RuboCop version 0.63.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 | ||
# versions of RuboCop, may require this file to be generated again. | ||
|
||
# Offense count: 1 | ||
Lint/AmbiguousBlockAssociation: | ||
Exclude: | ||
- 'spec/git_fastclone_runner_spec.rb' | ||
|
||
# Offense count: 5 | ||
Metrics/AbcSize: | ||
Max: 25 | ||
|
||
# Offense count: 4 | ||
# Configuration parameters: CountComments, ExcludedMethods. | ||
# ExcludedMethods: refine | ||
Metrics/BlockLength: | ||
Max: 214 | ||
|
||
# Offense count: 1 | ||
Metrics/CyclomaticComplexity: | ||
Max: 7 | ||
|
||
# Offense count: 2 | ||
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. | ||
# URISchemes: http, https | ||
Metrics/LineLength: | ||
Max: 158 | ||
|
||
# Offense count: 1 | ||
Metrics/PerceivedComplexity: | ||
Max: 8 | ||
|
||
# Offense count: 6 | ||
# Configuration parameters: . | ||
# SupportedStyles: inline, group | ||
Style/AccessModifierDeclarations: | ||
EnforcedStyle: inline |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#!/usr/bin/env ruby | ||
# frozen_string_literal: true | ||
|
||
# Copyright 2015 Square Inc. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
# Copyright 2015 Square Inc. | ||
|
||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
|
@@ -14,19 +16,21 @@ | |
|
||
require 'date' | ||
|
||
$:.push File.expand_path("../lib", __FILE__) | ||
$LOAD_PATH.push File.expand_path('lib', __dir__) | ||
require 'git-fastclone/version' | ||
|
||
Gem::Specification.new do |gem| | ||
gem.name = 'git-fastclone' | ||
gem.version = GitFastCloneVersion::VERSION | ||
gem.date = Date.today.to_s | ||
gem.summary = %q(git-clone --recursive on steroids!) | ||
gem.description = %q(A git command that uses reference repositories and threading to quickly and recursively clone repositories with many nested submodules) | ||
gem.summary = 'git-clone --recursive on steroids!' | ||
gem.description = 'A git command that uses reference repositories and threading to quickly' \ | ||
'and recursively clone repositories with many nested submodules' | ||
gem.authors = ['Michael Tauraso', 'James Chang'] | ||
gem.email = ['[email protected]', '[email protected]'] | ||
gem.files = Dir['Rakefile', '{bin,lib,man,test,spec}/**/*', 'README*', 'LICENSE*'] & `git ls-files -z`.split("\0") | ||
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) } | ||
gem.files = Dir['Rakefile', '{bin,lib,man,test,spec}/**/*', 'README*', 'LICENSE*'] & | ||
`git ls-files -z`.split("\0") | ||
gem.executables = gem.files.grep(%r{^bin/}).map { |f| File.basename(f) } | ||
gem.test_files = gem.files.grep(%r{^(test|spec|features)/}) | ||
gem.require_paths = ['lib'] | ||
gem.homepage = 'http://square.github.io/git-fastclone/' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
# Copyright 2015 Square Inc. | ||
|
||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
|
@@ -31,7 +33,7 @@ | |
end | ||
|
||
# Modified ARGV, watch out | ||
ARGV = ['ssh://[email protected]/git-fastclone.git', 'test_reference_dir'] | ||
ARGV = ['ssh://[email protected]/git-fastclone.git', 'test_reference_dir'] # rubocop:disable Style/MutableConstant | ||
|
||
let(:yielded) { [] } | ||
|
||
|
@@ -104,7 +106,7 @@ | |
describe '.thread_update_submodule' do | ||
it 'should update correctly' do | ||
pending('need to figure out how to test this') | ||
fail | ||
raise | ||
end | ||
end | ||
|
||
|
@@ -127,7 +129,7 @@ | |
|
||
expect do | ||
subject.with_reference_repo_lock(test_url_valid) do | ||
fail placeholder_arg | ||
raise placeholder_arg | ||
end | ||
end.to raise_error(placeholder_arg) | ||
end | ||
|
@@ -184,7 +186,7 @@ | |
end | ||
end | ||
|
||
let(:placeholder_hash) { Hash.new } | ||
let(:placeholder_hash) { {} } | ||
|
||
context 'when already have a hash' do | ||
it 'should not store' do | ||
|
@@ -218,7 +220,7 @@ | |
it 'should go through the submodule file properly' do | ||
expect(Thread).to receive(:new).exactly(3).times | ||
|
||
allow(File).to receive(:readlines) { %w(1 2 3) } | ||
allow(File).to receive(:readlines) { %w[1 2 3] } | ||
subject.prefetch_submodules = true | ||
subject.prefetch(placeholder_arg) | ||
end | ||
|
@@ -228,7 +230,7 @@ | |
context 'when fail_hard is true' do | ||
it 'should raise a Cocaine error' do | ||
cocaine_commandline_double = double('new_cocaine_commandline') | ||
allow(cocaine_commandline_double).to receive(:run) { fail Cocaine::ExitStatusError } | ||
allow(cocaine_commandline_double).to receive(:run) { raise Cocaine::ExitStatusError } | ||
allow(Cocaine::CommandLine).to receive(:new) { cocaine_commandline_double } | ||
expect(FileUtils).to receive(:remove_entry_secure).with(placeholder_arg, force: true) | ||
expect do | ||
|
@@ -240,7 +242,7 @@ | |
context 'when fail_hard is false' do | ||
it 'should not raise a cocaine error' do | ||
cocaine_commandline_double = double('new_cocaine_commandline') | ||
allow(cocaine_commandline_double).to receive(:run) { fail Cocaine::ExitStatusError } | ||
allow(cocaine_commandline_double).to receive(:run) { raise Cocaine::ExitStatusError } | ||
allow(Cocaine::CommandLine).to receive(:new) { cocaine_commandline_double } | ||
expect(FileUtils).to receive(:remove_entry_secure).with(placeholder_arg, force: true) | ||
|
||
|
@@ -250,7 +252,7 @@ | |
end | ||
end | ||
|
||
let(:placeholder_hash) { Hash.new } | ||
let(:placeholder_hash) { {} } | ||
|
||
it 'should correctly update the hash' do | ||
cocaine_commandline_double = double('new_cocaine_commandline') | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'rspec/core' | ||
require 'rspec/mocks' |