myimdb 0.3.8 → 0.3.9

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.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/bin/myimdb-catalogue +17 -1
  3. data/myimdb.gemspec +1 -1
  4. metadata +1 -1
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.8
1
+ 0.3.9
data/bin/myimdb-catalogue CHANGED
@@ -9,6 +9,14 @@ class Platform
9
9
  def windows?
10
10
  RUBY_PLATFORM =~ /mswin|windows|mingw/i
11
11
  end
12
+
13
+ def xp?
14
+ ENV["ALLUSERSPROFILE"] =~ /Documents and Settings/
15
+ end
16
+
17
+ def vista_or_later?
18
+ !xp?
19
+ end
12
20
 
13
21
  def mac?
14
22
  RUBY_PLATFORM =~ /darwin/i
@@ -85,6 +93,14 @@ def icon_file_name
85
93
  end
86
94
  end
87
95
 
96
+ def icon_size
97
+ if Platform.windows?
98
+ Platform.vista_or_later? ? '256x256' : '128x128'
99
+ else
100
+ '512x512'
101
+ end
102
+ end
103
+
88
104
  def filtered_movie_name(name)
89
105
  name.gsub(/\[.*?\]/,'').strip
90
106
  end
@@ -109,7 +125,7 @@ def repair_permissions_for(target_dir)
109
125
  end
110
126
 
111
127
  def convert_to_icon(image_file_path, icon_file_path)
112
- `convert "#{image_file_path}" -thumbnail 256x256 -gravity center -crop 256x256+0+0! -background transparent -flatten "#{icon_file_path}"`
128
+ `convert "#{image_file_path}" -thumbnail #{icon_size} -gravity center -crop #{icon_size}+0+0! -background transparent -flatten "#{icon_file_path}"`
113
129
  end
114
130
 
115
131
  def save_image(target_dir, name, image_index=0)
data/myimdb.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{myimdb}
8
- s.version = "0.3.8"
8
+ s.version = "0.3.9"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Gaurav"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: myimdb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.8
4
+ version: 0.3.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gaurav