module Peacock::Engine::Engine

Public Instance Methods

check_and_return_hash(opt_hash) click to toggle source
# File lib/peacock/engine/engine.rb, line 13
def check_and_return_hash(opt_hash)
  raise PeacockError, '#{self.class} expects an instance of Peacock::CLIHash' unless opt_hash.class == CLIHash
  opt_hash
end
determine_git_ignore_path() click to toggle source
# File lib/peacock/engine/engine.rb, line 18
def determine_git_ignore_path
  if @hash.root_ignore?
    determine_root_dir
  else
    '.gitignore'
  end
end
determine_root_dir() click to toggle source
# File lib/peacock/engine/engine.rb, line 26
def determine_root_dir
  old_path = Dir.pwd
  while not Dir.exists? '.git'
    Dir.chdir '..'
  end

  path = Dir.pwd() + '/.gitignore'
  Dir.chdir(old_path)
  path
end
git_ignore_exists?(path) click to toggle source
# File lib/peacock/engine/engine.rb, line 37
def git_ignore_exists?(path)
  raise PeacockError, '#{self.class} expects .gitignore to exist at #{path}' unless File.exists?(path)
end