Class: CG::Rebuild
- Inherits:
-
Object
- Object
- CG::Rebuild
- Defined in:
- lib/cg/rebuild.rb
Class Method Summary collapse
Instance Method Summary collapse
- #convert_all ⇒ Object
- #display(message) ⇒ Object
-
#initialize ⇒ Rebuild
constructor
A new instance of Rebuild.
- #packaging ⇒ Object
- #start ⇒ Object
Constructor Details
#initialize ⇒ Rebuild
9 10 11 |
# File 'lib/cg/rebuild.rb', line 9 def initialize @packaging = ARGV.first || false end |
Class Method Details
.start! ⇒ Object
13 14 15 |
# File 'lib/cg/rebuild.rb', line 13 def self.start! new.start end |
Instance Method Details
#convert_all ⇒ Object
28 29 30 31 32 |
# File 'lib/cg/rebuild.rb', line 28 def convert_all Dir.glob('markdown/*.mkd').each do |file| CG::Convert.start! file end end |
#display(message) ⇒ Object
40 41 42 |
# File 'lib/cg/rebuild.rb', line 40 def display() puts "#{message} #{Time.now.to_s}" end |
#packaging ⇒ Object
34 35 36 37 38 |
# File 'lib/cg/rebuild.rb', line 34 def packaging display ' Packing Start.' display `tar zcvf public.tar.gz -X .exclude *` display ' Packing End.' end |
#start ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/cg/rebuild.rb', line 17 def start display 'Rebuild Start.' begin convert_all packaging if @packaging == 'packing' rescue display 'Rebuild Faild.' end display 'Rebuild Success.' end |