icersplicer 1.0.6 → 1.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/bin/icersplicer +59 -41
  3. data/lib/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 828fde885629227694e9908fbc47fdf5c19fdb04
4
- data.tar.gz: 7cddde3b73f6932e7b54a6f766ab3418bc2a6895
3
+ metadata.gz: d19e22f059ad62dc8dd6c4f43be341eb14e5f3a3
4
+ data.tar.gz: a3acc16cb4123dd98c4d76d16efd587309111a15
5
5
  SHA512:
6
- metadata.gz: cd69d5421d3d4d20d1f77d7499339046192bc1ac8bb3f72b3bb773e0a0945d9da3973661693e1780b5e6328c0f556565bb65b4e5ff720b231565bc606a6622c5
7
- data.tar.gz: 02808a1982b5022f9fdaf56c53e2cd8ce9147c8d4f49b37569f74e3a21bc70719052f7f92086babfa97bce6b9d807d984fda5527b5b51d5c2578d86a39d612fb
6
+ metadata.gz: 9f0058e6fefe6ac373d03d256d0020856f53ab323883f19e7712ea72bd1130d719e70fb9a57ae853684a86a4b46e1726808ea0fdee06ab7b8ebd0273e0386311
7
+ data.tar.gz: e50323c24f03be0cd75c66a152c9c8b653ad76dd65878784a8fb59b748e4486d38dcc5b59e5820746d4d6fd77d38cf08ffc1b2091fbadbafb09bb4f1b5ee78f1
data/bin/icersplicer CHANGED
@@ -27,8 +27,7 @@ require File.expand_path(File.join(
27
27
  File.dirname(__FILE__),
28
28
  "../lib/version.rb"))
29
29
 
30
- include GlobUtils
31
- include Icersplicer
30
+ include GlobUtils, Icersplicer
32
31
 
33
32
  trap("INT") {
34
33
  puts "Goodbye see you soon!"
@@ -94,6 +93,21 @@ opts.each do |opt, arg|
94
93
  --debug '-d' Verbose debug for hacking on this project
95
94
  --nolines '-7' No Line numbers
96
95
 
96
+ Features:
97
+
98
+ Syntax highlighting / On / Off
99
+ Head /Tail functionality
100
+ Tail follow like tail -f
101
+ Support for multiple input for files / wildcards
102
+ Ability to Skip lines and line ranges and blank lines
103
+ Quiet mode for exporting large files
104
+ Countlines in a file
105
+ Grep functionality
106
+ Search & Replace in a file
107
+ Turn off line numbers
108
+ Debugging mode
109
+ Turn off line numbers
110
+
97
111
  Example:
98
112
 
99
113
  icersplicer -f inputfile --lineoffset 0 --linelimit 10 -s 3,6,9,10-15 -o outputfile
@@ -218,51 +232,55 @@ unless instance_variable_defined?("@nostats")
218
232
  end
219
233
  begin
220
234
  # Regular file / glob mask processor
221
- filenames = joinfilenames(buildfilelist(inputfile))
222
- # Iterator for file / file list
223
- filenames.split(",").each {|f|
224
- linecounter = 0
225
- ice.reset_screen
226
- puts "> Filename: #{f} <"
227
- File.open(f) {|n|
228
- n.each_line {|data|
229
- data_orig = data.clone
230
- if search_and_replace == true
231
- data.gsub!("#{search}", "#{replace}")
232
- end
233
- unless lineoffset > increment_offset
234
- unless linelimit == 0
235
- unless increment_limit > linelimit
236
- unless instance_variable_defined?("@skipblank") and data_orig.strip == ""
237
- if data_orig =~ /#{grep}/
238
- filterlines += 1
239
- ice.print_to_screen(linecounter, ice.text_processor(data), quietmode) unless ice.skip(linecounter)
240
- if instance_variable_defined?("@outputfile")
241
- data_orig.gsub!("#{search}", "#{replace}")
242
- ice.processdata(data_orig, outputfile, quietmode) unless ice.skip(linecounter)
235
+ begin
236
+ filenames = joinfilenames(buildfilelist(inputfile))
237
+ # Iterator for file / file list
238
+ filenames.split(",").each {|f|
239
+ linecounter = 0
240
+ ice.reset_screen
241
+ puts "> Filename: #{f} <"
242
+ File.open(f) {|n|
243
+ n.each_line {|data|
244
+ data_orig = data.clone
245
+ if search_and_replace == true
246
+ data.gsub!("#{search}", "#{replace}")
247
+ end
248
+ unless lineoffset > increment_offset
249
+ unless linelimit == 0
250
+ unless increment_limit > linelimit
251
+ unless instance_variable_defined?("@skipblank") and data_orig.strip == ""
252
+ if data_orig =~ /#{grep}/
253
+ filterlines += 1
254
+ ice.print_to_screen(linecounter, ice.text_processor(data), quietmode) unless ice.skip(linecounter)
255
+ if instance_variable_defined?("@outputfile")
256
+ data_orig.gsub!("#{search}", "#{replace}")
257
+ ice.processdata(data_orig, outputfile, quietmode) unless ice.skip(linecounter)
258
+ end
259
+ end
243
260
  end
244
261
  end
245
- end
246
- end
247
- else
248
- unless instance_variable_defined?("@skipblank") and data_orig.strip == ""
249
- if data_orig =~ /#{grep}/
250
- filterlines += 1
251
- ice.print_to_screen(linecounter, ice.text_processor(data), quietmode) unless ice.skip(linecounter)
252
- if instance_variable_defined?("@outputfile")
253
- data_orig.gsub!("#{search}", "#{replace}")
254
- ice.processdata(data_orig, outputfile, quietmode) unless ice.skip(linecounter)
262
+ else
263
+ unless instance_variable_defined?("@skipblank") and data_orig.strip == ""
264
+ if data_orig =~ /#{grep}/
265
+ filterlines += 1
266
+ ice.print_to_screen(linecounter, ice.text_processor(data), quietmode) unless ice.skip(linecounter)
267
+ if instance_variable_defined?("@outputfile")
268
+ data_orig.gsub!("#{search}", "#{replace}")
269
+ ice.processdata(data_orig, outputfile, quietmode) unless ice.skip(linecounter)
270
+ end
271
+ end
255
272
  end
256
273
  end
274
+ increment_limit += 1
257
275
  end
258
- end
259
- increment_limit += 1
260
- end
261
- increment_offset += 1
262
- linecounter += 1
276
+ increment_offset += 1
277
+ linecounter += 1
278
+ }
279
+ }
263
280
  }
264
- }
265
- }
281
+ rescue
282
+ raise NoMethodError, "Please specify a valid filename or wildcard file extension"
283
+ end
266
284
  rescue Errno::EPIPE, IOError
267
285
  raise IOError, "Closing session due to broken pipe"
268
286
  end
data/lib/version.rb CHANGED
@@ -4,7 +4,7 @@ module Icersplicer
4
4
  module VERSION #:nodoc:
5
5
  MAJOR = 1
6
6
  MINOR = 0
7
- TINY = 6
7
+ TINY = 7
8
8
  CODENAME = "Icey Blizzard!"
9
9
  STRING = [MAJOR, MINOR, TINY].join('.')
10
10
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: icersplicer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Hood