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

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

Instance Method Summary collapse

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_pathObject



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

#contentObject



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_pathsObject



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_rootObject



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

#stylesheetsObject



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