Switch Resin to use Thor and have one main executable file with subcommands
This commit is contained in:
parent
0a670c1cf4
commit
32b2c519ce
|
@ -0,0 +1,6 @@
|
|||
#!/usr/env/bin ruby
|
||||
|
||||
require 'rubygems'
|
||||
require 'resin/cli'
|
||||
|
||||
Resin::CLI.start
|
|
@ -1,6 +0,0 @@
|
|||
#!/usr/bin/env ruby
|
||||
|
||||
require 'rubygems'
|
||||
require 'resin/compiler'
|
||||
|
||||
Resin::Compiler.run
|
12
bin/runresin
12
bin/runresin
|
@ -1,12 +0,0 @@
|
|||
#!/usr/bin/env ruby
|
||||
|
||||
begin
|
||||
require 'resin/app'
|
||||
rescue LoadError => e
|
||||
require 'rubygems'
|
||||
path = File.expand_path '../../lib', __FILE__
|
||||
$:.unshift(path) if File.directory?(path) && !$:.include?(path)
|
||||
require 'resin/app'
|
||||
end
|
||||
|
||||
Resin::Server.run!
|
|
@ -0,0 +1,19 @@
|
|||
require 'thor'
|
||||
|
||||
module Resin
|
||||
class CLI < Thor
|
||||
desc 'start', 'Run the current Resin application'
|
||||
def start
|
||||
require 'sinatra/base'
|
||||
require 'sinatra/resin'
|
||||
Sinatra::Application.run!
|
||||
end
|
||||
|
||||
|
||||
desc 'compile', 'Compile all the Amber and JavaScripts together'
|
||||
def compile
|
||||
require 'resin/compiler'
|
||||
Resin::Compiler.run
|
||||
end
|
||||
end
|
||||
end
|
|
@ -11,7 +11,7 @@ spec = Gem::Specification.new do |s|
|
|||
s.files = Dir['bin/*'] + Dir['lib/**/*.rb'] + Dir['lib/**/*.haml'] + Dir['amber/css/*'] +
|
||||
Dir['amber/js/**/*'] + Dir['amber/st/**/*.st'] + Dir['amber/images/*'] + ['amber/bin/amberc', 'amber/bin/nodecompile.js']
|
||||
s.bindir = 'bin'
|
||||
s.executables = ['runresin', 'resin-compile']
|
||||
s.executables = ['resin']
|
||||
s.has_rdoc = true
|
||||
s.extra_rdoc_files = ["README.markdown"]
|
||||
|
||||
|
|
Loading…
Reference in New Issue