nutrun-string 0.1.1 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -15,3 +15,4 @@ spec/reports
15
15
  test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
+ *.tmproj
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
@@ -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
- class String
105
- include Nutrun::String
106
- end
114
+ String.send(:include,Nutrun::String)
115
+ self.send(:include,Nutrun::Cli)
@@ -1,5 +1,5 @@
1
1
  module Nutrun
2
2
  module String
3
- VERSION = "0.1.1"
3
+ VERSION = "0.1.3"
4
4
  end
5
5
  end
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.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-19 00:00:00.000000000Z
13
+ date: 2012-11-20 00:00:00.000000000Z
14
14
  dependencies: []
15
15
  description: Pimp my console strings
16
16
  email: