bin/ruby_app in RubyApp-0.0.91 vs bin/ruby_app in RubyApp-0.2.0

- old
+ new

@@ -15,13 +15,12 @@ <<-USAGE usage: ruby_app <command> <arguments> Available commands include: create application Create a basic application in the current folder named <arguments>. - create page DISABLED: Create a baisc page consisting of .rb, .html, .css. and .js files (not implemented) console Open an interactive console - run Run the application identified by the config.ru in <arguments> + run Run the application identified by the configuration.ru in <arguments> USAGE end def create_folder(destination, replacements = []) @@ -99,37 +98,18 @@ ] source = File.join(File.dirname(__FILE__), %w[.. lib ruby_app templates application]) copy_folder(source, full_folder, replacements) end -#def create_page -# argument = $*[2] -# folder = File.dirname(File.join(File.join(FileUtils.pwd, %w[elements arguments]), downcode(argument).split('/'))) -# namespace_class = "#{upcode(File.basename(FileUtils.pwd))}::Elements::Pages::#{upcode(argument)}" -# _class = namespace_class.split('::').last -# replacements = [ -# { -# :pattern => /_PAGE_DOWNCODE_/, -# :text => downcode(_class) -# }, -# { -# :pattern => /_PAGE_UPCODE_/, -# :text => _class -# } -# ] -# source = File.join(File.dirname(__FILE__), %w[.. lib ruby_app templates argument]) -# copy_folder(source, folder, replacements) -#end - def console argument = $*[1] system("irb --back-trace-limit 100 -r #{argument || ( File.exists?(File.join(FileUtils.pwd, %w[console.rb])) ? File.join(FileUtils.pwd, %w[console.rb]) : File.join(File.dirname(__FILE__), %w[console.rb]) )}") end def run argument = $*[1] - Rack::Server.start(:config => argument || File.join(FileUtils.pwd, %w[config.ru])) + Rack::Server.start(:config => argument || File.join(FileUtils.pwd, %w[configuration.ru])) end def downcode(value) value = value.gsub(/::/, '/') value = value.gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2') @@ -149,11 +129,9 @@ case $*[0].downcase when 'create' case $*[1].downcase when 'application' create_application - # when 'page' - # create_page else puts "Blank or unrecognized command '#{$*[1].downcase}'" puts usage end when 'console'