Skip to content

Commit

Permalink
[MERGE] merged in changes in Gemfile
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdill committed Feb 24, 2011
2 parents 33aacc4 + 4123400 commit 1204552
Show file tree
Hide file tree
Showing 38 changed files with 492 additions and 149 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ capybara*
public/stylesheets/compiled/*
coverage/
public/system
.DS_Store
tags
26 changes: 26 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,29 @@ gem 'uuid', '~> 2.3.1'
gem 'jquery-rails'
gem 'faker', '~> 0.3.1'
gem 'machinist', '~> 1.0.6'

group :development do
gem 'awesome_print', :require => 'ap'
gem 'ruby-debug19'
end

group :test do
gem 'awesome_print', :require => 'ap'
gem 'capybara', '~> 0.3.9'
gem 'cucumber', '~> 0.9.2'
gem 'cucumber-rails', '~> 0.3.2'
gem 'database_cleaner', '~> 0.5.2'
gem 'escape_utils', '~> 0.1.9'
gem 'faker', '~> 0.3.1'
gem 'forgery', '~> 0.3.5'
gem 'launchy', '~> 0.3.7'
gem 'machinist', '~> 1.0.6'
gem 'pickle', '~> 0.4.2'
gem 'ruby-debug19'
gem 'rspec', '= 2.0.0'
gem 'rspec-rails', '= 2.0.1'
gem 'shoulda', '~> 2.11.3'
gem 'simplecov', '~> 0.4.0'
gem 'spork', '~> 0.8.4'
gem 'yajl-ruby', '~> 0.7.8'
end
115 changes: 106 additions & 9 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -29,42 +29,81 @@ GEM
activemodel (= 3.0.3)
activesupport (= 3.0.3)
activesupport (3.0.3)
arel (2.0.6)
bcrypt-ruby (2.1.2)
archive-tar-minitar (0.5.2)
arel (2.0.8)
awesome_print (0.3.2)
bcrypt-ruby (2.1.4)
builder (2.1.2)
capistrano (2.5.19)
highline
net-scp (>= 1.0.0)
net-sftp (>= 2.0.0)
net-ssh (>= 2.0.14)
net-ssh-gateway (>= 1.0.0)
capybara (0.3.9)
culerity (>= 0.2.4)
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
selenium-webdriver (>= 0.0.3)
childprocess (0.1.7)
ffi (~> 0.6.3)
chunky_png (0.12.0)
columnize (0.3.2)
compass (0.10.6)
haml (>= 3.0.4)
compass-susy-plugin (0.8.1)
compass (>= 0.10.0)
configuration (1.2.0)
cucumber (0.9.4)
builder (~> 2.1.2)
diff-lcs (~> 1.1.2)
gherkin (~> 2.2.9)
json (~> 1.4.6)
term-ansicolor (~> 1.0.5)
cucumber-rails (0.3.2)
cucumber (>= 0.8.0)
culerity (0.2.15)
daemons (1.1.0)
devise (1.1.5)
database_cleaner (0.5.2)
devise (1.1.7)
bcrypt-ruby (~> 2.1.2)
warden (~> 1.0.2)
diff-lcs (1.1.2)
erubis (2.6.6)
abstract (>= 1.0.0)
escape_utils (0.1.9)
eventmachine (0.12.10)
faker (0.3.1)
ffi (0.6.3)
rake (>= 0.8.7)
forgery (0.3.7)
nokogiri (~> 1.4)
gherkin (2.2.9)
json (~> 1.4.6)
term-ansicolor (~> 1.0.5)
gravtastic (3.1.0)
haml (3.0.24)
haml (3.0.25)
highline (1.6.1)
i18n (0.5.0)
jquery-rails (0.2.6)
jquery-rails (0.2.7)
rails (~> 3.0)
thor (~> 0.14.4)
json (1.4.6)
json_pure (1.5.1)
launchy (0.3.7)
configuration (>= 0.0.5)
rake (>= 0.8.1)
lemonade (0.3.4)
chunky_png (>= 0.8.0)
compass (>= 0.10.0)
haml (>= 3.0.0)
linecache19 (0.5.11)
ruby_core_source (>= 0.1.4)
macaddr (1.0.0)
machinist (1.0.6)
mail (2.2.12)
mail (2.2.15)
activesupport (>= 2.3.6)
i18n (>= 0.4.0)
mime-types (~> 1.16)
Expand All @@ -75,17 +114,23 @@ GEM
net-ssh (>= 1.99.1)
net-sftp (2.0.5)
net-ssh (>= 2.0.9)
net-ssh (2.0.23)
net-ssh (2.1.0)
net-ssh-gateway (1.0.1)
net-ssh (>= 1.99.1)
nokogiri (1.4.4)
paperclip (2.3.8)
activerecord
activesupport
pickle (0.4.4)
cucumber (>= 0.8)
rake
rspec (>= 1.3)
yard
polyglot (0.3.1)
rack (1.2.1)
rack-mount (0.6.13)
rack (>= 1.0.0)
rack-test (0.5.6)
rack-test (0.5.7)
rack (>= 1.0)
rails (3.0.3)
actionmailer (= 3.0.3)
Expand All @@ -101,36 +146,88 @@ GEM
rake (>= 0.8.7)
thor (~> 0.14.4)
rake (0.8.7)
rspec (2.0.0)
rspec-core (= 2.0.0)
rspec-expectations (= 2.0.0)
rspec-mocks (= 2.0.0)
rspec-core (2.0.0)
rspec-expectations (2.0.0)
diff-lcs (>= 1.1.2)
rspec-mocks (2.0.0)
rspec-core (= 2.0.0)
rspec-expectations (= 2.0.0)
rspec-rails (2.0.1)
rspec (~> 2.0.0)
ruby-debug-base19 (0.11.24)
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.4)
archive-tar-minitar (>= 0.5.2)
rubyzip (0.9.4)
selenium-webdriver (0.1.3)
childprocess (~> 0.1.5)
ffi (~> 0.6.3)
json_pure
rubyzip
shoulda (2.11.3)
simplecov (0.4.0)
simplecov-html (~> 0.4.0)
simplecov-html (0.4.3)
spork (0.8.4)
term-ansicolor (1.0.5)
thin (1.2.7)
daemons (>= 1.0.9)
eventmachine (>= 0.12.6)
rack (>= 1.0.0)
thor (0.14.6)
treetop (1.4.9)
polyglot (>= 0.3.1)
tzinfo (0.3.23)
tzinfo (0.3.24)
uuid (2.3.1)
macaddr (~> 1.0)
warden (1.0.3)
rack (>= 1.0.0)
yajl-ruby (0.7.9)
yard (0.6.4)

PLATFORMS
ruby

DEPENDENCIES
acl9 (~> 0.12.0)
awesome_print
capistrano (~> 2.5.19)
capybara (~> 0.3.9)
compass (~> 0.10.4)
compass-susy-plugin (~> 0.8.1)
cucumber (~> 0.9.2)
cucumber-rails (~> 0.3.2)
database_cleaner (~> 0.5.2)
devise (~> 1.1.3)
escape_utils (~> 0.1.9)
faker (~> 0.3.1)
forgery (~> 0.3.5)
gravtastic
haml (~> 3.0.18)
jquery-rails
launchy (~> 0.3.7)
lemonade (~> 0.3.4)
machinist (~> 1.0.6)
mysql (~> 2.8.1)
paperclip (~> 2.3)
pickle (~> 0.4.2)
rails (= 3.0.3)
rspec (= 2.0.0)
rspec-rails (= 2.0.1)
ruby-debug19
shoulda (~> 2.11.3)
simplecov (~> 0.4.0)
spork (~> 0.8.4)
thin (~> 1.2.7)
uuid (~> 2.3.1)
yajl-ruby (~> 0.7.8)
51 changes: 28 additions & 23 deletions app/controllers/projects_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,38 @@ class ProjectsController < ApplicationController
before_filter :load_new_project, :only => [:new, :create]
before_filter :load_project, :only => [:show, :edit, :update]
before_filter :load_file_attachments, :only => [:show, :new, :create]

access_control do
allow :admin
allow :developer, :of => :project
allow :client, :of => :project, :to => [:show]
end

protected
def load_new_project
@project = Project.new(params[:project])
@project.client = Client.find(params[:client])
end

def load_project
@project = Project.find(params[:id])
# GET /projects/new
def new
end

def load_file_attachments
@file_attachments = @project.file_attachments
# POST /projects
def create
if @project.save
flash[:notice] = t(:project_created_successfully)
redirect_to @project
else
flash.now[:error] = t(:project_created_unsuccessfully)
render :action => 'new'
end
end

public

# GET /projects/:id
def show
@tickets = Ticket.for_project(@project).sort_by_name
end

def new
end

# GET /projects/:id/edit
def edit
end

# PUT /projects/:id
def update
if @project.update_attributes(params[:project])
flash[:notice] = t(:project_updated_successfully)
Expand All @@ -44,14 +44,19 @@ def update
end
end

def create
if @project.save
flash[:notice] = t(:project_created_successfully)
redirect_to @project
else
flash.now[:error] = t(:project_created_unsuccessfully)
render :action => 'new'
private

def load_new_project
@project = Project.new(params[:project])
@project.client = Client.find(params[:client])
end

def load_project
@project = Project.find(params[:id])
end

def load_file_attachments
@file_attachments = @project.file_attachments
end
end

end
31 changes: 23 additions & 8 deletions app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
class UsersController < ApplicationController
before_filter :load_user, :only => [:show, :edit, :change_password, :historical_time]
before_filter :require_current_user, :only => [:edit, :change_password]
before_filter :load_user, :only => [:show, :edit, :change_password, :historical_time, :update]

access_control do
allow :admin
allow :developer, :to => [:edit, :change_password], :if => :user_is_current_user?
allow :developer, :to => [:index, :show, :historical_time]
allow :client, :to => [:edit, :change_password], :if => :user_is_current_user?
allow :client, :to => [:index, :show, :historical_time]
end

def index
@users = User.unlocked.sort_by_name
Expand Down Expand Up @@ -28,16 +35,24 @@ def change_password
def historical_time
end

protected
def update
if @user.update_attributes(params[:user])
flash[:notice] = t(:user_updated_successfully)
redirect_to @user
else
flash.now[:error] = t(:user_updated_unsuccessfully)
render :action => 'edit'
end
end

private

def load_user
@user = User.find(params[:id])
end

def require_current_user
unless @user == current_user
flash[:error] = t(:cannot_make_changes_to_another_user)
redirect_to dashboard_path
end
def user_is_current_user?
@user == current_user
end

end
Loading

0 comments on commit 1204552

Please sign in to comment.