On Mon, 2010-05-17 at 13:17 +0200, [email protected] wrote: > From: Tomas Sedovic <[email protected]> > > Added the HAML gem to the gemspec and the RPM spec, set the Aggregator up to > work with it. > --- > deltacloud-aggregator.spec.in | 1 + > src/config/environment.rb | 1 + > src/vendor/plugins/haml/init.rb | 18 ++++++++++++++++++ > 3 files changed, 20 insertions(+), 0 deletions(-) > create mode 100644 src/vendor/plugins/haml/init.rb > > diff --git a/deltacloud-aggregator.spec.in b/deltacloud-aggregator.spec.in > index aee50ee..3228ee1 100644 > --- a/deltacloud-aggregator.spec.in > +++ b/deltacloud-aggregator.spec.in > @@ -22,6 +22,7 @@ Requires: ruby(abi) = 1.8 > Requires: rubygem(rails) >= 2.1.1 > Requires: rubygem(daemons) > Requires: rubygem(gettext_rails) > +Requires: rubygem(haml) > Requires: postgresql > Requires: postgresql-server > Requires: ruby-postgres > diff --git a/src/config/environment.rb b/src/config/environment.rb > index 4277fe7..eb12f46 100644 > --- a/src/config/environment.rb > +++ b/src/config/environment.rb > @@ -44,6 +44,7 @@ Rails::Initializer.run do |config| > config.gem "gettext", :lib => "gettext_activerecord" > config.gem "authlogic" > config.gem "deltacloud-client", :lib => "deltacloud" > + config.gem "haml" > > # Only load the plugins named here, in the order given. By default, all > plugins > # in vendor/plugins are loaded in alphabetical order.
According to: http://haml-lang.com/docs/yardoc/file.HAML_REFERENCE.html#plugin this init file is not needed, since we are using the gem config. I removed the file and tested that it still works with your next patch, and it does. Please remove this init.rb file from this patch. > diff --git a/src/vendor/plugins/haml/init.rb b/src/vendor/plugins/haml/init.rb > new file mode 100644 > index 0000000..3b64a9e > --- /dev/null > +++ b/src/vendor/plugins/haml/init.rb > @@ -0,0 +1,18 @@ > +begin > + require File.join(File.dirname(__FILE__), 'lib', 'haml') # From here > +rescue LoadError > + begin > + require 'haml' # From gem > + rescue LoadError => e > + # gems:install may be run to install Haml with the skeleton plugin > + # but not the gem itself installed. > + # Don't die if this is the case. > + raise e unless defined?(Rake) && > + (Rake.application.top_level_tasks.include?('gems') || > + Rake.application.top_level_tasks.include?('gems:install')) > + end > +end > + > +# Load Haml and Sass. > +# Haml may be undefined if we're running gems:install. > +Haml.init_rails(binding) if defined?(Haml) With the one caveat (file removal) above, ACK. _______________________________________________ deltacloud-devel mailing list [email protected] https://fedorahosted.org/mailman/listinfo/deltacloud-devel
