Sha256: 3c967c59aeac80f9dda582c9a2b3128c951cafa0dfbc00886a9903ac461f72c9

Contents?: true

Size: 1022 Bytes

Versions: 6

Compression:

Stored size: 1022 Bytes

Contents

desc "Internal hem debugging tools"
hidden true
namespace 'self'  do

  desc "REPL"
  task :repl do
    require 'pry'
    Pry.config.prompt = if STDIN.tty?
      proc { 'hem > '}
    else
      proc { '' }
    end
    pry
  end

  desc "Tasks for debugging hem"
  namespace 'debug' do
    desc "Display project paths"
    project_only
    task "paths" do
      Hem.ui.info "<%=color('Project path:', :green)%> " + Hem.project_path
      {
        :gemfile => "*Gemfile",
        :vagrantfile => "*Vagrantfile",
        :cheffile => "*Cheffile",
        :berksfile => "*Berksfile",
        :'composer.json' => "composer.json"
      }.each do |k,v|
        path = nil
        locate v do |file, full_file|
          path = full_file
        end
        Hem.ui.info "<%=color('#{k.to_s}:', :green) %> #{path.nil? ? "none" : path}"
      end
    end

    desc "Locate"
    project_only
    task "locate", [ :arg ] do |task, args|
      locate args[:arg] do |file, full_file|
        puts full_file
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
hem-1.0.1.beta6 lib/hem/tasks/self.rb
hem-1.0.1.beta5 lib/hem/tasks/self.rb
hem-1.0.1.beta4 lib/hem/tasks/self.rb
hem-1.0.1.beta3 lib/hem/tasks/self.rb
hem-1.0.1.beta2 lib/hem/tasks/self.rb
hem-1.0.1.beta1 lib/hem/tasks/self.rb