Skip to content

Commit

Permalink
Re-arrange initialization code
Browse files Browse the repository at this point in the history
  • Loading branch information
dasch authored and augustl committed Oct 8, 2009
1 parent bb08f1b commit da2fbfd
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
1 change: 1 addition & 0 deletions init.rb
@@ -0,0 +1 @@
require File.join(File.dirname(__FILE__), 'rails', 'init')
9 changes: 8 additions & 1 deletion lib/more.rb
Expand Up @@ -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" => {
Expand Down Expand Up @@ -162,4 +169,4 @@ def pathname_from_array(array)
Pathname.glob(self.source_path.join(*path_spec))[0]
end
end
end
end
4 changes: 2 additions & 2 deletions more.gemspec
Expand Up @@ -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
9 changes: 1 addition & 8 deletions 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
Expand Down

0 comments on commit da2fbfd

Please sign in to comment.