Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Bump to 1.9.3. Forced creation of a fresh capped collection, instead …

…of relying on a WebGUI step.

Update to more consise symbol syntax. Trimmed README.md to point to server version for deploy.
  • Loading branch information...
commit 9b08442a815434cff84aca5448635242a9db9c6b 1 parent cbf47b7
@benzenwen benzenwen authored
Showing with 15 additions and 27 deletions.
  1. +1 −1  .rvmrc
  2. +2 −19 README.md
  3. +12 −7 writer.rb
View
2  .rvmrc
@@ -1 +1 @@
-rvm use ruby-1.9.2@demo.tractorpush-writer --create
+rvm use ruby-1.9.3@demo.tractorpush-writer --create
View
21 README.md
@@ -1,21 +1,4 @@
-This application is the message-publishing portion of the system described in [this Heroku Dev Center article](https://devcenter.heroku.com/articles/build-realtime-polyglot-node-ruby-mongodb-socketio-app).
+This application is the message-publishing portion of the system described in [this Heroku Dev Center article](https://devcenter.heroku.com/articles/build-realtime-polyglot-node-ruby-mongodb-socketio-app). This is the original [Ruby version](https://github.com/mongolab/tractorpush-writer-ruby). A Node.js version is [here](https://github.com/mongolab.com/tractorpush-writer-node).
-The Node.js web-component can be found at: https://github.com/mongolab/tractorpush-server
+Deployment instructions can be found at server web-component [here](https://github.com/mongolab/tractorpush-server).
-#### Deploy
-
-Create the app on Heroku and add the MongoLab add-on.
-
-```term
-$ heroku create -s cedar tp-writer
-$ heroku addons:add mongolab
-```
-
-Next, [configure the required MongoDB capped collection](https://devcenter.heroku.com/articles/build-realtime-polyglot-node-ruby-mongodb-socketio-app#configure_mongodb_capped_collection).
-
-Then deploy to Heroku and scale the `worker` process.
-
-```term
-$ git push heroku master
-$ heroku ps:scale worker=1
-```
View
19 writer.rb
@@ -6,12 +6,16 @@
#
#
-# ObjectLabs is the maker of MongoLab.com a cloud, hosted MongoDb
-# service
+# See also: https://github.com/mongolab/tractorpush-server
#
#
-# Copyright 2012 ObjectLabs Corp.
+# ObjectLabs is the maker of MongoLab.com a MongoDB-as-a-Service
+# provider.
+#
+
+#
+# Copyright 2012, 2013 ObjectLabs Corp.
#
# MIT License
@@ -62,11 +66,12 @@
conn = Mongo::Connection.from_uri(uristring)
db = conn.db(uri.path.gsub(/^\//, ''))
-coll = db.collection('messages')
+db.drop_collection('messages')
+coll = db.create_collection('messages', {capped: true, size: 8000000})
-docs = [{'messagetype' => 'simple', 'ordinal' => 0, 'somename' => 'somevalue'},
- {'messagetype' => 'array', 'ordinal' => 0, 'somearray' => ['a', 'b', 'c', 'd']},
- {'messagetype' => 'complex', 'ordinal' =>0, 'subdocument' => {'fname' => 'George', 'lname' => 'Washington', 'subproperty' => 'US-president'}}]
+docs = [{messagetype: 'simple', ordinal: 0, somename: 'somevalue'},
+ {messagetype: 'array', ordinal: 0, somearray: ['a', 'b', 'c', 'd']},
+ {messagetype: 'complex', ordinal:0, subdocument: {fname: 'George', lname: 'Washington', subproperty: 'US-president'}}]
# Run until killed
i = 1
Please sign in to comment.
Something went wrong with that request. Please try again.