Module: Card::Set::Type::BootswatchSkin

Extended by:
Card::Set
Defined in:
platypus/tmp/set/gem-defaults/mod024-bootstrap/type/bootswatch_skin.rb,
platypus/tmp/set/gem-defaults/mod024-bootstrap/type/bootswatch_skin/events.rb,
platypus/tmp/set/gem-defaults/mod024-bootstrap/type/bootswatch_skin/html_views.rb

Overview

  • variables: variables from the bootswatch them and (where applicable) user-customized

Defined Under Namespace

Modules: Events, HtmlFormat, HtmlViews

Constant Summary collapse

CONTENT_PARTS =
%i[pre_variables variables post_variables stylesheets].freeze
PRE_VARIABLES_CARD_NAMES =
%i[bootstrap_functions].freeze
POST_VARIABLES_CARD_NAMES =
%i[bootstrap_core style_mods].freeze

Constants included from Helpers

Helpers::SET_PATTERN_TEST_REGEXP

Constants included from Event::Api

Event::Api::OPTIONS

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Card::Set

reset

Methods included from I18nScope

#mod_name, #scope

Methods included from Registrar

#extended, #finalize_load, #process_base_modules, #register_set

Methods included from Helpers

#format_module, #format_modules, #method_missing, #modules, #pattern_code, #respond_to_missing?, #set_name_parts, #shortname, #underscored_name

Methods included from AdvancedApi

#assign_type, #attachment, #define_set_from_error, #ensure_set, #setting_opts, #stage_method

Methods included from Format

#before, #format, layout_method_name, #view, view_method_name, view_setting_method_name, wrapper_method_name

Methods included from Inheritance

#include_set, #include_set_formats

Methods included from Card::Set::Trait

#card_accessor, #card_reader, #card_writer, #require_field

Methods included from Event::Api

#event

Class Method Details

.source_locationObject



20
# File 'platypus/tmp/set/gem-defaults/mod024-bootstrap/type/bootswatch_skin.rb', line 20

def self.source_location; "/Users/ethan/dev/decko/gem/mod/bootstrap/set/type/bootswatch_skin.rb"; end

Instance Method Details

#contentObject



51
52
53
54
55
# File 'platypus/tmp/set/gem-defaults/mod024-bootstrap/type/bootswatch_skin.rb', line 51

def content
  CONTENT_PARTS.map do |n|
    send "#{n}_content"
  end.join "\n"
end

#content_from_theme(field) ⇒ Object



98
99
100
# File 'platypus/tmp/set/gem-defaults/mod024-bootstrap/type/bootswatch_skin.rb', line 98

def content_from_theme field
  theme_card&.scss_from_theme_file field
end

#editable_item_cardsObject



86
87
88
# File 'platypus/tmp/set/gem-defaults/mod024-bootstrap/type/bootswatch_skin.rb', line 86

def editable_item_cards
  [colors_card, variables_card, stylesheets_card]
end

#item_names(_args = {}) ⇒ Object



57
58
59
60
61
62
# File 'platypus/tmp/set/gem-defaults/mod024-bootstrap/type/bootswatch_skin.rb', line 57

def item_names _args={}
  (PRE_VARIABLES_CARD_NAMES + variables_card_names +
    POST_VARIABLES_CARD_NAMES + stylesheets_card_names).compact.map do |n|
    Codename.name n
  end.compact
end

#parent?Boolean

Returns:

  • (Boolean)


64
65
66
# File 'platypus/tmp/set/gem-defaults/mod024-bootstrap/type/bootswatch_skin.rb', line 64

def parent?
  parent_skin_card&.real?
end

#read_bootstrap_variablesObject



102
103
104
105
106
# File 'platypus/tmp/set/gem-defaults/mod024-bootstrap/type/bootswatch_skin.rb', line 102

def read_bootstrap_variables
  ::File.read ::File.expand_path(
    "#{mod_path :bootstrap}/vendor/bootstrap/scss/_variables.scss"
  )
end

#scss_from_theme_file(file) ⇒ Object



81
82
83
84
# File 'platypus/tmp/set/gem-defaults/mod024-bootstrap/type/bootswatch_skin.rb', line 81

def scss_from_theme_file file
  path = ::File.join source_dir, "_#{file}.scss"
  path && ::File.exist?(path) ? ::File.read(path) : ""
end

#stylesheets_card_namesObject



94
95
96
# File 'platypus/tmp/set/gem-defaults/mod024-bootstrap/type/bootswatch_skin.rb', line 94

def stylesheets_card_names
  [[name, :stylesheets].cardname]
end

#theme_cardObject



72
73
74
75
# File 'platypus/tmp/set/gem-defaults/mod024-bootstrap/type/bootswatch_skin.rb', line 72

def theme_card
  @theme_card ||=
    parent? && parent_skin_card.id != id ? parent_skin_card.theme_card : self
end

#theme_codenameObject



77
78
79
# File 'platypus/tmp/set/gem-defaults/mod024-bootstrap/type/bootswatch_skin.rb', line 77

def theme_codename
  theme_card.codename
end

#theme_nameObject



68
69
70
# File 'platypus/tmp/set/gem-defaults/mod024-bootstrap/type/bootswatch_skin.rb', line 68

def theme_name
  theme_codename.to_s.sub(/_skin$/, "")
end

#variables_card_namesObject



90
91
92
# File 'platypus/tmp/set/gem-defaults/mod024-bootstrap/type/bootswatch_skin.rb', line 90

def variables_card_names
  %i[colors variables].map { |s| [name, s].cardname }
end