Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Get rid of the intermediate config object. (Fixes #69)

The ActiveSupport::OrderedOptions was a relict before
HamlCoffeeAssets::Configuration was introduced and
isn't necessary at all.
  • Loading branch information...
commit 6286dccbc96e3bea0f2bbd1994af93fedf4637bc 1 parent 2ac2822
@netzpirat authored
View
7 CHANGELOG.md
@@ -4,6 +4,7 @@ Please also have a look at the [Haml Coffee Changelog](https://github.com/netzpi
## Master
+- [#69][]: Timing issue during configuration
- Upgrade to Haml Coffee 1.4.9
- Trim whitespace in the helpers and make them run in the template context.
@@ -240,11 +241,13 @@ Please also have a look at the [Haml Coffee Changelog](https://github.com/netzpi
[#51]: https://github.com/netzpirat/haml_coffee_assets/issues/51
[#60]: https://github.com/netzpirat/haml_coffee_assets/issues/60
[#63]: https://github.com/netzpirat/haml_coffee_assets/issues/63
-
+[#65]: https://github.com/netzpirat/haml_coffee_assets/issues/65
+[#68]: https://github.com/netzpirat/haml_coffee_assets/issues/68
+[#69]: https://github.com/netzpirat/haml_coffee_assets/issues/69
[@axs89]: https://github.com/axs89
[@dzello]: https://github.com/dzello
[@jayzes]: https://github.com/jayzes
[@jfirebaugh]: https://github.com/jfirebaugh
[@jingoro]: https://github.com/jingoro
[@paulyoung]: https://github.com/paulyoung
-[@whitequark]: https://github.com/whitequark
+[@whitequark]: https://github.com/whitequark
View
8 lib/haml_coffee_assets.rb
@@ -25,14 +25,6 @@
#
module HamlCoffeeAssets
- # Get the Haml Coffee Assets configuration
- #
- # @return [HamlCoffeeAssets::Configuration] the configuration object
- #
- def self.config
- @config ||= ::HamlCoffeeAssets::Configuration.new
- end
-
# Get the path to the `hamlcoffee.js.coffee.erb` helper file.
#
# @return [String] the absolute path to the helpers file
View
8 lib/haml_coffee_assets/configuration.rb
@@ -1,5 +1,13 @@
module HamlCoffeeAssets
+ # Get the Haml Coffee Assets configuration
+ #
+ # @return [HamlCoffeeAssets::Configuration] the configuration object
+ #
+ def self.config
+ @config ||= ::HamlCoffeeAssets::Configuration.new
+ end
+
# Haml Coffee configuration object that contains the default values.
# It's a plain Ruby object so a Sinatra app doesn't have to depend
# on ActiveSupport just because of the Rails engine configuration.
View
7 lib/haml_coffee_assets/rails/engine.rb
@@ -8,7 +8,7 @@ module Rails
#
class Engine < ::Rails::Engine
- config.hamlcoffee = ActiveSupport::OrderedOptions.new
+ config.hamlcoffee = ::HamlCoffeeAssets.config
# Initialize Haml Coffee Assets after Sprockets
#
@@ -17,11 +17,6 @@ class Engine < ::Rails::Engine
# Register tilt template
app.assets.register_engine '.hamlc', ::HamlCoffeeAssets::Tilt::TemplateHandler
-
- # Copy Rails config to the Haml Coffee Assets config
- app.config.hamlcoffee.each do |key, value|
- HamlCoffeeAssets.config.instance_variable_set("@#{ key }", value)
- end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.