Class: JekyllGenerator::ThemeGeneratorBase

Inherits:
RubiGen::Base
  • Object
show all
Defined in:
lib/jekyll_generator/theme_generator_base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(runtime_args, runtime_options = {}) ⇒ ThemeGeneratorBase

Returns a new instance of ThemeGeneratorBase.



8
9
10
11
12
13
14
15
16
# File 'lib/jekyll_generator/theme_generator_base.rb', line 8

def initialize(runtime_args, runtime_options = {})
  super
  config_options = YAML.load(File.read(File.join(destination_root, "config.yml")))
  config_options.each do |key, value|
    self.send(:instance_variable_set, "@#{key}", value)
  end
  
  @hypenated_name = @name.gsub(/_/, '-')
end

Instance Attribute Details

#authorObject (readonly)

these values are automatically setup by the config.yml file generated from jekyll_generator_generator.rb based on options/defaults



5
6
7
# File 'lib/jekyll_generator/theme_generator_base.rb', line 5

def author
  @author
end

#emailObject (readonly)

these values are automatically setup by the config.yml file generated from jekyll_generator_generator.rb based on options/defaults



5
6
7
# File 'lib/jekyll_generator/theme_generator_base.rb', line 5

def email
  @email
end

#github_userObject (readonly)

these values are automatically setup by the config.yml file generated from jekyll_generator_generator.rb based on options/defaults



5
6
7
# File 'lib/jekyll_generator/theme_generator_base.rb', line 5

def github_user
  @github_user
end

#header_colorObject (readonly)

these values are automatically setup by the config.yml file generated from jekyll_generator_generator.rb based on options/defaults



5
6
7
# File 'lib/jekyll_generator/theme_generator_base.rb', line 5

def header_color
  @header_color
end

#hypenated_nameObject (readonly)

Returns the value of attribute hypenated_name.



6
7
8
# File 'lib/jekyll_generator/theme_generator_base.rb', line 6

def hypenated_name
  @hypenated_name
end

#nameObject (readonly)

these values are automatically setup by the config.yml file generated from jekyll_generator_generator.rb based on options/defaults



5
6
7
# File 'lib/jekyll_generator/theme_generator_base.rb', line 5

def name
  @name
end

#themeObject (readonly)

these values are automatically setup by the config.yml file generated from jekyll_generator_generator.rb based on options/defaults



5
6
7
# File 'lib/jekyll_generator/theme_generator_base.rb', line 5

def theme
  @theme
end

#titleObject (readonly)

these values are automatically setup by the config.yml file generated from jekyll_generator_generator.rb based on options/defaults



5
6
7
# File 'lib/jekyll_generator/theme_generator_base.rb', line 5

def title
  @title
end

Instance Method Details

#manifestObject



18
19
20
21
22
23
24
25
26
27
# File 'lib/jekyll_generator/theme_generator_base.rb', line 18

def manifest
  record do |m|
    # Ensure appropriate folder(s) exists
    m.directory '_layouts'
    m.directory 'css'

    m.template_copy_each ["default.html", "post.html"], "_layouts"
    m.template_copy_each ["stylesheet.css"], "css"
  end
end