emoji-commit 1.0.4 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0f3625b16774bf7e5973fc05a4f2f62ef44c7295
4
- data.tar.gz: f2aa97f9856cf0cb77351ee6eaebf2b01cad498b
3
+ metadata.gz: 6e8442d08642c4a17864ba0de7f3bfde68f04692
4
+ data.tar.gz: 66e96992e26606e6c396fbd190da68096c09b85c
5
5
  SHA512:
6
- metadata.gz: 913a37d092a19b5e6ffed1bd3f160d95d31673b5188bc9a82e61db196fb5db0f140b1521cf95dcf76750b4ed6cdc264904b63be2801808dccec839581abc7b04
7
- data.tar.gz: 877117da81859dbbd46cf1d2cab3e27ccf52225613d4d9a5936b9a7b4f5404a8236330c92a27bbb2dc55ba51dfcd2e8c6c63fc275802740fb30da2608b659932
6
+ metadata.gz: f478065868a1b5cd43e5ca72f6336472b9b40d65eb3fa19ef67844c341673a85e162901c250b11e43398a929fc03d7fe7bd791f345689896bdaedfedbcaa8cb9
7
+ data.tar.gz: 4074f2f64324c8e45b18fd731a9186e87f787398fc39e18e2b3e6a5aaffe474e155461887f075ac1db9dc323380c75cd61f8b0a3823af0c9ffadc57e468d6e9c
data/README.md CHANGED
@@ -56,3 +56,7 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/claire
56
56
 
57
57
  The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
58
58
 
