royw-imdb 0.0.19 → 0.0.20
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.
- data/Rakefile +0 -35
- data/VERSION.yml +1 -1
- data/lib/imdb.rb +2 -0
- data/lib/imdb/imdb_profile.rb +0 -31
- data/lib/imdb/optional_logger.rb +31 -0
- metadata +3 -2
data/Rakefile
CHANGED
|
@@ -5,24 +5,6 @@ require 'spec/rake/spectask'
|
|
|
5
5
|
desc "Run all specs"
|
|
6
6
|
task :default => :spec
|
|
7
7
|
|
|
8
|
-
#desc "Run all specs"
|
|
9
|
-
#Spec::Rake::SpecTask.new('spec') do |t|
|
|
10
|
-
# t.spec_files = FileList['spec/**/*.rb']
|
|
11
|
-
#end
|
|
12
|
-
#
|
|
13
|
-
#desc "Run all specs and generate HTML report"
|
|
14
|
-
#Spec::Rake::SpecTask.new('spec:html') do |t|
|
|
15
|
-
# t.spec_files = FileList['spec/**/*.rb']
|
|
16
|
-
# t.spec_opts = ["--format", "html:spec.html"]
|
|
17
|
-
#end
|
|
18
|
-
#
|
|
19
|
-
#desc "Run all specs and dump the result to README"
|
|
20
|
-
#Spec::Rake::SpecTask.new('spec:readme') do |t|
|
|
21
|
-
# t.spec_files = FileList['spec/**/*.rb']
|
|
22
|
-
# t.spec_opts = ["--format", "specdoc:README"]
|
|
23
|
-
#end
|
|
24
|
-
|
|
25
|
-
|
|
26
8
|
Spec::Rake::SpecTask.new(:spec) do |spec|
|
|
27
9
|
spec.libs << 'lib' << 'spec'
|
|
28
10
|
spec.spec_files = FileList['spec/**/*_spec.rb']
|
|
@@ -47,23 +29,6 @@ Spec::Rake::SpecTask.new(:rcov) do |spec|
|
|
|
47
29
|
end
|
|
48
30
|
|
|
49
31
|
|
|
50
|
-
#namespace :gem do
|
|
51
|
-
# desc "Increments the Gem version in imdb.gemspec"
|
|
52
|
-
# task :increment do
|
|
53
|
-
# lines = File.new('imdb.gemspec').readlines
|
|
54
|
-
# lines.each do |line|
|
|
55
|
-
# next unless line =~ /version = '\d+\.\d+\.(\d+)'/
|
|
56
|
-
# line.gsub!(/\d+'/, "#{$1.to_i + 1}'")
|
|
57
|
-
# end
|
|
58
|
-
# File.open('imdb.gemspec', 'w') do |f|
|
|
59
|
-
# lines.each do |line|
|
|
60
|
-
# f.write(line)
|
|
61
|
-
# end
|
|
62
|
-
# end
|
|
63
|
-
# end
|
|
64
|
-
#end
|
|
65
|
-
|
|
66
|
-
|
|
67
32
|
begin
|
|
68
33
|
require 'jeweler'
|
|
69
34
|
Jeweler::Tasks.new do |gem|
|
data/VERSION.yml
CHANGED
data/lib/imdb.rb
CHANGED
|
@@ -5,7 +5,9 @@ require 'cgi'
|
|
|
5
5
|
require 'hpricot'
|
|
6
6
|
require 'chronic'
|
|
7
7
|
require 'ruby-debug'
|
|
8
|
+
require 'xmlsimple'
|
|
8
9
|
|
|
10
|
+
require File.dirname(__FILE__) + '/imdb/optional_logger'
|
|
9
11
|
require File.dirname(__FILE__) + '/imdb/imdb_search'
|
|
10
12
|
require File.dirname(__FILE__) + '/imdb/imdb_movie'
|
|
11
13
|
require File.dirname(__FILE__) + '/imdb/imdb_profile'
|
data/lib/imdb/imdb_profile.rb
CHANGED
|
@@ -18,37 +18,6 @@
|
|
|
18
18
|
# puts profile.imdb_id
|
|
19
19
|
#
|
|
20
20
|
|
|
21
|
-
# An optional logger.
|
|
22
|
-
# If initialized with a logger instance, uses the logger
|
|
23
|
-
# otherwise doesn't do anything.
|
|
24
|
-
# Basically trying to not require a particular logger class.
|
|
25
|
-
class OptionalLogger
|
|
26
|
-
# logger may be nil or a logger instance
|
|
27
|
-
def initialize(logger)
|
|
28
|
-
@logger = logger
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
# debug {...}
|
|
32
|
-
def debug(&blk)
|
|
33
|
-
@logger.debug(blk.call) unless @logger.nil?
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
# info {...}
|
|
37
|
-
def info(&blk)
|
|
38
|
-
@logger.info(blk.call) unless @logger.nil?
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
# warn {...}
|
|
42
|
-
def warn(&blk)
|
|
43
|
-
@logger.warn(blk.call) unless @logger.nil?
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
# error {...}
|
|
47
|
-
def error(&blk)
|
|
48
|
-
@logger.error(blk.call) unless @logger.nil?
|
|
49
|
-
end
|
|
50
|
-
end
|
|
51
|
-
|
|
52
21
|
class ImdbProfile
|
|
53
22
|
|
|
54
23
|
# options:
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# An optional logger.
|
|
2
|
+
# If initialized with a logger instance, uses the logger
|
|
3
|
+
# otherwise doesn't do anything.
|
|
4
|
+
# Basically trying to not require a particular logger class.
|
|
5
|
+
class OptionalLogger
|
|
6
|
+
# logger may be nil or a logger instance
|
|
7
|
+
def initialize(logger)
|
|
8
|
+
@logger = logger
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# debug {...}
|
|
12
|
+
def debug(&blk)
|
|
13
|
+
@logger.debug(blk.call) unless @logger.nil?
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
# info {...}
|
|
17
|
+
def info(&blk)
|
|
18
|
+
@logger.info(blk.call) unless @logger.nil?
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# warn {...}
|
|
22
|
+
def warn(&blk)
|
|
23
|
+
@logger.warn(blk.call) unless @logger.nil?
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# error {...}
|
|
27
|
+
def error(&blk)
|
|
28
|
+
@logger.error(blk.call) unless @logger.nil?
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: royw-imdb
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.20
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Roy Wright
|
|
@@ -9,7 +9,7 @@ autorequire:
|
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
11
|
|
|
12
|
-
date: 2009-04-
|
|
12
|
+
date: 2009-04-16 00:00:00 -07:00
|
|
13
13
|
default_executable:
|
|
14
14
|
dependencies: []
|
|
15
15
|
|
|
@@ -31,6 +31,7 @@ files:
|
|
|
31
31
|
- lib/imdb/imdb_movie.rb
|
|
32
32
|
- lib/imdb/imdb_profile.rb
|
|
33
33
|
- lib/imdb/imdb_search.rb
|
|
34
|
+
- lib/imdb/optional_logger.rb
|
|
34
35
|
- lib/object_extensions.rb
|
|
35
36
|
- lib/string_extensions.rb
|
|
36
37
|
- spec/cache_extensions.rb
|