Skip to content

Commit e235e09

Browse files
committed
Print current environment (travi-ci debugging
1 parent 5acb111 commit e235e09

File tree

4 files changed

+15
-7
lines changed

4 files changed

+15
-7
lines changed

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,6 @@ spec/reports
1515
test/tmp
1616
test/version_tmp
1717
tmp
18-
.byebug_history
18+
.byebug_history
19+
.tags
20+
.tags1

.rspec

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
--color
2-
-Ilib
3-
-Ispec
2+
-I lib
3+
-I spec
44
--require spec_helper
5-
--exclude-pattern spec/fixtures/**/*_spec.rb
5+
--exclude-pattern spec/fixtures/**/*_spec.rb
6+
--tty
7+
--format documentation

lib/git_fame/base.rb

+4-3
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def initialize(args)
4343
@sort = args.fetch(:sort, @default_settings.fetch(:sorting))
4444
@repository = args.fetch(:repository)
4545
@bytype = args.fetch(:bytype, false)
46-
@branch = args.fetch(:branch, default_branch)
46+
@branch = args.fetch(:branch, nil)
4747

4848
# Figure out what branch the caller is using
4949
if present?(@branch = args[:branch])
@@ -72,10 +72,10 @@ def initialize(args)
7272
:files,
7373
[:distribution, "distribution (%)"]
7474
]
75-
@cache = {}
7675
@file_extensions = []
7776
@wopt = args.fetch(:whitespace, false) ? "-w" : ""
7877
@authors = {}
78+
@cache = {}
7979
end
8080

8181
#
@@ -277,6 +277,8 @@ def execute(command, silent = false, &block)
277277
Result.new(out.read.scrub.strip, thread.value.success?)
278278
end
279279

280+
warn command
281+
280282
if result.success? or silent
281283
return result unless block
282284
return block.call(result)
@@ -309,7 +311,6 @@ def default_branch
309311
execute("git rev-parse HEAD | head -1") do |result|
310312
return result.data.split(" ")[0] if result.success?
311313
end
312-
313314
raise Error, "No branch found. Define one using --branch=<branch>"
314315
end
315316

spec/spec_helper.rb

+3
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@
3535
config.expect_with(:rspec) { |c| c.syntax = [:should, :expect] }
3636
config.fail_fast = false
3737
config.before(:all) do
38+
warn "Current environment"
39+
warn `git --version`
40+
warn `grep --version`
3841
Dir.chdir(repository) { system "git checkout 7ab01bc5a720 > /dev/null 2>&1" }
3942
end
4043

0 commit comments

Comments
 (0)