JosephPecoraro / scripts

Some scripts I have written and tend to keep up to date. They reside in my personal bin folder.

This URL has Read+Write access

Sat Nov 14 20:29:10 -0800 2009
commit  0d677ea77a308266f3fa431b1e94ec24575f4086
tree    435122baf09231dbc651263bcf6f49e3e0f35d5a
parent  e03e4cc31dc9642b5df4f9a9e6456ccac12a0550
scripts / hask
100755 29 lines (25 sloc) 0.627 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env ruby
# Author: Joseph Pecoraro
# Date: Wednesday, September 30, 2009
# Description: Simple Haskell Quick Starter
 
# Defaults
EDITOR = 'mate' # ENV['EDITOR'] for most Unix Guys
HASK_DIR = File.expand_path('~/haskell')
 
# Determine the File
# - default to temp.hs
# - use provided file if exists
# - create new temp file with given name
file = File.join(HASK_DIR, 'temp.hs');
if ARGV.size > 0
  name = ARGV[0]
  if File.file? name
    file = name
  else
    name += '.hs' unless name =~ /\.hs$/
    file = name
  end
end
 
# Work the magic
system "touch #{file}"
system "#{EDITOR} #{file}"
system "ghci #{file}"