Permalink
Browse files

Re-arrange initialization code

  • Loading branch information...
1 parent bb08f1b commit da2fbfd66f0a033953cffd1f618428e906d43ffe @dasch dasch committed with augustl Sep 17, 2009
Showing with 12 additions and 11 deletions.
  1. +1 −0 init.rb
  2. +8 −1 lib/more.rb
  3. +2 −2 more.gemspec
  4. +1 −8 rails/init.rb
View
1 init.rb
@@ -0,0 +1 @@
+require File.join(File.dirname(__FILE__), 'rails', 'init')
View
9 lib/more.rb
@@ -7,6 +7,13 @@
# By default, Less::More.parse will be called for each request in `development` environment and on
# application initialization in `production` environment.
+begin
+ require 'less'
+rescue LoadError => e
+ e.message << " (You may need to install the less gem)"
+ raise e
+end
+
class Less::More
DEFAULTS = {
"production" => {
@@ -162,4 +169,4 @@ def pathname_from_array(array)
Pathname.glob(self.source_path.join(*path_spec))[0]
end
end
-end
+end
View
4 more.gemspec
@@ -10,8 +10,8 @@ SPEC = Gem::Specification.new do |s|
parses your applications .less files through LESS and outputs CSS files.
EOS
s.author = "Alexis Sellier"
- s.version = "0.0.1"
- s.files = FileList["README.markdown", "MIT-LICENSE", "Rakefile", "lib/*.rb", "rails/init.rb", "tasks/*", "test/*"]
+ s.version = "0.0.3"
+ s.files = FileList["README.markdown", "MIT-LICENSE", "Rakefile", "init.rb", "lib/*.rb", "rails/init.rb", "tasks/*", "test/*"]
s.has_rdoc = true
s.add_dependency "less"
end
View
9 rails/init.rb
@@ -1,11 +1,4 @@
-begin
- require 'less'
-rescue LoadError => e
- e.message << " (You may need to install the less gem)"
- raise e
-end
-
-require File.join(File.dirname(__FILE__), 'lib', 'more')
+require File.join(File.dirname(__FILE__), '..', 'lib', 'more')
config.after_initialize {
Less::More.clean

0 comments on commit da2fbfd

Please sign in to comment.