xiki 0.6.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,8 @@
1
1
  # Summary
2
- This file shows how to install Xiki. See http://xiki.org for a description of Xiki.
2
+
3
+ This file shows how to install Xiki. For a description of Xiki see:
4
+
5
+ http://xiki.org
3
6
 
4
7
  # Install Xiki
5
8
 
@@ -13,33 +16,37 @@ Either install as a gem, or install from github.
13
16
 
14
17
  $ git clone git@github.com:trogdoro/xiki.git
15
18
  $ cd xiki
16
- $ gem install bundler
17
- $ bundle install --system
18
- $ cp <xiki dir>/etc/command/xiki_wrapper /usr/local/bin/xiki
19
- $ chmod 755 /usr/local/bin/xiki
19
+ $ sudo gem install bundler
20
+ $ sudo bundle install --system
21
+ $ sudo ruby etc/command/copy_xiki_command_to.rb /usr/local/bin/xiki
20
22
 
21
- If you don't have permission, to run some of the commands put "sudo" at the beginning of the command.
23
+ You don't need "sudo" at the beginning if you're using rvm and your
24
+ /usr/local/bin/ dir is writable.
22
25
 
23
26
  # Verify the 'xiki' shell command works
24
27
 
25
28
  $ xiki
26
29
 
27
- It should delay slightly the first time, but be fast subsequent times. If you run into errors and then fix them, you'll want to run the "xiki restart" command.
30
+ It should delay slightly the first time, but be fast subsequent
31
+ times. If you run into errors and then fix them, you'll want to
32
+ run the "xiki restart" command.
28
33
 
29
34
  # Configure your editor to use Xiki
30
35
 
31
36
  ## Emacs
32
37
 
33
- If you're going to use Xiki with Emacs, do these steps:
38
+ Emacs is the most supported editor. Don't worry though, you don't
39
+ have to know emacs to use it with Xiki.
34
40
 
35
41
  ### Step 1: Download Emacs
36
42
 
37
43
  #### On Mac:
44
+
38
45
  - Try Aquamacs if you're new to emacs (it's more mac-like)
39
- - http://aquamacs.org/download-classic.shtml
40
- - works well with rvm, because it loads .bash_login
46
+ - http://aquamacs.org/download-classic.shtml
47
+ - works well with rvm, because it loads .bash_login
41
48
  - Or
42
- - http://emacsformacosx.com
49
+ - http://emacsformacosx.com
43
50
 
44
51
  #### On Linux:
45
52
 
@@ -52,33 +59,31 @@ We just patched el4r, so there's a chance Xiki might work in windows.
52
59
  - Skip the 'xiki' shell command step
53
60
  - Maybe try this emacs? http://ourcomments.org/Emacs/EmacsW32.html
54
61
 
55
-
56
62
  ### Step 2: EmacsRuby (el4r) setup
57
63
 
58
- $ cd <xiki dir>
64
+ $ cd `xiki dir`
59
65
  $ sudo bash etc/install/el4r_setup.sh
60
66
 
61
67
  If you're using rvm, the sudo may not be necessary.
62
68
 
63
- If you're using the xiki gem, you can paste this for the above cd:
64
-
65
- $ cd `dirname \`gem contents xiki | grep Gemfile\``
66
-
67
69
  ### Step 3: Require Xiki in EmacsRuby's config
68
70
  Sample configuration:
69
71
 
70
72
  ~/.el4r/init.rb:
71
- $LOAD_PATH.unshift "<xiki dir>/lib"
73
+ $LOAD_PATH.unshift "(xiki dir)/lib"
72
74
  require 'xiki'
73
75
  Xiki.init
74
76
 
75
77
  KeyBindings.keys # Use default key bindings
76
78
  Themes.use "Default" # Use xiki theme
77
79
 
80
+ Be sure to substitute '(xiki dir)' with the actual dir. If you
81
+ don't know it, run this command:
78
82
 
79
- Be sure to substitute "&lt;xiki dir&gt;" with the actual dir.
83
+ $ xiki dir
80
84
 
81
85
  ### If you get an error
86
+
82
87
  If you got partially through the load...
83
88
 
84
89
  - You may be able to use these keys to trouble-shoot:
@@ -86,31 +91,34 @@ If you got partially through the load...
86
91
  - Option+l to reload xiki and .emacs
87
92
  - also use this when you see "el4r-instance is dead"
88
93
  - If you can't use the keys, look at the log
