From b915ea9d31a81fdd3393f94caeb8e47a44037c59 Mon Sep 17 00:00:00 2001 From: Aaron Quint Date: Mon, 13 Apr 2009 16:41:35 -0400 Subject: [PATCH] Gemified. Added README and gemspec/hoe --- History.txt | 4 ++++ LICENSE | 22 +++++++++++++++++++++ Manifest.txt | 10 ++++++++++ README.rdoc | 32 +++++++++++++++++++++++++++++++ Rakefile | 35 +++++++++++++++++++++++++++++---- lib/vegas.rb | 10 +++++----- script/console | 10 ++++++++++ script/destroy | 14 ++++++++++++++ script/generate | 14 ++++++++++++++ vegas.gemspec | 51 +++++++++++++++++++++++++++++++++++++++++++++++++ 10 files changed, 193 insertions(+), 9 deletions(-) create mode 100644 History.txt create mode 100644 LICENSE create mode 100644 Manifest.txt create mode 100644 README.rdoc create mode 100755 script/console create mode 100755 script/destroy create mode 100755 script/generate create mode 100644 vegas.gemspec diff --git a/History.txt b/History.txt new file mode 100644 index 0000000..587eb62 --- /dev/null +++ b/History.txt @@ -0,0 +1,4 @@ +== 0.0.1 2009-04-13 + +* 1 major enhancement: + * Initial release diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..6caaee2 --- /dev/null +++ b/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2009 Aaron Quint, Quirkey NYC, LLC. + +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. \ No newline at end of file diff --git a/Manifest.txt b/Manifest.txt new file mode 100644 index 0000000..9c7a37e --- /dev/null +++ b/Manifest.txt @@ -0,0 +1,10 @@ +History.txt +LICENSE +Manifest.txt +README.rdoc +Rakefile +lib/vegas.rb +lib/vegas/runner.rb +test/test_apps.rb +test/test_helper.rb +test/test_vegas_runner.rb \ No newline at end of file diff --git a/README.rdoc b/README.rdoc new file mode 100644 index 0000000..3824d44 --- /dev/null +++ b/README.rdoc @@ -0,0 +1,32 @@ += vegas + +http://code.quirkey.com/vegas + +== DESCRIPTION: + +Vegas aims to solve the simple problem of creating executable versions of Sinatra/Rack apps. + +== FEATURES/PROBLEMS: + +Currently, Vegas just includes a single class Vegas::Runner which wraps your Sinatra app to give it command line options, daemonization, PID/URL tracking, and browser launching (using Launchy). + +Lets say you have a gem with a sinatra application. With Vegas you can create a bin that looks like + + #!/usr/bin/env ruby + # ./bin/myapp + + require File.expand_path(File.dirname(__FILE__) + "/../lib/myapp") + require 'vegas' + + Vegas::Runner.new(Sinatra::Application, 'myapp') + + +See the website: http://code.quirkey.com/vegas for full usage/options. + +== INSTALL: + + sudo gem install vegas + +== LICENSE: + +MIT LICENSE, see /LICENSE for details \ No newline at end of file diff --git a/Rakefile b/Rakefile index a879ccb..1facfbd 100644 --- a/Rakefile +++ b/Rakefile @@ -1,4 +1,31 @@ -namespace :vegas do - - -end \ No newline at end of file +%w[rubygems rake rake/clean fileutils newgem rubigen].each { |f| require f } +require File.dirname(__FILE__) + '/lib/vegas' + +# Generate all the Rake tasks +# Run 'rake -T' to see list of generated tasks (from gem root directory) +$hoe = Hoe.new('vegas', Vegas::VERSION) do |p| + p.developer('Aaron Quint', 'aaron@quirkey.com') + p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n") + p.post_install_message = 'PostInstall.txt' # TODO remove if post-install message not required + p.rubyforge_name = 'quirkey' + p.extra_deps = [ + ['sinatra','>= 0.9.1'], + ['launchy','>= 0.3.3'] + ] + p.extra_dev_deps = [ + ['newgem', ">= #{::Newgem::VERSION}"], + ['nokogiri', ">= 1.0.6"], + ['bacon', ">= 1.1.0"] + ] + + p.clean_globs |= %w[**/.DS_Store tmp *.log] + path = (p.rubyforge_name == p.name) ? p.rubyforge_name : "\#{p.rubyforge_name}/\#{p.name}" + p.remote_rdoc_dir = File.join(path.gsub(/^#{p.rubyforge_name}\/?/,''), 'rdoc') + p.rsync_args = '-av --delete --ignore-errors' +end + +require 'newgem/tasks' # load /tasks/*.rake +Dir['tasks/**/*.rake'].each { |t| load t } + +# TODO - want other tests/tasks run by default? Add them to the list +# task :default => [:spec, :features] diff --git a/lib/vegas.rb b/lib/vegas.rb index 8c7bfb0..cf8b1f8 100644 --- a/lib/vegas.rb +++ b/lib/vegas.rb @@ -2,10 +2,10 @@ require 'sinatra' require 'launchy' -module Vegas - VERSION = "0.0.1" -end - $LOAD_PATH.unshift File.dirname(__FILE__) -require 'vegas/runner' \ No newline at end of file +module Vegas + VERSION = "0.0.1" + + autoload :Runner, 'vegas/runner' +end \ No newline at end of file diff --git a/script/console b/script/console new file mode 100755 index 0000000..983ad7a --- /dev/null +++ b/script/console @@ -0,0 +1,10 @@ +#!/usr/bin/env ruby +# File: script/console +irb = RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb' + +libs = " -r irb/completion" +# Perhaps use a console_lib to store any extra methods I may want available in the cosole +# libs << " -r #{File.dirname(__FILE__) + '/../lib/console_lib/console_logger.rb'}" +libs << " -r #{File.dirname(__FILE__) + '/../lib/vegas.rb'}" +puts "Loading vegas gem" +exec "#{irb} #{libs} --simple-prompt" \ No newline at end of file diff --git a/script/destroy b/script/destroy new file mode 100755 index 0000000..e48464d --- /dev/null +++ b/script/destroy @@ -0,0 +1,14 @@ +#!/usr/bin/env ruby +APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..')) + +begin + require 'rubigen' +rescue LoadError + require 'rubygems' + require 'rubigen' +end +require 'rubigen/scripts/destroy' + +ARGV.shift if ['--help', '-h'].include?(ARGV[0]) +RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit] +RubiGen::Scripts::Destroy.new.run(ARGV) diff --git a/script/generate b/script/generate new file mode 100755 index 0000000..c27f655 --- /dev/null +++ b/script/generate @@ -0,0 +1,14 @@ +#!/usr/bin/env ruby +APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..')) + +begin + require 'rubigen' +rescue LoadError + require 'rubygems' + require 'rubigen' +end +require 'rubigen/scripts/generate' + +ARGV.shift if ['--help', '-h'].include?(ARGV[0]) +RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit] +RubiGen::Scripts::Generate.new.run(ARGV) diff --git a/vegas.gemspec b/vegas.gemspec new file mode 100644 index 0000000..6ef814b --- /dev/null +++ b/vegas.gemspec @@ -0,0 +1,51 @@ +# -*- encoding: utf-8 -*- + +Gem::Specification.new do |s| + s.name = %q{vegas} + s.version = "0.0.1" + + s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= + s.authors = ["Aaron Quint"] + s.date = %q{2009-04-13} + s.description = %q{Vegas aims to solve the simple problem of creating executable versions of Sinatra/Rack apps.} + s.email = ["aaron@quirkey.com"] + s.extra_rdoc_files = ["History.txt", "Manifest.txt", "README.rdoc"] + s.files = ["History.txt", "LICENSE", "Manifest.txt", "README.rdoc", "Rakefile", "lib/vegas.rb", "lib/vegas/runner.rb", "test/test_apps.rb", "test/test_helper.rb", "test/test_vegas_runner.rb"] + s.has_rdoc = true + s.homepage = %q{http://code.quirkey.com/vegas} + s.post_install_message = %q{PostInstall.txt} + s.rdoc_options = ["--main", "README.rdoc"] + s.require_paths = ["lib"] + s.rubyforge_project = %q{quirkey} + s.rubygems_version = %q{1.3.1} + s.summary = %q{Vegas aims to solve the simple problem of creating executable versions of Sinatra/Rack apps.} + s.test_files = ["test/test_apps.rb", "test/test_helper.rb", "test/test_vegas_runner.rb"] + + if s.respond_to? :specification_version then + current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION + s.specification_version = 2 + + if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then + s.add_runtime_dependency(%q, [">= 0.9.1"]) + s.add_runtime_dependency(%q, [">= 0.3.3"]) + s.add_development_dependency(%q, [">= 1.2.3"]) + s.add_development_dependency(%q, [">= 1.0.6"]) + s.add_development_dependency(%q, [">= 1.1.0"]) + s.add_development_dependency(%q, [">= 1.8.0"]) + else + s.add_dependency(%q, [">= 0.9.1"]) + s.add_dependency(%q, [">= 0.3.3"]) + s.add_dependency(%q, [">= 1.2.3"]) + s.add_dependency(%q, [">= 1.0.6"]) + s.add_dependency(%q, [">= 1.1.0"]) + s.add_dependency(%q, [">= 1.8.0"]) + end + else + s.add_dependency(%q, [">= 0.9.1"]) + s.add_dependency(%q, [">= 0.3.3"]) + s.add_dependency(%q, [">= 1.2.3"]) + s.add_dependency(%q, [">= 1.0.6"]) + s.add_dependency(%q, [">= 1.1.0"]) + s.add_dependency(%q, [">= 1.8.0"]) + end +end