Browse files

Updated gems; Use compass; Prepare for Mongoid

  • Loading branch information...
1 parent cae289b commit 1e463a8e8b162b5a6dc9650b97f34f2badf8f8af @starpeak committed Feb 10, 2012
View
47 Gemfile
@@ -1,36 +1,51 @@
source "http://rubygems.org"
-gem "rails", '~>3.1.0.rc'
+gemspec
+
+gem "rails", '~>3.2.1'
+# SQLite for ActiveRecord flavoured models
gem 'sqlite3'
+# Mongoid for Mongoid flavoured models
+gem "mongoid", ">= 2.4"
+gem "bson_ext", ">= 1.5"
# Gems used only for assets and not required
# in production environments by default.
group :assets do
- gem 'sass-rails', '~> 3.1.0.rc'
- gem 'coffee-rails', '~> 3.1.0.rc'
- gem 'uglifier'
+ gem 'sass-rails', '~> 3.2.3'
+ gem 'compass-rails'
+ gem 'coffee-rails', '~> 3.2.1'
+ gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
-gem 'pjax-rails'
group :test do
- gem 'ruby-debug19'
+ gem 'rspec-rails', '>= 2.8.1'
+ gem 'mongoid-rspec'
+ gem 'email_spec'
+ gem 'webrat'
gem 'capybara'
- gem 'cucumber'
gem 'cucumber-rails'
+ gem 'database_cleaner'
+ gem 'jasmine'
+end
+
+group :test, :development do
+ # gem 'ruby-debug19', require: 'ruby-debug'
+ gem 'pry'
gem 'fabrication'
gem 'launchy'
+ gem 'faker'
gem 'chronic'
- gem 'webrat'
- gem 'jasmine'
- gem 'rcov'
- gem 'email_spec'
- gem 'spork', git: 'git://github.com/timcharper/spork.git'
gem 'syntax'
- gem 'faker'
- gem 'database_cleaner'
- gem 'rspec'
- gem 'rspec-rails'
+ gem 'timecop'
+ gem 'jasminerice'
+ gem 'guard-shell'
gem 'yard'
+
+ if RUBY_PLATFORM =~ /darwin/i
+ gem 'growl_notify'
+ gem 'rb-fsevent', :require => false
+ end
end
View
296 Gemfile.lock
@@ -1,190 +1,211 @@
-GIT
- remote: git://github.com/timcharper/spork.git
- revision: 25e842457bca30b935a5401547009bc358e7d703
+PATH
+ remote: .
specs:
- spork (0.9.0.rc9)
+ gricer (0.0.5)
+ coffee-rails (>= 3.2.0)
+ rails (>= 3.2.0)
+ sass-rails (>= 3.2.0)
GEM
remote: http://rubygems.org/
specs:
- actionmailer (3.1.0.rc5)
- actionpack (= 3.1.0.rc5)
- mail (~> 2.3.0)
- actionpack (3.1.0.rc5)
- activemodel (= 3.1.0.rc5)
- activesupport (= 3.1.0.rc5)
+ actionmailer (3.2.1)
+ actionpack (= 3.2.1)
+ mail (~> 2.4.0)
+ actionpack (3.2.1)
+ activemodel (= 3.2.1)
+ activesupport (= 3.2.1)
builder (~> 3.0.0)
erubis (~> 2.7.0)
- i18n (~> 0.6)
- rack (~> 1.3.1)
- rack-cache (~> 1.0.2)
- rack-mount (~> 0.8.1)
- rack-test (~> 0.6.0)
- sprockets (~> 2.0.0.beta.12)
- activemodel (3.1.0.rc5)
- activesupport (= 3.1.0.rc5)
- bcrypt-ruby (~> 2.1.4)
+ journey (~> 1.0.1)
+ rack (~> 1.4.0)
+ rack-cache (~> 1.1)
+ rack-test (~> 0.6.1)
+ sprockets (~> 2.1.2)
+ activemodel (3.2.1)
+ activesupport (= 3.2.1)
builder (~> 3.0.0)
- i18n (~> 0.6)
- activerecord (3.1.0.rc5)
- activemodel (= 3.1.0.rc5)
- activesupport (= 3.1.0.rc5)
- arel (~> 2.1.4)
+ activerecord (3.2.1)
+ activemodel (= 3.2.1)
+ activesupport (= 3.2.1)
+ arel (~> 3.0.0)
tzinfo (~> 0.3.29)
- activeresource (3.1.0.rc5)
- activemodel (= 3.1.0.rc5)
- activesupport (= 3.1.0.rc5)
- activesupport (3.1.0.rc5)
+ activeresource (3.2.1)
+ activemodel (= 3.2.1)
+ activesupport (= 3.2.1)
+ activesupport (3.2.1)
+ i18n (~> 0.6)
multi_json (~> 1.0)
addressable (2.2.6)
- archive-tar-minitar (0.5.2)
- arel (2.1.4)
- bcrypt-ruby (2.1.4)
+ arel (3.0.0)
+ bson (1.5.2)
+ bson_ext (1.5.2)
+ bson (= 1.5.2)
builder (3.0.0)
- capybara (1.0.1)
+ capybara (1.1.2)
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
selenium-webdriver (~> 2.0)
xpath (~> 0.1.4)
- childprocess (0.2.1)
+ childprocess (0.3.1)
ffi (~> 1.0.6)
- chronic (0.6.2)
- coffee-rails (3.1.0.rc.6)
+ chronic (0.6.7)
+ chunky_png (1.2.5)
+ coderay (1.0.5)
+ coffee-rails (3.2.2)
coffee-script (>= 2.2.0)
- railties (~> 3.1.0.rc1)
+ railties (~> 3.2.0)
coffee-script (2.2.0)
coffee-script-source
execjs
- coffee-script-source (1.1.2)
- columnize (0.3.4)
- cucumber (1.0.2)
+ coffee-script-source (1.2.0)
+ compass (0.12.rc.1)
+ chunky_png (~> 1.2)
+ fssm (>= 0.2.7)
+ sass (~> 3.1)
+ compass-rails (1.0.0.rc.2)
+ compass (~> 0.12.rc.0)
+ cucumber (1.1.4)
builder (>= 2.1.2)
diff-lcs (>= 1.1.2)
- gherkin (~> 2.4.5)
+ gherkin (~> 2.7.1)
json (>= 1.4.6)
- term-ansicolor (>= 1.0.5)
- cucumber-rails (1.0.2)
- capybara (>= 1.0.0)
- cucumber (~> 1.0.0)
- nokogiri (>= 1.4.6)
- database_cleaner (0.6.7)
- diff-lcs (1.1.2)
+ term-ansicolor (>= 1.0.6)
+ cucumber-rails (1.2.1)
+ capybara (>= 1.1.2)
+ cucumber (>= 1.1.3)
+ nokogiri (>= 1.5.0)
+ database_cleaner (0.7.1)
+ diff-lcs (1.1.3)
email_spec (1.2.1)
mail (~> 2.2)
rspec (~> 2.0)
erubis (2.7.0)
- execjs (1.2.4)
+ execjs (1.3.0)
multi_json (~> 1.0)
- fabrication (1.0.1)
- faker (0.9.5)
+ fabrication (1.2.0)
+ faker (1.0.1)
i18n (~> 0.4)
- ffi (1.0.9)
- gherkin (2.4.6)
+ ffi (1.0.11)
+ fssm (0.2.8.1)
+ gherkin (2.7.7)
json (>= 1.4.6)
- hike (1.2.0)
+ growl_notify (0.0.3)
+ rb-appscript
+ guard (1.0.0)
+ ffi (>= 0.5.0)
+ thor (~> 0.14.6)
+ guard-shell (0.3.0)
+ guard (>= 0.2.0)
+ haml (3.1.4)
+ hike (1.2.1)
i18n (0.6.0)
- jasmine (1.0.2.1)
- json_pure (>= 1.4.3)
+ jasmine (1.1.2)
+ jasmine-core (>= 1.1.0)
rack (>= 1.1)
rspec (>= 1.3.1)
selenium-webdriver (>= 0.1.3)
- jquery-rails (1.0.13)
- railties (~> 3.0)
+ jasmine-core (1.1.0)
+ jasminerice (0.0.8)
+ haml
+ journey (1.0.1)
+ jquery-rails (2.0.0)
+ railties (>= 3.2.0.beta, < 5.0)
thor (~> 0.14)
- json (1.5.3)
- json_pure (1.5.3)
+ json (1.6.5)
launchy (2.0.5)
addressable (~> 2.2.6)
- linecache19 (0.5.12)
- ruby_core_source (>= 0.1.4)
- mail (2.3.0)
+ mail (2.4.1)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
- mime-types (1.16)
- multi_json (1.0.3)
+ method_source (0.7.0)
+ mime-types (1.17.2)
+ mongo (1.5.2)
+ bson (= 1.5.2)
+ mongoid (2.4.3)
+ activemodel (~> 3.1)
+ mongo (~> 1.3)
+ tzinfo (~> 0.3.22)
+ mongoid-rspec (1.4.4)
+ mongoid (~> 2.0)
+ rspec (~> 2)
+ multi_json (1.0.4)
nokogiri (1.5.0)
- pjax-rails (0.1.4)
- jquery-rails
- polyglot (0.3.2)
- rack (1.3.2)
- rack-cache (1.0.2)
+ polyglot (0.3.3)
+ pry (0.9.8.2)
+ coderay (~> 1.0.5)
+ method_source (~> 0.7)
+ slop (>= 2.4.4, < 3)
+ rack (1.4.1)
+ rack-cache (1.1)
rack (>= 0.4)
- rack-mount (0.8.2)
- rack (>= 1.0.0)
rack-ssl (1.3.2)
rack
rack-test (0.6.1)
rack (>= 1.0)
- rails (3.1.0.rc5)
- actionmailer (= 3.1.0.rc5)
- actionpack (= 3.1.0.rc5)
- activerecord (= 3.1.0.rc5)
- activeresource (= 3.1.0.rc5)
- activesupport (= 3.1.0.rc5)
+ rails (3.2.1)
+ actionmailer (= 3.2.1)
+ actionpack (= 3.2.1)
+ activerecord (= 3.2.1)
+ activeresource (= 3.2.1)
+ activesupport (= 3.2.1)
bundler (~> 1.0)
- railties (= 3.1.0.rc5)
- railties (3.1.0.rc5)
- actionpack (= 3.1.0.rc5)
- activesupport (= 3.1.0.rc5)
+ railties (= 3.2.1)
+ railties (3.2.1)
+ actionpack (= 3.2.1)
+ activesupport (= 3.2.1)
rack-ssl (~> 1.3.2)
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (~> 0.14.6)
- rake (0.9.2)
- rcov (0.9.10)
- rdoc (3.9.2)
- rspec (2.6.0)
- rspec-core (~> 2.6.0)
- rspec-expectations (~> 2.6.0)
- rspec-mocks (~> 2.6.0)
- rspec-core (2.6.4)
- rspec-expectations (2.6.0)
+ rake (0.9.2.2)
+ rb-appscript (0.6.1)
+ rb-fsevent (0.9.0)
+ rdoc (3.12)
+ json (~> 1.4)
+ rspec (2.8.0)
+ rspec-core (~> 2.8.0)
+ rspec-expectations (~> 2.8.0)
+ rspec-mocks (~> 2.8.0)
+ rspec-core (2.8.0)
+ rspec-expectations (2.8.0)
diff-lcs (~> 1.1.2)
- rspec-mocks (2.6.0)
- rspec-rails (2.6.1)
- actionpack (~> 3.0)
- activesupport (~> 3.0)
- railties (~> 3.0)
- rspec (~> 2.6.0)
- ruby-debug-base19 (0.11.25)
- columnize (>= 0.3.1)
- linecache19 (>= 0.5.11)
- ruby_core_source (>= 0.1.4)
- ruby-debug19 (0.11.6)
- columnize (>= 0.3.1)
- linecache19 (>= 0.5.11)
- ruby-debug-base19 (>= 0.11.19)
- ruby_core_source (0.1.5)
- archive-tar-minitar (>= 0.5.2)
- rubyzip (0.9.4)
- sass (3.1.7)
- sass-rails (3.1.0.rc.5)
- actionpack (~> 3.1.0.rc1)
- railties (~> 3.1.0.rc1)
- sass (>= 3.1.4)
- sprockets (>= 2.0.0.beta.9)
- selenium-webdriver (2.4.0)
- childprocess (>= 0.2.1)
- ffi (>= 1.0.7)
- json_pure
+ rspec-mocks (2.8.0)
+ rspec-rails (2.8.1)
+ actionpack (>= 3.0)
+ activesupport (>= 3.0)
+ railties (>= 3.0)
+ rspec (~> 2.8.0)
+ rubyzip (0.9.6.1)
+ sass (3.1.15)
+ sass-rails (3.2.4)
+ railties (~> 3.2.0)
+ sass (>= 3.1.10)
+ tilt (~> 1.3)
+ selenium-webdriver (2.19.0)
+ childprocess (>= 0.2.5)
+ ffi (~> 1.0.9)
+ multi_json (~> 1.0.4)
rubyzip
- sprockets (2.0.0.beta.13)
+ slop (2.4.4)
+ sprockets (2.1.2)
hike (~> 1.2)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
- sqlite3 (1.3.4)
+ sqlite3 (1.3.5)
syntax (1.0.0)
- term-ansicolor (1.0.6)
+ term-ansicolor (1.0.7)
thor (0.14.6)
- tilt (1.3.2)
+ tilt (1.3.3)
+ timecop (0.3.5)
treetop (1.4.10)
polyglot
polyglot (>= 0.3.1)
- tzinfo (0.3.29)
- uglifier (1.0.1)
+ tzinfo (0.3.31)
+ uglifier (1.2.3)
execjs (>= 0.3.0)
multi_json (>= 1.0.2)
webrat (0.7.3)
@@ -193,34 +214,39 @@ GEM
rack-test (>= 0.5.3)
xpath (0.1.4)
nokogiri (~> 1.3)
- yard (0.7.2)
+ yard (0.7.5)
PLATFORMS
ruby
DEPENDENCIES
+ bson_ext (>= 1.5)
capybara
chronic
- coffee-rails (~> 3.1.0.rc)
- cucumber
+ coffee-rails (~> 3.2.1)
+ compass-rails
cucumber-rails
database_cleaner
email_spec
fabrication
faker
+ gricer!
+ growl_notify
+ guard-shell
jasmine
+ jasminerice
jquery-rails
launchy
- pjax-rails
- rails (~> 3.1.0.rc)
- rcov
- rspec
- rspec-rails
- ruby-debug19
- sass-rails (~> 3.1.0.rc)
- spork!
+ mongoid (>= 2.4)
+ mongoid-rspec
+ pry
+ rails (~> 3.2.1)
+ rb-fsevent
+ rspec-rails (>= 2.8.1)
+ sass-rails (~> 3.2.3)
sqlite3
syntax
- uglifier
+ timecop
+ uglifier (>= 1.0.3)
webrat
yard
View
2 Rakefile
@@ -29,5 +29,7 @@ namespace :doc do
end
end
+Bundler::GemHelper.install_tasks
+
APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
load 'rails/tasks/engine.rake'
View
16 app/assets/stylesheets/gricer/fluid-jquery-ui.css.scss
@@ -10,7 +10,7 @@
* http://docs.jquery.com/UI/Theming/API
*/
-@import 'helpers/css3';
+@import 'compass/css3';
$jquery-ui-widget-border-color: #333;
$jquery-ui-widget-background-color: #ddd;
@@ -153,7 +153,7 @@ $jquery-ui-widget-error-text-color: #383838;
.ui-widget-content {
border: 1px solid $jquery-ui-widget-border-color;
background: $jquery-ui-widget-background-color;
- @include gradient(lighten($jquery-ui-widget-background-color, 20%), darken($jquery-ui-widget-background-color, 20%));
+ @include background-image(linear-gradient(lighten($jquery-ui-widget-background-color, 20%), darken($jquery-ui-widget-background-color, 20%)));
color: $jquery-ui-widget-text-color;
}
@@ -164,7 +164,7 @@ $jquery-ui-widget-error-text-color: #383838;
.ui-widget-header {
border: 1px solid $jquery-ui-widget-header-border-color;
background: $jquery-ui-widget-header-background-color;
- @include gradient(lighten($jquery-ui-widget-header-background-color, 20%), darken($jquery-ui-widget-header-background-color, 20%));
+ @include background-image(linear-gradient(lighten($jquery-ui-widget-header-background-color, 20%), darken($jquery-ui-widget-header-background-color, 20%)));
color: $jquery-ui-widget-header-text-color;
font-weight: bold;
}
@@ -179,7 +179,7 @@ $jquery-ui-widget-error-text-color: #383838;
.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default {
border: 1px solid $jquery-ui-widget-default-border-color;
background: $jquery-ui-widget-default-background-color;
- @include gradient(lighten($jquery-ui-widget-default-background-color, 20%), darken($jquery-ui-widget-default-background-color, 20%));
+ @include background-image(linear-gradient(lighten($jquery-ui-widget-default-background-color, 20%), darken($jquery-ui-widget-default-background-color, 20%)));
font-weight: bold;
color: $jquery-ui-widget-default-text-color;
}
@@ -192,7 +192,7 @@ $jquery-ui-widget-error-text-color: #383838;
.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus {
border: 1px solid $jquery-ui-widget-hover-border-color;
background: $jquery-ui-widget-hover-background-color;
- @include gradient(lighten($jquery-ui-widget-hover-background-color, 20%), darken($jquery-ui-widget-hover-background-color, 20%));
+ @include background-image(linear-gradient(lighten($jquery-ui-widget-hover-background-color, 20%), darken($jquery-ui-widget-hover-background-color, 20%)));
font-weight: bold;
color: $jquery-ui-widget-hover-text-color;
}
@@ -205,7 +205,7 @@ $jquery-ui-widget-error-text-color: #383838;
.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active {
border: 1px solid $jquery-ui-widget-active-border-color;
background: $jquery-ui-widget-active-background-color;
- @include gradient(lighten($jquery-ui-widget-active-background-color, 20%), darken($jquery-ui-widget-active-background-color, 20%));
+ @include background-image(linear-gradient(lighten($jquery-ui-widget-active-background-color, 20%), darken($jquery-ui-widget-active-background-color, 20%)));
font-weight: bold;
color: $jquery-ui-widget-active-text-color;
}
@@ -225,7 +225,7 @@ $jquery-ui-widget-error-text-color: #383838;
.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {
border: 1px solid $jquery-ui-widget-highlight-border-color;
background: $jquery-ui-widget-highlight-background-color;
- @include gradient(lighten($jquery-ui-widget-highlight-background-color, 20%), darken($jquery-ui-widget-highlight-background-color, 20%));
+ @include background-image(linear-gradient(lighten($jquery-ui-widget-highlight-background-color, 20%), darken($jquery-ui-widget-highlight-background-color, 20%)));
color: $jquery-ui-widget-highlight-text-color;
}
@@ -236,7 +236,7 @@ $jquery-ui-widget-error-text-color: #383838;
.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {
border: 1px solid $jquery-ui-widget-error-border-color;
background: $jquery-ui-widget-error-background-color;
- @include gradient(lighten($jquery-ui-widget-error-background-color, 20%), darken($jquery-ui-widget-error-background-color, 20%));
+ @include background-image(linear-gradient(lighten($jquery-ui-widget-error-background-color, 20%), darken($jquery-ui-widget-error-background-color, 20%)));
color: $jquery-ui-widget-error-text-color;
}
View
12 app/assets/stylesheets/gricer/fluid.css.scss
@@ -1,4 +1,4 @@
-@import 'gricer/helpers/css3';
+@import 'compass/css3';
.gricer-stat {
position: absolute;
@@ -16,7 +16,7 @@
line-height: 20px;
height: 20px;
background: #eee;
- @include gradient(#eee,#ccc);
+ @include background-image(linear-gradient(#eee,#ccc));
.path {
a {
@@ -72,7 +72,7 @@
&.active {
border-top: 1px solid #a3b1cc;
background: #94a6c5;
- @include gradient(#b0bed7, #8195b8);
+ @include background-image(linear-gradient(#b0bed7, #8195b8));
color: #fff;
}
}
@@ -135,15 +135,15 @@
span, a {
padding: 2px 4px;
background: #ccc;
- @include gradient(#ddd, #bbb);
+ @include background-image(linear-gradient(#ddd, #bbb));
border-right: 1px solid #b4b4b4;
color: #000;
text-decoration: none;
}
span {
background: #666;
- @include gradient(#555, #777);
+ @include background-image(linear-gradient(#555, #777));
color: #fff;
}
@@ -204,7 +204,7 @@
tr:first-child {
th {
background: #eee;
- @include gradient(#ccc,#eee);
+ @include background-image(linear-gradient(#ccc,#eee));
border-bottom: 1px solid #b4b4b4;
border-right: 1px solid #b4b4b4;
overflow: hidden;
View
21 app/assets/stylesheets/gricer/helpers/css3.css.scss
@@ -1,21 +0,0 @@
-@mixin border-radius($radius) {
- -webkit-border-radius: $radius;
- -moz-border-radius: $radius;
- -o-border-radius: $radius;
- -ms-border-radius: $radius;
- -khtml-border-radius: $radius;
- border-radius: $radius;
-}
-
-@mixin gradient($from, $to) {
- background-image: -webkit-gradient(linear, left top, left bottom, from($from), to($to));
- background-image: -moz-linear-gradient($from, $to);
- background-image: linear-gradient($from, $to);
-}
-
-@mixin rotate($degree: -90deg) {
- -moz-transform:rotate($degree);
- -webkit-transform:rotate($degree);
- -o-transform:rotate($degree);
- transform:rotate($degree);
-}
View
2 app/controllers/gricer/dashboard_controller.rb
@@ -12,7 +12,7 @@ def overview
@sessions = Session.browsers.between_dates(@stat_from, @stat_thru)
@requests = Request.browsers.between_dates(@stat_from, @stat_thru)
- render partial: 'overview.html', locals: {sessions: @sessions, requests: @requests}
+ render partial: 'overview', formats: [:html], locals: {sessions: @sessions, requests: @requests}
end
end
end
View
2 app/models/gricer/agent.rb
@@ -29,7 +29,7 @@ module Gricer
#
# See {AGENT_CLASSES} for possible values.
class Agent < ::ActiveRecord::Base
- set_table_name "#{::Gricer::config.table_name_prefix}agents"
+ self.table_name = "#{::Gricer::config.table_name_prefix}agents"
include ActiveModel::Statistics
has_many :requests, class_name: 'Gricer::Request', foreign_key: :agent_id, order: 'created_at ASC'
View
4 app/models/gricer/request.rb
@@ -103,7 +103,7 @@ module Gricer
# The current value of the locale responded
#
class Request < ::ActiveRecord::Base
- set_table_name "#{::Gricer::config.table_name_prefix}requests"
+ self.table_name = "#{::Gricer::config.table_name_prefix}requests"
include ActiveModel::Statistics
belongs_to :session, class_name: 'Gricer::Session', counter_cache: true
@@ -150,7 +150,7 @@ def request=(request)
self.protocol = request.protocol.sub(/[:\/]*$/, '').upcase
self.locale = I18n.locale
- @request_locale = request.headers['HTTP_ACCEPT_LANGUAGE'].try(:split, ',').try(:first)
+ @request_locale = request.headers['HTTP_ACCEPT_LANGUAGE'].try(:scan, /[^,;]+/).try(:first)
#logger.debug I18n.locale
end
View
2 app/models/gricer/session.rb
@@ -97,7 +97,7 @@ module Gricer
# The current value of the locale requested
#
class Session < ::ActiveRecord::Base
- set_table_name "#{::Gricer::config.table_name_prefix}sessions"
+ self.table_name = "#{::Gricer::config.table_name_prefix}sessions"
include ActiveModel::Statistics
has_many :requests, class_name: 'Gricer::Request', foreign_key: :session_id, order: 'created_at ASC'
View
96 features/support/env.rb
@@ -4,61 +4,55 @@
# instead of editing this one. Cucumber will automatically load all features/**/*.rb
# files.
+ENV["RAILS_ENV"] ||= "test"
+ENV["RAILS_ROOT"] ||= File.expand_path(File.dirname(__FILE__) + '/../../spec/dummy/')
-require 'spork'
+require 'cucumber/rails'
-Spork.prefork do
- ENV["RAILS_ENV"] ||= "test"
- ENV["RAILS_ROOT"] ||= File.expand_path(File.dirname(__FILE__) + '/../../spec/dummy/')
-
- require 'cucumber/rails'
+# Capybara defaults to XPath selectors rather than Webrat's default of CSS3. In
+# order to ease the transition to Capybara we set the default here. If you'd
+# prefer to use XPath just remove this line and adjust any selectors in your
+# steps to use the XPath syntax.
+Capybara.default_selector = :css
- # Capybara defaults to XPath selectors rather than Webrat's default of CSS3. In
- # order to ease the transition to Capybara we set the default here. If you'd
- # prefer to use XPath just remove this line and adjust any selectors in your
- # steps to use the XPath syntax.
- Capybara.default_selector = :css
-end
-
-Spork.each_run do
- # By default, any exception happening in your Rails application will bubble up
- # to Cucumber so that your scenario will fail. This is a different from how
- # your application behaves in the production environment, where an error page will
- # be rendered instead.
- #
- # Sometimes we want to override this default behaviour and allow Rails to rescue
- # exceptions and display an error page (just like when the app is running in production).
- # Typical scenarios where you want to do this is when you test your error pages.
- # There are two ways to allow Rails to rescue exceptions:
- #
- # 1) Tag your scenario (or feature) with @allow-rescue
- #
- # 2) Set the value below to true. Beware that doing this globally is not
- # recommended as it will mask a lot of errors for you!
- #
- ActionController::Base.allow_rescue = false
+# By default, any exception happening in your Rails application will bubble up
+# to Cucumber so that your scenario will fail. This is a different from how
+# your application behaves in the production environment, where an error page will
+# be rendered instead.
+#
+# Sometimes we want to override this default behaviour and allow Rails to rescue
+# exceptions and display an error page (just like when the app is running in production).
+# Typical scenarios where you want to do this is when you test your error pages.
+# There are two ways to allow Rails to rescue exceptions:
+#
+# 1) Tag your scenario (or feature) with @allow-rescue
+#
+# 2) Set the value below to true. Beware that doing this globally is not
+# recommended as it will mask a lot of errors for you!
+#
+ActionController::Base.allow_rescue = false
- # If you set this to true, each scenario will run in a database transaction.
- # You can still turn off transactions on a per-scenario basis, simply tagging
- # a feature or scenario with the @no-txn tag. If you are using Capybara,
- # tagging with @culerity or @javascript will also turn transactions off.
- #
- # If you set this to false, transactions will be off for all scenarios,
- # regardless of whether you use @no-txn or not.
- #
- # Beware that turning transactions off will leave data in your database
- # after each scenario, which can lead to hard-to-debug failures in
- # subsequent scenarios. If you do this, we recommend you create a Before
- # block that will explicitly put your database in a known state.
- Cucumber::Rails::World.use_transactional_fixtures = true
+# If you set this to true, each scenario will run in a database transaction.
+# You can still turn off transactions on a per-scenario basis, simply tagging
+# a feature or scenario with the @no-txn tag. If you are using Capybara,
+# tagging with @culerity or @javascript will also turn transactions off.
+#
+# If you set this to false, transactions will be off for all scenarios,
+# regardless of whether you use @no-txn or not.
+#
+# Beware that turning transactions off will leave data in your database
+# after each scenario, which can lead to hard-to-debug failures in
+# subsequent scenarios. If you do this, we recommend you create a Before
+# block that will explicitly put your database in a known state.
+Cucumber::Rails::World.use_transactional_fixtures = true
- # How to clean your database when transactions are turned off. See
- # http://github.com/bmabey/database_cleaner for more info.
- if defined?(ActiveRecord::Base)
- begin
- require 'database_cleaner'
- DatabaseCleaner.strategy = :truncation
- rescue LoadError => ignore_if_database_cleaner_not_present
- end
+# How to clean your database when transactions are turned off. See
+# http://github.com/bmabey/database_cleaner for more info.
+if defined?(ActiveRecord::Base)
+ begin
+ require 'database_cleaner'
+ DatabaseCleaner.strategy = :truncation
+ rescue LoadError => ignore_if_database_cleaner_not_present
end
end
+
View
35 features/support/setup.rb
@@ -1,21 +1,14 @@
-require 'spork'
-
-Spork.prefork do
- require 'cucumber/formatter/unicode'
- require 'cucumber/rails/world'
- require 'cucumber/web/tableish'
-
- require 'capybara/rails'
- require 'capybara/cucumber'
- require 'capybara/session'
- require 'cucumber/rails/capybara/javascript_emulation'
-
- require 'email_spec'
- require 'email_spec/cucumber'
-
- ActiveSupport::Dependencies.clear
-end
-
-Spork.each_run do
- Rails.application.reload_routes!
-end
+require 'cucumber/formatter/unicode'
+require 'cucumber/rails/world'
+
+require 'capybara/rails'
+require 'capybara/cucumber'
+require 'capybara/session'
+require 'cucumber/rails/capybara/javascript_emulation'
+
+require 'email_spec'
+require 'email_spec/cucumber'
+
+ActiveSupport::Dependencies.clear
+
+Rails.application.reload_routes!
View
7 gricer.gemspec
@@ -6,9 +6,8 @@ Gem::Specification.new do |s|
s.email = 'info@gricer.org'
s.homepage = 'http://gricer.org/'
s.files = Dir["app/**/*"] + Dir["lib/**/*"] + Dir["spec/**/*"] + Dir["db/migrate/*"] + Dir["config/**/*"] + ["MIT-LICENSE", "Rakefile", "README.rdoc", "script/rails"]
- s.add_dependency 'rails', '>= 3.1.0.rc'
- s.add_dependency 'coffee-script', '>= 2.2.0'
- s.add_dependency 'sass-rails', '>= 3.1.0.rc'
- s.add_dependency 'pjax-rails'
+ s.add_dependency 'rails', '>= 3.2.0'
+ s.add_dependency 'coffee-rails', '>= 3.2.0'
+ s.add_dependency 'sass-rails', '>= 3.2.0'
s.version = "0.0.5"
end
View
3 lib/gricer.rb
@@ -5,6 +5,9 @@
require 'gricer/active_model/statistics'
+require 'sass'
+require 'compass'
+
# Gricer is a web analytics gem for Rails 3.1 and beyond
module Gricer
autoload :Config, 'gricer/config'
View
BIN spec/dummy/.sass-cache/9851804ca153bd582c2879ff216f5f8128947b7a/fluid.css.scssc
Binary file not shown.
View
1 spec/dummy/app/assets/javascripts/application.js
@@ -5,5 +5,6 @@
// the compiled file.
//
//= require jquery
+//= require jquery-ui
//= require jquery_ujs
//= require gricer
View
1 spec/dummy/app/assets/stylesheets/application.css
@@ -3,6 +3,7 @@
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
* the top of the compiled file, but it's generally better to create a new file per style scope.
*= require_self
+ *= require gricer/fluid-jquery-ui
*= require gricer/fluid
*/
View
4 spec/dummy/app/assets/stylesheets/dashboard.css
@@ -1,4 +0,0 @@
-/*
- Place all the styles related to the matching controller here.
- They will automatically be included in application.css.
-*/
View
4 spec/dummy/app/assets/stylesheets/sessions.css
@@ -1,4 +0,0 @@
-/*
- Place all the styles related to the matching controller here.
- They will automatically be included in application.css.
-*/
View
19 spec/dummy/config/application.rb
@@ -2,8 +2,9 @@
require 'rails/all'
-Bundler.require
-require "gricer"
+# If you have a Gemfile, require the gems listed there, including any gems
+# you've limited to :test, :development, or :production.
+Bundler.require *Rails.groups(:assets => %w(development test staging production))
module Dummy
class Application < Rails::Application
@@ -35,9 +36,23 @@ class Application < Rails::Application
# Configure sensitive parameters which will be filtered from the log file.
config.filter_parameters += [:password]
+ # Use SQL instead of Active Record's schema dumper when creating the database.
+ # This is necessary if your schema can't be completely dumped by the schema dumper,
+ # like if you have constraints or database-specific column types
+ # config.active_record.schema_format = :sql
+
+ # Enforce whitelist mode for mass assignment.
+ # This will create an empty whitelist of attributes available for mass-assignment for all models
+ # in your app. As such, your models will need to explicitly whitelist or blacklist accessible
+ # parameters by using an attr_accessible or attr_protected declaration.
+ # config.active_record.whitelist_attributes = true
+
# Enable the asset pipeline
config.assets.enabled = true
+ # Version of your assets, change this if you want to expire all your assets
+ config.assets.version = '1.0'
+
config.generators do |g|
g.orm :active_record
g.template_engine :erb
View
12 spec/dummy/config/environments/development.rb
@@ -2,7 +2,7 @@
# Settings specified here will take precedence over those in config/application.rb
# In the development environment your application's code is reloaded on
- # every request. This slows down response time but is perfect for development
+ # every request. This slows down response time but is perfect for development
# since you don't have to restart the web server when you make code changes.
config.cache_classes = false
@@ -22,6 +22,16 @@
# Only use best-standards-support built into browsers
config.action_dispatch.best_standards_support = :builtin
+ # Raise exception on mass assignment protection for Active Record models
+ config.active_record.mass_assignment_sanitizer = :strict
+
+ # Log the query plan for queries taking more than this (works
+ # with SQLite, MySQL, and PostgreSQL)
+ config.active_record.auto_explain_threshold_in_seconds = 0.5
+
# Do not compress assets
config.assets.compress = false
+
+ # Expands the lines which load the assets
+ config.assets.debug = true
end
View
51 spec/dummy/config/environments/production.rb
@@ -1,51 +0,0 @@
-Dummy::Application.configure do
- # Settings specified here will take precedence over those in config/application.rb
-
- # Code is not reloaded between requests
- config.cache_classes = true
-
- # Full error reports are disabled and caching is turned on
- config.consider_all_requests_local = false
- config.action_controller.perform_caching = true
-
- # Disable Rails's static asset server (Apache or nginx will already do this)
- config.serve_static_assets = false
-
- # Compress JavaScripts and CSS
- config.assets.compress = true
-
- # Specifies the header that your server uses for sending files
- # (comment out if your front-end server doesn't support this)
- config.action_dispatch.x_sendfile_header = "X-Sendfile" # Use 'X-Accel-Redirect' for nginx
-
- # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
- # config.force_ssl = true
-
- # See everything in the log (default is :info)
- # config.log_level = :debug
-
- # Use a different logger for distributed setups
- # config.logger = SyslogLogger.new
-
- # Use a different cache store in production
- # config.cache_store = :mem_cache_store
-
- # Enable serving of images, stylesheets, and JavaScripts from an asset server
- # config.action_controller.asset_host = "http://assets.example.com"
-
- # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
- # config.assets.precompile += %w( search.js )
-
- # Disable delivery errors, bad email addresses will be ignored
- # config.action_mailer.raise_delivery_errors = false
-
- # Enable threaded mode
- # config.threadsafe!
-
- # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
- # the I18n.default_locale when a translation can not be found)
- config.i18n.fallbacks = true
-
- # Send deprecation notices to registered listeners
- config.active_support.deprecation = :notify
-end
View
10 spec/dummy/config/environments/test.rb
@@ -2,9 +2,9 @@
# Settings specified here will take precedence over those in config/application.rb
# The test environment is used exclusively to run your application's
- # test suite. You never need to work with it otherwise. Remember that
+ # test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test suite and is wiped
- # and recreated between test runs. Don't rely on the data there!
+ # and recreated between test runs. Don't rely on the data there!
config.cache_classes = true
# Configure static asset server for tests with Cache-Control for performance
@@ -29,10 +29,8 @@
# ActionMailer::Base.deliveries array.
config.action_mailer.delivery_method = :test
- # Use SQL instead of Active Record's schema dumper when creating the test database.
- # This is necessary if your schema can't be completely dumped by the schema dumper,
- # like if you have constraints or database-specific column types
- # config.active_record.schema_format = :sql
+ # Raise exception on mass assignment protection for Active Record models
+ config.active_record.mass_assignment_sanitizer = :strict
# Print deprecation notices to the stderr
config.active_support.deprecation = :stderr
View
7 spec/dummy/config/mongoid.yml
@@ -0,0 +1,7 @@
+development:
+ host: localhost
+ database: gricer_development
+
+test:
+ host: localhost
+ database: gricer_test
View
1 spec/dummy/db/schema.rb
@@ -1,3 +1,4 @@
+# encoding: UTF-8
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
View
27 spec/spec_helper.rb
@@ -1,23 +1,18 @@
-require 'spork'
+ENV["RAILS_ENV"] = "test"
-Spork.prefork do
- ENV["RAILS_ENV"] = "test"
+require File.expand_path("../dummy/config/environment.rb", __FILE__)
+require 'rspec/rails'
- require File.expand_path("../dummy/config/environment.rb", __FILE__)
- require 'rspec/rails'
+Rails.backtrace_cleaner.remove_silencers!
- Rails.backtrace_cleaner.remove_silencers!
+Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
- Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
-
- RSpec.configure do |config|
- config.mock_with :rspec
- config.use_transactional_fixtures = true
- end
+RSpec.configure do |config|
+ config.mock_with :rspec
+ config.use_transactional_fixtures = true
end
-Spork.each_run do
- Rails.application.reload_routes!
- Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
-end
+Rails.application.reload_routes!
+Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
+

0 comments on commit 1e463a8

Please sign in to comment.