Buildr C0 Coverage Information - RCov

lib/buildr/java/deprecated.rb

Name Total Lines Lines of Code Total Coverage Code Coverage
lib/buildr/java/deprecated.rb 141 74
18.44%
20.27%

Key

Code reported as executed by Ruby looks like this...and this: this line is also marked as covered.Lines considered as run by rcov, but not reported by Ruby, look like this,and this: these lines were inferred by rcov (using simple heuristics).Finally, here's a line marked as not executed.

Coverage Details

1 # Licensed to the Apache Software Foundation (ASF) under one or more
2 # contributor license agreements.  See the NOTICE file distributed with this
3 # work for additional information regarding copyright ownership.  The ASF
4 # licenses this file to you under the Apache License, Version 2.0 (the
5 # "License"); you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 #    http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
13 # License for the specific language governing permissions and limitations under
14 # the License.
15 
16 
17 require 'buildr/core/project'
18 
19 
20 module Java
21 
22   # *Deprecated:* In earlier versions, Java.wrapper served as a wrapper around RJB/JRuby.
23   # From this version forward, we apply with JRuby style for importing Java classes:
24   #   Java.java.lang.String.new('hai!')
25   # You still need to call Java.load before using any Java code: it resolves, downloads
26   # and installs various dependencies that are required on the classpath before calling
27   # any Java code (e.g. Ant and its tasks).
28   class JavaWrapper
29 
30     include Singleton
31 
32     # *Deprecated:* Append to Java.classpath directly.
33     def classpath
34       Buildr.application.deprecated 'Append to Java.classpath instead.'
35       ::Java.classpath
36     end
37 
38     def classpath=(paths)
39       fail 'Deprecated: Append to Java.classpath, you cannot replace the classpath.'
40     end
41 
42     # *Deprecated:* No longer necessary.
43     def setup
44       Buildr.application.deprecated 'See documentation for new way to access Java code.'
45       yield self if block_given?
46     end
47 
48     # *Deprecated:* Use Java.load instead.
49     def load
50       Buildr.application.deprecated 'Use Java.load instead.'
51       ::Java.load
52     end
53 
54     alias :onload :setup
55 
56     # *Deprecated:* Use Java.pkg.pkg.ClassName to import a Java class.
57     def import(class_name)
58       Buildr.application.deprecated 'Use Java.pkg.pkg.ClassName to import a Java class.'
59       ::Java.instance_eval(class_name)
60     end
61   end
62 
63 
64   class << self
65 
66     # *Deprecated*: Use Java::Commands.java instead.
67     def java(*args, &block)
68       return send(:method_missing, :java) if args.empty?
69       Buildr.application.deprecated 'Use Java::Commands.java instead.'
70       Commands.java(*args, &block)
71     end
72 
73     # *Deprecated*: Use Java::Commands.apt instead.
74     def apt(*args)
75       Buildr.application.deprecated 'Use Java::Commands.apt instead.'
76       Commands.apt(*args)
77     end
78 
79     # *Deprecated*: Use Java::Commands.javac instead.
80     def javac(*args)
81       Buildr.application.deprecated 'Use Java::Commands.javac instead.'
82       Commands.javac(*args)
83     end
84 
85     # *Deprecated*: Use Java::Commands.javadoc instead.
86     def javadoc(*args)
87       Buildr.application.deprecated 'Use Java::Commands.javadoc instead.'
88       Commands.javadoc(*args)
89     end
90 
91     # *Deprecated:* Use ENV_JAVA['java.version'] instead.
92     def version
93       Buildr.application.deprecated 'Use ENV_JAVA[\'java.version\'] instead.'
94       Java.load
95       ENV_JAVA['java.version']
96     end
97 
98     # *Deprecated:* Use ENV['JAVA_HOME'] instead
99     def home
100       Buildr.application.deprecated 'Use ENV[\'JAVA_HOME\'] instead.'
101       ENV['JAVA_HOME']
102     end
103 
104     # *Deprecated:* In earlier versions, Java.wrapper served as a wrapper around RJB/JRuby.
105     # From this version forward, we apply with JRuby style for importing Java classes:
106     #   Java.java.lang.String.new('hai!')
107     # You still need to call Java.load before using any Java code: it resolves, downloads
108     # and installs various dependencies that are required on the classpath before calling
109     # any Java code (e.g. Ant and its tasks).
110     def wrapper
111       Buildr.application.deprecated 'See documentation for new way to access Java code.'
112       if block_given?
113         Java.load
114         yield JavaWrapper.instance
115       else
116         JavaWrapper.instance
117       end
118     end
119 
120     alias :rjb :wrapper
121 
122   end
123 
124 
125   class Options
126 
127     # *Deprecated:* Use ENV['JAVA_OPTS'] instead.
128     def java_args
129       Buildr.application.deprecated "Use ENV['JAVA_OPTS'] instead"
130       (ENV["JAVA_OPTS"] || ENV["JAVA_OPTIONS"]).to_s.split
131     end
132 
133     # *Deprecated:* Use ENV['JAVA_OPTS'] instead.
134     def java_args=(args)
135       Buildr.application.deprecated "Use ENV['JAVA_OPTS'] instead"
136       ENV['JAVA_OPTS'] = Array(args).join(' ')
137     end
138 
139   end
140 
141 end

Generated on 2011-07-06 23:35:37 -0700 with rcov 0.9.8