From d5b5be59a68876ddc5fe2c5cb4f455e878e73d8a Mon Sep 17 00:00:00 2001 From: Aleksandar Ivanov Date: Fri, 8 Apr 2016 10:53:03 +0300 Subject: [PATCH 1/2] Use the current working directory if none specified --- bin/hellgrid | 4 +++- spec/hellgrid_spec.rb | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/bin/hellgrid b/bin/hellgrid index 5d18081..f30ab2d 100755 --- a/bin/hellgrid +++ b/bin/hellgrid @@ -9,7 +9,9 @@ require 'find' require 'hellgrid' -ARGV.each do |folder| +folders = ARGV.empty? ? [Dir.pwd] : ARGV + +folders.each do |folder| matrix = Hellgrid::Matrix.new Find.find(folder) do |path| diff --git a/spec/hellgrid_spec.rb b/spec/hellgrid_spec.rb index f1593a9..53065e6 100644 --- a/spec/hellgrid_spec.rb +++ b/spec/hellgrid_spec.rb @@ -92,4 +92,22 @@ expect(`cd ~ && #{PROJECT_ROOT}/bin/hellgrid #{PROJECT_ROOT}/spec/tmp`).to eq(expected_result) end end + + it 'uses the current working directory by default' do + expected_result = <<-TABLE + x | bar | in/foo +--------------------+--------+-------- + diff-lcs | 1.2.5 | 1.2.5 + rake | 10.0.0 | 11.1.0 + rspec | 2.0.0 | 3.0.0 + rspec-core | 2.0.0 | 3.0.4 + rspec-expectations | 2.0.0 | 3.0.4 + rspec-mocks | 2.0.0 | 3.0.4 + rspec-support | x | 3.0.4 +TABLE + + Bundler.with_clean_env do + expect(`cd #{PROJECT_ROOT}/spec/tmp && #{PROJECT_ROOT}/bin/hellgrid`).to eq(expected_result) + end + end end From ad3e0e1762b7c88dc7aba67539ca8ede90e195c6 Mon Sep 17 00:00:00 2001 From: Aleksandar Ivanov Date: Fri, 8 Apr 2016 10:54:52 +0300 Subject: [PATCH 2/2] Version 0.1.0 * run the command in the current working dir by default * display the absolute path from the current working dir onwards for project name * no more warnings for running the command in a directory that is not a git repo --- lib/hellgrid/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/hellgrid/version.rb b/lib/hellgrid/version.rb index ad24172..89fe086 100644 --- a/lib/hellgrid/version.rb +++ b/lib/hellgrid/version.rb @@ -1,3 +1,3 @@ module Hellgrid - VERSION = '0.0.1' + VERSION = '0.1.0' end