tty_string 0.1.0
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.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/.gitmodules +3 -0
- data/.rspec +3 -0
- data/.rubocop.yml +1 -0
- data/.travis.yml +5 -0
- data/Gemfile +8 -0
- data/Gemfile.lock +63 -0
- data/LICENSE.txt +21 -0
- data/README.md +68 -0
- data/Rakefile +8 -0
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/lib/tty_string/cursor.rb +56 -0
- data/lib/tty_string/parser.rb +82 -0
- data/lib/tty_string/renderer.rb +104 -0
- data/lib/tty_string/screen.rb +88 -0
- data/lib/tty_string/version.rb +5 -0
- data/lib/tty_string.rb +21 -0
- data/tty_string.gemspec +31 -0
- metadata +161 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 5cf9c99684d1bffc4b5238d85a0fbddc6c228a92
|
4
|
+
data.tar.gz: 29daa63edffa32d87215419a32c0f3eb06511648
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: c0184931cc63e842676e467f9cf1e3262f97a3e191f690bc100e075f389cdd54e3d94d09295da58a2e23a97b9f27836cd3eaf6772a67079184b1fc8030cd05ac
|
7
|
+
data.tar.gz: 5804b7bcf35cb28a18feeb330662cac534b307badd16f2ebd5e138a772fcd8cf4743702181d33a208bf6b20f8d03013ac0f77fae7e1faba4eb1745bbb2687296
|
data/.gitignore
ADDED
data/.gitmodules
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
rubocop_yml/rubocop.yml
|
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
tty_string (0.1.0)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
ast (2.4.0)
|
10
|
+
coderay (1.1.2)
|
11
|
+
diff-lcs (1.3)
|
12
|
+
jaro_winkler (1.5.3)
|
13
|
+
method_source (0.9.2)
|
14
|
+
parallel (1.17.0)
|
15
|
+
parser (2.6.4.1)
|
16
|
+
ast (~> 2.4.0)
|
17
|
+
pry (0.12.2)
|
18
|
+
coderay (~> 1.1.0)
|
19
|
+
method_source (~> 0.9.0)
|
20
|
+
rainbow (3.0.0)
|
21
|
+
rake (10.5.0)
|
22
|
+
rspec (3.8.0)
|
23
|
+
rspec-core (~> 3.8.0)
|
24
|
+
rspec-expectations (~> 3.8.0)
|
25
|
+
rspec-mocks (~> 3.8.0)
|
26
|
+
rspec-core (3.8.2)
|
27
|
+
rspec-support (~> 3.8.0)
|
28
|
+
rspec-expectations (3.8.4)
|
29
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
30
|
+
rspec-support (~> 3.8.0)
|
31
|
+
rspec-mocks (3.8.1)
|
32
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
33
|
+
rspec-support (~> 3.8.0)
|
34
|
+
rspec-support (3.8.2)
|
35
|
+
rubocop (0.74.0)
|
36
|
+
jaro_winkler (~> 1.5.1)
|
37
|
+
parallel (~> 1.10)
|
38
|
+
parser (>= 2.6)
|
39
|
+
rainbow (>= 2.2.2, < 4.0)
|
40
|
+
ruby-progressbar (~> 1.7)
|
41
|
+
unicode-display_width (>= 1.4.0, < 1.7)
|
42
|
+
rubocop-performance (1.4.1)
|
43
|
+
rubocop (>= 0.71.0)
|
44
|
+
rubocop-rspec (1.35.0)
|
45
|
+
rubocop (>= 0.60.0)
|
46
|
+
ruby-progressbar (1.10.1)
|
47
|
+
unicode-display_width (1.6.0)
|
48
|
+
|
49
|
+
PLATFORMS
|
50
|
+
ruby
|
51
|
+
|
52
|
+
DEPENDENCIES
|
53
|
+
bundler (~> 1.16)
|
54
|
+
pry (~> 0.12.2)
|
55
|
+
rake (~> 10.0)
|
56
|
+
rspec (~> 3.0)
|
57
|
+
rubocop (~> 0.74.0)
|
58
|
+
rubocop-performance (~> 1.4.1)
|
59
|
+
rubocop-rspec (~> 1.35.0)
|
60
|
+
tty_string!
|
61
|
+
|
62
|
+
BUNDLED WITH
|
63
|
+
1.16.0
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2019 Dana Sherson
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,68 @@
|
|
1
|
+
# TTYString
|
2
|
+
|
3
|
+
Render a string like your terminal does by parsing ANSI TTY codes.
|
4
|
+
This is useful for testing CLI's
|
5
|
+
|
6
|
+
Supported codes
|
7
|
+
|
8
|
+
- \b
|
9
|
+
- \e[A
|
10
|
+
- \e[B
|
11
|
+
- \e[C
|
12
|
+
- \e[D
|
13
|
+
- \e[E
|
14
|
+
- \e[F
|
15
|
+
- \e[G
|
16
|
+
- \e[H
|
17
|
+
- \e[J
|
18
|
+
- \e[K
|
19
|
+
- \e[f
|
20
|
+
- \e[m
|
21
|
+
- \n
|
22
|
+
- \r
|
23
|
+
- \t
|
24
|
+
|
25
|
+
## Installation
|
26
|
+
|
27
|
+
Add this line to your application's Gemfile:
|
28
|
+
|
29
|
+
```ruby
|
30
|
+
gem 'tty_string'
|
31
|
+
```
|
32
|
+
|
33
|
+
And then execute:
|
34
|
+
|
35
|
+
$ bundle
|
36
|
+
|
37
|
+
Or install it yourself as:
|
38
|
+
|
39
|
+
$ gem install tty_string
|
40
|
+
|
41
|
+
## Usage
|
42
|
+
|
43
|
+
```
|
44
|
+
TTYString.new("th\ta string\e[3Gis is").to_s => "this is a string"
|
45
|
+
```
|
46
|
+
|
47
|
+
Styling information is suppressed by default:
|
48
|
+
```
|
49
|
+
TTYString.new("th\ta \e[31mstring\e[0m\e[3Gis is", clear_style: false).to_s => "this is a string"
|
50
|
+
```
|
51
|
+
But can be passed through:
|
52
|
+
```
|
53
|
+
TTYString.new("th\ta \e[31mstring\e[0m\e[3Gis is", clear_style: false).to_s => "this is a \e[31mstring\e[0m"
|
54
|
+
```
|
55
|
+
|
56
|
+
## Development
|
57
|
+
|
58
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
59
|
+
|
60
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
61
|
+
|
62
|
+
## Contributing
|
63
|
+
|
64
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/robotdana/tty_string.
|
65
|
+
|
66
|
+
## License
|
67
|
+
|
68
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require 'bundler/setup'
|
5
|
+
require 'tty_string'
|
6
|
+
|
7
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
8
|
+
# with your gem easier. You can also use a different console, if you like.
|
9
|
+
|
10
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
11
|
+
# require "pry"
|
12
|
+
# Pry.start
|
13
|
+
|
14
|
+
require 'irb'
|
15
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class TTYString
|
4
|
+
# point on a screen. you can move it
|
5
|
+
class Cursor
|
6
|
+
attr_reader :row, :col
|
7
|
+
|
8
|
+
def initialize(row = 0, col = 0)
|
9
|
+
@row = row
|
10
|
+
@col = col
|
11
|
+
end
|
12
|
+
|
13
|
+
def row=(value)
|
14
|
+
@row = value.to_i
|
15
|
+
@row = 0 if @row.negative?
|
16
|
+
end
|
17
|
+
|
18
|
+
def col=(value)
|
19
|
+
@col = value.to_i
|
20
|
+
@col = 0 if @col.negative?
|
21
|
+
end
|
22
|
+
|
23
|
+
def left(count = 1)
|
24
|
+
count = count.to_i
|
25
|
+
raise ArgumentError if count.negative?
|
26
|
+
|
27
|
+
self.col -= count
|
28
|
+
end
|
29
|
+
|
30
|
+
def up(count = 1)
|
31
|
+
count = count.to_i
|
32
|
+
raise ArgumentError if count.negative?
|
33
|
+
|
34
|
+
self.row -= count
|
35
|
+
end
|
36
|
+
|
37
|
+
def down(count = 1)
|
38
|
+
count = count.to_i
|
39
|
+
raise ArgumentError unless count >= 0
|
40
|
+
|
41
|
+
self.row += count
|
42
|
+
end
|
43
|
+
|
44
|
+
def right(count = 1)
|
45
|
+
count = count.to_i
|
46
|
+
raise ArgumentError unless count >= 0
|
47
|
+
|
48
|
+
self.col += count
|
49
|
+
end
|
50
|
+
|
51
|
+
def to_ary
|
52
|
+
[row, col]
|
53
|
+
end
|
54
|
+
alias to_a to_ary
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,82 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'strscan'
|
4
|
+
require_relative 'renderer'
|
5
|
+
|
6
|
+
class TTYString
|
7
|
+
# Reads the text string a
|
8
|
+
class Parser < StringScanner
|
9
|
+
def render(clear_style: true)
|
10
|
+
reset
|
11
|
+
@clear_style = clear_style
|
12
|
+
@renderer = Renderer.new
|
13
|
+
read until eos?
|
14
|
+
renderer.to_s
|
15
|
+
end
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
attr_reader :renderer
|
20
|
+
attr_reader :clear_style
|
21
|
+
|
22
|
+
def write(string)
|
23
|
+
renderer.write(string)
|
24
|
+
end
|
25
|
+
|
26
|
+
def read
|
27
|
+
text || slash_n || slash_r || slash_t || slash_b || slash_e
|
28
|
+
end
|
29
|
+
|
30
|
+
def text
|
31
|
+
write(matched) if scan(text_regexp)
|
32
|
+
end
|
33
|
+
|
34
|
+
def slash_n
|
35
|
+
renderer.slash_n if skip(/\n/)
|
36
|
+
end
|
37
|
+
|
38
|
+
def slash_r
|
39
|
+
renderer.slash_r if skip(/\r/)
|
40
|
+
end
|
41
|
+
|
42
|
+
def slash_t
|
43
|
+
renderer.slash_t if skip(/\t/)
|
44
|
+
end
|
45
|
+
|
46
|
+
def slash_b
|
47
|
+
# can't use `scan(/\b/)` because it matches everything
|
48
|
+
return unless peek(1) == "\b"
|
49
|
+
|
50
|
+
self.pos += 1
|
51
|
+
renderer.slash_b
|
52
|
+
end
|
53
|
+
|
54
|
+
def slash_e
|
55
|
+
return unless scan(csi_regexp)
|
56
|
+
|
57
|
+
args = matched.slice(2..-2).split(';')
|
58
|
+
command = matched.slice(-1)
|
59
|
+
render_csi(:"csi_#{command}", *args)
|
60
|
+
end
|
61
|
+
|
62
|
+
def csi_regexp
|
63
|
+
@csi_regexp ||= Regexp.new("\e#{csi_pattern}")
|
64
|
+
end
|
65
|
+
|
66
|
+
def csi_pattern
|
67
|
+
"\\[(\\d+;?|;)*[ABCDEFGHJKf#{'m' if clear_style}]"
|
68
|
+
end
|
69
|
+
|
70
|
+
def text_regexp
|
71
|
+
@text_regexp ||= Regexp.new("[^\b\t\r\n\e]|\e(?!#{csi_pattern})")
|
72
|
+
end
|
73
|
+
|
74
|
+
def render_csi(method, *args)
|
75
|
+
method = renderer.method(method)
|
76
|
+
params = method.parameters
|
77
|
+
args = args.take(params.length) unless params.assoc(:rest)
|
78
|
+
args = [] if args.all?(&:empty?)
|
79
|
+
method.call(*args)
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
@@ -0,0 +1,104 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'screen'
|
4
|
+
class TTYString
|
5
|
+
# turns the text string into screen instructions
|
6
|
+
class Renderer
|
7
|
+
attr_reader :screen
|
8
|
+
|
9
|
+
def initialize
|
10
|
+
@screen = Screen.new
|
11
|
+
end
|
12
|
+
|
13
|
+
def to_s
|
14
|
+
screen.to_s
|
15
|
+
end
|
16
|
+
|
17
|
+
def write(string)
|
18
|
+
screen.write(string)
|
19
|
+
end
|
20
|
+
|
21
|
+
# rubocop:disable Naming/MethodName
|
22
|
+
def csi_A(rows = 1)
|
23
|
+
cursor.up(rows)
|
24
|
+
end
|
25
|
+
|
26
|
+
def csi_B(rows = 1)
|
27
|
+
cursor.down(rows)
|
28
|
+
end
|
29
|
+
|
30
|
+
def csi_C(cols = 1)
|
31
|
+
cursor.right(cols)
|
32
|
+
end
|
33
|
+
|
34
|
+
def csi_D(cols = 1)
|
35
|
+
cursor.left(cols)
|
36
|
+
end
|
37
|
+
|
38
|
+
def csi_E(rows = 1)
|
39
|
+
cursor.down(rows)
|
40
|
+
cursor.col = 0
|
41
|
+
end
|
42
|
+
|
43
|
+
def csi_F(rows = 1)
|
44
|
+
cursor.up(rows)
|
45
|
+
cursor.col = 0
|
46
|
+
end
|
47
|
+
|
48
|
+
def csi_G(col = 1)
|
49
|
+
cursor.col = col.to_i - 1 # cursor is zero indexed, arg is 1 indexed
|
50
|
+
end
|
51
|
+
|
52
|
+
def csi_H(row = 1, col = 1)
|
53
|
+
# cursor is zero indexed, arg is 1 indexed
|
54
|
+
cursor.row = row.to_i - 1
|
55
|
+
cursor.col = col.to_i - 1
|
56
|
+
end
|
57
|
+
alias csi_f csi_H
|
58
|
+
|
59
|
+
def csi_J(mode = 0)
|
60
|
+
case mode.to_i
|
61
|
+
when 0 then screen.clear_forward
|
62
|
+
when 1 then screen.clear_backward
|
63
|
+
when 2, 3 then screen.clear
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
def csi_K(mode = 0)
|
68
|
+
case mode.to_i
|
69
|
+
when 0 then screen.clear_line_forward
|
70
|
+
when 1 then screen.clear_line_backward
|
71
|
+
when 2 then screen.clear_line
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
def csi_m(*args)
|
76
|
+
end
|
77
|
+
# rubocop:enable Naming/MethodName
|
78
|
+
|
79
|
+
def slash_b
|
80
|
+
cursor.left
|
81
|
+
screen.clear_at_cursor
|
82
|
+
end
|
83
|
+
|
84
|
+
def slash_n
|
85
|
+
cursor.down
|
86
|
+
cursor.col = 0
|
87
|
+
screen.write('')
|
88
|
+
end
|
89
|
+
|
90
|
+
def slash_r
|
91
|
+
cursor.col = 0
|
92
|
+
end
|
93
|
+
|
94
|
+
def slash_t
|
95
|
+
cursor.right(8 - (cursor.col % 8))
|
96
|
+
end
|
97
|
+
|
98
|
+
private
|
99
|
+
|
100
|
+
def cursor
|
101
|
+
screen.cursor
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
@@ -0,0 +1,88 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'cursor'
|
4
|
+
|
5
|
+
class TTYString
|
6
|
+
# a grid to draw on
|
7
|
+
class Screen
|
8
|
+
attr_reader :cursor
|
9
|
+
|
10
|
+
def initialize
|
11
|
+
@cursor = Cursor.new
|
12
|
+
@screen = []
|
13
|
+
end
|
14
|
+
|
15
|
+
def to_s
|
16
|
+
screen.map { |c| Array(c).map { |x| x || ' ' }.join.rstrip }.join("\n")
|
17
|
+
end
|
18
|
+
|
19
|
+
def []=((row, col), *value)
|
20
|
+
screen[row] ||= []
|
21
|
+
screen[row][col] = value.flatten(1)
|
22
|
+
end
|
23
|
+
|
24
|
+
def []((row, col))
|
25
|
+
screen[row] ||= []
|
26
|
+
screen[row][col]
|
27
|
+
end
|
28
|
+
|
29
|
+
def clear_at_cursor
|
30
|
+
self[cursor] = nil
|
31
|
+
end
|
32
|
+
|
33
|
+
def clear_line_forward
|
34
|
+
screen[row].fill(nil, col..-1)
|
35
|
+
end
|
36
|
+
|
37
|
+
def clear_line_backward
|
38
|
+
screen[row].fill(nil, 0..col)
|
39
|
+
end
|
40
|
+
|
41
|
+
def clear_line
|
42
|
+
screen[row] = []
|
43
|
+
end
|
44
|
+
|
45
|
+
def clear
|
46
|
+
@screen = []
|
47
|
+
end
|
48
|
+
|
49
|
+
def clear_lines_before
|
50
|
+
screen.fill([], 0...row)
|
51
|
+
end
|
52
|
+
|
53
|
+
def clear_lines_after
|
54
|
+
screen.slice!((row + 1)..-1)
|
55
|
+
end
|
56
|
+
|
57
|
+
def clear_backward
|
58
|
+
clear_line_backward
|
59
|
+
clear_lines_before
|
60
|
+
end
|
61
|
+
|
62
|
+
def clear_forward
|
63
|
+
clear_lines_after
|
64
|
+
clear_line_forward
|
65
|
+
end
|
66
|
+
|
67
|
+
def write(string)
|
68
|
+
return self[cursor] if string.empty?
|
69
|
+
|
70
|
+
string.each_char do |char|
|
71
|
+
self[cursor] = char
|
72
|
+
cursor.right
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
private
|
77
|
+
|
78
|
+
attr_reader :screen
|
79
|
+
|
80
|
+
def row
|
81
|
+
cursor.row
|
82
|
+
end
|
83
|
+
|
84
|
+
def col
|
85
|
+
cursor.col
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
data/lib/tty_string.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'tty_string/parser'
|
4
|
+
|
5
|
+
# Renders a string taking into ANSI escape codes and \t\r\n etc
|
6
|
+
# Usage: TTYString.new("this\r\e[Kthat").to_s => "that"
|
7
|
+
class TTYString
|
8
|
+
def initialize(input_string, clear_style: true)
|
9
|
+
@parser = Parser.new(input_string)
|
10
|
+
@clear_style = clear_style
|
11
|
+
end
|
12
|
+
|
13
|
+
def to_s
|
14
|
+
parser.render(clear_style: clear_style)
|
15
|
+
end
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
attr_reader :clear_style
|
20
|
+
attr_reader :parser
|
21
|
+
end
|
data/tty_string.gemspec
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
lib = File.expand_path('lib', __dir__)
|
4
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
+
require 'tty_string/version'
|
6
|
+
|
7
|
+
Gem::Specification.new do |spec|
|
8
|
+
spec.name = 'tty_string'
|
9
|
+
spec.version = TTYString::VERSION
|
10
|
+
spec.authors = ['Dana Sherson']
|
11
|
+
spec.email = ['robot@dana.sh']
|
12
|
+
|
13
|
+
spec.summary = 'Render a string using ANSI TTY codes'
|
14
|
+
spec.homepage = "https://github.com/robotdana/tty_string"
|
15
|
+
spec.license = 'MIT'
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
18
|
+
f.match(%r{^(test|spec|features|\.?rubocop|\.travis|\.git|\.rspec)/})
|
19
|
+
end
|
20
|
+
spec.bindir = 'exe'
|
21
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
|
+
spec.require_paths = ['lib']
|
23
|
+
|
24
|
+
spec.add_development_dependency 'bundler', '~> 1.16'
|
25
|
+
spec.add_development_dependency 'pry', '~> 0.12.2'
|
26
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
27
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
28
|
+
spec.add_development_dependency 'rubocop', '~> 0.74.0'
|
29
|
+
spec.add_development_dependency 'rubocop-performance', '~> 1.4.1'
|
30
|
+
spec.add_development_dependency 'rubocop-rspec', '~> 1.35.0'
|
31
|
+
end
|
metadata
ADDED
@@ -0,0 +1,161 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: tty_string
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Dana Sherson
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-09-21 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.16'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.16'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: pry
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.12.2
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.12.2
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '10.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '10.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '3.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '3.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rubocop
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 0.74.0
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 0.74.0
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rubocop-performance
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 1.4.1
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 1.4.1
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rubocop-rspec
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 1.35.0
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 1.35.0
|
111
|
+
description:
|
112
|
+
email:
|
113
|
+
- robot@dana.sh
|
114
|
+
executables: []
|
115
|
+
extensions: []
|
116
|
+
extra_rdoc_files: []
|
117
|
+
files:
|
118
|
+
- ".gitignore"
|
119
|
+
- ".gitmodules"
|
120
|
+
- ".rspec"
|
121
|
+
- ".rubocop.yml"
|
122
|
+
- ".travis.yml"
|
123
|
+
- Gemfile
|
124
|
+
- Gemfile.lock
|
125
|
+
- LICENSE.txt
|
126
|
+
- README.md
|
127
|
+
- Rakefile
|
128
|
+
- bin/console
|
129
|
+
- bin/setup
|
130
|
+
- lib/tty_string.rb
|
131
|
+
- lib/tty_string/cursor.rb
|
132
|
+
- lib/tty_string/parser.rb
|
133
|
+
- lib/tty_string/renderer.rb
|
134
|
+
- lib/tty_string/screen.rb
|
135
|
+
- lib/tty_string/version.rb
|
136
|
+
- tty_string.gemspec
|
137
|
+
homepage: https://github.com/robotdana/tty_string
|
138
|
+
licenses:
|
139
|
+
- MIT
|
140
|
+
metadata: {}
|
141
|
+
post_install_message:
|
142
|
+
rdoc_options: []
|
143
|
+
require_paths:
|
144
|
+
- lib
|
145
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
146
|
+
requirements:
|
147
|
+
- - ">="
|
148
|
+
- !ruby/object:Gem::Version
|
149
|
+
version: '0'
|
150
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
151
|
+
requirements:
|
152
|
+
- - ">="
|
153
|
+
- !ruby/object:Gem::Version
|
154
|
+
version: '0'
|
155
|
+
requirements: []
|
156
|
+
rubyforge_project:
|
157
|
+
rubygems_version: 2.5.2.1
|
158
|
+
signing_key:
|
159
|
+
specification_version: 4
|
160
|
+
summary: Render a string using ANSI TTY codes
|
161
|
+
test_files: []
|