ripl-irb 0.2.0 → 0.2.1

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.
Files changed (3) hide show
  1. data/CHANGELOG.rdoc +3 -0
  2. data/lib/ripl/irb.rb +33 -16
  3. metadata +4 -4
data/CHANGELOG.rdoc CHANGED
@@ -1,3 +1,6 @@
1
+ == 0.2.1
2
+ * Add more irb config messages
3
+
1
4
  == 0.2.0
2
5
  * Add suggestions for ripl equivalents to irb commands and config
3
6
 
data/lib/ripl/irb.rb CHANGED
@@ -2,29 +2,47 @@ require 'ripl'
2
2
 
3
3
  module Ripl
4
4
  module Irb
5
- VERSION = '0.2.0'
5
+ VERSION = '0.2.1'
6
6
 
7
7
  def before_loop
8
8
  mock_irb
9
9
  super
10
10
  end
11
11
 
12
- CONFIG_MAP = {
13
- :PROMPT_MODE => :prompt, :PROMPT => :prompt, :HISTORY_FILE => :history,
14
- :USE_READLINE => :readline, :AP_NAME => :name, :RC => :irbrc
15
- }
16
- DESC_MAP = {
17
- :SINGLE_IRB => "jump commands in ripl-commands plugin have this enabled by default",
18
- :IRB_RC => "Use ripl-after_rc plugin instead of IRB.conf[:IRB_RC]",
19
- :RC_NAME_GENERATOR => "Use Ripl.config[:history] or Ripl.config[:irbrc] "+
20
- "instead of IRB.conf[:RC_NAME_GENERATOR]",
21
- :LOAD_MODULES => 'No need for irb or ripl to do this. Just use require :)'
22
- }
23
-
24
12
  def mock_irb
25
13
  mod = Object.const_set(:IRB, Module.new).extend(MockIrb)
26
- conf = {}
27
- def conf.[]=(key, val)
14
+ conf = {}.extend ConvertIrb
15
+ class <<mod; self end.send(:define_method, :conf) { conf }
16
+ end
17
+
18
+ module ConvertIrb
19
+ CONFIG_MAP = {
20
+ :PROMPT_MODE => :prompt, :PROMPT => :prompt, :HISTORY_FILE => :history,
21
+ :USE_READLINE => :readline, :AP_NAME => :name, :RC => :irbrc
22
+ }
23
+
24
+ DESC_MAP = {
25
+ :SINGLE_IRB => "jump commands in ripl-commands plugin have this enabled by default",
26
+ :IRB_RC => "Use ripl-after_rc plugin instead of IRB.conf[:IRB_RC]",
27
+ :AUTO_INDENT => 'Use ripl-auto_indent plugin instead of IRB.conf[:AUTO_INDENT]',
28
+ :SCRIPT => 'Use ripl-play plugin instead of IRB.conf[:SCRIPT]',
29
+ :RC_NAME_GENERATOR => "Use Ripl.config[:history] or Ripl.config[:irbrc] "+
30
+ "instead of IRB.conf[:RC_NAME_GENERATOR]",
31
+ :MAIN_CONTEXT => 'Use Ripl.shell instead of IRB.conf[:MAIN_CONTEXT]',
32
+ :LOAD_MODULES => 'No need for irb or ripl to do this. Just use require :)',
33
+ :SAVE_HISTORY => 'See https://github.com/cldwalker/ripl-misc/blob/master/lib/ripl/history_size.rb for IRB.conf[:SAVE_HISTORY]',
34
+ :MATH_MODE => 'See https://github.com/cldwalker/ripl-misc/blob/master/lib/ripl/math.rb for IRB.conf[:MATH_MODE]',
35
+ :ECHO => 'See https://github.com/cldwalker/ripl-misc/blob/master/lib/ripl/echo.rb for IRB.conf[:ECHO]',
36
+ :INSPECT_MODE => 'See https://github.com/cldwalker/ripl-misc/blob/master/lib/ripl/inspect.rb for IRB.conf[:INSPECT_MODE]',
37
+ :BACK_TRACE_LIMIT => 'See https://github.com/cldwalker/ripl-misc/blob/master/lib/ripl/backtrace_limit.rb for IRB.conf[:BACK_TRACE_LIMIT]',
38
+ :IGNORE_SIGINT => 'See https://github.com/cldwalker/ripl-misc/blob/master/lib/ripl/ignore_sigint.rb for IRB.conf[:IGNORE_SIGINT]'
39
+ }
40
+
41
+ def []=(key, val)
42
+ self[key]
43
+ end
44
+
45
+ def [](key)
28
46
  return unless Ripl.config[:irb_verbose]
29
47
  if ripl_key = CONFIG_MAP[key]
30
48
  puts "Use Ripl.config[#{ripl_key.inspect}] instead of IRB.conf[#{key.inspect}]"
@@ -32,7 +50,6 @@ module Ripl
32
50
  puts desc
33
51
  end
34
52
  end
35
- class <<mod; self end.send(:define_method, :conf) { conf }
36
53
  end
37
54
 
38
55
  module MockIrb
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ripl-irb
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 0
10
- version: 0.2.0
9
+ - 1
10
+ version: 0.2.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Gabriel Horner
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-11-24 00:00:00 -05:00
18
+ date: 2010-12-18 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency