wesrog / last.fm-tagger

A simple RubyCocoa app that writes popular last.fm tags as genres to your iTunes library.

This URL has Read+Write access

last.fm-tagger / rb_main.rb
100644 28 lines (22 sloc) 0.532 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#
# rb_main.rb
# last.fm-tagger2
#
# Created by Wes Rogers on 7/5/08.
# Copyright (c) 2008 633k.net. All rights reserved.
#
 
require 'osx/cocoa'
 
include OSX
 
require_framework 'ScriptingBridge'
 
def rb_main_init
  path = OSX::NSBundle.mainBundle.resourcePath.fileSystemRepresentation
  rbfiles = Dir.entries(path).select {|x| /\.rb\z/ =~ x}
  rbfiles -= [ File.basename(__FILE__) ]
  rbfiles.each do |path|
    require( File.basename(path) )
  end
end
 
if $0 == __FILE__ then
  rb_main_init
  OSX.NSApplicationMain(0, nil)
end