attn 0.0.0 → 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/attn.rb +13 -6
  3. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b643305b524aac15f3be9a32ef361779b9123bc1
4
- data.tar.gz: 907a17fcd9b4bcedad10559c68e735df84ce242d
3
+ metadata.gz: 64206b0dec6095905aa7127609c903f7c894a457
4
+ data.tar.gz: 22b093ea290d502e97ee392b29da1f4aecafd663
5
5
  SHA512:
6
- metadata.gz: 59d9d8ba005967c771e0cbe3edc3c2ab818e5b5a3825dc6f442166f4423e3a20f7556addd35b1dbc8ac1199fcd2f693e1e736c5f63362ae33188b7a20b18d462
7
- data.tar.gz: 878943bac627b905510a825fe773b7a5affd0eb0c997f52192612541db9c35c079985dcc011359c38a95b572d6b8b4b70a0ba1971120dd2f469fea694ebaaae5
6
+ metadata.gz: eefd00fba8c70f58099a22010928f7a0a9f031b8725a660888940947eaf8be36d0afac90febd551b04065f3c3d5fa79627839465b936a906af304f3dbcb77b68
7
+ data.tar.gz: 5c6f4bb8efc182a91a84db70f9296154e9222ac0249d455499e8d80e007e10801dbaaa58cf815165b08698f2e13be5067720f87d6181ffb70347b695c00f8709
@@ -1,9 +1,16 @@
1
- def attn(method = nil)
1
+ def attn(method = nil, color = 'yellow')
2
+ colors = {'red' => '031','green' => '032','yellow' => '033','blue' => '034','magenta' => '035','cyan' => '036'}
3
+
4
+ color,method = method,nil if colors.keys.include?(method)
5
+ color = 'yellow' unless colors.keys.include?(color)
6
+
2
7
  unless method
3
- print "\033[43m* * * * * * * * * * * * * * * * * * * *\033[0m\n"
8
+ print "\033[#{colors[color]}m* * * * * * * * * * * * * * * * * * * * * * * * *\033[0m\n"
4
9
  else
5
- print "\033[43m* * * * * * * * * * * * * * * * * * * *\033[0m\n"
6
- p method
7
- print "\033[43m* * * * * * * * * * * * * * * * * * * *\033[0m\n"
10
+ proc = Proc.new { method }
11
+ print "\033[#{colors[color]}m* * * * * * * * * * START * * * * * * * * * * * *\033[0m\n"
12
+ p proc.call
13
+ print "\033[#{colors[color]}m* * * * * * * * * * FINISH * * * * * * * * * * *\033[0m\n"
8
14
  end
9
- end
15
+
16
+ end
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: attn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 0.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shawn Watson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-02 00:00:00.000000000 Z
11
+ date: 2016-05-03 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description: A simple gem to make finding specific lines of code easier in the console
13
+ description: A simple gem to make finding specific lines of output easier in the console
14
14
  email: shawn.h.watson@gmail.com
15
15
  executables: []
16
16
  extensions: []
@@ -40,5 +40,5 @@ rubyforge_project:
40
40
  rubygems_version: 2.4.5
41
41
  signing_key:
42
42
  specification_version: 4
43
- summary: Easy to spot strings in the console
43
+ summary: Easy to spot, colored strings in the console
44
44
  test_files: []