term-slides 0.13.0 → 0.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/examples/basic.rb +3 -3
- data/lib/term-slides.rb +14 -1
- data/lib/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c0f6ce8ea24b563ab91dabfdaa5e3062acdd203eea706bbd6580b9635f71e5c4
|
4
|
+
data.tar.gz: 1ebbefa2999d127f7e59d8ebeedca2b727cf3645dbe2b9bfeecf865b8129b2b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b6e1ab7f5fe6e8dbad00c033bebf1cc0d7e75cef175b68e06a331c8208f86c51f97828bd7d7e087abe37a4e7c699bef130c87d028c458fe7890c6c75d4999688
|
7
|
+
data.tar.gz: cf1229bd69ba27081fbf6dd34efb04e8247dc74cccb4e514a2122e46d8acf53aea07fbc0cc9bb05643e5af2b767348bce48c3ad4435c215cfc2a84edf8d969a8
|
data/examples/basic.rb
CHANGED
@@ -7,7 +7,7 @@ TermSlides::Slides.new(ARGV) do
|
|
7
7
|
text ""
|
8
8
|
t "t is an alias for text"
|
9
9
|
end
|
10
|
-
slide("code
|
10
|
+
slide("code") do
|
11
11
|
code :rb, """
|
12
12
|
def example_code(a, b)
|
13
13
|
p a
|
@@ -21,13 +21,13 @@ TermSlides::Slides.new(ARGV) do
|
|
21
21
|
row :sym1, :sym2
|
22
22
|
end
|
23
23
|
end
|
24
|
-
slide("diagram (requires dot (graphviz)
|
24
|
+
slide("diagram (requires dot (graphviz))") do
|
25
25
|
diagram 'digraph {
|
26
26
|
a -> b
|
27
27
|
dpi = 55
|
28
28
|
}'
|
29
29
|
end
|
30
|
-
slide("image
|
30
|
+
slide("image") do
|
31
31
|
image "#{File.dirname(__FILE__)}/cat.jpg"
|
32
32
|
end
|
33
33
|
end.run
|
data/lib/term-slides.rb
CHANGED
@@ -29,12 +29,25 @@ module TermSlides
|
|
29
29
|
def render_text text
|
30
30
|
puts center(text.text)
|
31
31
|
end
|
32
|
+
def pstree pid = Process.pid
|
33
|
+
processes = []
|
34
|
+
while pid != 0
|
35
|
+
`/bin/ps axww -q #{pid} -o ppid,command`.each_line do |line|
|
36
|
+
next if line !~ /^\s*\d+/
|
37
|
+
line.strip!
|
38
|
+
result = line.split(/\s+/, 2)
|
39
|
+
processes << result[1].split(" ").first.split("/").last
|
40
|
+
pid = result[0].to_i
|
41
|
+
end
|
42
|
+
end
|
43
|
+
processes
|
44
|
+
end
|
32
45
|
def render_image_file path
|
33
46
|
commands = {
|
34
47
|
"kitty" => %w(kitty +kitten icat),
|
35
48
|
"terminology" => %w(tycat)
|
36
49
|
}
|
37
|
-
ptree =
|
50
|
+
ptree = pstree
|
38
51
|
terminals = commands.keys.map { |terminal| ptree.include?(terminal) ? terminal : nil }.select { |x| !x.nil? }
|
39
52
|
if terminals.size > 0
|
40
53
|
command = commands[terminals.first]
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: term-slides
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.14.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- yazgoo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-04-
|
11
|
+
date: 2019-04-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorize
|