gitshot 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: ec936dd8c2ea20e43271277ef2dedc0cd3d77210
4
+ data.tar.gz: ed1a7700d80fb17b8e088622f8b48dc66eba9db5
5
+ SHA512:
6
+ metadata.gz: e63647ca5d1b82e26b31d81102e01714b84c6eddf3b9f260ea3b6ece25771475e2bdff4c3569b3d1d2fe493f3e07bd152b9300a605279c93506df0121e5a0bbc
7
+ data.tar.gz: 13fa282b68975dc8eece8ff3f982fe876af81b77545cb1a2b4c8013713a96a14376bac550f2342795bf4a8665c5533e057c55dfacbb041621264af52ea6400a1
data/bin/gitshot ADDED
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'gitshot'
4
+
5
+ if ARGV[0] != "install"
6
+ puts "Usage: gitshot install"
7
+ exit(1)
8
+ end
9
+
10
+ if !File.exists?(".git")
11
+ puts "No .git directory found."
12
+ exit(1)
13
+ end
14
+
15
+ Gitshot::Hook.new.install
16
+ puts "Gitshot installed #{Gitshot::Hook::POST_COMMIT_HOOK_PATH}"
data/lib/gitshot.rb ADDED
@@ -0,0 +1,13 @@
1
+ require 'fileutils'
2
+
3
+ module Gitshot
4
+ class Hook
5
+ POST_COMMIT_HOOK_PATH = '.git/hooks/post-commit'
6
+
7
+ def install
8
+ hook_template = File.expand_path("../gitshot/hooks/post-commit-template", __FILE__)
9
+ FileUtils.cp(hook_template, POST_COMMIT_HOOK_PATH)
10
+ FileUtils.chmod(0755, POST_COMMIT_HOOK_PATH)
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env ruby
2
+ puts "[Cheese!]"
3
+
4
+ # Get some info about current commit
5
+ repository_name = `basename "$PWD"`.chop
6
+ commit_hash, commit_date = `git log -1 --pretty="%H%n%ci"`.split(/\r?\n/)
7
+
8
+ # Capture image and save it to ~/Pictures/gitshots/REPOSITORYNAME-TIMESTAMP-COMMITHASH.jpeg
9
+ exec "imagesnap ~/Pictures/gitshots/#{repository_name}_#{commit_date.gsub!(' ', '_')}_#{commit_hash}.jpeg"
10
+ exit 1
metadata ADDED
@@ -0,0 +1,47 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: gitshot
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Muamer Ribica
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2012-11-23 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: gitshot is using post-commit hook to take your picture after every commit.
14
+ email: muamer.ribica@gmail.com
15
+ executables:
16
+ - gitshot
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - lib/gitshot/hooks/post-commit-template
21
+ - lib/gitshot.rb
22
+ - bin/gitshot
23
+ homepage: http://www.github.com/mribica/gitshot
24
+ licenses:
25
+ - WTFPL
26
+ metadata: {}
27
+ post_install_message:
28
+ rdoc_options: []
29
+ require_paths:
30
+ - lib
31
+ required_ruby_version: !ruby/object:Gem::Requirement
32
+ requirements:
33
+ - - '>='
34
+ - !ruby/object:Gem::Version
35
+ version: '0'
36
+ required_rubygems_version: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ requirements: []
42
+ rubyforge_project:
43
+ rubygems_version: 2.0.3
44
+ signing_key:
45
+ specification_version: 4
46
+ summary: Take picture on every commit
47
+ test_files: []