brice 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README +1 -1
- data/lib/brice/colours.rb +406 -0
- data/lib/brice/config.rb +36 -20
- data/lib/brice/dsl.rb +19 -31
- data/lib/brice/history.rb +168 -0
- data/lib/brice/rc/010_added_methods.rb +17 -0
- data/lib/{rc/010_libs.rb → brice/rc/020_libs.rb} +4 -5
- data/lib/brice/rc/030_history.rb +7 -0
- data/lib/brice/rc/040_colours.rb +7 -0
- data/lib/brice/rc/050_shortcuts.rb +7 -0
- data/lib/{rc/015_utility_belt.rb → brice/rc/060_utility_belt.rb} +0 -0
- data/lib/brice/rc/070_init.rb +9 -0
- data/lib/{rc/030_prompt.rb → brice/rc/080_prompt.rb} +1 -1
- data/lib/{rc/040_rails.rb → brice/rc/090_rails.rb} +1 -1
- data/lib/{rc/050_devel.rb → brice/rc/100_devel.rb} +0 -0
- data/lib/brice/shortcuts.rb +110 -0
- data/lib/brice/version.rb +3 -3
- data/lib/brice.rb +118 -108
- metadata +21 -16
- data/lib/rc/004_wirble.rb +0 -32
- data/lib/rc/005_added_methods.rb +0 -23
- data/lib/rc/020_init.rb +0 -25
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: brice
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 2
|
9
|
+
- 0
|
10
|
+
version: 0.2.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jens Wille
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-08-09 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: ruby-nuggets
|
@@ -46,17 +46,22 @@ extra_rdoc_files:
|
|
46
46
|
files:
|
47
47
|
- lib/brice.rb
|
48
48
|
- lib/brice/init.rb
|
49
|
+
- lib/brice/history.rb
|
50
|
+
- lib/brice/colours.rb
|
49
51
|
- lib/brice/version.rb
|
52
|
+
- lib/brice/shortcuts.rb
|
50
53
|
- lib/brice/config.rb
|
54
|
+
- lib/brice/rc/010_added_methods.rb
|
55
|
+
- lib/brice/rc/060_utility_belt.rb
|
56
|
+
- lib/brice/rc/020_libs.rb
|
57
|
+
- lib/brice/rc/090_rails.rb
|
58
|
+
- lib/brice/rc/030_history.rb
|
59
|
+
- lib/brice/rc/070_init.rb
|
60
|
+
- lib/brice/rc/040_colours.rb
|
61
|
+
- lib/brice/rc/100_devel.rb
|
62
|
+
- lib/brice/rc/050_shortcuts.rb
|
63
|
+
- lib/brice/rc/080_prompt.rb
|
51
64
|
- lib/brice/dsl.rb
|
52
|
-
- lib/rc/004_wirble.rb
|
53
|
-
- lib/rc/030_prompt.rb
|
54
|
-
- lib/rc/005_added_methods.rb
|
55
|
-
- lib/rc/020_init.rb
|
56
|
-
- lib/rc/050_devel.rb
|
57
|
-
- lib/rc/015_utility_belt.rb
|
58
|
-
- lib/rc/010_libs.rb
|
59
|
-
- lib/rc/040_rails.rb
|
60
65
|
- README
|
61
66
|
- ChangeLog
|
62
67
|
- Rakefile
|
@@ -70,11 +75,11 @@ rdoc_options:
|
|
70
75
|
- --line-numbers
|
71
76
|
- --main
|
72
77
|
- README
|
78
|
+
- --all
|
73
79
|
- --charset
|
74
80
|
- UTF-8
|
75
|
-
- --all
|
76
81
|
- --title
|
77
|
-
- brice Application documentation (v0.
|
82
|
+
- brice Application documentation (v0.2.0)
|
78
83
|
require_paths:
|
79
84
|
- lib
|
80
85
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -98,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
98
103
|
requirements: []
|
99
104
|
|
100
105
|
rubyforge_project: prometheus
|
101
|
-
rubygems_version: 1.7
|
106
|
+
rubygems_version: 1.8.7
|
102
107
|
signing_key:
|
103
108
|
specification_version: 3
|
104
109
|
summary: Extra cool IRb goodness for the masses
|
data/lib/rc/004_wirble.rb
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
# Configure wirble[http://pablotron.org/software/wirble/]
|
2
|
-
|
3
|
-
brice 'wirble' do |config|
|
4
|
-
|
5
|
-
unless Wirble::History::DEFAULTS.has_key?(:history_uniq)
|
6
|
-
# Save history newest-first, instead of default oldest-first.
|
7
|
-
class Wirble::History
|
8
|
-
def save_history
|
9
|
-
if Object.const_defined?(:IRB)
|
10
|
-
path, max_size, perms = %w[path size perms].map { |v| cfg(v) }
|
11
|
-
|
12
|
-
lines = Readline::HISTORY.to_a.reverse.uniq.reverse
|
13
|
-
lines = lines[-max_size..-1] if lines.size > max_size
|
14
|
-
|
15
|
-
real_path = File.expand_path(path)
|
16
|
-
File.open(real_path, perms) { |fh| fh.puts lines }
|
17
|
-
say 'Saved %d lines to history file %s.' % [lines.size, path]
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
# Make wirble and ruby-debug use the same histfile
|
24
|
-
silence { FILE_HISTORY = Wirble::History::DEFAULTS[:history_path] }
|
25
|
-
|
26
|
-
Wirble.init(
|
27
|
-
:skip_prompt => true,
|
28
|
-
:init_colors => true,
|
29
|
-
:history_uniq => :reverse
|
30
|
-
)
|
31
|
-
|
32
|
-
end
|
data/lib/rc/005_added_methods.rb
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
# Load AddedMethods[http://added_methods.rubyforge.org/] if one
|
2
|
-
# (or both) of the following environment variables has been set:
|
3
|
-
#
|
4
|
-
# <tt>WATCH_FOR_ADDED_METHODS</tt>:: Regular expression or <tt>true</tt>
|
5
|
-
# <tt>WATCH_FOR_ADDED_METHODS_IN</tt>:: Space-delimited list of class names
|
6
|
-
|
7
|
-
brice 'added_methods' do |config|
|
8
|
-
|
9
|
-
regexp = ENV['WATCH_FOR_ADDED_METHODS']
|
10
|
-
klasses = ENV['WATCH_FOR_ADDED_METHODS_IN']
|
11
|
-
|
12
|
-
if regexp || klasses
|
13
|
-
if regexp == 'true'
|
14
|
-
AddedMethods.init
|
15
|
-
else
|
16
|
-
regexp = Regexp.new(regexp || '')
|
17
|
-
klasses = (klasses || '').split
|
18
|
-
|
19
|
-
AddedMethods.init(regexp, klasses)
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
end
|
data/lib/rc/020_init.rb
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
# Basic initialization for IRb
|
2
|
-
|
3
|
-
brice 'init' => nil do |config|
|
4
|
-
|
5
|
-
$KCODE = 'u' unless RUBY_VERSION >= '1.9'
|
6
|
-
|
7
|
-
IRB.conf[:AUTO_INDENT] = true
|
8
|
-
|
9
|
-
# Cf. <http://rubyforge.org/snippet/detail.php?type=snippet&id=22>
|
10
|
-
def aorta(obj)
|
11
|
-
tempfile = Tempfile.new('aorta')
|
12
|
-
YAML.dump(obj, tempfile)
|
13
|
-
tempfile.close
|
14
|
-
|
15
|
-
path = tempfile.path
|
16
|
-
|
17
|
-
system(ENV['VISUAL'] || ENV['EDITOR'] || 'vi', path)
|
18
|
-
return obj unless File.exists?(path)
|
19
|
-
|
20
|
-
content = YAML.load_file(path)
|
21
|
-
tempfile.unlink
|
22
|
-
content
|
23
|
-
end
|
24
|
-
|
25
|
-
end
|