toolman 0.1.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 07c7d4b07541b7312a6221c6f479b9cadc2b6996
4
- data.tar.gz: 78f8cae8e0a6511d7fd9cc8505a05cc94aafefdf
3
+ metadata.gz: 9303ecc563c9d8c1ed1c42372f2262b2ea777996
4
+ data.tar.gz: e6fae610e81488c333f6f6235277168109a310b4
5
5
  SHA512:
6
- metadata.gz: 62c04aefd406fa7325c6c8781d18623594b8a2766a0bd9aac31ca6cd7b05765db8264a93c0c6aa83d105bfbb53c28d0167e550be8d176f240281ea9f43d1566d
7
- data.tar.gz: 7a0c2ddd042c8ebde2628382337dd1cb4c8eaecce71e8da0be9d77908dd2ce7843ecc6dbd166611a1025df88c5bc144e9251f076110530cb3963791ed3afc060
6
+ metadata.gz: d28a1ca63be95cf5e365f694dea355f4c1c18443be066447232ded93a59044542cfc143fe926fe6096ae275e02e5b0738336df0100bd6a4a1861ca76b78e19a1
7
+ data.tar.gz: 93befedaa1ac5757afd908c99f9d154e1a26db2bd9cefc5af34d37e54121cf11a883bc73c7c7ceb3e0419c4c5ea3741349b53877fa36d0038758b4c6f00565ba
@@ -1,3 +1,3 @@
1
1
  module Toolman
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.1"
3
3
  end
data/lib/toolman.rb CHANGED
@@ -32,8 +32,9 @@ module Toolman
32
32
 
33
33
  def initialize
34
34
  @tempPoint = 0
35
- @circle = ["|","\\","-","/"]
35
+ @circle = [">",">>",">>>",">>>>"," >>>"," >>"," >"," "]
36
36
  @circleSize = @circle.size
37
+ @colorMechine = Color.new
37
38
  end
38
39
 
39
40
 
@@ -48,9 +49,13 @@ module Toolman
48
49
  p = (( (nowPoint*1.0) / endPoint) * 100).floor
49
50
  print "\r"
50
51
  print " \r"
51
- print "#{p}%#{@circle[@tempPoint]}"
52
+ print "%5d%-3s%-5s%-3s" % [p,"%","#{@circle[@tempPoint]}",""]
52
53
  @tempPoint = (@tempPoint + 1) % @circleSize
53
54
  end
55
+
56
+ def puts
57
+ @colorMechine
58
+ end
54
59
  end
55
60
 
56
61
  class ToolmanS
@@ -60,8 +65,12 @@ module Toolman
60
65
  @circle = ["|","\\","-","/"]
61
66
  @circleSize = @circle.size
62
67
  @loadBarPid = 0
68
+ @colorMechine = Color.new
69
+ end
70
+
71
+ def puts
72
+ @colorMechine
63
73
  end
64
-
65
74
 
66
75
 
67
76
  def say(data)
@@ -128,4 +137,33 @@ module Toolman
128
137
  end
129
138
  end
130
139
 
140
+ class Color
141
+ def red(string)
142
+ puts colorize1(string, 31)
143
+ end
144
+
145
+ def green(string)
146
+ puts colorize1(string, 32)
147
+ end
148
+ def blue(string)
149
+ puts colorize1(string, 33)
150
+ end
151
+
152
+ def blue(string)
153
+ puts colorize1(string, 34)
154
+ end
155
+
156
+ def cyan(string)
157
+ puts colorize1(string, 36)
158
+ end
159
+
160
+
161
+ def colorize2(text, color_code)
162
+ "\e[1;#{color_code}m#{text}\e[0m"
163
+ end
164
+ def colorize1(text, color_code)
165
+ "\e[#{color_code}m#{text}\e[0m"
166
+ end
167
+ end
168
+
131
169
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: toolman
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mikeva
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-20 00:00:00.000000000 Z
11
+ date: 2015-06-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler