Skip to content

Commit

Permalink
Load gems of assets group before of precompile
Browse files Browse the repository at this point in the history
  • Loading branch information
guilleiguaran committed Feb 24, 2013
1 parent 7f4ebd3 commit bbc19aa
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/sprockets/rails/task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ def define
# Override this task change the loaded dependencies
desc "Load asset compile environment"
task :environment do
# Load gems in assets group of Gemfile
Bundler.require(:assets) if defined?(Bundler)
# Load full Rails environment by default
Rake::Task['environment'].invoke
end
Expand Down

9 comments on commit bbc19aa

@josh
Copy link
Contributor

@josh josh commented on bbc19aa Feb 26, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gross.

@josh
Copy link
Contributor

@josh josh commented on bbc19aa Feb 26, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

People should use bundler env vars or flags when invoking assets:precompile if they want to do this.

@rafaelfranca
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@josh is there any case where people don't want this?

@josh
Copy link
Contributor

@josh josh commented on bbc19aa Feb 26, 2013 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rafaelfranca
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, got it. This patch is fixing a problem to people who choose to follow the conventions. They should be able to add sprockets-rails and the things will just work.

I'm not used to this code base, so if we have a way to do it without penalize the people who choose to follow the conventions, please go ahead and make the change.

Your thoughts are always valuable and welcome here.

@josh
Copy link
Contributor

@josh josh commented on bbc19aa Feb 26, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most wish this was a rails initialization concern in that case.

@rafaelfranca
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@guilleiguaran could you investigate it?

@guilleiguaran
Copy link
Member Author

@guilleiguaran guilleiguaran commented on bbc19aa Feb 27, 2013 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@guilleiguaran
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted in 59922ec

Please sign in to comment.