Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add gemspec, license, readme, rakefile, version

  • Loading branch information...
commit ceb2678222babbd5ed4e1b4613966f4400c304b9 1 parent 9a460c4
@cldwalker authored
View
23 .gemspec
@@ -0,0 +1,23 @@
+# -*- encoding: utf-8 -*-
+require 'rubygems' unless Object.const_defined?(:Gem)
+require File.dirname(__FILE__) + "/lib/nirvana/version"
+
+Gem::Specification.new do |s|
+ s.name = "nirvana"
+ s.version = Nirvana::VERSION
+ s.authors = ["Gabriel Horner"]
+ s.email = "gabriel.horner@gmail.com"
+ s.homepage = "http://github.com/cldwalker/nirvana"
+ s.summary = "A ruby web shell that is very ape and very nice"
+ s.description = "DESCRIPTION"
+ s.required_rubygems_version = ">= 1.3.6"
+ s.rubyforge_project = 'tagaholic'
+ s.executables = ['nirvana', 'nirvana-websocket']
+ s.add_dependency 'ripl', '>= 0.2.1'
+ s.add_dependency 'escape_utils', '>= 0.1.8'
+ s.add_dependency 'json_pure', '>= 1.4.3'
+ s.add_dependency 'em-websocket', '>= 0.1.4'
+ s.files = Dir.glob(%w[{lib,test}/**/*.rb bin/* [A-Z]*.{txt,rdoc} ext/**/*.{rb,c} **/deps.rip]) + %w{Rakefile .gemspec}
+ s.extra_rdoc_files = ["README.rdoc", "LICENSE.txt"]
+ s.license = 'MIT'
+end
View
22 LICENSE.txt
@@ -0,0 +1,22 @@
+The MIT LICENSE
+
+Copyright (c) 2010 Gabriel Horner
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
49 README.rdoc
@@ -0,0 +1,49 @@
+== Description
+A ruby web shell that has autocompletion and readline behavior. It uses
+websockets, repl.js, readline.js and ripl for the shell engine.
+
+== Install
+Install the gem with:
+
+ sudo gem install nirvana
+
+== Usage
+
+Your browser must have html5 websockets support.
+
+To use, start a websocket server and open nirvana in a tab
+
+ # On a mac
+ $ nirvana
+
+ # Everywhere else
+ $ nirvana | command_to_browser_path
+
+If you close the tab, the path to nirvana's html page is (for reopening)
+
+ $ echo $(dirname $(gem which nirvana))/nirvana/public/index.html
+
+== Customize
+Since nirvana uses ripl under the hood, most shell behavior is customizable with ripl plugins which
+get loaded from ~/.riplrc. See {ripl}[http://github.com/cldwalker/ripl] for more.
+
+== Links
+* {ripl}[http://github.com/cldwalker/ripl]
+* {readline.js}[http://github.com/cldwalker/readline.js]
+* {repl.js}[http://github.com/cldwalker/repl.js]
+
+== Bugs/Issues
+Please report them {on github}[http://github.com/cldwalker/nirvana/issues]. For javascript issues,
+report them on {readline.js}[http://github.com/cldwalker/readline.js/issues] or
+{repl.js}[http://github.com/cldwalker/repl.js/issues] as appropriate.
+
+== Credits
+* {rkh's brirb}[http://github.com/rkh/brirb]: Original prototype which inspired this project
+
+== Todo
+* Tests
+* Load ~/.irb_history into readline.js
+* Customizable html and js
+* Use text area for multi-line input
+* See readline.js and repl.js todos for javascript todos
+* Possible plugins for sinatra and em-websocket-server
View
35 Rakefile
@@ -0,0 +1,35 @@
+require 'rake'
+require 'fileutils'
+
+def gemspec
+ @gemspec ||= eval(File.read('.gemspec'), binding, '.gemspec')
+end
+
+desc "Build the gem"
+task :gem=>:gemspec do
+ sh "gem build .gemspec"
+ FileUtils.mkdir_p 'pkg'
+ FileUtils.mv "#{gemspec.name}-#{gemspec.version}.gem", 'pkg'
+end
+
+desc "Install the gem locally"
+task :install => :gem do
+ sh %{gem install pkg/#{gemspec.name}-#{gemspec.version}}
+end
+
+desc "Generate the gemspec"
+task :generate do
+ puts gemspec.to_ruby
+end
+
+desc "Validate the gemspec"
+task :gemspec do
+ gemspec.validate
+end
+
+desc 'Run tests'
+task :test do |t|
+ sh 'bacon -q -Ilib -I. test/*_test.rb'
+end
+
+task :default => :test
View
4 deps.rip
@@ -0,0 +1,4 @@
+ripl >=0.2.1
+escape_utils >=0.1.9
+json_pure >=1.4.3
+em-websocket >=0.1.4
View
1  lib/nirvana.rb
@@ -2,6 +2,7 @@
require 'ripl/web'
require 'nirvana/shell'
require 'nirvana/util'
+require 'nirvana/version'
module Nirvana
def self.start_shell
View
4 lib/nirvana/shell.rb
@@ -1,4 +1,4 @@
-require 'yajl'
+require 'json'
require 'ripl/completion'
module Nirvana
@@ -38,7 +38,7 @@ def html_error(error, message)
def get_completions(input)
arr = completions input.sub(/^:AUTOCOMPLETE:\s*/, '')
- ':AUTOCOMPLETE: ' + Yajl::Encoder.encode(arr)
+ ':AUTOCOMPLETE: ' + JSON.generate(arr)
end
def completions(line_buffer)
View
3  lib/nirvana/version.rb
@@ -0,0 +1,3 @@
+module Nirvana
+ VERSION = '0.1.0'
+end
Please sign in to comment.
Something went wrong with that request. Please try again.