Class: Opsk::Commit

Inherits:
Thor::Group
  • Object
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

#commitObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/opskeleton/commit.rb', line 11

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
    puts "Changes found for #{d}:\n\n"
    puts "#{g.show}\n"
    g.checkout('master')
    if options['message']
g.commit_all(options['message']) 
    else 
puts 'Please provide commit message:'
g.commit_all(STDIN.gets.chomp) 
    end
 end
    end
  end
end

#validateObject



7
8
9
# File 'lib/opskeleton/commit.rb', line 7

def validate
  check_root
end