59
+ ## :crystal_ball: Meta
60
+
61
+ On Ruby gems: [emoji-commit](https://rubygems.org/gems/emoji-commit)
62
+
data/TODO.md CHANGED
@@ -8,17 +8,18 @@ Pull requests welcome
8
8
  * ~~Add specs for get_emoji~~
9
9
  * ~~Rename emoji-commit-msg class and methods~~
10
10
  * ~~Print message on successful install~~
11
- * Print message on unsuccessful install/exit
12
- * Refactor and rename file-tasks
13
11
  * ~~Ask whether they want to install~~
14
- * Test asking whether they want to install
15
- * Test all bundle exec Thor stuff
12
+ * ~~Add SimpleCov~~
13
+ * ~~Refactor file-tasks~~
14
+ * ~~Test asking whether they want to install~~
15
+ * ~~Prompt user through install~~
16
+ * ~~Add uninstall scripts method~~
17
+ * ~~Uninstall fails if file not there~~
18
+ * Print message on unsuccessful install/exit
16
19
  * Check Fileutils.cp is OK if file already exists
17
- * Add a rescue in to file-tasks
18
20
  * Can you do skin tone modifiers in Git emojis?
19
21
  * Add support for this if yes
20
- * Prompt user through install
21
- * Add uninstall scripts method
22
- * Add SimpleCov
23
- * Spec for file-tasks
24
- * Add colours to prompt messages
22
+ * Spec for file-tasks FileUtils methods
23
+ * Add colours to prompt messages
24
+ * Better Readme - more emojis
25
+ * Improve that terrible attempt at instance methods in file-tasks
data/emoji-commit.gemspec CHANGED
@@ -25,4 +25,5 @@ Gem::Specification.new do |spec|
25
25
  spec.add_development_dependency 'rake', '~> 10.0'
26
26
  spec.add_development_dependency 'rspec'
27
27
  spec.add_development_dependency 'simplecov'
28
+ spec.add_development_dependency 'fakefs'
28
29
  end
@@ -0,0 +1,24 @@
1
+ #!/bin/sh
2
+ #
3
+ # An example hook script to check the commit log message.
4
+ # Called by "git commit" with one argument, the name of the file
5
+ # that has the commit message. The hook should exit with non-zero
6
+ # status after issuing an appropriate message if it wants to stop the
7
+ # commit. The hook is allowed to edit the commit message file.
8
+ #
9
+ # To enable this hook, rename this file to "commit-msg".
10
+
11
+ # Uncomment the below to add a Signed-off-by line to the message.
12
+ # Doing this in a hook is a bad idea in general, but the prepare-commit-msg
13
+ # hook is more suited to it.
14
+ #
15
+ # SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p')
16
+ # grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1"
17
+
18
+ # This example catches duplicate Signed-off-by lines.
19
+
20
+ test "" = "$(grep '^Signed-off-by: ' "$1" |
21
+ sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || {
22
+ echo >&2 Duplicate Signed-off-by lines.
23
+ exit 1
24
+ }
@@ -1,3 +1,3 @@
1
1
  module EmojiCommit
2
- VERSION = "1.0.4"
2
+ VERSION = "1.1.0"
3
3
  end
File without changes
data/lib/file-tasks.rb CHANGED
@@ -4,14 +4,11 @@ require 'thor'
4
4
 
5
5
  module EmojiCommit
6
6
  class Cli < Thor
7
- desc 'install', 'installs commit hook scripts'
8
7
 
8
+ desc 'install', 'installs commit hook scripts'
9
9
  def install
10
- unless Dir.exist?('.git')
11
- puts 'Git has not been initialised in this directory. Bye'
12
- exit
13
- end
14
-
10
+ check_for_git
11
+
15
12
  puts 'You are about to overwrite any existing Git commit hook with the emoji script'
16
13
  puts 'Is that OK? (y|n)'
17
14
 
@@ -28,23 +25,58 @@ module EmojiCommit
28
25
  end
29
26
 
30
27
  if File.exist?('.git/hooks/commit-msg') then FileUtils.rm('.git/hooks/commit-msg') end
31
- if File.exist?('.git/hooks/commit-msg.sample') then FileUtils.rm('.git/hooks/commit-msg.sample') end
32
28
 
33
- path = path_to_resources
34
-
35
- FileUtils.cp(path + '/emoji-script.rb', '.git/hooks/emoji-script.rb')
36
- FileUtils.cp(path + '/emoji-commit-msg.rb', '.git/hooks/emoji-commit-msg.rb')
37
- FileUtils.cp(path + '/commit-msg', '.git/hooks/commit-msg')
38
- FileUtils.cp(path + '/assets/emojis.json', '.git/hooks/emojis.json')
39
- FileUtils.chmod 0755, %w(.git/hooks/emoji-script.rb .git/hooks/emoji-commit-msg.rb .git/hooks/commit-msg .git/hooks/emojis.json)
40
-
29
+ filenames.each do |filename|
30
+ FileUtils.cp("#{path}/#{filename}", ".git/hooks/#{filename}")
31
+ FileUtils.chmod(0755, ".git/hooks/#{filename}")
32
+ end
33
+
41
34
  puts 'Installed scripts successfully. Commit emoji-ful messages!'
42
35
  end
43
36
 
37
+ desc 'uninstall', 'uninstalls commit hook scripts and restores sample script'
38
+ def uninstall
39
+ check_for_git
40
+
41
+ puts 'You are about to uninstall the emoji Git commit hook'
42
+ puts 'Is that OK? (y|n)'
43
+
44
+ answer = STDIN.gets.strip.downcase
45
+
46
+ if answer == 'n'
47
+ puts 'Good choice. Bye'
48
+ exit
49
+ elsif answer != 'y'
50
+ puts 'Pardon? Oh who cares. Bye'
51
+ exit
52
+ else
53
+ puts 'As long as you\'re sure :( Removing files now'
54
+ end
55
+
56
+ filenames.each do |filename|
57
+ FileUtils.rm(".git/hooks/#{filename}") if File.exists?(".git/hooks/#{filename}")
58
+ end
59
+
60
+ FileUtils.cp("#{path}/commit-msg.sample", ".git/hooks/commit-msg.sample") unless File.exist?('.git/hooks/commit-msg.sample')
61
+
62
+ puts 'Uninstalled scripts successfully. Enjoy your boring emoji-less life.'
63
+ end
64
+
44
65
  no_commands do
45
- def path_to_resources
66
+ def check_for_git
67
+ unless Dir.exist?('.git')
68
+ puts 'Git has not been initialised in this directory. Bye'
69
+ exit
70
+ end
71
+ end
72
+
73
+ def path
46
74
  File.dirname(File.expand_path(__FILE__))
47
75
  end
76
+
77
+ def filenames
78
+ ['emoji-script.rb', 'emoji-commit-msg.rb', 'commit-msg', 'emojis.json']
79
+ end
48
80
  end
49
81
  end
50
82
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: emoji-commit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Claire Parker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-10 00:00:00.000000000 Z
11
+ date: 2015-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -80,6 +80,20 @@ dependencies:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: fakefs
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
83
97
  description: Prefixes Git commit messages with a random GitHub-friendly emoji.
84
98
  email:
85
99
  - claire.parker87@gmail.com
@@ -102,11 +116,12 @@ files:
102
116
  - bin/emoji
103
117
  - bin/setup
104
118
  - emoji-commit.gemspec
105
- - lib/assets/emojis.json
106
119
  - lib/commit-msg
120
+ - lib/commit-msg.sample
107
121
  - lib/emoji-commit-msg.rb
108
122
  - lib/emoji-commit-version.rb
109
123
  - lib/emoji-script.rb
124
+ - lib/emojis.json
110
125
  - lib/file-tasks.rb
111
126
  homepage: https://github.com/claireparker/emoji-commit
112
127
  licenses:
@@ -128,7 +143,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
128
143
  version: '0'
129
144
  requirements: []
130
145
  rubyforge_project:
131
- rubygems_version: 2.4.5.1
146
+ rubygems_version: 2.4.6
132
147
  signing_key:
133
148
  specification_version: 4
134
149
  summary: Adds an emoji to your commit message