ribhu 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -16,3 +16,7 @@ tmp
16
16
  .yardoc
17
17
  _yardoc
18
18
  doc/
19
+ Gemfile.lock
20
+ lib/
21
+ rbc13.log
22
+ todo
data/README.md CHANGED
@@ -20,6 +20,8 @@ from the conf file as:
20
20
  Pressing Alt-c and type in any class or method or portion. If `ri` does not return data or returns
21
21
  choices, a popup will allows selection of choices.
22
22
 
23
+ Search through the current window using "/". You may use "Alt-h" to access history (previous searches).
24
+
23
25
  Browser style, one may backspace through earlier results, or use Alt-n and Alt-p to go back and forth
24
26
  between previous and next pages viewed.
25
27
 
@@ -45,6 +47,8 @@ This gem depends on rbcurse-core
45
47
 
46
48
  rib was taken, so i took the next name that came to mind. "ri" browser.
47
49
 
50
+ https://rubygems.org/gems/ribhu
51
+
48
52
  ## Contributing
49
53
 
50
54
  1. Fork it
data/bin/ribhu CHANGED
@@ -105,11 +105,11 @@ end
105
105
  #
106
106
  def ask_classes
107
107
  format="rdoc"
108
- str = get_string("Enter a class name: ")
108
+ str = get_string_with_history("Enter a class name: ")
109
109
  if str != ""
110
110
  lines = `ri -f #{format} #{str}`.split("\n")
111
111
  if lines.size == 0
112
- #alert "Nothing came through for #{str}"
112
+ alert "Nothing came through for #{str}"
113
113
  ## Nothing returned, lets see if we can match something from the class list
114
114
  li = @form.by_name["mylist"];
115
115
  values = li.list
@@ -193,6 +193,19 @@ def popup_history
193
193
  display_text $visited[ix]
194
194
  end
195
195
  end
196
+ def get_string_with_history prompt
197
+ $shell_history ||= []
198
+ cmd = get_string(prompt, :maxlen => 50) do |f|
199
+ require 'rbcurse/core/include/rhistory'
200
+ f.extend(FieldHistory)
201
+ f.history($shell_history)
202
+ end
203
+ if cmd && !cmd.empty?
204
+ $shell_history.push(cmd) unless $shell_history.include? cmd
205
+ end
206
+ return cmd
207
+ end
208
+
196
209
 
197
210
 
198
211
  #if $0 == __FILE__
@@ -322,7 +335,7 @@ if true
322
335
  #str=w
323
336
  #else
324
337
  str = "#{tv.title}.#{w}"
325
- _text = try_ri([w, "#{str}"])
338
+ _text = try_ri(["#{str}", w])
326
339
  #end
327
340
  tt = tv.title
328
341
  #_text = `ri -f rdoc #{str} 2>&1`
@@ -341,6 +354,22 @@ if true
341
354
  end
342
355
  end
343
356
  }
357
+ tv.bind_key(?\M-m, "Select methods") {
358
+ kl = tv.title.strip
359
+ lines = tv.text
360
+ ix = lines.index("= Instance methods:")
361
+ unless ix
362
+ alert "No instance methods found"
363
+ end
364
+ if ix
365
+ values = lines[ix..-1]
366
+ ix = popuplist(values)
367
+ if ix
368
+ meth = values[ix].strip
369
+ display_text "#{kl}.#{meth}"
370
+ end
371
+ end
372
+ }
344
373
 
345
374
 
346
375
  @form.repaint
data/ribhu.gemspec CHANGED
@@ -1,11 +1,11 @@
1
1
  # coding: utf-8
2
2
  lib = File.expand_path('../lib', __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'ribhu/version'
4
+ #require 'ribhu/version'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "ribhu"
8
- spec.version = Ribhu::VERSION
8
+ spec.version = "0.0.3"
9
9
  spec.authors = ["Rahul Kumar"]
10
10
  spec.email = ["sentinel1879@gmail.com"]
11
11
  spec.description = %q{ri documentation browser using ncurses}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ribhu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-04 00:00:00.000000000 Z
12
+ date: 2013-03-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -73,8 +73,6 @@ files:
73
73
  - README.md
74
74
  - Rakefile
75
75
  - bin/ribhu
76
- - lib/ribhu.rb
77
- - lib/ribhu/version.rb
78
76
  - ribhu.gemspec
79
77
  homepage: https://github.com/rkumar/ribhu
80
78
  licenses:
@@ -91,7 +89,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
91
89
  version: '0'
92
90
  segments:
93
91
  - 0
94
- hash: -1996546408870180195
92
+ hash: 13658087095020374
95
93
  required_rubygems_version: !ruby/object:Gem::Requirement
96
94
  none: false
97
95
  requirements:
@@ -100,7 +98,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
100
98
  version: '0'
101
99
  segments:
102
100
  - 0
103
- hash: -1996546408870180195
101
+ hash: 13658087095020374
104
102
  requirements: []
105
103
  rubyforge_project:
106
104
  rubygems_version: 1.8.25
data/lib/ribhu/version.rb DELETED
@@ -1,3 +0,0 @@
1
- module Ribhu
2
- VERSION = "0.0.2"
3
- end
data/lib/ribhu.rb DELETED
@@ -1,5 +0,0 @@
1
- require "ribhu/version"
2
-
3
- module Ribhu
4
- # Your code goes here...
5
- end