89
- - Named something like: /tmp/el4r......log
90
- - Go to the end and search backward for the last error
91
- - probably contains ":Error:"
92
- - Restart emacs (or reload .emacs) manually to reload
94
+ - Named something like: /tmp/el4r......log
95
+ - Go to the end and search backward for the last error
96
+ - probably contains ":Error:"
97
+ - Restart emacs (or reload .emacs) manually to reload
93
98
  - See "Issues Loading Xiki" buffer (under "Window" menu bar menu)
94
99
 
95
-
96
100
  ## Vim
97
101
 
98
102
  Vim support is very partially implemented, but should be pretty
99
103
  straight-forward to implement. It turns out vim is very easy to
100
104
  extend using ruby. See this file to try it out:
101
105
 
102
- ./etc/vim/vim_status.notes
106
+ (xiki dir)/etc/vim/vim_status.notes
103
107
 
104
108
  ## CodeMirror
105
109
 
106
110
  There's a simple prototype working, though it's not committed yet.
107
111
 
108
112
  ## Other editors
109
- Are you in the bay area and savvy at extending your editor (vim, sublime, textmate, rubymine)? Ping me on the google group and we'll get together and pair on making a Xiki extension for it.
110
113
 
114
+ Are you in the bay area and savvy at extending your editor (vim,
115
+ sublime, textmate, rubymine)? Ping me on the google group and
116
+ we'll get together and pair on making a Xiki extension for it.
111
117
 
112
118
  # Google group
113
- Join the google group for help with installing, or to chat about whatever or share your ideas:
114
119
 
115
- http://groups.google.com/group/xiki
120
+ Join the google group for help with installing, or to chat about
121
+ whatever or share your ideas:
122
+
123
+ http://groups.google.com/group/xiki
116
124
 
@@ -0,0 +1,14 @@
1
+ dest = ARGV[0]
2
+ puts "Putting the 'xiki' shell command at:
3
+ #{dest}"
4
+
5
+ source = "etc/command/xiki_wrapper"
6
+
7
+ xiki_dir = Dir.pwd
8
+
9
+ puts "" # Blank line
10
+
11
+ txt = File.read source
12
+ txt.sub! /\(xiki_dir\)/, xiki_dir
13
+
14
+ File.open(dest, "w", 0755) { |f| f << txt }
@@ -108,7 +108,7 @@ class XikiCommand
108
108
  def self.get_response
109
109
 
110
110
  # Simulate timeout error if process not running
111
- process_running = `ps -e` =~ /xiki_process.rb/
111
+ process_running = `ps -ef` =~ /xiki_process.rb/
112
112
  if ! process_running
113
113
  raise Timeout::Error
114
114
  end
@@ -146,13 +146,17 @@ class XikiCommand
146
146
 
147
147
  > Setting up your editor
148
148
  The most common way to use Xiki is from a text editor. For
149
- example, typing "tables" on any blank line and double-clicking on
150
- it (or typing control-enter or command-enter) to browse and update
151
- your mysql database.
149
+ example, from in a text editor, typing "tables" on any blank line
150
+ and then double-clicking on it (or typing control-enter or
151
+ command-enter) to browse and update your mysql database.
152
152
 
153
- See this file for help setting up your editor:
153
+ See the README.markdown file in the Xiki dir for help setting up
154
+ your editor. You can view it by typing this command or going to
155
+ this url:
154
156
 
155
- $xiki/README.markdown
157
+ $ xiki readme
158
+
159
+ https://github.com/trogdoro/xiki
156
160
 
157
161
  > Service
158
162
  The 'xiki' shell command automatically runs a service in the
@@ -180,11 +184,10 @@ class XikiCommand
180
184
  http://twitter.com/xiki
181
185
 
182
186
  > Troubleshooting
183
- Be sure to run this command to install required gems:
187
+ A couple commands to help you trouble-shoot:
184
188
 
185
189
  % bundle install
186
-
187
- Also see $xiki/README.markdown
190
+ % xiki readme
188
191
 
