Permalink
Browse files

gemification

  • Loading branch information...
1 parent e96d961 commit 576a5554768ea3da85c1864ab56cb7cf08721711 @cldwalker committed Apr 4, 2011
Showing with 160 additions and 0 deletions.
  1. +22 −0 .gemspec
  2. +2 −0 CHANGELOG.rdoc
  3. +22 −0 LICENSE.txt
  4. +79 −0 README.rdoc
  5. +35 −0 Rakefile
View
@@ -0,0 +1,22 @@
+# -*- encoding: utf-8 -*-
+require 'rubygems' unless Object.const_defined?(:Gem)
+require File.dirname(__FILE__) + "/lib/tux/version"
+
+Gem::Specification.new do |s|
+ s.name = "tux"
+ s.version = Tux::VERSION
+ s.authors = ["Gabriel Horner"]
+ s.email = "gabriel.horner@gmail.com"
+ s.homepage = "http://github.com/cldwalker/tux"
+ s.summary = "Sinatra dressed for interactive ruby - a sinatra shell"
+ s.description = "Tux dresses up sinatra for interactive use. Use it to interact with your helpers, view rendering and your app's response objects. Tux also gives you commands to view your app's routes and settings."
+ s.required_rubygems_version = ">= 1.3.6"
+ s.rubyforge_project = 'tagaholic'
+ s.executables = ['tux']
+ s.add_dependency 'ripl', '>= 0.3.4'
+ s.add_dependency 'ripl-rack', '>= 0.1.0'
+ s.add_dependency 'sinatra', '>= 1.2.1'
+ 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
@@ -0,0 +1,2 @@
+== 0.1.0
+* Initial release!
View
@@ -0,0 +1,22 @@
+The MIT LICENSE
+
+Copyright (c) 2011 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
@@ -0,0 +1,79 @@
+== Description
+Tux dresses up sinatra for interactive use. Use it to interact with your helpers, view rendering and
+your app's response objects. Tux also gives you commands to view your app's routes and settings.
+
+== Install
+Install the gem with:
+
+ gem install tux
+
+== Usage
+
+To interact with your helpers:
+
+ $ tux.uri
+ >> app.my_helper_method
+ ...
+
+To interact with any built-in sinatra methods i.e. request and response specific helper
+methods:
+
+ # depends on request
+ >> app.uri '/'
+ => "http://:/"
+
+ # depends on response
+ >> app.headers
+ => {"Content-Type"=>"text/html"}
+
+For the above to work, tux sets up default empty request and response objects. To try the helpers
+with your own requests and responses:
+
+ >> app.request = Sinatra::Request.new({})
+ >> app.response = Sinatra::Response.new
+
+To interact with your views:
+
+ >> app.erb :my_template
+ => 'template rendered'
+
+Tux also comes with commands to give you a good overview of your app
+
+ $ tux
+ >> routes
+ HEAD "/"
+ HEAD /book/:id
+ GET "/"
+ GET /book/:id
+
+ >> settings
+ absolute_redirects true
+ add_charset [/^text\//, "application/javascript", "application/xml",
+ "application/xhtml+xml"]
+ app_file "./sample.rb"
+ bind "0.0.0.0"
+ default_encoding "utf-8"
+ dump_errors true
+ empty_path_info nil
+ environment :development
+ lock false
+ logging false
+ method_override false
+ port 4567
+ prefixed_redirects false
+ public "/my/path/public"
+ raise_errors false
+ reload_templates true
+ root "/my/path"
+ run false
+ running false
+ server ["thin", "mongrel", "webrick"]
+ session_secret "XXX"
+ sessions false
+ show_exceptions true
+ static true
+ views "/my/path/views"
+
+== TODO
+* Better integration with ripl-rack
+* Tests
View
@@ -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

0 comments on commit 576a555

Please sign in to comment.