Sha256: 745209735a156728faa985d1c955961016ab9f4978cc9e11fe5db8cd26e4ae61

Contents?: true

Size: 1.12 KB

Versions: 38

Compression:

Stored size: 1.12 KB

Contents

require 'fileutils'
require 'colorize'
require 'active_support/core_ext/string'
require 'thor'
require 'bundler'

class Jets::Commands::Sequence < Thor::Group
  include Thor::Actions

  def self.source_root
    File.expand_path("templates/skeleton", File.dirname(__FILE__))
  end

private
  def clone_project
    unless git_installed?
      abort "Unable to detect git installation on your system.  Git needs to be installed in order to use the --repo option."
    end

    if File.exist?(project_name)
      abort "The folder #{project_name} already exists."
    else
      run "git clone https://github.com/#{options[:repo]} #{project_name}"
    end
    confirm_jets_project
  end

  def confirm_jets_project
    jets_project = File.exist?("#{project_name}/config/application.rb")
    unless jets_project
      puts "It does not look like the repo #{options[:repo]} is a jets project. Maybe double check that it is?  Exited.".colorize(:red)
      exit 1
    end
  end

  def copy_project
    puts "Creating new project called #{project_name}."
    directory ".", project_name
  end

  def git_installed?
    system("type git > /dev/null")
  end
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
jets-0.8.18 lib/jets/commands/sequence.rb
jets-0.8.17 lib/jets/commands/sequence.rb
jets-0.8.15 lib/jets/commands/sequence.rb
jets-0.8.14 lib/jets/commands/sequence.rb
jets-0.8.13 lib/jets/commands/sequence.rb
jets-0.8.12 lib/jets/commands/sequence.rb
jets-0.8.11 lib/jets/commands/sequence.rb
jets-0.8.10 lib/jets/commands/sequence.rb
jets-0.8.9 lib/jets/commands/sequence.rb
jets-0.8.8 lib/jets/commands/sequence.rb
jets-0.8.6 lib/jets/commands/sequence.rb
jets-0.8.5 lib/jets/commands/sequence.rb
jets-0.8.4 lib/jets/commands/sequence.rb
jets-0.8.3 lib/jets/commands/sequence.rb
jets-0.8.2 lib/jets/commands/sequence.rb
jets-0.8.1 lib/jets/commands/sequence.rb
jets-0.8.0 lib/jets/commands/sequence.rb
jets-0.7.1 lib/jets/commands/sequence.rb
jets-0.7.0 lib/jets/commands/sequence.rb
jets-0.6.9 lib/jets/commands/sequence.rb