class Sutty::Cli::Commands::Theme
Attributes
name[R]
Public Class Methods
new(name, options)
click to toggle source
# File lib/sutty/cli/commands/theme.rb 12 def initialize(name, options) 13 @name = name 14 @options = options 15 end
Public Instance Methods
execute(input: $stdin, output: $stdout)
click to toggle source
# File lib/sutty/cli/commands/theme.rb 17 def execute(input: $stdin, output: $stdout) 18 cmd.run('git clone https://0xacab.org/sutty/jekyll/sutty-base-jekyll-theme.git', theme_name) 19 20 Dir.chdir theme_name do 21 cmd.run('git remote rename origin upstream') 22 cmd.run('git remote add origin', origin) 23 cmd.run('git push -u origin master') 24 cmd.run('bundle install') 25 cmd.run('yarn install') 26 cmd.run('git mv sutty-base-jekyll-theme.gemspec', gemspec) 27 end 28 end
Private Instance Methods
cmd()
click to toggle source
# File lib/sutty/cli/commands/theme.rb 44 def cmd 45 @cmd ||= TTY::Command.new 46 end
gemspec()
click to toggle source
# File lib/sutty/cli/commands/theme.rb 40 def gemspec 41 @gemspec ||= theme_name + '.gemspec' 42 end
origin()
click to toggle source
# File lib/sutty/cli/commands/theme.rb 36 def origin 37 @origin ||= 'git@0xacab.org:sutty/jekyll/' + theme_name + '.git' 38 end
theme_name()
click to toggle source
# File lib/sutty/cli/commands/theme.rb 32 def theme_name 33 @theme_name ||= name + '-jekyll-theme' 34 end