Module: StaticCms::Commands
- Extended by:
- RubyPatch::AutoLoad
- Defined in:
- lib/static_cms/commands.rb
Constant Summary collapse
- SITE_TEMPLATE_DIR =
File.join(__DIR__, '..', '..', 'data', 'site_template')
Class Method Summary collapse
Class Method Details
.init(dir = '.') ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/static_cms/commands.rb', line 8 def self.init(dir = '.') FileUtils.mkdir_p(dir) success = false FileUtils.cd(dir){|dir| success = ::StaticCms::Helpers.puts_system "git init > \#{File::NULL}\ngit commit --allow-empty -m 'Empty commit.' > \#{File::NULL}\ncp -r \#{File.join(SITE_TEMPLATE_DIR, '*')} . > \#{File::NULL}\ngit add . > \#{File::NULL}\ngit commit -m 'Copied from site template.' > \#{File::NULL}\n EOS\n }\n\n success\nend\n" |
.update(dir = '.') ⇒ Object
24 25 26 27 28 29 30 31 |
# File 'lib/static_cms/commands.rb', line 24 def self.update(dir = '.') FileUtils.cp_r(File.join(SITE_TEMPLATE_DIR, 'templates'), dir) FileUtils.cp_r(File.join(SITE_TEMPLATE_DIR, 'sources'), dir) FileUtils.cp_r(File.join(SITE_TEMPLATE_DIR, 'statics'), dir) FileUtils.cp(File.join(SITE_TEMPLATE_DIR, 'rakefile'), dir) true end |