Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #7 from bob-p/decouple-responsibilities

Decouple responsibilities
  • Loading branch information...
commit ca11dfc496e4f5f06e356ef0ef064e53c9d16861 2 parents cedfce3 + 1926f69
@rodreegez rodreegez authored
View
5 README.markdown
@@ -55,7 +55,7 @@ end
### Pathways::Parser
-Now that we're tracking the paths our users take we need to parse these so that we can mine this like a mofo.
+Now that we're tracking the paths our users take we need to parse these so that we can mine this like a mofo (note you might need to require 'pathways/parser').
Pathways::Parser.execute
@@ -110,6 +110,7 @@ run Rack::URLMap.new \
You can also easily mount Pathways on a subpath in your existing Rails 3 app by adding this to your `routes.rb`:
``` ruby
+require 'pathways/server'
mount Pathways::Server.new, :at => "/pathways"
```
@@ -201,4 +202,4 @@ Simon Reed :: simon@mintdigital.com :: @simonreed
[0]: http://logicalfriday.com/2011/08/25/dont-build-that-feature/
[1]: http://help.github.com/forking/
-[2]: http://www.mintdigital.com/
+[2]: http://www.mintdigital.com/
View
4 bin/pathways-web
@@ -7,6 +7,6 @@ rescue LoadError
require 'rubygems'
require 'vegas'
end
-require 'pathways'
+require 'pathways/server'
-Vegas::Runner.new(Pathways::Server, 'pathways-web')
+Vegas::Runner.new(Pathways::Server, 'pathways-web')
View
4 bin/pathways-worker
@@ -7,6 +7,6 @@ rescue LoadError
require 'rubygems'
require 'vegas'
end
-require 'pathways'
+require 'pathways/parser'
-Pathways::Parser.execute
+Pathways::Parser.execute
View
8 lib/pathways.rb
@@ -1,12 +1,4 @@
module Pathways
- require 'mongo_mapper'
require "pathways/tracker"
- require "pathways/filter"
- require "pathways/parser"
- require "pathways/server"
- require "pathways/session"
- require "pathways/visit"
- MongoMapper.connection = Mongo::Connection.new('localhost')
- MongoMapper.database = 'pathways'
end
View
2  lib/pathways/parser.rb
@@ -65,4 +65,4 @@ def run(most_recent_session_updated_at)
end
end
end
-end
+end
View
9 lib/pathways/server.rb
@@ -1,6 +1,13 @@
require 'sinatra/base'
+require 'mongo_mapper'
require 'erb'
require 'pathways'
+require 'pathways/filter'
+require "pathways/session"
+require "pathways/visit"
+
+MongoMapper.connection = Mongo::Connection.new('localhost')
+MongoMapper.database = 'pathways'
module Pathways
class Server < Sinatra::Base
@@ -87,4 +94,4 @@ def self.tabs
end
end
-end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.