Sha256: 1fb50b43876814fbb91016a849385c1145c5dcf32b1a49e7b6c7fa097d7da563

Contents?: true

Size: 1.42 KB

Versions: 1

Compression:

Stored size: 1.42 KB

Contents

module Nucleon
module Mixin
module Action
module Commit
        
  #-----------------------------------------------------------------------------
  # Options
        
  def commit_options(parser, optional = true)
    if optional
      parser.option_bool(:commit, false, 
        '--commit', 
        'nucleon.core.mixins.commit.options.commit'
      )
    else
      parser.options[:commit] = true
    end
         
    parser.option_bool(:allow_empty, false,
      '--empty', 
      'nucleon.core.mixins.commit.options.empty'
    )
    parser.option_bool(:propogate, false,
      '--propogate', 
      'nucleon.core.mixins.commit.options.propogate'
    )          
    parser.option_str(:message, '',
      '--message COMMIT_MESSAGE',  
      'nucleon.core.mixins.commit.options.message'
    )
    parser.option_str(:author, nil,
      '--author COMMIT_AUTHOR',  
      'nucleon.core.mixins.commit.options.author'
    )         
  end
        
  #-----------------------------------------------------------------------------
  # Operations
        
  def commit(project, files = '.')
    success = true
          
    if project && settings[:commit]
      success = project.commit(files, extended_config(:commit, {
        :allow_empty => settings[:allow_empty],
        :message     => settings[:message],
        :author      => settings[:author],
        :propogate   => settings[:propogate]
      }))
    end
    success
  end
end
end
end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nucleon-0.1.1 lib/core/mixin/action/commit.rb