Skip to content

Find a way to automatically generate ember.js or other frameworks’s libs. #35

Open
juan77 opened this Issue Jan 2, 2012 · 3 comments

4 participants

@juan77
juan77 commented Jan 2, 2012

When working on an application we have a bunch of frameworks that are cloned directly, and we need to find a way to generate the framework’s libraries when we made a change on it, so we can work without breaking :D, because we actually generate the ember.js manually by running rakep dist, and same for sproutcore-touch, sproutcore-routing and so on... and we can also add our own small framework.

I think that the idea is to find all other Assetfile, and chain it when something changes.

@dudleyf
dudleyf commented Jan 2, 2012

My first thought is to add something like a pipeline DSL method that would take a path to another Assetfile, making that pipeline part of the current pipeline.

@xdissent

I reworked ember.js to use rake-pipeline (https://github.com/xdissent/ember.js/tree/rake-pipeline) and now I'm trying to hook up its Assetfile in my own project. Currently this works fine in my Rakefile (rack not rails):

task :dist => :clean do
  Dir.chdir "vendor/ember.js" do |d|
    Rake::Pipeline::Project.new("Assetfile").invoke
  end
  Dir.chdir "vendor/ember-data" do |d|
    Rake::Pipeline::Project.new("Assetfile").invoke
  end
  Rake::Pipeline::Project.new("Assetfile").invoke
end

I can't seem to hack the middleware to work though, since calls to Dir.chdir will be nested if you use multiple middlewares causing massive path confusion. A pipeline DSL method would be great. Perhaps we could pass it a base dir from which the Assetfile should be parsed and use a Dir.chdir block around the actual invoke call? I'll play with the idea tonight but I'm not super familiar with creating DSLs (sounds fun though!)

@wagenet
wagenet commented Mar 8, 2012

@juan77 now that Ember is using RakeP to build, this should be possible. You'll probably need to set up a custom middleware that sees if the request is for Ember and punts it to the ember RakeP middleware, otherwise using your app's. If you're using standard Rack, you should be able to do this in your Rackup file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.