popcorn 1.1.1 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1f1ab2f5b749fd2276eb04eeb223e08bd0b2d57a
4
- data.tar.gz: dcb6ab92d54e5cc5655c47704e5ab64e90a39c80
3
+ metadata.gz: 2c6623cc711bdeeb364429d1b8bbcb5e805d27ca
4
+ data.tar.gz: fc7e14fe7ff039f694334cb55feaf61f01469fe2
5
5
  SHA512:
6
- metadata.gz: 3c9fa114aae40fd3cb32c1c254429ebeeb2cd10f07a6ba0b01e9193a1474404259849433794aa7506302692ea198c8da21423ad30632667971af0263073cfa59
7
- data.tar.gz: 8de3ecbd30c0dce4695d9e98af69a8ce2840155cfb231d09a5a19d5c689e33b6817682e012a058c6d6ef310ed088e09e1d01b0ead288983d2aa62946ecada2e4
6
+ metadata.gz: 6286ac1d285bd811cde716bb691c699fde147f375e3b6976319605638026014268b12f4e1cfa1a503648b1226617f9169b025e6b79e0dfb80a91f36e5debbc77
7
+ data.tar.gz: a93945e0ebcc3f277de750d774cae7876b60a2b3a5b61eba5bbc2dcf0dfc0c66fe5d3c854176ff683a541148ace1144529cd3bb3dec535b6306cb1540fd99923
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.1
1
+ 1.2.0
@@ -8,17 +8,19 @@ require 'popcorn/settings'
8
8
  class Popcorn::Driver < Thor
9
9
 
10
10
  desc "import MOVIE", "Move movie file into library."
11
- def import(movie)
11
+ def import(movie_filename)
12
12
  @moviemgr = Popcorn::MovieManager.new
13
13
 
14
14
  while true
15
- @moviemgr.lookup(movie)
15
+ puts "Please enter search term for movie name: "
16
+ movie = STDIN.gets.chomp
17
+
18
+ @moviemgr.lookup(movie, movie_filename)
16
19
  puts
17
20
  puts "Looking up #{movie}"
18
21
  unless @moviemgr.movie.nil?
19
22
  puts "Title: #{@moviemgr.movie[:title]}"
20
23
  puts "Year: #{@moviemgr.movie[:year]}"
21
- puts "Art URL: #{@moviemgr.movie[:poster_url]}"
22
24
  print "Is this correct? (y/n): "
23
25
  if STDIN.gets.chomp =~ /y/i
24
26
  begin
@@ -28,9 +30,6 @@ class Popcorn::Driver < Thor
28
30
  puts e.message
29
31
  end
30
32
  break
31
- else
32
- print "Please enter new search term: "
33
- movie = STDIN.gets.chomp
34
33
  end
35
34
  end
36
35
  end
@@ -15,11 +15,11 @@ module Popcorn
15
15
  @imdb = ImdbParty::Imdb.new
16
16
  end
17
17
 
18
- def lookup(movie)
18
+ def lookup(movie, movie_filename)
19
19
  if @path.nil?
20
- @path = Pathname.new(movie)
20
+ @path = Pathname.new(movie_filename)
21
21
  end
22
- movie = File.basename(movie, '.*')
22
+ #movie = File.basename(movie, '.*')
23
23
  @movie = @imdb.find_by_title(movie)[0]
24
24
  end
25
25
 
@@ -27,8 +27,8 @@ module Popcorn
27
27
  unless @path.exist?
28
28
  raise "Error: File does not exist #{@path}"
29
29
  end
30
- to_dir = "#{Settings.library}/#{@movie[:title]}/"
31
- filename = "#{@movie[:title]}#{@path.extname}"
30
+ to_dir = "#{Settings.library}/#{@movie[:title]} (#{@movie[:year]})/"
31
+ filename = "#{@movie[:title]} (#{@movie[:year]})#{@path.extname}"
32
32
  to_path = "#{to_dir}#{filename}"
33
33
  FileUtils.mkdir(to_dir)
34
34
  puts "Moving #{@path} to #{to_path}"
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: popcorn 1.1.1 ruby lib
5
+ # stub: popcorn 1.2.0 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "popcorn"
9
- s.version = "1.1.1"
9
+ s.version = "1.2.0"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["Blaine Pace"]
14
- s.date = "2017-03-18"
14
+ s.date = "2017-04-01"
15
15
  s.description = "Popcorn handles movie library management for you."
16
16
  s.email = "blainepace@gmail.com"
17
17
  s.executables = ["popcorn"]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: popcorn
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Blaine Pace
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-18 00:00:00.000000000 Z
11
+ date: 2017-04-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor