Module: Play
- Defined in:
- lib/play.rb,
lib/play/app.rb,
lib/play/song.rb,
lib/play/user.rb,
lib/play/vote.rb,
lib/play/album.rb,
lib/play/artist.rb,
lib/play/client.rb,
lib/play/office.rb,
lib/play/app/api.rb,
lib/play/history.rb,
lib/play/library.rb,
lib/play/views/index.rb,
lib/play/views/layout.rb,
lib/play/views/search.rb,
lib/play/views/profile.rb,
lib/play/views/show_song.rb,
lib/play/views/album_songs.rb,
lib/play/views/now_playing.rb,
lib/play/views/artist_songs.rb,
lib/play/views/play_history.rb
Defined Under Namespace
Modules: Views Classes: Album, App, Artist, Client, History, Library, Office, Song, User, Vote
Constant Summary collapse
- VERSION =
'0.0.8'
Class Method Summary collapse
-
.config ⇒ Object
The configuration object for Play.
-
.config_path ⇒ Object
The path to play.yml.
-
.now_playing ⇒ Object
The song that’s currently playing.
-
.path ⇒ Object
The path of the music library on-disk.
-
.path=(path) ⇒ Object
The path to your music library.
Class Method Details
.config ⇒ Object
The configuration object for Play.
Returns the Hash containing the configuration for Play. This includes:
path - the String path to where your music is located
gh_key - the Client ID from your GitHub app's OAuth settings
gh_secret - the Client Secret from your GitHub app's OAuth settings
office_url - the URL to an endpoint where we can see who's in your office
72 73 74 |
# File 'lib/play.rb', line 72 def self.config YAML::load(File.open(config_path)) end |
.config_path ⇒ Object
The path to play.yml.
Returns the String path to the configuration file.
60 61 62 |
# File 'lib/play.rb', line 60 def self.config_path "#{ENV['HOME']}/.play.yml" end |
.now_playing ⇒ Object
The song that’s currently playing.
Returns the Song object from the database that’s currently playing.
53 54 55 |
# File 'lib/play.rb', line 53 def self. Song.where(:now_playing => true).first end |
.path ⇒ Object
The path of the music library on-disk.
Returns a String absolute path on the local file system.
46 47 48 |
# File 'lib/play.rb', line 46 def self.path config['path'] end |
.path=(path) ⇒ Object
The path to your music library. All of the music underneath this directory will be added to the internal library.
path - a String absolute path to your music
Returns nothing.
39 40 41 |
# File 'lib/play.rb', line 39 def self.path=(path) @path = path end |