nutrun-string 0.1.1 → 0.1.3
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/.gitignore +1 -0
- data/README.md +9 -0
- data/lib/nutrun-string.rb +12 -3
- data/lib/nutrun-string/version.rb +1 -1
- metadata +2 -2
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -7,6 +7,10 @@ During the last couple of years I've ended up using that little script again and
|
|
7
7
|
|
8
8
|
NOTE: This class will extend Ruby's native String class. Many people don't really like extending base classes, and there are a few long, loooong-winded conversations on the subject on various mailing lists and forums. We don't mind it, and if you don't too, feel free to use this gem.
|
9
9
|
|
10
|
+
## Platforms
|
11
|
+
|
12
|
+
This gem should work on every POSIX-based OS, but it has only been tested on OSX and Amazon and CentOS Linux
|
13
|
+
|
10
14
|
## Installation
|
11
15
|
|
12
16
|
Add this line to your application's Gemfile:
|
@@ -27,6 +31,11 @@ Your console strings can now do boss things such as:
|
|
27
31
|
"OMG!!1!".blink.red.underline
|
28
32
|
Check out the source for a full list of features
|
29
33
|
|
34
|
+
You can also call on a couple of special console methods:
|
35
|
+
|
36
|
+
clear_screen
|
37
|
+
clear_line
|
38
|
+
|
30
39
|
## Contributing
|
31
40
|
|
32
41
|
1. Fork it
|
data/lib/nutrun-string.rb
CHANGED
@@ -1,6 +1,16 @@
|
|
1
1
|
require "nutrun-string/version"
|
2
2
|
|
3
3
|
module Nutrun
|
4
|
+
module Cli
|
5
|
+
def clear_screen
|
6
|
+
print `clear`
|
7
|
+
end
|
8
|
+
|
9
|
+
def clear_line
|
10
|
+
print "\r"
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
4
14
|
module String
|
5
15
|
def red
|
6
16
|
"\e[31m#{self}\e[0m"
|
@@ -101,6 +111,5 @@ module Nutrun
|
|
101
111
|
end
|
102
112
|
end
|
103
113
|
|
104
|
-
|
105
|
-
|
106
|
-
end
|
114
|
+
String.send(:include,Nutrun::String)
|
115
|
+
self.send(:include,Nutrun::Cli)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nutrun-string
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-11-
|
13
|
+
date: 2012-11-20 00:00:00.000000000Z
|
14
14
|
dependencies: []
|
15
15
|
description: Pimp my console strings
|
16
16
|
email:
|