Skip to content
Browse files

Lib dir: moved classes into 'xiki' dir.

  • Loading branch information...
1 parent 642d6df commit 06ea614d31557686a62de56e7604b86418d87c6a @trogdoro committed
Showing with 862 additions and 163 deletions.
  1. +2 −15 bin/xiki
  2. +5 −5 etc/command/xiki_command.rb
  3. +3 −7 etc/command/xiki_process.rb
  4. +1 −4 etc/www/web_server.rb
  5. +1 −3 etc/xiki.org/xiki_bootstrap_source.notes
  6. +1 −1 lib/menu.rb
  7. +21 −19 lib/xiki.rb
  8. 0 lib/{ → xiki}/block.rb
  9. +2 −2 lib/{ → xiki}/bookmarks.rb
  10. 0 lib/{ → xiki}/buffers.rb
  11. +2 −2 lib/{ → xiki}/clipboard.rb
  12. +1 −1 lib/{ → xiki}/code.rb
  13. +2 −2 lib/{ → xiki}/code_tree.rb
  14. +2 −2 lib/{ → xiki}/color.rb
  15. 0 lib/{ → xiki}/console.rb
  16. 0 lib/{ → xiki}/control_lock.rb
  17. 0 lib/{ → xiki}/control_tab.rb
  18. +1 −1 lib/{ → xiki}/core_ext.rb
  19. 0 lib/{ → xiki}/cursor.rb
  20. 0 lib/{ → xiki}/deletes.rb
  21. +1 −1 lib/{ → xiki}/diff_log.rb
  22. +1 −1 lib/{ → xiki}/effects.rb
  23. 0 lib/{ → xiki}/environment.rb
  24. +4 −4 lib/{ → xiki}/file_tree.rb
  25. 0 lib/{ → xiki}/files.rb
  26. 0 lib/{ → xiki}/hide.rb
  27. 0 lib/{ → xiki}/history.rb
  28. 0 lib/{ → xiki}/image.rb
  29. 0 lib/{ → xiki}/incrementer.rb
  30. 0 lib/{ → xiki}/insert.rb
  31. 0 lib/{ → xiki}/irc.rb
  32. 0 lib/{ → xiki}/key_bindings.rb
  33. +5 −5 lib/{ → xiki}/keys.rb
  34. +6 −4 lib/{ → xiki}/launcher.rb
  35. 0 lib/{ → xiki}/line.rb
  36. 0 lib/{ → xiki}/links.rb
  37. 0 lib/{ → xiki}/location.rb
  38. 0 lib/{ → xiki}/macros.rb
  39. 0 lib/{ → xiki}/man.rb
  40. +709 −0 lib/xiki/menu.rb
  41. +1 −1 lib/{ → xiki}/merb.rb
  42. 0 lib/{ → xiki}/message.rb
  43. 0 lib/{ → xiki}/meths.rb
  44. 0 lib/{ → xiki}/mode.rb
  45. +1 −1 lib/{ → xiki}/move.rb
  46. +29 −16 lib/{ → xiki}/notes.rb
  47. 0 lib/{ → xiki}/numbers.rb
  48. 0 lib/{ → xiki}/ol.rb
  49. 0 lib/{ → xiki}/ol_helper.rb
  50. 0 lib/{ → xiki}/overlay.rb
  51. +1 −1 lib/{ → xiki}/pause_means_space.rb
  52. 0 lib/{ → xiki}/php.rb
  53. 0 lib/{ → xiki}/projects.rb
  54. 0 lib/{ → xiki}/relinquish_exception.rb
  55. +1 −1 lib/{ → xiki}/remote.rb
  56. +1 −1 lib/{ → xiki}/requirer.rb
  57. 0 lib/{ → xiki}/rest_tree.rb
  58. 0 lib/{ → xiki}/ruby.rb
  59. 0 lib/{ → xiki}/ruby_console.rb
  60. +5 −5 lib/{ → xiki}/search.rb
  61. 0 lib/{ → xiki}/search_term.rb
  62. 0 lib/{ → xiki}/snippet.rb
  63. 0 lib/{ → xiki}/specs.rb
  64. 0 lib/{ → xiki}/styles.rb
  65. 0 lib/{ → xiki}/svn.rb
  66. +2 −2 lib/{ → xiki}/text_util.rb
  67. +1 −1 lib/{ → xiki}/tree.rb
  68. 0 lib/{ → xiki}/tree_cursor.rb
  69. 0 lib/{ → xiki}/trouble_shooting.rb
  70. 0 lib/{ → xiki}/url_tree.rb
  71. 0 lib/{ → xiki}/view.rb
  72. 0 lib/{ → xiki}/window.rb
  73. +3 −3 menus/agenda.rb
  74. +2 −2 menus/amazon.rb
  75. +2 −2 menus/cassandra_db.rb
  76. +1 −1 menus/deck.rb
  77. +0 −8 menus/dir.rb
  78. +3 −3 menus/headings.rb
  79. +4 −1 menus/mac.rb
  80. +2 −2 menus/maps.rb
  81. +1 −1 menus/piano.rb
  82. +1 −1 menus/rails.rb
  83. +1 −1 menus/redmine.rb
  84. +1 −1 spec/code_tree_spec.rb
  85. +4 −4 spec/diff_log_spec.rb
  86. +2 −2 spec/file_tree_spec.rb
  87. +2 −2 spec/line_spec.rb
  88. +5 −5 spec/menu_spec.rb
  89. +3 −3 spec/ol_spec.rb
  90. +2 −2 spec/remote_spec.rb
  91. +2 −2 spec/search_spec.rb
  92. +1 −1 spec/text_util_spec.rb
  93. +3 −3 spec/tree_cursor_spec.rb
  94. +3 −3 spec/tree_spec.rb
  95. +2 −2 xiki.gemspec
