jax 1.1.1 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +4 -0
- data/.rvmrc +2 -3
- data/.travis.yml +8 -22
- data/README.md +2 -2
- data/Rakefile +128 -96
- data/app/assets/javascripts/jax/controller-list.js.coffee +22 -0
- data/app/assets/javascripts/jax/dom-helpers.js.coffee +17 -0
- data/app/assets/javascripts/jax/jasmine_runner.js +177 -0
- data/app/assets/javascripts/jax/runtime.js +6 -0
- data/app/assets/javascripts/jax/shader_editor.js.coffee +33 -0
- data/app/assets/stylesheets/jax/controller-list.css +5 -0
- data/app/assets/stylesheets/jax/jasmine.css +16 -0
- data/app/assets/stylesheets/jax/nav.css +41 -0
- data/app/assets/stylesheets/jax/runtime.css +47 -0
- data/app/assets/stylesheets/jax/shader_editor.css +3 -0
- data/app/assets/stylesheets/jax/suite.css +82 -0
- data/app/controllers/jax/suite_controller.rb +48 -0
- data/app/views/jax/suite/jasmine.html.erb +38 -0
- data/app/views/jax/suite/run_webgl.html.erb +49 -0
- data/app/views/jax/suite/shader_editor.html.erb +24 -0
- data/app/views/layouts/jax.html.erb +40 -0
- data/bin/jax +8 -4
- data/config/routes.rb +2 -0
- data/config.ru +5 -0
- data/features/rails/resources.feature +45 -0
- data/features/rails/shaders.feature +13 -0
- data/features/rails/specs.feature +24 -0
- data/features/runtime.feature +15 -0
- data/features/step_definitions/environment_steps.rb +15 -0
- data/features/step_definitions/response_steps.rb +13 -0
- data/features/step_definitions/runtime.rb +11 -0
- data/features/step_definitions/web_steps.rb +223 -0
- data/features/support/env.rb +75 -0
- data/features/support/paths.rb +30 -0
- data/features/support/rails_environment.rb +3 -0
- data/features/support/selectors.rb +39 -0
- data/features/support/setup.rb +17 -0
- data/jax.gemspec +22 -16
- data/lib/assets/javascripts/jax/anim_frame.js +64 -0
- data/lib/assets/javascripts/jax/application.js +16 -0
- data/lib/assets/javascripts/jax/builtin/all.js +21 -0
- data/lib/assets/javascripts/jax/builtin/meshes/cube.js +83 -0
- data/lib/assets/javascripts/jax/builtin/meshes/plane.js +67 -0
- data/lib/assets/javascripts/jax/builtin/meshes/quad.js +89 -0
- data/lib/assets/javascripts/jax/builtin/meshes/sphere.js +65 -0
- data/lib/assets/javascripts/jax/builtin/meshes/teapot.js +48 -0
- data/lib/assets/javascripts/jax/builtin/meshes/torus.js +64 -0
- data/lib/assets/javascripts/jax/compatibility.js +312 -0
- data/lib/assets/javascripts/jax/context.js +741 -0
- data/lib/assets/javascripts/jax/core/base.js +69 -0
- data/lib/assets/javascripts/jax/core/glMatrix_ext/mat3.js +20 -0
- data/lib/assets/javascripts/jax/core/glMatrix_ext/mat4.js +10 -0
- data/lib/assets/javascripts/jax/core/glMatrix_ext/quat4.js +148 -0
- data/lib/assets/javascripts/jax/core/glMatrix_ext/vec2.js +25 -0
- data/lib/assets/javascripts/jax/core/glMatrix_ext/vec3.js +86 -0
- data/lib/assets/javascripts/jax/core/glMatrix_ext/vec4.js +28 -0
- data/lib/assets/javascripts/jax/core/helper.js +44 -0
- data/lib/assets/javascripts/jax/core/math.js +61 -0
- data/lib/assets/javascripts/jax/core/matrix_stack.js +310 -0
- data/lib/assets/javascripts/jax/core/util.js +271 -0
- data/lib/assets/javascripts/jax/core.js +43 -0
- data/lib/assets/javascripts/jax/events.js +304 -0
- data/lib/assets/javascripts/jax/geometry/line.js +185 -0
- data/lib/assets/javascripts/jax/geometry/plane.js +371 -0
- data/lib/assets/javascripts/jax/geometry/triangle/inliner.rb +94 -0
- data/lib/assets/javascripts/jax/geometry/triangle/slow_tri_tri_intersect.js +20 -0
- data/lib/assets/javascripts/jax/geometry/triangle/tri_tri_intersect.js +281 -0
- data/lib/assets/javascripts/jax/geometry/triangle/tri_tri_intersect_optimized.js +564 -0
- data/lib/assets/javascripts/jax/geometry/triangle.js +311 -0
- data/lib/assets/javascripts/jax/geometry.js +14 -0
- data/lib/assets/javascripts/jax/mvc/controller.js +188 -0
- data/lib/assets/javascripts/jax/mvc/model.js +302 -0
- data/lib/assets/javascripts/jax/mvc/route_set.js +148 -0
- data/lib/assets/javascripts/jax/mvc/view.js +43 -0
- data/lib/assets/javascripts/jax/mvc/view_manager.js +65 -0
- data/lib/assets/javascripts/jax/noise.js +251 -0
- data/lib/assets/javascripts/jax/prototype/class.js +81 -0
- data/lib/assets/javascripts/jax/prototype/core.js +112 -0
- data/lib/assets/javascripts/jax/prototype/extensions.js +142 -0
- data/lib/assets/javascripts/jax/vendor/ejs.js +1 -0
- data/lib/assets/javascripts/jax/vendor/glMatrix.js +7 -0
- data/lib/assets/javascripts/jax/webgl/camera.js +697 -0
- data/lib/assets/javascripts/jax/webgl/cleanup.js +1 -0
- data/lib/assets/javascripts/jax/webgl/core/buffer.js +292 -0
- data/lib/assets/javascripts/jax/webgl/core/data_region.js +184 -0
- data/lib/assets/javascripts/jax/webgl/core/data_segment.js +255 -0
- data/lib/assets/javascripts/jax/webgl/core/events.js +99 -0
- data/lib/assets/javascripts/jax/webgl/core/framebuffer.js +316 -0
- data/lib/assets/javascripts/jax/webgl/core.js +6 -0
- data/lib/assets/javascripts/jax/webgl/material.js +381 -0
- data/lib/assets/javascripts/jax/webgl/mesh/normals.js +37 -0
- data/lib/assets/javascripts/jax/webgl/mesh/support.js +104 -0
- data/lib/assets/javascripts/jax/webgl/mesh/tangent_space.js +111 -0
- data/lib/assets/javascripts/jax/webgl/mesh.js +440 -0
- data/lib/assets/javascripts/jax/webgl/scene/frustum.js +422 -0
- data/lib/assets/javascripts/jax/webgl/scene/light_manager.js +141 -0
- data/lib/assets/javascripts/jax/webgl/scene/light_source.js +300 -0
- data/lib/assets/javascripts/jax/webgl/scene.js +16 -0
- data/lib/assets/javascripts/jax/webgl/shader/delegator/attribute.js +53 -0
- data/lib/assets/javascripts/jax/webgl/shader/delegator/uniform.js +71 -0
- data/lib/assets/javascripts/jax/webgl/shader/delegator.js +13 -0
- data/lib/assets/javascripts/jax/webgl/shader/manifest.js +70 -0
- data/lib/assets/javascripts/jax/webgl/shader/program.js +138 -0
- data/lib/assets/javascripts/jax/webgl/shader.js +299 -0
- data/lib/assets/javascripts/jax/webgl/shader_chain.js +267 -0
- data/lib/assets/javascripts/jax/webgl/texture.js +506 -0
- data/lib/assets/javascripts/jax/webgl/world.js +279 -0
- data/lib/assets/javascripts/jax/webgl.js +109 -0
- data/lib/assets/javascripts/jax.js +136 -0
- data/{builtin/app/shaders/basic/common.ejs → lib/assets/javascripts/shaders/basic/common.glsl} +0 -0
- data/{builtin/app/shaders/basic/fragment.ejs → lib/assets/javascripts/shaders/basic/fragment.glsl} +0 -0
- data/{builtin/app/shaders/basic/vertex.ejs → lib/assets/javascripts/shaders/basic/vertex.glsl} +1 -1
- data/{builtin/app/shaders/depthmap/common.ejs → lib/assets/javascripts/shaders/depthmap/common.glsl} +0 -0
- data/{builtin/app/shaders/depthmap/fragment.ejs → lib/assets/javascripts/shaders/depthmap/fragment.glsl} +1 -1
- data/{builtin/app → lib/assets/javascripts}/shaders/depthmap/material.js +0 -0
- data/{builtin/app/shaders/depthmap/vertex.ejs → lib/assets/javascripts/shaders/depthmap/vertex.glsl} +0 -0
- data/{builtin/app/shaders/fog/common.ejs → lib/assets/javascripts/shaders/fog/common.glsl} +0 -0
- data/{builtin/app/shaders/fog/fragment.ejs → lib/assets/javascripts/shaders/fog/fragment.glsl} +0 -0
- data/{builtin/app → lib/assets/javascripts}/shaders/fog/manifest.yml +0 -0
- data/{builtin/app → lib/assets/javascripts}/shaders/fog/material.js +6 -8
- data/{builtin/app/shaders/fog/vertex.ejs → lib/assets/javascripts/shaders/fog/vertex.glsl} +0 -0
- data/{builtin/app/shaders/functions/depth_map.ejs → lib/assets/javascripts/shaders/functions/depth_map.glsl} +0 -0
- data/{builtin/app/shaders/functions/lights.ejs → lib/assets/javascripts/shaders/functions/lights.glsl} +0 -0
- data/{builtin/app/shaders/functions/noise.ejs → lib/assets/javascripts/shaders/functions/noise.glsl} +0 -0
- data/lib/assets/javascripts/shaders/lighting/common.glsl +5 -0
- data/{builtin/app/shaders/lighting/fragment.ejs → lib/assets/javascripts/shaders/lighting/fragment.glsl} +0 -0
- data/{builtin/app → lib/assets/javascripts}/shaders/lighting/manifest.yml +0 -0
- data/{builtin/app → lib/assets/javascripts}/shaders/lighting/material.js +2 -4
- data/{builtin/app/shaders/lighting/vertex.ejs → lib/assets/javascripts/shaders/lighting/vertex.glsl} +0 -0
- data/{builtin/app/shaders/normal_map/common.ejs → lib/assets/javascripts/shaders/normal_map/common.glsl} +1 -1
- data/{builtin/app/shaders/normal_map/fragment.ejs → lib/assets/javascripts/shaders/normal_map/fragment.glsl} +0 -0
- data/{builtin/app → lib/assets/javascripts}/shaders/normal_map/manifest.yml +0 -0
- data/lib/assets/javascripts/shaders/normal_map/material.js +11 -0
- data/{builtin/app/shaders/normal_map/vertex.ejs → lib/assets/javascripts/shaders/normal_map/vertex.glsl} +0 -0
- data/{builtin/app/shaders/paraboloid/common.ejs → lib/assets/javascripts/shaders/paraboloid/common.glsl} +0 -0
- data/{builtin/app/shaders/paraboloid/fragment.ejs → lib/assets/javascripts/shaders/paraboloid/fragment.glsl} +0 -0
- data/{builtin/app → lib/assets/javascripts}/shaders/paraboloid/manifest.yml +0 -0
- data/{builtin/app → lib/assets/javascripts}/shaders/paraboloid/material.js +2 -4
- data/{builtin/app/shaders/paraboloid/vertex.ejs → lib/assets/javascripts/shaders/paraboloid/vertex.glsl} +0 -0
- data/{builtin/app/shaders/picking/common.ejs → lib/assets/javascripts/shaders/picking/common.glsl} +0 -0
- data/{builtin/app/shaders/picking/fragment.ejs → lib/assets/javascripts/shaders/picking/fragment.glsl} +0 -0
- data/{builtin/app → lib/assets/javascripts}/shaders/picking/material.js +2 -4
- data/{builtin/app/shaders/picking/vertex.ejs → lib/assets/javascripts/shaders/picking/vertex.glsl} +0 -0
- data/{builtin/app/shaders/shadow_map/common.ejs → lib/assets/javascripts/shaders/shadow_map/common.glsl} +2 -1
- data/{builtin/app/shaders/shadow_map/fragment.ejs → lib/assets/javascripts/shaders/shadow_map/fragment.glsl} +1 -1
- data/{builtin/app → lib/assets/javascripts}/shaders/shadow_map/manifest.yml +0 -0
- data/{builtin/app → lib/assets/javascripts}/shaders/shadow_map/material.js +4 -6
- data/{builtin/app/shaders/shadow_map/vertex.ejs → lib/assets/javascripts/shaders/shadow_map/vertex.glsl} +0 -0
- data/{builtin/app/shaders/texture/common.ejs → lib/assets/javascripts/shaders/texture/common.glsl} +0 -0
- data/{builtin/app/shaders/texture/fragment.ejs → lib/assets/javascripts/shaders/texture/fragment.glsl} +0 -0
- data/{builtin/app → lib/assets/javascripts}/shaders/texture/manifest.yml +0 -0
- data/lib/assets/javascripts/shaders/texture/material.js +17 -0
- data/{builtin/app/shaders/texture/vertex.ejs → lib/assets/javascripts/shaders/texture/vertex.glsl} +0 -0
- data/lib/generators/jax/all.rb +16 -0
- data/lib/generators/jax/application/application_generator.rb +48 -0
- data/lib/generators/jax/base/actions.rb +52 -0
- data/lib/generators/jax/base/coffee_generator.rb +30 -0
- data/lib/generators/jax/base/named_base.rb +17 -0
- data/lib/generators/jax/base/plugin_base.rb +108 -0
- data/lib/generators/jax/base/plugin_credentials.rb +99 -0
- data/lib/generators/jax/base/plugin_manifest.rb +75 -0
- data/lib/generators/jax/base/rails_base.rb +30 -0
- data/lib/generators/jax/base/source_root.rb +5 -0
- data/lib/generators/jax/controller/controller_generator.rb +37 -0
- data/lib/generators/jax/helper/helper_generator.rb +30 -0
- data/lib/generators/jax/install/install_generator.rb +27 -0
- data/lib/generators/jax/jax_generator.rb +13 -0
- data/lib/generators/jax/light/light_generator.rb +23 -0
- data/lib/{jax/generators → generators/jax}/material/USAGE +4 -8
- data/lib/generators/jax/material/material_generator.rb +112 -0
- data/lib/generators/jax/model/model_generator.rb +24 -0
- data/lib/generators/jax/plugin/plugin_generator.rb +72 -0
- data/lib/generators/jax/scaffold/scaffold_generator.rb +35 -0
- data/lib/generators/jax/shader/shader_generator.rb +38 -0
- data/lib/jax/commands/plugin_manager.rb +240 -0
- data/lib/jax/commands.rb +69 -0
- data/lib/jax/configuration.rb +64 -0
- data/lib/jax/directive_processor.rb +53 -0
- data/lib/jax/engine.rb +38 -54
- data/lib/jax/helper_methods.rb +3 -0
- data/lib/jax/rails/application.rb +34 -0
- data/lib/jax/resource_file.rb +29 -0
- data/lib/jax/script_loader.rb +68 -0
- data/lib/jax/server.rb +87 -0
- data/lib/jax/shader.rb +70 -172
- data/lib/jax/testing/rails_environment.rb +94 -0
- data/lib/jax/util/tar.rb +75 -0
- data/lib/jax/util.rb +3 -0
- data/lib/jax/version.rb +7 -8
- data/lib/jax.rb +23 -41
- data/spec/bin/jax_spec.rb +149 -0
- data/{lib/jax/generators/app/templates/app/models/.empty_directory → spec/fixtures/public/favicon.ico} +0 -0
- data/spec/fixtures/public/textures/brickwall.jpg +0 -0
- data/spec/fixtures/public/textures/jacks.jpg +0 -0
- data/spec/fixtures/public/textures/normal_map.jpg +0 -0
- data/spec/fixtures/public/textures/rock.png +0 -0
- data/spec/fixtures/public/textures/rock_normal.png +0 -0
- data/spec/fixtures/public/textures/rss.png +0 -0
- data/spec/generators/jax/application_generator_spec.rb +18 -0
- data/spec/generators/jax/controller_generator_spec.rb +102 -0
- data/spec/generators/jax/helper_generator_spec.rb +55 -0
- data/spec/generators/jax/install_generator_spec.rb +30 -0
- data/spec/generators/jax/jax_generator_spec.rb +21 -0
- data/spec/generators/jax/light_generator_spec.rb +27 -0
- data/spec/generators/jax/material_generator_spec.rb +62 -0
- data/spec/generators/jax/model_generator_spec.rb +72 -0
- data/spec/generators/jax/plugin_generator_spec.rb +143 -0
- data/spec/generators/jax/scaffold_generator_spec.rb +35 -0
- data/spec/generators/jax/shader_generator_spec.rb +37 -0
- data/spec/javascripts/helpers/jasmine_webgl_helper.js +13 -0
- data/{lib/jax/generators/app/templates/spec/javascripts/support/spec_helpers → spec/javascripts/helpers}/jax_spec_environment_helper.js +7 -2
- data/{lib/jax/generators/app/templates/spec/javascripts/support/spec_helpers → spec/javascripts/helpers}/jax_spec_helper.js +0 -0
- data/spec/javascripts/jax/builtin/meshes/cube_spec.js +10 -0
- data/spec/javascripts/jax/builtin/meshes/plane_spec.js +8 -0
- data/spec/javascripts/jax/builtin/meshes/quad_spec.js +8 -0
- data/spec/javascripts/jax/builtin/meshes/sphere_spec.js +8 -0
- data/spec/javascripts/jax/builtin/meshes/teapot_spec.js +8 -0
- data/spec/javascripts/jax/builtin/meshes/torus_spec.js +8 -0
- data/spec/javascripts/jax/compatibility_spec.js +46 -0
- data/spec/javascripts/jax/context_events_spec.js +212 -0
- data/spec/javascripts/jax/context_spec.js +305 -0
- data/spec/javascripts/jax/core/data_region_spec.js +118 -0
- data/spec/javascripts/jax/core/data_segment_spec.js +96 -0
- data/spec/javascripts/jax/core/delegation_spec.js +48 -0
- data/spec/javascripts/jax/core/events_spec.js +17 -0
- data/spec/javascripts/jax/core/glMatrix_extensions_spec.js +8 -0
- data/spec/javascripts/jax/core/helper_spec.js +61 -0
- data/spec/javascripts/jax/core/matrix_stack_spec.js +28 -0
- data/spec/javascripts/jax/core/utils_spec.js +275 -0
- data/spec/javascripts/jax/geometry/line_spec.js +20 -0
- data/spec/javascripts/jax/geometry/plane_spec.js +181 -0
- data/spec/javascripts/jax/geometry/triangle_spec.js +105 -0
- data/spec/javascripts/jax/mvc/controller_spec.js +156 -0
- data/spec/javascripts/jax/mvc/model_spec.js +93 -0
- data/spec/javascripts/jax/mvc/route_set_spec.js +49 -0
- data/spec/javascripts/jax/mvc/view_manager_spec.js +17 -0
- data/spec/javascripts/jax/noise_spec.js +50 -0
- data/spec/javascripts/jax/optimizations/material_limitations_spec.js +85 -0
- data/spec/javascripts/jax/optimizations/shaders/basic_spec.js +65 -0
- data/spec/javascripts/jax/prototype/extensions_spec.js +34 -0
- data/spec/javascripts/jax/webgl/camera_spec.js +237 -0
- data/spec/javascripts/jax/webgl/core/events_spec.js +47 -0
- data/spec/javascripts/jax/webgl/framebuffer_spec.js +44 -0
- data/spec/javascripts/jax/webgl/lighting_spec.js +108 -0
- data/spec/javascripts/jax/webgl/material_spec.js +117 -0
- data/spec/javascripts/jax/webgl/mesh_spec.js +228 -0
- data/spec/javascripts/jax/webgl/shader/manifest_spec.js +57 -0
- data/spec/javascripts/jax/webgl/shader_chain_spec.js +211 -0
- data/spec/javascripts/jax/webgl/shader_spec.js +276 -0
- data/spec/javascripts/jax/webgl/tangent_space_spec.js +142 -0
- data/spec/javascripts/jax/webgl/texture_spec.js +159 -0
- data/spec/javascripts/jax/webgl_spec.js +5 -0
- data/spec/javascripts/jax/world_spec.js +175 -0
- data/spec/javascripts/jax_spec.js +14 -0
- data/spec/javascripts/node/mocks/webgl.js +159 -0
- data/spec/javascripts/node_helper.js +51 -0
- data/spec/javascripts/shaders/core_materials_spec.js +38 -0
- data/spec/javascripts/shaders/fog_spec.js +15 -0
- data/spec/javascripts/shaders/lighting_spec.js +15 -0
- data/spec/javascripts/shaders/normal_map_spec.js +15 -0
- data/spec/javascripts/shaders/paraboloid_spec.js +33 -0
- data/spec/javascripts/shaders/preprocessor_spec.js +45 -0
- data/spec/javascripts/shaders/shadow_map_spec.js +15 -0
- data/spec/javascripts/shaders/texture_spec.js +37 -0
- data/spec/javascripts/suite/controller_select_spec.js.coffee +24 -0
- data/spec/lib/jax/commands/plugin_manager/credentials_spec.rb +56 -0
- data/spec/lib/jax/commands/plugin_manager/push_spec.rb +62 -0
- data/spec/lib/jax/commands/plugin_manager_spec.rb +204 -0
- data/spec/lib/jax/rails/application_spec.rb +23 -0
- data/spec/lib/jax/shader_spec.rb +67 -0
- data/spec/lib/jax/util/tar_spec.rb +26 -0
- data/spec/{test_helper.rb → spec_helper.rb} +37 -28
- data/spec/support/test_model_generator.rb +14 -0
- data/templates/app/Gemfile.tt +17 -0
- data/templates/app/Rakefile +4 -0
- data/templates/app/config/application.rb +16 -0
- data/{lib/jax/generators/app/templates → templates/app}/config/boot.rb +0 -0
- data/templates/app/config/environment.rb +5 -0
- data/templates/app/config/environments/production.rb +4 -0
- data/templates/app/config.ru +6 -0
- data/{lib/jax/generators/app/templates/app/resources → templates/app/public}/.empty_directory +0 -0
- data/templates/app/script/jax +8 -0
- data/{lib/jax/generators/app/templates/app/views → templates/app/spec}/.empty_directory +0 -0
- data/templates/application_controller.js.coffee.erb +3 -0
- data/templates/application_controller.js.erb +6 -0
- data/templates/application_helper.js.coffee.erb +3 -0
- data/templates/application_helper.js.erb +3 -0
- data/templates/controller.js.coffee.erb +9 -0
- data/templates/controller.js.erb +15 -0
- data/templates/controller_spec.js.coffee.erb +9 -0
- data/templates/controller_spec.js.erb +12 -0
- data/templates/helper.js.coffee.erb +2 -0
- data/templates/helper.js.erb +3 -0
- data/templates/helper_spec.js.coffee.erb +8 -0
- data/templates/helper_spec.js.erb +12 -0
- data/{lib/jax/generators/light_source/templates/light.yml.tt → templates/light_source.resource.erb} +3 -3
- data/{lib/jax/generators/material/templates/material.yml.tt → templates/material.resource.erb} +0 -9
- data/templates/model.js.coffee.erb +3 -0
- data/templates/model.js.erb +5 -0
- data/templates/model_defaults.resource.erb +5 -0
- data/templates/model_spec.js.coffee.erb +16 -0
- data/templates/model_spec.js.erb +18 -0
- data/{lib/jax/generators/plugin/templates/new_plugin/app → templates/new_plugin/app/assets/jax}/controllers/.empty_directory +0 -0
- data/{lib/jax/generators/plugin/templates/new_plugin/app → templates/new_plugin/app/assets/jax}/helpers/.empty_directory +0 -0
- data/{lib/jax/generators/plugin/templates/new_plugin/app → templates/new_plugin/app/assets/jax}/models/.empty_directory +0 -0
- data/{lib/jax/generators/plugin/templates/new_plugin/app → templates/new_plugin/app/assets/jax}/resources/.empty_directory +0 -0
- data/{lib/jax/generators/plugin/templates/new_plugin/app → templates/new_plugin/app/assets/jax}/views/.empty_directory +0 -0
- data/{lib/jax/generators/plugin/templates → templates}/new_plugin/init.rb +0 -0
- data/{lib/jax/generators/plugin/templates → templates}/new_plugin/install.rb +0 -0
- data/{lib/jax/generators/plugin/templates/new_plugin/public → templates/new_plugin/spec}/.empty_directory +0 -0
- data/{lib/jax/generators/plugin/templates → templates}/new_plugin/uninstall.rb +0 -0
- data/{lib/jax/generators/shader/templates/common.ejs.tt → templates/shader_common.glsl.erb} +0 -0
- data/{lib/jax/generators/shader/templates/fragment.ejs.tt → templates/shader_fragment.glsl.erb} +0 -0
- data/{lib/jax/generators/shader/templates/manifest.yml.tt → templates/shader_manifest.yml.erb} +0 -0
- data/templates/shader_material.js.coffee.erb +22 -0
- data/{lib/jax/generators/shader/templates/material.js.tt → templates/shader_material.js.erb} +0 -0
- data/templates/shader_spec.js.coffee.erb +16 -0
- data/{lib/jax/generators/shader/templates/spec.js.tt → templates/shader_spec.js.erb} +1 -1
- data/{lib/jax/generators/shader/templates/vertex.ejs.tt → templates/shader_vertex.glsl.erb} +0 -0
- data/templates/view.js.coffee.erb +3 -0
- data/{lib/jax/generators/controller/templates/view.js.tt → templates/view.js.erb} +1 -1
- data/vendor/assets/javascripts/ejs.js +505 -0
- data/vendor/assets/javascripts/glMatrix.js +1772 -0
- data/vendor/assets/javascripts/jasmine.js +2476 -0
- data/vendor/assets/stylesheets/jasmine.css +166 -0
- data/vendor/pdoc_template/html/assets/images/pdoc/alias.png +0 -0
- data/vendor/pdoc_template/html/assets/images/pdoc/class.png +0 -0
- data/vendor/pdoc_template/html/assets/images/pdoc/class_deprecated.png +0 -0
- data/vendor/pdoc_template/html/assets/images/pdoc/class_method.png +0 -0
- data/vendor/pdoc_template/html/assets/images/pdoc/class_property.png +0 -0
- data/vendor/pdoc_template/html/assets/images/pdoc/constant.png +0 -0
- data/vendor/pdoc_template/html/assets/images/pdoc/constructor.png +0 -0
- data/vendor/pdoc_template/html/assets/images/pdoc/deprecated.png +0 -0
- data/vendor/pdoc_template/html/assets/images/pdoc/description.png +0 -0
- data/vendor/pdoc_template/html/assets/images/pdoc/information.png +0 -0
- data/vendor/pdoc_template/html/assets/images/pdoc/instance_method.png +0 -0
- data/vendor/pdoc_template/html/assets/images/pdoc/instance_property.png +0 -0
- data/vendor/pdoc_template/html/assets/images/pdoc/method.png +0 -0
- data/vendor/pdoc_template/html/assets/images/pdoc/method_deprecated.png +0 -0
- data/vendor/pdoc_template/html/assets/images/pdoc/mixin.png +0 -0
- data/vendor/pdoc_template/html/assets/images/pdoc/namespace.png +0 -0
- data/vendor/pdoc_template/html/assets/images/pdoc/property.png +0 -0
- data/vendor/pdoc_template/html/assets/images/pdoc/related_to.png +0 -0
- data/vendor/pdoc_template/html/assets/images/pdoc/search-background.png +0 -0
- data/vendor/pdoc_template/html/assets/images/pdoc/section-background.png +0 -0
- data/vendor/pdoc_template/html/assets/images/pdoc/section.png +0 -0
- data/vendor/pdoc_template/html/assets/images/pdoc/selected-section-background.png +0 -0
- data/vendor/pdoc_template/html/assets/images/pdoc/subclass.png +0 -0
- data/vendor/pdoc_template/html/assets/images/pdoc/superclass.png +0 -0
- data/vendor/pdoc_template/html/assets/images/pdoc/utility.png +0 -0
- data/vendor/pdoc_template/html/assets/javascripts/pdoc/application.js +478 -0
- data/vendor/pdoc_template/html/assets/javascripts/pdoc/prototype.js +4874 -0
- data/vendor/pdoc_template/html/assets/javascripts/pdoc/tabs.js +506 -0
- data/vendor/pdoc_template/html/assets/stylesheets/jax.css +30 -0
- data/vendor/pdoc_template/html/assets/stylesheets/pdoc/api.css +681 -0
- data/vendor/pdoc_template/html/assets/stylesheets/pdoc/pygments.css +62 -0
- data/vendor/pdoc_template/html/helpers.rb +35 -0
- data/vendor/pdoc_template/html/index.erb +18 -0
- data/vendor/pdoc_template/html/item_index.js.erb +6 -0
- data/vendor/pdoc_template/html/layout.erb +67 -0
- data/vendor/pdoc_template/html/leaf.erb +22 -0
- data/vendor/pdoc_template/html/node.erb +30 -0
- data/vendor/pdoc_template/html/partials/class_relationships.erb +19 -0
- data/vendor/pdoc_template/html/partials/classes.erb +7 -0
- data/vendor/pdoc_template/html/partials/constructor.erb +5 -0
- data/vendor/pdoc_template/html/partials/description.erb +5 -0
- data/vendor/pdoc_template/html/partials/link_list.erb +1 -0
- data/vendor/pdoc_template/html/partials/method_signatures.erb +14 -0
- data/vendor/pdoc_template/html/partials/methodized_note.erb +9 -0
- data/vendor/pdoc_template/html/partials/mixins.erb +7 -0
- data/vendor/pdoc_template/html/partials/namespaces.erb +7 -0
- data/vendor/pdoc_template/html/partials/related_utilities.erb +5 -0
- data/vendor/pdoc_template/html/partials/relationships.erb +11 -0
- data/vendor/pdoc_template/html/partials/short_description_list.erb +7 -0
- data/vendor/pdoc_template/html/partials/title.erb +24 -0
- data/vendor/pdoc_template/html/section.erb +18 -0
- metadata +635 -332
- data/builtin/app/shaders/lighting/common.ejs +0 -5
- data/builtin/app/shaders/normal_map/material.js +0 -16
- data/builtin/app/shaders/texture/material.js +0 -18
- data/jax.gems +0 -1
- data/lib/jax/application/builtin/configurable.rb +0 -5
- data/lib/jax/application/builtin/configuration.rb +0 -5
- data/lib/jax/application/builtin.rb +0 -12
- data/lib/jax/application/configurable.rb +0 -19
- data/lib/jax/application/configuration.rb +0 -60
- data/lib/jax/application/railties.rb +0 -26
- data/lib/jax/application.rb +0 -149
- data/lib/jax/core_ext/kernel.rb +0 -7
- data/lib/jax/engine/configurable.rb +0 -19
- data/lib/jax/engine/configuration.rb +0 -49
- data/lib/jax/generators/app/app_generator.rb +0 -96
- data/lib/jax/generators/app/templates/Gemfile.tt +0 -3
- data/lib/jax/generators/app/templates/Rakefile +0 -6
- data/lib/jax/generators/app/templates/app/controllers/application_controller.js.tt +0 -5
- data/lib/jax/generators/app/templates/app/helpers/application_helper.js.tt +0 -3
- data/lib/jax/generators/app/templates/config/application.rb.tt +0 -6
- data/lib/jax/generators/app/templates/config/environment.rb.tt +0 -5
- data/lib/jax/generators/app/templates/config/routes.rb.tt +0 -5
- data/lib/jax/generators/app/templates/public/index.html.tt +0 -26
- data/lib/jax/generators/app/templates/public/javascripts/jax.js +0 -9462
- data/lib/jax/generators/app/templates/public/stylesheets/%file_name%.css.tt +0 -11
- data/lib/jax/generators/app/templates/public/webgl_not_supported.html +0 -26
- data/lib/jax/generators/app/templates/script/jax +0 -7
- data/lib/jax/generators/app/templates/spec/javascripts/controllers/application_controller_spec.js +0 -11
- data/lib/jax/generators/app/templates/spec/javascripts/helpers/application_helper_spec.js +0 -12
- data/lib/jax/generators/app/templates/spec/javascripts/support/jasmine.yml +0 -91
- data/lib/jax/generators/app/templates/spec/javascripts/support/jasmine_config.rb +0 -23
- data/lib/jax/generators/app/templates/spec/javascripts/support/jasmine_runner.rb +0 -32
- data/lib/jax/generators/app/templates/spec/javascripts/support/spec_layout.html.erb +0 -104
- data/lib/jax/generators/app.rb +0 -18
- data/lib/jax/generators/commands.rb +0 -220
- data/lib/jax/generators/controller/USAGE +0 -9
- data/lib/jax/generators/controller/controller_generator.rb +0 -66
- data/lib/jax/generators/controller/templates/controller_source.js.tt +0 -16
- data/lib/jax/generators/controller/templates/controller_test.js.tt +0 -11
- data/lib/jax/generators/controller/templates/helper.js.tt +0 -3
- data/lib/jax/generators/controller/templates/helper_test.js.tt +0 -12
- data/lib/jax/generators/interactions.rb +0 -56
- data/lib/jax/generators/light_source/USAGE +0 -14
- data/lib/jax/generators/light_source/light_source_generator.rb +0 -46
- data/lib/jax/generators/material/material_generator.rb +0 -80
- data/lib/jax/generators/material/templates/append.yml.tt +0 -7
- data/lib/jax/generators/model/USAGE +0 -5
- data/lib/jax/generators/model/model_generator.rb +0 -40
- data/lib/jax/generators/model/templates/model.js.tt +0 -11
- data/lib/jax/generators/model/templates/test.js.tt +0 -11
- data/lib/jax/generators/packager/package_generator.rb +0 -32
- data/lib/jax/generators/plugin/USAGE +0 -4
- data/lib/jax/generators/plugin/all.rb +0 -113
- data/lib/jax/generators/plugin/credentials.rb +0 -108
- data/lib/jax/generators/plugin/plugin_generator.rb +0 -72
- data/lib/jax/generators/plugin/plugin_manager.rb +0 -254
- data/lib/jax/generators/plugin/templates/new_plugin/config/routes.rb +0 -3
- data/lib/jax/generators/plugin/templates/new_plugin/spec/.empty_directory +0 -0
- data/lib/jax/generators/script_jax_loader.rb +0 -49
- data/lib/jax/generators/shader/USAGE +0 -4
- data/lib/jax/generators/shader/shader_generator.rb +0 -70
- data/lib/jax/monkeypatch/jasmine/config.rb +0 -45
- data/lib/jax/monkeypatch/jasmine/server.rb +0 -50
- data/lib/jax/monkeypatch/jasmine.rb +0 -3
- data/lib/jax/packager/sprockets_template.rb +0 -77
- data/lib/jax/packager.rb +0 -59
- data/lib/jax/plugin/manifest.rb +0 -71
- data/lib/jax/plugin.rb +0 -49
- data/lib/jax/resource_compiler.rb +0 -60
- data/lib/jax/routes.rb +0 -62
- data/lib/jax/tasks/rake.rb +0 -38
- data/spec/benchmark.htm +0 -93
- data/spec/generators/app_generator_test.rb +0 -42
- data/spec/generators/controller_generator_test.rb +0 -47
- data/spec/generators/light_generator_test.rb +0 -37
- data/spec/generators/material_generator_test.rb +0 -22
- data/spec/generators/model_generator_test.rb +0 -26
- data/spec/generators/plugin_generator_test.rb +0 -114
- data/spec/generators/plugin_manager/push_test.rb +0 -59
- data/spec/generators/plugin_manager_test.rb +0 -192
- data/spec/generators/shader_generator_test.rb +0 -38
- data/spec/javascripts/support/jasmine.yml +0 -85
- data/spec/javascripts/support/jasmine_runner.rb +0 -32
- data/spec/lib/jax/application_test.rb +0 -18
- data/spec/lib/jax/generators/plugin/credentials_test.rb +0 -72
- data/spec/lib/jax/packager_test.rb +0 -87
- data/spec/lib/jax/plugin_test.rb +0 -27
- data/spec/lib/jax/reloading_test.rb +0 -23
- data/spec/lib/jax/routes_test.rb +0 -28
- data/spec/lib/jax/shader_test.rb +0 -29
- data/spec/lib/jax/tasks/jax_rake_test.rb +0 -85
- data/spec/support/bases/generator_test_case.rb +0 -108
- data/spec/support/bases/isolated_test_case.rb +0 -148
- data/spec/support/file_exist_matcher.rb +0 -23
- data/spec/support/spec_shell.rb +0 -110
- data/spec/test_app.rb +0 -3
@@ -0,0 +1,223 @@
|
|
1
|
+
# TL;DR: YOU SHOULD DELETE THIS FILE
|
2
|
+
#
|
3
|
+
# This file was generated by Cucumber-Rails and is only here to get you a head start
|
4
|
+
# These step definitions are thin wrappers around the Capybara/Webrat API that lets you
|
5
|
+
# visit pages, interact with widgets and make assertions about page content.
|
6
|
+
#
|
7
|
+
# If you use these step definitions as basis for your features you will quickly end up
|
8
|
+
# with features that are:
|
9
|
+
#
|
10
|
+
# * Hard to maintain
|
11
|
+
# * Verbose to read
|
12
|
+
#
|
13
|
+
# A much better approach is to write your own higher level step definitions, following
|
14
|
+
# the advice in the following blog posts:
|
15
|
+
#
|
16
|
+
# * http://benmabey.com/2008/05/19/imperative-vs-declarative-scenarios-in-user-stories.html
|
17
|
+
# * http://dannorth.net/2011/01/31/whose-domain-is-it-anyway/
|
18
|
+
# * http://elabs.se/blog/15-you-re-cuking-it-wrong
|
19
|
+
#
|
20
|
+
|
21
|
+
|
22
|
+
require 'uri'
|
23
|
+
require 'cgi'
|
24
|
+
require File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "paths"))
|
25
|
+
require File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "selectors"))
|
26
|
+
|
27
|
+
module WithinHelpers
|
28
|
+
def with_scope(locator)
|
29
|
+
locator ? within(*selector_for(locator)) { yield } : yield
|
30
|
+
end
|
31
|
+
end
|
32
|
+
World(WithinHelpers)
|
33
|
+
|
34
|
+
# Single-line step scoper
|
35
|
+
When /^(.*) within (.*[^:])$/ do |step, parent|
|
36
|
+
with_scope(parent) { When step }
|
37
|
+
end
|
38
|
+
|
39
|
+
# Multi-line step scoper
|
40
|
+
When /^(.*) within (.*[^:]):$/ do |step, parent, table_or_string|
|
41
|
+
with_scope(parent) { When "#{step}:", table_or_string }
|
42
|
+
end
|
43
|
+
|
44
|
+
Given /^(?:|I )am on (.+)$/ do |page_name|
|
45
|
+
visit path_to(page_name)
|
46
|
+
end
|
47
|
+
|
48
|
+
When /^(?:|I )go to (.+)$/ do |page_name|
|
49
|
+
visit path_to(page_name)
|
50
|
+
end
|
51
|
+
|
52
|
+
When /^(?:|I )press "([^"]*)"$/ do |button|
|
53
|
+
click_button(button)
|
54
|
+
end
|
55
|
+
|
56
|
+
When /^(?:|I )follow "([^"]*)"$/ do |link|
|
57
|
+
click_link(link)
|
58
|
+
end
|
59
|
+
|
60
|
+
When /^(?:|I )fill in "([^"]*)" with "([^"]*)"$/ do |field, value|
|
61
|
+
fill_in(field, :with => value)
|
62
|
+
end
|
63
|
+
|
64
|
+
When /^(?:|I )fill in "([^"]*)" for "([^"]*)"$/ do |value, field|
|
65
|
+
fill_in(field, :with => value)
|
66
|
+
end
|
67
|
+
|
68
|
+
# Use this to fill in an entire form with data from a table. Example:
|
69
|
+
#
|
70
|
+
# When I fill in the following:
|
71
|
+
# | Account Number | 5002 |
|
72
|
+
# | Expiry date | 2009-11-01 |
|
73
|
+
# | Note | Nice guy |
|
74
|
+
# | Wants Email? | |
|
75
|
+
#
|
76
|
+
# TODO: Add support for checkbox, select og option
|
77
|
+
# based on naming conventions.
|
78
|
+
#
|
79
|
+
When /^(?:|I )fill in the following:$/ do |fields|
|
80
|
+
fields.rows_hash.each do |name, value|
|
81
|
+
When %{I fill in "#{name}" with "#{value}"}
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
When /^(?:|I )select "([^"]*)" from "([^"]*)"$/ do |value, field|
|
86
|
+
select(value, :from => field)
|
87
|
+
end
|
88
|
+
|
89
|
+
When /^(?:|I )check "([^"]*)"$/ do |field|
|
90
|
+
check(field)
|
91
|
+
end
|
92
|
+
|
93
|
+
When /^(?:|I )uncheck "([^"]*)"$/ do |field|
|
94
|
+
uncheck(field)
|
95
|
+
end
|
96
|
+
|
97
|
+
When /^(?:|I )choose "([^"]*)"$/ do |field|
|
98
|
+
choose(field)
|
99
|
+
end
|
100
|
+
|
101
|
+
When /^(?:|I )attach the file "([^"]*)" to "([^"]*)"$/ do |path, field|
|
102
|
+
attach_file(field, File.expand_path(path))
|
103
|
+
end
|
104
|
+
|
105
|
+
Then /^(?:|I )should see "([^"]*)"$/ do |text|
|
106
|
+
if page.respond_to? :should
|
107
|
+
page.should have_content(text)
|
108
|
+
else
|
109
|
+
assert page.has_content?(text)
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
Then /^(?:|I )should see \/([^\/]*)\/$/ do |regexp|
|
114
|
+
regexp = Regexp.new(regexp)
|
115
|
+
|
116
|
+
if page.respond_to? :should
|
117
|
+
page.should have_xpath('//*', :text => regexp)
|
118
|
+
else
|
119
|
+
assert page.has_xpath?('//*', :text => regexp)
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
Then /^(?:|I )should not see "([^"]*)"$/ do |text|
|
124
|
+
if page.respond_to? :should
|
125
|
+
page.should have_no_content(text)
|
126
|
+
else
|
127
|
+
assert page.has_no_content?(text)
|
128
|
+
end
|
129
|
+
end
|
130
|
+
|
131
|
+
Then /^(?:|I )should not see \/([^\/]*)\/$/ do |regexp|
|
132
|
+
regexp = Regexp.new(regexp)
|
133
|
+
|
134
|
+
if page.respond_to? :should
|
135
|
+
page.should have_no_xpath('//*', :text => regexp)
|
136
|
+
else
|
137
|
+
assert page.has_no_xpath?('//*', :text => regexp)
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
141
|
+
Then /^(?:|I )should see an? "([^"]*)" element$/ do |element_name|
|
142
|
+
page.should have_xpath("//#{element_name}")
|
143
|
+
end
|
144
|
+
|
145
|
+
Then /^(?:|I )should see an? "([^"]*)" element with attribute "([^"]*)" equal to "([^"]*)"$/ do |element_name, attribute_name, attribute_value|
|
146
|
+
page.should have_xpath("//#{element_name}[@#{attribute_name}='#{attribute_value}']")
|
147
|
+
end
|
148
|
+
|
149
|
+
Then /^(?:|I )should see an? "([^"]*)" element with attribute "([^"]*)" starting with "([^"]*)"$/ do |element_name, attribute_name, attribute_value|
|
150
|
+
page.should have_xpath("//#{element_name}[starts-with(@#{attribute_name},'#{attribute_value}')]")
|
151
|
+
end
|
152
|
+
|
153
|
+
Then /^the "([^"]*)" field(?: within (.*))? should contain "([^"]*)"$/ do |field, parent, value|
|
154
|
+
with_scope(parent) do
|
155
|
+
field = find_field(field)
|
156
|
+
field_value = (field.tag_name == 'textarea') ? field.text : field.value
|
157
|
+
if field_value.respond_to? :should
|
158
|
+
field_value.should =~ /#{value}/
|
159
|
+
else
|
160
|
+
assert_match(/#{value}/, field_value)
|
161
|
+
end
|
162
|
+
end
|
163
|
+
end
|
164
|
+
|
165
|
+
Then /^the "([^"]*)" field(?: within (.*))? should not contain "([^"]*)"$/ do |field, parent, value|
|
166
|
+
with_scope(parent) do
|
167
|
+
field = find_field(field)
|
168
|
+
field_value = (field.tag_name == 'textarea') ? field.text : field.value
|
169
|
+
if field_value.respond_to? :should_not
|
170
|
+
field_value.should_not =~ /#{value}/
|
171
|
+
else
|
172
|
+
assert_no_match(/#{value}/, field_value)
|
173
|
+
end
|
174
|
+
end
|
175
|
+
end
|
176
|
+
|
177
|
+
Then /^the "([^"]*)" checkbox(?: within (.*))? should be checked$/ do |label, parent|
|
178
|
+
with_scope(parent) do
|
179
|
+
field_checked = find_field(label)['checked']
|
180
|
+
if field_checked.respond_to? :should
|
181
|
+
field_checked.should be_true
|
182
|
+
else
|
183
|
+
assert field_checked
|
184
|
+
end
|
185
|
+
end
|
186
|
+
end
|
187
|
+
|
188
|
+
Then /^the "([^"]*)" checkbox(?: within (.*))? should not be checked$/ do |label, parent|
|
189
|
+
with_scope(parent) do
|
190
|
+
field_checked = find_field(label)['checked']
|
191
|
+
if field_checked.respond_to? :should
|
192
|
+
field_checked.should be_false
|
193
|
+
else
|
194
|
+
assert !field_checked
|
195
|
+
end
|
196
|
+
end
|
197
|
+
end
|
198
|
+
|
199
|
+
Then /^(?:|I )should be on (.+)$/ do |page_name|
|
200
|
+
current_path = URI.parse(current_url).path
|
201
|
+
if current_path.respond_to? :should
|
202
|
+
current_path.should == path_to(page_name)
|
203
|
+
else
|
204
|
+
assert_equal path_to(page_name), current_path
|
205
|
+
end
|
206
|
+
end
|
207
|
+
|
208
|
+
Then /^(?:|I )should have the following query string:$/ do |expected_pairs|
|
209
|
+
query = URI.parse(current_url).query
|
210
|
+
actual_params = query ? CGI.parse(query) : {}
|
211
|
+
expected_params = {}
|
212
|
+
expected_pairs.rows_hash.each_pair{|k,v| expected_params[k] = v.split(',')}
|
213
|
+
|
214
|
+
if actual_params.respond_to? :should
|
215
|
+
actual_params.should == expected_params
|
216
|
+
else
|
217
|
+
assert_equal expected_params, actual_params
|
218
|
+
end
|
219
|
+
end
|
220
|
+
|
221
|
+
Then /^show me the page$/ do
|
222
|
+
save_and_open_page
|
223
|
+
end
|
@@ -0,0 +1,75 @@
|
|
1
|
+
require 'bundler/setup'
|
2
|
+
require 'jax'
|
3
|
+
require 'jax/rails/application'
|
4
|
+
|
5
|
+
# this will cause warnings but is necessary to ensure the #to_prepare blocks fire on each request.
|
6
|
+
# note that since we are not (currently) using ActiveRecord, the warning can be ignored.
|
7
|
+
Jax::Rails::Application.config.cache_classes = false
|
8
|
+
|
9
|
+
# IMPORTANT: it is necessary to set this _prior_ to app initialization in order to pick up asset dirs
|
10
|
+
::Rails.application.config.root = File.expand_path("../../tmp/rails-cukes", File.dirname(__FILE__))
|
11
|
+
|
12
|
+
Jax::Rails::Application.initialize!
|
13
|
+
|
14
|
+
require 'cucumber/rails/action_controller'
|
15
|
+
|
16
|
+
if defined?(ActiveRecord::Base)
|
17
|
+
require 'rails/test_help'
|
18
|
+
else
|
19
|
+
require 'action_dispatch/testing/test_process'
|
20
|
+
require 'action_dispatch/testing/integration'
|
21
|
+
end
|
22
|
+
|
23
|
+
if !Rails.application.config.cache_classes
|
24
|
+
warn "WARNING: You have set Rails' config.cache_classes to false (most likely in config/environments/cucumber.rb). This setting is known to cause problems with database transactions. Set config.cache_classes to true if you want to use transactions. For more information see https://rspec.lighthouseapp.com/projects/16211/tickets/165."
|
25
|
+
end
|
26
|
+
|
27
|
+
require 'cucumber/rails/world'
|
28
|
+
require 'cucumber/rails/hooks'
|
29
|
+
require 'cucumber/rails/capybara'
|
30
|
+
|
31
|
+
require 'cucumber/web/tableish'
|
32
|
+
|
33
|
+
World(Jax::Engine.routes.url_helpers)
|
34
|
+
|
35
|
+
# Capybara defaults to XPath selectors rather than Webrat's default of CSS3. In
|
36
|
+
# order to ease the transition to Capybara we set the default here. If you'd
|
37
|
+
# prefer to use XPath just remove this line and adjust any selectors in your
|
38
|
+
# steps to use the XPath syntax.
|
39
|
+
Capybara.default_selector = :css
|
40
|
+
|
41
|
+
# By default, any exception happening in your Rails application will bubble up
|
42
|
+
# to Cucumber so that your scenario will fail. This is a different from how
|
43
|
+
# your application behaves in the production environment, where an error page will
|
44
|
+
# be rendered instead.
|
45
|
+
#
|
46
|
+
# Sometimes we want to override this default behaviour and allow Rails to rescue
|
47
|
+
# exceptions and display an error page (just like when the app is running in production).
|
48
|
+
# Typical scenarios where you want to do this is when you test your error pages.
|
49
|
+
# There are two ways to allow Rails to rescue exceptions:
|
50
|
+
#
|
51
|
+
# 1) Tag your scenario (or feature) with @allow-rescue
|
52
|
+
#
|
53
|
+
# 2) Set the value below to true. Beware that doing this globally is not
|
54
|
+
# recommended as it will mask a lot of errors for you!
|
55
|
+
#
|
56
|
+
ActionController::Base.allow_rescue = false
|
57
|
+
|
58
|
+
#### We're not using the DB at this time but may move toward it eventually.
|
59
|
+
# begin
|
60
|
+
# DatabaseCleaner.strategy = :transaction
|
61
|
+
# rescue NameError
|
62
|
+
# raise "You need to add database_cleaner to your Gemfile (in the :test group) if you wish to use it."
|
63
|
+
# end
|
64
|
+
|
65
|
+
# You may also want to configure DatabaseCleaner to use different strategies for certain features and scenarios.
|
66
|
+
# See the DatabaseCleaner documentation for details. Example:
|
67
|
+
#
|
68
|
+
# Before('@no-txn,@selenium,@culerity,@celerity,@javascript') do
|
69
|
+
# DatabaseCleaner.strategy = :truncation, {:except => %w[widgets]}
|
70
|
+
# end
|
71
|
+
#
|
72
|
+
# Before('~@no-txn', '~@selenium', '~@culerity', '~@celerity', '~@javascript') do
|
73
|
+
# DatabaseCleaner.strategy = :transaction
|
74
|
+
# end
|
75
|
+
#
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module NavigationHelpers
|
2
|
+
# Maps a name to a path. Used by the
|
3
|
+
#
|
4
|
+
# When /^I go to (.+)$/ do |page_name|
|
5
|
+
#
|
6
|
+
# step definition in web_steps.rb
|
7
|
+
#
|
8
|
+
def path_to(page_name)
|
9
|
+
case page_name
|
10
|
+
|
11
|
+
when /^the home\s?page$/
|
12
|
+
'/'
|
13
|
+
|
14
|
+
when /^the WebGL start page$/
|
15
|
+
url_for(Jax.config.webgl_start)
|
16
|
+
|
17
|
+
else
|
18
|
+
begin
|
19
|
+
page_name =~ /^the (.*) page$/
|
20
|
+
path_components = $1.split(/\s+/)
|
21
|
+
self.send(path_components.push('path').join('_').to_sym)
|
22
|
+
rescue NoMethodError, ArgumentError
|
23
|
+
raise "Can't find mapping from \"#{page_name}\" to a path.\n" +
|
24
|
+
"Now, go and add a mapping in #{__FILE__}"
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
World(NavigationHelpers)
|
@@ -0,0 +1,39 @@
|
|
1
|
+
module HtmlSelectorsHelpers
|
2
|
+
# Maps a name to a selector. Used primarily by the
|
3
|
+
#
|
4
|
+
# When /^(.+) within (.+)$/ do |step, scope|
|
5
|
+
#
|
6
|
+
# step definitions in web_steps.rb
|
7
|
+
#
|
8
|
+
def selector_for(locator)
|
9
|
+
case locator
|
10
|
+
|
11
|
+
when "the page"
|
12
|
+
"html > body"
|
13
|
+
|
14
|
+
# Add more mappings here.
|
15
|
+
# Here is an example that pulls values out of the Regexp:
|
16
|
+
#
|
17
|
+
# when /^the (notice|error|info) flash$/
|
18
|
+
# ".flash.#{$1}"
|
19
|
+
|
20
|
+
# You can also return an array to use a different selector
|
21
|
+
# type, like:
|
22
|
+
#
|
23
|
+
# when /the header/
|
24
|
+
# [:xpath, "//header"]
|
25
|
+
|
26
|
+
# This allows you to provide a quoted selector as the scope
|
27
|
+
# for "within" steps as was previously the default for the
|
28
|
+
# web steps:
|
29
|
+
when /^"(.+)"$/
|
30
|
+
$1
|
31
|
+
|
32
|
+
else
|
33
|
+
raise "Can't find mapping from \"#{locator}\" to a selector.\n" +
|
34
|
+
"Now, go and add a mapping in #{__FILE__}"
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
World(HtmlSelectorsHelpers)
|
@@ -0,0 +1,17 @@
|
|
1
|
+
$cucumber_root = FileUtils.pwd
|
2
|
+
|
3
|
+
Before do
|
4
|
+
FileUtils.rm_rf File.join($cucumber_root, "tmp/cache").to_s
|
5
|
+
Jax.reset_config!
|
6
|
+
end
|
7
|
+
|
8
|
+
Before("@rails") do
|
9
|
+
setup_rails_environment
|
10
|
+
create_directory "app/assets/jax/shaders"
|
11
|
+
route "mount Jax::Engine => '/'"
|
12
|
+
end
|
13
|
+
|
14
|
+
After do
|
15
|
+
# clear out cache since I can't seem to disable it entirely. (Anybody know why???)
|
16
|
+
FileUtils.rm_rf File.expand_path("../../tmp/cache", File.dirname(__FILE__))
|
17
|
+
end
|
data/jax.gemspec
CHANGED
@@ -10,25 +10,32 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.email = ["sinisterchipmunk@gmail.com"]
|
11
11
|
s.homepage = "http://jaxgl.com"
|
12
12
|
s.summary = %q{Framework for creating rich WebGL-enabled applications using JavaScript and Ruby}
|
13
|
-
s.description = %q{
|
13
|
+
s.description = %q{
|
14
|
+
Framework for creating rich WebGL-enabled applications using JavaScript and Ruby.
|
15
|
+
Can be used stand-alone to create static JavaScript documents, or integrated
|
16
|
+
seamlessly with Ruby on Rails to build dynamic WebGL applications.
|
17
|
+
}
|
14
18
|
|
15
|
-
s.add_dependency '
|
16
|
-
s.add_dependency '
|
17
|
-
s.add_dependency
|
18
|
-
s.add_dependency '
|
19
|
-
s.add_dependency 'railties', '~> 3.0.8'
|
20
|
-
s.add_dependency 'sprockets', '~> 1.0.2'
|
21
|
-
s.add_dependency 'rest-client', '~> 1.6.3'
|
22
|
-
s.add_dependency 'minitar', '~> 0.5.3'
|
19
|
+
s.add_dependency 'rails', '~> 3.1.0'
|
20
|
+
s.add_dependency 'jquery-rails', '~> 1.0.13'
|
21
|
+
s.add_dependency 'jasmine', '~> 1.0.2.0'
|
22
|
+
s.add_dependency 'rest-client', '~> 1.6.3'
|
23
23
|
|
24
|
-
s.add_development_dependency '
|
25
|
-
s.add_development_dependency '
|
24
|
+
s.add_development_dependency 'rspec', '~> 2.6.0'
|
25
|
+
s.add_development_dependency 'coffee-rails', '~> 3.1.0'
|
26
|
+
s.add_development_dependency 'coderay', '~> 0.9.7'
|
27
|
+
s.add_development_dependency 'sqlite3', '~> 1.3.4'
|
28
|
+
s.add_development_dependency 'sass-rails', '~> 3.1.0'
|
29
|
+
s.add_development_dependency 'uglifier', '~> 1.0.2'
|
30
|
+
s.add_development_dependency 'genspec', '~> 0.2.3'
|
31
|
+
s.add_development_dependency 'selenium-webdriver', '~> 2.9.1'
|
32
|
+
s.add_development_dependency 'fakeweb', '~> 1.3.0'
|
26
33
|
s.add_development_dependency 'ansi'
|
27
|
-
s.add_development_dependency '
|
34
|
+
s.add_development_dependency 'cucumber-rails', '~> 1.0.2'
|
28
35
|
|
29
36
|
# required by guides
|
30
37
|
s.add_development_dependency 'RedCloth', '~> 4.2'
|
31
|
-
s.add_development_dependency 'w3c_validators', '~> 1.
|
38
|
+
s.add_development_dependency 'w3c_validators', '~> 1.2'
|
32
39
|
|
33
40
|
# required by pdoc
|
34
41
|
s.add_development_dependency 'treetop', '~> 1.4.9'
|
@@ -36,11 +43,10 @@ Gem::Specification.new do |s|
|
|
36
43
|
|
37
44
|
s.rubyforge_project = "jax"
|
38
45
|
|
39
|
-
# Don't include stuff used to build & document jax, the
|
40
|
-
useless_files = `git ls-files -- public/* guides
|
46
|
+
# Don't include stuff used to build & document jax, otherwise the gem will get huge
|
47
|
+
useless_files = `git ls-files -- public/* guides/*`.split("\n")
|
41
48
|
|
42
49
|
s.files = `git ls-files`.split("\n") - useless_files
|
43
|
-
# `git ls-files -- spec/example_app/* public/images/*`.split("\n")
|
44
50
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") - useless_files
|
45
51
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
46
52
|
s.require_paths = ["lib"]
|
@@ -0,0 +1,64 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright 2010, Google Inc.
|
3
|
+
* All rights reserved.
|
4
|
+
*
|
5
|
+
* Redistribution and use in source and binary forms, with or without
|
6
|
+
* modification, are permitted provided that the following conditions are
|
7
|
+
* met:
|
8
|
+
*
|
9
|
+
* * Redistributions of source code must retain the above copyright
|
10
|
+
* notice, this list of conditions and the following disclaimer.
|
11
|
+
* * Redistributions in binary form must reproduce the above
|
12
|
+
* copyright notice, this list of conditions and the following disclaimer
|
13
|
+
* in the documentation and/or other materials provided with the
|
14
|
+
* distribution.
|
15
|
+
* * Neither the name of Google Inc. nor the names of its
|
16
|
+
* contributors may be used to endorse or promote products derived from
|
17
|
+
* this software without specific prior written permission.
|
18
|
+
*
|
19
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
20
|
+
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
21
|
+
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
22
|
+
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
23
|
+
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
24
|
+
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
25
|
+
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
26
|
+
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
27
|
+
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
28
|
+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
29
|
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
30
|
+
*/
|
31
|
+
|
32
|
+
|
33
|
+
/**
|
34
|
+
* Global#requestAnimFrame(callback, element) -> undefined
|
35
|
+
* - callback (Function): callback to be fired to initiate a render sequence
|
36
|
+
* - element (DOMElement): a DOM element to attach the animation state to
|
37
|
+
*
|
38
|
+
* Provides requestAnimationFrame in a cross browser way.
|
39
|
+
**/
|
40
|
+
if (typeof(window) == "undefined") {
|
41
|
+
global.requestAnimFrame = (function() {
|
42
|
+
return global.requestAnimationFrame ||
|
43
|
+
global.webkitRequestAnimationFrame ||
|
44
|
+
global.mozRequestAnimationFrame ||
|
45
|
+
global.oRequestAnimationFrame ||
|
46
|
+
global.msRequestAnimationFrame ||
|
47
|
+
function(/* function FrameRequestCallback */ callback, /* DOMElement Element */ element) {
|
48
|
+
setTimeout(callback, 1000/60);
|
49
|
+
};
|
50
|
+
})();
|
51
|
+
}
|
52
|
+
else {
|
53
|
+
window.requestAnimFrame = (function() {
|
54
|
+
return window.requestAnimationFrame ||
|
55
|
+
window.webkitRequestAnimationFrame ||
|
56
|
+
window.mozRequestAnimationFrame ||
|
57
|
+
window.oRequestAnimationFrame ||
|
58
|
+
window.msRequestAnimationFrame ||
|
59
|
+
function(/* function FrameRequestCallback */ callback, /* DOMElement Element */ element) {
|
60
|
+
setTimeout(callback, 1000/60);
|
61
|
+
};
|
62
|
+
})();
|
63
|
+
}
|
64
|
+
|
@@ -0,0 +1,16 @@
|
|
1
|
+
/* Used by endpoints to pull in application-specific logic. */
|
2
|
+
|
3
|
+
//= require "jax"
|
4
|
+
//= require_everything_matching "helpers"
|
5
|
+
//= require_everything_matching "models"
|
6
|
+
//= require_everything_matching "views"
|
7
|
+
//= require_everything_matching "controllers"
|
8
|
+
//= require_everything_matching "shaders"
|
9
|
+
//= require_everything_matching "resources"
|
10
|
+
|
11
|
+
for (var shaderName in Jax._shader_data) {
|
12
|
+
if (!(Jax.shaders[shaderName] instanceof Jax.Shader)) {
|
13
|
+
var descriptor = Jax._shader_data[shaderName];
|
14
|
+
Jax.shaders[shaderName] = new Jax.Shader(descriptor);
|
15
|
+
}
|
16
|
+
}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
/* meshes */
|
2
|
+
//= require "jax/builtin/meshes/quad"
|
3
|
+
//= require "jax/builtin/meshes/cube"
|
4
|
+
//= require "jax/builtin/meshes/torus"
|
5
|
+
//= require "jax/builtin/meshes/plane"
|
6
|
+
//= require "jax/builtin/meshes/sphere"
|
7
|
+
//= require "jax/builtin/meshes/teapot"
|
8
|
+
|
9
|
+
//= require "shaders/texture/material"
|
10
|
+
//= require "shaders/normal_map/material"
|
11
|
+
//= require "shaders/shadow_map/material"
|
12
|
+
//= require "shaders/depthmap/material"
|
13
|
+
//= require "shaders/paraboloid/material"
|
14
|
+
//= require "shaders/fog/material"
|
15
|
+
//= require "shaders/picking/material"
|
16
|
+
|
17
|
+
Jax.Material.create("basic");
|
18
|
+
Jax.Material.create("default", {default_shader:'basic'});
|
19
|
+
Jax.Material.create("depthmap", {default_shader:"depthmap"});
|
20
|
+
Jax.Material.create("paraboloid-depthmap", {type:"Paraboloid",default_shader:"paraboloid",layers:[{type:"Depthmap"}]});
|
21
|
+
Jax.Material.create("picking", {type:"Picking"});
|
@@ -0,0 +1,83 @@
|
|
1
|
+
/**
|
2
|
+
* class Jax.Mesh.Cube < Jax.Mesh
|
3
|
+
*
|
4
|
+
* Constructs a 6-sided Cube mesh.
|
5
|
+
*
|
6
|
+
* Options:
|
7
|
+
*
|
8
|
+
* * width : the width of the cube in units. Defaults to +size+.
|
9
|
+
* * height : the height of the cube in units. Defaults to +size+.
|
10
|
+
* * depth : the depth of the cube in units. Defaults to +size+.
|
11
|
+
* * size : a value to use for any of the other options if
|
12
|
+
* they are unspecified. Defaults to 1.0.
|
13
|
+
*
|
14
|
+
* Example:
|
15
|
+
*
|
16
|
+
* new Jax.Mesh.Cube(); //=> 1x1x1
|
17
|
+
* new Jax.Mesh.Cube({size:2}); //=> 2x2x2
|
18
|
+
* new Jax.Mesh.Cube({width:2}); //=> 2x1x1
|
19
|
+
* new Jax.Mesh.Cube({width:2,depth:3}); //=> 2x1x3
|
20
|
+
*
|
21
|
+
**/
|
22
|
+
Jax.Mesh.Cube = Jax.Class.create(Jax.Mesh, {
|
23
|
+
initialize: function($super, options) {
|
24
|
+
var size = options && options.size || 1.0;
|
25
|
+
options = Jax.Util.normalizeOptions(options, {
|
26
|
+
width: size,
|
27
|
+
depth: size,
|
28
|
+
height: size
|
29
|
+
});
|
30
|
+
this.draw_mode = GL_TRIANGLES;
|
31
|
+
$super(options);
|
32
|
+
|
33
|
+
var w = options.width, h = options.height, d = options.depth;
|
34
|
+
this.sides = {};
|
35
|
+
|
36
|
+
this.sides.left = new Jax.Model({mesh: new Jax.Mesh.Quad(d, h)});
|
37
|
+
this.sides.left.camera.reorient([-1,0,0], [-w/2,0,0]);
|
38
|
+
|
39
|
+
this.sides.right = new Jax.Model({mesh: new Jax.Mesh.Quad(d, h)});
|
40
|
+
this.sides.right.camera.reorient([1,0,0], [w/2,0,0]);
|
41
|
+
|
42
|
+
this.sides.front = new Jax.Model({mesh: new Jax.Mesh.Quad(w, h)});
|
43
|
+
this.sides.front.camera.reorient([0,0,1], [0,0,d/2]);
|
44
|
+
|
45
|
+
this.sides.back = new Jax.Model({mesh: new Jax.Mesh.Quad(w, h)});
|
46
|
+
this.sides.back.camera.reorient([0,0,-1], [0,0,-d/2]);
|
47
|
+
|
48
|
+
this.sides.top = new Jax.Model({mesh: new Jax.Mesh.Quad(w, d)});
|
49
|
+
this.sides.top.camera.reorient([0,1,0], [0,h/2,0]);
|
50
|
+
|
51
|
+
this.sides.bottom = new Jax.Model({mesh: new Jax.Mesh.Quad(w, d)});
|
52
|
+
this.sides.bottom.camera.reorient([0,-1,0], [0,-h/2,0]);
|
53
|
+
},
|
54
|
+
|
55
|
+
init: function(verts, colors, texes, norms) {
|
56
|
+
// we need to get each quad's vertices, but then transform them by the object's
|
57
|
+
// local transformation, which includes the position offset and direction.
|
58
|
+
|
59
|
+
var matrix;
|
60
|
+
for (var i in this.sides)
|
61
|
+
{
|
62
|
+
var qverts = [], qcolor = [], qtex = [], qnorm = [];
|
63
|
+
this.sides[i].mesh.init(qverts, qcolor, qtex, qnorm, []);
|
64
|
+
matrix = this.sides[i].camera.getTransformationMatrix();
|
65
|
+
|
66
|
+
// unfortunately quads are rendered in triangle strips; we need to translate that
|
67
|
+
// into triangles, because there's no support at this time for ending one triangle
|
68
|
+
// strip and beginning another.
|
69
|
+
function push(verti) {
|
70
|
+
var i1 = verti*3, i2 = verti*3+1, i3 = verti*3+2;
|
71
|
+
var vert = mat4.multiplyVec3(matrix, [qverts[i1], qverts[i2], qverts[i3]]);
|
72
|
+
var norm = mat4.multiplyVec3(matrix, [qnorm[i1], qnorm[i2], qnorm[i3]]);
|
73
|
+
|
74
|
+
verts.push(vert[0], vert[1], vert[2]);
|
75
|
+
norms.push(norm[0], norm[1], norm[2]);
|
76
|
+
if (qcolor.length != 0) colors.push(qcolor[verti*4], qcolor[verti*4+1], qcolor[verti*4+2], qcolor[verti*4+3]);
|
77
|
+
if (qtex.length != 0) texes. push(-qtex [verti*2], qtex[verti*2+1]);//, qtex [i3]);
|
78
|
+
}
|
79
|
+
push(0); push(1); push(2); // tri1
|
80
|
+
push(2); push(1); push(3); // tri2
|
81
|
+
}
|
82
|
+
}
|
83
|
+
});
|