Module: Soundcloud9000

Defined in:
lib/soundcloud9000.rb,
lib/soundcloud9000/client.rb,
lib/soundcloud9000/events.rb,
lib/soundcloud9000/ui/rect.rb,
lib/soundcloud9000/ui/view.rb,
lib/soundcloud9000/ui/color.rb,
lib/soundcloud9000/ui/input.rb,
lib/soundcloud9000/ui/table.rb,
lib/soundcloud9000/ui/canvas.rb,
lib/soundcloud9000/application.rb,
lib/soundcloud9000/models/user.rb,
lib/soundcloud9000/time_helper.rb,
lib/soundcloud9000/models/track.rb,
lib/soundcloud9000/views/splash.rb,
lib/soundcloud9000/models/player.rb,
lib/soundcloud9000/download_thread.rb,
lib/soundcloud9000/models/playlist.rb,
lib/soundcloud9000/models/collection.rb,
lib/soundcloud9000/views/player_view.rb,
lib/soundcloud9000/views/tracks_table.rb,
lib/soundcloud9000/controllers/controller.rb,
lib/soundcloud9000/models/track_collection.rb,
lib/soundcloud9000/controllers/track_controller.rb,
lib/soundcloud9000/controllers/player_controller.rb

Defined Under Namespace

Modules: Controllers, Models, TimeHelper, UI, Views Classes: Application, Client, DownloadThread, Events

Class Method Summary collapse

Class Method Details

.startObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/soundcloud9000.rb', line 5

def self.start
  unless client_id = ENV['SC_CLIENT_ID']
    puts 'You need to set SC_CLIENT_ID to a valid client ID'
    exit 1
  end

  if ARGV.include?('-v') || ARGV.include?('--version')
    puts Application.get_version
    puts "Copyright (C) #{Time.new.year} Sumanth Ratna"
    exit 0
  end

  if ARGV.include?('-h') || ARGV.include?('--help')
    puts Application.get_help
    exit 0
  end

  client = Client.new(client_id)
  application = Application.new(client)

  Signal.trap('SIGINT') do
    application.stop
  end

  application.run
end