Sha256: 3c61e11949cbbfd632eb3166250d315b4ca6830393fea421b896b084bc29b779

Contents?: true

Size: 1.03 KB

Versions: 2

Compression:

Stored size: 1.03 KB

Contents

#!/usr/bin/env ruby
$:.unshift File.expand_path('../../lib', __FILE__)

require 'rubygems' unless Object.const_defined?(:Gem)
require 'rake'
require 'peony'

# Intercept: if invoked as 'peony --help', don't let it pass through Rake, or else
# we'll see the Rake help screen. Redirect it to 'peony help'.
if ARGV.delete('--help') || ARGV.delete('-h')
  ARGV << 'help'
end

if ARGV.delete('--version') || ARGV.delete('-V')
  puts "Peony, version v#{Peony::VERSION}"
  exit
end

if ARGV.delete('--simulate') || ARGV.delete('-S')
  ENV['simulate'] = '1'
end

if ARGV.delete('--dry-run') || ARGV.delete('-D')
  ENV['dry-run'] = '1'
end

Rake.application.instance_eval do
  standard_exception_handling do
    
    init 'peony'
    
    @rakefiles += %w{Peonyfile peonyfile}
    options.rakelib += %w{recipes/**}
    
    # Load the Peony DSL.
    require 'peony/rake'
    
    load_rakefile

    Dir.glob(File.expand_path('../recipes/**/*.rake', __dir__)).reverse.each do|fn|
      load fn
    end
    
    require 'peony/parse_arguments'
    top_level
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
peony-0.3.1 bin/peony
peony-0.3.0 bin/peony