Skip to content

Commit

Permalink
no more shelling out
Browse files Browse the repository at this point in the history
  • Loading branch information
defunkt committed Mar 20, 2011
1 parent 9cfedd5 commit 55f33a7
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions app/helpers/sinatra.rb
Expand Up @@ -14,19 +14,6 @@ def colorize(hash = {})
tokens = CodeRay.scan(hash.values.first, hash.keys.first)
tokens.html.div.sub('CodeRay', 'highlight')
end

# shell "cat", :stdin => "file.rb"
def shell(cmd, options = {})
ret = ''
Open3.popen3(cmd) do |stdin, stdout, stderr|
if options[:stdin]
stdin.puts options[:stdin].to_s
stdin.close
end
ret = stdout.read.strip
end
ret
end
end
end
end

0 comments on commit 55f33a7

Please sign in to comment.