Sha256: 84da0effb8c7f9162c430c87d9f0dad100e6c303da7d5f550f623f63835991dc

Contents?: true

Size: 646 Bytes

Versions: 9

Compression:

Stored size: 646 Bytes

Contents

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

class Lono::Sequence < Thor::Group
  include Thor::Actions

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

private
  def git_installed?
    system("type git > /dev/null 2>&1")
  end

  def run_git?
    options[:git] && git_installed?
  end

  def run_git_init
    return unless run_git?
    puts "=> Initialize git repo"
    run("git init")
  end

  def run_git_commit
    return unless run_git?

    puts "=> Commit git repo"
    run("git add .")
    run("git commit -m 'first commit'")
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
lono-7.5.2 lib/lono/sequence.rb
lono-7.5.1 lib/lono/sequence.rb
lono-7.5.0 lib/lono/sequence.rb
lono-7.4.11 lib/lono/sequence.rb
lono-7.4.10 lib/lono/sequence.rb
lono-7.4.9 lib/lono/sequence.rb
lono-7.4.8 lib/lono/sequence.rb
lono-7.4.7 lib/lono/sequence.rb
lono-7.4.6 lib/lono/sequence.rb