PageRenderTime 79ms CodeModel.GetById 69ms app.highlight 6ms RepoModel.GetById 2ms app.codeStats 0ms

/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
 1TOP_LEVEL_CONSTANT = 0
 2
 3def a_top_level_function
 4end
 5
 6task :default => [:work, :obj, :const]
 7
 8task :work do
 9  begin
10    a_top_level_function
11    puts "GOOD:M Top level methods can be called in tasks"
12  rescue NameError => ex
13    puts "BAD:M  Top level methods can not be called in tasks"
14  end
15end
16
17# TODO: remove `disabled_' when DeprecatedObjectDSL removed
18task :obj
19task :disabled_obj do
20  begin
21    Object.new.instance_eval { task :xyzzy }
22    puts "BAD:D  Rake DSL are polluting objects"
23  rescue StandardError => ex
24    puts "GOOD:D Rake DSL are not polluting objects"
25  end
26end
27
28task :const do
29  begin
30    TOP_LEVEL_CONSTANT
31    puts "GOOD:C Top level constants are available in tasks"
32  rescue StandardError => ex
33    puts "BAD:C  Top level constants are NOT available in tasks"
34  end
35end