rib 0.1.0 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +0 -4
- data/CHANGES.md +6 -0
- data/README +107 -113
- data/README.md +107 -113
- data/Rakefile +5 -3
- data/TODO.md +6 -0
- data/bin/rib-all +5 -0
- data/bin/rib-auto +9 -0
- data/bin/rib-min +5 -0
- data/bin/rib-rails +9 -0
- data/bin/rib-ramaze +9 -0
- data/lib/rib.rb +70 -6
- data/lib/rib/all.rb +0 -1
- data/lib/rib/api.rb +60 -64
- data/lib/rib/app/auto.rb +25 -0
- data/lib/rib/app/rails.rb +41 -0
- data/lib/rib/app/ramaze.rb +25 -0
- data/lib/rib/config.rb +3 -0
- data/lib/rib/core.rb +13 -1
- data/lib/rib/core/completion.rb +15 -3
- data/lib/rib/core/history.rb +56 -0
- data/lib/rib/core/multiline.rb +104 -0
- data/lib/rib/core/readline.rb +3 -1
- data/lib/rib/core/squeeze_history.rb +45 -0
- data/lib/rib/core/strip_backtrace.rb +45 -0
- data/lib/rib/core/underscore.rb +17 -8
- data/lib/rib/debug.rb +2 -1
- data/lib/rib/dep/hirb.rb +24 -0
- data/lib/rib/more.rb +4 -3
- data/lib/rib/more/anchor.rb +85 -0
- data/lib/rib/more/color.rb +44 -43
- data/lib/rib/{zore → more}/edit.rb +3 -3
- data/lib/rib/more/multiline_history.rb +24 -12
- data/lib/rib/more/multiline_history_file.rb +7 -3
- data/lib/rib/plugin.rb +2 -4
- data/lib/rib/runner.rb +84 -49
- data/lib/rib/shell.rb +4 -2
- data/lib/rib/test.rb +55 -2
- data/lib/rib/test/multiline.rb +140 -0
- data/lib/rib/version.rb +1 -1
- data/rib.gemspec +54 -22
- data/screenshot.png +0 -0
- data/task/gemgem.rb +3 -1
- data/test/core/{test_history_file.rb → test_history.rb} +29 -19
- data/test/core/test_multiline.rb +22 -0
- data/test/core/test_readline.rb +13 -8
- data/test/{more → core}/test_squeeze_history.rb +24 -18
- data/test/core/test_underscore.rb +32 -21
- data/test/more/test_multiline_history.rb +42 -0
- data/test/test_shell.rb +13 -8
- metadata +72 -27
- data/2011-02-28.md +0 -203
- data/CHANGES +0 -86
- data/TODO +0 -6
- data/lib/rib/core/history_file.rb +0 -38
- data/lib/rib/more/multiline.rb +0 -77
- data/lib/rib/more/squeeze_history.rb +0 -37
- data/lib/rib/more/strip_backtrace.rb +0 -43
- data/lib/rib/zore.rb +0 -3
- data/lib/rib/zore/anchor.rb +0 -69
data/.gitignore
CHANGED
data/CHANGES.md
ADDED
data/README
CHANGED
@@ -1,175 +1,169 @@
|
|
1
|
-
#
|
1
|
+
# Rib
|
2
2
|
|
3
3
|
by Lin Jen-Shin ([godfat](http://godfat.org))
|
4
4
|
|
5
5
|
## LINKS:
|
6
6
|
|
7
|
-
* [github](https://github.com/godfat/
|
8
|
-
* [rubygems](http://rubygems.org/gems/
|
7
|
+
* [github](https://github.com/godfat/rib)
|
8
|
+
* [rubygems](http://rubygems.org/gems/rib)
|
9
9
|
|
10
10
|
## DESCRIPTION:
|
11
11
|
|
12
|
-
|
12
|
+
Ruby-Interactive-ruBy -- Yet another interactive Ruby shell
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
## INSTALLATION:
|
20
|
-
|
21
|
-
gem install ripl-rc
|
14
|
+
Rib is based on the design of [ripl][] and the work of [ripl-rc][], some of
|
15
|
+
the features are also inspired by [pry][]. The aim of Rib is to be fully
|
16
|
+
featured and yet very easy to opt-out or opt-in other features. It shall
|
17
|
+
be simple, lightweight and modular so that everyone could customize Rib.
|
22
18
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
overview of what does __ripl-rc__ do, then you can use it as
|
27
|
-
a command line tool:
|
19
|
+
[ripl]: https://github.com/cldwalker/ripl
|
20
|
+
[ripl-rc]: https://github.com/godfat/ripl-rc
|
21
|
+
[pry]: https://github.com/pry/pry
|
28
22
|
|
29
|
-
|
23
|
+
## REQUIREMENTS:
|
30
24
|
|
31
|
-
|
32
|
-
|
25
|
+
* Tested with MRI 1.8.7, 1.9.2 and Rubinius 1.2, JRuby 1.6
|
26
|
+
* All gem dependencies are optional, but it's highly recommended to use
|
27
|
+
Rib with [bond][] for tab completion.
|
33
28
|
|
34
|
-
|
29
|
+
[bond]: https://github.com/cldwalker/bond
|
35
30
|
|
36
|
-
|
37
|
-
setting anything (i.e. `~/.riplrc`)
|
31
|
+
## INSTALLATION:
|
38
32
|
|
39
|
-
|
40
|
-
yourself, to be better control what you might want and what
|
41
|
-
you might not want. Then checkout FEATURES for all plugins
|
42
|
-
you can put in `~/.riplrc`.
|
33
|
+
gem install rib
|
43
34
|
|
44
|
-
|
35
|
+
## SYNOPSIS:
|
45
36
|
|
46
|
-
|
37
|
+
![Screenshot](https://github.com/godfat/rib/raw/master/screenshot.png)
|
47
38
|
|
48
|
-
|
49
|
-
`ripl/rc/anchor`, which is a _pry_ like feature built into
|
50
|
-
ripl. You can embed two things into ripl, one is any object:
|
39
|
+
### As an interactive shell
|
51
40
|
|
52
|
-
|
41
|
+
As IRB (reads `~/.config/rib/config.rb` writes `~/.config/rib/history.rb`)
|
53
42
|
|
54
|
-
|
43
|
+
rib
|
55
44
|
|
56
|
-
|
45
|
+
As Rails console
|
57
46
|
|
58
|
-
|
59
|
-
with an interactive environment. Anchor could be nested, too.
|
60
|
-
You can anchor another object inside a _ripl_ session. The number
|
61
|
-
shown in prompt is the level of anchors, started from 1.
|
47
|
+
rib rails
|
62
48
|
|
63
|
-
|
49
|
+
As Ramaze console
|
64
50
|
|
65
|
-
|
66
|
-
had time to update this README... Sorry about that.
|
51
|
+
rib ramaze
|
67
52
|
|
68
|
-
|
53
|
+
As a console for whichever the app in the current path
|
54
|
+
it should be (for now, it's either Rails or Ramaze)
|
69
55
|
|
70
|
-
|
56
|
+
rib auto
|
71
57
|
|
72
|
-
|
58
|
+
As a fully featured interactive Ruby shell (as ripl-rc)
|
73
59
|
|
74
|
-
|
60
|
+
rib all
|
75
61
|
|
76
|
-
|
77
|
-
and history file.
|
62
|
+
As a fully featured app console (yes, some commands could be used together)
|
78
63
|
|
79
|
-
|
64
|
+
rib all auto # or `rib auto all`, the order doesn't really matter
|
80
65
|
|
81
|
-
|
82
|
-
|
83
|
-
|
66
|
+
You can customize Rib's behaviour by setting `~/.config/rib/config.rb` (by
|
67
|
+
default). Since it's merely a Ruby script which would be loaded into memory
|
68
|
+
before launching Rib shell session, You can put any customization or monkey
|
69
|
+
patch there. Personally, I use all plugins provided by Rib.
|
84
70
|
|
85
|
-
|
71
|
+
<https://github.com/godfat/dev-tool/blob/master/.config/rib/config.rb>
|
86
72
|
|
87
|
-
|
88
|
-
|
89
|
-
|
73
|
+
As you can see, putting `require 'rib/all'` into config file is exactly the
|
74
|
+
same as running `rib all` without a config file. What `rib all` would do is
|
75
|
+
merely require the file, and that file is also merely requiring all plugins.
|
76
|
+
Suppose you only want to use the core plugins and color plugin, you'll put
|
77
|
+
this into your config file:
|
90
78
|
|
91
|
-
|
79
|
+
require 'rib/core'
|
80
|
+
require 'rib/more/color'
|
92
81
|
|
93
|
-
|
82
|
+
You can also write your plugins there. Here's another example:
|
94
83
|
|
95
|
-
|
96
|
-
|
97
|
-
|
84
|
+
require 'rib/core'
|
85
|
+
require 'pp'
|
86
|
+
Rib.config[:prompt] = '$ '
|
98
87
|
|
99
|
-
|
88
|
+
module RibPP
|
89
|
+
Rib::Shell.send(:include, self)
|
100
90
|
|
101
|
-
|
91
|
+
def format_result result
|
92
|
+
result_prompt + result.pretty_inspect
|
93
|
+
end
|
94
|
+
end
|
102
95
|
|
103
|
-
|
96
|
+
So that we override the original format_result to pretty_inspect the result.
|
97
|
+
You can also build your own gem and then simply require it in your config
|
98
|
+
file. To see a list of overridable API, please read [api.rb][]
|
104
99
|
|
105
|
-
|
106
|
-
exceptions come from interactive environment, making it
|
107
|
-
very verbose. This ripl plugin strips those backtrace.
|
100
|
+
[api.rb]: https://github.com/godfat/rib/blob/master/lib/rib/api.rb
|
108
101
|
|
109
|
-
|
102
|
+
#### Basic configuration
|
110
103
|
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
104
|
+
<pre>
|
105
|
+
Rib.config[:config] | The path where config should be located
|
106
|
+
Rib.config[:name] | The name of this shell
|
107
|
+
Rib.config[:result_prompt] | Default is "=>"
|
108
|
+
Rib.config[:prompt] | Default is ">>"
|
109
|
+
Rib.config[:binding] | Context, default: TOPLEVEL_BINDING
|
110
|
+
Rib.config[:exit] | Commands to exit, default [nil, 'exit', 'quit']
|
111
|
+
</pre>
|
117
112
|
|
118
|
-
|
119
|
-
to pick up which color should be used upon a ruby object.
|
113
|
+
#### Plugin specific configuration
|
120
114
|
|
121
|
-
|
115
|
+
<pre>
|
116
|
+
Rib.config[:completion] | Completion: Bond config
|
117
|
+
Rib.config[:history_file] | Default is "~/.rib/config/history.rb"
|
118
|
+
Rib.config[:history_size] | Default is 500
|
119
|
+
Rib.config[:color] | A hash of Class => :color mapping
|
120
|
+
</pre>
|
122
121
|
|
123
|
-
|
122
|
+
### As a debugging/interacting tool
|
124
123
|
|
125
|
-
|
124
|
+
Rib could be used as a kind of debugging tool which you can set break point
|
125
|
+
in the source program.
|
126
126
|
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
ripl-multi_line.
|
127
|
+
require 'rib/config' # This would load your ~/.config/rib/config.rb
|
128
|
+
require 'rib/anchor' # If you enabled this in config, then needed not.
|
129
|
+
Rib.anchor binding # This would give you an interactive shell
|
130
|
+
# when your program has been executed here.
|
131
|
+
Rib.anchor 123 # You can also anchor on an object.
|
133
132
|
|
134
|
-
|
133
|
+
But this might be called in a loop, you might only want to
|
134
|
+
enter the shell under certain circumstance, then you'll do:
|
135
135
|
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
is empty just like irb.
|
136
|
+
require 'rib/debug'
|
137
|
+
Rib.enable_anchor do
|
138
|
+
# Only `Rib.anchor` called in the block would launch a shell
|
139
|
+
end
|
141
140
|
|
142
|
-
|
141
|
+
Rib.anchor binding # No effect (no-op) outside the block
|
143
142
|
|
144
|
-
|
143
|
+
Anchor could also be nested. The level would be shown on the prompt,
|
144
|
+
starting from 1.
|
145
145
|
|
146
|
-
|
147
|
-
trying to make pry support irb_history, colorizing, etc.,
|
148
|
-
I think implement pry like feature in ripl is a lot easier.
|
149
|
-
No need to be fancy, I just need the basic functionality.
|
146
|
+
### In place editing
|
150
147
|
|
151
|
-
|
152
|
-
<pre><code>Ripl.anchor your_object_want_to_be_viewed_as_self</code></pre>
|
153
|
-
or
|
154
|
-
<pre><code>Ripl.anchor binding</code></pre>
|
155
|
-
in your code. Other than pry ripl support, you might be
|
156
|
-
interested in <a href="https://github.com/cldwalker/ripl-rails">ripl-rails</a> and <a href="https://github.com/cldwalker/ripl-hijack">ripl-hijack</a>, too.
|
148
|
+
Whenever you called:
|
157
149
|
|
158
|
-
|
150
|
+
Rib.edit
|
159
151
|
|
160
|
-
|
152
|
+
Rib would open an editor according to $EDITOR (`ENV['EDITOR']`) for you.
|
153
|
+
After save and leave the editor, Rib would evaluate what you had input.
|
154
|
+
This also works inside an anchor. To use it, require either rib/more/edit
|
155
|
+
or rib/more or rib/all.
|
161
156
|
|
162
|
-
|
163
|
-
is what people still using irb would want, because the
|
164
|
-
configuration is totally different. This suppress that,
|
165
|
-
make it only read `~/.riplrc`
|
157
|
+
### As a shell framework
|
166
158
|
|
167
|
-
|
159
|
+
The essence is:
|
168
160
|
|
169
|
-
|
161
|
+
require 'rib'
|
170
162
|
|
171
|
-
|
172
|
-
|
163
|
+
All others are optional. The core plugins are lying in `rib/core/*.rb`, and
|
164
|
+
more plugins are lying in `rib/more/*.rb`. You can read `rib/app/ramaze.rb`
|
165
|
+
and `bin/rib-ramaze` as a Rib App reference implementation, because it's very
|
166
|
+
simple, simpler than rib-rails.
|
173
167
|
|
174
168
|
## LICENSE:
|
175
169
|
|
data/README.md
CHANGED
@@ -1,175 +1,169 @@
|
|
1
|
-
#
|
1
|
+
# Rib
|
2
2
|
|
3
3
|
by Lin Jen-Shin ([godfat](http://godfat.org))
|
4
4
|
|
5
5
|
## LINKS:
|
6
6
|
|
7
|
-
* [github](https://github.com/godfat/
|
8
|
-
* [rubygems](http://rubygems.org/gems/
|
7
|
+
* [github](https://github.com/godfat/rib)
|
8
|
+
* [rubygems](http://rubygems.org/gems/rib)
|
9
9
|
|
10
10
|
## DESCRIPTION:
|
11
11
|
|
12
|
-
|
12
|
+
Ruby-Interactive-ruBy -- Yet another interactive Ruby shell
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
## INSTALLATION:
|
20
|
-
|
21
|
-
gem install ripl-rc
|
14
|
+
Rib is based on the design of [ripl][] and the work of [ripl-rc][], some of
|
15
|
+
the features are also inspired by [pry][]. The aim of Rib is to be fully
|
16
|
+
featured and yet very easy to opt-out or opt-in other features. It shall
|
17
|
+
be simple, lightweight and modular so that everyone could customize Rib.
|
22
18
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
overview of what does __ripl-rc__ do, then you can use it as
|
27
|
-
a command line tool:
|
19
|
+
[ripl]: https://github.com/cldwalker/ripl
|
20
|
+
[ripl-rc]: https://github.com/godfat/ripl-rc
|
21
|
+
[pry]: https://github.com/pry/pry
|
28
22
|
|
29
|
-
|
23
|
+
## REQUIREMENTS:
|
30
24
|
|
31
|
-
|
32
|
-
|
25
|
+
* Tested with MRI 1.8.7, 1.9.2 and Rubinius 1.2, JRuby 1.6
|
26
|
+
* All gem dependencies are optional, but it's highly recommended to use
|
27
|
+
Rib with [bond][] for tab completion.
|
33
28
|
|
34
|
-
|
29
|
+
[bond]: https://github.com/cldwalker/bond
|
35
30
|
|
36
|
-
|
37
|
-
setting anything (i.e. `~/.riplrc`)
|
31
|
+
## INSTALLATION:
|
38
32
|
|
39
|
-
|
40
|
-
yourself, to be better control what you might want and what
|
41
|
-
you might not want. Then checkout FEATURES for all plugins
|
42
|
-
you can put in `~/.riplrc`.
|
33
|
+
gem install rib
|
43
34
|
|
44
|
-
|
35
|
+
## SYNOPSIS:
|
45
36
|
|
46
|
-
|
37
|
+
![Screenshot](https://github.com/godfat/rib/raw/master/screenshot.png)
|
47
38
|
|
48
|
-
|
49
|
-
`ripl/rc/anchor`, which is a _pry_ like feature built into
|
50
|
-
ripl. You can embed two things into ripl, one is any object:
|
39
|
+
### As an interactive shell
|
51
40
|
|
52
|
-
|
41
|
+
As IRB (reads `~/.config/rib/config.rb` writes `~/.config/rib/history.rb`)
|
53
42
|
|
54
|
-
|
43
|
+
rib
|
55
44
|
|
56
|
-
|
45
|
+
As Rails console
|
57
46
|
|
58
|
-
|
59
|
-
with an interactive environment. Anchor could be nested, too.
|
60
|
-
You can anchor another object inside a _ripl_ session. The number
|
61
|
-
shown in prompt is the level of anchors, started from 1.
|
47
|
+
rib rails
|
62
48
|
|
63
|
-
|
49
|
+
As Ramaze console
|
64
50
|
|
65
|
-
|
66
|
-
had time to update this README... Sorry about that.
|
51
|
+
rib ramaze
|
67
52
|
|
68
|
-
|
53
|
+
As a console for whichever the app in the current path
|
54
|
+
it should be (for now, it's either Rails or Ramaze)
|
69
55
|
|
70
|
-
|
56
|
+
rib auto
|
71
57
|
|
72
|
-
|
58
|
+
As a fully featured interactive Ruby shell (as ripl-rc)
|
73
59
|
|
74
|
-
|
60
|
+
rib all
|
75
61
|
|
76
|
-
|
77
|
-
and history file.
|
62
|
+
As a fully featured app console (yes, some commands could be used together)
|
78
63
|
|
79
|
-
|
64
|
+
rib all auto # or `rib auto all`, the order doesn't really matter
|
80
65
|
|
81
|
-
|
82
|
-
|
83
|
-
|
66
|
+
You can customize Rib's behaviour by setting `~/.config/rib/config.rb` (by
|
67
|
+
default). Since it's merely a Ruby script which would be loaded into memory
|
68
|
+
before launching Rib shell session, You can put any customization or monkey
|
69
|
+
patch there. Personally, I use all plugins provided by Rib.
|
84
70
|
|
85
|
-
|
71
|
+
<https://github.com/godfat/dev-tool/blob/master/.config/rib/config.rb>
|
86
72
|
|
87
|
-
|
88
|
-
|
89
|
-
|
73
|
+
As you can see, putting `require 'rib/all'` into config file is exactly the
|
74
|
+
same as running `rib all` without a config file. What `rib all` would do is
|
75
|
+
merely require the file, and that file is also merely requiring all plugins.
|
76
|
+
Suppose you only want to use the core plugins and color plugin, you'll put
|
77
|
+
this into your config file:
|
90
78
|
|
91
|
-
|
79
|
+
require 'rib/core'
|
80
|
+
require 'rib/more/color'
|
92
81
|
|
93
|
-
|
82
|
+
You can also write your plugins there. Here's another example:
|
94
83
|
|
95
|
-
|
96
|
-
|
97
|
-
|
84
|
+
require 'rib/core'
|
85
|
+
require 'pp'
|
86
|
+
Rib.config[:prompt] = '$ '
|
98
87
|
|
99
|
-
|
88
|
+
module RibPP
|
89
|
+
Rib::Shell.send(:include, self)
|
100
90
|
|
101
|
-
|
91
|
+
def format_result result
|
92
|
+
result_prompt + result.pretty_inspect
|
93
|
+
end
|
94
|
+
end
|
102
95
|
|
103
|
-
|
96
|
+
So that we override the original format_result to pretty_inspect the result.
|
97
|
+
You can also build your own gem and then simply require it in your config
|
98
|
+
file. To see a list of overridable API, please read [api.rb][]
|
104
99
|
|
105
|
-
|
106
|
-
exceptions come from interactive environment, making it
|
107
|
-
very verbose. This ripl plugin strips those backtrace.
|
100
|
+
[api.rb]: https://github.com/godfat/rib/blob/master/lib/rib/api.rb
|
108
101
|
|
109
|
-
|
102
|
+
#### Basic configuration
|
110
103
|
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
104
|
+
<pre>
|
105
|
+
Rib.config[:config] | The path where config should be located
|
106
|
+
Rib.config[:name] | The name of this shell
|
107
|
+
Rib.config[:result_prompt] | Default is "=>"
|
108
|
+
Rib.config[:prompt] | Default is ">>"
|
109
|
+
Rib.config[:binding] | Context, default: TOPLEVEL_BINDING
|
110
|
+
Rib.config[:exit] | Commands to exit, default [nil, 'exit', 'quit']
|
111
|
+
</pre>
|
117
112
|
|
118
|
-
|
119
|
-
to pick up which color should be used upon a ruby object.
|
113
|
+
#### Plugin specific configuration
|
120
114
|
|
121
|
-
|
115
|
+
<pre>
|
116
|
+
Rib.config[:completion] | Completion: Bond config
|
117
|
+
Rib.config[:history_file] | Default is "~/.rib/config/history.rb"
|
118
|
+
Rib.config[:history_size] | Default is 500
|
119
|
+
Rib.config[:color] | A hash of Class => :color mapping
|
120
|
+
</pre>
|
122
121
|
|
123
|
-
|
122
|
+
### As a debugging/interacting tool
|
124
123
|
|
125
|
-
|
124
|
+
Rib could be used as a kind of debugging tool which you can set break point
|
125
|
+
in the source program.
|
126
126
|
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
ripl-multi_line.
|
127
|
+
require 'rib/config' # This would load your ~/.config/rib/config.rb
|
128
|
+
require 'rib/anchor' # If you enabled this in config, then needed not.
|
129
|
+
Rib.anchor binding # This would give you an interactive shell
|
130
|
+
# when your program has been executed here.
|
131
|
+
Rib.anchor 123 # You can also anchor on an object.
|
133
132
|
|
134
|
-
|
133
|
+
But this might be called in a loop, you might only want to
|
134
|
+
enter the shell under certain circumstance, then you'll do:
|
135
135
|
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
is empty just like irb.
|
136
|
+
require 'rib/debug'
|
137
|
+
Rib.enable_anchor do
|
138
|
+
# Only `Rib.anchor` called in the block would launch a shell
|
139
|
+
end
|
141
140
|
|
142
|
-
|
141
|
+
Rib.anchor binding # No effect (no-op) outside the block
|
143
142
|
|
144
|
-
|
143
|
+
Anchor could also be nested. The level would be shown on the prompt,
|
144
|
+
starting from 1.
|
145
145
|
|
146
|
-
|
147
|
-
trying to make pry support irb_history, colorizing, etc.,
|
148
|
-
I think implement pry like feature in ripl is a lot easier.
|
149
|
-
No need to be fancy, I just need the basic functionality.
|
146
|
+
### In place editing
|
150
147
|
|
151
|
-
|
152
|
-
<pre><code>Ripl.anchor your_object_want_to_be_viewed_as_self</code></pre>
|
153
|
-
or
|
154
|
-
<pre><code>Ripl.anchor binding</code></pre>
|
155
|
-
in your code. Other than pry ripl support, you might be
|
156
|
-
interested in <a href="https://github.com/cldwalker/ripl-rails">ripl-rails</a> and <a href="https://github.com/cldwalker/ripl-hijack">ripl-hijack</a>, too.
|
148
|
+
Whenever you called:
|
157
149
|
|
158
|
-
|
150
|
+
Rib.edit
|
159
151
|
|
160
|
-
|
152
|
+
Rib would open an editor according to $EDITOR (`ENV['EDITOR']`) for you.
|
153
|
+
After save and leave the editor, Rib would evaluate what you had input.
|
154
|
+
This also works inside an anchor. To use it, require either rib/more/edit
|
155
|
+
or rib/more or rib/all.
|
161
156
|
|
162
|
-
|
163
|
-
is what people still using irb would want, because the
|
164
|
-
configuration is totally different. This suppress that,
|
165
|
-
make it only read `~/.riplrc`
|
157
|
+
### As a shell framework
|
166
158
|
|
167
|
-
|
159
|
+
The essence is:
|
168
160
|
|
169
|
-
|
161
|
+
require 'rib'
|
170
162
|
|
171
|
-
|
172
|
-
|
163
|
+
All others are optional. The core plugins are lying in `rib/core/*.rb`, and
|
164
|
+
more plugins are lying in `rib/more/*.rb`. You can read `rib/app/ramaze.rb`
|
165
|
+
and `bin/rib-ramaze` as a Rib App reference implementation, because it's very
|
166
|
+
simple, simpler than rib-rails.
|
173
167
|
|
174
168
|
## LICENSE:
|
175
169
|
|