popcorn 1.1.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/popcorn.rb +5 -6
- data/lib/popcorn/movies.rb +5 -5
- data/popcorn.gemspec +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2c6623cc711bdeeb364429d1b8bbcb5e805d27ca
|
4
|
+
data.tar.gz: fc7e14fe7ff039f694334cb55feaf61f01469fe2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6286ac1d285bd811cde716bb691c699fde147f375e3b6976319605638026014268b12f4e1cfa1a503648b1226617f9169b025e6b79e0dfb80a91f36e5debbc77
|
7
|
+
data.tar.gz: a93945e0ebcc3f277de750d774cae7876b60a2b3a5b61eba5bbc2dcf0dfc0c66fe5d3c854176ff683a541148ace1144529cd3bb3dec535b6306cb1540fd99923
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.2.0
|
data/lib/popcorn.rb
CHANGED
@@ -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(
|
11
|
+
def import(movie_filename)
|
12
12
|
@moviemgr = Popcorn::MovieManager.new
|
13
13
|
|
14
14
|
while true
|
15
|
-
|
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
|
data/lib/popcorn/movies.rb
CHANGED
@@ -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(
|
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}"
|
data/popcorn.gemspec
CHANGED
@@ -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.
|
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.
|
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-
|
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.
|
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-
|
11
|
+
date: 2017-04-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|