Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

pik run bugfix, fixed up tag scenarios

  • Loading branch information...
commit b1f3b18d7bc327a2ded87e4abbcc50cba7d35d4e 1 parent 30c56b5
@vertiginous authored
View
24 features/env.rb
@@ -36,33 +36,15 @@
path: c:\\temp\\.pik\\downloads
:install_dir: !ruby/object:Pathname
path: c:\\temp\\ruby
-:tags:
- "186":
- - "186: ruby 1.8.6 (2009-03-31 patchlevel 368) [i386-mingw32]"
- - "186: ruby 1.8.6 (2008-08-11 patchlevel 287) [i386-mswin32]"
- "191":
- - "191: ruby 1.9.1p243 (2009-07-16 revision 24175) [i386-mingw32]"
- - "191: ruby 1.9.1p129 (2009-05-12 revision 23412) [i386-mingw32]"
- iron:
- - "091: IronRuby 0.9.1.0 on .NET 2.0.0.0"
- - "090: IronRuby 0.9.0.0 on .NET 2.0.0.0"
- jruby:
- - "131: jruby 1.3.1 (ruby 1.8.6p287) (2009-06-15 2fd6c3d) (Java HotSpot(TM) Client VM 1.6.0_14) [x86-java]"
- mingw:
- - "186: ruby 1.8.6 (2009-03-31 patchlevel 368) [i386-mingw32]"
- - "191: ruby 1.9.1p129 (2009-05-12 revision 23412) [i386-mingw32]"
- - "191: ruby 1.9.1p243 (2009-07-16 revision 24175) [i386-mingw32]"
- ms:
- - "185: ruby 1.8.5 (2006-12-25 patchlevel 12) [i386-mswin32]"
- - "185: ruby 1.8.5 (2006-12-25 patchlevel 12) [i386-mswin32]"
- - "186: ruby 1.8.6 (2008-08-11 patchlevel 287) [i386-mswin32]"
CONFIG
+REAL_PATH = ENV['PATH']
FAKE_PIK_HOME = 'c:/temp/.pik'
-
ENV['HOME'] = "C:\\temp"
+ENV['JAVA_HOME'] = "C:\\Program Files\\Java\\jre6"
Before do
+ ENV['PATH'] = REAL_PATH
FileUtils.rm_rf FAKE_PIK_HOME
FileUtils.mkdir_p FAKE_PIK_HOME
File.open(File.join(FAKE_PIK_HOME, 'config.yml'), 'w'){|f| f.puts config }
View
7 features/step_definitions/pik_commands.rb
@@ -19,7 +19,6 @@
k,v = `pik switch #{@version} & path`.split('=')
ENV[k]=v
end
-
`ruby -v`.should match(@version_reg)
end
@@ -47,7 +46,11 @@
File.open(PIK_HOME + 'config.yml','w'){|f| }
end
-When /^I run "pik (.*)"$/ do |args|
+When /^I run "pik (.+?)" and "pik (.+)",$/ do |args1, args2|
+ %x[tools\\pik.bat #{args1} > #{PIK_LOG} 2>&1 && tools\\pik.bat #{args2} > #{PIK_LOG} 2>&1]
+end
+
+When /^I run "pik (.+?)"$/ do |args|
%x[tools\\pik.bat #{args} > #{PIK_LOG} 2>&1 ]
end
View
4 lib/pik/commands/run_command.rb
@@ -44,14 +44,14 @@ def switch_path_to(new_ver)
new_gem_bin = Pathname.new(new_gem_home) + 'bin'
- if current_gem_home = current_config[:gem_home]
+ if current_config && (current_gem_home = current_config[:gem_home])
current_gem_bin = Pathname.new(current_gem_home) + 'bin'
new_path.replace(current_gem_bin, new_gem_bin)
else
new_path.add(new_gem_bin)
end
else
- if current_gem_home = current_config[:gem_home]
+ if current_config && (current_gem_home = current_config[:gem_home])
current_gem_bin = Pathname.new(current_gem_home) + 'bin'
new_path.remove(current_gem_bin)
end
Please sign in to comment.
Something went wrong with that request. Please try again.