Closed Goutte closed 11 years ago
I'm having trouble coercing rake and bundler from the project root. I decided to call it a night without quite getting this working.
You can run rake
inside of the jax-core directory to test just jax-core; you can do the same in jax-engine to test just jax-engine. Ideally, rake
in the project root should do both, but Bundler messes with the load paths and keeps me from dynamically loading the sub-projects' gemfiles. (FYI, automated in-browser testing for jax-engine isn't functional right now either. You have to rackup for that -- see TESTING
.)
The answer might be to refactor out the gemfiles into the project root, I don't know yet. I'd rather not do that if possible because jax-engine relies on testbeds, but jax and jax-core do not, and it seems like a waste of cycles.
Leaving this open until rake
works from project root, because it should. :)
Ok, this seems to be working now.
Example from project root:
BUNDLE_GEMFILE=`pwd`/gemfiles/rails-3.2 rake
I think using an absolute path to the Gemfile is required.
When jax-core
runs its in-browser tests, be patient. It takes a while to serialize the results to Ruby. As of this writing, only the picking tests are failing for me. Failures in JavaScript don't cause the rake
command to fail, at this time.
For running tests within a jax-core
or jax-engine
directory instead of from project root, export BUNDLE_GEMFILE
as an absolute path, first.
I haven't been successful with hooking jax-engine
JavaScript tests into rake
just yet, so you have to continue with rackup
for that.
Ok !
I think it's a neat idea to separate jax-core
from jax-engine
, even at the cost of some tesing complexity (who said brainfcuk?). It'll be easier to later separate the shaders in a jax-shaders
section for example, with its own visual testing facility !
I've moved to installing a jax app using the 3.0.0rc2, and I ran into problems similar to issue #72.
I spent my day trying various dependencies configurations (up until I capped out rubygems' API limit)... I seems to be a bug related to jasmine-rails, but I don't really understand because it should be fixed in the version of jasmine jax uses... which does not use jasmine-rails !
Here's what I did :
$ gem install jax -v "=3.0.0rc2"
$ rvm use 2.0.0
$ bundle install
$ bundle update
$ jax new cyx
Everything's shiny up to this point, not to fret.
$ jax server
=> Booting WEBrick
=> Rails 3.2.14 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2013-07-27 18:44:06] INFO WEBrick 1.3.1
[2013-07-27 18:44:06] INFO ruby 2.0.0 (2013-06-27) [x86_64-linux]
[2013-07-27 18:44:06] INFO WEBrick::HTTPServer#start: pid=6479 port=3000
Started GET "/assets/jax.js" for 127.0.0.1 at 2013-07-27 18:44:08 +0200
NameError (uninitialized constant Jasmine::Config):
jax (3.0.0.rc2) lib/jax/jasmine/config.rb:1:in `<top (required)>'
jax (3.0.0.rc2) lib/jax/jasmine/rails_adapter.rb:18:in `middleware'
jax (3.0.0.rc2) lib/jax/jasmine/rails_adapter.rb:12:in `call'
actionpack (3.2.14) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
rack (1.4.5) lib/rack/etag.rb:23:in `call'
rack (1.4.5) lib/rack/conditionalget.rb:25:in `call'
actionpack (3.2.14) lib/action_dispatch/middleware/head.rb:14:in `call'
actionpack (3.2.14) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.2.14) lib/action_dispatch/middleware/flash.rb:242:in `call'
rack (1.4.5) lib/rack/session/abstract/id.rb:210:in `context'
rack (1.4.5) lib/rack/session/abstract/id.rb:205:in `call'
actionpack (3.2.14) lib/action_dispatch/middleware/cookies.rb:341:in `call'
actionpack (3.2.14) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
activesupport (3.2.14) lib/active_support/callbacks.rb:405:in `_run__1898584455044460363__call__1644893896191916401__callbacks'
activesupport (3.2.14) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.14) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
activesupport (3.2.14) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.2.14) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (3.2.14) lib/action_dispatch/middleware/reloader.rb:65:in `call'
actionpack (3.2.14) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
actionpack (3.2.14) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
actionpack (3.2.14) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
railties (3.2.14) lib/rails/rack/logger.rb:32:in `call_app'
railties (3.2.14) lib/rails/rack/logger.rb:16:in `block in call'
activesupport (3.2.14) lib/active_support/tagged_logging.rb:22:in `tagged'
railties (3.2.14) lib/rails/rack/logger.rb:16:in `call'
actionpack (3.2.14) lib/action_dispatch/middleware/request_id.rb:22:in `call'
rack (1.4.5) lib/rack/methodoverride.rb:21:in `call'
rack (1.4.5) lib/rack/runtime.rb:17:in `call'
activesupport (3.2.14) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.4.5) lib/rack/lock.rb:15:in `call'
actionpack (3.2.14) lib/action_dispatch/middleware/static.rb:63:in `call'
railties (3.2.14) lib/rails/engine.rb:484:in `call'
railties (3.2.14) lib/rails/application.rb:231:in `call'
rack (1.4.5) lib/rack/content_length.rb:14:in `call'
railties (3.2.14) lib/rails/rack/log_tailer.rb:17:in `call'
rack (1.4.5) lib/rack/handler/webrick.rb:59:in `service'
/usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
/usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
/usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
The released RC is not compatible with recent changes to jasmine-rails. Try using bundler to install jax from github. I have not tested recent commits this way, and jax master may be broken in other ways right now, but it should at least be compatible with jasmine.
oooOOooOoooh ! Did not even figured that rc2
was frozen >.<
I must be exhausted from the heat...
Well I can definitely add in the Gemfile
gem 'jax', :git => "git://github.com/sinisterchipmunk/jax.git"
but, how can I create a new jax (non-rails) project in an empty directory ?
Is it still possible to create through something like
$ gem install jax -v "=3.0.0rc3"
(which does not find rc3 because it is not on rubygems i suppose, though the git repo says rc3)
My story is : I need to jax new ...
so I get the new files, because with the jax new ...
from rc2
, when I only update the Gemfile, I get :
$ jax server
script/jax:8:in `require': cannot load such file -- jax/commands (LoadError)
BTW, gem install
has no option for git, all of the internet tells me to use a Gemfile... :(
Don't mind me, I got it working by initializing a new Rails project, works fine that way !
I don't have access to jax
, but I still can generate using rails generate jax:<something>
!
Of course, as you said, some things are broken, but it's coffeescript, I can deal with it ! :)
Would you like me to collect and report (and even try to fix hack around) broken things ? (broken = not working as documentation states)
Yes, I would appreciate people pointing out places where the docs don't make sense. Keep in mind that in many cases, it's the docs, not the code, that will change -- but shedding light on those changes is important regardless of where they need to be made.
After much deliberation, I've decided to make Jax more rails-centric. My reasoning is simple: a standalone Jax application is really just a Rails application where you never create a controller, and always precompile your assets. So, it makes more sense to make Jax be a Rails framework, and users who need a standalone app can just rake assets:precompile
to get the exact same benefit, with half the magic.
Thus, the jax
command-line tool has been removed, and now rails generate jax:<something>
is the preferred way to invoke the generators.
If there's enough push-back from the community, then I could be convinced to continue supporting static applications, but if you give the rake assets:precompile
approach a try, I think you'll eventually agree that this makes more sense, and makes the whole Jax app build process more transparent.
Okay !
I don't mind one way or the other, and like you I prefer when things stay simple ; I was merely following the doc blindly, and it took me quite a while to figure out the rails generate jax:<something>
command, and even then I was convinced I was not doing the right thing. ;)
Static apps are not needed, I think ; it's easy enough to rails new awesomeness
.
I'll make a PR when LEAP controls are hacked and I'll post other issues as well, but right now, know that the Light generator still generates .resource
files instead of Jax.Light.addResources
coffeescript files and that the generated Model resource files lack the .getGlobal()
after Jax
. (I don't yet really understand why it is needed, though)
I'll make a PR when LEAP controls are hacked
Sounds great, but be aware that I have been working on the input code. The API is somewhat different. It should make adding new devices much more seamless -- but hopefully it doesn't break anything you've been working on so far. Take a look at Jax.Input.Keyboard
and Jax.Input.Mouse
for examples.
the Light generator still generates .resource files instead of Jax.Light.addResources coffeescript files and that the generated Model resource files lack the .getGlobal() after Jax.
Thanks for the heads up. I'll get both of those fixed soon. Actually, I'm thinking of removing Jax.getGlobal()
. It adds an unnecessary verbosity, with no real gain at all. Its original intent was to make Jax more friendly to CommonJS (e.g. node.js) environments -- but since WebGL isn't supported in those environments right now, it's kind of a waste. For now, I'm still debating whether Jax.getGlobal()
helps future-proof the framework, or just makes it harder to understand and use.
Don't worry, my time has mostly been spent to install the leap motion on debian, and trying to figure out (on paper) the best gesture ergonomy to control a trackball camera from the data the leap webservice sends.
Thanks for the Input
tips, I'll get right down to it !
Cool, thanks for the link! I spent only enough time with my Linux box to say, "Ehh, no installer", and moved on to my other machines.
I, too, am playing with adding a Leap input to Jax. Since it sounds like you're not quite ready to code yet, if I get something operational first, I'll commit it. Then, if you don't agree with the implementation, I'm always open to suggestions.
Well don't be too excited, I haven't yet managed to install Airspace... But it works with leapjs
, so it should be enough to hack leap controls for JAX ! It does bug quite often, though. (leapd
stops responding, and I have to SIGKILL
it)
There's a trackball controls demo by the guy behind three.js
, and it works for me on debian, but it's exactly the kind of too sensitive controls I don't want.
See commit eaab2409: add support for Leap Motion input devices. :dancer:
Here's the simplest possible demo, just paste it into a (Jax-ready) console and start making gestures:
jQuery.getScript("https://raw.github.com/leapmotion/leapjs/master/leap.js", function() {
Jax.Controller.create('leapdemo', {
leap_gesture_circled: function(data) { console.log("CIRCLE", data); },
leap_gesture_swiped: function(data) { console.log("SWIPE", data); },
leap_gesture_key_tapped: function(data) { console.log("KEY TAPPED", data); },
leap_gesture_screen_tapped: function(data) { console.log("SCREEN TAPPED", data); }
});
var context = new Jax.Context(document.createElement('canvas'))
context.redirectTo("leapdemo")
});
You can process way more than just gestures like this, see the commit for details.
OMG ! :clap:
I'm so glad you did it and not me ! It would have been so shameful to publish my awful code ! :sheep:
Besides, I don't know about you, but my leapd
keeps freezing after minutes of use, which is really annoying (and chronophage)...
my
leapd
keeps freezing after minutes of use
Odd. I've not tried to get it running on *nix yet, but it's working pretty well on my Mac.
So, I tried the latest version, and here's some feedback :
Hey, where are the development dependencies of
jax-core
andjax-engine
?Because, then I get :
I found rspec in
jax-core.gemspec
. I cancd jax-core
andbundle update
, but when Icd ..
andrake
I still get the same error.I really am still a noob when it comes to ruby >.<
Also, the
generate-testbeds
worked.