Skip to content

Commit

Permalink
Merge pull request #34 from gionkunz/master
Browse files Browse the repository at this point in the history
Added better support for usage outside of rails (i.e. Middleman)
  • Loading branch information
hiravgandhi committed Jan 27, 2014
2 parents 8ddf99e + 137f7cf commit 27bf075
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ spec/reports
test/tmp
test/version_tmp
tmp
/.idea
5 changes: 4 additions & 1 deletion lib/angularjs-rails.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

module AngularJS
module Rails
class Engine < ::Rails::Engine
if defined? Rails::Engine
require "angularjs-rails/engine"
elsif defined? Sprockets
require "angularjs-rails/sprockets"
end
end
end
6 changes: 6 additions & 0 deletions lib/angularjs-rails/engine.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module AngularJS
module Rails
class Engine < ::Rails::Engine
end
end
end
3 changes: 3 additions & 0 deletions lib/angularjs-rails/sprockets.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
require 'sprockets'

Sprockets.append_path File.expand_path("../../../vendor/assets/javascript", __FILE__)

1 comment on commit 27bf075

@jedisct1
Copy link

Choose a reason for hiding this comment

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

Any idea why this commit breaks rake assets:precompile?

After this commit, I get couldn't find file 'angular.js' with application.js just being:

//= require angular
//= require angular-resource
//= require angular-route

Please sign in to comment.