Module: HappyCommit
- Includes:
- OnCommit
- Defined in:
- lib/happy-commit.rb,
lib/happy-commit/on_commit.rb
Defined Under Namespace
Modules: OnCommit
Class Method Summary collapse
Methods included from OnCommit
Class Method Details
.install ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/happy-commit.rb', line 11 def self.install if File.exist?(self.hooks_path) FileUtils.mkpath(self.sounds_path) self.sounds.each_with_index do |sound, i| FileUtils.cp(sound, self.sounds_path+"/#{i}.wav") end File.open(self.post_commit_path, "w") do |f| f << File.read(File.("../happy-commit/hook.rb", __FILE__)) end FileUtils.chmod(0755, self.post_commit_path) end end |
.sounds ⇒ Object
7 8 9 |
# File 'lib/happy-commit.rb', line 7 def self.sounds @sounds ||= Dir.glob(File.dirname(__FILE__)+"/../sounds/*.wav") end |