icersplicer 0.8.9 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/icersplicer +5 -1
- data/lib/icersplicer.rb +16 -13
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa5eaf273fcb7862ad081ad0944b41c60d2def7e
|
4
|
+
data.tar.gz: 7fcc0e5257079277bb47ff0c5a1b2da401b1444e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c51ec7c9aa16508578711e364fe5f4e03fae680fb151831e606723bfaecd0d59d3ace135ad3f39f1fa98b350ba40f30850521bcd885e51a1f53212c3c18cf6c
|
7
|
+
data.tar.gz: 79ae4c37b6f96ab03a846d2378308730553a034d864a5e5c57a10a48b55c57bd79074cad8b28a1ef5aa4628644e01ae7d5f0da3e53abc9ffeeec1839125c7449
|
data/bin/icersplicer
CHANGED
@@ -54,7 +54,8 @@ opts = GetoptLong.new(
|
|
54
54
|
[ '--search', '-1', GetoptLong::REQUIRED_ARGUMENT],
|
55
55
|
[ '--replace', '-2', GetoptLong::REQUIRED_ARGUMENT],
|
56
56
|
[ '--nostats', '-6', GetoptLong::NO_ARGUMENT ],
|
57
|
-
[ '--debug', '-d', GetoptLong::REQUIRED_ARGUMENT ]
|
57
|
+
[ '--debug', '-d', GetoptLong::REQUIRED_ARGUMENT ],
|
58
|
+
[ '--nolines', '-7', GetoptLong::NO_ARGUMENT ]
|
58
59
|
)
|
59
60
|
|
60
61
|
opts.each do |opt, arg|
|
@@ -84,6 +85,7 @@ opts.each do |opt, arg|
|
|
84
85
|
--replace '-2' Replacement string
|
85
86
|
--nostats '-6' Don't process statistics before exit
|
86
87
|
--debug '-d' Verbose debug for hacking on this project
|
88
|
+
--nolines '-7' No Line numbers
|
87
89
|
|
88
90
|
Example:
|
89
91
|
|
@@ -142,6 +144,8 @@ Written by Brian Hood
|
|
142
144
|
@nostats = "SKIP"
|
143
145
|
when '--debug'
|
144
146
|
ice.debug = arg.to_i
|
147
|
+
when '--nolines'
|
148
|
+
ice.nolinenumbers = true
|
145
149
|
end
|
146
150
|
end
|
147
151
|
|
data/lib/icersplicer.rb
CHANGED
@@ -14,8 +14,8 @@ module Icersplicer
|
|
14
14
|
|
15
15
|
module VERSION #:nodoc:
|
16
16
|
MAJOR = 0
|
17
|
-
MINOR =
|
18
|
-
TINY =
|
17
|
+
MINOR = 9
|
18
|
+
TINY = 0
|
19
19
|
CODENAME = "Icey Sea !"
|
20
20
|
STRING = [MAJOR, MINOR, TINY].join('.')
|
21
21
|
end
|
@@ -26,22 +26,22 @@ module Icersplicer
|
|
26
26
|
|
27
27
|
class FileProcessor
|
28
28
|
|
29
|
-
attr_writer :nohighlighter, :skip_lines, :keywordsfile, :debug
|
29
|
+
attr_writer :nohighlighter, :skip_lines, :keywordsfile, :debug, :nolinenumbers
|
30
30
|
|
31
31
|
COLOURS = {"black" => 0,
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
32
|
+
"red" => 1,
|
33
|
+
"green" => 2,
|
34
|
+
"yellow" => 3,
|
35
|
+
"blue" => 4,
|
36
|
+
"purple" => 5,
|
37
|
+
"cyan" => 6,
|
38
|
+
"white" => 7}
|
39
39
|
|
40
40
|
def initialize
|
41
41
|
@fileopen = 0
|
42
|
-
@exp = nil
|
43
42
|
@keywordsfile = "keywords.ice"
|
44
43
|
@debug = 0
|
44
|
+
@nolinenumbers = false
|
45
45
|
end
|
46
46
|
|
47
47
|
def reset_screen
|
@@ -168,12 +168,15 @@ module Icersplicer
|
|
168
168
|
end
|
169
169
|
|
170
170
|
def print_to_screen(linenum, text, quiet)
|
171
|
-
|
171
|
+
unless @nolinenumbers == true
|
172
|
+
print "\e[1;33mLn: #{linenum}:\e[0m\ "
|
173
|
+
end
|
174
|
+
print "#{text}" unless quiet == true
|
172
175
|
end
|
173
176
|
|
174
177
|
def openfile(outputfile)
|
175
178
|
begin
|
176
|
-
puts "Openfile: #{outputfile}" if @debug
|
179
|
+
puts "Openfile: #{outputfile}" if @debug >= 1
|
177
180
|
@export = File.open("#{outputfile}", 'w')
|
178
181
|
rescue Errno::EACCES
|
179
182
|
raise IOError, "Can't create file please check file / directory permissions"
|