ansiterm 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ansiterm/string.rb +11 -1
- data/lib/ansiterm/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e87a8b37e0488b859cc89f8ebcc0ed199518d3fc
|
4
|
+
data.tar.gz: 738b1172d4ea87b8e4da9fc40eec476a5b0ba6a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e91d53b54b15a24a69944992c4da4882d2c17b549af25dab471c7b19ded12eeef36c986d2fd8f70f078cac64689aff72ec7a1071b0393cb4cad06b380e3a2f24
|
7
|
+
data.tar.gz: d6b17caf80f4e3a46d478a2d31dc3562817b7da6ed541ccec5fc44d44db7462d9fe34900070d0666da28766b98ca8a2237c8898d92d8043654b990c7bbf1c7ea
|
data/lib/ansiterm/string.rb
CHANGED
@@ -5,7 +5,7 @@ module AnsiTerm
|
|
5
5
|
def initialize(str="")
|
6
6
|
parse(str)
|
7
7
|
end
|
8
|
-
|
8
|
+
|
9
9
|
def to_str
|
10
10
|
out = ""
|
11
11
|
a = Attr.new
|
@@ -28,6 +28,10 @@ module AnsiTerm
|
|
28
28
|
@str.length
|
29
29
|
end
|
30
30
|
|
31
|
+
def index str, off = 0
|
32
|
+
@str.index(str,off)
|
33
|
+
end
|
34
|
+
|
31
35
|
def set(str,attrs)
|
32
36
|
@str, @attrs = str,Array(attrs)
|
33
37
|
end
|
@@ -43,6 +47,12 @@ module AnsiTerm
|
|
43
47
|
end
|
44
48
|
end
|
45
49
|
|
50
|
+
def << str
|
51
|
+
str = self.class.new(str)
|
52
|
+
@str << str.raw
|
53
|
+
@attrs << str.attrs
|
54
|
+
# parse(self.to_str + "\e[0m" + str.to_str)
|
55
|
+
end
|
46
56
|
|
47
57
|
private
|
48
58
|
|
data/lib/ansiterm/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ansiterm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vidar Hokstad
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-01-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|