Sha256: d2f87e690b3ca9e20da070e8efbb2df42e4700011b7cbe867d20670df3941b08

Contents?: true

Size: 1.17 KB

Versions: 1

Compression:

Stored size: 1.17 KB

Contents

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

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

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

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

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

scope = self

Rake.application.instance_eval do
  standard_exception_handling do
    # Initialize Rake and make it think it's Mina.
    init 'mina'
    @rakefiles = ['Minafile', 'config/deploy.rb']

    # Workaround: Rake 0.9+ doesn't record task descriptions unless it's needed.
    # Need it for 'mina help'
    if Rake::TaskManager.respond_to?(:record_task_metadata)
      Rake::TaskManager.record_task_metadata = true
    end

    # Load the Mina Rake DSL.
    require 'mina/rake'

    # Allow running without a Rakefile
    load_rakefile  if have_rakefile

    # Run tasks
    top_level

    scope.mina_cleanup! if top_level_tasks.any?
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mina-0.1.0 bin/mina