Module: Lyricli

Defined in:
lib/lyricli.rb,
lib/lyricli/util.rb,
lib/lyricli/lyricli.rb,
lib/lyricli/sources.rb,
lib/lyricli/exceptions.rb,
lib/lyricli/sources/rdio.rb,
lib/lyricli/lyrics_engine.rb,
lib/lyricli/configuration.rb,
lib/lyricli/sources/itunes.rb,
lib/lyricli/source_manager.rb,
lib/lyricli/sources/arguments.rb

Overview

The Lyricli module allows you to easily search for lyrics by looking for song and artist data from diverse sources.

Defined Under Namespace

Modules: Exceptions, Sources, Util Classes: Configuration, Lyricli, LyricsEngine, SourceManager

Class Method Summary (collapse)

Class Method Details

+ (Object) disable(source_name)

Disables a source via the Source Manager



56
57
58
59
# File 'lib/lyricli.rb', line 56

def self.disable(source_name)
  source_manager = SourceManager.new
  source_manager.disable(source_name)
end

+ (Object) enable(source_name)

Enables a source via the Source Manager



50
51
52
53
# File 'lib/lyricli.rb', line 50

def self.enable(source_name)
  source_manager = SourceManager.new
  source_manager.enable(source_name)
end

+ (String) lyrics

Creates a new Lyricli instance and returns lyrics by going through the sources.

Returns:

  • (String)

    the fetched lyrics



30
31
32
33
# File 'lib/lyricli.rb', line 30

def self.lyrics
  @lyricli = Lyricli.new
  @lyricli.get_lyrics
end

+ (Object) reset(source_name)

Resets all configuration for a source via the Source Manager



62
63
64
65
# File 'lib/lyricli.rb', line 62

def self.reset(source_name)
  source_manager = SourceManager.new
  source_manager.reset(source_name)
end

+ (String) sources

Returns a list of the available sources to enable or disable

Returns:

  • (String)

    the list of available sources. Enabled sources have a star appended.



44
45
46
47
# File 'lib/lyricli.rb', line 44

def self.sources
  source_manager = SourceManager.new
  source_manager.available_sources(true).join(", ")
end

+ (String) version

Returns the version of the library

Returns:

  • (String)

    the version



37
38
39
# File 'lib/lyricli.rb', line 37

def self.version
  Gem.loaded_specs["lyricli"].version
end