Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

grep calls in Rakefile won't work on Windows #1047

Closed
djberg96 opened this Issue · 3 comments

3 participants

Daniel Berger Rohit Arondekar Alexey Zapparov
Daniel Berger

As the title says, you've got grep system calls being made in the Rakefile, which blows up the spec:deps task on Windows. They're being used to detect the presence of certain rubygems, which isn't necessary at all because rubygems provides an interface for this. I've pasted the patch below:

diff --git a/Rakefile b/Rakefile
index 6f9e3c4..4b71493 100644
--- a/Rakefile
+++ b/Rakefile
@@ -35,7 +35,9 @@ begin

       desc "Install CI dependencies"
       task :deps do
-        sh "gem list ci_reporter | (grep 'ci_reporter' 1> /dev/null) || gem install ci_reporter --n
+        unless Gem.available?("ci_reporter")
+          sh "gem gem install ci_reporter --no-ri --no-rdoc"
+        end
       end
       task :deps => "spec:deps"
     end
@@ -116,11 +118,14 @@ rescue LoadError
   namespace :spec do
     desc "Ensure spec dependencies are installed"
     task :deps do
-      sh "gem list ronn | (grep 'ronn' 1> /dev/null) || gem install ronn --no-ri --no-rdoc"
-      sh "gem list rspec | (grep 'rspec (2.0' 1> /dev/null) || gem install rspec --no-ri --no-rdoc"
+      unless Gem.available?('ronn')
+        sh "gem install ronn --no-rdoc --no-ri"
+      end
+      unless Gem.available?('rspec', "~> 2.0")
+        sh "gem install rspec --no-rdoc --no-ri"
+      end
     end
   end
-
 end

 namespace :man do
Rohit Arondekar
Collaborator

Doesn't Cygwin et all provide grep though? I'm sorry haven't used Ruby on Windows but I'd think that grep would be provided, at least Cygwin does, don't know about others.

Rohit Arondekar
Collaborator

Also Gem.available? is deprecated so even if we do opt for this we'll need to take care of different RG versions capability.

Alexey Zapparov
Collaborator

Fixed in 1.2+

Alexey Zapparov ixti closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.