ssoroka-ansi 1.0.0 → 1.0.1
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.
- data/README.rdoc +14 -12
- data/Rakefile +1 -1
- data/ansi.gemspec +1 -1
- data/init.rb +1 -0
- metadata +1 -1
data/README.rdoc
CHANGED
@@ -14,23 +14,25 @@ as a plugin:
|
|
14
14
|
|
15
15
|
== USAGE
|
16
16
|
|
17
|
+
require 'ansi' # if not installed as a plugin.
|
18
|
+
|
17
19
|
1) Simply control the cursor:
|
18
|
-
>> puts "HELLO" + ANSI.right(30) + "THERE!"
|
19
|
-
HELLO THERE!
|
20
|
+
>> puts "HELLO" + ANSI.right(30) + "THERE!"
|
21
|
+
HELLO THERE!
|
20
22
|
|
21
23
|
2) use colors:
|
22
24
|
|
23
|
-
>> puts ANSI.color(:red) { "hello there" }
|
24
|
-
>> puts ANSI.color(:green) + "Everything is green now" + ANSI.no_color
|
25
|
+
>> puts ANSI.color(:red) { "hello there" }
|
26
|
+
>> puts ANSI.color(:green) + "Everything is green now" + ANSI.no_color
|
25
27
|
|
26
28
|
3) loops:
|
27
29
|
|
28
|
-
printf ANSI.clear_screen
|
29
|
-
puts "Processing users..."
|
30
|
-
max = User.count
|
31
|
-
User.all.each_with_index {|user, index|
|
32
|
-
|
33
|
-
|
34
|
-
}
|
35
|
-
puts " done!"
|
30
|
+
printf ANSI.clear_screen
|
31
|
+
puts "Processing users..."
|
32
|
+
max = User.count
|
33
|
+
User.all.each_with_index {|user, index|
|
34
|
+
user.update_something!
|
35
|
+
printf ANSI.left(50) + "Processed #{index}/#{max} users..."
|
36
|
+
}
|
37
|
+
puts " done!"
|
36
38
|
|
data/Rakefile
CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
|
|
2
2
|
require 'rake'
|
3
3
|
require 'echoe'
|
4
4
|
|
5
|
-
Echoe.new('ansi', '1.0.
|
5
|
+
Echoe.new('ansi', '1.0.1') do |p|
|
6
6
|
p.description = 'Use ANSI codes in printed output, including colors and controlling the cursor, clearing the line, and clearing the screen.'
|
7
7
|
p.url = 'http://github.com/ssoroka/ansi'
|
8
8
|
p.author = 'Steven Soroka'
|
data/ansi.gemspec
CHANGED
data/init.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/lib/ansi'
|