Class: Locomotive::Wagon::CLI::Generate
- Includes:
- CheckPath, ForceColor
- Defined in:
- lib/locomotive/wagon/cli.rb
Instance Method Summary collapse
- #content_type(name, *fields) ⇒ Object
- #page(fullpath) ⇒ Object
- #public_form ⇒ Object
- #relationship(source, type, target) ⇒ Object
- #section(slug, *settings) ⇒ Object
- #site_metafields ⇒ Object
- #snippet(slug) ⇒ Object
- #webpack ⇒ Object
Methods included from ForceColor
Instance Method Details
#content_type(name, *fields) ⇒ Object
78 79 80 81 82 83 84 85 86 |
# File 'lib/locomotive/wagon/cli.rb', line 78 def content_type(name, *fields) force_color_if_asked() say('The fields are missing', :red) and return false if fields.empty? if path = check_path! Locomotive::Wagon.generate :content_type, [name, fields, path], self. end end |
#page(fullpath) ⇒ Object
125 126 127 128 129 130 131 132 |
# File 'lib/locomotive/wagon/cli.rb', line 125 def page(fullpath) force_color_if_asked() if path = check_path! self.[:default_locales] = self.site_config(path)['locales'] Locomotive::Wagon.generate :page, [fullpath, path], self. end end |
#public_form ⇒ Object
171 172 173 174 175 176 177 |
# File 'lib/locomotive/wagon/cli.rb', line 171 def public_form force_color_if_asked() if path = check_path! Locomotive::Wagon.generate :public_form, [path], self. end end |
#relationship(source, type, target) ⇒ Object
103 104 105 106 107 108 109 |
# File 'lib/locomotive/wagon/cli.rb', line 103 def relationship(source, type, target) force_color_if_asked() if path = check_path! Locomotive::Wagon.generate :relationship, [source, type, target, path], self. end end |
#section(slug, *settings) ⇒ Object
162 163 164 165 166 167 168 |
# File 'lib/locomotive/wagon/cli.rb', line 162 def section(slug, *settings) force_color_if_asked() if path = check_path! Locomotive::Wagon.generate :section, [slug, settings, path], self. end end |
#site_metafields ⇒ Object
180 181 182 183 184 185 186 |
# File 'lib/locomotive/wagon/cli.rb', line 180 def force_color_if_asked() if path = check_path! Locomotive::Wagon.generate :site_metafields, [path], self. end end |
#snippet(slug) ⇒ Object
142 143 144 145 146 147 148 149 |
# File 'lib/locomotive/wagon/cli.rb', line 142 def snippet(slug) force_color_if_asked() if path = check_path! locales = self.site_config(path)['locales'] Locomotive::Wagon.generate :snippet, [slug, locales, path], self. end end |
#webpack ⇒ Object
189 190 191 192 193 194 195 |
# File 'lib/locomotive/wagon/cli.rb', line 189 def webpack force_color_if_asked() if path = check_path! Locomotive::Wagon.generate :webpack, [path], self. end end |