movier 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc ADDED
@@ -0,0 +1,6 @@
1
+ = movier
2
+
3
+ Describe your project here
4
+
5
+ :include:movier.rdoc
6
+
data/bin/movier ADDED
@@ -0,0 +1,132 @@
1
+ #!/usr/bin/env ruby
2
+ require 'gli'
3
+ begin # XXX: Remove this begin/rescue before distributing your app
4
+ require 'movier'
5
+ rescue LoadError => e
6
+ puts e.message
7
+ STDERR.puts "In development, you need to use `bundle exec bin/movier` to run your app"
8
+ STDERR.puts "At install-time, RubyGems will make sure lib, etc. are in the load path"
9
+ STDERR.puts "Feel free to remove this message from bin/movier now"
10
+ exit 64
11
+ end
12
+
13
+ include GLI::App
14
+ lmdb = Movier::LMDB.new
15
+
16
+ version Movier::VERSION
17
+ program_desc 'Movier allows you to organize your movies, quickly.'
18
+
19
+ desc 'Find the IMDB.com rating for the given movie'
20
+ arg_name 'movie name'
21
+ command [:imdb, :rating] do |c|
22
+ c.desc 'Be verbose with information'
23
+ c.switch [:v, :verbose]
24
+
25
+ c.desc 'Do not ignore movies with less than 1000 votes'
26
+ c.switch [:a, :all]
27
+
28
+ c.desc 'Movie from a particular year'
29
+ c.default_value nil
30
+ c.flag :year
31
+
32
+ c.action do |global_options,options,args|
33
+ movie = args.join(" ")
34
+ Movier::info movie, options
35
+ end
36
+ end
37
+
38
+ desc 'Update the local movie database [LMDB]'
39
+ arg_name 'directory_to_add', optional: true, multiple: true
40
+ command [:update] do |c|
41
+ c.action do |global_options,options,args|
42
+ if args.any?
43
+ args.each { |dir| lmdb.add dir }
44
+ else
45
+ lmdb.update_itself
46
+ end
47
+ end
48
+ end
49
+
50
+ desc 'Get a list of IMDB.com defined genre'
51
+ command [:genre] do |c|
52
+ c.action do |global_options,options,args|
53
+ lmdb.genre
54
+ end
55
+ end
56
+
57
+ desc 'Find a movie locally based on conditions'
58
+ command [:find, :local] do |c|
59
+ c.desc "Find a movie with given actors"
60
+ c.flag [:a, :actors]
61
+ c.desc "Find a movie with given directors"
62
+ c.flag [:d, :directors]
63
+ c.desc "Find a movie with given writers"
64
+ c.flag [:w, :writers]
65
+ c.desc "Find a movie with given genre"
66
+ c.flag [:g, :genre]
67
+ c.desc "Find a movie with given PG rating"
68
+ c.flag [:r, :rated]
69
+ c.desc "Limit number of movies returned"
70
+ c.default_value 0
71
+ c.flag [:l, :limit]
72
+ c.desc "Find movies with keywords"
73
+ c.flag [:k, :keywords]
74
+ c.desc "Find movies with IMDB.com points above.."
75
+ c.default_value 0
76
+ c.flag [:p, :points]
77
+ c.desc "Find movies with given tags"
78
+ c.flag [:t, :tags]
79
+ c.desc "Exclude movies with given tags"
80
+ c.flag [:exclude_tags]
81
+ c.desc 'Add tags for the movies that were found'
82
+ c.flag [:add_tags]
83
+ c.desc "Give detailed information about the movies"
84
+ c.switch [:v, :verbose]
85
+ c.desc "Find a random movie based on given conditions, and play it!"
86
+ c.switch [:s, :shuffle]
87
+ c.action do |global_options,options,args|
88
+ lmdb.find options
89
+ end
90
+ end
91
+
92
+ desc 'Organize movies in a folder'
93
+ arg_name 'folder path'
94
+ command [:classify, :organize] do |c|
95
+
96
+ # c.desc 'Directory where movies will be saved after organizing'
97
+ # c.default_value "/Volumes/JukeBox/Movies"
98
+ # c.flag :dir
99
+
100
+ c.desc 'Classify all movies with this language'
101
+ c.flag :lang
102
+
103
+ c.desc 'Automatically guess movie targets'
104
+ c.switch [:g, :guess]
105
+
106
+ c.action do |global_options,options,args|
107
+ Movier.organize args, options
108
+ end
109
+ end
110
+
111
+ pre do |global,command,options,args|
112
+ # Pre logic here
113
+ # Return true to proceed; false to abort and not call the
114
+ # chosen command
115
+ # Use skips_pre before a command to skip this block
116
+ # on that command only
117
+ true
118
+ end
119
+
120
+ post do |global,command,options,args|
121
+ # Post logic here
122
+ # Use skips_post before a command to skip this
123
+ # block on that command only
124
+ end
125
+
126
+ on_error do |exception|
127
+ # Error logic here
128
+ # return false to skip default error handling
129
+ true
130
+ end
131
+
132
+ exit run(ARGV)
data/lib/movier.rb ADDED
@@ -0,0 +1,20 @@
1
+ require 'movier/version.rb'
2
+
3
+ # Add requires for other files you add to your project here, so
4
+ # you just need to require this one file in your bin file
5
+
6
+ require 'open-uri'
7
+ require 'json'
8
+ require 'httparty'
9
+ require 'highline/import'
10
+ require 'pry'
11
+ require 'digest/md5'
12
+
13
+ require 'movier/say.rb'
14
+ require 'movier/api.rb'
15
+ require 'movier/helpers.rb'
16
+
17
+ require 'movier/movier.rb'
18
+ require 'movier/organize.rb'
19
+ require 'movier/lmdb.rb'
20
+ require 'movier/info.rb'
@@ -0,0 +1,3 @@
1
+ module Movier
2
+ VERSION = '0.0.1'
3
+ end
data/movier.rdoc ADDED
@@ -0,0 +1,5 @@
1
+ = movier
2
+
3
+ Generate this with
4
+ movier rdoc
5
+ After you have described your command line interface
metadata ADDED
@@ -0,0 +1,176 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: movier
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Nikhil Gupta
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-02-25 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: highline
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: httparty
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ - !ruby/object:Gem::Dependency
47
+ name: pry
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ - !ruby/object:Gem::Dependency
63
+ name: rake
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ type: :development
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ - !ruby/object:Gem::Dependency
79
+ name: rdoc
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ type: :development
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ - !ruby/object:Gem::Dependency
95
+ name: aruba
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ! '>='
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ type: :development
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ - !ruby/object:Gem::Dependency
111
+ name: gli
112
+ requirement: !ruby/object:Gem::Requirement
113
+ none: false
114
+ requirements:
115
+ - - '='
116
+ - !ruby/object:Gem::Version
117
+ version: 2.5.3
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - '='
124
+ - !ruby/object:Gem::Version
125
+ version: 2.5.3
126
+ description:
127
+ email: me@nikhgupta.com
128
+ executables:
129
+ - movier
130
+ extensions: []
131
+ extra_rdoc_files:
132
+ - README.rdoc
133
+ - movier.rdoc
134
+ files:
135
+ - bin/movier
136
+ - lib/movier/version.rb
137
+ - lib/movier.rb
138
+ - README.rdoc
139
+ - movier.rdoc
140
+ homepage: http://nikhgupta.com
141
+ licenses: []
142
+ post_install_message:
143
+ rdoc_options:
144
+ - --title
145
+ - movier
146
+ - --main
147
+ - README.rdoc
148
+ - -ri
149
+ require_paths:
150
+ - lib
151
+ - lib
152
+ required_ruby_version: !ruby/object:Gem::Requirement
153
+ none: false
154
+ requirements:
155
+ - - ! '>='
156
+ - !ruby/object:Gem::Version
157
+ version: '0'
158
+ segments:
159
+ - 0
160
+ hash: 2458896892976242213
161
+ required_rubygems_version: !ruby/object:Gem::Requirement
162
+ none: false
163
+ requirements:
164
+ - - ! '>='
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
167
+ segments:
168
+ - 0
169
+ hash: 2458896892976242213
170
+ requirements: []
171
+ rubyforge_project:
172
+ rubygems_version: 1.8.24
173
+ signing_key:
174
+ specification_version: 3
175
+ summary: Movier is a gem that allows you to quickly organize your movies
176
+ test_files: []