Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Link to TechRepublic article

  • Loading branch information...
commit df85060e52a6e5775dd5be16550abe19ae9722e3 1 parent c8f79fc
@jberkel authored
Showing with 57 additions and 3 deletions.
  1. +12 −3 README.md
  2. +45 −0 Rakefile
View
15 README.md
@@ -1,7 +1,11 @@
-
# Interactive editor
-cf. my (slightly outdated) blog post: [Integrating vim and irb](http://zegoggl.es/2009/04/integrating-vim-and-irb.html) and [vimcasts #20: Running Vim within IRB](http://vimcasts.org/e/20).
+Drew Neil has made it the subject of one of his vimcasts:
+[vimcasts #20: running Vim within IRB][], and Chad Perrin has written an
+article about it on TechRepublic:
+[Use interactive_editor with irb for an inside-out Ruby IDE][].
+There's also an outdated blog post which predates the gem from 2009:
+[Integrating vim and IRB][].
## Usage
@@ -35,7 +39,9 @@ interactive_editor also works with the IRB alternative [ripl][].
## Credits
-Giles Bowkett, Greg Brown, and several audience members from Giles' Ruby East presentation: [Use vi or any text editor from within IRB](http://gilesbowkett.blogspot.com/2007/10/use-vi-or-any-text-editor-from-within.html).
+Giles Bowkett, Greg Brown, and several audience members from Giles' Ruby East
+presentation: [Use vi or any text editor from within
+IRB](http://gilesbowkett.blogspot.com/2007/10/use-vi-or-any-text-editor-from-within.html).
With contributions from:
@@ -43,5 +49,8 @@ With contributions from:
* [Jan Lelis](https://github.com/janlelis)
* [TJ Singleton](https://github.com/tjsingleton)
+[Integrating vim and irb]: http://zegoggl.es/2009/04/integrating-vim-and-irb.html
+[vimcasts #20: Running Vim within IRB]: http://vimcasts.org/e/20
+[Use interactive_editor with irb for an inside-out Ruby IDE]: http://www.techrepublic.com/blog/programming-and-development/use-interactiveeditor-with-irb-for-an-inside-out-ruby-ide/4125
[ripl]: https://github.com/cldwalker/ripl
[object aorta]: http://rubyforge.org/snippet/detail.php?type=snippet&id=22
View
45 Rakefile
@@ -116,3 +116,48 @@ task :validate do
exit!
end
end
+
+namespace :doc do
+ desc "Render markdown as if it were shown on github, expects FILE=path/to/doc.md"
+ task :preview do
+ infile = File.expand_path(ENV['FILE'].to_s)
+ outfile = "/tmp/#{File.basename(infile)}.html"
+ revision = `git rev-parse HEAD`.strip
+ markdown = `which markdown`.strip
+
+ unless $?.success?
+ puts "Make sure you have 'markdown' in your path, usage: brew install markdown"
+ exit 1
+ end
+
+ unless File.exists?(infile)
+ puts "Cannot find FILE=#{ENV['FILE'].inspect}, usage: rake soundcloud:doc:preview FILE=doc/hello.md"
+ exit 2
+ end
+
+ File.open(outfile, "w") do |out|
+ body = `#{markdown} #{infile}`
+ template = <<-END
+ <html>
+ <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
+ <meta http-equiv="X-UA-Compatible" content="chrome=1">
+ <head>
+ <link href="https://assets0.github.com/stylesheets/bundle_common.css?#{revision}" media="screen" rel="stylesheet" type="text/css" />
+ <link href="https://assets3.github.com/stylesheets/bundle_github.css?#{revision}" media="screen" rel="stylesheet" type="text/css" />
+ </head>
+ <body>
+ <div id="readme" class="blob">
+ <div class="wikistyle">
+ #{body}
+ </div>
+ </div>
+ </body>
+ </html>
+ END
+ out.write(template)
+ end
+
+ puts "Launching: open #{outfile}"
+ system("open #{outfile}")
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.