xiki 0.5.3a → 0.6.0a

Sign up to get free protection for your applications and to get access to all the features.
Files changed (186) hide show
  1. data/etc/command/xiki_command.rb +6 -5
  2. data/etc/presentations/face.deck +9 -9
  3. data/etc/presentations/menu_directories.deck +6 -6
  4. data/etc/presentations/potential/intro.deck +1 -1
  5. data/etc/presentations/potential/intro1.deck +1 -1
  6. data/etc/presentations/potential/make_mysql_menu.deck +1 -1
  7. data/etc/www/sinatra_server.rb +2 -2
  8. data/lib/xiki.rb +2 -2
  9. data/lib/xiki/code.rb +2 -2
  10. data/lib/xiki/console.rb +0 -3
  11. data/lib/xiki/file_tree.rb +2 -2
  12. data/lib/xiki/image.rb +3 -1
  13. data/lib/xiki/launcher.rb +5 -5
  14. data/lib/xiki/menu.rb +19 -19
  15. data/lib/xiki/notes.rb +2 -4
  16. data/lib/xiki/projects.rb +1 -1
  17. data/lib/xiki/requirer.rb +1 -1
  18. data/lib/xiki/window.rb +1 -1
  19. data/{menus → menu}/accounts.rb +0 -0
  20. data/{menus → menu}/address_book.rb +0 -0
  21. data/{menus → menu}/agenda.rb +0 -0
  22. data/{menus → menu}/all.rb +0 -0
  23. data/{menus → menu}/amazon.rb +0 -0
  24. data/menu/apache.rb +21 -0
  25. data/{menus → menu}/app.rb +0 -0
  26. data/{menus → menu}/applescript.rb +0 -0
  27. data/menu/aquamacs.menu +10 -0
  28. data/{menus → menu}/as.rb +0 -0
  29. data/menu/ascii.menu +131 -0
  30. data/{menus → menu}/black.menu +0 -0
  31. data/{menus → menu}/bookmarklet.rb +0 -0
  32. data/{menus → menu}/bootstrap.rb +0 -0
  33. data/menu/brew.menu +12 -0
  34. data/{menus → menu}/browser.rb +2 -3
  35. data/menu/calendar.rb +42 -0
  36. data/{menus → menu}/cassandra_db.rb +0 -0
  37. data/menu/chgrp.menu +1 -0
  38. data/{menus → menu}/chmod.rb +0 -0
  39. data/menu/chown.rb +32 -0
  40. data/menu/cla.rb +19 -0
  41. data/{menus → menu}/classes.rb +0 -0
  42. data/{menus → menu}/coffee_script.rb +0 -0
  43. data/menu/colors.menu +2 -0
  44. data/menu/computer.menu +4 -0
  45. data/{menus → menu}/conf.rb +0 -0
  46. data/{menus → menu}/contacts.rb +0 -0
  47. data/{menus → menu}/cookies.rb +0 -0
  48. data/{menus → menu}/couch.rb +0 -0
  49. data/menu/count.menu +4 -0
  50. data/menu/cpu.menu +2 -0
  51. data/{menus → menu}/create.rb +1 -1
  52. data/{menus → menu}/crop.rb +0 -0
  53. data/{menus → menu}/css.rb +0 -0
  54. data/menu/curl.menu +8 -0
  55. data/{menus → menu}/current.rb +0 -0
  56. data/menu/databases.menu +6 -0
  57. data/{menus → menu}/db.rb +0 -0
  58. data/{menus → menu}/deck.rb +0 -0
  59. data/menu/def.rb +17 -0
  60. data/{menus → menu}/dictionary.rb +0 -0
  61. data/menu/diffs.menu +2 -0
  62. data/menu/dimensions_config.menu +8 -0
  63. data/{menus → menu}/dimensions_config.rb +0 -0
  64. data/{menus → menu}/disk.rb +0 -0
  65. data/{menus → menu}/do.rb +0 -0
  66. data/menu/docs.menu +74 -0
  67. data/menu/dom.rb +252 -0
  68. data/{menus → menu}/dotsies.rb +0 -0
  69. data/{menus → menu}/edited.rb +0 -0
  70. data/menu/edits.rb +5 -0
  71. data/{menus → menu}/emacs.rb +0 -0
  72. data/menu/encoding.rb +32 -0
  73. data/{menus → menu}/enter.rb +0 -0
  74. data/{menus → menu}/executable.rb +0 -0
  75. data/{menus → menu}/filter.rb +0 -0
  76. data/{menus → menu}/firefox.rb +0 -0
  77. data/menu/font.menu +1 -0
  78. data/{menus → menu}/foo.rb +0 -0
  79. data/menu/frameworks.menu +3 -0
  80. data/{menus → menu}/french.rb +0 -0
  81. data/menu/gems.rb +77 -0
  82. data/{menus → menu}/git.rb +1 -1
  83. data/{menus → menu}/gito.rb +0 -0
  84. data/{menus → menu}/google.rb +0 -0
  85. data/{menus → menu}/google_images.rb +0 -0
  86. data/{menus → menu}/google_patents.rb +0 -0
  87. data/menu/grep.menu +14 -0
  88. data/{menus → menu}/gutenberg.rb +0 -0
  89. data/{menus → menu}/head.rb +0 -0
  90. data/{menus → menu}/headings.rb +0 -0
  91. data/menu/hosts.menu +5 -0
  92. data/{menus → menu}/html.rb +0 -0
  93. data/menu/html5.menu +164 -0
  94. data/{menus → menu}/http.rb +0 -0
  95. data/menu/httpd.menu +1 -0
  96. data/{menus → menu}/icon.rb +0 -0
  97. data/{menus → menu}/images.menu +0 -0
  98. data/{menus → menu}/img.rb +0 -0
  99. data/{menus → menu}/info.rb +0 -0
  100. data/{menus → menu}/ip.rb +0 -0
  101. data/{menus → menu}/iterm.rb +0 -0
  102. data/{menus → menu}/itunes.rb +0 -0
  103. data/{menus → menu}/javascript.rb +0 -0
  104. data/{menus → menu}/layout.rb +0 -0
  105. data/menu/lighttp.menu +30 -0
  106. data/menu/linebreaks.menu +1 -0
  107. data/menu/list.menu +1 -0
  108. data/menu/ln.menu +2 -0
  109. data/{menus → menu}/local_storage.rb +0 -0
  110. data/{menus → menu}/ls.rb +0 -0
  111. data/{menus → menu}/mac.rb +0 -0
  112. data/{menus → menu}/maps.rb +0 -0
  113. data/menu/markdown.rb +52 -0
  114. data/{menus → menu}/matches.rb +0 -0
  115. data/{menus → menu}/memcache.rb +0 -0
  116. data/{menus → menu}/mkdir.rb +0 -0
  117. data/{menus → menu}/models.rb +0 -0
  118. data/{menus → menu}/mongo.rb +0 -0
  119. data/menu/music.menu +1 -0
  120. data/{menus → menu}/mysql.rb +2 -2
  121. data/{menus → menu}/node.rb +0 -0
  122. data/menu/opacity.menu +1 -0
  123. data/{menus → menu}/open.rb +0 -0
  124. data/{menus → menu}/outline.rb +0 -0
  125. data/menu/permissions.menu +2 -0
  126. data/{menus → menu}/piano.rb +0 -0
  127. data/{menus → menu}/postgres.rb +0 -0
  128. data/{menus → menu}/pre.rb +0 -0
  129. data/menu/processes.menu +8 -0
  130. data/menu/ps.menu +1 -0
  131. data/{menus → menu}/python.rb +0 -0
  132. data/menu/qri.rb +11 -0
  133. data/{menus → menu}/r.rb +0 -0
  134. data/{menus → menu}/rails.rb +0 -0
  135. data/{menus → menu}/rake.rb +0 -0
  136. data/menu/random.menu +1 -0
  137. data/menu/redis.menu +10 -0
  138. data/{menus → menu}/redmine.rb +0 -0
  139. data/{menus → menu}/riak_tree.rb +0 -0
  140. data/{menus → menu}/rss.rb +0 -0
  141. data/menu/rsync.menu +8 -0
  142. data/menu/rvm.menu +6 -0
  143. data/{menus → menu}/safari.rb +0 -0
  144. data/{menus → menu}/sass.rb +0 -0
  145. data/{menus → menu}/say.rb +0 -0
  146. data/{menus → menu}/scale.rb +0 -0
  147. data/menu/scroll_bars.menu +1 -0
  148. data/{menus → menu}/serve.rb +1 -1
  149. data/{menus → menu}/settings.menu +0 -0
  150. data/menu/shell_commands.menu +1 -0
  151. data/{menus → menu}/shuffle.rb +0 -0
  152. data/menu/sinatra.menu +19 -0
  153. data/menu/size.menu +1 -0
  154. data/menu/source.menu +2 -0
  155. data/{menus → menu}/spanish.rb +0 -0
  156. data/menu/specials.rb +7 -0
  157. data/{menus → menu}/standalone.rb +1 -1
  158. data/menu/svg.rb +139 -0
  159. data/menu/synonyms.menu +1 -0
  160. data/menu/tabs.rb +20 -0
  161. data/{menus → menu}/tail.rb +0 -0
  162. data/{menus → menu}/technologies.rb +0 -0
  163. data/menu/tests.menu +2 -0
  164. data/menu/textile.rb +44 -0
  165. data/menu/themes.rb +56 -0
  166. data/{menus → menu}/thesaurus.rb +0 -4
  167. data/{menus → menu}/to.rb +0 -0
  168. data/{menus → menu}/twitter.rb +0 -0
  169. data/{menus → menu}/urls.menu +0 -0
  170. data/menu/web_development.menu +24 -0
  171. data/{menus → menu}/web_interface.rb +0 -4
  172. data/{menus → menu}/welcome.menu +3 -3
  173. data/{menus → menu}/white.menu +0 -0
  174. data/menu/wiki.menu +9 -0
  175. data/menu/wiki_syntax.menu +19 -0
  176. data/{menus → menu}/wikipedia.rb +0 -0
  177. data/{menus → menu}/words.rb +0 -0
  178. data/{menus → menu}/youtube.rb +0 -0
  179. data/xiki.gemspec +2 -2
  180. metadata +406 -340
  181. data/menus/browse.rb +0 -13
  182. data/menus/computer.rb +0 -24
  183. data/menus/dimensions_config.menu +0 -30
  184. data/menus/docs.rb +0 -57
  185. data/menus/eval.rb +0 -17
  186. data/menus/themes.rb +0 -32
