From 80a5a25457adcf85186b91b4cc1b7e1360ed56a3 Mon Sep 17 00:00:00 2001 From: Thomas Reynolds Date: Thu, 5 Jan 2012 20:28:34 -0800 Subject: [PATCH] prep 3.0 beta windows gem --- middleman-core/lib/middleman-core.rb | 2 + middleman-core/lib/middleman-core/watcher.rb | 9 ++--- .../middleman-core-x86-mingw32.gemspec | 39 +++++++++++++++++++ middleman-core/middleman-core.gemspec | 4 -- 4 files changed, 45 insertions(+), 9 deletions(-) create mode 100644 middleman-core/middleman-core-x86-mingw32.gemspec diff --git a/middleman-core/lib/middleman-core.rb b/middleman-core/lib/middleman-core.rb index a812e8c2..6666961b 100755 --- a/middleman-core/lib/middleman-core.rb +++ b/middleman-core/lib/middleman-core.rb @@ -22,6 +22,8 @@ require "middleman-core/vendor/hooks-0.2.0/lib/hooks" module Middleman WINDOWS = !!(RUBY_PLATFORM =~ /(mingw|bccwin|wince|mswin32)/i) unless const_defined?(:WINDOWS) JRUBY = !!(RbConfig::CONFIG["RUBY_INSTALL_NAME"] =~ /^jruby/i) unless const_defined?(:JRUBY) + DARWIN = RbConfig::CONFIG['target_os'] =~ /darwin/i + LINUX = RbConfig::CONFIG['target_os'] =~ /linux/i # Auto-load modules on-demand autoload :Base, "middleman-core/base" diff --git a/middleman-core/lib/middleman-core/watcher.rb b/middleman-core/lib/middleman-core/watcher.rb index ea903845..41d4b64e 100644 --- a/middleman-core/lib/middleman-core/watcher.rb +++ b/middleman-core/lib/middleman-core/watcher.rb @@ -1,9 +1,8 @@ -# Inspect Ruby env -require "rbconfig" - # File changes are forwarded to the currently running app via HTTP require "net/http" +require "win32/process" if ::Middleman::WINDOWS + module Middleman class Watcher class << self @@ -32,9 +31,9 @@ module Middleman def initialize(options) @options = options - if RbConfig::CONFIG['target_os'] =~ /darwin/i + if ::Middleman::DARWIN $LOAD_PATH << File.expand_path('../../middleman-core/vendor/darwin/lib', __FILE__) - elsif RbConfig::CONFIG['target_os'] =~ /linux/i + elsif ::Middleman::LINUX $LOAD_PATH << File.expand_path('../../middleman-core/vendor/linux/lib', __FILE__) end diff --git a/middleman-core/middleman-core-x86-mingw32.gemspec b/middleman-core/middleman-core-x86-mingw32.gemspec new file mode 100644 index 00000000..a79ea8ba --- /dev/null +++ b/middleman-core/middleman-core-x86-mingw32.gemspec @@ -0,0 +1,39 @@ +# -*- encoding: utf-8 -*- +$:.push File.expand_path("../lib", __FILE__) +require "middleman-core/version" + +Gem::Specification.new do |s| + s.name = "middleman-core" + s.version = Middleman::VERSION + s.platform = "x86-mingw32" + s.license = "MIT" + s.authors = ["Thomas Reynolds"] + s.email = ["me@tdreyno.com"] + s.homepage = "http://middlemanapp.com" + s.summary = "Hand-crafted frontend development" + s.description = "A static site generator based on Sinatra. Providing dozens of templating languages (Haml, Sass, Compass, Slim, CoffeeScript, and more). Makes minification, compression, cache busting, Yaml data (and more) an easy part of your development cycle." + + s.files = `git ls-files`.split("\n") + %w(bin/fsevent_watch_guard) + s.test_files = `git ls-files -- {fixtures,features}/*`.split("\n") + s.executable = "middleman" + s.require_path = "lib" + + # Core + s.add_dependency("rack", ["~> 1.3.5"]) + s.add_dependency("tilt", ["~> 1.3.1"]) + + # Builder + s.add_dependency("rack-test", ["~> 0.6.1"]) + + # CLI + s.add_dependency("thor", ["~> 0.14.0"]) + + # Helpers + s.add_dependency("activesupport", ["~> 3.1.0"]) + + # Watcher + s.add_dependency("fssm", ["~> 0.2.8"]) + + # Fork on Windows + s.add_dependency("win32-process", ["~> 0.6.5"]) +end \ No newline at end of file diff --git a/middleman-core/middleman-core.gemspec b/middleman-core/middleman-core.gemspec index bc5eb193..5745518e 100644 --- a/middleman-core/middleman-core.gemspec +++ b/middleman-core/middleman-core.gemspec @@ -17,9 +17,6 @@ Gem::Specification.new do |s| s.test_files = `git ls-files -- {fixtures,features}/*`.split("\n") s.executable = "middleman" s.require_path = "lib" - - # Thin - # s.add_dependency("thin", ["~> 1.3.1"]) # Core s.add_dependency("rack", ["~> 1.3.5"]) @@ -32,7 +29,6 @@ Gem::Specification.new do |s| s.add_dependency("thor", ["~> 0.14.0"]) # Helpers - # s.add_dependency("i18n", ["~> 0.6.0"]) s.add_dependency("activesupport", ["~> 3.1.0"]) # Watcher