Sha256: e9c8d49af074a75e7b980ae3a702f83cfc80f5428ec92cf8fafa9b7ae1341fc7

Contents?: true

Size: 1.49 KB

Versions: 9

Compression:

Stored size: 1.49 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`
          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

9 entries across 9 versions & 1 rubygems

Version Path
caboodle-0.2.1 lib/caboodle/command.rb
caboodle-0.2.0 lib/caboodle/command.rb
caboodle-0.1.9 lib/caboodle/command.rb
caboodle-0.1.8 lib/caboodle/command.rb
caboodle-0.1.7 lib/caboodle/command.rb
caboodle-0.1.6 lib/caboodle/command.rb
caboodle-0.1.5 lib/caboodle/command.rb
caboodle-0.1.4 lib/caboodle/command.rb
caboodle-0.1.3 lib/caboodle/command.rb