irbtools 0.8.6 → 0.8.7

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,8 @@
1
+ 0.8.7
2
+ * fix railsrc loading
3
+ * add ori gem for nice Object#ri calling
4
+ * minor tweaks
5
+
1
6
  0.8.6
2
7
  * windows support
3
8
  * update hirb + activate unicode-drawn tables
data/README.rdoc CHANGED
@@ -24,6 +24,7 @@ If it does not exist, just create a new one.
24
24
 
25
25
  It's possible to modify, which libraries get loaded:
26
26
 
27
+ # don't require 'irbtools'
27
28
  require 'irbtools/configure'
28
29
  # here you can modify which libraries get loaded (see below)
29
30
  Irbtools.init
@@ -42,7 +43,10 @@ You have the following ways:
42
43
  * <tt>Irbtools.add_package(pkg)</tt>
43
44
  * <tt>Irbtools.remove_package(pkg)</tt>
44
45
 
45
- Edit the <tt>Irbtools.libraries</tt>, <tt>Irbtools.libraries_in_proc</tt> or <tt>Irbtools.packages</tt> arrays directly. If you use the <tt>add_library</tt> method, you can apply a block which gets executed when the library is loaded.
46
+ You can edit the <tt>Irbtools.libraries</tt> or <tt>Irbtools.libraries_in_proc</tt> directly, but when using the <tt>add_library</tt> method, you can apply a block which gets executed after the library is loaded.
47
+
48
+ ==== Packages
49
+ <tt>Irbtools.packages</tt> are extension packs for Irbtools, e.g. {irbtools-more}[https://github.com/janlelis/irbtools-more].
46
50
 
47
51
  == Features
48
52
 
@@ -55,11 +59,11 @@ See http://rbjl.net/40-irbtools-release-the-power-of-irb or read the commented s
55
59
  * fancy_irb[https://github.com/janlelis/fancy_irb] put result as comment and more colorization
56
60
  * *fileutils* (stdlib) cd, pwd, ln_s, mv, rm, mkdir, touch ... ;)
57
61
  * clipboard[http://github.com/janlelis/clipboard] easy clipboard access (copy & paste)
58
- * interactive_editor[https://github.com/jberkel/interactive_editor] lets you open vim, hack something, and it gets loaded into the current session
62
+ * interactive_editor[https://github.com/jberkel/interactive_editor] lets you open vim, hack something, and it gets loaded into the current session, also possible: yaml object editing
59
63
  * sketches[http://sketches.rubyforge.org/] another, more flexible "start editor and it gets loaded into your irb session" plugin
60
64
  * zucker[http:/rubyzucker.info] nice debug printing (q, o, c, .m, .d) + useful pseudo-constants (Info, OS, RubyVersion, RubyEngine)
61
- * ap[https://github.com/michaeldv/awesome_print] nice debug printing (ap) [also see wp]
62
- * coderay[http://coderay.rubychan.de/] some nice colorful displaying ;)
65
+ * ap[https://github.com/michaeldv/awesome_print] nice debug printing (ap) [also see wp from wirb/wp]
66
+ * coderay[http://coderay.rubychan.de/] some colorful code displaying ;)
63
67
  * boson[http://tagaholic.me/boson/] commands repository (commands also work in the shell!)
64
68
  * guessmethod[http://guessmethod.rubyforge.org/] automatically corrects typos (method_missing hook) [not loaded by default]
65
69
 
@@ -67,7 +71,7 @@ See http://rbjl.net/40-irbtools-release-the-power-of-irb or read the commented s
67
71
 
68
72
  See the source for a description. These methods are defined directly by irbtools. Each gem may add its own helper methods.
69
73
 
70
- *General*: <tt>ls, cat, rq, rrq/rerequire, ld, session_history, reset!, clear, use_ruby/use, rubies, use_gemset/gemset, gemsets, dbg, Object#ri</tt>
74
+ *General*: <tt>ls, cat, rq, rrq/rerequire, ld, session_history, reset!, clear, use_ruby/use, rubies, use_gemset/gemset, gemsets, dbg</tt>
71
75
 
72
76
  *Clipboard*: <tt>copy, paste, copy_input, copy_output</tt>
73
77
 
@@ -81,19 +85,11 @@ If you have RVM installed, you can switch your gemset or ruby with <tt>gemset</t
81
85
 
82
86
  You can customize the welcome message with <tt>Irbtools.welcome_message=</tt>
83
87
 
84
- == Todo
85
-
86
- * Nicer ri command
87
-
88
- === Planned features for 0.9.0 (next main version)
88
+ == Planned features for 0.9.0 (next main version - probably coming in may 2011)
89
89
 
90
90
  * define flexibly, whether library should be loaded on start/on subsession or via autoload
91
91
  * faster loading
92
92
 
93
- == More Features
94
-
95
- * See the irbtools-more[https://github.com/janlelis/irbtools-more] package or suggest some useful utilities/tweaks ;)
96
-
97
93
  == Copyright
98
94
 
99
95
  Copyright (c) 2010-2011 Jan Lelis, http://rbjl.net, released under the MIT license.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.8.6
1
+ 0.8.7
data/irbtools.gemspec CHANGED
@@ -6,7 +6,7 @@ Gem::Specification.new do |s|
6
6
  s.version = File.read('VERSION').chomp
7
7
 
8
8
  s.authors = ["Jan Lelis"]
9
- s.date = %q{2011-02-24}
9
+ s.date = %q{2011-03-28}
10
10
  s.summary = %q{irbtools is a meta gem which installs some useful irb gems and configures your irb.}
11
11
  s.description = %q{irbtools is a meta gem which installs some useful irb gems and configures your irb. Simply put a require 'irbtools' in the .irbrc file in your home directory.}
12
12
  s.email = %q{mail@janlelis.de}
@@ -17,13 +17,14 @@ Gem::Specification.new do |s|
17
17
 
18
18
  s.add_dependency %q<fancy_irb>, ">= 0.6.5"
19
19
  s.add_dependency %q<zucker>, ">= 9"
20
- s.add_dependency %q<hirb>, "~> 0.4"
21
- s.add_dependency %q<awesome_print>, "~> 0.3"
20
+ s.add_dependency %q<hirb>, "~> 0.4.3"
21
+ s.add_dependency %q<awesome_print>, "~> 0.3.2"
22
22
  s.add_dependency %q<clipboard>, ">= 0.9.7"
23
23
  s.add_dependency %q<coderay>, "~> 0.9"
24
24
  s.add_dependency %q<boson>, "~> 0.3"
25
25
  s.add_dependency %q<wirb>, ">= 0.2.4"
26
- s.add_dependency %q<interactive_editor>, ">= 0.0.6"
26
+ s.add_dependency %q<interactive_editor>, ">= 0.0.8"
27
+ s.add_dependency %q<ori>, "~> 0.1.0"
27
28
  s.add_dependency %q<sketches>, ">= 0"
28
29
  s.add_dependency %q<g>, ">= 0"
29
30
  s.add_dependency %q<guessmethod>, ">= 0"
data/lib/irbtools.rb CHANGED
@@ -85,8 +85,9 @@ if defined?(IRB) || defined?(Ripl)
85
85
 
86
86
  # load rails.rc
87
87
  begin
88
- if ( ENV['RAILS_ENV'] || defined? Rails ) && Irbtools.railsrc && File.exist?(Irbtools.railsrc)
89
- load File.expand_path( Irbtools.railsrc )
88
+ if ( ENV['RAILS_ENV'] || defined? Rails ) && Irbtools.railsrc &&
89
+ File.exist?( File.expand_path(Irbtools.railsrc) )
90
+ load File.expand_path(Irbtools.railsrc)
90
91
  end
91
92
  rescue
92
93
  end
@@ -122,18 +122,4 @@ def dbg
122
122
  end
123
123
  end
124
124
 
125
- class Object
126
- # display ri entry
127
- def ri(meth)
128
- ri_cmd = 'ri'
129
- if instance_of?( Kernel ) || instance_of?( Object )
130
- puts `#{ri_cmd} #{meth}`
131
- elsif is_a? Module
132
- puts `#{ri_cmd} #{self}.#{meth}`
133
- else
134
- puts `#{ri_cmd} #{self.class}##{meth}`
135
- end
136
- end
137
- end
138
-
139
125
  # J-_-L
@@ -9,7 +9,7 @@
9
9
  Irbtools.add_library :wirb do # result colors
10
10
  Wirb.start unless OS.windows?
11
11
  end
12
- Irbtools.add_library 'wirb/wp'
12
+ Irbtools.add_library 'wirb/wp' # ap alternative
13
13
 
14
14
 
15
15
  Irbtools.add_library :fancy_irb do # put result as comment instead of a new line and colorful errors/streams
@@ -94,6 +94,27 @@ Irbtools.add_library :hirb do
94
94
  Hirb::View.formatter.add_view 'Object', :ancestor => true, :options => { :unicode => true } # unicode tables
95
95
  end
96
96
 
97
+ Irbtools.add_library :ori do
98
+ class Object
99
+ # patch ori to also allow shell-like "Array#slice" syntax
100
+ def ri(*args)
101
+ if args[0] &&
102
+ self == TOPLEVEL_BINDING.eval('self') &&
103
+ args[0] =~ /\A(.*)(?:#|\.)(.*)\Z/
104
+ begin
105
+ klass = Object.const_get $1
106
+ klass.ri $2
107
+ rescue
108
+ super
109
+ end
110
+ else
111
+ super
112
+ end
113
+ end
114
+ end
115
+ end
116
+
117
+
97
118
  # remove failing/not needed libs
98
119
  if OS.windows?
99
120
  Irbtools.libraries -= %w[coderay]
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: irbtools
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.8.6
5
+ version: 0.8.7
6
6
  platform: ruby
7
7
  authors:
8
8
  - Jan Lelis
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-02-24 00:00:00 +01:00
13
+ date: 2011-03-28 00:00:00 +02:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -43,7 +43,7 @@ dependencies:
43
43
  requirements:
44
44
  - - ~>
45
45
  - !ruby/object:Gem::Version
46
- version: "0.4"
46
+ version: 0.4.3
47
47
  type: :runtime
48
48
  version_requirements: *id003
49
49
  - !ruby/object:Gem::Dependency
@@ -54,7 +54,7 @@ dependencies:
54
54
  requirements:
55
55
  - - ~>
56
56
  - !ruby/object:Gem::Version
57
- version: "0.3"
57
+ version: 0.3.2
58
58
  type: :runtime
59
59
  version_requirements: *id004
60
60
  - !ruby/object:Gem::Dependency
@@ -109,22 +109,22 @@ dependencies:
109
109
  requirements:
110
110
  - - ">="
111
111
  - !ruby/object:Gem::Version
112
- version: 0.0.6
112
+ version: 0.0.8
113
113
  type: :runtime
114
114
  version_requirements: *id009
115
115
  - !ruby/object:Gem::Dependency
116
- name: sketches
116
+ name: ori
117
117
  prerelease: false
118
118
  requirement: &id010 !ruby/object:Gem::Requirement
119
119
  none: false
120
120
  requirements:
121
- - - ">="
121
+ - - ~>
122
122
  - !ruby/object:Gem::Version
123
- version: "0"
123
+ version: 0.1.0
124
124
  type: :runtime
125
125
  version_requirements: *id010
126
126
  - !ruby/object:Gem::Dependency
127
- name: g
127
+ name: sketches
128
128
  prerelease: false
129
129
  requirement: &id011 !ruby/object:Gem::Requirement
130
130
  none: false
@@ -135,7 +135,7 @@ dependencies:
135
135
  type: :runtime
136
136
  version_requirements: *id011
137
137
  - !ruby/object:Gem::Dependency
138
- name: guessmethod
138
+ name: g
139
139
  prerelease: false
140
140
  requirement: &id012 !ruby/object:Gem::Requirement
141
141
  none: false
@@ -145,6 +145,17 @@ dependencies:
145
145
  version: "0"
146
146
  type: :runtime
147
147
  version_requirements: *id012
148
+ - !ruby/object:Gem::Dependency
149
+ name: guessmethod
150
+ prerelease: false
151
+ requirement: &id013 !ruby/object:Gem::Requirement
152
+ none: false
153
+ requirements:
154
+ - - ">="
155
+ - !ruby/object:Gem::Version
156
+ version: "0"
157
+ type: :runtime
158
+ version_requirements: *id013
148
159
  description: irbtools is a meta gem which installs some useful irb gems and configures your irb. Simply put a require 'irbtools' in the .irbrc file in your home directory.
149
160
  email: mail@janlelis.de
150
161
  executables: []
@@ -157,8 +168,8 @@ extra_rdoc_files:
157
168
  files:
158
169
  - lib/irbtools.rb
159
170
  - lib/irbtools/libraries.rb
160
- - lib/irbtools/general.rb
161
171
  - lib/irbtools/configure.rb
172
+ - lib/irbtools/general.rb
162
173
  - lib/irbtools/rvm.rb
163
174
  - VERSION
164
175
  - CHANGELOG