Skip to content

Commit

Permalink
harder better faster stronger
Browse files Browse the repository at this point in the history
  • Loading branch information
defunkt committed Feb 7, 2011
1 parent bb24ee5 commit 7799f0e
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions bin/dotjs
@@ -1,15 +1,7 @@
#!/usr/bin/env ruby

def install
def puts(*things)
print "\e[1m\e[33m->\e[0m "
super
end

def gets(*things)
print "\e[1m\e[34m<-\e[0m "
super
end
ARGV.clear

puts "Hi! I'm going to install the \e[1m\e[32mdotjs\e[0m Google Chrome extension."
puts "Cool? (y/n)"
Expand All @@ -32,6 +24,7 @@ def install
end

def server
ARGV.clear
ARGV.push('-p')
ARGV.push('3131')

Expand All @@ -41,7 +34,7 @@ def server
content_type 'text/plain'
headers 'Access-Control-Allow-Origin' => '*'
host = params[:host].gsub('..', '.')
if File.exist? file = File.expand_path("~/.js/#{host}.js")
if File.exist? file = File.expand_path("~/.js/#{host}")
File.read(file)
end
end
Expand All @@ -52,10 +45,10 @@ if ARGV.include?('--install')
elsif ARGV.include?('--server')
server
else
puts "usage: $ dotjs [command]"
puts "usage: \e[33m$\e[0m dotjs [command]"
puts
puts "commands:"
puts " --install\tInstalls dotjs"
puts " --server\tStarts the dotjs server"
puts " --help\tPrints this message"
puts " \e[1m--install\e[0m\tInstalls dotjs"
puts " \e[1m--server\e[0m\tStarts the dotjs server"
puts " \e[1m--help\e[0m\tPrints this message"
end

0 comments on commit 7799f0e

Please sign in to comment.