Sha256: 93e8e7ed9bc7a778c32f295ae40240169c9276b45e85f8cb06b7efd714e4221e

Contents?: true

Size: 1.53 KB

Versions: 1

Compression:

Stored size: 1.53 KB

Contents

gem 'heroku'
require 'heroku'
require 'heroku/command'

module Caboodle
  module Command
    class << self
      def run(command, args, retries=0)
        case command
        when "create"
          puts `mkdir #{args.first}`
          puts `cd #{args.first} && cp -r #{File.expand_path(File.join(File.dirname(__FILE__), 'app'))}/* .`
          puts `cd #{args.first} && cp #{File.expand_path(File.join(File.dirname(__FILE__), 'app'))}/.gems .`
          puts `cd #{args.first} && git init`
          Caboodle::Kit.configure
          puts `cd #{args.first} && git add .`
          puts `cd #{args.first} && git commit -m"initial setup"`
          puts `cd #{args.first} && heroku create #{args.first}`
          puts `cd #{args.first} && git push heroku master`
          
        when /kit:add/
          Caboodle::Kit.load_kit args.first.capitalize
          puts "Dump config"
          Caboodle::Kit.dump_config
          puts "Pushing to Heroku"
          puts `git add .`
          puts `git commit -m"kit:add #{args}" -a`
          puts `git push heroku master`
          puts "Done!"
        when /kit:remove/
          Caboodle::Kit.unload_kit args.first.capitalize
          puts "Pushing to Heroku"
          puts `git add .`
          puts `git commit -m"kit:remove #{args}" -a`
          puts `git push heroku master`
          puts "Done!"
        when "deploy"
          puts `git commit -m"deploy" -a`
          puts `git push heroku master`
        else
          Heroku::Command.run(command,args,retries)
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
caboodle-0.2.2 lib/caboodle/command.rb