brice 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README +1 -1
- data/lib/brice/version.rb +1 -1
- data/lib/rc/030_prompt.rb +23 -8
- data/lib/rc/040_rails.rb +4 -3
- metadata +1 -1
data/README
CHANGED
data/lib/brice/version.rb
CHANGED
data/lib/rc/030_prompt.rb
CHANGED
@@ -20,13 +20,28 @@ brice 'prompt' => nil do |config|
|
|
20
20
|
|
21
21
|
IRB.conf[:PROMPT] ||= {} # prevent error in webrick
|
22
22
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
IRB.conf[:
|
23
|
+
# prompt configuration:
|
24
|
+
#
|
25
|
+
# PROMPT_I = normal prompt
|
26
|
+
# PROMPT_S = prompt for continuing strings
|
27
|
+
# PROMPT_C = prompt for continuing statement
|
28
|
+
# RETURN = format to return value
|
29
|
+
|
30
|
+
IRB.conf[:PROMPT].update(
|
31
|
+
:BRICE_SIMPLE => {
|
32
|
+
:PROMPT_I => ' ',
|
33
|
+
:PROMPT_S => ' ',
|
34
|
+
:PROMPT_C => ' ',
|
35
|
+
:RETURN => lambda { |rt| "#{rt} => %s\n" }
|
36
|
+
},
|
37
|
+
:BRICE_VERBOSE => {
|
38
|
+
:PROMPT_I => "#{RUBY_VERSION}p#{RUBY_PATCHLEVEL}> ",
|
39
|
+
:PROMPT_S => "#{RUBY_VERSION}p#{RUBY_PATCHLEVEL}> ",
|
40
|
+
:PROMPT_C => "#{RUBY_VERSION}p#{RUBY_PATCHLEVEL}> ",
|
41
|
+
:RETURN => lambda { |rt| "#{rt} => %s\n" }
|
42
|
+
}
|
43
|
+
)
|
44
|
+
|
45
|
+
IRB.conf[:PROMPT_MODE] = RUBY_VERSION < '1.9' ? :BRICE_SIMPLE : :BRICE_VERBOSE
|
31
46
|
|
32
47
|
end
|
data/lib/rc/040_rails.rb
CHANGED
@@ -23,14 +23,15 @@ brice 'rails' => nil do |config|
|
|
23
23
|
|
24
24
|
IRB.conf[:PROMPT] ||= {}
|
25
25
|
|
26
|
-
IRB.conf[:PROMPT][:
|
26
|
+
IRB.conf[:PROMPT][:BRICE_RAILS] = {
|
27
27
|
:PROMPT_I => prompt,
|
28
28
|
:PROMPT_S => prompt,
|
29
29
|
:PROMPT_C => prompt,
|
30
|
-
:RETURN => IRB.conf[:PROMPT][:
|
30
|
+
:RETURN => IRB.conf[:PROMPT][:BRICE_SIMPLE] ?
|
31
|
+
IRB.conf[:PROMPT][:BRICE_SIMPLE][:RETURN] : "=> %s\n"
|
31
32
|
}
|
32
33
|
|
33
|
-
IRB.conf[:PROMPT_MODE] = :
|
34
|
+
IRB.conf[:PROMPT_MODE] = :BRICE_RAILS
|
34
35
|
|
35
36
|
### logger
|
36
37
|
brice_require 'logger' do
|