-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclasses.rb
46 lines (43 loc) · 1.7 KB
/
classes.rb
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
class Settings
AUTHOR = "MuffinTheMan (aka Caleb Larsen)"
end
class Ruby
SPACER = "# ----- ----- ----- ------ ----- ----- ----- #"
AUTHOR_HEADER = "# Written by " + Settings::AUTHOR + " #"
MONKEYPATCHING_HEADER = "# MonkeyPatching #"
SCRIPT_HEADER = "# Script #"
COMMENT_MARKER = "#"
OPEN_FILE = "# Open file (name supplied as first argument) and read through one line at a time.\n\
File.open(ARGV[0]).each_line do |line|"
end
class PHP
SPACER = "// ----- ----- ----- ------ ----- ----- ----- //"
AUTHOR_HEADER = "// Written by " + Settings::AUTHOR + " //"
MONKEYPATCHING_HEADER = nil
SCRIPT_HEADER = "// Script //"
COMMENT_MARKER = "//"
OPEN_FILE = "// Open file (name supplied as first argument) and read through one line at a time.\n\
$fh = fopen($argv[1], \"r\");\n\n\
while ($line = fgets($fh)) {\n\
}"
end
class Java
SPACER = "// ----- ----- ----- ------ ----- ----- ----- //"
AUTHOR_HEADER = "// Written by " + Settings::AUTHOR + " //"
MONKEYPATCHING_HEADER = nil
SCRIPT_HEADER = "// Script //"
COMMENT_MARKER = "//"
OPEN_FILE = "import java.io.*;\n\n\
public class Main {\n\
public static void main (String[] args) throws IOException {\n\
// Open file (name supplied as first argument) and read through one line at a time.\n\
File file = new File(args[0]);\n\
BufferedReader buffer = new BufferedReader(new FileReader(file));\n\
String line;\n\
while ((line = buffer.readLine()) != null) {\n\
line = line.trim();\n\
// Process line of input Here\n\
}\n\
}\n\
}"
end