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 CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  == VERSION
4
4
 
5
- This documentation refers to brice version 0.0.3
5
+ This documentation refers to brice version 0.0.4
6
6
 
7
7
 
8
8
  == DESCRIPTION
data/lib/brice/version.rb CHANGED
@@ -4,7 +4,7 @@ class Brice
4
4
 
5
5
  MAJOR = 0
6
6
  MINOR = 0
7
- TINY = 3
7
+ TINY = 4
8
8
 
9
9
  class << self
10
10
 
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
- IRB.conf[:PROMPT][:BRICE] = { # name of prompt mode
24
- :PROMPT_I => ' ', # normal prompt
25
- :PROMPT_S => ' ', # prompt for continuing strings
26
- :PROMPT_C => ' ', # prompt for continuing statement
27
- :RETURN => lambda { |rt| "#{rt} => %s\n" } # format to return value
28
- }
29
-
30
- IRB.conf[:PROMPT_MODE] = :BRICE
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][:RAILS] = {
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][:BRICE][:RETURN]
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] = :RAILS
34
+ IRB.conf[:PROMPT_MODE] = :BRICE_RAILS
34
35
 
35
36
  ### logger
36
37
  brice_require 'logger' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brice
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
  - Jens Wille