lib/sprockets/secretary.rb in sstephenson-sprockets-0.5.0 vs lib/sprockets/secretary.rb in sstephenson-sprockets-0.9.0

- old
+ new

@@ -8,10 +8,14 @@ } attr_reader :environment, :preprocessor def initialize(options = {}) + reset!(options) + end + + def reset!(options = @options) @options = DEFAULT_OPTIONS.merge(options) @environment = Sprockets::Environment.new(@options[:root]) @preprocessor = Sprockets::Preprocessor.new(@environment) add_load_locations(@options[:load_path]) @@ -40,19 +44,23 @@ raise Sprockets::LoadError, "no such file `#{source_file}'" end end end - def output_file - preprocessor.output_file + def concatenation + preprocessor.concatenation end def install_assets if @options[:asset_root] preprocessor.asset_paths.each do |asset_path| copy_assets_from(asset_path.absolute_location) end end + end + + def source_last_modified + preprocessor.source_files.map { |s| s.mtime }.max end protected def expand_paths(paths, options = {}) if options.has_key?(:expand_paths) ? options[:expand_paths] : @options[:expand_paths]