189
192
  `.unindent
190
193
 
@@ -224,7 +227,9 @@ class XikiCommand
224
227
  case line
225
228
  when /^(>) (.+)/
226
229
  "#{self.heading_bracket $1} #{self.bold $2}"
227
- when /^http:\/\/.+/
230
+ when /^(>>+) (.+)/
231
+ "#{self.heading_bracket $1} #{self.path $2}"
232
+ when /^ *https?:\/\/.+/
228
233
  "#{self.url $&}"
229
234
  when /^.+\/$/
230
235
  "#{self.path $&}"
@@ -251,7 +256,7 @@ class XikiCommand
251
256
  self.colorize txt, "1;31" # Red # colorize("1;91") # Red
252
257
  end
253
258
  def self.label txt
254
- self.colorize txt, "1;33" # Yellow
259
+ self.colorize txt, "1;90" # Gray
255
260
  end
256
261
  def self.path txt
257
262
  colorize(txt, "1;90")
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env ruby
2
- load "/projects/xiki/bin/xiki"
2
+ load "(xiki_dir)/bin/xiki"
@@ -1,5 +1,4 @@
1
1
  require 'sinatra'
2
- require "/projects/xiki/lib/xiki/ol.rb"
3
2
 
4
3
  set :port, 8161
5
4
  set :bind, '127.0.0.1'
@@ -286,14 +285,11 @@ def index menu
286
285
 
287
286
  # rescue e=>Exception
288
287
  # puts "<pre>#{e.message}\n#{e.backtrace}</pre>"
289
- # Ol << "e: #{e.message}"
290
- # Ol << "e: #{e.backtrace}"
291
288
  # Ol << "If we get the permission problem, provide .notes file that will run command to run xiki command once (message explaining it first)!"
292
289
  # end
293
290
 
294
291
  # TODO: return different string when the service is down
295
292
 
296
- # Ol << "Extract to new method: suggest_creating!!"
297
293
  if txt.empty?
298
294
  menu = menu.sub /\/$/, ''
299
295
 
@@ -44,8 +44,8 @@ class Xiki
44
44
  | Double-click on these lines to add the executable 'xiki' command to
45
45
  | your path:
46
46
  |
47
- @$ cp #{Xiki.dir}etc/command/xiki_wrapper /usr/local/bin/xiki
48
- @$ chmod 755 /usr/local/bin/xiki
47
+ @#{Xiki.dir}/
48
+ $ ruby etc/command/copy_xiki_command_to.rb /usr/local/bin/xiki
49
49
  |
50
50
  | Then you can type 'xiki' on a command line outside of emacs as a
51
51
  | shortcut to opening xiki and opening menus, like so:
@@ -750,6 +750,9 @@ class Launcher
750
750
  View.to_nth orig
751
751
  else
752
752
  Move.to_window 1
753
+ if prefix.is_a? Fixnum
754
+ View.line = prefix
755
+ end
753
756
  end
754
757
 
755
758
  line = Line.value
@@ -1,4 +1,5 @@
1
1
  - full/View.dimensions_full; Styles.font_size 110
2
+ - half/width = 166; width += 3 if ! View.scroll_bars; View.dimensions_set width, 59, 0, 902; Styles.font_size 110; Window.visibility('full')
2
3
  - medium/Styles.font_size 160
3
4
  - small/View.dimensions_set 50, 15, 100, 22; Styles.font_size 110
4
5
  - tiny/20, 10, 40, 22
@@ -0,0 +1,5 @@
1
+ class Directory
2
+ def self.menu *args
3
+ Xiki.dir
4
+ end
5
+ end
@@ -25,7 +25,6 @@ class Itunes
25
25
  @@use_pipe_delimiter = "set Applescript's text item delimiters to \"|\""
26
26
 
27
27
  def self.songs name=nil
28
-
29
28
  # If nothing passed, list all songs
30
29
  if name.nil?
31
30
  tracks = Applescript.run "iTunes", "get the name of every track of library playlist 1 as string", :delimiter=>"|"
@@ -35,7 +34,6 @@ class Itunes
35
34
  end
36
35
 
37
36
  Applescript.run "iTunes", "play track \"#{name}\""
38
-
39
37
  end
40
38
 
41
39
  def self.current
@@ -56,13 +54,13 @@ class Itunes
56
54
 
57
55
  def self.next
58
56
  Applescript.run "iTunes", "next track"
57
+ ".flash - #{self.current}"
59
58
  end
60
59
  def self.previous
61
60
  Applescript.run "iTunes", "previous track"
62
61
  end
63
62
 
64
63
  def self.artists artist=nil, track=nil
65
-
66
64
  # If nothing passed, list artists
67
65
 
68
66
  if artist.nil?
@@ -3,6 +3,10 @@ require 'redcarpet'
3
3
 
4
4
  class Markdown
5
5
 
6
+ def self.to_xiki_format txt
7
+ txt = txt.gsub(/^#+/){"#{'>' * $&.length}"}
8
+ end
9
+
6
10
  def self.render txt
7
11
  markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, :autolink=>true, :space_after_headers=>true)
8
12
  html = markdown.render txt
@@ -0,0 +1,6 @@
1
+ class Readme
2
+ def self.menu *args
3
+ txt = File.read "#{Bookmarks["$x"]}README.markdown"
4
+ Markdown.to_xiki_format txt
5
+ end
6
+ end
@@ -1 +1,3 @@
1
+ > See
1
2
  << console/
3
+ << xiki/setup/install command/
@@ -7,6 +7,10 @@ class WebInterface
7
7
  @http://xiki
8
8
 
9
9
  - install/
10
+ - warning/
11
+ | Beware, the web interface is currently experimental and
12
+ | has security holes that need to be patched (blocking)
13
+ | non-priveleged users from using sensitive menus.
10
14
  - Mac/
11
15
  - 1. Configure Apache/
12
16
  @/etc/apache2/other/
@@ -43,6 +47,11 @@ class WebInterface
43
47
  - Restore) @chmod/644/
44
48
  - 3. Restart Apache/
45
49
  @apache/restart/
50
+ - Linux/
51
+ The steps are the same as for the Mac, but with these
52
+ differences:
53
+ - Use the 'sites-available' dir instead of 'other'
54
+ - Run "a2ensite xiki" on the command line before restarting apache
46
55
  - start/
47
56
  @$xiki/etc/www/
48
57
  % ruby -rubygems sinatra_server.rb
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "xiki"
8
- s.version = "0.6.0"
8
+ s.version = "0.6.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Craig Muth"]
@@ -18,9 +18,11 @@ Gem::Specification.new do |s|
18
18
  "LICENSE",
19
19
  "README.markdown"
20
20
  ]
21
+
22
+ s.rdoc_options += %w[--exclude etc/templates/.*]
23
+
21
24
  files = `git ls-files`.split("\n")
22
25
 
23
- # TMP
24
26
  files = files.select{|o| o !~ /^etc\/xiki/}
25
27
 
26
28
  s.files = files
@@ -39,7 +41,6 @@ Gem::Specification.new do |s|
39
41
  s.add_dependency('net-scp')
40
42
  s.add_dependency('net-sftp')
41
43
  s.add_dependency('rspec')
42
- s.add_dependency('memcached')
43
44
  s.add_dependency('trogdoro-el4r', [">= 1.0.7"])
44
45
 
45
46
  s.add_dependency('file-tail')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xiki
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -171,22 +171,6 @@ dependencies:
171
171
  - - ! '>='
172
172
  - !ruby/object:Gem::Version
173
173
  version: '0'
174
- - !ruby/object:Gem::Dependency
175
- name: memcached
176
- requirement: !ruby/object:Gem::Requirement
177
- none: false
178
- requirements:
179
- - - ! '>='
180
- - !ruby/object:Gem::Version
181
- version: '0'
182
- type: :runtime
183
- prerelease: false
184
- version_requirements: !ruby/object:Gem::Requirement
185
- none: false
186
- requirements:
187
- - - ! '>='
188
- - !ruby/object:Gem::Version
189
- version: '0'
190
174
  - !ruby/object:Gem::Dependency
191
175
  name: trogdoro-el4r
192
176
  requirement: !ruby/object:Gem::Requirement
@@ -282,6 +266,7 @@ files:
282
266
  - README.markdown
283
267
  - Rakefile
284
268
  - bin/xiki
269
+ - etc/command/copy_xiki_command_to.rb
285
270
  - etc/command/xiki_command.rb
286
271
  - etc/command/xiki_process.rb
287
272
  - etc/command/xiki_wrapper
@@ -471,6 +456,7 @@ files:
471
456
  - menu/diffs.menu
472
457
  - menu/dimensions_config.menu
473
458
  - menu/dimensions_config.rb
459
+ - menu/dir.rb
474
460
  - menu/disk.rb
475
461
  - menu/do.rb
476
462
  - menu/docs.menu
@@ -544,6 +530,7 @@ files:
544
530
  - menu/rails.rb
545
531
  - menu/rake.rb
546
532
  - menu/random.menu
533
+ - menu/readme.rb
547
534
  - menu/redis.menu
548
535
  - menu/redmine.rb
549
536
  - menu/riak_tree.rb
@@ -614,7 +601,9 @@ homepage: http://xiki.org
614
601
  licenses:
615
602
  - MIT
616
603
  post_install_message:
617
- rdoc_options: []
604
+ rdoc_options:
605
+ - --exclude
606
+ - etc/templates/.*
618
607
  require_paths:
619
608
  - .
620
609
  required_ruby_version: !ruby/object:Gem::Requirement