/tools/Ruby/lib/ruby/gems/1.8/gems/rake-0.9.2/test/data/access/Rakefile
http://github.com/agross/netopenspace · Rakefile · 35 lines · 29 code · 5 blank · 1 comment · 0 complexity · e74222f186fa73070ed421deade4a84a MD5 · raw file
- 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