Skip to content

Commit

Permalink
Pass raw params to less parser
Browse files Browse the repository at this point in the history
close #94
  • Loading branch information
ilyapoz authored and simi committed Apr 9, 2016
1 parent 989bf20 commit cefd7aa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/less/rails/railtie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class Railtie < ::Rails::Railtie
config.less = ActiveSupport::OrderedOptions.new
config.less.paths = []
config.less.compress = false
config.less.raw = ActiveSupport::OrderedOptions.new
config.app_generators.stylesheet_engine :less

config.before_initialize do |app|
Expand Down
6 changes: 5 additions & 1 deletion lib/less/rails/template_handlers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def config_to_less_parser_options(scope)
paths = config_paths(scope) + scope.environment.paths
local_path = scope.pathname.dirname
paths += [local_path] unless paths.include? local_path
{:filename => eval_file, :line => line, :paths => paths, :dumpLineNumbers => config_from_rails(scope).line_numbers}
{:filename => eval_file, :line => line, :paths => paths, :dumpLineNumbers => config_from_rails(scope).line_numbers}.merge(config_raw(scope))
end

def config_to_css_options(scope)
Expand All @@ -36,6 +36,10 @@ def config_to_css_options(scope)
def config_paths(scope)
config_from_rails(scope)[:paths]
end

def config_raw(scope)
config_from_rails(scope)[:raw]
end

def config_from_rails(scope)
scope.environment.context_class.less_config
Expand Down

0 comments on commit cefd7aa

Please sign in to comment.