Skip to content
Browse files

+ experimental MacRuby-specific extensions

  • Loading branch information...
1 parent 1ae4aad commit 5fb64fb8df12818fc7171fe7cb8f39253722524a @floere committed Feb 1, 2012
Showing with 42 additions and 7 deletions.
  1. +5 −0 history.textile
  2. +7 −5 install
  3. +9 −1 server/lib/picky.rb
  4. +20 −0 server/lib/picky/platforms/macruby.rb
  5. +1 −1 version.rb
View
5 history.textile
@@ -1,5 +1,10 @@
h2. Upcoming Version
+h2. Version 4.2.1 "fries with that"
+
+* hanke: (server) Experimental extensions to get Picky run on MacRuby 0.12.
+* hanke: (server) Unfortunately, we dom't have the resources to always run the tests – please use with caution.
+
h2. Version 4.2.0 "talk to the hand"
* hanke: (server) Redesigned how Picky logs: Picky itself logs its index handling (tokenizing/dumping/loading) using one of its built-in loggers. Set a logger after requiring 'picky' like this: @Picky.logger = Picky::Loggers::Verbose.new(STDOUT) # or any IO@. Default is @Picky::Loggers::Concise.new(STDOUT)@ aka @Picky::Loggers::Default@. Also an option is @Picky::Loggers::Silent@. This closes "issue 70":https://github.com/floere/picky/issues/70.
View
12 install
@@ -7,9 +7,11 @@ local_or_remote = ARGV.include?('REMOTE') ? '' : '--local'
require File.expand_path '../version', __FILE__
+gem_command = 'gem'
+
puts "Installing all gems."
-system "cd server; gem build picky.gemspec; gem install picky-*.gem #{local_or_remote} --no-rdoc --no-ri; rm picky-*.gem"
-system "cd client; gem build picky-client.gemspec; gem install picky-client-*.gem #{local_or_remote} --no-rdoc --no-ri; rm picky-client-*.gem"
-system "cd statistics; gem build picky-statistics.gemspec; gem install picky-statistics-*.gem #{local_or_remote} --no-rdoc --no-ri; rm picky-statistics-*.gem"
-system "cd generators; gem build picky-generators.gemspec; gem install picky-generators-*.gem #{local_or_remote} --no-rdoc --no-ri; rm picky-generators-*.gem"
-system "cd live; gem build picky-live.gemspec; gem install picky-live-*.gem #{local_or_remote} --no-rdoc --no-ri; rm picky-live-*.gem"
+system "cd server; #{gem_command} build picky.gemspec; #{gem_command} install picky-*.gem #{local_or_remote} --no-rdoc --no-ri; rm picky-*.gem"
+system "cd client; #{gem_command} build picky-client.gemspec; #{gem_command} install picky-client-*.gem #{local_or_remote} --no-rdoc --no-ri; rm picky-client-*.gem"
+system "cd statistics; #{gem_command} build picky-statistics.gemspec; #{gem_command} install picky-statistics-*.gem #{local_or_remote} --no-rdoc --no-ri; rm picky-statistics-*.gem"
+system "cd generators; #{gem_command} build picky-generators.gemspec; #{gem_command} install picky-generators-*.gem #{local_or_remote} --no-rdoc --no-ri; rm picky-generators-*.gem"
+system "cd live; #{gem_command} build picky-live.gemspec; #{gem_command} install picky-live-*.gem #{local_or_remote} --no-rdoc --no-ri; rm picky-live-*.gem"
View
10 server/lib/picky.rb
@@ -10,7 +10,15 @@ module Picky
require 'yajl'
require 'procrastinate'
require 'rack_fast_escape' if defined? Rack
-
+
+ # Check if platform specific modifiers need to be installed.
+ #
+
+ # Note: We don't use require_relative because MacRuby doesn't
+ # have it.
+ #
+ require File.expand_path '../picky/platforms/macruby', __FILE__
+
# Require the constants.
#
require_relative 'picky/constants'
View
20 server/lib/picky/platforms/macruby.rb
@@ -0,0 +1,20 @@
+# This tests if we are using MacRuby.
+# If yes, it checks if we already have require_relative.
+#
+# TODO Remove (too verbose) message as soon as it is final.
+#
+if Kernel.respond_to?(:to_plist) && !Kernel.respond_to?(:require_relative)
+
+ puts "Installing Picky specific MacRuby extensions."
+
+ module Kernel
+
+ def require_relative relative_feature
+ file = caller.first.split(/:\d/,2).first
+ raise LoadError, "require_relative is called in #{$1}" if /\A\((.*)\)/ =~ file
+ require File.expand_path relative_feature, File.dirname(file)
+ end
+
+ end
+
+end
View
2 version.rb
@@ -1,3 +1,3 @@
module Picky
- VERSION = '4.2.0'
+ VERSION = '4.2.1'
end

0 comments on commit 5fb64fb

Please sign in to comment.
Something went wrong with that request. Please try again.