gimdb 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.1
1
+ 0.0.2
data/bin/gimdb CHANGED
@@ -1,9 +1,10 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require 'src/gimdb.rb'
3
+ $GIMDB_PATH = "#{File.dirname(__FILE__)}/.."
4
+ $DOMAIN = 'gimdb'
5
+ $LOCALEDIR = "#{$GIMDB_PATH}/data/locale"
4
6
 
5
- $DOMAIN = 'gimdb'
6
- $LOCALEDIR = 'data/locale'
7
+ require "#{$GIMDB_PATH}/src/gimdb.rb"
7
8
 
8
- GimdbGlade.new('data/gimdb.glade')
9
+ GimdbGlade.new("#{$GIMDB_PATH}/data/gimdb.glade")
9
10
  Gtk.main
data/gimdb.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{gimdb}
8
- s.version = "0.0.1"
8
+ s.version = "0.0.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Enrico Pilotto"]
data/lib/imdb.rb CHANGED
@@ -6,9 +6,7 @@ require 'net/http'
6
6
 
7
7
  class IMDB
8
8
 
9
- @@URL = 'http://www.imdb.com/search/title/'
10
- @@BASE_URL = 'www.imdb.com'
11
- @@PATH_URL = '/search/title/'
9
+ @@URL = 'http://www.imdb.com/search/title/'
12
10
 
13
11
 
14
12
  module StringStripper
data/src/controller.rb CHANGED
@@ -1,5 +1,5 @@
1
- require 'lib/imdb'
2
- require 'src/model'
1
+ require "#{$GIMDB_PATH}/lib/imdb"
2
+ require "#{$GIMDB_PATH}/src/model"
3
3
 
4
4
 
5
5
  module Controller
data/src/gimdb.rb CHANGED
@@ -22,9 +22,9 @@ rescue LoadError => e
22
22
  puts ""
23
23
  exit -1
24
24
  end
25
- require 'lib/imdb'
26
- require 'src/controller'
27
- require 'src/movie_box'
25
+ require "#{$GIMDB_PATH}/lib/imdb"
26
+ require "#{$GIMDB_PATH}/src/controller"
27
+ require "#{$GIMDB_PATH}/src/movie_box"
28
28
 
29
29
 
30
30
  class GimdbGlade
@@ -91,7 +91,7 @@ class GimdbGlade
91
91
  @combo_rating_from.active = 0
92
92
  @combo_rating_to.active = 9
93
93
  @combo_sort.active = 0
94
- @image_spinner.pixbuf_animation = Gdk::PixbufAnimation.new('data/icons/spinner16x16.gif')
94
+ @image_spinner.pixbuf_animation = Gdk::PixbufAnimation.new("#{$GIMDB_PATH}/data/icons/spinner16x16.gif")
95
95
  @scrolled.add_with_viewport(@vbox_movies)
96
96
  @scrolled.vscrollbar.signal_connect('value-changed') do |s|
97
97
  x = (s.adjustment.upper * 90.0)/100.0
data/src/model.rb CHANGED
@@ -3,14 +3,14 @@ require 'active_record'
3
3
  require 'etc'
4
4
 
5
5
 
6
- $GIMDB_PATH = "#{Etc.getpwuid.dir}/.gimdb"
7
- Dir.mkdir($GIMDB_PATH) unless File.exist?($GIMDB_PATH)
8
- Dir.mkdir("#{$GIMDB_PATH}/posters") unless File.exist?("#{$GIMDB_PATH}/posters")
6
+ $GIMDB_LOCAL_PATH = "#{Etc.getpwuid.dir}/.gimdb"
7
+ Dir.mkdir($GIMDB_LOCAL_PATH) unless File.exist?($GIMDB_LOCAL_PATH)
8
+ Dir.mkdir("#{$GIMDB_LOCAL_PATH}/posters") unless File.exist?("#{$GIMDB_LOCAL_PATH}/posters")
9
9
 
10
10
 
11
11
  ActiveRecord::Base.establish_connection(
12
12
  :adapter => "sqlite3",
13
- :database => "#{$GIMDB_PATH}/db.sqlite3"
13
+ :database => "#{$GIMDB_LOCAL_PATH}/db.sqlite3"
14
14
  )
15
15
 
16
16
 
data/src/movie_box.rb CHANGED
@@ -17,7 +17,7 @@ module GtkGimdb
17
17
 
18
18
 
19
19
  def setting_up
20
- img = Gtk::Image.new((@movie.image_path.nil? || !File.exists?(@movie.image_path)) ? 'data/icons/no_poster.png' : @movie.image_path)
20
+ img = Gtk::Image.new((@movie.image_path.nil? || !File.exists?(@movie.image_path)) ? "#{$GIMDB_PATH}/data/icons/no_poster.png" : @movie.image_path)
21
21
  img.set_tooltip_text("Code: #{@movie.code}")
22
22
  self.pack_start(img, false)
23
23
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gimdb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Enrico Pilotto