renmov 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -42,3 +42,28 @@ Feature: Options
42
42
  """
43
43
  mv TV.Show.S01E02.HDTV.x264-LOL.mp4 tv.show.s01e02.mp4
44
44
  """
45
+
46
+ Scenario: version (--version)
47
+ Given a blank slate
48
+ When I successfully run `renmov --version`
49
+ Then the output should contain the right version
50
+
51
+ Scenario: help (-h)
52
+ Given a blank slate
53
+ When I successfully run `renmov -h`
54
+ Then the output should contain:
55
+ """
56
+ Rename video files to a consistent format.
57
+
58
+ Usage: renmov [options] filename...
59
+ """
60
+
61
+ Scenario: help (--help)
62
+ Given a blank slate
63
+ When I successfully run `renmov --help`
64
+ Then the output should contain:
65
+ """
66
+ Rename video files to a consistent format.
67
+
68
+ Usage: renmov [options] filename...
69
+ """
@@ -0,0 +1,7 @@
1
+ Given /^a blank slate$/ do
2
+ # do nothing
3
+ end
4
+
5
+ Then /^the output should contain the right version$/ do
6
+ assert_partial_output(Renmov::VERSION, all_output)
7
+ end
data/lib/renmov/cli.rb CHANGED
@@ -18,6 +18,13 @@ module Renmov
18
18
 
19
19
  def parse_options
20
20
  optparse = OptionParser.new do |opts|
21
+ executable_name = File.basename($PROGRAM_NAME, '.rb')
22
+ opts.banner = <<EOL
23
+ Rename video files to a consistent format.
24
+
25
+ Usage: #{executable_name} [options] filename...
26
+ EOL
27
+
21
28
  opts.on('-v', '--verbose', 'Output more information') do
22
29
  options[:verbose] = true
23
30
  end
@@ -26,6 +33,16 @@ module Renmov
26
33
  options[:noop] = true
27
34
  options[:verbose] = true
28
35
  end
36
+
37
+ opts.on_tail('-h', '--help', 'Show this message') do
38
+ puts opts
39
+ exit
40
+ end
41
+
42
+ opts.on_tail('--version', 'Show version') do
43
+ puts Renmov::VERSION
44
+ exit
45
+ end
29
46
  end
30
47
 
31
48
  self.filenames = optparse.parse! args
@@ -1,3 +1,3 @@
1
1
  module Renmov
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: renmov
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -70,6 +70,7 @@ files:
70
70
  - bin/renmov
71
71
  - features/options.feature
72
72
  - features/rename_files.feature
73
+ - features/step_definitions/renmov_steps.rb
73
74
  - features/support/env.rb
74
75
  - lib/renmov.rb
75
76
  - lib/renmov/basic_renamer.rb
@@ -103,10 +104,11 @@ rubyforge_project:
103
104
  rubygems_version: 1.8.24
104
105
  signing_key:
105
106
  specification_version: 3
106
- summary: renmov-0.0.2
107
+ summary: renmov-0.0.3
107
108
  test_files:
108
109
  - features/options.feature
109
110
  - features/rename_files.feature
111
+ - features/step_definitions/renmov_steps.rb
110
112
  - features/support/env.rb
111
113
  - spec/renmov/basic_renamer_spec.rb
112
114
  - spec/renmov/cli_spec.rb