Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails 3.1 upgrade #10

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ db/schema.rb
.DS_Store
log/*
tmp/*

.bundle
.sass-cache/
1 change: 1 addition & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--colour
35 changes: 35 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
source "http://rubygems.org"

gem "rails", "3.1.0"

# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem "sass-rails", "~> 3.1.0"
gem "coffee-rails", "~> 3.1.0"
gem "uglifier"
end

gem 'jquery-rails'

gem "bson_ext", "~> 1.4"
gem "mongo", "~> 1.4"
gem "mongo_mapper", "~> 0.9.1"
gem "haml-rails", "~> 0.3.4"
gem "devise", "~> 1.4.7"
gem "devise-mongo_mapper", :git => "git://github.com/proxygear/devise-mongo_mapper.git"
gem "will_paginate", "~> 3.0.1"
gem "dynamic_form"

group :development, :test do
gem "rspec-rails", "~> 2.6.1"
end

group :test do
gem "capybara"
gem "timecop"
gem "randexp", "~> 0.1.5"
gem "factory_girl", "~> 2.1.2"
gem "email_spec", "~> 1.2.1"
gem "mocha", "~> 0.10.0"
end
212 changes: 212 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,212 @@
GIT
remote: git://github.com/proxygear/devise-mongo_mapper.git
revision: bbafac6612be9c68ca5938c24dfbd3f9327e65a6
specs:
devise-mongo_mapper (0.0.2)
devise

GEM
remote: http://rubygems.org/
specs:
ParseTree (3.0.7)
RubyInline (>= 3.7.0)
sexp_processor (>= 3.0.0)
RubyInline (3.10.1)
ZenTest (~> 4.3)
ZenTest (4.6.2)
actionmailer (3.1.0)
actionpack (= 3.1.0)
mail (~> 2.3.0)
actionpack (3.1.0)
activemodel (= 3.1.0)
activesupport (= 3.1.0)
builder (~> 3.0.0)
erubis (~> 2.7.0)
i18n (~> 0.6)
rack (~> 1.3.2)
rack-cache (~> 1.0.3)
rack-mount (~> 0.8.2)
rack-test (~> 0.6.1)
sprockets (~> 2.0.0)
activemodel (3.1.0)
activesupport (= 3.1.0)
bcrypt-ruby (~> 3.0.0)
builder (~> 3.0.0)
i18n (~> 0.6)
activerecord (3.1.0)
activemodel (= 3.1.0)
activesupport (= 3.1.0)
arel (~> 2.2.1)
tzinfo (~> 0.3.29)
activeresource (3.1.0)
activemodel (= 3.1.0)
activesupport (= 3.1.0)
activesupport (3.1.0)
multi_json (~> 1.0)
arel (2.2.1)
bcrypt-ruby (3.0.1)
bson (1.4.0)
bson_ext (1.4.0)
builder (3.0.0)
capybara (1.1.1)
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.2)
ffi (~> 1.0.6)
coffee-rails (3.1.1)
coffee-script (>= 2.2.0)
railties (~> 3.1.0)
coffee-script (2.2.0)
coffee-script-source
execjs
coffee-script-source (1.1.2)
devise (1.4.7)
bcrypt-ruby (~> 3.0)
orm_adapter (~> 0.0.3)
warden (~> 1.0.3)
diff-lcs (1.1.3)
dynamic_form (1.1.4)
email_spec (1.2.1)
mail (~> 2.2)
rspec (~> 2.0)
erubis (2.7.0)
execjs (1.2.9)
multi_json (~> 1.0)
factory_girl (2.1.2)
activesupport
ffi (1.0.9)
haml (3.1.3)
haml-rails (0.3.4)
actionpack (~> 3.0)
activesupport (~> 3.0)
haml (~> 3.0)
railties (~> 3.0)
hike (1.2.1)
i18n (0.6.0)
jquery-rails (1.0.14)
railties (~> 3.0)
thor (~> 0.14)
json_pure (1.6.1)
mail (2.3.0)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
metaclass (0.0.1)
mime-types (1.16)
mocha (0.10.0)
metaclass (~> 0.0.1)
mongo (1.4.0)
bson (= 1.4.0)
mongo_mapper (0.9.2)
activemodel (~> 3.0)
activesupport (~> 3.0)
plucky (~> 0.3.8)
multi_json (1.0.3)
nokogiri (1.5.0)
orm_adapter (0.0.5)
plucky (0.3.8)
mongo (~> 1.3)
polyglot (0.3.2)
rack (1.3.3)
rack-cache (1.0.3)
rack (>= 0.4)
rack-mount (0.8.3)
rack (>= 1.0.0)
rack-ssl (1.3.2)
rack
rack-test (0.6.1)
rack (>= 1.0)
rails (3.1.0)
actionmailer (= 3.1.0)
actionpack (= 3.1.0)
activerecord (= 3.1.0)
activeresource (= 3.1.0)
activesupport (= 3.1.0)
bundler (~> 1.0)
railties (= 3.1.0)
railties (3.1.0)
actionpack (= 3.1.0)
activesupport (= 3.1.0)
rack-ssl (~> 1.3.2)
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (~> 0.14.6)
rake (0.9.2)
randexp (0.1.5)
ParseTree
rdoc (3.9.4)
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)
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)
rubyzip (0.9.4)
sass (3.1.7)
sass-rails (3.1.2)
actionpack (~> 3.1.0)
railties (~> 3.1.0)
sass (>= 3.1.4)
sprockets (~> 2.0.0)
tilt (~> 1.3.2)
selenium-webdriver (2.6.0)
childprocess (>= 0.2.1)
ffi (>= 1.0.7)
json_pure
rubyzip
sexp_processor (3.0.7)
sprockets (2.0.0)
hike (~> 1.2)
rack (~> 1.0)
tilt (!= 1.3.0, ~> 1.1)
thor (0.14.6)
tilt (1.3.3)
timecop (0.3.5)
treetop (1.4.10)
polyglot
polyglot (>= 0.3.1)
tzinfo (0.3.29)
uglifier (1.0.3)
execjs (>= 0.3.0)
multi_json (>= 1.0.2)
warden (1.0.5)
rack (>= 1.0)
will_paginate (3.0.1)
xpath (0.1.4)
nokogiri (~> 1.3)

PLATFORMS
ruby

DEPENDENCIES
bson_ext (~> 1.4)
capybara
coffee-rails (~> 3.1.0)
devise (~> 1.4.7)
devise-mongo_mapper!
dynamic_form
email_spec (~> 1.2.1)
factory_girl (~> 2.1.2)
haml-rails (~> 0.3.4)
jquery-rails
mocha (~> 0.10.0)
mongo (~> 1.4)
mongo_mapper (~> 0.9.1)
rails (= 3.1.0)
randexp (~> 0.1.5)
rspec-rails (~> 2.6.1)
sass-rails (~> 3.1.0)
timecop
uglifier
will_paginate (~> 3.0.1)
37 changes: 18 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,22 @@ ErrorNot :
You will need

- Ruby of 1.8.6 or greater
- Rails 2.3.5
- MongoMapper 0.7.1
- Rails 3.1.0
- MongoMapper 0.9.2
- A MongoDB 1.0.1 or greater

## Installing

- fetch source from our github account ( git clone git://github.com/errornot/ErrorNot.git )
- install rails gem ( gem install rails -v2.3.5 )
- install all gems required by ErrorNot ( rake gems:install )
- install bundler gem ( `gem install bundler` )
- install all gems required by ErrorNot ( `bundle` )
- configure your database
- copy config/database.yml.sample to config/database.yml
- update config/database.yml with your database connection and the table name
- configure your email settings
- copy config/email.yaml.sample to config/email.yml
- update it with email configuration (sendmail or smtp information)
- Start the server in production mode : ruby script/server -e production
- Start the server in production mode : `rails s -e production`
- If you want that your user can be received their notification by digest, you need
add the rake task `RAILS_ENV=production rake notify:digest` in your crontab
- You can now register your self /user/new
Expand All @@ -62,7 +62,7 @@ You will need

If you upgrade your errornot, you need launch the task to migration your database if needed

rake db:mongo_migrate
`rake db:mongo_migrate`

## Using

Expand All @@ -79,30 +79,30 @@ If you want to hack ErrorNot, you need launch all Test. This test is made with r

You can install all gems needed with command :

- RAILS_ENV=test rake gems:install
- `bundle`

Now you can launch spec :

- rake spec
- `rake spec`

If you want to fill your Database with a lot of fake data, you can launch the task :

- rake db:populate:default
- `rake db:populate:default`

This task depends of :

- rake db:populate:users
- rake db:populate:projects
- rake db:populate:errors
- rake db:populate:comments
- rake db:populate:same_errors
- `rake db:populate:users`
- `rake db:populate:projects`
- `rake db:populate:errors`
- `rake db:populate:comments`
- `rake db:populate:same_errors`

When you have generated some data, you can fetch a user account by console and use the
default password 'tintinpouet'

$ script/console
> Project.first.members.first.email
=> "[email protected]"
$ rails c
> Project.first.members.first.email
=> "[email protected]"

Every project has one related email. You can use this email to log in.

Expand All @@ -119,5 +119,4 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program. If not, see [http://www.fsf.org/licensing/licenses/agpl-3.0.html](http://www.fsf.org/licensing/licenses/agpl-3.0.html)

along with this program. If not, see [http://www.fsf.org/licensing/licenses/agpl-3.0.html](http://www.fsf.org/licensing/licenses/agpl-3.0.html)
9 changes: 3 additions & 6 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
#!/usr/bin/env rake
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.

require(File.join(File.dirname(__FILE__), 'config', 'boot'))
require File.expand_path('../config/application', __FILE__)

require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'

require 'tasks/rails'
ErrorNot::Application.load_tasks
Binary file added app/assets/images/accept-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/delete-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/errornot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
//= require jquery
//= require jquery_ujs
//= require_tree .
7 changes: 7 additions & 0 deletions app/assets/stylesheets/application.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*
* This is a manifest file that'll automatically include all the stylesheets available in this directory
* 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_tree .
*/
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ body { font: 13px/22px Arial; background: #FFF; }

/* Header */
header { position: relative; width: 940px; height: 95px; margin: 0 auto; }
header p a { display: block; width: 317px; height: 52px; margin: 15px 0 0 0; background: url('/images/errornot.png') 0 0 no-repeat; }
header p a { display: block; width: 317px; height: 52px; margin: 15px 0 0 0; background: url(<%= asset_path "/images/errornot.png" %>) 0 0 no-repeat; }
header ul { position: absolute; top: 0; right: 10px; }
header ul li { float: left; list-style-type: none; }
header ul li a { display: block; padding: 3px 10px; background: rgb(35, 31, 32); font: normal 12px Arial; text-decoration: none; color: rgb(141, 198, 63); }
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ class ApplicationController < ActionController::Base
# Scrub sensitive parameters from your log
# filter_parameter_logging :password

rescue_from Mongo::InvalidObjectID do
rescue_from BSON::InvalidObjectId do
render_404
end

rescue_from MongoMapper::DocumentNotFound do
rescue_from MongoMapper::DocumentNotFound do
render_404
end

Expand Down
Loading