Class: SphinxModule

Inherits:
Object
  • Object
show all
Defined in:
lib/modules/sphinx_module.rb

Direct Known Subclasses

MySQL, MythTv, Shepherd

Instance Method Summary collapse

Constructor Details

#initializeSphinxModule

Returns a new instance of SphinxModule.



2
3
4
5
6
# File 'lib/modules/sphinx_module.rb', line 2

def initialize
  @config = {
      :version => SphinxTv::VERSION
  }
end

Instance Method Details

#check(quiet = false) ⇒ Object



27
28
29
# File 'lib/modules/sphinx_module.rb', line 27

def check(quiet = false)
  return true
end

#configureObject



36
37
38
39
# File 'lib/modules/sphinx_module.rb', line 36

def configure
  puts "#{self.class.to_s} does not have a configuration menu.".red
  return false
end

#downloadObject



41
42
# File 'lib/modules/sphinx_module.rb', line 41

def download
end

#installObject



44
45
46
# File 'lib/modules/sphinx_module.rb', line 44

def install
  puts "#{self.class.to_s} does not have an install function.".red
end

#load_configurationObject



8
9
10
11
12
13
14
15
16
# File 'lib/modules/sphinx_module.rb', line 8

def load_configuration
  config_file = File.join(SphinxTv::CONFIG_DIRECTORY, "#{self.class.to_s.downcase}.yml")
  unless File.exists? config_file
    return false
  end
  c = YAML::load_file config_file
  @config.merge! c
  return true
end

#save_configurationObject



18
19
20
21
22
23
24
25
# File 'lib/modules/sphinx_module.rb', line 18

def save_configuration
  def save_configuration
    Dir.mkdir(SphinxTv::CONFIG_DIRECTORY) unless File.exists? SphinxTv::CONFIG_DIRECTORY
    File.open(File.join(SphinxTv::CONFIG_DIRECTORY, "#{self.class.to_s.downcase}.yml"), "w") do |file|
      file.write @config.to_yaml
    end
  end
end

#setupObject



31
32
33
34
# File 'lib/modules/sphinx_module.rb', line 31

def setup
  puts "#{self.class.to_s} does not have a setup menu.".red
  return false
end

#uninstallObject



48
49
50
# File 'lib/modules/sphinx_module.rb', line 48

def uninstall
  puts "#{self.class.to_s} does not have an uninstall function.".red
end

#updateObject



52
53
54
# File 'lib/modules/sphinx_module.rb', line 52

def update
  puts "#{self.class.to_s} does not have an update function.".red
end