Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

making nice with gems; bye mooch, it was fun

  • Loading branch information...
commit 9cdfcab3117d054eb7cc432a8c67cd00ecc90d10 1 parent 8a71565
@levicook authored
View
3  .gitmodules
@@ -1,3 +0,0 @@
-[submodule "vendor/levicook/redis-rb"]
- path = vendor/levicook/redis-rb
- url = git@github.com:levicook/redis-rb.git
View
1  Rakefile
@@ -10,6 +10,7 @@ begin
gem.email = "levicook@gmail.com"
gem.homepage = "http://github.com/levicook/memodis"
gem.authors = ["levicook@gmail.com"]
+ gem.add_dependency "redis", ">= 0.1.2"
gem.add_development_dependency "riot", ">= 0"
gem.add_development_dependency "reek", ">= 0"
gem.add_development_dependency "daemon_controller", ">= 0"
View
10 lib/dependencies.rb
@@ -1,10 +0,0 @@
-
-require "pathname"
-vendor_path = Pathname.new(__FILE__).parent.parent + "vendor"
-Pathname.glob("#{vendor_path}/**/lib") do |lib|
- next if $LOAD_PATH.include?(lib)
- $LOAD_PATH.insert(0, lib.realpath.to_s) if lib.directory?
-end
-
-require "dist_redis"
-
View
5 lib/memodis.rb
@@ -1,8 +1,9 @@
-require 'pathname'
-load Pathname.new(__FILE__).parent+'dependencies.rb'
+require 'rubygems'
+require 'pathname'
require 'memodis/dist_cache'
+
module Memodis
# slurp cool vendor goodies into our namespace. would declare them
View
4 lib/memodis/dist_cache.rb
@@ -1,5 +1,6 @@
-module Memodis
+require 'dist_redis'
+module Memodis
class DistCache
CODERS = {}
@@ -85,5 +86,4 @@ def resolve_coder(coder_spec)
end
end
-
end
View
39 script/mooch
@@ -1,39 +0,0 @@
-#!/usr/bin/env ruby
-require "pathname"
-
-
-LOADER = '''
-require "pathname"
-
-vendor_path = Pathname.new(__FILE__).parent.parent + 'vendor'
-
-Pathname.glob("#{vendor_path}/**/lib") do |lib|
- next if $LOAD_PATH.include?(lib)
- $LOAD_PATH.insert(0, lib.realpath.to_s) if lib.directory?
-end
-'''
-
-
-if ARGV[0] == "init"
- lib = Pathname.new(ARGV[1])
- lib.mkpath
- (lib + 'dependencies.rb').open("w") do |file|
- file.write LOADER
- end
-else
- vendor = Pathname.new("vendor")
- vendor.mkpath
-
- if File.exist?('.git')
- system("git add vendor")
- system("git submodule add git://github.com/#{ARGV[0]}.git vendor/#{ARGV[0]}")
- else
- Dir.chdir(vendor.realpath)
- system("git clone git://github.com/#{ARGV[0]}.git #{ARGV[0]}")
- if ARGV[1]
- Dir.chdir(ARGV[0])
- system("git checkout #{ARGV[1]}")
- end
- end
-
-end
1  vendor/levicook/redis-rb
@@ -1 +0,0 @@
-Subproject commit 29517f4ea5a9e0720d1229006575e6174de67307
Please sign in to comment.
Something went wrong with that request. Please try again.