commit_art 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 4c74b176d5ca6ec6995fba0028b27017038376f1
4
+ data.tar.gz: f54ea7ff4d868166e5bb46208cc9fd85a637c3cd
5
+ SHA512:
6
+ metadata.gz: 705e366d83d1bf467471ae33c14bac176612b8ea575e4deff988c4e76d6790670be6f2a9c3b4f0efdfaccea1355c058647b219101d81dcbda035fd0058dee6f4
7
+ data.tar.gz: 39ba30f0d2706ba6b0d697582d251ec46c252162888aea108e3909b9d9046b8fb8f47f75645650752a2743fdc9ea845f47b57c29a5560e07ad42a8c64c3ee458
data/.DS_Store ADDED
Binary file
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in commit_art.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Christian McNulty
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,49 @@
1
+ # CommitArt
2
+
3
+ TODO: Gem description
4
+
5
+ ## Installing
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'commit_art'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install commit_art
18
+
19
+ ## Uninstalling
20
+
21
+ Run this to remove the post-commit hook:
22
+
23
+ $ commit_art -d
24
+
25
+ Then uninstall as usual
26
+
27
+ $ gem uninstall commit_art
28
+
29
+ ## Usage
30
+ If you are using rbenv, make sure you run:
31
+
32
+ rbenv rehash
33
+
34
+ Then you can use any of these commmands:
35
+
36
+ commit_art -e # to enable
37
+ commit_art -d # to disable
38
+ commit_art -v # to check version
39
+ commit_art -c # to check current post-commit hook =>
40
+
41
+ ## Contributing
42
+
43
+ 1. Fork it ( http://github.com/<my-github-username>/commit_art/fork )
44
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
45
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
46
+ 4. Push to the branch (`git push origin my-new-feature`)
47
+ 5. Create new Pull Request
48
+
49
+ All ascii art courtesy of [http://www.geocities.com/spunk1111](http://www.geocities.com/spunk1111).
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
data/asciis/01.txt ADDED
@@ -0,0 +1,15 @@
1
+ Humpty Dumpty
2
+
3
+ .-"-.
4
+ /a a \ _/\
5
+ / - \ \ /
6
+ ;`'-----'`;\//
7
+ /|___:_____|\/
8
+ _//|---------|
9
+ (_/__\/)__/)_/______
10
+ |__|_//__//__|___|__|
11
+ |___|\\__\\|___|___||
12
+ |_|_(_/_(_/___|___|_|
13
+ |____|___|___|___|__|
14
+ |__|___|___|___|___||
15
+ ^^^^^^^^^^^^^^^^^^^^^^^^^
data/asciis/02.txt ADDED
@@ -0,0 +1,28 @@
1
+ birds
2
+ _..._
3
+ \_.._ `'-.,--,
4
+ '-._'-. `\a\\
5
+ '. `_.' (|
6
+ `7 ||
7
+ / .' |
8
+ /_.-' ,J
9
+ / \
10
+ || / ;
11
+ _.. || | | /`\.-.
12
+ .' _ `\ `\ \ | \_/__/
13
+ / /e)-,\ '. \ /.-` .'\
14
+ / | ,_ | /\ `;_.-'_.-'`\_/
15
+ / '-(-.)/ \_;(((_.-;
16
+ .'--. \ ` .(((_,;`'. \
17
+ / `\ | _.--'`__.' `\ '-;\
18
+ /` | /.-' .--' '._.'\\
19
+ .' ; /__.-'` | \ |
20
+ .'`-'_ /_.'))) \_\,_/
21
+ / -'_.'---;`'-)))
22
+ (__.'/ /` .'`
23
+ (_.'/ /` /`
24
+ _|.' /`
25
+ .-` __.'|
26
+ .-'|| |
27
+ \_`/
28
+ `
data/asciis/03.txt ADDED
@@ -0,0 +1,18 @@
1
+ elephants
2
+
3
+ _
4
+ / )
5
+ .--.; | _...,-"""-,
6
+ .-""-.-""""-. / _`'-._.' /` \
7
+ /' \ \| (/'-._/ ) ;
8
+ .-""""-; ( '--' /-' _ |
9
+ .' | ; e / a , ;
10
+ / \ | __.'`-.__, ; /
11
+ / `._ ; .-' `--.,__.\ /`
12
+ //| \ \,-' /\_.'
13
+ // | `;.___> /,-'.
14
+ /`| / |`\ _..---\ | \
15
+ |/ / _,.-----\ | \ /`| | |\ \
16
+ / .; | | | \ / | | | \ )
17
+ | / | \ / |\..' \ \ | \ \..'
18
+ \../ \.../ \.../ \.../---' \.../
data/asciis/04.txt ADDED
@@ -0,0 +1,21 @@
1
+ panda bear
2
+
3
+ .--.
4
+ / _ \ ___ .--.
5
+ | ( _.-"" `'-.,' _ \
6
+ \.' '. ) /
7
+ / \_.'
8
+ / .-. .-. \
9
+ | / o \ / o \ |
10
+ ; \.-'` `'-./ |
11
+ /\ ._. /
12
+ ;-'';_ ,_Y_, _.'
13
+ / \`--.___.--;.
14
+ /| '.__.---. \\
15
+ ; \ \ ;'--. .-.
16
+ | '. __..-._.' |-,.-' /
17
+ | `""` .---._ / .--. /
18
+ / ; / `-;/ /|_/
19
+ \_,\ | | |
20
+ '-...--'._ _..__\/
21
+ `"""`
data/asciis/05.txt ADDED
@@ -0,0 +1,10 @@
1
+ fish
2
+
3
+ ,
4
+ () _/{
5
+ ,_ o .' './`>
6
+ _}\_ O / a (( =<
7
+ <`\.' '. o '.,__,.'\_>
8
+ > )) e \ \)
9
+ <_/'.,___,.'
10
+ (/
data/asciis/06.txt ADDED
@@ -0,0 +1,14 @@
1
+ cat
2
+
3
+ _ ,-.
4
+ <`-.__.-',> \/\
5
+ ) ( ) |
6
+ _/ ^4^ _\ / ;
7
+ =\_ -'- _=/__.-~~-./ /
8
+ `;---` /
9
+ __| | \
10
+ .~` \ | , \ ;
11
+ (_,~'` `.\ |__..~'. |
12
+ | ; ) | `) 7
13
+ _/ / (_.' / /
14
+ (__,' (_.'
data/asciis/07.txt ADDED
@@ -0,0 +1,13 @@
1
+ puppy looking into box
2
+ __
3
+ .' `.
4
+ _.-'/ | \/-._
5
+ , _.-" ,| / a `-._'-._
6
+ |\ .-" `--""-.__.' '-._'-._
7
+ \ `-'` .___.--._)========'-._]
8
+ \ .' | |
9
+ | /,_.-' | |
10
+ _/ _.'( | |
11
+ / ,-' \ \ | |
12
+ \ \ `-' | |
13
+ `-' '-------------'
data/asciis/08.txt ADDED
@@ -0,0 +1,17 @@
1
+ love bunnies
2
+
3
+ ,_ ,_ (\/) _, _,
4
+ | '. '. \/ .' .' |
5
+ \ \ \ / / /
6
+ '.__\_|_ _|_/__.'
7
+ /` '. .' `\
8
+ / ^ ) ( ^ \
9
+ / __.' '.__ \
10
+ .' (_ _) '.
11
+ .' \'-._ _.-'/ '.
12
+ / '.__)(__.' \
13
+ ; .-. '. .' .-. ;
14
+ /`| / '._)(_.' \ |`\
15
+ | \ /--. .--\ / |
16
+ '--'\ '-.__) (__.-' /'--'
17
+ )_____) (______(
data/asciis/09.txt ADDED
@@ -0,0 +1,22 @@
1
+ leprechaun with a pot of gold
2
+
3
+ .-----. ()()
4
+ / \ .'()
5
+ |__...__|/
6
+ |_....._|
7
+ .-' ___ '-.
8
+ \_.-`a a`-._/
9
+ __ .--. _ (|\ (_) /|)
10
+ .-;.-"-.-;`_;-, ( \_=_/ )
11
+ .(_( `)-;___),-;_), _(_ _)_
12
+ (.( `\.-._)-.( ). ) /` ||'-'|| `\
13
+ ,(_`'--;.__\ _).;--'`_) _ /_/ (_>o<_) \_\
14
+ // )`--..__ ``` _( o )'(';,)\_//| || : || |\\
15
+ \;' ````` `\\ '.\\--' |`"""""""`|//
16
+ / ':.___// \___,___/\_(
17
+ | '---'| |__|__|
18
+ ; ; ;""|"";
19
+ \ / [] | []
20
+ '. .' .' / \ '.
21
+ jgs'-,.__ __.,-' `--' `--'
22
+ (___/`````````\___)
data/asciis/10.txt ADDED
@@ -0,0 +1,12 @@
1
+ man in hat
2
+ _ _
3
+ /` '-' `\
4
+ .--./ \.--.
5
+ | \ / |
6
+ \ '._____.' /
7
+ '. .'
8
+ `;-.......-;`
9
+ | _7_ |
10
+ , \/` ^ `\/ ,
11
+ \'-' ._. '-'/
12
+ '--'` `'--'
data/asciis/11.txt ADDED
@@ -0,0 +1,34 @@
1
+ weight lifter
2
+ _ _
3
+ _| | | |_
4
+ | | |______OOOOo__________oOOOO_______| | |
5
+ [| | |--------(`,----------\`,---------| | |]
6
+ |_| | ) ( ) ( | |_|
7
+ |_| / | | \ |_|
8
+ | | \\\\\\// | |
9
+ \ / | - - | \ /
10
+ / \ ( a a ) / \
11
+ | | | L | | |
12
+ | | \ == / | |
13
+ | /_.\____/._\ |
14
+ \ || || /
15
+ \ | '-..-' | /
16
+ | ; GOLD'S ; |
17
+ | / \ |
18
+ \ /
19
+ | |
20
+ | __ |
21
+ |===[LI]===|
22
+ )"""`""`"""(
23
+ / \
24
+ / ,____, \
25
+ /'-._ .' '. _.-'\
26
+ / / \ \
27
+ | / \ |
28
+ (_ / \ _)
29
+ | `\ /` |
30
+ |___| |___|
31
+ |===/ \===|
32
+ _/\._( )_./\_
33
+ /` | | _`\
34
+ `""""`"" ""`"""`
data/asciis/12.txt ADDED
@@ -0,0 +1,14 @@
1
+ hamburger and fries
2
+
3
+ |\ /| /|_/|
4
+ |\||-|\||-/|/|
5
+ \\|\|//||///
6
+ _..----.._ |\/\||//||||
7
+ .' o '. |||\\|/\\ ||
8
+ / o o \ | './\_/.' |
9
+ |o o o| | .:. .:. |
10
+ /'-.._o __.-'\ | : :: : |
11
+ \ ````` / | : '' : |
12
+ |``--........--'`| '.______.'
13
+ \ /
14
+ `'----------'`
data/asciis/13.txt ADDED
@@ -0,0 +1,22 @@
1
+ ranch style houses
2
+
3
+ _T_
4
+ _/ \_ _ _
5
+ |---| _[_] _.-'_'-._
6
+ _;-'-;_ _ | |.-'_.-';'-._'-._
7
+ _.-',.-;-._'-._ [_] |_.-'_.-'; : ; ;'-._'-._
8
+ _.-'_.-'/\ ; ;'-._'-. |____________________ _.-'_.-' ; ;' ; ; : ;'-._'-._
9
+ _.-'_.-; ; /\/\; ; ; ;-._'-._ _.-'_.-' ; ; ; : : ; ; ;-._'-._
10
+ .-'_.-; ; ;</// \ ; ; ; ;'-._'-.-______-.-'_.-; '; ; '; ; . ; : ' ; ; ; ;'-._'-.
11
+ `";";__;___;_;_\/;__&_;__;_;__;___ ;";"` "";" ; ;_;___; _: : '; _;_;__;_ ; ; ";"`
12
+ |{}.---------------------------;{}||.-------.| ; '. | |/\/\| | ; : | |/\/\| |; ; .|
13
+ | | | ||||_____||| ; \/'| |\/\/| |' ; . ; | |\/\/| |; () |
14
+ | |---------------------------| 2||'-------'| ; '. | |_|/\/\|_| ; : : |_|/\/\|_|;'( )|
15
+ | | | 7||)( |_; _ \|_ ;_ _;_ __;_;__ ;___;_; _; ;_( )___
16
+ | |---------------------------| 1||\/_______|==_-=_|__=_ ===_-=-=_=-=_=-=----=-=_=-( )=-=|
17
+ | | _ | 2||_ )(|-/:::::::::`\_=\|/=-=.-"-.=-=\|/-=-=-_=( _)--=|
18
+ | |---------------------------| ||/ _\/|.--.:::::::::)\\|//=( )-\\|//.---.=-||+-=-=|
19
+ jgs^/^^^^^^^^^^^^^^^^^^^^^^^^^^^^/^^^/ / ( `)==.-.-'^===^==='-Y-'===^==( )=^.-.^^^^
20
+ / ```` / .-.'-Y-' {__ } ~ ~ '-Y-' {__~}
21
+ / .----.--.' { __} ~ .--.
22
+ / / {___~} { __}
data/asciis/14.txt ADDED
@@ -0,0 +1,10 @@
1
+ car
2
+
3
+ _..------.,._
4
+ ,-; .------.'-._`-.
5
+ __.'_/ /______/ ``-`.
6
+ _.-;'`` --_ ; =, .-'``". `\/|
7
+ .'--' .-"-.\| | | / .---. `-' |
8
+ `-..__/ .-. \__'_-__-_____/ .-. \___/
9
+ \ '-' / \ '-' /
10
+ '-.-' '-.-'
data/asciis/15.txt ADDED
@@ -0,0 +1,13 @@
1
+ crab
2
+
3
+ , ,
4
+ /(_, ,_)\
5
+ \ _/ \_ /
6
+ // \\
7
+ \\ (@)(@) //
8
+ \'="=="='/
9
+ ,===/ \===,
10
+ ",===\ /===,"
11
+ " ,==='------'===, "
12
+ " "
13
+
data/asciis/16.txt ADDED
@@ -0,0 +1,12 @@
1
+ dolphin
2
+
3
+ ,-._
4
+ _.-' '--.
5
+ .' _ -`\_
6
+ / .----.`_.'----'
7
+ ;/ `
8
+ /_;
9
+
10
+ ._ ._ ._ ._
11
+ _.-._)`\_.-._)`\_.-._)`\_.-._)`\_.-._
12
+
data/asciis/17.txt ADDED
@@ -0,0 +1,19 @@
1
+ octopus
2
+ ___
3
+ .-' `'.
4
+ / \
5
+ | ;
6
+ | | ___.--,
7
+ _.._ |0) ~ (0) | _.---'`__.-( (_.
8
+ __.--'`_.. '.__.\ '--. \_.-' ,.--'` `""`
9
+ ( ,.--'` ',__ /./; ;, '.__.'` __
10
+ _`) ) .---.__.' / | |\ \__..--"" """--.,_
11
+ `---' .'.''-._.-'`_./ /\ '. \ _.-~~~````~~~-._`-.__.'
12
+ | | .' _.-' | | \ \ '. `~---`
13
+ \ \/ .' \ \ '. '-._)
14
+ \/ / \ \ `=.__`~-.
15
+ / /\ `) ) / / `"".`\
16
+ , _.-'.'\ \ / / ( ( / /
17
+ `--~` ) ) .-'.' '.'. | (
18
+ (/` ( (` ) ) '-;
19
+ ` '-; (-'
data/asciis/18.txt ADDED
@@ -0,0 +1,35 @@
1
+ seahorses
2
+ ,
3
+ , /^\ ___
4
+ /^\_/ `...' /`
5
+ ,__\ ,' ~ (
6
+ ,___\ ,, ., \
7
+ \___ \\\ .'.' .-. )
8
+ .'.-\\\`.`. '.-. (
9
+ / (==== ."". ( o ) \
10
+ ,/u `~~~'| / `-' )
11
+ "")^u ^u^|~| `""". ~_ /
12
+ /^u ^u ^\~\ ". \\
13
+ _ /u^ u ^u ~\ ". \\
14
+ ( \ )^ ^U ^U ^U\~\ ". \\
15
+ (_ (\ /^U ^ ^U ^U ~| ". `\
16
+ (_ _ \ )U ^ U^ ^U ^|~| ". `\.
17
+ (_ = _(\ \^ U ^U ^ U^ ~| ".`.;
18
+ (_ -( _\_)U ^ ^ U^ ^|~| ""
19
+ (_ = ( ^ U^ U^ ^ U ~|
20
+ (_ - ( ~ = ^ U ^U U ^|~/
21
+ (_ = (_^U^ ^ U^ U /
22
+ (_- ~_(/ \^ U^ ^U^,"
23
+ (_ = _/ |^ u^u."
24
+ (_ (/ |u^ u.(
25
+ (__/ )^u^ u/
26
+ /u^ u^(
27
+ |^ u^ u/
28
+ |u^ u^( ____
29
+ |^u^ u( .-' `-,
30
+ \^u ^ \ / ' .---. \
31
+ \^ u^u\ | ' ` ; |
32
+ \u^u^u:` . `-' ; |
33
+ `-.^ u`._ _.'^'./
34
+ "-.^.-```_=~._/
35
+ `"------"'
data/asciis/19.txt ADDED
@@ -0,0 +1,11 @@
1
+ shark
2
+ __
3
+ o /' )
4
+ /' ( ,
5
+ __/' ) .' `;
6
+ o _.-~~~~' ``---..__ .' ;
7
+ _.--' b) ``--...____.' .'
8
+ ( _. )). `-._ <
9
+ `\|\|\|\|)-.....___.- `-. __...--'-.'.
10
+ `---......_______,,,`.___.'----... .' `.;
11
+ `-`
data/asciis/20.txt ADDED
@@ -0,0 +1,13 @@
1
+ sperm whale
2
+
3
+ .-------------'```'----......,,__ _,
4
+ | `'`'`'`'-.,.__ .'(
5
+ | `'--._.' )
6
+ | `'-.<
7
+ \ .-'`'-. -. `\
8
+ \ -.o_. _ _,-'`\ |
9
+ ``````''--.._.-=-._ .' \ _,,--'` `-._(
10
+ (^^^^^^^^`___ '-. | \ __,,,...--' `
11
+ ````````` `'--..___\ |`
12
+ `-.,'
13
+
data/bin/commit_art ADDED
@@ -0,0 +1,127 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ begin
4
+ require 'commit_art'
5
+ rescue
6
+ require 'rubygems'
7
+ require 'commit_art'
8
+ end
9
+
10
+ include CommitArt
11
+
12
+ # path to the post-commit file and directory
13
+ HOOK_PATH = File.join ".git", "hooks", "post-commit"
14
+ HOOK_DIR = File.join ".git", "hooks"
15
+
16
+ # enables commit_art
17
+ def do_enable
18
+ # checks if the project is a git directory
19
+ if not File.directory?(".git")
20
+ puts "You're not in a git project directory."
21
+ exit 1
22
+ end
23
+
24
+ # makes the hook directory if it doesn't exist
25
+ if not File.directory?(HOOK_DIR)
26
+ Dir.mkdir(HOOK_DIR)
27
+ end
28
+
29
+ # returns a message if a post-commit hook already exists
30
+ if File.exists? HOOK_PATH
31
+ puts "A post-commit hook already exists"
32
+ exit 1
33
+ end
34
+
35
+ # adds post-commit hook to the post-commit file and changes permissions
36
+ doc = "#!/bin/sh\ncommit_art --print\n"
37
+ File.open(HOOK_PATH, 'w') { |f| f.write(doc) }
38
+ FileUtils.chmod 0755, HOOK_PATH
39
+ puts "installed commit_art hook as:"
40
+ puts " -> #{File.expand_path(HOOK_PATH)}"
41
+ puts "if you are using rbenv, use rbenv rehash"
42
+ puts "(to remove later, you can use: commit_art --disable)"
43
+ end
44
+
45
+ # disables commit_art
46
+ def do_disable
47
+ # checks that the post-commit hook file exists
48
+ if File.exists? HOOK_PATH
49
+ # checks if the post-commit file contains commit_art
50
+ if File.readlines(HOOK_PATH).grep(/commit_art/).size > 0
51
+ # deletes only a commit_art hook
52
+ FileUtils.rm HOOK_PATH
53
+ puts "removed #{HOOK_PATH}"
54
+ else
55
+ # if there is a different post-commit hook
56
+ puts "A different post-commit hook exists and was not removed"
57
+ end
58
+ else
59
+ # if there aren't any post-commit hooks already
60
+ puts "No post-commit hook exists for this directory, so there is nothing to uninstall"
61
+ end
62
+ end
63
+
64
+ # prints out art
65
+ def do_print
66
+ puts CommitArt.get_art
67
+ puts "\nENJOY YOUR ART"
68
+ end
69
+
70
+ # shows the version
71
+ def do_version
72
+ puts CommitArt::VERSION
73
+ end
74
+
75
+ # shows the current post-commit hook, whether from commit_art or not
76
+ def do_show_current_hook
77
+ if File.exists? HOOK_PATH
78
+ current_hook = File.readlines(HOOK_PATH)
79
+ if current_hook.nil?
80
+ puts "there is no current post-commit hook installed"
81
+ else
82
+ puts "#{current_hook}"
83
+ end
84
+ else
85
+ puts "there is no current post-commit hook installed"
86
+ end
87
+ end
88
+
89
+ # all the command line options
90
+ Choice.options do
91
+
92
+ option :enable do
93
+ long "--enable"
94
+ short '-e'
95
+ action { do_enable }
96
+ desc "install commit_art for this repo"
97
+ end
98
+
99
+ option :disable do
100
+ long "--disable"
101
+ short "-d"
102
+ action { do_disable }
103
+ desc "uninstall commit_art for this repo"
104
+ end
105
+
106
+ option :print do
107
+ long "--print"
108
+ short "-p"
109
+ action { do_print }
110
+ desc "print out art"
111
+ end
112
+
113
+ option :version do
114
+ long "--version"
115
+ short "-v"
116
+ action { do_version }
117
+ desc "show the version"
118
+ end
119
+
120
+ option :show_current_hook do
121
+ long "--show-current-hook"
122
+ short "-c"
123
+ action { do_show_current_hook }
124
+ desc "show the current post-commit hook"
125
+ end
126
+
127
+ end
@@ -0,0 +1,28 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'commit_art/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "commit_art"
8
+ spec.version = CommitArt::VERSION
9
+ spec.authors = ["Christian McNulty"]
10
+ spec.email = ["ctm814@gmail.com"]
11
+ spec.summary = "Shows ascii art in the terminal after a git commit."
12
+ spec.description = "With commit_art, you can add a git post-commit hook that
13
+ prints ascii art in the terminal."
14
+ spec.homepage = "http://github.com/cmcn/commit_art"
15
+ spec.license = "MIT"
16
+
17
+ spec.files = `git ls-files`.split("\n")
18
+ spec.executables = ["commit_art"]
19
+ spec.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
20
+ spec.require_paths = ["lib"]
21
+
22
+ spec.add_development_dependency "bundler", "~> 1.5"
23
+ spec.add_development_dependency "rake"
24
+ spec.add_development_dependency "cucumber"
25
+ spec.add_development_dependency "aruba"
26
+
27
+ spec.add_dependency "choice"
28
+ end
@@ -0,0 +1,5 @@
1
+ Feature: CommitArt
2
+
3
+ # Scenario: Print art
4
+ # When I run "commit_art -p"
5
+ # Then the output should be a string
@@ -0,0 +1 @@
1
+ require 'aruba/cucumber'
data/lib/commit_art.rb ADDED
@@ -0,0 +1,36 @@
1
+ # TODO: figure out what this does
2
+ $:.unshift File.expand_path('.')
3
+
4
+ require 'commit_art/version'
5
+ require 'choice'
6
+ require 'fileutils'
7
+
8
+ module CommitArt
9
+
10
+ # TODO: use this
11
+ attr_reader :asciis_count
12
+
13
+ def initialize
14
+ dir = '../asciis'
15
+ asciis_count = Dir[File.join(dir, '**', '*')].count { |file| File.file?(file) }
16
+ end
17
+
18
+ def path_to_asciis
19
+ File.join(File.dirname(File.expand_path(__FILE__)), '../asciis')
20
+ end
21
+
22
+ # gets a random art
23
+ def get_art
24
+ which_art = rand(22)
25
+
26
+ # sweet file name stuff
27
+ case which_art
28
+ when 0..20
29
+ this_art = File.read("#{path_to_asciis}/#{format('%02d', which_art)}.txt")
30
+ else
31
+ puts "Invalid art choice."
32
+ this_art = ""
33
+ end
34
+ end
35
+
36
+ end
@@ -0,0 +1,3 @@
1
+ module CommitArt
2
+ VERSION = "0.0.7"
3
+ end
@@ -0,0 +1,19 @@
1
+ require 'test/unit'
2
+
3
+ # Loads commit_art directly from the lib folder so don't have to create
4
+ # a gem before testing
5
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
6
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
7
+ require 'commit_art'
8
+
9
+ include CommitArt
10
+
11
+ # TODO: write more tests, CLI tests specifically
12
+ class CommitArtTest < Test::Unit::TestCase
13
+
14
+ def test_get_art
15
+ assert_not_nil get_art
16
+ assert get_art.is_a?(String)
17
+ end
18
+
19
+ end
metadata ADDED
@@ -0,0 +1,152 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: commit_art
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.7
5
+ platform: ruby
6
+ authors:
7
+ - Christian McNulty
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-02-16 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.5'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.5'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: cucumber
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: aruba
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: choice
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ description: "With commit_art, you can add a git post-commit hook that \n prints
84
+ ascii art in the terminal."
85
+ email:
86
+ - ctm814@gmail.com
87
+ executables:
88
+ - commit_art
89
+ extensions: []
90
+ extra_rdoc_files: []
91
+ files:
92
+ - ".DS_Store"
93
+ - ".gitignore"
94
+ - Gemfile
95
+ - LICENSE.txt
96
+ - README.md
97
+ - Rakefile
98
+ - asciis/01.txt
99
+ - asciis/02.txt
100
+ - asciis/03.txt
101
+ - asciis/04.txt
102
+ - asciis/05.txt
103
+ - asciis/06.txt
104
+ - asciis/07.txt
105
+ - asciis/08.txt
106
+ - asciis/09.txt
107
+ - asciis/10.txt
108
+ - asciis/11.txt
109
+ - asciis/12.txt
110
+ - asciis/13.txt
111
+ - asciis/14.txt
112
+ - asciis/15.txt
113
+ - asciis/16.txt
114
+ - asciis/17.txt
115
+ - asciis/18.txt
116
+ - asciis/19.txt
117
+ - asciis/20.txt
118
+ - bin/commit_art
119
+ - commit_art.gemspec
120
+ - features/post_commit_hookers.feature
121
+ - features/support/setup.rb
122
+ - lib/commit_art.rb
123
+ - lib/commit_art/version.rb
124
+ - test/test_commit_art.rb
125
+ homepage: http://github.com/cmcn/commit_art
126
+ licenses:
127
+ - MIT
128
+ metadata: {}
129
+ post_install_message:
130
+ rdoc_options: []
131
+ require_paths:
132
+ - lib
133
+ required_ruby_version: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - ">="
136
+ - !ruby/object:Gem::Version
137
+ version: '0'
138
+ required_rubygems_version: !ruby/object:Gem::Requirement
139
+ requirements:
140
+ - - ">="
141
+ - !ruby/object:Gem::Version
142
+ version: '0'
143
+ requirements: []
144
+ rubyforge_project:
145
+ rubygems_version: 2.2.0
146
+ signing_key:
147
+ specification_version: 4
148
+ summary: Shows ascii art in the terminal after a git commit.
149
+ test_files:
150
+ - features/post_commit_hookers.feature
151
+ - features/support/setup.rb
152
+ - test/test_commit_art.rb