visitors 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  The visitors gem gives you a simple tracking system for use in your
4
4
  Ruby-based web application. Anywhere in your app you can call…
5
5
 
6
- Visitors.increment(1, 'show')
6
+ Visitors.increment(1, :show)
7
7
 
8
8
  …to increment a counter that corresponds to the resource with an
9
9
  identifier of 1.
@@ -18,7 +18,6 @@ Next make sure you have Redis running and the config.yml file has the
18
18
  right configuration settings to connect to your Redis instance.
19
19
 
20
20
  development:
21
- database: postgres://localhost/visitors_development
22
21
  redis_namespace: visitors_development
23
22
  redis_config:
24
23
  host: localhost
@@ -29,7 +28,7 @@ Require the visitors gem in your Rails app via your Gemfile?
29
28
 
30
29
  gem 'visitors', '~> 0.0.2'
31
30
 
32
- Now add `Visitors.increment(params[:id], 'show')` to a show action in
31
+ Now add `Visitors.increment(@resource.id, :show)` to a show action in
33
32
  your application.
34
33
 
35
34
  Launch a Vegas-powered Sinatra web console to see who's been visiting
data/Rakefile CHANGED
@@ -1,2 +1,18 @@
1
+ require 'rspec/core/rake_task'
1
2
  require 'bundler'
2
3
  Bundler::GemHelper.install_tasks
4
+
5
+ desc 'Default: run specs.'
6
+ task :default => :spec
7
+
8
+ desc 'Run specs'
9
+ RSpec::Core::RakeTask.new do |t|
10
+ t.pattern = './spec/**/*_spec.rb'
11
+ end
12
+
13
+ desc 'Generate code coverage'
14
+ RSpec::Core::RakeTask.new(:coverage) do |t|
15
+ t.pattern = './spec/**/*_spec.rb'
16
+ t.rcov = true
17
+ t.rcov_opts = ['--exclude', 'spec']
18
+ end
data/config.ru CHANGED
@@ -1,2 +1,2 @@
1
- require File.expand_path('../lib/visitors/server', __FILE__)
1
+ require './server'
2
2
  run Visitors::Server
data/lib/visitors.rb CHANGED
@@ -4,7 +4,6 @@ require 'visitors/helpers'
4
4
  module Visitors
5
5
  extend self
6
6
 
7
- autoload :Server, 'visitors/server'
8
7
  autoload :Config, 'visitors/config'
9
8
  autoload :Resource, 'visitors/resource'
10
9
 
@@ -1,3 +1,3 @@
1
1
  module Visitors
2
- VERSION = '0.0.5'
2
+ VERSION = '0.0.6'
3
3
  end
@@ -3,7 +3,9 @@ require 'bundler/setup'
3
3
 
4
4
  require 'sinatra'
5
5
  require 'haml'
6
- require File.expand_path('../../visitors', __FILE__)
6
+
7
+ $:.push File.expand_path(File.dirname(__FILE__))
8
+ require 'lib/visitors'
7
9
 
8
10
  class Visitors::Server < Sinatra::Base
9
11
  MONTHS = %w[
@@ -25,8 +27,8 @@ class Visitors::Server < Sinatra::Base
25
27
 
26
28
  dir = File.expand_path('..', __FILE__)
27
29
 
28
- set :views, "#{dir}/server/views"
29
- set :public, "#{dir}/server/public"
30
+ set :views, "#{dir}/views"
31
+ set :public, "#{dir}/public"
30
32
  set :static, true
31
33
 
32
34
  get '/' do
File without changes
File without changes
File without changes
File without changes
File without changes
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: visitors
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.5
5
+ version: 0.0.6
6
6
  platform: ruby
7
7
  authors:
8
8
  - James Conroy-Finn
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-03-02 00:00:00 +00:00
13
+ date: 2011-03-09 00:00:00 +00:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -148,22 +148,22 @@ files:
148
148
  - lib/visitors/config.rb
149
149
  - lib/visitors/helpers.rb
150
150
  - lib/visitors/resource.rb
151
- - lib/visitors/server.rb
152
- - lib/visitors/server/public/images/email.png
153
- - lib/visitors/server/public/images/phone.png
154
- - lib/visitors/server/public/images/search.png
155
- - lib/visitors/server/public/images/show.png
156
- - lib/visitors/server/public/images/website.png
157
- - lib/visitors/server/views/_form.haml
158
- - lib/visitors/server/views/home.haml
159
- - lib/visitors/server/views/layout.haml
160
- - lib/visitors/server/views/show.haml
161
- - lib/visitors/server/views/stats.sass
162
151
  - lib/visitors/version.rb
152
+ - public/images/email.png
153
+ - public/images/phone.png
154
+ - public/images/search.png
155
+ - public/images/show.png
156
+ - public/images/website.png
157
+ - server.rb
163
158
  - spec/spec_helper.rb
164
159
  - spec/visitors/config_spec.rb
165
160
  - spec/visitors/resource_spec.rb
166
161
  - spec/visitors_spec.rb
162
+ - views/_form.haml
163
+ - views/home.haml
164
+ - views/layout.haml
165
+ - views/show.haml
166
+ - views/stats.sass
167
167
  - visitors.gemspec
168
168
  has_rdoc: true
169
169
  homepage: http://github.com/jcf/visitors