Module: Card::Set::Abstract::BootstrapCodeFile::OverrideCodeFile

Defined in:
platypus/tmp/set/gem-defaults/mod024-bootstrap/abstract/bootstrap_code_file.rb

Overview

method overrides wrt bootstrap codefile

Instance Method Summary collapse

Instance Method Details

#add_bs_stylesheet(filename, type: :scss, subdir: nil) ⇒ Object



48
49
50
51
# File 'platypus/tmp/set/gem-defaults/mod024-bootstrap/abstract/bootstrap_code_file.rb', line 48

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



26
27
28
29
30
# File 'platypus/tmp/set/gem-defaults/mod024-bootstrap/abstract/bootstrap_code_file.rb', line 26

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



40
41
42
# File 'platypus/tmp/set/gem-defaults/mod024-bootstrap/abstract/bootstrap_code_file.rb', line 40

def add_stylesheet filename, type: :scss
  load_from_path "#{mod_root}/lib/stylesheets/#{filename}.#{type}"
end

#add_stylesheet_file(path) ⇒ Object



44
45
46
# File 'platypus/tmp/set/gem-defaults/mod024-bootstrap/abstract/bootstrap_code_file.rb', line 44

def add_stylesheet_file path
  load_from_path File.join(mod_root, path)
end

#bootstrap_pathObject



36
37
38
# File 'platypus/tmp/set/gem-defaults/mod024-bootstrap/abstract/bootstrap_code_file.rb', line 36

def bootstrap_path
  "#{mod_root}/vendor/bootstrap/scss"
end

#contentObject



17
18
19
# File 'platypus/tmp/set/gem-defaults/mod024-bootstrap/abstract/bootstrap_code_file.rb', line 17

def content
  stylesheets.join "\n"
end

#existing_source_pathsObject



63
64
65
# File 'platypus/tmp/set/gem-defaults/mod024-bootstrap/abstract/bootstrap_code_file.rb', line 63

def existing_source_paths
  []
end

#load_from_path(path) ⇒ Object



53
54
55
56
57
# File 'platypus/tmp/set/gem-defaults/mod024-bootstrap/abstract/bootstrap_code_file.rb', line 53

def load_from_path path
  @stylesheets ||= []
  Rails.logger.debug "reading file: #{path}"
  @stylesheets << File.read(path)
end

#mod_rootObject



32
33
34
# File 'platypus/tmp/set/gem-defaults/mod024-bootstrap/abstract/bootstrap_code_file.rb', line 32

def mod_root
  mod_path :bootstrap
end

#source_changed(_since:) ⇒ Object



59
60
61
# File 'platypus/tmp/set/gem-defaults/mod024-bootstrap/abstract/bootstrap_code_file.rb', line 59

def source_changed _since:
  false
end

#stylesheetsObject



21
22
23
24
# File 'platypus/tmp/set/gem-defaults/mod024-bootstrap/abstract/bootstrap_code_file.rb', line 21

def stylesheets
  load_stylesheets unless @stylesheets
  @stylesheets
end