File without changes
data/menu/diffs.menu ADDED
@@ -0,0 +1,2 @@
1
+ << diff log/
2
+ << history/unsaved files/
@@ -0,0 +1,8 @@
1
+ - full/View.dimensions_full; Styles.font_size 110
2
+ - medium/Styles.font_size 160
3
+ - small/View.dimensions_set 50, 15, 100, 22; Styles.font_size 110
4
+ - tiny/20, 10, 40, 22
5
+ - small font/Styles.font_size 110
6
+ - medium font/Styles.font_size 170
7
+ - large/145, 58, 46, 22
8
+ - right/View.dimensions_set 119, 50, 573, 22; Styles.font_size 110
File without changes
File without changes
File without changes
data/menu/docs.menu ADDED
@@ -0,0 +1,74 @@
1
+ - Introduction/
2
+ | Most of the Xiki documentation is spread out among other menus, under
3
+ | their respective 'docs' menus.
4
+
5
+ > Here are some to check out first
6
+ @keys/docs/
7
+ @menu/docs/
8
+ @files/docs/
9
+ @view/docs/
10
+ - Try typing stuff/
11
+ > Try just typing a word
12
+ | Think of a menu name that might exist and sounds likely to solve your
13
+ | problem. For example, if you want to do something with images, try the
14
+ | 'images' menu. Type it on a blank line and double-click, or use
15
+ | open+menu (type Ctrl-O, Ctrl-M).
16
+
17
+ | Help us improve the docs, and contribute back to the Xiki project. If
18
+ | the menu doesn't exist, create it! If it exists, but could be improved,
19
+ | edit it! Many menus exist just to direct you to other menus. It takes
20
+ | only seconds to create them.
21
+
22
+ > See
23
+ @menu/docs/how_to_create/
24
+ - faq/
25
+ - What is Xiki/
26
+ Xiki is an environment that can be used in several ways:
27
+
28
+ - Shell terminal on steroids
29
+ - Development environment for coding rails or node.js apps, etc.
30
+ - Framework for making lightweight user interfaces
31
+ - What does Xiki stand for/
32
+ XIKI is short for eXecutable wIKI.
33
+ - What are Xiki's main dependencies/
34
+ - An editor
35
+ - Emacs is fully supported
36
+ - Xiki takes advantage of many powerful Emacs features
37
+ - but you don't need to know Emacs to use Xiki
38
+ - El4r is used as a bridge
39
+ - Vim and support for other editors is on the way
40
+ - Xiki is implemented mostly in ruby
41
+ - but can use other languages like python, javascript, and coffeescript
42
+ - What's the best way to figure out how to do something/
43
+ - @docs/Try typing stuff/
44
+ - How can I keep up to date with the latest Xiki happenings/
45
+ - Follow http://twitter.com/xiki
46
+ - Join http://groups.google.com/group/xiki/
47
+ - Watch https://github.com/trogdoro/xiki
48
+ - Xiki Shell Command/
49
+ > Summary
50
+ The 'xiki' shell command can be run on the command line
51
+ outside of Xiki. It is mostly meant to be called by programs
52
+ that want to interface with Xiki. But it is sometimes useful for
53
+ people to call it directly. Example usages:
54
+
55
+ $ xiki ip
56
+ $ xiki docs/faq
57
+ - Xiki Web Interface/
58
+ > Summary
59
+ You can access most xiki menus in your browser, using this url:
60
+
61
+ http://xiki
62
+
63
+ > Setting it up
64
+ See this menu for how to set it up. Beware, it's currently
65
+ experimental has security holes that need to be patched (blocking)
66
+ non-priveleged users from using sensitive menus.
67
+
68
+ @web interface/
69
+
70
+ Some of the more complicated menus that have editor dependencies
71
+ will only be partially functional in the browser.
72
+
73
+ > From the shell console, you can type stuff like this:
74
+ $ xiki docs/Introduction
data/menu/dom.rb ADDED
@@ -0,0 +1,252 @@
1
+ class Dom
2
+
3
+ def self.menu
4
+
5
+ "
6
+ - .styles/
7
+ - docs/
8
+ > Summary
9
+ | Navigate and update the web page currently displayed in your
10
+ | web browser.
11
+
12
+ > Browse
13
+ @dom/
14
+
15
+ > Search text
16
+ @dom/##Some text/
17
+
18
+ > Id's and styles
19
+ @dom/#my_id/
20
+ @dom/.my_style/
21
+
22
+ > Show all id's
23
+ @dom/ids/
24
+
25
+ > Show all styles
26
+ @dom/styles/
27
+ "
28
+ end
29
+
30
+ def self.menu_before *args
31
+ return nil if args.any?
32
+
33
+ # If no args, delegate to dom path
34
+
35
+ result = self.dom *args
36
+ result + ["docs/"]
37
+ end
38
+
39
+ def self.menu_after output, *args
40
+ return nil if output
41
+
42
+ # If menu couldn't handle it, delegate to dom path
43
+
44
+ self.dom *args
45
+ end
46
+
47
+ def self.dom *args
48
+
49
+ # If starts with ##, delegate to search...
50
+
51
+ if args[0] =~ /^##(.+)/
52
+ return self.search $1
53
+ end
54
+
55
+ options = args[-1].is_a?(Hash) ? args.pop : {}
56
+
57
+ prefix = options[:prefix] || Keys.prefix
58
+
59
+ raw_args = args.to_s.sub /\/$/, ''
60
+
61
+ # If last arg has linebreakes, save back to page...
62
+
63
+ save = args.pop if args.last =~ /^\|/
64
+
65
+ args.each do |o|
66
+ o.sub! /\/$/, ''
67
+ o.sub!(/:(\d+)$/) { ":eq(#{$1.to_i - 1})" }
68
+ o.sub!(/$/, ':eq(0)') if o !~ /[:#]/
69
+ end
70
+ args = ['html'] + args unless args[0] =~ /[.#]/
71
+ args = args.join ' > '
72
+
73
+ js = %`
74
+ $.fn.blink = function(times) {
75
+ console.log(times)
76
+
77
+ var el = $(this);
78
+ if(! times) times = 2;
79
+ for(x=1;x<=times;x++) {
80
+ el.animate({opacity: 0.0}, {easing: 'swing', duration: 200});
81
+ el.animate({opacity: 1.0}, {easing: 'swing', duration: 200});
82
+ }
83
+ return this;
84
+ };
85
+
86
+ var kids = [];
87
+ `.unindent
88
+
89
+ if save
90
+ save = Tree.siblings(:all=>true).map{|i| "#{i.gsub(/^\| /, '')}\n"}.join('')
91
+ save.gsub! "\n", "\\n"
92
+ save.gsub! '"', '\\"'
93
+
94
+ js << %`
95
+ var e = $(\"#{args}\");
96
+ if(e.length)
97
+ e.blink(1).html(\"#{save}\");
98
+ `.unindent
99
+
100
+ if args =~ /(.+) > (.+)/
101
+ parent, child = $1, $2.sub!(/:.+/, '')
102
+ js << %`
103
+ else
104
+ $(\"#{parent}\").blink(1).append(\"<#{child}>#{save}</#{child}>\");
105
+ `.unindent
106
+ end
107
+
108
+ Firefox.exec js
109
+ return
110
+ end
111
+
112
+ # Otherwise, just blink and show children...
113
+
114
+ if prefix == :-
115
+ Firefox.exec "$(\"#{args}\").blink()"
116
+ return
117
+ end
118
+ if prefix != "all" && prefix != "outline"
119
+ js << %`
120
+ $("#{args}").blink().children().each(function(n, e){
121
+ var tag = e.nodeName.toLowerCase();
122
+ var id = $(e).attr('id');
123
+ if(id) tag += "#"+id
124
+ kids.push(tag);
125
+ })
126
+ `
127
+ end
128
+
129
+ js << %`
130
+ if(kids.length)
131
+ String(kids);
132
+ else
133
+ "html::"+$("#{args}").html();
134
+ `.unindent
135
+
136
+ kids = Firefox.exec js #, :jquery=>1
137
+
138
+ kids = kids.sub(/\A"/, '').sub(/"\z/, '') if kids =~ /\A"/
139
+ if kids =~ /\Ahtml::/
140
+ kids = kids.sub(/\Ahtml::/, '').strip
141
+ return prefix == "all" ?
142
+ kids.gsub(/^/, '| ') :
143
+ self.tidy(kids, raw_args)
144
+ end
145
+
146
+ kids = kids.split ','
147
+
148
+ counts = {}
149
+ kids.each do |k| # Add on counts
150
+ k_raw = k.sub /#.+/, ''
151
+ counts[k] ||= 0
152
+ counts[k] += 1
153
+ k.replace "#{k}:#{counts[k]}" unless k =~ /#/ || counts[k] == 1
154
+ end
155
+ kids.map{|o| "#{o}/"}
156
+ end
157
+
158
+
159
+ def self.search txt=nil
160
+ if txt.nil?
161
+ return View.prompt "Enter a string to search for on the page"
162
+ end
163
+
164
+ js = %`
165
+ var result="", depth=-1;
166
+ $('*:contains(#{txt})').each(function(i, e){
167
+ var tag = e.tagName.toLowerCase();
168
+ e = $(e);
169
+ var current_depth = e.parents().length; // Only climb downward
170
+ if(current_depth <= depth) return depth = 9999; // Don't grab any more
171
+ depth = current_depth;
172
+ var prev_count = $(e).prevAll(tag).length;
173
+ result += tag;
174
+ if(prev_count > 0) result += ':'+(prev_count+1);
175
+ result += '/';
176
+ })
177
+ result;
178
+ `.unindent
179
+
180
+ result = Firefox.exec js #, :jquery=>1
181
+
182
+ result.sub "html/", "- @dom/"
183
+ end
184
+
185
+
186
+ def self.tidy html, tag=nil
187
+
188
+ File.open("/tmp/tidy.html", "w") { |f| f << html }
189
+
190
+ errors = `tidy --indent-spaces 2 --tidy-mark 0 --force-output 1 -i -wrap 0 -o /tmp/tidy.html.out /tmp/tidy.html`
191
+ html = IO.read("/tmp/tidy.html.out")
192
+
193
+ html.gsub! /\n\n+/, "\n"
194
+
195
+ if tag == "" # It's the whole thing, do nothing
196
+ elsif tag == "head"
197
+ html.sub! /.+?<head>\n/m, ''
198
+ html.sub! /^<\/head>\n.+/m, ''
199
+ else
200
+ html.sub! /.+?<body>\n/m, ''
201
+ html.sub! /^<\/body>\n.+/m, ''
202
+ end
203
+
204
+ html.gsub!(/ +$/, '')
205
+ html.gsub! /^ /, '' unless html =~ /^</
206
+ html.gsub! /^/, '| '
207
+ html
208
+
209
+ # Try Nokogiri and xsl - Fucking dies part-way through
210
+ # return Nokogiri::XML(kids).human.sub(/\A<\?.+\n\n/, '').gsub(/^/, '| ')
211
+ # return Nokogiri::XML("<foo>#{kids}</foo>").human.gsub(/^/, '| ')
212
+ # return Nokogiri::XML(kids).human.gsub(/^/, '| ')
213
+
214
+ # Try REXML (gives errors)
215
+ # doc = REXML::Document.new("<foo>#{kids}</foo>")
216
+ # out = StringIO.new; doc.write( out, 2 )
217
+ # return out.string
218
+
219
+ end
220
+
221
+ # def self.ids *args
222
+ # Ol << "args: #{args.inspect}"
223
+
224
+ # # If just "ids/", list all
225
+
226
+ # if args.blank?
227
+ # js = %`
228
+ # var result="";
229
+ # $('*[id]').each(function(i, e){
230
+ # var id = $(e).attr('id');
231
+ # result += "+ #"+id+"/\\n";
232
+ # })
233
+ # result;
234
+ # `.unindent
235
+
236
+ # return Firefox.exec js
237
+ # end
238
+
239
+ # # Id passed so just navigate to it
240
+
241
+ # Dom.dom *args
242
+
243
+ # # result.sub "html/", "- @dom/"
244
+
245
+ # end
246
+
247
+ def self.styles
248
+ "todo"
249
+ end
250
+
251
+
252
+ end
File without changes
File without changes
data/menu/edits.rb ADDED
@@ -0,0 +1,5 @@
1
+ class Edits
2
+ def self.menu *args
3
+ DiffLog.diffs *args
4
+ end
5
+ end
File without changes
data/menu/encoding.rb ADDED
@@ -0,0 +1,32 @@
1
+ class Encoding
2
+ def self.menu *args
3
+ "
4
+ - current: #{$el.elvar.buffer_file_coding_system.to_s}
5
+ - .dos/
6
+ - .raw unix/
7
+ - .iso unix/
8
+ - .utf8/
9
+ "
10
+ end
11
+
12
+ def self.dos
13
+ $el.set_buffer_file_coding_system :dos
14
+ ".flash - updated!"
15
+ end
16
+
17
+ def self.raw_unix
18
+ $el.set_buffer_file_coding_system :unix
19
+ ".flash - updated!"
20
+ end
21
+
22
+ def self.iso_unix
23
+ $el.set_buffer_file_coding_system :iso_latin_1_unix
24
+ ".flash - updated!"
25
+ end
26
+
27
+ def self.utf8
28
+ $el.set_buffer_file_coding_system :mule_utf_8_unix
29
+ ".flash - updated!"
30
+ end
31
+
32
+ end
File without changes
File without changes
File without changes
File without changes
data/menu/font.menu ADDED
@@ -0,0 +1 @@
1
+ <<< @styles/font size/
File without changes
@@ -0,0 +1,3 @@
1
+ << rails/
2
+ << sinatra/
3
+ << node/
File without changes
data/menu/gems.rb ADDED
@@ -0,0 +1,77 @@
1
+ class Gems
2
+ def self.menu
3
+ "
4
+ - .list/
5
+ - */
6
+ - */
7
+ - .readme/
8
+ - .source/
9
+ - .uninstall/
10
+ - .environment/
11
+ "
12
+ end
13
+
14
+ def self.list name=nil
15
+
16
+ # If nothing passed, list noames
17
+
18
+ if name.nil?
19
+ gem_list = Console.sync("gem list")
20
+ return gem_list.gsub(/ \(.+/, "").gsub(/.+/, "- \\0/")
21
+ end
22
+
23
+ # If just name, list versions
24
+
25
+ txt = Console.sync("gem list #{name}")
26
+ versions = txt[/\((.+)\)/, 1]
27
+ versions = versions.split ", "
28
+
29
+ return versions.map{|o| "#{o}/"}
30
+
31
+
32
+ # # If version passed, show options
33
+ # "
34
+ # - nothing at this point/
35
+ # "
36
+
37
+ end
38
+
39
+ def self.uninstall name, version
40
+ txt = "sudo gem uninstall #{name} -v #{version}"
41
+ Console.run txt
42
+
43
+ ".flash - Running gem uninstall command in shell..."
44
+ end
45
+
46
+ def self.gem_dir name
47
+ Gem::Specification.find_by_name(name).gem_dir+"/"
48
+ end
49
+
50
+ def self.source name, version
51
+ dir = Gems.gem_dir name
52
+
53
+ "@#{dir}"
54
+ end
55
+
56
+ def self.readme name, version
57
+
58
+ dir = Gems.gem_dir name
59
+
60
+ entries = Dir.new(dir).entries
61
+ file = entries.find{|o| o =~ /^readme/i}
62
+
63
+ return "| No readme file found in\n@#{dir}" if ! file
64
+
65
+ path = "#{dir}#{file}"
66
+
67
+ Tree << "@#{path}"
68
+
69
+ Launcher.enter_all
70
+ nil
71
+ end
72
+
73
+ def self.environment
74
+ Console.sync("gem environment").strip.gsub(/^/, '| ')
75
+ end
76
+
77
+ end