gitfog 0.0.3 → 0.0.4

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/bin/gitfog +22 -5
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 41e92b60e2a5fa3dca3c599406c89ec1b3a17b51
4
- data.tar.gz: affff66f10fe8c66a4a24f332e8c73655b3fb614
3
+ metadata.gz: f5f16ab573fe000f10d03267e23a020181b8458f
4
+ data.tar.gz: 0d1da50f3fd98cbd176ec910becbd4cf7dcd70d9
5
5
  SHA512:
6
- metadata.gz: 3941a269db18a1bed4d7fa61d2e3497e4f59b5a039a60740947378eb3d1c474ef7c21d7cfe9df20e47e4084451b39f7caa714f5a8be1987ba5b527fd1db046a5
7
- data.tar.gz: bc9c81cf17c4e862e17c61cf4088c496764a520c55218e26e1bcf0cfd6cdcb28516ccfd9c77b8b5bd72654b1fdc0f157764d21f8a8d402380921f2b480a76846
6
+ metadata.gz: a7010a894e5af775a4fd96c5ced6e1975593e805115b5724fbeccd67df9ce70f28ed022dd150325bc0434c486fded9e418e013342c2c7115f0a7a07c47932ba9
7
+ data.tar.gz: 3ce052c86851994a0ae2d315595b6c95a59b9f2c9672c9ad7b9147dfc3243a997740bd67f2d1f9f2961769677d8c8bfcd6262326d6be15fd3389146a659df744
data/README.md CHANGED
@@ -27,7 +27,7 @@ Have Ruby and RubyGems installed on your computer.
27
27
 
28
28
  Then run ```gem install gitfog```
29
29
 
30
- Currently at version 0.0.3
30
+ Currently at version 0.0.4
31
31
 
32
32
  ## How to use GitFog
33
33
 
data/bin/gitfog CHANGED
@@ -7,7 +7,7 @@ require 'highline/import'
7
7
  require 'fileutils'
8
8
  require 'git'
9
9
 
10
- program :version, '0.0.3'
10
+ program :version, '0.0.4'
11
11
  program :description, 'Camouflage git commit and push'
12
12
 
13
13
  def verify_gitfog
@@ -120,6 +120,19 @@ command :init do |c|
120
120
  cfile.puts config
121
121
  end
122
122
 
123
+ # ask whether to GPG sign commits
124
+ puts "Use your PGP key to sign commits?"
125
+ use_pgp = ask "Enter Y or Yes to add signature: "
126
+ if use_pgp.strip.downcase == "y" || use_pgp.strip.downcase == "yes"
127
+ File.open('.gitfog/use_pgp', 'w') do |pgp_file|
128
+ pgp_file.puts "yes"
129
+ end
130
+ puts "Enabled PGP signature on commits"
131
+ elsif File.exist?('.gitfog/use_pgp')
132
+ File.delete('.gitfog/use_pgp')
133
+ puts "Disabled PGP signature on commits"
134
+ end
135
+
123
136
  # remove old .git directory
124
137
  FileUtils.rm_rf('.git')
125
138
  puts "When you want to restore regular git commands, run 'gitfog off'."
@@ -207,6 +220,10 @@ command :commit do |c|
207
220
  # verify .gitfog exists
208
221
  verify_gitfog
209
222
 
223
+ # check whether to PGP sign commits
224
+ use_pgp = ""
225
+ use_pgp = " -S" if File.exist?('.gitfog/use_pgp')
226
+
210
227
  # copy .gitfog directory to .git
211
228
  restore_git
212
229
 
@@ -252,9 +269,9 @@ command :commit do |c|
252
269
 
253
270
  # make a timed commit
254
271
  if options.m
255
- system "GIT_AUTHOR_DATE='" + commit_time + "' GIT_COMMITTER_DATE='" + commit_time + "' git commit -m \"" + options.m + "\""
272
+ system "GIT_AUTHOR_DATE='" + commit_time + "' GIT_COMMITTER_DATE='" + commit_time + "' git commit -m \"" + options.m + "\"" + use_pgp
256
273
  else
257
- system "GIT_AUTHOR_DATE='" + commit_time + "' GIT_COMMITTER_DATE='" + commit_time + "' git commit"
274
+ system "GIT_AUTHOR_DATE='" + commit_time + "' GIT_COMMITTER_DATE='" + commit_time + "' git commit" + use_pgp
258
275
  end
259
276
  else
260
277
  puts "Try again after more time has passed."
@@ -263,9 +280,9 @@ command :commit do |c|
263
280
  puts "Making the commit with local system time"
264
281
  # make a commit without changing time
265
282
  if options.m
266
- system 'git commit -m "' + options.m + '"'
283
+ system 'git commit -m "' + options.m + '"' + use_pgp
267
284
  else
268
- system 'git commit'
285
+ system 'git commit' + use_pgp
269
286
  end
270
287
  end
271
288
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitfog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Msjoinder
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-12 00:00:00.000000000 Z
11
+ date: 2014-01-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: commander