- Revision
- 139
- Author
- mward
- Date
- 2007-06-03 21:52:16 -0500 (Sun, 03 Jun 2007)
Log Message
waffle jruby apps can specify a relative path in their web.xml from where the application is running to where the ruby files are located, allowing for developers to code their ruby controllers/actions without restarting their applications
Modified Paths
- trunk/core/core.iml
- trunk/core/src/main/java/org/codehaus/waffle/bind/RubyDataBinder.java
- trunk/core/src/main/ruby/waffle.rb
- trunk/examples/freemarker-example/freemarker-example.iml
- trunk/examples/jruby-example/jruby-example.iml
- trunk/examples/jruby-example/src/main/webapp/WEB-INF/web.xml
- trunk/examples/paranamer-example/paranamer-example.iml
- trunk/examples/simple-example/simple-example.iml
- trunk/root.iml
- trunk/waffle.ipr
Diff
Modified: trunk/core/core.iml (138 => 139)
--- trunk/core/core.iml 2007-06-03 22:08:47 UTC (rev 138) +++ trunk/core/core.iml 2007-06-04 02:52:16 UTC (rev 139) @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<module version="4" relativePaths="false" type="JAVA_MODULE"> +<module relativePaths="false" type="JAVA_MODULE" version="4"> <component name="ModuleRootManager" /> <component name="NewModuleRootManager" inherit-compiler-output="false"> <output url="" />
Modified: trunk/core/src/main/java/org/codehaus/waffle/bind/RubyDataBinder.java (138 => 139)
--- trunk/core/src/main/java/org/codehaus/waffle/bind/RubyDataBinder.java 2007-06-03 22:08:47 UTC (rev 138) +++ trunk/core/src/main/java/org/codehaus/waffle/bind/RubyDataBinder.java 2007-06-04 02:52:16 UTC (rev 139) @@ -27,8 +27,6 @@ JavaEmbedUtils.invokeMethod(runtime, rubyObject, "__set_request", new IRubyObject[] {JavaEmbedUtils.javaToRuby(runtime, request)}, Object.class); JavaEmbedUtils.invokeMethod(runtime, rubyObject, "__set_session", new HttpSession[] {request.getSession(false)}, Object.class); - // inspect rubyObject instance variables ... resolve values from (params, req, session, application) ... and set them onto the instance - } else { // default to standard binding super.bind(request, response, errorsContext, controller);
Modified: trunk/core/src/main/ruby/waffle.rb (138 => 139)
--- trunk/core/src/main/ruby/waffle.rb 2007-06-03 22:08:47 UTC (rev 138) +++ trunk/core/src/main/ruby/waffle.rb 2007-06-04 02:52:16 UTC (rev 139) @@ -5,6 +5,7 @@ # load/require files class ScriptLoader def ScriptLoader.load_all(prefix, servlet_context) + @@__servlet_context = servlet_context if (prefix.gsub!(/^dir:/, '')) @@_ruby_script_path = prefix @@ -17,9 +18,14 @@ end def ScriptLoader.load_from_file_system - Dir.new(@@_ruby_script_path).each do |entry| - file = "#{@@_ruby_script_path}#{entry}" - load(file) if File.file?(file) # TODO need to ensure it is a *.rb file ... need to recursively search directories + path = @@__servlet_context.getRealPath('/') + path = "#{path}#{@@_ruby_script_path}" + + Dir.new(path).each do |entry| + file = "#{path}#{entry}" + if File.file?(file) # TODO need to recursively search directories + load(file) if file =~ /.rb$/ + end end end end
Modified: trunk/examples/freemarker-example/freemarker-example.iml (138 => 139)
--- trunk/examples/freemarker-example/freemarker-example.iml 2007-06-03 22:08:47 UTC (rev 138) +++ trunk/examples/freemarker-example/freemarker-example.iml 2007-06-04 02:52:16 UTC (rev 139) @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<module version="4" relativePaths="true" type="J2EE_WEB_MODULE"> +<module relativePaths="true" type="J2EE_WEB_MODULE" version="4"> <component name="AppServerSpecificValidatorsManager" /> <component name="ModuleRootManager" /> <component name="NewModuleRootManager" inherit-compiler-output="false"> @@ -62,7 +62,6 @@ <setting name="EXPLODED_ENABLED" value="true" /> <setting name="JAR_URL" value="file://" /> <setting name="JAR_ENABLED" value="false" /> - <setting name="SYNC_EXPLODED_DIR" value="false" /> <setting name="BUILD_MODULE_ON_FRAME_DEACTIVATION" value="false" /> <setting name="BUILD_EXTERNAL_DEPENDENCIES" value="false" /> <setting name="RUN_JASPER_VALIDATION" value="true" />
Modified: trunk/examples/jruby-example/jruby-example.iml (138 => 139)
--- trunk/examples/jruby-example/jruby-example.iml 2007-06-03 22:08:47 UTC (rev 138) +++ trunk/examples/jruby-example/jruby-example.iml 2007-06-04 02:52:16 UTC (rev 139) @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<module version="4" relativePaths="true" type="J2EE_WEB_MODULE"> +<module relativePaths="true" type="J2EE_WEB_MODULE" version="4"> <component name="AppServerSpecificValidatorsManager" /> <component name="ModuleRootManager" /> <component name="NewModuleRootManager" inherit-compiler-output="false"> @@ -69,7 +69,6 @@ <setting name="EXPLODED_ENABLED" value="true" /> <setting name="JAR_URL" value="file://" /> <setting name="JAR_ENABLED" value="false" /> - <setting name="SYNC_EXPLODED_DIR" value="false" /> <setting name="BUILD_MODULE_ON_FRAME_DEACTIVATION" value="false" /> <setting name="BUILD_EXTERNAL_DEPENDENCIES" value="false" /> <setting name="RUN_JASPER_VALIDATION" value="true" /> @@ -90,8 +89,8 @@ <url>jar://$M2_REPOSITORY$/asm/asm/3.0/asm-3.0.jar!/</url> </containerElement> <containerElement type="library" level="module"> - <attribute name="method" value="1" /> - <attribute name="URI" value="/WEB-INF/lib/paranamer-1.0-RC-3-SNAPSHOT.jar" /> + <attribute name="method" value="0" /> + <attribute name="URI" value="<N/A>" /> <url>jar://$M2_REPOSITORY$/com/thoughtworks/paranamer/paranamer/1.0-RC-3-SNAPSHOT/paranamer-1.0-RC-3-SNAPSHOT.jar!/</url> </containerElement> <containerElement type="library" level="module"> @@ -100,13 +99,13 @@ <url>jar://$M2_REPOSITORY$/com/thoughtworks/xstream/xstream/1.2.2/xstream-1.2.2.jar!/</url> </containerElement> <containerElement type="library" level="module"> - <attribute name="method" value="1" /> - <attribute name="URI" value="/WEB-INF/lib/jmock-1.2.0.jar" /> + <attribute name="method" value="0" /> + <attribute name="URI" value="<N/A>" /> <url>jar://$M2_REPOSITORY$/jmock/jmock/1.2.0/jmock-1.2.0.jar!/</url> </containerElement> <containerElement type="library" level="module"> - <attribute name="method" value="1" /> - <attribute name="URI" value="/WEB-INF/lib/junit-4.0.jar" /> + <attribute name="method" value="0" /> + <attribute name="URI" value="<N/A>" /> <url>jar://$M2_REPOSITORY$/junit/junit/4.0/junit-4.0.jar!/</url> </containerElement> <containerElement type="library" level="module"> @@ -115,27 +114,27 @@ <url>jar://$M2_REPOSITORY$/ognl/ognl/2.6.9/ognl-2.6.9.jar!/</url> </containerElement> <containerElement type="library" level="module"> - <attribute name="method" value="1" /> - <attribute name="URI" value="/WEB-INF/lib/hamcrest-api-1.0.jar" /> + <attribute name="method" value="0" /> + <attribute name="URI" value="<N/A>" /> <url>jar://$M2_REPOSITORY$/org/hamcrest/hamcrest-api/1.0/hamcrest-api-1.0.jar!/</url> </containerElement> <containerElement type="library" level="module"> - <attribute name="method" value="1" /> - <attribute name="URI" value="/WEB-INF/lib/hamcrest-library-1.0.jar" /> + <attribute name="method" value="0" /> + <attribute name="URI" value="<N/A>" /> <url>jar://$M2_REPOSITORY$/org/hamcrest/hamcrest-library/1.0/hamcrest-library-1.0.jar!/</url> </containerElement> <containerElement type="library" level="module"> - <attribute name="method" value="1" /> - <attribute name="URI" value="/WEB-INF/lib/jmock-junit4-2.0.0.jar" /> + <attribute name="method" value="0" /> + <attribute name="URI" value="<N/A>" /> <url>jar://$M2_REPOSITORY$/org/jmock/jmock-junit4/2.0.0/jmock-junit4-2.0.0.jar!/</url> </containerElement> <containerElement type="library" level="module"> - <attribute name="method" value="1" /> - <attribute name="URI" value="/WEB-INF/lib/jmock-2.0.0.jar" /> + <attribute name="method" value="0" /> + <attribute name="URI" value="<N/A>" /> <url>jar://$M2_REPOSITORY$/org/jmock/jmock/2.0.0/jmock-2.0.0.jar!/</url> </containerElement> <containerElement type="library" level="module"> - <attribute name="method" value="0" /> + <attribute name="method" value="1" /> <attribute name="URI" value="/WEB-INF/lib/jruby-complete-1.0RC3.jar" /> <url>jar://$M2_REPOSITORY$/org/jruby/jruby-complete/1.0RC3/jruby-complete-1.0RC3.jar!/</url> </containerElement>
Modified: trunk/examples/jruby-example/src/main/webapp/WEB-INF/web.xml (138 => 139)
--- trunk/examples/jruby-example/src/main/webapp/WEB-INF/web.xml 2007-06-03 22:08:47 UTC (rev 138) +++ trunk/examples/jruby-example/src/main/webapp/WEB-INF/web.xml 2007-06-04 02:52:16 UTC (rev 139) @@ -7,8 +7,6 @@ <display-name>Waffle JRuby Example</display-name> - - <!-- 1. This is how an application registers its custom Registrar --> <context-param> <param-name>org.codehaus.waffle.registrar.Registrar</param-name> @@ -31,7 +29,7 @@ <context-param> <param-name>org.codehaus.waffle.ruby.path</param-name> - <param-value>dir:/Users/mward/development/waffle/examples/jruby-example/src/main/ruby/ruby/</param-value><!-- this needs to be more forgiving --> + <param-value>dir:../src/main/ruby/ruby/</param-value><!-- this needs to be more forgiving --> </context-param> <listener>
Modified: trunk/examples/paranamer-example/paranamer-example.iml (138 => 139)
--- trunk/examples/paranamer-example/paranamer-example.iml 2007-06-03 22:08:47 UTC (rev 138) +++ trunk/examples/paranamer-example/paranamer-example.iml 2007-06-04 02:52:16 UTC (rev 139) @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<module version="4" relativePaths="true" type="J2EE_WEB_MODULE"> +<module relativePaths="true" type="J2EE_WEB_MODULE" version="4"> <component name="AppServerSpecificValidatorsManager" /> <component name="ModuleRootManager" /> <component name="NewModuleRootManager" inherit-compiler-output="false"> @@ -70,7 +70,6 @@ <setting name="EXPLODED_ENABLED" value="true" /> <setting name="JAR_URL" value="file://" /> <setting name="JAR_ENABLED" value="false" /> - <setting name="SYNC_EXPLODED_DIR" value="false" /> <setting name="BUILD_MODULE_ON_FRAME_DEACTIVATION" value="false" /> <setting name="BUILD_EXTERNAL_DEPENDENCIES" value="false" /> <setting name="RUN_JASPER_VALIDATION" value="true" />
Modified: trunk/examples/simple-example/simple-example.iml (138 => 139)
--- trunk/examples/simple-example/simple-example.iml 2007-06-03 22:08:47 UTC (rev 138) +++ trunk/examples/simple-example/simple-example.iml 2007-06-04 02:52:16 UTC (rev 139) @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<module version="4" relativePaths="true" type="J2EE_WEB_MODULE"> +<module relativePaths="true" type="J2EE_WEB_MODULE" version="4"> <component name="AppServerSpecificValidatorsManager" /> <component name="ModuleRootManager" /> <component name="NewModuleRootManager" inherit-compiler-output="false"> @@ -78,7 +78,6 @@ <setting name="EXPLODED_ENABLED" value="true" /> <setting name="JAR_URL" value="file://" /> <setting name="JAR_ENABLED" value="false" /> - <setting name="SYNC_EXPLODED_DIR" value="false" /> <setting name="BUILD_MODULE_ON_FRAME_DEACTIVATION" value="false" /> <setting name="BUILD_EXTERNAL_DEPENDENCIES" value="false" /> <setting name="RUN_JASPER_VALIDATION" value="false" />
Modified: trunk/root.iml (138 => 139)
--- trunk/root.iml 2007-06-03 22:08:47 UTC (rev 138) +++ trunk/root.iml 2007-06-04 02:52:16 UTC (rev 139) @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<module version="4" relativePaths="true" type="JAVA_MODULE"> +<module relativePaths="true" type="JAVA_MODULE" version="4"> <component name="ModuleRootManager" /> <component name="NewModuleRootManager" inherit-compiler-output="true"> <content url=""
Modified: trunk/waffle.ipr (138 => 139)
--- trunk/waffle.ipr 2007-06-03 22:08:47 UTC (rev 138) +++ trunk/waffle.ipr 2007-06-04 02:52:16 UTC (rev 139) @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<project version="4" relativePaths="false"> +<project relativePaths="false" version="4"> <component name="AntConfiguration"> <defaultAnt bundledAnt="true" /> </component> @@ -54,6 +54,15 @@ </option> <option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="99" /> <option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="99" /> + <ADDITIONAL_INDENT_OPTIONS fileType="js"> + <option name="INDENT_SIZE" value="4" /> + <option name="CONTINUATION_INDENT_SIZE" value="8" /> + <option name="TAB_SIZE" value="4" /> + <option name="USE_TAB_CHARACTER" value="false" /> + <option name="SMART_TABS" value="false" /> + <option name="LABEL_INDENT_SIZE" value="0" /> + <option name="LABEL_INDENT_ABSOLUTE" value="false" /> + </ADDITIONAL_INDENT_OPTIONS> </value> </option> <option name="USE_PER_PROJECT_SETTINGS" value="true" /> @@ -98,7 +107,7 @@ <option name="MAXIMUM_HEAP_SIZE" value="128" /> </component> <component name="EntryPointsManager"> - <entry_points /> + <entry_points version="2.0" /> </component> <component name="ExportToHTMLSettings"> <option name="PRINT_LINE_NUMBERS" value="false" /> @@ -349,11 +358,7 @@ </option> </component> <component name="libraryTable" /> - <component name="uidesigner-configuration"> - <option name="INSTRUMENT_CLASSES" value="true" /> - <option name="COPY_FORMS_RUNTIME_TO_OUTPUT" value="true" /> - <option name="DEFAULT_LAYOUT_MANAGER" value="GridLayoutManager" /> - </component> + <component name="uidesigner-configuration" /> <UsedPathMacros> <macro name="M2_REPOSITORY" /> </UsedPathMacros>
To unsubscribe from this list please visit:
