module Nucleon::Mixin::Action::Commit

Public Instance Methods

commit(project, files = '.') click to toggle source
   # File lib/core/mixin/action/commit.rb
41 def commit(project, files = '.')
42   success = true
43 
44   if project && settings[:commit]
45     success = project.commit(files, extended_config(:commit, {
46       :allow_empty => settings[:allow_empty],
47       :message     => settings[:message],
48       :author      => settings[:author],
49       :propogate   => settings[:propogate_commit]
50     }))
51   end
52   success
53 end
commit_config(optional = true) click to toggle source
   # File lib/core/mixin/action/commit.rb
10 def commit_config(optional = true)
11 
12   if optional
13     register_bool :commit, :false, 'nucleon.core.mixin.action.commit.options.commit'
14   else
15     settings[:commit] = true
16   end
17 
18   register_bool :allow_empty, true, 'nucleon.mixin.core.action.commit.options.allow_empty'
19   register_bool :propogate_commit, false, 'nucleon.core.mixin.action.commit.options.propogate_commit'
20 
21   register_str :message, '', 'nucleon.core.mixin.action.commit.options.message'
22 
23   register_str :author, nil, 'nucleon.core.mixin.action.commit.options.author' do |value|
24     if value.nil? || value.strip =~ /^[A-Za-z\s]+<\s*[^@]+@[^>]+\s*>$/
25       next true
26     end
27     warn('nucleon.core.mixin.action.commit.errors.author', { :value => value })
28     false
29   end
30 end
commit_ignore() click to toggle source
   # File lib/core/mixin/action/commit.rb
34 def commit_ignore
35   [ :commit, :allow_empty, :propogate_commit, :message, :author ]
36 end