Class: Richcss::Generators::Template
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- Richcss::Generators::Template
- Includes:
- Thor::Actions
- Defined in:
- lib/richcss/generators.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.source_root ⇒ Object
9 10 11 |
# File 'lib/richcss/generators.rb', line 9 def self.source_root File.dirname(__FILE__) + "/generator" end |
Instance Method Details
#create_css_files ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/richcss/generators.rb', line 26 def create_css_files # TODO: add choice of CSS or SCSS files to generate # TODO: Make it not hardcode box/elements extension = ".css" # extension = ".css.scss" @boxFiles.each do |filename| create_file "box/#{filename}#{extension}" unless File.file?("box/#{filename}#{extension}") end @elementFiles.each do |filename| create_file "elements/#{filename}#{extension}" unless File.file?("elements/#{filename}#{extension}") end end |
#create_folders ⇒ Object
20 21 22 23 24 |
# File 'lib/richcss/generators.rb', line 20 def create_folders @groups.each do |g| empty_directory("#{g}") unless Dir.exists?("#{g}") end end |
#create_partfile ⇒ Object
40 41 42 |
# File 'lib/richcss/generators.rb', line 40 def create_partfile create_file "parts/Partfile" unless File.file?("parts/Partfile") end |
#init ⇒ Object
13 14 15 16 17 18 |
# File 'lib/richcss/generators.rb', line 13 def init @groups = ['box', 'elements', 'parts'] @boxFiles = ['blocks', 'main', 'positioning'] @elementFiles = ['button', 'colors', 'features', 'fonts', 'images', 'inputs', 'lists'] @partFiles = ['Partfile'] end |