Class: Opsk::Commit
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- Opsk::Commit
show all
- Includes:
- Thorable, Thor::Actions
- Defined in:
- lib/opskeleton/commit.rb
Instance Method Summary
collapse
Methods included from Thorable
#artifact, #artifact_path, #check_root, included, #machines, #meta, #name, #type_of
Instance Method Details
#commit ⇒ Object
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
# File 'lib/opskeleton/commit.rb', line 23
def commit
Dir["modules/*"].reject{|o| not File.directory?(o)}.each do |d|
if File.exists?("#{d}/.git")
g = Git.init(d)
if g.status.changed.keys.length > 0
say "Listing changes for #{d}:\n\n"
report(g)
resp = yes? "Commit the changes under #{d}? (y/n)" unless options['all']
if(options['all'] or resp)
g.checkout('master')
if options['message']
g.commit_all(options['message'])
else
say 'Commit message:'
g.commit_all(STDIN.gets.chomp)
end
end
end
end
end
end
|
#validate ⇒ Object
18
19
20
|
# File 'lib/opskeleton/commit.rb', line 18
def validate
check_root
end
|