moviesort 0.1.2 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README +6 -0
  2. data/VERSION +1 -1
  3. data/lib/moviesort/command_line.rb +6 -1
  4. metadata +5 -4
data/README ADDED
@@ -0,0 +1,6 @@
1
+ Moviesort is a script to sort and file away your TV shows and movies
2
+
3
+ Usage: moviesort [options]
4
+ --source, -s <s>: Source directory (default: .)
5
+ --target, -t <s>: Target directory (default: .)
6
+ --help, -h: Show this message
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.1.4
@@ -7,6 +7,8 @@ module Moviesort
7
7
  new(options.split)
8
8
  end
9
9
 
10
+ MOVIE_EXTENSIONS = %w{avi mkv mov mp4}
11
+
10
12
  def initialize(argv = ARGV)
11
13
  @options = Trollop.options(argv) do
12
14
  banner <<-EOS.gsub(/^ {8}/, '')
@@ -22,7 +24,10 @@ module Moviesort
22
24
 
23
25
  def run
24
26
  sorter = Sorter::TV.new(@options[:target])
25
- Dir[File.join(@options[:source], '*.avi')].each do |file|
27
+ movie_files = Dir[File.join(@options[:source], '*')].select do |file|
28
+ MOVIE_EXTENSIONS.include?(File.extname(file)[1..-1])
29
+ end
30
+ movie_files.each do |file|
26
31
  sorter.sort_file(file)
27
32
  end
28
33
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: moviesort
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luke Redpath
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-11-14 00:00:00 +00:00
12
+ date: 2009-11-18 00:00:00 +00:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -20,10 +20,11 @@ executables:
20
20
  - moviesort
21
21
  extensions: []
22
22
 
23
- extra_rdoc_files: []
24
-
23
+ extra_rdoc_files:
24
+ - README
25
25
  files:
26
26
  - .gitignore
27
+ - README
27
28
  - Rakefile
28
29
  - VERSION
29
30
  - bin/moviesort