- Revision
- 819
- Author
- mward
- Date
- 2008-09-05 07:32:21 -0500 (Fri, 05 Sep 2008)
Log Message
updated loading ruby scripts from WEB-INF
Modified Paths
- trunk/waffle-ruby/pom.xml
- trunk/waffle-ruby/src/main/java/org/codehaus/waffle/context/pico/RubyScriptLoader.java
- trunk/waffle-ruby/src/main/ruby/org/codehaus/waffle/waffle.rb
Diff
Modified: trunk/waffle-ruby/pom.xml (818 => 819)
--- trunk/waffle-ruby/pom.xml 2008-09-05 07:04:07 UTC (rev 818) +++ trunk/waffle-ruby/pom.xml 2008-09-05 12:32:21 UTC (rev 819) @@ -74,7 +74,7 @@ <configuration> <jrubyHome>${project.build.directory}/jruby/META-INF/jruby.home</jrubyHome> <sourceDirectory>${basedir}/src/test/ruby/specs</sourceDirectory> - <outputDirectory>${basedir}/target</outputDirectory> + <outputDirectory>/${basedir}/target</outputDirectory> <reportName>rspec-report.html</reportName> <ignoreFailure>false</ignoreFailure> <skipTests>false</skipTests>
Modified: trunk/waffle-ruby/src/main/java/org/codehaus/waffle/context/pico/RubyScriptLoader.java (818 => 819)
--- trunk/waffle-ruby/src/main/java/org/codehaus/waffle/context/pico/RubyScriptLoader.java 2008-09-05 07:04:07 UTC (rev 818) +++ trunk/waffle-ruby/src/main/java/org/codehaus/waffle/context/pico/RubyScriptLoader.java 2008-09-05 12:32:21 UTC (rev 819) @@ -19,7 +19,7 @@ * @author Mauro Talevi */ public class RubyScriptLoader implements Startable { - public static final String DEFAULT_RUBY_SCRIPT_PATH = "/WEB-INF/classes/ruby/"; + public static final String DEFAULT_RUBY_SCRIPT_PATH = "/WEB-INF/classes/"; public static final String RUBY_SCRIPT_PATH_KEY = "org.codehaus.waffle.ruby.path"; public static final String RUBY_SCRIPT_ENV_KEY = "org.codehaus.waffle.ruby.env";
Modified: trunk/waffle-ruby/src/main/ruby/org/codehaus/waffle/waffle.rb (818 => 819)
--- trunk/waffle-ruby/src/main/ruby/org/codehaus/waffle/waffle.rb 2008-09-05 07:04:07 UTC (rev 818) +++ trunk/waffle-ruby/src/main/ruby/org/codehaus/waffle/waffle.rb 2008-09-05 12:32:21 UTC (rev 819) @@ -12,18 +12,25 @@ def ScriptLoader.load_all(prefix, servlet_context) @__servlet_context = servlet_context + @__reloadable = true if (prefix.gsub!(/^dir:/, '')) @__ruby_script_path = prefix ScriptLoader.load_from_file_system else servlet_context.getResourcePaths(prefix).each do |path| # this would be for production!! - require(path.gsub(%r{#{prefix}\/}, '')) + @__reloadable = false + if path =~ /.rb$/ + file_name = @__servlet_context.getRealPath('/') + path.gsub(%r{#{prefix}\/}, '') + require(file_name) + end end end end def ScriptLoader.load_from_file_system + return unless @__reloadable # do nothing if not reloadable + path = @__ruby_script_path Dir.new(path).each do |entry|
To unsubscribe from this list please visit:
