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/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 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