Skip to content
Browse files

cleanup

  • Loading branch information...
1 parent ce1766e commit ab0b6ac219ccfda05389abb38d5f32c562b88e85 @phoet committed May 22, 2011
Showing with 9 additions and 49 deletions.
  1. +1 −2 Gemfile
  2. +5 −8 Gemfile.lock
  3. +0 −1 autotest/discover.rb
  4. +3 −5 config.ru
  5. +0 −1 lib/examples_app.rb
  6. +0 −3 lib/helper.rb
  7. +0 −22 lib/mongo_mapper_example.rb
  8. +0 −3 lib/mongo_ruby_driver_example.rb
  9. +0 −4 lib/mongoid_example.rb
View
3 Gemfile
@@ -7,12 +7,11 @@ gem "crack", "~> 0.1.8"
gem "coderay", "~> 0.9.3"
gem "awesome_print", "~> 0.4.0"
gem "mongo", "~> 1.3.1"
+gem "bson_ext", "~> 1.3.1"
gem "mongoid", "~> 2.0.1"
gem "mongo_mapper", "~> 0.9.1"
-gem "tzinfo", "~> 0.3.27"
group :development do
- gem "ZenTest", "~> 4.5.0"
gem "rack-test", "~> 0.6.0"
gem "rspec", "~> 2.6.0"
gem "fuubar", "~> 0.0.4"
View
13 Gemfile.lock
@@ -1,14 +1,14 @@
GEM
remote: http://gemcutter.org/
specs:
- ZenTest (4.5.0)
activemodel (3.0.7)
activesupport (= 3.0.7)
builder (~> 2.1.2)
i18n (~> 0.5.0)
activesupport (3.0.7)
awesome_print (0.4.0)
bson (1.3.1)
+ bson_ext (1.3.1)
builder (2.1.2)
chalofa_ruby-progressbar (0.0.9.1)
coderay (0.9.8)
@@ -36,11 +36,10 @@ GEM
activemodel (~> 3.0)
activesupport (~> 3.0)
plucky (~> 0.3.8)
- mongoid (2.0.1)
+ mongoid (2.0.2)
activemodel (~> 3.0)
mongo (~> 1.3)
tzinfo (~> 0.3.22)
- will_paginate (~> 3.0.pre)
plucky (0.3.8)
mongo (~> 1.3)
rack (1.2.2)
@@ -53,7 +52,7 @@ GEM
rspec-core (~> 2.6.0)
rspec-expectations (~> 2.6.0)
rspec-mocks (~> 2.6.0)
- rspec-core (2.6.1)
+ rspec-core (2.6.2)
rspec-expectations (2.6.0)
diff-lcs (~> 1.1.2)
rspec-instafail (0.1.7)
@@ -62,16 +61,15 @@ GEM
rack (~> 1.1)
tilt (>= 1.2.2, < 2.0)
term-ansicolor (1.0.5)
- tilt (1.3)
+ tilt (1.3.1)
tzinfo (0.3.27)
- will_paginate (3.0.pre2)
PLATFORMS
ruby
DEPENDENCIES
- ZenTest (~> 4.5.0)
awesome_print (~> 0.4.0)
+ bson_ext (~> 1.3.1)
coderay (~> 0.9.3)
crack (~> 0.1.8)
fuubar (~> 0.0.4)
@@ -84,4 +82,3 @@ DEPENDENCIES
rack-test (~> 0.6.0)
rspec (~> 2.6.0)
sinatra (~> 1.2.6)
- tzinfo (~> 0.3.27)
View
1 autotest/discover.rb
@@ -1 +0,0 @@
-Autotest.add_discovery { "rspec2" }
View
8 config.ru
@@ -1,11 +1,9 @@
$:.unshift ::File.join(::File.dirname(__FILE__), 'lib')
-require "rubygems"
-require "bundler"
+require 'rubygems'
+require 'bundler'
-Bundler.setup
-
-require 'sinatra'
+Bundler.require
configure :development do
Sinatra::Application.reset!
View
1 lib/examples_app.rb
@@ -15,7 +15,6 @@
end
post "/add" do
- puts params.inspect
halt 500 if params[:driver].nil?
@driver = params[:driver].to_sym
View
3 lib/helper.rb
@@ -1,6 +1,3 @@
-require 'httpclient'
-require 'crack/json'
-
module Helper
def load_post_from_twitter(post_id)
View
22 lib/mongo_mapper_example.rb
@@ -1,25 +1,3 @@
-
-require 'mongo_mapper'
-
-# monkey patchin!
-module MongoMapper
- module Plugins
- def plugins
- @plugins ||= []
- end
-
- def plugin(mod)
- # extend mod::ClassMethods if mod.const_defined?(:ClassMethods)
- # include mod::InstanceMethods if mod.const_defined?(:InstanceMethods)
- # for whatever reason mod.const_defined?(:ClassMethods) doesn't work hence this workaround
- extend mod::ClassMethods if mod.constants.include?(:ClassMethods)
- include mod::InstanceMethods if mod.constants.include?(:InstanceMethods)
- mod.configure(self) if mod.respond_to?(:configure)
- plugins << mod
- end
- end
-end
-
class MongoMapperExample
def self.save(twitter_post)
View
3 lib/mongo_ruby_driver_example.rb
@@ -1,6 +1,4 @@
-
require 'uri'
-require 'mongo'
class MongoRubyDriverExample
@@ -16,7 +14,6 @@ def self.load(id)
end
def self.connect
- puts "opening connection to #{ENV['MONGOHQ_URL']}"
uri = URI.parse(ENV['MONGOHQ_URL'])
conn = Mongo::Connection.from_uri(ENV['MONGOHQ_URL'])
db = conn.db(uri.path.gsub(/^\//, ''))
View
4 lib/mongoid_example.rb
@@ -1,6 +1,3 @@
-
-require 'mongoid'
-
class MongoidExample
def self.save(twitter_post)
@@ -25,7 +22,6 @@ def self.load(mongo_id)
end
def self.connect
- puts "opening connection to #{ENV['MONGOHQ_URL']}"
uri = URI.parse(ENV['MONGOHQ_URL'])
conn = Mongo::Connection.from_uri(ENV['MONGOHQ_URL'])
Mongoid.database = conn.db(uri.path.gsub(/^\//, ''))

0 comments on commit ab0b6ac

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