Class: Jekyll::ThemeBuilder
- Inherits:
-
Object
- Object
- Jekyll::ThemeBuilder
- Defined in:
- lib/jekyll/theme_builder.rb
Defined Under Namespace
Classes: ERBRenderer
Constant Summary collapse
- SCAFFOLD_DIRECTORIES =
%w( assets _data _layouts _includes _sass ).freeze
Instance Attribute Summary collapse
-
#code_of_conduct ⇒ Object
readonly
Returns the value of attribute code_of_conduct.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #create! ⇒ Object
-
#initialize(theme_name, opts) ⇒ ThemeBuilder
constructor
A new instance of ThemeBuilder.
- #user_email ⇒ Object
- #user_name ⇒ Object
Constructor Details
#initialize(theme_name, opts) ⇒ ThemeBuilder
Returns a new instance of ThemeBuilder.
11 12 13 14 15 |
# File 'lib/jekyll/theme_builder.rb', line 11 def initialize(theme_name, opts) @name = theme_name.to_s.tr(" ", "_").squeeze("_") @path = Pathname.new(File.(name, Dir.pwd)) @code_of_conduct = !!opts["code_of_conduct"] end |
Instance Attribute Details
#code_of_conduct ⇒ Object (readonly)
Returns the value of attribute code_of_conduct.
9 10 11 |
# File 'lib/jekyll/theme_builder.rb', line 9 def code_of_conduct @code_of_conduct end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
9 10 11 |
# File 'lib/jekyll/theme_builder.rb', line 9 def name @name end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
9 10 11 |
# File 'lib/jekyll/theme_builder.rb', line 9 def path @path end |
Instance Method Details
#create! ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/jekyll/theme_builder.rb', line 17 def create! create_directories create_starter_files create_gemspec create_accessories initialize_git_repo end |
#user_email ⇒ Object
29 30 31 |
# File 'lib/jekyll/theme_builder.rb', line 29 def user_email @user_email ||= `git config user.email`.chomp end |
#user_name ⇒ Object
25 26 27 |
# File 'lib/jekyll/theme_builder.rb', line 25 def user_name @user_name ||= `git config user.name`.chomp end |