Sha256: 8e04154f4861ea0fd8cdf9810d5bf53dc7530f8ae9cc4647ca991780c72b3526

Contents?: true

Size: 632 Bytes

Versions: 11

Compression:

Stored size: 632 Bytes

Contents

class RakeConsole
  GEM = Dir["*.gemspec"].first.sub('.gemspec', '')
  REQUIRE_PATH = File.join(Dir.pwd, 'lib', GEM)

  module Helpers
    def reload!
      puts "Reloading..."
      $LOADED_FEATURES.select do |feat|
        feat =~ /\/#{GEM}\//
      end.each { |file| load file }
      true
    end
  end

  def start
    require REQUIRE_PATH
    ARGV.clear
    Object.include(Helpers)

    begin
      require 'pry'
      TOPLEVEL_BINDING.pry
    rescue LoadError
      require 'irb'
      require 'irb/completion'
      IRB.start
    end
  end
end

desc "Start development console"
task :console do
  RakeConsole.new.start
end

Version data entries

11 entries across 11 versions & 4 rubygems

Version Path
detaso-oprah-0.3.1 tasks/console.rb
detaso-oprah-0.3.0 tasks/console.rb
oprah-0.3.0 tasks/console.rb
oprah-0.2.1 tasks/console.rb
oprah-0.2.0 tasks/console.rb
oprah-0.1.3 tasks/console.rb
pugs-1.0.0 tasks/console.rb
oprah-0.1.2 tasks/console.rb
oprah-0.1.1 tasks/console.rb
sheaf-0.1.1 tasks/console.rb
sheaf-0.1.0 tasks/console.rb