lib/bemer/configuration.rb in bemer-0.1.0 vs lib/bemer/configuration.rb in bemer-0.2.0
- old
+ new
@@ -1,8 +1,9 @@
# frozen_string_literal: true
require 'singleton'
+require 'rails'
module Bemer
class Configuration
include Singleton
@@ -15,10 +16,11 @@
alias can_use_new_matcher? can_use_new_matcher
def initialize # rubocop:disable Metrics/MethodLength
@asset_paths = []
@bem = false
+ # Gem::Version.new('0.4.1') > Gem::Version.new('0.10.1')
@can_use_new_matcher = RUBY_VERSION >= '2.4.0'
@default_block_tag = :div
@default_element_tag = :div
@default_path_prefix = nil
@element_name_separator = '__'
@@ -28,9 +30,9 @@
@paths = []
@prepend_asset_paths = true
end
def path
- Rails.root.join(@path)
+ Rails.root ? Rails.root.join(@path) : @path
end
end
end