Sha256: 80ed181af7ee00b958c33140f3658ceb721dfbfe06d605715d246393b21099c5
Contents?: true
Size: 718 Bytes
Versions: 5
Compression:
Stored size: 718 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 task :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
5 entries across 5 versions & 2 rubygems