lolcommits 0.5.2 → 0.5.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 94ae90ded5c3704ad9da445343644d55d9abb751
4
- data.tar.gz: 953a29473f91750e4a3f20684dbd0d5f49483e1b
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ MGUzMzkwYmFhNGQyYjE3ZDY3ZjhjZDlhOGZhZTIzMzYzMGMyYzAxYw==
5
+ data.tar.gz: !binary |-
6
+ NzE4NTQ1Y2E3ZDM4NTQzYzIyMjYzNzI0NGViMjQ2ZDU0ZDEwZjcxNg==
5
7
  SHA512:
6
- metadata.gz: 18726391ce18363965e49b46dfca8a41c721c070b2be1941d38ee0350d49f42ff2f84cab2848652b50f6a3146de6eed7e5f78e55078bd75f7b6d59074b82bff6
7
- data.tar.gz: 947127f66fe9ce7a9b2d047c4886ac1344c3cece6db70d951c22e4e20d401170cdc541e06e6fe124d0f2b2e0bf588cf89711b6cc84bc14ac7378bb0d980668ba
8
+ metadata.gz: !binary |-
9
+ N2NlZTFiMGJmOGU0NTk3ZTdiMDVlNTI1ZTY4ZWFlNGJjZDIwYzI3MTk4NDVl
10
+ Y2UxZWM2N2Y0MjE1OGE4YWZmMWMxMjYxNzIxMzVkZTJkNzQ1ZDVmZWExNDM3
11
+ M2JjZmFjODUyMjU4Y2I5NWM1N2NmNTIzMWIxNWI0ZDJlNGFmNzA=
12
+ data.tar.gz: !binary |-
13
+ N2RjMjRhYWQwOWVjZThhNzg5OTMwNmJiNDY0Njk2ZWM0M2M2Y2YyMDQ3MDcz
14
+ MjU4MzU1OTJlNzEyYjg4ZTdiNmI4NGI1ZGYyYTA5NjRiMzE0OGNmOGY3MmE3
15
+ ZjMwYmMxMGYxMjgyMjBjMmUzZjViMmMzNmYyYjZmYjNlY2Y2ODc=
data/.editorconfig ADDED
@@ -0,0 +1,17 @@
1
+ # EditorConfig helps developers define and maintain consistent
2
+ # coding styles between different editors and IDEs
3
+ # editorconfig.org
4
+
5
+ root = true
6
+
7
+ [*]
8
+ indent_style = space
9
+ indent_size = 2
10
+
11
+ end_of_line = lf
12
+ charset = utf-8
13
+ trim_trailing_whitespace = true
14
+ insert_final_newline = true
15
+
16
+ [*.md]
17
+ trim_trailing_whitespace = false
data/.gitattributes ADDED
@@ -0,0 +1 @@
1
+ * text=auto
data/.rubocop.yml ADDED
@@ -0,0 +1,5 @@
1
+ inherit_from: rubocop-todo.yml
2
+
3
+ # Enforce Ruby 1.8.7 compatible syntax
4
+ HashSyntax:
5
+ EnforcedStyle: hash_rockets
data/.travis.yml CHANGED
@@ -4,8 +4,12 @@ rvm:
4
4
  - 1.9.2
5
5
  - 1.9.3
6
6
  - 2.0.0
7
+ - 2.1.0
7
8
 
8
9
  before_install:
10
+ # use earlier version of Rubygems to avoid fatal bundler error on 1.8.7
11
+ - gem update --system 2.1.11
12
+ - gem --version
9
13
  - sudo apt-get update -qq
10
14
  - sudo apt-get install -qq -y mplayer
11
15
  - sudo apt-get install ffmpeg
data/CHANGELOG CHANGED
@@ -1,6 +1,17 @@
1
1
  0.x.x (in development)
2
2
  * TODO: figure out problems with GUI clients
3
3
 
