Sha256: c12dd05aff1522a6a044b3d886044980e6868b67b708284f71622d8a6e4af329

Contents?: true

Size: 797 Bytes

Versions: 47

Compression:

Stored size: 797 Bytes

Contents

TOP_LEVEL_CONSTANT = 0

def a_top_level_function
end

task :default => [:work, :obj, :const]

task :work do
  begin
    a_top_level_function
    puts "GOOD:M Top level methods can be called in tasks"
  rescue NameError => ex
    puts "BAD:M  Top level methods can not be called in tasks"
  end
end

# TODO: remove `disabled_' when DeprecatedObjectDSL removed
task :obj
task :disabled_obj do
  begin
    Object.new.instance_eval { task :xyzzy }
    puts "BAD:D  Rake DSL are polluting objects"
  rescue StandardError => ex
    puts "GOOD:D Rake DSL are not polluting objects"
  end
end

task :const do
  begin
    TOP_LEVEL_CONSTANT
    puts "GOOD:C Top level constants are available in tasks"
  rescue StandardError => ex
    puts "BAD:C  Top level constants are NOT available in tasks"
  end
end

Version data entries

47 entries across 34 versions & 5 rubygems

Version Path
dirty_history-0.7.3 dirty_history/ruby/1.9.1/gems/rake-0.9.2/test/data/access/Rakefile
dirty_history-0.7.2 dirty_history/ruby/1.9.1/gems/rake-0.9.2/test/data/access/Rakefile
dirty_history-0.7.1 dirty_history/ruby/1.9.1/gems/rake-0.9.2/test/data/access/Rakefile
dirty_history-0.7.0 dirty_history/ruby/1.9.1/gems/rake-0.9.2/test/data/access/Rakefile
dirty_history-0.6.7 dirty_history/ruby/1.9.1/gems/rake-0.9.2/test/data/access/Rakefile
dirty_history-0.6.6 dirty_history/ruby/1.9.1/gems/rake-0.9.2/test/data/access/Rakefile
dirty_history-0.6.5 dirty_history/ruby/1.9.1/gems/rake-0.9.2/test/data/access/Rakefile
dirty_history-0.6.4 dirty_history/ruby/1.9.1/gems/rake-0.9.2/test/data/access/Rakefile
dirty_history-0.6.3 dirty_history/ruby/1.9.1/gems/rake-0.9.2/test/data/access/Rakefile
dirty_history-0.6.2 dirty_history/ruby/1.9.1/gems/rake-0.9.2/test/data/access/Rakefile
dirty_history-0.6.1 dirty_history/ruby/1.9.1/gems/rake-0.9.2/test/data/access/Rakefile
dirty_history-0.6.0 dirty_history/ruby/1.9.1/gems/rake-0.9.2/test/data/access/Rakefile
dirty_history-0.5.4 dirty_history/ruby/1.9.1/gems/rake-0.9.2/test/data/access/Rakefile
dirty_history-0.5.3 dirty_history/ruby/1.9.1/gems/rake-0.9.2/test/data/access/Rakefile
dirty_history-0.5.2 dirty_history/ruby/1.9.1/gems/dirty_history-0.2.0/dirty_history/ruby/1.9.1/gems/rake-0.9.2/test/data/access/Rakefile
dirty_history-0.5.2 dirty_history/ruby/1.9.1/gems/rake-0.9.2/test/data/access/Rakefile
dirty_history-0.5.1 dirty_history/ruby/1.9.1/gems/rake-0.9.2/test/data/access/Rakefile
dirty_history-0.5.1 dirty_history/ruby/1.9.1/gems/dirty_history-0.2.0/dirty_history/ruby/1.9.1/gems/rake-0.9.2/test/data/access/Rakefile
dirty_history-0.5.0 dirty_history/ruby/1.9.1/gems/dirty_history-0.2.0/dirty_history/ruby/1.9.1/gems/rake-0.9.2/test/data/access/Rakefile
dirty_history-0.5.0 dirty_history/ruby/1.9.1/gems/rake-0.9.2/test/data/access/Rakefile