showfix 1.0.1 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -26,7 +26,14 @@ $ gem install showfix
26
26
 
27
27
  ## Usage
28
28
 
29
- *TODO*
29
+ The most common usage is to fix all files within the current directory. You can optionally add `--pretend` to the command if you would like to see what it will rename, without actually touching your files.
30
+
31
+ ```sh
32
+ $ cd SomeTvShow
33
+ $ showfix rename
34
+ ```
35
+
36
+ For detailed help, just run `showfix help` for a list of commands.
30
37
 
31
38
  ## Roadmap
32
39
 
data/lib/showfix/cli.rb CHANGED
@@ -9,12 +9,19 @@ module Showfix
9
9
  method_option "directory", type: :string, banner: 'PATH', aliases: "-d",
10
10
  default: ".",
11
11
  desc: "Specify the directory to work in. If not specified, use the current directory."
12
+
12
13
  method_option "season", type: :numeric, aliases: "-s",
13
14
  banner: '1', desc: "The season/series number"
15
+
16
+ method_option "series", type: :string, aliases: "-n",
17
+ banner: "\"Series Name\"", desc: "Specify the name of the TV series"
18
+
14
19
  method_option "pretend", type: :boolean, lazy_default: true, default: false,
15
20
  aliases: "-p", desc: "Do not rename files, only show outcome"
21
+
16
22
  method_option 'strip-year', type: :boolean, lazy_default: true, default: false,
17
23
  desc: 'Strip years from file names', aliases: '-y'
24
+
18
25
  method_option 'clean', type: :boolean, lazy_default: true, default: true,
19
26
  desc: "Strip encoding and resolution flags from filenames", aliases: '-c'
20
27
  def rename
@@ -27,6 +34,7 @@ module Showfix
27
34
  end
28
35
 
29
36
  episode_opts = {
37
+ series: options['series'],
30
38
  season: options['season'],
31
39
  year: options['strip-year'],
32
40
  flags: options['clean']
@@ -15,13 +15,15 @@ module Showfix
15
15
 
16
16
  @filename = filename
17
17
  @options = {
18
- season: nil
18
+ season: nil,
19
+ series: nil
19
20
  }.merge(options)
20
21
 
21
22
  @cleaner = Cleaner.new(@options)
22
23
  @parser = Parser.new(@options)
23
24
 
24
25
  @season ||= options[:season] # if they passed in a default season
26
+ @series ||= options[:series]
25
27
 
26
28
  @file_no_ext = @filename.chomp(File.extname(@filename))
27
29
  @extension = File.extname(@filename).gsub(/\./, '').downcase
@@ -42,6 +44,12 @@ module Showfix
42
44
  VALID_EXTENSIONS.include?(self.extension)
43
45
  end
44
46
 
47
+ # Parse season/episode info inputted by the user from the commandline
48
+ def update_season_episode(input)
49
+ # 1.1 => S1, E1
50
+ # 1.1-2 => S1, E1 & E2
51
+ # 1 => E1 (expect season to be from command line)
52
+ end
45
53
 
46
54
  def to_formatted_s
47
55
 
@@ -1,3 +1,3 @@
1
1
  module Showfix
2
- VERSION = "1.0.1"
2
+ VERSION = "1.1.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: showfix
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-04-14 00:00:00.000000000 Z
12
+ date: 2014-04-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
16
- requirement: &2153584980 !ruby/object:Gem::Requirement
16
+ requirement: &2160717760 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '1.3'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2153584980
24
+ version_requirements: *2160717760
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: thor
27
- requirement: &2153583700 !ruby/object:Gem::Requirement
27
+ requirement: &2160716340 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 0.18.1
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *2153583700
35
+ version_requirements: *2160716340
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rake
38
- requirement: &2153582420 !ruby/object:Gem::Requirement
38
+ requirement: &2160715680 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *2153582420
46
+ version_requirements: *2160715680
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rspec
49
- requirement: &2153580820 !ruby/object:Gem::Requirement
49
+ requirement: &2160713860 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 3.0.0.beta1
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *2153580820
57
+ version_requirements: *2160713860
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: simplecov
60
- requirement: &2153598700 !ruby/object:Gem::Requirement
60
+ requirement: &2160728480 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *2153598700
68
+ version_requirements: *2160728480
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: coveralls
71
- requirement: &2153596240 !ruby/object:Gem::Requirement
71
+ requirement: &2160727260 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *2153596240
79
+ version_requirements: *2160727260
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: pry
82
- requirement: &2153595620 !ruby/object:Gem::Requirement
82
+ requirement: &2160726340 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,7 +87,7 @@ dependencies:
87
87
  version: '0'
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *2153595620
90
+ version_requirements: *2160726340
91
91
  description: A gem to easily rename TV show files.
92
92
  email:
93
93
  - mrdempsey@gmail.com
@@ -137,7 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
137
137
  version: '0'
138
138
  segments:
139
139
  - 0
140
- hash: -2692044755987088624
140
+ hash: -917585063365791121
141
141
  requirements: []
142
142
  rubyforge_project:
143
143
  rubygems_version: 1.8.15