seashell 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/seashell.rb +58 -0
- metadata +64 -0
data/lib/seashell.rb
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
class Seashell
|
2
|
+
def initialize
|
3
|
+
@indent = 0
|
4
|
+
end
|
5
|
+
|
6
|
+
def _level
|
7
|
+
" " * @indent
|
8
|
+
end
|
9
|
+
|
10
|
+
def indent
|
11
|
+
@indent = @indent + 1
|
12
|
+
end
|
13
|
+
|
14
|
+
def unindent
|
15
|
+
@indent = (@indent - 1) unless @indent == 0
|
16
|
+
end
|
17
|
+
|
18
|
+
def action(s)
|
19
|
+
print _level + s
|
20
|
+
$stdout.flush
|
21
|
+
end
|
22
|
+
|
23
|
+
def msg(s)
|
24
|
+
puts _level + s
|
25
|
+
end
|
26
|
+
|
27
|
+
def ok
|
28
|
+
print " [" + _green("OK") + "]\n"
|
29
|
+
$stdout.flush
|
30
|
+
end
|
31
|
+
|
32
|
+
def done
|
33
|
+
print " [" + _green("DONE") + "]\n"
|
34
|
+
$stdout.flush
|
35
|
+
end
|
36
|
+
|
37
|
+
def failed
|
38
|
+
print " [" + _red("FAILED") + "]\n"
|
39
|
+
$stdout.flush
|
40
|
+
end
|
41
|
+
|
42
|
+
def error
|
43
|
+
print " [" + _red("ERROR") + "]\n"
|
44
|
+
$stdout.flush
|
45
|
+
end
|
46
|
+
|
47
|
+
def _colorize(c, s)
|
48
|
+
"\e[#{c}m#{s}\e[0m"
|
49
|
+
end
|
50
|
+
|
51
|
+
def _green(s)
|
52
|
+
_colorize(32, s)
|
53
|
+
end
|
54
|
+
|
55
|
+
def _red(s)
|
56
|
+
_colorize(31, s)
|
57
|
+
end
|
58
|
+
end
|
metadata
ADDED
@@ -0,0 +1,64 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: seashell
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 1
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
version: 1.0.0
|
10
|
+
platform: ruby
|
11
|
+
authors:
|
12
|
+
- Toby Lawrence
|
13
|
+
autorequire:
|
14
|
+
bindir: bin
|
15
|
+
cert_chain: []
|
16
|
+
|
17
|
+
date: 2013-09-02 00:00:00 -04:00
|
18
|
+
default_executable:
|
19
|
+
dependencies: []
|
20
|
+
|
21
|
+
description:
|
22
|
+
email: me@yournameistoby@.com
|
23
|
+
executables: []
|
24
|
+
|
25
|
+
extensions: []
|
26
|
+
|
27
|
+
extra_rdoc_files: []
|
28
|
+
|
29
|
+
files:
|
30
|
+
- lib/seashell.rb
|
31
|
+
has_rdoc: true
|
32
|
+
homepage: http://rubygems.org/gems/seashell
|
33
|
+
licenses:
|
34
|
+
- MIT
|
35
|
+
post_install_message:
|
36
|
+
rdoc_options: []
|
37
|
+
|
38
|
+
require_paths:
|
39
|
+
- lib
|
40
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ">="
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
segments:
|
46
|
+
- 0
|
47
|
+
version: "0"
|
48
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
segments:
|
54
|
+
- 0
|
55
|
+
version: "0"
|
56
|
+
requirements: []
|
57
|
+
|
58
|
+
rubyforge_project:
|
59
|
+
rubygems_version: 1.3.7
|
60
|
+
signing_key:
|
61
|
+
specification_version: 3
|
62
|
+
summary: Utility library for emulating shell script/init script facilities. Colorize your output and more.
|
63
|
+
test_files: []
|
64
|
+
|