Module: Card::Set::Abstract::BootstrapCodeFile::OverrideCodeFile
- Defined in:
- platypus/tmp/set/gem-defaults/mod024-bootstrap/abstract/bootstrap_code_file.rb
Instance Method Summary collapse
-
#add_bs_stylesheet(filename, type: :scss, subdir: nil) ⇒ Object
-
#add_bs_subdir(sub_dir) ⇒ Object
-
#add_stylesheet(filename, type: :scss) ⇒ Object
-
#add_stylesheet_file(path) ⇒ Object
-
#bootstrap_path ⇒ Object
-
#content ⇒ Object
-
#existing_source_paths ⇒ Object
-
#load_from_path(path) ⇒ Object
-
#mod_root ⇒ Object
-
#source_changed(_since:) ⇒ Object
-
#stylesheets ⇒ Object
Instance Method Details
#add_bs_stylesheet(filename, type: :scss, subdir: nil) ⇒ Object
47 48 49 50 |
# File 'platypus/tmp/set/gem-defaults/mod024-bootstrap/abstract/bootstrap_code_file.rb', line 47 def add_bs_stylesheet filename, type: :scss, subdir: nil path = File.join(*[bootstrap_path, subdir, "_#{filename}.#{type}"].compact) load_from_path path end |
#add_bs_subdir(sub_dir) ⇒ Object
25 26 27 28 29 |
# File 'platypus/tmp/set/gem-defaults/mod024-bootstrap/abstract/bootstrap_code_file.rb', line 25 def add_bs_subdir sub_dir Dir.glob("#{bootstrap_path}/#{sub_dir}/*.scss").each do |path| load_from_path path end end |
#add_stylesheet(filename, type: :scss) ⇒ Object
39 40 41 |
# File 'platypus/tmp/set/gem-defaults/mod024-bootstrap/abstract/bootstrap_code_file.rb', line 39 def add_stylesheet filename, type: :scss load_from_path "#{mod_root}/lib/stylesheets/#{filename}.#{type}" end |
#add_stylesheet_file(path) ⇒ Object
43 44 45 |
# File 'platypus/tmp/set/gem-defaults/mod024-bootstrap/abstract/bootstrap_code_file.rb', line 43 def add_stylesheet_file path load_from_path File.join(mod_root, path) end |
#bootstrap_path ⇒ Object
35 36 37 |
# File 'platypus/tmp/set/gem-defaults/mod024-bootstrap/abstract/bootstrap_code_file.rb', line 35 def bootstrap_path "#{mod_root}/vendor/bootstrap/scss" end |
#content ⇒ Object
16 17 18 |
# File 'platypus/tmp/set/gem-defaults/mod024-bootstrap/abstract/bootstrap_code_file.rb', line 16 def content stylesheets.join "\n" end |
#existing_source_paths ⇒ Object
62 63 64 |
# File 'platypus/tmp/set/gem-defaults/mod024-bootstrap/abstract/bootstrap_code_file.rb', line 62 def existing_source_paths [] end |
#load_from_path(path) ⇒ Object
52 53 54 55 56 |
# File 'platypus/tmp/set/gem-defaults/mod024-bootstrap/abstract/bootstrap_code_file.rb', line 52 def load_from_path path @stylesheets ||= [] Rails.logger.debug "reading file: #{path}" @stylesheets << File.read(path) end |
#mod_root ⇒ Object
31 32 33 |
# File 'platypus/tmp/set/gem-defaults/mod024-bootstrap/abstract/bootstrap_code_file.rb', line 31 def mod_root mod_path :bootstrap end |
#source_changed(_since:) ⇒ Object
58 59 60 |
# File 'platypus/tmp/set/gem-defaults/mod024-bootstrap/abstract/bootstrap_code_file.rb', line 58 def source_changed _since: false end |
#stylesheets ⇒ Object
20 21 22 23 |
# File 'platypus/tmp/set/gem-defaults/mod024-bootstrap/abstract/bootstrap_code_file.rb', line 20 def stylesheets load_stylesheets unless @stylesheets @stylesheets end |