Sha256: 1411f31102141db6bdd1e31d8054533ab1b10ef929898f5c251757e4245090e2

Contents?: true

Size: 1.28 KB

Versions: 9

Compression:

Stored size: 1.28 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

    fail "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

9 entries across 9 versions & 2 rubygems

Version Path
celluloid-0.17.4 culture/sync.rb
celluloid-0.17.3 culture/sync.rb
celluloid-zmq-0.17.2 culture/sync.rb
celluloid-0.17.2 culture/sync.rb
celluloid-0.17.1.2 culture/sync.rb
celluloid-0.17.1.1 culture/sync.rb
celluloid-zmq-0.17.0 culture/sync.rb
celluloid-0.17.1 culture/sync.rb
celluloid-0.17.0 culture/sync.rb