View
17 bin/xiki
@@ -16,31 +16,18 @@
require 'rubygems'
# Generate with correct path (see below)
-# xiki_dir = "/projects/xiki/"
xiki_dir = File.expand_path "#{File.dirname(__FILE__)}/.."
-# p "xiki_dir: #{xiki_dir.inspect}"
-# $:.unshift xiki_dir #.sub(/\/$/, '')
$:.unshift "#{xiki_dir}/lib" #.sub(/\/$/, '')
-# require "#{xiki_dir}/ol"
-require "ol"
-# Ol.line
-require "core_ext"
+require "xiki/ol"
+require "xiki/core_ext"
$:.unshift "#{xiki_dir}/etc/command"
-# $:.unshift "#{xiki_dir}etc/command/stubs"
require "xiki_command.rb"
-# load "xiki_command.rb"
result = XikiCommand.run
puts result if result != ""
exit 0
-
-# TODO: Start with template, and when installing, change:
- # - #!.. line to: result of: `which ruby`
- # - xiki_dir to: Xiki.dir
-
-
View
10 etc/command/xiki_command.rb
@@ -19,7 +19,7 @@ def self.pop_initial_request
# Called by the 'xiki' shell command
def self.run
- xiki_root = File.expand_path "#{File.dirname(__FILE__)}/../.."
+ xiki_dir = File.expand_path "#{File.dirname(__FILE__)}/../.."
argv = ARGV
if argv.empty?
@@ -83,7 +83,7 @@ def self.run
pid_orig = Process.pid
@@initial_request = path
- xiki_process = "#{xiki_root}/etc/command/xiki_process.rb"
+ xiki_process = "#{xiki_dir}/etc/command/xiki_process.rb"
Daemons.run xiki_process, :ARGV=>['start'], :monitor=>false, :multiple=>false, :dir_mode=>:normal, :dir=>"/tmp/", :log_dir=>"/tmp/", :log_output=>true
# Aparently this line never gets reached
@@ -94,7 +94,7 @@ def self.run
process_succeeded = true
rescue Exception=>e
- puts "- service couldn't start!"
+ puts "- service couldn't start!:#{e.message}\n#{e.backtrace.join("\n")}\n\n"
end
end
@@ -169,8 +169,8 @@ def self.usage
def self.ctrl action
require 'daemons'
- xiki_root = File.expand_path "#{File.dirname(__FILE__)}/../.."
- xiki_process = "#{xiki_root}/etc/command/xiki_process.rb"
+ xiki_dir = File.expand_path "#{File.dirname(__FILE__)}/../.."
+ xiki_process = "#{xiki_dir}/etc/command/xiki_process.rb"
Daemons.run xiki_process, :ARGV=>[action], :dir_mode=>:normal, :dir=>"/tmp/", :log_dir=>"/tmp/", :log_output=>true
""
end
View
10 etc/command/xiki_process.rb
@@ -1,10 +1,6 @@
-# Don't hard-code, generate with script? - or use __file path xiki env var!
-require '/projects/xiki/lib/ol'
-require 'core_ext'
-
-require 'menu'
-
-require 'launcher'
+require 'xiki/core_ext'
+require 'xiki/menu'
+require 'xiki/launcher'
Xiki.init
View
5 etc/www/web_server.rb
@@ -13,7 +13,7 @@ def self.htmlify txt, options={}
xiki_dir = File.expand_path "#{File.dirname(__FILE__)}/../.."
$:.unshift "#{xiki_dir}/lib"
- ["lib/core_ext", "lib/line", "lib/tree", "menus/bootstrap"].each{|o| require "#{xiki_dir}/#{o}"}
+ ["xiki/ol", "xiki/core_ext", "xiki/line", "xiki/tree", "../../menus/bootstrap"].each{|o| require o}
txt.slice! /.+\n/
txt = txt.unindent
@@ -243,7 +243,6 @@ def self.usage
end
def self.index
-
no_keys = false
if ENV['REQUEST_METHOD'] == "POST"
@@ -339,8 +338,6 @@ def self.menu *args
txt = self.htmlify txt, :no_keys=>no_keys
print txt
- # print "<pre>#{ENV.keys.map{|k| "#{k}: #{ENV[k]}"}.join("\n")}</pre>"
-
rescue Exception=>e
puts "<pre>#{e.message}\n#{e.backtrace}</pre>"
end
View
4 etc/xiki.org/xiki_bootstrap_source.notes
@@ -77,9 +77,7 @@ bootstrap/
- p/
Go to
<a href="http://github.com/trogdoro/xiki">github.com/trogdoro/xiki</a>
- to check out the code and
- <a href="http://github.com/trogdoro/xiki/tree/master/INSTALL.txt">install</a>
- Xiki.
+ to check out the code and install Xiki.
- span4/
- h1/
- icon/043_group
View
2 lib/menu.rb
@@ -342,7 +342,7 @@ def self.[] path
end
def self.call root, rest=nil
- root = root.gsub /[ +]/, '_'
+ root = root.gsub /[- +]/, '_'
menus = Launcher.menus
block = menus[0][root] || menus[1][root]
return if block.nil?
View
40 lib/xiki.rb
@@ -1,11 +1,11 @@
-XIKI_ROOT = File.expand_path "#{File.dirname(__FILE__)}/.."
-Dir.chdir(XIKI_ROOT)
+xiki_dir = File.expand_path "#{File.dirname(__FILE__)}/.."
+Dir.chdir xiki_dir
# Used by a lot of classes
class Xiki
@@dir = "#{Dir.pwd}/" # Store current dir when xiki first launches
- # TODO Just use XIKI_ROOT from above?
+ # TODO Just use XIKI_DIR from above?
def self.dir
@@dir
@@ -15,16 +15,18 @@ def self.dir
$el.el4r_lisp_eval '(ignore-errors (kill-buffer "Issues Loading Xiki"))' if $el
+# $LOAD_PATH << "#{xiki_dir}/lib"
+
# Require some of the core files
-require 'trouble_shooting'
require 'rubygems'
-require 'ol'
-require 'requirer'
-require 'text_util'
-Requirer.require_classes ['notes']
-require 'launcher'
-require 'mode'
-require 'menu'
+require 'xiki/trouble_shooting'
+require 'xiki/ol'
+require 'xiki/requirer'
+require 'xiki/text_util'
+Requirer.require_classes ['xiki/notes']
+require 'xiki/launcher'
+require 'xiki/mode'
+require 'xiki/menu'
# Launcher.add_class_launchers classes
class Xiki
@@ -73,6 +75,7 @@ def self.menu
- start/
- stop/
- restart/
+ - log/
- api/
> Summary
Here are some functions that will always be available to menu classes,
@@ -343,11 +346,10 @@ def self.on_open
def self.init
# Get rest of files to require
- classes = Dir["lib/*.rb"]
-Ol << "classes: #{classes.inspect}"
+ classes = Dir["lib/xiki/*.rb"]
classes = classes.select{|i|
- i !~ /xiki.rb$/ && # Remove self
- i !~ /key_bindings.rb$/ && # Remove key_bindings
+ i !~ /\/xiki.rb$/ && # Remove self
+ i !~ /\/key_bindings.rb$/ && # Remove key_bindings
i !~ /__/ # Remove __....rb files
}
@@ -362,15 +364,13 @@ def self.init
classes.map!{|i| i.sub(/\.rb$/, '')}.sort!
-Ol << "classes: #{classes.inspect}"
-
# Require classes
Requirer.require_classes classes
# key_bindings has many dependencies, require it last
- Requirer.require_classes ['lib/key_bindings.rb']
+ Requirer.require_classes ['lib/xiki/key_bindings.rb']
- Launcher.add_class_launchers classes.map{|o| o[/\/(.+)/, 1]}
+ Launcher.add_class_launchers classes.map{|o| o[/.*\/(.+)/, 1]}
Launcher.reload_menu_dirs
Launcher.add "xiki"
@@ -395,6 +395,8 @@ def self.process action
response = `xiki restart`
response = "apparently it wasn't running" if response.blank?
response.gsub /^/, '- '
+ when "log"
+ "@/tmp/xiki_process.rb.output"
when "start"
result = `xiki`
"- started!"
View
0 lib/block.rb → lib/xiki/block.rb
File renamed without changes.
View
4 lib/bookmarks.rb → lib/xiki/bookmarks.rb
@@ -1,5 +1,5 @@
-require 'location'
-require 'keys'
+require 'xiki/location'
+require 'xiki/keys'
require 'yaml'
class Bookmarks
View
0 lib/buffers.rb → lib/xiki/buffers.rb
File renamed without changes.
View
4 lib/clipboard.rb → lib/xiki/clipboard.rb
@@ -1,5 +1,5 @@
-require 'keys'
-require 'file_tree'
+require 'xiki/keys'
+require 'xiki/file_tree'
# Provides copy and paste functionality
class Clipboard
View
2 lib/code.rb → lib/xiki/code.rb
@@ -1,4 +1,4 @@
-require 'block'
+require 'xiki/block'
require 'stringio'
gem 'ruby2ruby'
require 'ruby2ruby'
View
4 lib/code_tree.rb → lib/xiki/code_tree.rb
@@ -1,5 +1,5 @@
-require 'line'
-require 'ol'
+require 'xiki/line'
+require 'xiki/ol'
class CodeTree
View
4 lib/color.rb → lib/xiki/color.rb
@@ -1,5 +1,5 @@
-require 'effects'
-require 'styles'
+require 'xiki/effects'
+require 'xiki/styles'
# Colors lines, and shows only colored lines
class Color
View
0 lib/console.rb → lib/xiki/console.rb
File renamed without changes.
View
0 lib/control_lock.rb → lib/xiki/control_lock.rb
File renamed without changes.
View
0 lib/control_tab.rb → lib/xiki/control_tab.rb
File renamed without changes.
View
2 lib/core_ext.rb → lib/xiki/core_ext.rb
@@ -1,4 +1,4 @@
-require 'text_util'
+require 'xiki/text_util'
class Array
def blank?
View
0 lib/cursor.rb → lib/xiki/cursor.rb
File renamed without changes.
View
0 lib/deletes.rb → lib/xiki/deletes.rb
File renamed without changes.
View
2 lib/diff_log.rb → lib/xiki/diff_log.rb
@@ -1,4 +1,4 @@
-require 'hide'
+require 'xiki/hide'
# Will store a diff each time a file is saved.
class DiffLog
View
2 lib/effects.rb → lib/xiki/effects.rb
@@ -1,4 +1,4 @@
-require 'styles'
+require 'xiki/styles'
# Makes visual things happen
class Effects
View
0 lib/environment.rb → lib/xiki/environment.rb
File renamed without changes.
View
8 lib/file_tree.rb → lib/xiki/file_tree.rb
@@ -1,9 +1,9 @@
-require 'styles'
-require 'line'
-require 'view'
+require 'xiki/styles'
+require 'xiki/line'
+require 'xiki/view'
require 'net/http'
require 'uri'
-require 'cursor'
+require 'xiki/cursor'
# Draws a tree from a dir structure and lets you incrementally search in the tree.
# Usage (user):
View
0 lib/files.rb → lib/xiki/files.rb
File renamed without changes.
View
0 lib/hide.rb → lib/xiki/hide.rb
File renamed without changes.
View
0 lib/history.rb → lib/xiki/history.rb
File renamed without changes.
View
0 lib/image.rb → lib/xiki/image.rb
File renamed without changes.
View
0 lib/incrementer.rb → lib/xiki/incrementer.rb
File renamed without changes.
View
0 lib/insert.rb → lib/xiki/insert.rb
File renamed without changes.
View
0 lib/irc.rb → lib/xiki/irc.rb
File renamed without changes.
View
0 lib/key_bindings.rb → lib/xiki/key_bindings.rb
File renamed without changes.
View
10 lib/keys.rb → lib/xiki/keys.rb
@@ -1,7 +1,7 @@
-require 'pause_means_space'
-require 'line'
-require 'text_util'
-require 'launcher'
+require 'xiki/pause_means_space'
+require 'xiki/line'
+require 'xiki/text_util'
+require 'xiki/launcher'
# Methods for defining keyboard shortcuts
class Keys
@@ -461,7 +461,7 @@ def self.jump_to_code
end
file, line = Code.location_from_proc proc
- file = "#{XIKI_ROOT}/#{file}" unless file =~ /^\//
+ file = "#{Xiki.dir}#{file}" unless file =~ /^\//
Location.go(file)
View.to_line line.to_i
Effects.blink(:what=>:line)
View
10 lib/launcher.rb → lib/xiki/launcher.rb
@@ -1,5 +1,5 @@
-require 'effects'
-require 'requirer'
+require 'xiki/effects'
+require 'xiki/requirer'
require 'xiki'
@@ -653,13 +653,14 @@ def self.init_default_launchers
end
Launcher.add /^[a-z]+\+[a-z+]+\/?$/ do |path|
- Tree << %`
+ txt = %`
| If you were told to "type #{path}", it is meant that you should
- | "type the acronym" while holding down control. This means Meaning
+ | "type the acronym" while holding down control. This means
| you should type:
|
| #{Keys.human_readable(path)}
`
+ Tree.<< txt, :no_slash=>1
end
# Menu launchers
@@ -948,6 +949,7 @@ def self.invoke_menu_after clazz, txt, args
end
def self.add_class_launchers classes
+
classes.each do |clazz|
next if clazz =~ /\//
View
0 lib/line.rb → lib/xiki/line.rb
File renamed without changes.
View
0 lib/links.rb → lib/xiki/links.rb
File renamed without changes.
View
0 lib/location.rb → lib/xiki/location.rb
File renamed without changes.
View
0 lib/macros.rb → lib/xiki/macros.rb
File renamed without changes.
View
0 lib/man.rb → lib/xiki/man.rb
File renamed without changes.
View
709 lib/xiki/menu.rb
@@ -0,0 +1,709 @@
+class Menu
+
+ def self.menu
+ '
+ - history/
+ - @log/
+ - @last/
+ - @all/
+ - .create/
+ - here/
+ - class/
+ - .install/
+ - gem/
+ - .setup/
+ - @~/menus/
+ - .reload_menus/
+ - .api/
+ > Summary
+ | How to use ruby code to define menus.
+ |
+ | You can create sophisticated menus backed by classes, or by using other
+ | simple means:
+ - .classes/
+ - .simple class/
+ - .menu with method/
+ - .menu with two methods/
+ - other/
+ - With a string/
+ |
+ | Menu.fish :menu=>"- salmon/\n- tuna/\n - yellow fin/"
+ |
+ Try it out by typing 1 do_ruby (C-1 Ctrl-d Ctrl-r) while on it, then
+ double-clicking on this menu to see what happens:
+ |
+ @fish/
+ |
+ - Delegating to an existing menu/
+ |
+ | Menu.critters :menu=>"foo/animals"
+ |
+ @critters/
+ |
+ - Using a block/
+ |
+ | Menu.foo do
+ | "hey/"
+ | end
+ |
+ The block can optionally take a |path| param to handle multiple levels
+ of nesting.
+ |
+ | Menu.foo do |path|
+ | "hey/#{path}"
+ | end
+ |
+ - Extract menu text from somewhere/
+ | Tree.children just expects text that is in the form of a menu (lines with
+ | 2-space indenting for nesting). So, the text can be pulled from
+ | anywhere, such as a part of a larger file:
+ |
+ | Menu.lawn do |path|
+ | menu = Notes.read_block("/tmp/garage.notes", "> Lawn")
+ | Tree.children menu, Tree.rootless(path)
+ | end
+ |
+ |
+ | If you want to create a very simple menu you can do so without code,
+ | by just putting the menu in a file such as ~/menu/foo.menu. See:
+ |
+ << docs/how_to_create/
+ - .docs/
+ - .How to use/
+ - .How to create/
+ - .keys/
+ > Summary
+ | Helpful keyboard shortcuts when using menus.
+ |
+ | - as+menu
+ | - Save changes to menu (or create new one)
+ | - to+menu
+ | - Jump to file that implements menu
+ |
+ '
+ end
+
+ def self.install *args
+ Xiki.dont_search
+ Tree.quote "
+ > TODO
+ - implement this.
+
+ - Should it look for installed gems with this name?
+ - Should it just show commands to do a gem install?
+ - How would it know whether it the gem has a xiki menu?
+ "
+ end
+
+ def self.create *args
+ type = args[0]
+
+ return self.create_here if type == "here"
+ return self.create_class if type == "class"
+ return self.create_more(*args.drop(1)) if type == "more"
+
+ "- unknown option #{type} passed to .create!"
+ end
+
+ def self.create_here
+
+ # TODO: Handle various use cases
+ # "menu/create/here/" at left margin
+ # "@menu/create/here/" nested
+ # "menu/create/\n here/" at left margin
+ # "@menu/create/\n here/" nested
+
+ trunk = Xiki.trunk
+ if wrapper = trunk[-2] # If @menu/create/here is nested
+ menu = Tree.root wrapper
+ else # If put it under a fake menu
+
+ # What? This is if it's not nested? - is this used?
+
+ # TODO: Go to left margin and remove menu...
+
+ Tree.to_root
+
+ Tree.kill_under
+ menu = "foo"
+ Line.sub! /([ +-]*).*/, "\\1#{menu}/"
+ # Insert it wherever we are
+ end
+ Xiki.dont_search
+
+ name_text = menu == "foo" ?
+ "and change '#{menu}' to something" :
+ "to go under the '#{menu}' menu"
+
+ snake = TextUtil.snake_case menu
+
+ Tree << "
+ | Supply a few items here. Then do as+menu (type Ctrl-a Ctrl-m) to create
+ | the '#{menu}' menu. Or, just create '~/menus/#{snake}.menu' yourself.
+ - example item/
+ - another/
+ - and another/
+ "
+
+ nil
+
+ end
+
+ def self.create_class
+ trunk = Xiki.trunk
+ if wrapper = trunk[-2]
+ # Just do in-line
+ menu = TextUtil.snake_case Tree.root(wrapper)
+ else
+ menu = 'foo'
+ end
+
+ Xiki.dont_search
+
+ Tree << %`
+ | Update this sample class to your liking. Then do as+update (type
+ | Ctrl-a, Ctrl-u) to create the '#{menu}' class file.
+ - @~/menus/
+ - #{menu}.rb
+ | class #{TextUtil.camel_case(menu)}
+ | def self.menu *args
+ | "- Args Passed: \#{args.inspect}\\n- Customize me in) @ ~/menus/#{menu}.rb"
+ | end
+ | end
+ - more examples) @menu/api/classes/
+ `
+ nil
+ end
+
+ def self.simple_class *args
+ root = 'foo'
+ trunk = Xiki.trunk
+ root = TextUtil.snake_case(trunk[-2][/^[\w -]+/]) if trunk.length > 1 # If nested path (due to @), grab root of parent
+
+ %`
+ - @~/menus/
+ - #{root}.rb
+ | class #{TextUtil.camel_case(root)}
+ | def self.menu *args
+ | "- args passed: \#{args.inspect}\n- Customize me in) @ ~/menus/#{menu}.rb"
+ | end
+ | end
+ `
+ end
+
+ def self.menu_with_method *args
+ root = 'foo'
+ trunk = Xiki.trunk
+ root = TextUtil.snake_case(trunk[-2][/^[\w -]+/]) if trunk.length > 1 # If nested path (due to @), grab root of parent
+
+ %`
+ - @~/menus/
+ - #{root}.rb
+ | class #{TextUtil.camel_case(root)}
+ | def self.menu
+ | "
+ | - cake/
+ | - chocolate/
+ | - .pie/
+ | "
+ | end
+ |
+ | def self.pie
+ | "- apple/"
+ | end
+ | end
+ `
+ end
+
+ def self.menu_with_two_methods *args
+ root = 'foo'
+ trunk = Xiki.trunk
+ root = TextUtil.snake_case(trunk[-2][/^[\w -]+/]) if trunk.length > 1 # If nested path (due to @), grab root of parent
+
+ %`
+ - @~/menus/
+ - #{root}.rb
+ | class #{TextUtil.camel_case(root)}
+ | def self.menu
+ | "
+ | - sammiches/
+ | - ham/
+ | - .buy/
+ | - tofu/
+ | - .buy/
+ | - .checkout/
+ | - cash/
+ | - credit/
+ | "
+ | end
+ | def self.buy category, item
+ | "- buying \#{item} \#{category}"
+ | end
+ | def self.checkout kind
+ | "- checking out as \#{kind}..."
+ | end
+ | end
+ |
+ `
+ end
+
+ def self.how_to_use *args
+ %`
+ > Summary
+ | How to use Xiki menus. Note this refers to the wiki-style menus, not the menu bar.
+ |
+ | All menus can be used the same way. Just type something and double-click
+ | on it (or type Ctrl-enter while the cursor is on the line).
+ |
+ - example/
+ | 1: type "foo" on a line (the "@" isn't necessary when the line isn't indented)
+ @ foo
+ |
+ | 2: double-click on it to drill in. You can try it on the line above. It will look like this:
+ @ foo/
+ | - sammiches/
+ | - dranks/
+ |
+ | 3: double-click to drill in further. It will look like this:
+ @ foo/
+ | - sammiches/
+ | - ham/
+ | - tofu/
+ | - dranks/
+ |
+ - using the mouse/
+ | You can click on the "bullets" (the - and + at the beginnings of lines)
+ | to expand and collapse. You can also double-click to expand and
+ | collapse.
+ |
+ - search to narrow down/
+ | When you double-click a line the cursor turns blue and you can type
+ | letters to search and narrow down the list.
+ |
+ - misc keys/
+ | - Return: stops searching and launches (expands file or dir)
+ | - Tab: like return but hides others
+ | - ;: like return but collapses path
+ |
+ | - C-g: stops searching
+ |
+ | - Arrow keys: you can use them to go up and down and expand and collapse
+ |
+ `
+ end
+
+ def self.how_to_create *args
+ txt = %q`
+ > Summary
+ | How to make your own menus in Xiki. Note this refers to wiki-style
+ | menus (such as this one), not the menu bar.
+ |
+ - Creating .menu files/
+ | You can make menus without code, by just put "whatever.menu" files in the
+ | "menu/" dir in your home dir.
+ |
+ | For example you could create a "foo.menu" file with the contents
+ | "- sammiches/..." etc:
+ |
+ - TODO: get these to expand out somehow! - maybe pass another arg to Tree.children below? - probably bad idea
+ - ~/menus/
+ - foo.menu
+ | - sammiches/
+ | - ham/
+ | - tofu/
+ | - dranks/
+ | - foty/
+ |
+ - Delegating/
+ | This makes a foo/ menu that you can expand. Even though these menus
+ | don't run code themselves, they can delegate to other menus or run code,
+ | like:
+ |
+ - ~/menus/
+ - foo.menu
+ | - @mymenu/
+ | - @MyClass.my_method
+ |
+ `
+
+ Tree.children(txt, args.join('/'))
+ end
+
+ def self.reload_menus
+ Launcher.reload_menu_dirs
+ View.flash
+ nil
+ end
+
+ def self.[] path
+ path, rest = path.split '/', 2
+
+ self.call path, rest
+ end
+
+ def self.call root, rest=nil
+ root = root.gsub /[ +]/, '_'
+ menus = Launcher.menus
+ block = menus[0][root] || menus[1][root]
+ return if block.nil?
+ Tree.output_and_search block, :line=>"#{root}/#{rest}", :just_return=>1
+ end
+
+ def self.method_missing *args, &block
+ Launcher.method_missing *args, &block
+ "- defined!"
+ end
+
+ def self.split path, options={}
+ path = path.sub /\/$/, ''
+ path = Tree.rootless path if options[:rootless]
+
+ return [] if path.empty?
+
+ groups = path.split '/|', -1
+
+ result = groups[0] =~ /^\|/ ?
+ [groups[0]] :
+ groups[0].split('/', -1)
+
+ result += groups[1..-1].map{|o| "|#{o}"}
+ end
+
+ def self.to_menu
+ # Take best guess, by looking through dirs for root
+ trunk = Xiki.trunk
+
+ return View.<<("- You weren't on a menu\n | To jump to a menu's implementation, put your cursor on it\n | (or type it on a blank line) and then do as+menu (ctrl-a ctrl-m)\n | Or, look in one of these dirs:\n - ~/menus/\n - $xiki/menus/") if trunk[-1].blank?
+
+ root = trunk[0][/^[\w _-]+/]
+
+ root = trunk[-1][/^[\w _-]+/] if ! Keys.prefix_u
+
+ root.gsub!(/[ -]/, '_') if root
+
+ root.downcase!
+
+ (["#{Xiki.dir}lib/"]+Launcher::MENU_DIRS).reverse.each do |dir|
+ next unless File.directory? dir
+ file = Dir["#{dir}/#{root}.*"]
+ next unless file.any?
+ return View.open file[0]
+ end
+
+ # message = "
+ # - No menu found:
+ # | No \"#{root}\" menu or class file found in these dirs:
+ # @ ~/menus/
+ # @ $x/menus/
+ # ".unindent
+
+ # Should be able to get it right from proc
+
+ proc = Launcher.menus[1][root]
+
+ return View.flash "- Menu 'root' doesn't exist!", :times=>4 if ! proc
+
+ location = proc.source_location # ["./firefox.rb", 739]
+ location[0].sub! /^\.\//, Xiki.dir
+ View.open location[0]
+ View.line = location[1]
+
+ end
+
+ def self.external menu, options={}
+
+ View.message ""
+
+ View.wrap :off
+
+ # IF nothing passed, must want to do tiny search box
+ if menu.empty?
+ Launcher.open ""
+ View.message ""
+ View.prompt "Type anything", :timed=>1, :times=>2 #, :color=>:rainbow
+
+ Launcher.launch
+ else
+ Launcher.open menu, options
+ end
+ end
+
+ def self.as_menu
+ orig = View.cursor
+
+ Tree.to_root
+
+ root, left = Line.value, View.cursor
+ root = Line.without_label :line=>root
+
+ root = TextUtil.snake_case(root).sub(/^_+/, '')
+
+ if Line.value(2) =~ /^ +\| Supply a few items here/ # If sample text, remove
+ Line.next
+ while Line.=~(/^ +\| /)
+ Line.delete
+ end
+ Line.previous
+ orig = nil
+ end
+
+ Tree.after_children
+ right = View.cursor
+ View.cursor = left
+
+ # Go until end of paragraph (simple for now)
+ Effects.blink :left=>left, :right=>right
+ txt = View.txt left, right
+ txt.sub! /.+\n/, ''
+ txt.gsub! /^ /, ''
+ txt.unindent
+
+ return Tree << "| You must supply something to put under the '#{root}' menu.\n| First, add some lines here, such as these:\n- line/\n- another line/\n" if txt.empty?
+
+ path = File.expand_path "~/menus/#{root}.menu"
+
+ file_existed = File.exists? path
+
+ if file_existed
+ treeb = File.read path
+ txt = Tree.restore txt, treeb
+
+ DiffLog.save_diffs :patha=>path, :textb=>txt
+ end
+
+ File.open(path, "w") { |f| f << txt }
+
+ View.cursor = orig if orig
+
+ require_menu path
+
+ View.flash "- #{file_existed ? 'Updated' : 'Created'} ~/menus/#{root}.menu", :times=>3
+ nil
+ end
+
+ @@loaded_already = {}
+
+ def self.load_if_changed file
+ return :not_found if ! File.exists?(file)
+ previous = @@loaded_already[file]
+ recent = File.mtime(file)
+
+ if previous == nil
+ # require file
+ load file
+ @@loaded_already[file] = recent
+ return
+ end
+
+ return if recent <= previous
+
+ load file
+ @@loaded_already[file] = recent
+ end
+
+ def self.collapser_launcher
+
+ line = Line.value
+ arrows = line[/<+/].length
+ arrows -= 1 if arrows > 1 # Make "<<" go back just 1, etc.
+
+ # line.sub! /(^ +)= /, "\\1< " # Temporarily get "=" to work too
+ line = Line.without_label :line=>line
+
+ skip = line.empty? && arrows - 1
+
+ Line.sub! /^( +)<+ .+/, "\\1- " # Delete after bullet to prepare for loop
+
+ arrows.times do |i|
+
+ # If no items left on current line, jump to parent and delete
+ if Line =~ /^[ +-]+$/
+ Tree.to_parent
+ Tree.kill_under
+ Move.to_end
+ end
+
+ unless i == skip # Remove last item, or after bullet if no items
+ Line.sub!(/\/[^\/]+\/$/, '/') || Line.sub!(/^([ @+-]*).*/, "\\1")
+ end
+ end
+
+ if Line.indent.blank?
+ line.sub! /^@ ?/, ''
+ Line.sub! /^@ ?/, ''
+ end
+
+ Line << line unless skip
+ Launcher.launch
+
+ end
+
+ def self.root_collapser_launcher
+
+ View.cursor
+
+
+ # Grab line
+ line = Line.value
+
+ arrows = line[/<+/].length
+
+ line.sub!(/ *<+@ /, '')
+
+ # Go up to root, and kill under
+ arrows.times { Tree.to_root }
+ Tree.kill_under
+
+ # Insert line, and launch
+ old = Line.delete :leave_linebreak
+ old.sub! /^( *).+/, "\\1"
+ old << "@" if old =~ /^ / # If any indent, @ is needed
+ View << "#{old}#{line}"
+
+ Launcher.launch
+ end
+
+ def self.replacer_launcher
+ Line.sub! /^( +)<+= /, "\\1+ "
+
+ # Run in place, grab output, then move higher and show output
+
+ orig = View.line
+ Launcher.launch :no_search=>1
+
+ # If didn't move line, assume it had no output, and it's collapse things itself
+ return if orig == View.line
+
+ # If it inserted something
+
+ output = Tree.siblings :everything=>1
+
+ # return
+
+ # Shouldn't this be looping like self.collapser_launcher ?
+ Tree.to_parent
+ Tree.to_parent
+ Tree.kill_under :no_plus=>1
+ Tree << output
+
+ # TODO: do search now, after insterted?
+
+ end
+
+ def self.menu_to_hash txt
+ txt = File.read txt if txt =~ /\A\/.+\z/ # If 1 line and starts with slash, read file
+
+ txt.gsub(/^\| /, '').split("\n").inject({}) do |o, txt|
+ txt = txt.split(/ : /)
+ o[txt[0]] = txt[1]
+ o
+ end
+
+ end
+
+ # def self.config txt, *args
+
+ # # TODO: implement
+ # # Args look like sample invocation below
+ # # If not there, create it first, using supplied default
+ # # Insert quoted file contents to be edited
+
+ # # Sample invocation
+ # # Menu.config "
+ # # - @ ~/xiki_config/browser.notes
+ # # | - default browser:
+ # # | - Firefox
+ # # | - others:
+ # # | - Safari
+ # # | - Chrome
+ # # ", *args
+
+ # "TODO"
+ # end
+
+ # Moves item to root of tree (replacing tree), then launches.
+ def self.do_as_menu
+ line = Line.value
+
+ # If on ^@... line and there's child on next line...
+
+ on_subtree = line =~ /^[ +-]*@/ && Tree.has_child?
+
+ txt = on_subtree ? Tree.subtree.unindent.sub(/^[ @+-]+/, '') : Tree.path.last
+
+ Keys.prefix_u ? Tree.to_root(:highest=>1) : Tree.to_root
+ Tree.kill_under
+
+ Line.sub! /^([ @]*).+/, "\\1#{txt}"
+
+ return if on_subtree
+
+ # replace line with menu
+
+ Launcher.launch
+ end
+
+
+ # The following 3 methods are for the menu bar
+ # - a different use of the "Menu" class
+ # TODO move them into menu_bar.rb ?
+
+ def self.add_menu *name
+ menu_spaces = name.join(' ').downcase
+ menu_dashes = name.join('-').downcase
+ name = name[-1]
+
+ lisp = %Q<
+ (define-key global-map
+ [menu-bar #{menu_spaces}]
+ (cons "#{name}" (make-sparse-keymap "#{menu_dashes}")))
+ >
+ $el.el4r_lisp_eval lisp
+
+ menu = $el.elvar.menu_bar_final_items.to_a
+ $el.elvar.menu_bar_final_items = menu.push(name.downcase.to_sym)
+ end
+
+ def self.add_item menu, name, function
+
+ menu_spaces = menu.join(' ').downcase
+ lisp = "
+ (define-key global-map
+ [menu-bar #{menu_spaces} #{function}]
+ '(\"#{name}\" . #{function}))
+ "
+ $el.el4r_lisp_eval lisp
+ end
+
+ ROOT_MENU = 'Keys'
+
+ def self.init
+
+ return if ! $el
+
+ Mode.define(:menu, ".menu") do
+ Notes.mode
+ end
+
+ add_menu ROOT_MENU
+
+ menus = [
+ [ROOT_MENU, 'To'],
+ [ROOT_MENU, 'Open'],
+ [ROOT_MENU, 'Layout'],
+ [ROOT_MENU, 'As'],
+ [ROOT_MENU, 'Enter'],
+ [ROOT_MENU, 'Do'],
+ [ROOT_MENU, 'Search']
+ ]
+ menus.reverse.each do |tuple|
+ add_menu tuple[0], tuple[1]
+ end
+ end
+
+
+end
+
+Menu.init # Define mode
+
+
View
2 lib/merb.rb → lib/xiki/merb.rb
@@ -1,4 +1,4 @@
-require "launcher"
+require 'xiki/launcher'
class Merb
View
0 lib/message.rb → lib/xiki/message.rb
File renamed without changes.
View
0 lib/meths.rb → lib/xiki/meths.rb
File renamed without changes.
View
0 lib/mode.rb → lib/xiki/mode.rb
File renamed without changes.
View
2 lib/move.rb → lib/xiki/move.rb
@@ -1,4 +1,4 @@
-require 'keys'
+require 'xiki/keys'
# Provides different ways of moving cursor.
class Move
View
45 lib/notes.rb → lib/xiki/notes.rb
@@ -1,9 +1,9 @@
-require 'styles'
-require 'line'
-require 'effects'
-require 'view'
-require 'keys'
-require 'clipboard'
+require 'xiki/styles'
+require 'xiki/line'
+require 'xiki/effects'
+require 'xiki/view'
+require 'xiki/keys'
+require 'xiki/clipboard'
class Notes
@@ -816,26 +816,29 @@ def archive
def self.enter_do_bullet
- txt = Keys.input :chars=>1, :prompt=>'Enter a character: '
- expanded = Notes.expand_if_action_abbrev txt
-
# If on blank line, just insert it
+ indent = ""
if ! Line.blank?
line = Line.value
indent, first_char = line.match(/^( *)(.)/)[1..2]
Move.to_axis
- $el.open_line(1)
+ $el.open_line 1
end
- if txt == " "
- View << "#{indent}- !"
- ControlLock.disable
- return View.column = -1
- end
+ Line << "#{indent}- !"
+ Move.backward
+
+ txt = Keys.input :chars=>1, :prompt=>'Enter a character: '
+ expanded = Notes.expand_if_action_abbrev txt
+
+ View << (expanded || txt)
+ # If wasn't expanded prepare to edit
+ ControlLock.disable if ! expanded
+
+# return
if expanded
- View << "#{indent}- #{expanded}!"
Line.to_beginning
else
View << "#{indent}- !"
@@ -843,6 +846,16 @@ def self.enter_do_bullet
View << txt
end
+# return
+
+
+ # if txt == " "
+ # View << "#{indent}- !"
+ # ControlLock.disable
+ # return View.column = -1
+ # end
+
+
nil
end
View
0 lib/numbers.rb → lib/xiki/numbers.rb
File renamed without changes.
View
0 lib/ol.rb → lib/xiki/ol.rb
File renamed without changes.
View
0 lib/ol_helper.rb → lib/xiki/ol_helper.rb
File renamed without changes.
View
0 lib/overlay.rb → lib/xiki/overlay.rb
File renamed without changes.
View
2 lib/pause_means_space.rb → lib/xiki/pause_means_space.rb
@@ -1,4 +1,4 @@
-require 'keys'
+require 'xiki/keys'
class PauseMeansSpace
View
0 lib/php.rb → lib/xiki/php.rb
File renamed without changes.
View
0 lib/projects.rb → lib/xiki/projects.rb
File renamed without changes.
View
0 lib/relinquish_exception.rb → lib/xiki/relinquish_exception.rb
File renamed without changes.
View
2 lib/remote.rb → lib/xiki/remote.rb
@@ -2,7 +2,7 @@
require 'net/ssh'
require 'net/sftp'
require 'timeout'
-require 'ol'
+require 'xiki/ol'
class Remote
View
2 lib/requirer.rb → lib/xiki/requirer.rb
@@ -1,4 +1,4 @@
-require 'core_ext'
+require 'xiki/core_ext'
class Requirer
def self.show txt
View
0 lib/rest_tree.rb → lib/xiki/rest_tree.rb
File renamed without changes.
View
0 lib/ruby.rb → lib/xiki/ruby.rb
File renamed without changes.
View
0 lib/ruby_console.rb → lib/xiki/ruby_console.rb
File renamed without changes.
View
10 lib/search.rb → lib/xiki/search.rb
@@ -1,7 +1,7 @@
-require "hide"
-require 'control_lock'
-require 'line'
-require 'text_util'
+require 'xiki/hide'
+require 'xiki/control_lock'
+require 'xiki/line'
+require 'xiki/text_util'
class Search
@@ -1113,7 +1113,7 @@ def self.xiki
char = Keys.input(:chars=>1, :prompt=>"Enter one char: ")
if char == "m"
- Launcher.open("- $x/\n - ##\\bdef /")
+ Launcher.open("- $x/lib/xiki/\n - ##\\bdef /")
elsif char == "k"
Launcher.open("- $x/key_bindings.rb\n - ##\\bKeys\\./")
elsif char == "l"
View
0 lib/search_term.rb → lib/xiki/search_term.rb
File renamed without changes.
View
0 lib/snippet.rb → lib/xiki/snippet.rb
File renamed without changes.
View
0 lib/specs.rb → lib/xiki/specs.rb
File renamed without changes.
View
0 lib/styles.rb → lib/xiki/styles.rb
File renamed without changes.
View
0 lib/svn.rb → lib/xiki/svn.rb
File renamed without changes.
View
4 lib/text_util.rb → lib/xiki/text_util.rb
@@ -1,5 +1,5 @@
-require 'line'
-require 'ol'
+require 'xiki/line'
+require 'xiki/ol'
class TextUtil
View
2 lib/tree.rb → lib/xiki/tree.rb
@@ -1,4 +1,4 @@
-require 'tree_cursor'
+require 'xiki/tree_cursor'
class Tree
def self.menu
View
0 lib/tree_cursor.rb → lib/xiki/tree_cursor.rb
File renamed without changes.
View
0 lib/trouble_shooting.rb → lib/xiki/trouble_shooting.rb
File renamed without changes.
View
0 lib/url_tree.rb → lib/xiki/url_tree.rb
File renamed without changes.
View
0 lib/view.rb → lib/xiki/view.rb
File renamed without changes.
View
0 lib/window.rb → lib/xiki/window.rb
File renamed without changes.
View
6 menus/agenda.rb
@@ -1,6 +1,6 @@
-require 'view'
-require 'line'
-require 'effects'
+require 'xiki/view'
+require 'xiki/line'
+require 'xiki/effects'
class Agenda
View
4 menus/amazon.rb
@@ -1,5 +1,5 @@
-require 'view'
-require 'effects'
+require 'xiki/view'
+require 'xiki/effects'
class Amazon
View
4 menus/cassandra_db.rb
@@ -1,7 +1,7 @@
gem 'cassandra'
-require 'cassandra'
+require 'xiki/cassandra'
-require "launcher"
+require 'xiki/launcher'
# Cassandras structure:
# keyspace ->* table family ->* key (->* super column) ->* column
View
2 menus/deck.rb
@@ -1,4 +1,4 @@
-require "mode"
+require 'xiki/mode'
# Makes text in .deck files huge, and makes left and right arrow keys treat
# headings as slides.
View
8 menus/dir.rb
@@ -1,8 +0,0 @@
-class Dir
- def self.menu
- "
- > See
- - @mkdir/
- "
- end
-end
View
6 menus/headings.rb
@@ -1,6 +1,6 @@
-require 'view'
-require 'line'
-require 'effects'
+require 'xiki/view'
+require 'xiki/line'
+require 'xiki/effects'
class Headings
View
5 menus/mac.rb
@@ -10,7 +10,8 @@ def self.menu
@/Users/
@/Applications/
@/Applications/Utilities/
- @ ~/Library/Fonts/
+ @~/Library/Fonts/
+ @/System/Library/CoreServices/
- api/
| Define standard mac shortcuts
@ Mac.define_keys
@@ -31,6 +32,8 @@ def self.define_keys
#
def self.keys_for_aquamacs
+ return if ! $el.boundp(:osx_key_mode_map)
+
$el.define_key(:osx_key_mode_map, $el.kbd("A-0")) { Styles.font_size 110 }
$el.define_key(:osx_key_mode_map, $el.kbd("A-=")) { Styles.zoom }
$el.define_key(:osx_key_mode_map, $el.kbd("A--")) { Styles.zoom :out=>1 }
View
4 menus/maps.rb
@@ -1,5 +1,5 @@
-require 'view'
-require 'effects'
+require 'xiki/view'
+require 'xiki/effects'
class Maps
View
2 menus/piano.rb
@@ -1,6 +1,6 @@
Requirer.require_gem 'midiator', :optional=>1
-require "mode"
+require 'mode'
class Piano
View
2 menus/rails.rb
@@ -1,4 +1,4 @@
-require "ruby_console"
+require 'xiki/ruby_console'
class Rails
View
2 menus/redmine.rb
@@ -1,7 +1,7 @@
require 'net/http'
require 'uri'
require 'timeout'
-require 'keys'
+require 'xiki/keys'
class Redmine
View
2 spec/code_tree_spec.rb
@@ -1,6 +1,6 @@
$:.unshift "spec/"
require 'xiki'
-require 'code_tree'
+require 'xiki/code_tree'
# require 'core_ext'
describe CodeTree, "#extract_class" do
View
8 spec/diff_log_spec.rb
@@ -1,8 +1,8 @@
$:.unshift "spec/"
-require 'line'
-require 'ol'
-require 'diff_log'
-# require 'core_ext'
+require 'xiki/line'
+require 'xiki/ol'
+require 'xiki/diff_log'
+# require 'xiki/core_ext'
describe Line, "#parse_tree_diffs" do
# it "parses a rename" do
View
4 spec/file_tree_spec.rb
@@ -1,6 +1,6 @@
$:.unshift "spec/"
-require 'file_tree'
-require 'core_ext'
+require 'xiki/file_tree'
+require 'xiki/core_ext'
describe "handles?" do
View
4 spec/line_spec.rb
@@ -1,6 +1,6 @@
$:.unshift "spec/"
-require 'line'
-require 'core_ext'
+require 'xiki/line'
+require 'xiki/core_ext'
describe Line, "#without_label" do
it "removes bullets" do
View
10 spec/menu_spec.rb
@@ -1,12 +1,12 @@
$:.unshift "spec/"
-require 'ol'
-require 'tree'
-require 'core_ext'
-require 'mode'
+require 'xiki/ol'
+require 'xiki/tree'
+require 'xiki/core_ext'
+require 'xiki/mode'
class Mode
def self.define *args; end
end
-require 'menu'
+require 'xiki/menu'
describe Menu, "#split" do
it "splits normal strings" do
View
6 spec/ol_spec.rb
@@ -1,7 +1,7 @@
$:.unshift "spec/"
-require 'line'
-require 'ol'
-require 'core_ext'
+require 'xiki/line'
+require 'xiki/ol'
+require 'xiki/core_ext'
def define_vars
@stack = [
View
4 spec/remote_spec.rb
@@ -3,8 +3,8 @@
class Keys
def self.method_missing(meth, *args, &block); end
end
-require 'remote'
-require 'core_ext'
+require 'xiki/remote'
+require 'xiki/core_ext'
describe Remote, "#calculate_local_path" do
it "should put dashes in path" do
View
4 spec/search_spec.rb
@@ -1,6 +1,6 @@
$:.unshift "spec/"
-require 'search'
-require 'core_ext'
+require 'xiki/search'
+require 'xiki/core_ext'
describe Search, "#case_options" do
it "should initialize" do
View
2 spec/text_util_spec.rb
@@ -1,5 +1,5 @@
$:.unshift "spec/"
-require 'text_util'
+require 'xiki/text_util'
describe TextUtil, "#unindent" do
it "indents to the left" do
View
6 spec/tree_cursor_spec.rb
@@ -1,7 +1,7 @@
$:.unshift "spec/"
-require 'core_ext'
-require 'tree_cursor'
-require 'ol'
+require 'xiki/core_ext'
+require 'xiki/tree_cursor'
+require 'xiki/ol'
def a_aa_tree
"
View
6 spec/tree_spec.rb
@@ -1,7 +1,7 @@
$:.unshift "spec/"
-require 'ol'
-require 'tree'
-require 'core_ext'
+require 'xiki/ol'
+require 'xiki/tree'
+require 'xiki/core_ext'
describe Tree, "#traverse" do
View
4 xiki.gemspec
@@ -5,11 +5,11 @@
Gem::Specification.new do |s|
s.name = "xiki"
- s.version = "0.5.0a"
+ s.version = "0.5.1a"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Craig Muth"]
- s.date = "2011-08-24"
+ s.date = "2012-07-30"
s.executables = ["xiki"]
s.summary = "A shell console with GUI features."
s.description = "Xiki does what shell consoles do, but lets you edit everything at any time. It's trivial to make your own commands and menus to access other tools."

0 comments on commit 06ea614

Please sign in to comment.
Something went wrong with that request. Please try again.