Bones::App::Freeze

Public Class Methods

initialize_freeze() click to toggle source
    # File lib/bones/app/freeze.rb, line 5
 5:   def self.initialize_freeze
 6:     synopsis 'bones freeze [options] [skeleton_name]'
 7: 
 8:     summary 'create a new skeleton in ~/.mrbones/'
 9: 
10:     description Freeze the project skeleton to the current Mr Bones project skeleton.If a name is not given, then the default name "default" will be used.Optionally a git or svn repository can be frozen as the projectskeleton.
11: 
12:     option(standard_options[:repository])
13:     option(standard_options[:verbose])
14:   end

Public Instance Methods

freeze_to_repository() click to toggle source

Freeze the project skeleton to the git or svn repository that the user passed in on the command line. This essentially creates an alias to the reposiory using the name passed in on the command line.

    # File lib/bones/app/freeze.rb, line 49
49:   def freeze_to_repository
50:     FileUtils.mkdir_p(File.dirname(output_dir))
51:     File.open(output_dir, 'w') {|fd| fd.puts repository}
52:     stdout.puts "Project skeleton #{name.inspect} " <<
53:                 "has been frozen to #{repository.inspect}"
54:   end
parse( args ) click to toggle source
    # File lib/bones/app/freeze.rb, line 39
39:   def parse( args )
40:     opts = super args
41:     config[:name] = args.empty? ? DEFAULT_SKELETON : args.join('_')
42:     config[:output_dir] = File.join(mrbones_dir, name)
43:   end
run() click to toggle source
    # File lib/bones/app/freeze.rb, line 21
21:   def run
22:     fm = FileManager.new(
23:       :source => repository || ::Bones.path(DEFAULT_SKELETON),
24:       :destination => output_dir,
25:       :stdout => stdout,
26:       :stderr => stderr,
27:       :verbose => verbose?
28:     )
29: 
30:     fm.archive_destination
31:     return freeze_to_repository if repository
32: 
33:     fm.copy
34: 
35:     stdout.puts "Project skeleton #{name.inspect} " <<
36:                 "has been frozen to Mr Bones #{::Bones.version}"
37:   end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.