paned_repl 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e319071ab6659f5796231c27e6fdc10fd7a3cf3d
4
- data.tar.gz: 33e37c207c6db8b64e24a67313215eb54ad0e285
3
+ metadata.gz: b5c42a3722ef794d604ce1964f1c5c8f475e7c34
4
+ data.tar.gz: 4f4b92401e320a0da4bc6897a50743af292b93e8
5
5
  SHA512:
6
- metadata.gz: 3c7a97b3219599582be64fe82e0a9eed0eec4cf1657de33504e2828e0a59e14c7c3e3f55a18c477bc5c7d47ad51c6dabfe4ca41aed0f78bbaeb2b3bc9ccd4f8b
7
- data.tar.gz: 0377b005dc7d9db3ed4fc112e1596adb9cb14f13da8b255e748d95351a1bae73f9659f04e3c9e5ed4ed7cc006d6f7c334593d867264d2382b7b5b4e1f28715eb
6
+ metadata.gz: 7d1f4fdd860dc0772c5949165d6d9fca577fddd97895e6e714fd86f0c728442b20a944f5b8c4f34fa5e696cecc84026e5b354a67ef86204d3506a41b6b2442e2
7
+ data.tar.gz: 575f6ea1720630996b43ae7de3f1ff7606fccb97ac3d324c710d790fb285382c4d92ec16d0ea4e4ffba10ff9cd95269f54db24c810d1bc439a6703802e4a7584
data/README.md ADDED
@@ -0,0 +1,39 @@
1
+ **Installation**
2
+
3
+ To launch a REPL (using Pry), first do this in Bash:
4
+
5
+ ```sh
6
+ gem install paned_repl
7
+ paned_repl init
8
+ sh paned_repl.sh
9
+ ```
10
+ **Usage**
11
+
12
+ inside the REPL, require whatever programs you need.
13
+
14
+ There is a Ruby wrapper over TMux commands. For example:
15
+
16
+ ```rb
17
+ # the 'main pane' receives tmux commands
18
+ # this refers to a root Tmux session that is automatically created.
19
+ # launching subsequent Tmux sessions is not implemented
20
+ session = PanelRepl.sessions.values.first
21
+
22
+ # create a new pane, but maintain focus on main frame.
23
+ # swaps positions so the main pane is always last
24
+ session.split_horizontal
25
+
26
+ # make the panes equal size
27
+ session.even_horizontal
28
+
29
+ new_pane_id = 0 # There are 2 total panes, and the main pane is always the last
30
+ # Therefore (with 0-indexing) the new pane has an id of 0.
31
+ # If a third pane were added, it would have an id of 1 and the main
32
+ # pane would have an id of 2.
33
+
34
+ session.send_keys "echo hello", new_pane_id
35
+ ```
36
+
37
+ There is intended to be one pane that handles direct user input. The other panes just receive commands through `send_keys`.
38
+
39
+ See [./lib/paned_repl/tmux.rb](lib/paned_repl/tmux.rb) for more commands that can be used.
@@ -32,6 +32,7 @@ module PanedRepl::Tmux
32
32
 
33
33
  def kill_pane(n)
34
34
  `tmux kill-pane -t #{n}`
35
+ @pane = pane - 1
35
36
  end
36
37
 
37
38
  def send_keys(keys, frame_id)
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module PanedRepl
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paned_repl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - maxpleaner
@@ -73,6 +73,7 @@ executables:
73
73
  extensions: []
74
74
  extra_rdoc_files: []
75
75
  files:
76
+ - README.md
76
77
  - bin/paned_repl
77
78
  - lib/paned_repl.rb
78
79
  - lib/paned_repl/constants.rb
@@ -80,7 +81,6 @@ files:
80
81
  - lib/paned_repl/repls/base_repl.rb
81
82
  - lib/paned_repl/tmux.rb
82
83
  - lib/paned_repl/utils.rb
83
- - lib/paned_repl/utils/html_printer.rb
84
84
  - lib/version.rb
85
85
  homepage: https://github.com/maxpleaner/paned_repl
86
86
  licenses:
@@ -1,40 +0,0 @@
1
-
2
- class PanedRepl::Utils::HtmlPrinter
3
-
4
- Delimiter = PanedRepl.const("HTML_PRINTER_DELIMITER")
5
-
6
- using Gemmy.patch("object/i/ergo")
7
-
8
- def self.start &blk
9
- Html.io_loop &:ergo
10
- end
11
-
12
- def self.io_loop &blk
13
- html = ''
14
- loop do
15
- str = gets.chomp
16
- if str.ends_with? Delimiter
17
- new(html: html).print
18
- html = blk.call html
19
- else
20
- html = html + str
21
- end
22
- end
23
- end
24
-
25
- include AutoInitializer
26
-
27
- attr_reader :html
28
-
29
- def create_path
30
- Tempfile.new.tap { |f|
31
- f.write html
32
- f.close
33
- }.path
34
- end
35
-
36
- def print
37
- puts `cat #{create_path} | w3m -dump -T text/html`
38
- end
39
-
40
- end