Sha256: ed796b67c157436cafb1038f5ae8e9f07ece5255bb95ad297b3772cddb663211

Contents?: true

Size: 1.39 KB

Versions: 6

Compression:

Stored size: 1.39 KB

Contents

$LOAD_PATH.unshift File.expand_path(File.join(File.dirname(__FILE__), %w[lib]))

require '_APPLICATION_DOWNCODE_'

namespace :_APPLICATION_DOWNCODE_ do

  namespace :process do

    desc 'Create console'
    task :console do |task|
      system('bundle exec pry -r ./console.rb')
    end

    namespace :server do

      desc 'Start the server'
      task :start, [:daemonize] => ['_APPLICATION_DOWNCODE_:cache:destroy'] do |task, arguments|
        daemonize = arguments.daemonize ? arguments.daemonize.to_b : true
        puts "Starting ..."
        system("mkdir -p ./process/thin/log ./process/thin/pid; bundle exec thin --rackup configuration.ru --port 8000 --log ./process/thin/log/thin.log --pid ./process/thin/pid/thin.pid #{daemonize ? '--daemonize' : nil} start")
      end

      desc 'Stop the server'
      task :stop do |task|
        puts "Stopping ..."
        system('for pid in ./process/thin/pid/*.pid; do bundle exec thin --pid $pid stop; done')
      end

      desc 'Restart the server'
      task :restart => ['_APPLICATION_DOWNCODE_:process:server:stop',
                        '_APPLICATION_DOWNCODE_:process:server:start']

    end

  end

  namespace :cache do

    desc 'List all cached files'
    task :list do
      system('find . | grep \'\\.cache\'')
    end

    desc 'Remove all cached files'
    task :destroy do
      system('find . -name \'.cache\' | xargs rm -rv')
    end

  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
RubyApp-0.7.16 lib/ruby_app/templates/application/Rakefile
RubyApp-0.7.15 lib/ruby_app/templates/application/Rakefile
RubyApp-0.7.14 lib/ruby_app/templates/application/Rakefile
RubyApp-0.7.13 lib/ruby_app/templates/application/Rakefile
RubyApp-0.7.12 lib/ruby_app/templates/application/Rakefile
RubyApp-0.7.11 lib/ruby_app/templates/application/Rakefile