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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/bin/icersplicer +5 -1
  3. data/lib/icersplicer.rb +16 -13
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c79c144aea7b10ae25373863f07871e381b53baf
4
- data.tar.gz: 135decaecbfe484b53fef4579e31b8a5477a01bc
3
+ metadata.gz: aa5eaf273fcb7862ad081ad0944b41c60d2def7e
4
+ data.tar.gz: 7fcc0e5257079277bb47ff0c5a1b2da401b1444e
5
5
  SHA512:
6
- metadata.gz: 201632e6e5dcb26d1c80792a6bfb4a65d4109349622c915c533051ebb147400b68a25eddf4a741c4ee8c96b3312da905c66fbdcd72ffb89de857542c522527d6
7
- data.tar.gz: 5e6b0a8962aaa87ccb6e9dcbf263b7dc88544b9c15f8fe3eb29378cfa4d70fdca0f76ac915494ad5d511138de3f697fcb31da443d49facbc82190e30bc05ce3d
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 = 8
18
- TINY = 9
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
- "red" => 1,
33
- "green" => 2,
34
- "yellow" => 3,
35
- "blue" => 4,
36
- "purple" => 5,
37
- "cyan" => 6,
38
- "white" => 7}
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
- puts "\e[1;33mLn: #{linenum}:\e[0m\ #{text}" unless quiet == true
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 == true
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"
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: 0.8.9
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Hood