4
+ 0.5.3 (30 March 2014)
5
+ * Fixed permissions on CommandCam (755) for cygwin (@matthutchinson)
6
+ * Added `--devices` option, mac only for now (@matthutchinson #183, #174)
7
+ * Replace http with https in twitter plugin (@kleinschmidt #195)
8
+ * RuboCop gem added for development (@mroth #194)
9
+ * Added optional key to uploldz plugin (@Numan1617 #192)
10
+ * Fixed lolcommmits typo: too much mmm (@penyaskito #189)
11
+ * Work when in subdirectory of a git repo (@ilkka #186)
12
+ * Added --version (-v) flag (@bfontaine #184)
13
+ * Send more VCS details to lolsrv (@drewwells #181)
14
+
4
15
  0.5.2 (5 December 2013)
5
16
  * Allow lolsrv plugin to sync/upload gifs (@matthutchinson #180)
6
17
  * Plugins refactor, can now configure themselves (@matthutchinson #179)
data/CONTRIBUTING CHANGED
@@ -8,4 +8,6 @@ GUIDELINES FOR CONTRIBUTING
8
8
 
9
9
  You can run the existing test-suite via `rake`. Ensure nothing is broken, but since the test since is far from complete, it'd be awesome if you manually tested for regressions as well.
10
10
 
11
- Please, if at all possible, write a passing test for the functionality you added.
11
+ Please, if at all possible, write a passing test for the functionality you added.
12
+
13
+ The default rake task uses Rubocop on default settings to ensure Ruby Style Guidelines. If you want to run tests before conforming to this to verify functionality you can just run `rake test` and `rake features` manually.
data/README.md CHANGED
@@ -75,7 +75,7 @@ Or they can be set via the following arguments in the capture command (located i
75
75
  * `--fork`
76
76
  * `--stealth`
77
77
 
78
- Read how to [configure commit capturing](https://github.com/mroth/lolcommits/wiki/Configure-Commit-Capturing) for more details.
78
+ Use `lolcommits --devices` to list all attached video devices available for capturing. Read how to [configure commit capturing](https://github.com/mroth/lolcommits/wiki/Configure-Commit-Capturing) for more details.
79
79
 
80
80
  ### Animated Gif Capturing
81
81
  Animated gifs (Mac/OSX only) can take a while to generate (depending on the number of seconds you capture and the capabilities of your machine). `ffmpeg` is required and can be installed with brew like so;
data/Rakefile CHANGED
@@ -16,7 +16,13 @@ task :fix_permissions do
16
16
  # Reset all permissions.
17
17
  system 'bash -c "find . -type f -exec chmod 644 {} \; && find . -type d -exec chmod 755 {} \;"'
18
18
  # Executable files.
19
- system 'bash -c "chmod +x ./bin/* vendor/ext/imagesnap/imagesnap vendor/ext/videosnap/videosnap"'
19
+ executables = %w(
20
+ vendor/ext/imagesnap/imagesnap
21
+ vendor/ext/videosnap/videosnap
22
+ vendor/ext/CommandCam/CommandCam.exe
23
+ )
24
+
25
+ system "bash -c \"chmod +x ./bin/* #{executables.join(' ')}\""
20
26
  end
21
27
 
22
28
  Rake::Task[:build].prerequisites.unshift :fix_permissions
@@ -37,14 +43,18 @@ Cucumber::Rake::Task.new(:features) do |t|
37
43
  end
38
44
 
39
45
  Rake::RDocTask.new do |rd|
40
-
41
46
  rd.main = "README.rdoc"
42
-
43
47
  rd.rdoc_files.include("README.rdoc","lib/**/*.rb","bin/**/*")
44
48
  end
45
49
 
46
- task :default => [:test,:features]
47
-
50
+ # only run rubocop on platforms where it is supported, sigh
51
+ if RUBY_VERSION >= '1.9.2'
52
+ require 'rubocop/rake_task'
53
+ Rubocop::RakeTask.new
54
+ task :default => [:rubocop,:test,:features]
55
+ else
56
+ task :default => [:test,:features]
57
+ end
48
58
 
49
59
 
50
60
  desc "Migrate an existing local .lolcommits directory to Dropbox"
@@ -53,25 +63,25 @@ task :dropboxify do
53
63
  dropbox_loldir = "#{$home}/Dropbox/lolcommits"
54
64
  loldir = "#{$home}/.lolcommits"
55
65
  backup_loldir = "#{$home}/.lolcommits.old"
56
-
66
+
57
67
  #check whether we've done this already
58
68
  if File.symlink? loldir
59
69
  abort "already dropboxified!"
60
70
  end
61
-
71
+
62
72
  #create dropbox folder
63
73
  if not File.directory? dropbox_loldir
64
74
  FileUtils.mkdir_p dropbox_loldir
65
75
  end
66
-
76
+
67
77
  #backup existing loldir
68
78
  if File.directory? loldir
69
79
  FileUtils.mv( loldir, backup_loldir )
70
80
  end
71
-
81
+
72
82
  #symlink dropbox to local
73
83
  FileUtils.ln_s( dropbox_loldir, loldir )
74
-
84
+
75
85
  #copy over existing files
76
86
  FileUtils.cp_r( "#{backup_loldir}/.", loldir)
77
87
  end
data/bin/lolcommits CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # -*- encoding: utf-8 -*-
2
3
 
3
4
  begin
4
5
  require 'lolcommits'
@@ -8,8 +9,8 @@ rescue LoadError
8
9
  end
9
10
 
10
11
  include Lolcommits
11
- require "launchy"
12
- require "choice"
12
+ require 'launchy'
13
+ require 'choice'
13
14
 
14
15
  require 'methadone'
15
16
  include Methadone::CLILogging
@@ -19,29 +20,29 @@ include Methadone::CLILogging
19
20
  #
20
21
 
21
22
  def die_on_fatal_conditions!
22
- if Configuration.is_mac?
23
+ if Configuration.platform_mac?
23
24
  %w(imagesnap videosnap).each do |executable|
24
- unless File.executable? File.join(Configuration::LOLCOMMITS_ROOT, "vendor", "ext", executable, executable)
25
+ unless File.executable? File.join(Configuration::LOLCOMMITS_ROOT, 'vendor', 'ext', executable, executable)
25
26
  fatal "Couldn't properly execute #{executable} for some reason, please file a bug?!"
26
27
  exit 1
27
28
  end
28
29
  end
29
- elsif Configuration.is_linux?
30
+ elsif Configuration.platform_linux?
30
31
  if not Configuration.command_which('mplayer')
31
32
  fatal "Couldn't find mplayer in your PATH!"
32
33
  exit 1
33
34
  end
34
35
  end
35
- unless File.readable? File.join(Configuration::LOLCOMMITS_ROOT, "vendor", "fonts", "Impact.ttf")
36
+ unless File.readable? File.join(Configuration::LOLCOMMITS_ROOT, 'vendor', 'fonts', 'Impact.ttf')
36
37
  fatal "Couldn't properly read Impact font from gem package, please file a bug?!"
37
38
  exit 1
38
39
  end
39
40
  if !Configuration.valid_ffmpeg_installed? && capture_animate
40
- fatal "FATAL: ffmpeg does not appear to be properly installed!"
41
+ fatal 'FATAL: ffmpeg does not appear to be properly installed!'
41
42
  exit 1
42
43
  end
43
44
  unless Configuration.valid_imagemagick_installed?
44
- fatal "FATAL: ImageMagick does not appear to be properly installed!"
45
+ fatal 'FATAL: ImageMagick does not appear to be properly installed!'
45
46
  exit 1
46
47
  end
47
48
  if Configuration.git_config_color_always?
@@ -53,8 +54,8 @@ end
53
54
 
54
55
  def die_if_not_git_repo!
55
56
  begin
56
- debug "Checking for valid git repo"
57
- g=Git.open('.')
57
+ debug 'Checking for valid git repo'
58
+ g = Git.open('.')
58
59
  rescue ArgumentError
59
60
  # ruby-git throws an argument error if path isnt for a valid git repo...
60
61
  fatal "Erm? Can't do that since we're not in a valid git repository!"
@@ -62,115 +63,14 @@ def die_if_not_git_repo!
62
63
  end
63
64
  end
64
65
 
65
- def good_shebang?
66
- File.read(HOOK_PATH).lines.first =~ /^\#\!\/bin\/.*sh/
67
- end
68
-
69
- def lolcommits_hook?
70
- File.exists?(HOOK_PATH) &&
71
- File.read(HOOK_PATH).to_s =~ /lolcommits.*\(begin\)(.*\n)*.*lolcommits.*\(end\)/
72
- end
73
-
74
- def remove_existing_hook
75
- hook = File.read(HOOK_PATH)
76
- out = File.open(HOOK_PATH, 'w')
77
- skip = false
78
-
79
- hook.lines.each do |line|
80
- if !skip && (line =~ /lolcommits.*\(begin\)/)
81
- skip = true
82
- end
83
-
84
- out << line unless skip
85
-
86
- if skip && (line =~ /lolcommits.*\(end\)/)
87
- skip = false
88
- end
89
- end
90
-
91
- out.close
92
- end
93
-
94
66
  #
95
67
  # NO ARGUMENTS SPECIFIED, HELP THE USER OUT
96
68
  #
97
69
  def do_noargs
98
- #TODO: make this a contextual helper to know status of whether lolcommits is enabled
99
- puts "Do what exactly?"
100
- puts "Try: lolcommits --enable (when in a git repository)"
101
- puts "Or: lolcommits --help"
102
- end
103
-
104
- HOOK_PATH = File.join ".git", "hooks", "post-commit"
105
- HOOK_DIR = File.join ".git", "hooks"
106
-
107
- #
108
- # IF --ENABLE, DO ENABLE
109
- #
110
- def do_enable
111
- if not File.directory?(".git")
112
- fatal "You don't appear to be in the base directory of a git project."
113
- exit 1
114
- end
115
-
116
- #its possible a hooks dir doesnt exist, so create it if so
117
- if not File.directory?(HOOK_DIR)
118
- Dir.mkdir(HOOK_DIR)
119
- end
120
-
121
- # clear away any existing lolcommits hook
122
- if hook_exists = File.exists?(HOOK_PATH)
123
- remove_existing_hook
124
-
125
- # check for a good shebang line in the existing hook
126
- unless good_shebang?
127
- warn "the existing hook (at #{HOOK_PATH}) doesn't start with with a good shebang; like #!/bin/sh"
128
- exit 1
129
- end
130
- end
131
-
132
- File.open(HOOK_PATH, hook_exists ? 'a' : 'w') do |f|
133
- f.write(hook_script(!hook_exists))
134
- end
135
-
136
- FileUtils.chmod 0755, HOOK_PATH
137
-
138
- info "installed lolcommmit hook to:"
139
- info " -> #{File.expand_path(HOOK_PATH)}"
140
- info "(to remove later, you can use: lolcommits --disable)"
141
- # we dont symlink, but rather install a small stub that calls the one from path
142
- # that way, as gem version changes, script updates even if new file thus breaking symlink
143
- end
144
-
145
- def hook_script(add_shebang = true)
146
- shebang = add_shebang ? "#!/bin/sh\n\n" : ''
147
- ruby_path = Lolcommits::Configuration.command_which('ruby')
148
- hook_export = "export PATH=\"#{ruby_path}:$PATH\"\n" if ruby_path
149
- capture_cmd = 'lolcommits --capture'
150
- capture_args = " #{ARGV[1..-1].join(' ')}" if ARGV.length > 1
151
-
152
- <<-EOS
153
- #{shebang}### lolcommits hook (begin) ###
154
- #{hook_export}#{capture_cmd}#{capture_args}
155
- ### lolcommits hook (end) ###
156
- EOS
157
- end
158
-
159
- #
160
- # IF --DISABLE, DO DISABLE
161
- #
162
- def do_disable
163
- if lolcommits_hook?
164
- remove_existing_hook
165
- info "uninstalled lolcommits hook (from #{HOOK_PATH})"
166
- elsif File.exists?(HOOK_PATH)
167
- info "couldn't find an lolcommits hook (at #{HOOK_PATH})"
168
- if File.read(HOOK_PATH) =~ /lolcommit/
169
- info "warning: an older-style lolcommit hook may still exist, edit #{HOOK_PATH} to remove it manually"
170
- end
171
- else
172
- info "no post commit hook found (at #{HOOK_PATH}), so there is nothing to uninstall"
173
- end
70
+ # TODO: make this a contextual helper to know status of whether lolcommits is enabled
71
+ puts 'Do what exactly?'
72
+ puts 'Try: lolcommits --enable (when in a git repository)'
73
+ puts 'Or: lolcommits --help'
174
74
  end
175
75
 
176
76
  def configuration
@@ -191,14 +91,14 @@ end
191
91
  # IF --CAPTURE, DO CAPTURE
192
92
  #
193
93
  def do_capture
194
- capture_delay = Choice.choices[:delay] || ENV['LOLCOMMITS_DELAY'] || 0
195
- capture_stealth = Choice.choices[:stealth] || ENV['LOLCOMMITS_STEALTH'] || nil
196
- capture_device = Choice.choices[:device] || ENV['LOLCOMMITS_DEVICE'] || nil
197
- capture_font = Choice.choices[:font] || ENV['LOLCOMMITS_FONT'] || nil
94
+ capture_delay = Choice.choices[:delay] || ENV['LOLCOMMITS_DELAY'] || 0
95
+ capture_stealth = Choice.choices[:stealth] || ENV['LOLCOMMITS_STEALTH'] || nil
96
+ capture_device = Choice.choices[:device] || ENV['LOLCOMMITS_DEVICE'] || nil
97
+ capture_font = Choice.choices[:font] || ENV['LOLCOMMITS_FONT'] || nil
198
98
 
199
99
  fork_me? do
200
100
  if Choice.choices[:test]
201
- info "*** Capturing in test mode."
101
+ info '*** Capturing in test mode.'
202
102
  runner = Lolcommits::Runner.new(
203
103
  :capture_delay => capture_delay,
204
104
  :capture_stealth => capture_stealth,
@@ -258,7 +158,7 @@ def do_last
258
158
  die_if_not_git_repo!
259
159
  lolimage = configuration.most_recent
260
160
  if lolimage.nil?
261
- warn "No lolcommits have been captured for this repository yet."
161
+ warn 'No lolcommits have been captured for this repository yet.'
262
162
  exit 1
263
163
  end
264
164
  Launchy.open lolimage
@@ -268,154 +168,183 @@ def do_gif
268
168
  die_if_not_git_repo!
269
169
 
270
170
  case Choice.choices[:gif]
271
- when "today"
171
+ when 'today'
272
172
  lolimages = configuration.images_today
273
173
  filename = "#{Date.today.to_s}.gif"
274
174
  else
275
175
  lolimages = configuration.images
276
- filename = "archive.gif"
176
+ filename = 'archive.gif'
277
177
  end
278
178
 
279
179
  if lolimages.empty?
280
- warn "No lolcommits have been captured for this time yet."
180
+ warn 'No lolcommits have been captured for this time yet.'
281
181
  exit 1
282
182
  end
283
183
 
284
- puts "*** Generating animated gif."
184
+ puts '*** Generating animated gif.'
285
185
 
286
186
  gif = MiniMagick::Image.new File.join configuration.archivedir, filename
287
187
 
288
188
  # This is for ruby 1.8.7, *lolimages just doesn't work with ruby 187
289
- gif.run_command("convert", *[ "-delay", "50", "-loop", "0", lolimages, "#{gif.path}"].flatten)
189
+ gif.run_command('convert', *['-delay', '50', '-loop', '0', lolimages, "#{gif.path}"].flatten)
290
190
 
291
191
  puts "*** #{gif.path} generated."
292
192
  end
293
193
 
194
+ def print_version_and_exit
195
+ puts Lolcommits::VERSION
196
+ exit 0
197
+ end
198
+
199
+ def change_dir_to_root_or_repo!
200
+ debug 'Walking up dir tree'
201
+ loop do
202
+ cur = File.expand_path('.')
203
+ nxt = File.expand_path('..', cur)
204
+ if File.directory?(File.expand_path('.git')) || nxt == cur
205
+ return # found root or git dir
206
+ end
207
+ Dir.chdir(nxt)
208
+ end
209
+ end
210
+
294
211
  #
295
212
  # Command line parsing fun
296
213
  #
297
214
  Choice.options do
298
215
 
216
+ option :version do
217
+ long '--version'
218
+ short '-v'
219
+ desc 'print version and exit'
220
+ action { print_version_and_exit }
221
+ end
222
+
299
223
  option :enable do
300
- long "--enable"
224
+ long '--enable'
301
225
  short '-e'
302
- action { do_enable }
303
- desc "install lolcommits for this repo"
226
+ action { Installation.do_enable }
227
+ desc 'install lolcommits for this repo'
304
228
  end
305
229
 
306
230
  option :disable do
307
- long "--disable"
231
+ long '--disable'
308
232
  short '-d'
309
- action { do_disable }
310
- desc "uninstall lolcommits for this repo"
233
+ action { Installation.do_disable }
234
+ desc 'uninstall lolcommits for this repo'
311
235
  end
312
236
 
313
237
  option :capture do
314
- long "--capture"
238
+ long '--capture'
315
239
  short '-c'
316
- desc "capture lolcommit based on last git commit"
240
+ desc 'capture lolcommit based on last git commit'
317
241
  end
318
242
 
319
243
  option :last do
320
- long "--last"
321
- short "-l"
322
- desc "view the most recent lolcommit"
244
+ long '--last'
245
+ short '-l'
246
+ desc 'view the most recent lolcommit'
323
247
  end
324
248
 
325
249
  option :browse do
326
- long "--browse"
327
- short "-b"
250
+ long '--browse'
251
+ short '-b'
328
252
  desc "browse this repo's lolcommits"
329
253
  end
330
254
 
331
255
  option :configure do
332
- long "--config"
333
- desc "configure a plugin"
256
+ long '--config'
257
+ desc 'configure a plugin'
334
258
  end
335
259
 
336
260
  option :show_config do
337
- short "-sc"
338
- long "--show-config"
339
- desc "display configuration file"
261
+ short '-sc'
262
+ long '--show-config'
263
+ desc 'display configuration file'
340
264
  end
341
265
 
342
266
  option :plugin do
343
- desc "pass plugin name for --config"
344
- long "--plugin"
345
- short "-p"
267
+ desc 'pass plugin name for --config'
268
+ long '--plugin'
269
+ short '-p'
346
270
  default nil
347
271
  end
348
272
 
349
273
  option :plugins do
350
- desc "list all available plugins"
351
- long "--plugins"
274
+ desc 'list all available plugins'
275
+ long '--plugins'
352
276
  end
353
277
 
354
278
  option :test do
355
- long "--test"
356
- desc "Run in test mode"
279
+ long '--test'
280
+ desc 'Run in test mode'
357
281
  end
358
282
 
359
283
  option :sha do
360
- desc "pass SHA manually [TEST-MODE]"
361
- long "--sha"
284
+ desc 'pass SHA manually [TEST-MODE]'
285
+ long '--sha'
362
286
  short '-s'
363
- default "test-#{rand(10 ** 10)}"
287
+ default "test-#{rand(10**10)}"
364
288
  end
365
289
 
366
290
  option :msg do
367
- desc "pass commit msg manually [TEST-MODE]"
368
- long "--msg"
291
+ desc 'pass commit msg manually [TEST-MODE]'
292
+ long '--msg'
369
293
  short '-m'
370
- default "this is a test message i didnt really commit something"
294
+ default 'this is a test message i didnt really commit something'
371
295
  end
372
296
 
373
297
  option :delay do
374
- long "--delay=SECONDS"
375
- desc "delay taking of the snapshot by n seconds"
298
+ long '--delay=SECONDS'
299
+ desc 'delay taking of the snapshot by n seconds'
376
300
  cast Integer
377
301
  short '-w'
378
302
  end
379
303
 
380
304
  option :stealth do
381
- long "--stealth"
382
- desc "capture image in stealth mode"
305
+ long '--stealth'
306
+ desc 'capture image in stealth mode'
383
307
  end
384
308
 
385
309
  option :device do
386
- long "--device=DEVICE"
387
- desc "the device name used to take the snapshot (only mac/linux)"
310
+ long '--device=DEVICE'
311
+ desc 'the device name used to take the snapshot (mac/linux only)'
312
+ end
313
+
314
+ option :devices do
315
+ long '--devices'
316
+ desc 'list all video devices available (mac only)'
388
317
  end
389
318
 
390
319
  option :debug do
391
- long "--debug"
392
- desc "Output debugging information"
320
+ long '--debug'
321
+ desc 'output debugging information'
393
322
  end
394
323
 
395
324
  option :font do
396
- long "--font=FONT_PATH"
397
- short "-f"
398
- desc "pass font file location"
325
+ long '--font=FONT_PATH'
326
+ short '-f'
327
+ desc 'pass font file location'
399
328
  end
400
329
 
401
330
  option :gif do
402
- long "--gif"
403
- short "-g"
404
- desc "generate animated timeline gif from captured images"
331
+ long '--gif'
332
+ short '-g'
333
+ desc 'generate animated timeline gif from captured images'
405
334
  end
406
335
 
407
336
  if Configuration.can_animate?
408
337
  option :animate do
409
- long "--animate=SECONDS"
410
- short "-a"
338
+ long '--animate=SECONDS'
339
+ short '-a'
411
340
  cast Integer
412
- desc "enable animated gif captures with duration (seconds)"
341
+ desc 'enable animated gif captures with duration (seconds)'
413
342
  end
414
343
  end
415
344
 
416
345
  option :fork do
417
- long "--fork"
418
- desc "fork the lolcommits runner to the background"
346
+ long '--fork'
347
+ desc 'fork the lolcommits runner to the background'
419
348
  end
420
349
  end
421
350
 
@@ -423,7 +352,7 @@ end
423
352
  debug_mode = Choice.choices[:debug] || ENV['LOLCOMMITS_DEBUG'] || nil
424
353
  if debug_mode
425
354
  logger.level = Logger::DEBUG
426
- debug "Outputting at DEBUG verbosity"
355
+ debug 'Outputting at DEBUG verbosity'
427
356
  end
428
357
 
429
358
  #
@@ -431,26 +360,33 @@ end
431
360
  #
432
361
  die_on_fatal_conditions!
433
362
 
363
+ #
364
+ # change working dir to either a repo or the fs root
365
+ #
366
+ change_dir_to_root_or_repo!
367
+
434
368
  #
435
369
  # Handle actions manually since choice seems weird
436
370
  #
437
371
  if not (Choice.choices[:enable] || Choice.choices[:disable])
438
372
  if Choice.choices[:capture]
439
- do_capture()
373
+ do_capture
440
374
  elsif Choice.choices[:configure]
441
- do_configure()
375
+ do_configure
442
376
  elsif Choice.choices[:show_config]
443
377
  puts configuration
444
378
  elsif Choice.choices[:plugins]
445
- configuration.puts_plugins()
379
+ configuration.puts_plugins
380
+ elsif Choice.choices[:devices]
381
+ configuration.puts_devices
446
382
  elsif Choice.choices[:last]
447
- do_last()
383
+ do_last
448
384
  elsif Choice.choices[:browse]
449
385
  die_if_not_git_repo!
450
386
  Launchy.open configuration.loldir
451
387
  elsif Choice.choices[:gif]
452
- do_gif()
388
+ do_gif
453
389
  else
454
- do_noargs()
390
+ do_noargs
455
391
  end
456
392
  end