Permalink
Browse files

minimum set of fixes to have Pomodori running on Lion. Tests are brok…

…en at the moment.
  • Loading branch information...
1 parent a0f1a98 commit 5f18bb0eb5c6f4e6ace4b1a334fb77e2dbf86e82 reborg committed Dec 18, 2011
View
1 .rvmrc
@@ -0,0 +1 @@
+rvm use --create macruby-0.10@pomodori
View
4 Gemfile
@@ -0,0 +1,4 @@
+# A sample Gemfile
+source "http://rubygems.org"
+
+gem "hotcocoa"
View
10 Gemfile.lock
@@ -0,0 +1,10 @@
+GEM
+ remote: http://rubygems.org/
+ specs:
+ hotcocoa (0.6.1)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ hotcocoa
View
31 Rakefile
@@ -1,21 +1,24 @@
-$LOAD_PATH.unshift(File.dirname(__FILE__) + "/vendor/hotcocoa-0.5.1+patch/lib")
-require 'hotcocoa/application_builder'
-require 'hotcocoa/standard_rake_tasks'
+#$LOAD_PATH.unshift(File.dirname(__FILE__) + "/vendor/hotcocoa-0.5.1+patch/lib")
+
+APPSPEC = 'config/Pomodori.appspec'
+
+require 'rubygems'
+require 'hotcocoa/rake_tasks'
task :default => [:test]
task :test do
`macruby test/all_tests.rb`
end
-task :embed => [:deploy] do
- `rm -rf ./#{AppConfig.name}.app/Contents/Frameworks/MacRuby.framework/Versions/#{MACRUBY_VERSION}/usr/bin`
- `rm -rf ./#{AppConfig.name}.app/Contents/Frameworks/MacRuby.framework/Versions/#{MACRUBY_VERSION}/usr/lib/libmacruby-static.a`
- `rm -rf ./#{AppConfig.name}.app/Contents/Frameworks/MacRuby.framework/Versions/#{MACRUBY_VERSION}/usr/lib/ruby/Gems`
- `rm -rf ./#{AppConfig.name}.app/Contents/Frameworks/MacRuby.framework/Versions/#{MACRUBY_VERSION}/usr/lib/ruby/1.9.0/rubygems`
- `rm -rf ./#{AppConfig.name}.app/Contents/Frameworks/MacRuby.framework/Versions/#{MACRUBY_VERSION}/usr/lib/ruby/1.9.0/irb`
- `rm -rf ./#{AppConfig.name}.app/Contents/Frameworks/MacRuby.framework/Versions/#{MACRUBY_VERSION}/usr/lib/ruby/1.9.0/rdoc`
- `rm -rf ./#{AppConfig.name}.app/Contents/Frameworks/MacRuby.framework/Versions/#{MACRUBY_VERSION}/usr/share`
- `find ./#{AppConfig.name}.app/Contents -name "*.rbo" -exec install_name_tool -change /Library/Frameworks/MacRuby.framework/Versions/#{MACRUBY_VERSION}/usr/lib/libmacruby.dylib @executable_path/../Frameworks/MacRuby.framework/Versions/#{MACRUBY_VERSION}/usr/lib/libmacruby.dylib {} \\;`
- `find ./#{AppConfig.name}.app/Contents -name "*.bundle" -exec install_name_tool -change /Library/Frameworks/MacRuby.framework/Versions/#{MACRUBY_VERSION}/usr/lib/libmacruby.dylib @executable_path/../Frameworks/MacRuby.framework/Versions/#{MACRUBY_VERSION}/usr/lib/libmacruby.dylib {} \\;`
-end
+#task :embed => [:deploy] do
+# `rm -rf ./#{AppConfig.name}.app/Contents/Frameworks/MacRuby.framework/Versions/#{MACRUBY_VERSION}/usr/bin`
+# `rm -rf ./#{AppConfig.name}.app/Contents/Frameworks/MacRuby.framework/Versions/#{MACRUBY_VERSION}/usr/lib/libmacruby-static.a`
+# `rm -rf ./#{AppConfig.name}.app/Contents/Frameworks/MacRuby.framework/Versions/#{MACRUBY_VERSION}/usr/lib/ruby/Gems`
+# `rm -rf ./#{AppConfig.name}.app/Contents/Frameworks/MacRuby.framework/Versions/#{MACRUBY_VERSION}/usr/lib/ruby/1.9.0/rubygems`
+# `rm -rf ./#{AppConfig.name}.app/Contents/Frameworks/MacRuby.framework/Versions/#{MACRUBY_VERSION}/usr/lib/ruby/1.9.0/irb`
+# `rm -rf ./#{AppConfig.name}.app/Contents/Frameworks/MacRuby.framework/Versions/#{MACRUBY_VERSION}/usr/lib/ruby/1.9.0/rdoc`
+# `rm -rf ./#{AppConfig.name}.app/Contents/Frameworks/MacRuby.framework/Versions/#{MACRUBY_VERSION}/usr/share`
+# `find ./#{AppConfig.name}.app/Contents -name "*.rbo" -exec install_name_tool -change /Library/Frameworks/MacRuby.framework/Versions/#{MACRUBY_VERSION}/usr/lib/libmacruby.dylib @executable_path/../Frameworks/MacRuby.framework/Versions/#{MACRUBY_VERSION}/usr/lib/libmacruby.dylib {} \\;`
+# `find ./#{AppConfig.name}.app/Contents -name "*.bundle" -exec install_name_tool -change /Library/Frameworks/MacRuby.framework/Versions/#{MACRUBY_VERSION}/usr/lib/libmacruby.dylib @executable_path/../Frameworks/MacRuby.framework/Versions/#{MACRUBY_VERSION}/usr/lib/libmacruby.dylib {} \\;`
+#end
View
55 config/Pomodori.appspec
@@ -0,0 +1,55 @@
+# for more information about the fields that can be set on the specification, check out the rdoc:
+# http://rdoc.info/github/ferrous26/hotcocoa/master/Application/Specification
+#
+Application::Specification.new do |s|
+ s.name = 'Pomodori'
+ s.identifier = 'net.reborg.Pomodori'
+
+ # The version of the app, usually including the build number.
+ s.version = '0.7'
+
+ s.icon = 'resources/Pomodori.icns'
+ s.resources = Dir.glob('resources/**/*.*')
+ s.sources = Dir.glob('lib/**/*.rb')
+
+ # BridgeSupport is required if you need to run your app under OS X 10.6 (Snow Leopard)
+ # set this option to false if you do not wish to embed the BridgeSupport files during deployment
+ # (i.e. you are targeting Lion only)
+ # Information about BridgeSupport: http://www.macruby.org/documentation/tutorial.html
+ # Latest Preview of BridgeSupport: http://www.macruby.org/files/BridgeSupport%20Preview%203.zip
+ s.embed_bridgesupport = true
+
+ # optional copyright
+ # s.copyright = "2011, Your Company"
+
+ # optional short version (in contrast to the full version, the short version should not contain the build number)
+ # s.short_version = "$MAJOR.$MINOR.$PATCHLEVEL"
+
+ # to avoid embedding the standard libs
+ # s.stdlib = false
+ # alternatively, specify the modules that you wish to include
+ # s.stdlib = ['base64', 'matrix', 'set']
+
+ # specify which gems you wish to be bundled with your application
+ # hotcocoa is automatically bundled and doesn't need to be specified here
+ # s.gems = ['rest-client']
+
+ # uncomment to always make a clean build of the app
+ # s.overwrite = true
+
+ # toggle whether the app is an daemon with UI or a regular app
+ # You can use this flag to hide the dock icon for the app; the
+ # default value is false so that apps will have a dock icon
+ # s.agent = true
+
+ # uncomment the block below to declare document types for your document-based application
+ # you can declare multiple document types by specifying several declare_doc_type blocks
+ # s.declare_doc_type do |doc_type|
+ # doc_type.extensions = ["ext"]
+ # doc_type.icon = "MyIcon.icns"
+ # doc_type.name = "MyProjectDocument"
+ # doc_type.role = :viewer # one of [:editor, :viewer, :none]
+ # doc_type.class = "MyDocument"
+ # end
+end
+
View
3 lib/main.rb
@@ -1,4 +1,5 @@
-require File.dirname(__FILE__) + "/../vendor/hotcocoa-0.5.1+patch/lib/hotcocoa"
+require 'rubygems'
+require 'hotcocoa'
require File.dirname(__FILE__) + '/pomodori'
require 'pomodori/migration'
require 'pomodori/views/main_view'
View
3 test/all_tests.rb
@@ -1 +1,2 @@
-Dir.glob(File.join(File.dirname(__FILE__), 'pomodori/**/*_test.rb')).each {|f| require f}
+require 'rubygems'
+Dir.glob(File.join(File.dirname(__FILE__), 'pomodori/**/*_test.rb')).each {|f| require f}
View
8 testithere/Rakefile
@@ -0,0 +1,8 @@
+APPSPEC = 'Testithere.appspec'
+
+require 'rubygems'
+require 'hotcocoa/rake_tasks'
+
+task :default => :run
+
+# Add your own tasks here
View
55 testithere/Testithere.appspec
@@ -0,0 +1,55 @@
+# for more information about the fields that can be set on the specification, check out the rdoc:
+# http://rdoc.info/github/ferrous26/hotcocoa/master/Application/Specification
+#
+Application::Specification.new do |s|
+ s.name = 'Testithere'
+ s.identifier = 'com.reborg.Testithere'
+
+ # The version of the app, usually including the build number.
+ s.version = '1.0'
+
+ s.icon = 'resources/HotCocoa.icns'
+ s.resources = Dir.glob('resources/**/*.*')
+ s.sources = Dir.glob('lib/**/*.rb')
+
+ # BridgeSupport is required if you need to run your app under OS X 10.6 (Snow Leopard)
+ # set this option to false if you do not wish to embed the BridgeSupport files during deployment
+ # (i.e. you are targeting Lion only)
+ # Information about BridgeSupport: http://www.macruby.org/documentation/tutorial.html
+ # Latest Preview of BridgeSupport: http://www.macruby.org/files/BridgeSupport%20Preview%203.zip
+ s.embed_bridgesupport = true
+
+ # optional copyright
+ # s.copyright = "2011, Your Company"
+
+ # optional short version (in contrast to the full version, the short version should not contain the build number)
+ # s.short_version = "$MAJOR.$MINOR.$PATCHLEVEL"
+
+ # to avoid embedding the standard libs
+ # s.stdlib = false
+ # alternatively, specify the modules that you wish to include
+ # s.stdlib = ['base64', 'matrix', 'set']
+
+ # specify which gems you wish to be bundled with your application
+ # hotcocoa is automatically bundled and doesn't need to be specified here
+ # s.gems = ['rest-client']
+
+ # uncomment to always make a clean build of the app
+ # s.overwrite = true
+
+ # toggle whether the app is an daemon with UI or a regular app
+ # You can use this flag to hide the dock icon for the app; the
+ # default value is false so that apps will have a dock icon
+ # s.agent = true
+
+ # uncomment the block below to declare document types for your document-based application
+ # you can declare multiple document types by specifying several declare_doc_type blocks
+ # s.declare_doc_type do |doc_type|
+ # doc_type.extensions = ["ext"]
+ # doc_type.icon = "MyIcon.icns"
+ # doc_type.name = "MyProjectDocument"
+ # doc_type.role = :viewer # one of [:editor, :viewer, :none]
+ # doc_type.class = "MyDocument"
+ # end
+end
+
View
42 testithere/lib/application.rb
@@ -0,0 +1,42 @@
+require 'rubygems' # disable this for a deployed application
+require 'hotcocoa'
+
+class Testithere
+ include HotCocoa
+
+ def start
+ application name: 'Testithere' do |app|
+ app.delegate = self
+ window frame: [100, 100, 500, 500], title: 'Testithere' do |win|
+ win << label(text: 'Hello from HotCocoa', layout: {start: false})
+ win.will_close { exit }
+ end
+ end
+ end
+
+ # file/open
+ def on_open(menu)
+ end
+
+ # file/new
+ def on_new(menu)
+ end
+
+ # help menu item
+ def on_help(menu)
+ end
+
+ # This is commented out, so the minimize menu item is disabled
+ #def on_minimize(menu)
+ #end
+
+ # window/zoom
+ def on_zoom(menu)
+ end
+
+ # window/bring_all_to_front
+ def on_bring_all_to_front(menu)
+ end
+end
+
+Testithere.new.start
View
32 testithere/lib/menu.rb
@@ -0,0 +1,32 @@
+module HotCocoa
+ def application_menu
+ menu do |main|
+ main.submenu :apple do |apple|
+ apple.item :about, title: "About #{NSApp.name}"
+ apple.separator
+ apple.item :preferences, key: ','
+ apple.separator
+ apple.submenu :services
+ apple.separator
+ apple.item :hide, title: "Hide #{NSApp.name}", key: 'h'
+ apple.item :hide_others, title: 'Hide Others', key: 'h', modifiers: [:command, :alt]
+ apple.item :show_all, title: 'Show All'
+ apple.separator
+ apple.item :quit, title: "Quit #{NSApp.name}", key: 'q'
+ end
+ main.submenu :file do |file|
+ file.item :new, key: 'n'
+ file.item :open, key: 'o'
+ end
+ main.submenu :window do |win|
+ win.item :minimize, key: 'm'
+ win.item :zoom
+ win.separator
+ win.item :bring_all_to_front, title: 'Bring All to Front', key: 'o'
+ end
+ main.submenu :help do |help|
+ help.item :help, title: "#{NSApp.name} Help"
+ end
+ end
+ end
+end
View
BIN testithere/resources/HotCocoa.icns
Binary file not shown.
1 vendor/hotcocoa-0.5.1+patch
@@ -1 +0,0 @@
-Subproject commit deca85e695154b82d31af76badaa0aba67187936

0 comments on commit 5f18bb0

Please sign in to comment.