icersplicer 0.9.2 → 0.9.6
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 +34 -30
- data/lib/version.rb +1 -1
- 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: 28b48d417b51f6c80bb9b392c746035caf3d4db4
|
4
|
+
data.tar.gz: cd7439a780ab034052c9bf898dff5151c07637c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 68aae7735f40373ee3411569d1e4221c3de4b79ae6590e8e80fc2aefac26c67801c8c14b88ae32685dead4818325d48c71a4e9233a0160af4c5d882bf0f1f5d0
|
7
|
+
data.tar.gz: 955e3c532104a4a68b696b1e913cf432d55990fcfed6c490828368a4c71abc939285af85e1689c97f2e5e2f67ae9847bab28edae386d172e807076f093fc68ae
|
data/bin/icersplicer
CHANGED
@@ -76,7 +76,7 @@ opts.each do |opt, arg|
|
|
76
76
|
--head '-3' INTEGER
|
77
77
|
--tail '-4' INTEGER
|
78
78
|
--followtail '-5' INTEGER
|
79
|
-
--inputfile '-f' filename
|
79
|
+
--inputfile '-f' filename(s) / Comma separated
|
80
80
|
--skiplines '-s' LINE NUMBERS 3,5,6
|
81
81
|
--skipblank '-b' NO ARGUMENTS ( Ommit blank lines )
|
82
82
|
--quiet '-q' NO ARGUMENTS
|
@@ -198,10 +198,12 @@ if @countlines == true
|
|
198
198
|
exit
|
199
199
|
end
|
200
200
|
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
201
|
+
inputfile.split(",").each {|f|
|
202
|
+
unless File.exist?("#{f}")
|
203
|
+
raise ArgumentError, "Input filename #{f} / location doesn't exist... ?"
|
204
|
+
exit
|
205
|
+
end
|
206
|
+
}
|
205
207
|
|
206
208
|
filterlines = 0
|
207
209
|
unless instance_variable_defined?("@nostats")
|
@@ -209,16 +211,29 @@ unless instance_variable_defined?("@nostats")
|
|
209
211
|
timer.watch('start')
|
210
212
|
end
|
211
213
|
begin
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
unless
|
220
|
-
unless
|
221
|
-
unless
|
214
|
+
inputfile.split(",").each {|f|
|
215
|
+
File.open(f) {|n|
|
216
|
+
n.each_line {|data|
|
217
|
+
data_orig = data.clone
|
218
|
+
if search_and_replace == true
|
219
|
+
data.gsub!("#{search}", "#{replace}")
|
220
|
+
end
|
221
|
+
unless lineoffset > increment_offset
|
222
|
+
unless linelimit == 0
|
223
|
+
unless increment_limit > linelimit
|
224
|
+
unless instance_variable_defined?("@skipblank") and data_orig.strip == ""
|
225
|
+
if data_orig =~ /#{grep}/
|
226
|
+
filterlines += 1
|
227
|
+
ice.print_to_screen(linecounter, ice.text_processor(data), quietmode) unless ice.skip(linecounter)
|
228
|
+
if instance_variable_defined?("@outputfile")
|
229
|
+
data_orig.gsub!("#{search}", "#{replace}")
|
230
|
+
ice.processdata(data_orig, outputfile, quietmode) unless ice.skip(linecounter)
|
231
|
+
end
|
232
|
+
end
|
233
|
+
end
|
234
|
+
end
|
235
|
+
else
|
236
|
+
unless instance_variable_defined?("@skipblank") and data_orig.strip == ""
|
222
237
|
if data_orig =~ /#{grep}/
|
223
238
|
filterlines += 1
|
224
239
|
ice.print_to_screen(linecounter, ice.text_processor(data), quietmode) unless ice.skip(linecounter)
|
@@ -229,22 +244,11 @@ begin
|
|
229
244
|
end
|
230
245
|
end
|
231
246
|
end
|
232
|
-
|
233
|
-
unless instance_variable_defined?("@skipblank") and data_orig.strip == ""
|
234
|
-
if data_orig =~ /#{grep}/
|
235
|
-
filterlines += 1
|
236
|
-
ice.print_to_screen(linecounter, ice.text_processor(data), quietmode) unless ice.skip(linecounter)
|
237
|
-
if instance_variable_defined?("@outputfile")
|
238
|
-
data_orig.gsub!("#{search}", "#{replace}")
|
239
|
-
ice.processdata(data_orig, outputfile, quietmode) unless ice.skip(linecounter)
|
240
|
-
end
|
241
|
-
end
|
242
|
-
end
|
247
|
+
increment_limit += 1
|
243
248
|
end
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
linecounter += 1
|
249
|
+
increment_offset += 1
|
250
|
+
linecounter += 1
|
251
|
+
}
|
248
252
|
}
|
249
253
|
}
|
250
254
|
rescue Errno::EPIPE, IOError
|
data/lib/version.rb
CHANGED