icersplicer 0.7.6 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/icersplicer +4 -4
- data/lib/icersplicer.rb +17 -20
- 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: 59b59767d5ae416f112ea0893067c55591177994
|
4
|
+
data.tar.gz: f089d8099aae8558a307fc250f33c1e90ef635bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f23b9ba6b07e861bf392a15a038ca2215e379dbec87c91142f65f4d6b1f9505240e94fcf0cb0ebd7013d37679dcd222348ab43fc7a78c35ac8a73871917b25a0
|
7
|
+
data.tar.gz: f65520d9dff96cc467a7427bd476b3d50cd469bec785972d5686b671a175f88221272dc565b4f9156c2d2bef76632aa9e18c51dd878848eb46c84d40e6fa9fa2
|
data/bin/icersplicer
CHANGED
@@ -149,7 +149,7 @@ if instance_variable_defined?("@search")
|
|
149
149
|
replace = @replace
|
150
150
|
search_and_replace = true
|
151
151
|
else
|
152
|
-
|
152
|
+
raise ArgumentError, "Replace string required to use search / replace features..."
|
153
153
|
exit
|
154
154
|
end
|
155
155
|
end
|
@@ -181,7 +181,7 @@ if @countlines == true
|
|
181
181
|
end
|
182
182
|
|
183
183
|
unless File.exist?("#{inputfile}")
|
184
|
-
|
184
|
+
raise ArgumentError, "Input filename / location doesn't exist... ?"
|
185
185
|
exit
|
186
186
|
end
|
187
187
|
|
@@ -229,8 +229,8 @@ begin
|
|
229
229
|
linecounter += 1
|
230
230
|
}
|
231
231
|
}
|
232
|
-
rescue Errno::EPIPE
|
233
|
-
|
232
|
+
rescue Errno::EPIPE, IOError
|
233
|
+
raise IOError, "Closing session due to broken pipe"
|
234
234
|
end
|
235
235
|
closefile
|
236
236
|
unless instance_variable_defined?("@nostats")
|
data/lib/icersplicer.rb
CHANGED
@@ -14,9 +14,9 @@ module Icersplicer
|
|
14
14
|
|
15
15
|
module VERSION #:nodoc:
|
16
16
|
MAJOR = 0
|
17
|
-
MINOR =
|
18
|
-
TINY =
|
19
|
-
CODENAME = "Ice
|
17
|
+
MINOR = 8
|
18
|
+
TINY = 0
|
19
|
+
CODENAME = "Ice Age !"
|
20
20
|
STRING = [MAJOR, MINOR, TINY].join('.')
|
21
21
|
end
|
22
22
|
|
@@ -82,7 +82,7 @@ module Icersplicer
|
|
82
82
|
|
83
83
|
def text_highlighter(text)
|
84
84
|
@keys ||= load_keywords("#{@@keywordsfile}")
|
85
|
-
|
85
|
+
unless @keys.class == Hash
|
86
86
|
@keys = {0 => "Ln:",
|
87
87
|
1 => "SELECT",
|
88
88
|
2 => "CREATE TABLE",
|
@@ -95,12 +95,9 @@ module Icersplicer
|
|
95
95
|
if n[1].split("##")[1] == nil
|
96
96
|
text.gsub!("#{n[1]}", "\e[4;3#{cpicker[rand(cpicker.size)]}m#{n[1]}\e[0m\ \e[0;32m")
|
97
97
|
else
|
98
|
-
name = n[1].split("##")[1].split("=")[1]
|
99
|
-
puts "
|
100
|
-
|
101
|
-
puts "Colour Number: #{cnum}" if @@debug == true
|
102
|
-
nval = n[1].split("##")[0]
|
103
|
-
puts "Value: #{nval}" if @@debug == true
|
98
|
+
name = n[1].split("##")[1].split("=")[1]; puts "Name: #{name}" if @@debug == true
|
99
|
+
cnum = COLOURS[name].to_i; puts "Colour Number: #{cnum}" if @@debug == true
|
100
|
+
nval = n[1].split("##")[0]; puts "Value: #{nval}" if @@debug == true
|
104
101
|
text.gsub!("#{nval}", "\e[4;3#{cnum}m#{nval}\e[0m\ \e[0;32m")
|
105
102
|
end
|
106
103
|
text.gsub!(" \e[0;32m", "\e[0;32m")
|
@@ -131,14 +128,10 @@ module Icersplicer
|
|
131
128
|
# Allow line ranges
|
132
129
|
min = n.split("-")[0].to_i
|
133
130
|
max = n.split("-")[1].to_i
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
end
|
139
|
-
rescue
|
140
|
-
puts "Range Error: Minimun value can't be more than Maxiumun Range value"
|
141
|
-
exit
|
131
|
+
puts "Min: #{min} Max: #{max}" if @debug == true
|
132
|
+
unless n.split("-")[1] == nil
|
133
|
+
if min > max
|
134
|
+
raise RangeError, "Range Error: Minimun value can't be more than Maxiumun Range value"
|
142
135
|
end
|
143
136
|
min.upto(max) {|s|
|
144
137
|
skip_lines.update({skipcounter => s}) unless skip_lines[skip_lines.size - 1] == s
|
@@ -169,8 +162,12 @@ module Icersplicer
|
|
169
162
|
end
|
170
163
|
|
171
164
|
def openfile(outputfile)
|
172
|
-
|
173
|
-
|
165
|
+
begin
|
166
|
+
puts "Openfile: #{outputfile}"
|
167
|
+
@@exp = File.open("#{outputfile}", 'w')
|
168
|
+
rescue Errno::EACCES
|
169
|
+
puts "Can't create file please check file / directory permissions"
|
170
|
+
end
|
174
171
|
end
|
175
172
|
|
176
173
|
def writefile(data)
|