Skip to content

Commit

Permalink
Dropping support for rails 3.2 and finxing issue #152
Browse files Browse the repository at this point in the history
  • Loading branch information
emilioforrer committed Sep 9, 2016
1 parent 9fd4093 commit 2dda042
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 6 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Expand Up @@ -6,6 +6,12 @@ Please have a look at the [Haml Coffee Changelog](https://github.com/netzpirat/h

- Update to Haml-Coffee 1.13.6

## 2.0.0 - September 08, 2016

- Dropping support for rails 3.2
- [#152][]: Templates not being found


## 1.16.2 - February 25, 2016

- Fixing compatibility with older versions of rails.
Expand Down
4 changes: 2 additions & 2 deletions haml_coffee_assets.gemspec
Expand Up @@ -19,8 +19,8 @@ Gem::Specification.new do |s|
s.files = Dir.glob('{app,lib,vendor}/**/*') + %w[LICENSE README.md]

s.add_runtime_dependency 'coffee-script', '>= 2'
s.add_runtime_dependency 'tilt', '>= 1'
s.add_runtime_dependency 'sprockets', '>= 2'
s.add_runtime_dependency 'tilt', '>= 2'
s.add_runtime_dependency 'sprockets', '>= 3'

s.add_development_dependency 'bundler'
s.add_development_dependency 'rspec'
Expand Down
19 changes: 16 additions & 3 deletions lib/haml_coffee_assets/rails/engine.rb
Expand Up @@ -12,6 +12,19 @@ class Engine < ::Rails::Engine

config.hamlcoffee = ::HamlCoffeeAssets.config

# https://github.com/tricknotes/ember-rails/blob/c45c5d23755ef9f8ab51d9f611cdd3517a11badf/lib/ember_rails.rb#L30
def configure_assets(app)
if config.respond_to?(:assets) && config.assets.respond_to?(:configure)
# Rails 4.x
config.assets.configure do |env|
yield env
end
else
# Rails 3.2
yield app.assets
end
end

# Initialize Haml Coffee Assets after Sprockets
#
initializer 'sprockets.hamlcoffeeassets', group: :all, after: 'sprockets.environment' do |app|
Expand Down Expand Up @@ -77,10 +90,10 @@ def render(view, locals, buffer=nil, &block)
end
end

next unless app.assets

# Register Tilt template (for Sprockets)
app.assets.register_engine '.hamlc', ::HamlCoffeeAssets::Tilt::TemplateHandler
configure_assets(app) do |env|
env.register_engine '.hamlc', ::HamlCoffeeAssets::Tilt::TemplateHandler
end
end

end
Expand Down
2 changes: 1 addition & 1 deletion lib/haml_coffee_assets/version.rb
@@ -1,5 +1,5 @@
# coding: UTF-8

module HamlCoffeeAssets
VERSION = '1.16.2' unless defined?(HamlCoffeeAssets::VERSION)
VERSION = '2.0.0' unless defined?(HamlCoffeeAssets::VERSION)
end

0 comments on commit 2dda042

Please sign in to comment.