Sha256: ed74c74ead02dc3ed66047e8c5f5733ef7c9c73b83d313477037f5ac31a3f6bb

Contents?: true

Size: 1.03 KB

Versions: 1

Compression:

Stored size: 1.03 KB

Contents

$:.unshift(File.dirname(__FILE__) + '/../lib')

require 'scrooge'

Scrooge::Framework::Rails

namespace :scrooge do
  
  desc "Copies over the example scrooge.yml file to the host framework's configuration directory"
  task :setup do
    Scrooge::Base.setup!
  end  

  desc "List all available Scrooge scopes"
  task :list do
    any_scopes do
      Scrooge::Profile.framework.scopes.each do |scope|
        puts "- #{scope}"
      end
    end    
  end

  desc "Dumps Resources and Models for a given scope to a human friendly format.Assumes ENV['scope'] is set."
  task :inspect do
    any_scopes do
      begin
        Scrooge::Base.profile.scope_to_signature!( ENV['scope'] )
        puts Scrooge::Base.profile.tracker.inspect
      rescue Scrooge::Framework::Base::InvalidScopeSignature
        puts "Please set ENV['scope'] to the scope you'd like to inspect."
      end
    end      
  end

  def any_scopes
    if Scrooge::Profile.framework.scopes?
      yield
    else
      puts "There's no existing Scrooge scopes!"
    end      
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
methodmissing-scrooge-1.0.1 tasks/scrooge.rake