Sha256: fe67387c938ad79b162d5fe9525b8c80348e078d9abb4c3a50f19e518af25581

Contents?: true

Size: 1.29 KB

Versions: 1

Compression:

Stored size: 1.29 KB

Contents

require "forwardable"

module Celluloid
  module Sync
    class << self
      undef gem_path rescue nil
      def gem_path
        File.expand_path("../../", __FILE__)
      end

      undef gem_name rescue nil
      def gem_name
        Dir["#{File.expand_path('../../', __FILE__)}/*.gemspec"].first.gsub(".gemspec", "").split("/").last
      end

      undef gem_name? rescue nil
      def gem_name?
        !gem_name.nil?
      end

      undef lib_path rescue nil
      def lib_path
        File.expand_path("../../lib", __FILE__)
      end

      undef lib_gempath rescue nil
      def lib_gempath
        "#{lib_path}/#{gem_name.split('-').join('/')}"
      end

      undef scenario rescue nil
      def scenario
        File.basename($PROGRAM_NAME)
      end

      undef bundler? rescue nil
      def bundler?
        scenario == "bundle"
      end
    end

    raise "Missing gemspec." unless gem_name?
    $LOAD_PATH.push(gem_path)
    $LOAD_PATH.push(lib_path)

    # TODO: This will likely need to be done differently if INSIDE a cut gem.
    if scenario == "bundle"
      `cd #{gem_path}/culture; git pull origin master` if ARGV.first == "update"
    end

    require("#{gem_path}/culture/gems/loader")
    if File.exist?(version = "#{lib_gempath}/version.rb")
      require(version)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
celluloid-0.18.0.pre culture/sync.rb