cfp 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/README.md +14 -0
  3. data/Rakefile +35 -0
  4. data/app/assets/javascripts/cfp/application.js +18 -0
  5. data/app/assets/javascripts/cfp/backbone/models/rank.js.coffee +3 -0
  6. data/app/assets/javascripts/cfp/backbone/views/ranking_view.js.coffee +13 -0
  7. data/app/assets/stylesheets/cfp/application.css +13 -0
  8. data/app/assets/stylesheets/cfp/errors.css.scss +16 -0
  9. data/app/controllers/cfp/application_controller.rb +4 -0
  10. data/app/controllers/cfp/comments_controller.rb +34 -0
  11. data/app/controllers/cfp/proposals_controller.rb +50 -0
  12. data/app/controllers/cfp/ranks_controller.rb +34 -0
  13. data/app/helpers/cfp/application_helper.rb +4 -0
  14. data/app/models/cfp/comment.rb +13 -0
  15. data/app/models/cfp/proposal.rb +32 -0
  16. data/app/models/cfp/rank.rb +5 -0
  17. data/app/views/cfp/application/_alerts.html.haml +2 -0
  18. data/app/views/cfp/application/_navbar.html.haml +3 -0
  19. data/app/views/cfp/comments/_comment.html.haml +3 -0
  20. data/app/views/cfp/comments/_form.html.haml +2 -0
  21. data/app/views/cfp/comments/index.html.haml +30 -0
  22. data/app/views/cfp/comments/new.html.haml +9 -0
  23. data/app/views/cfp/proposals/_form.html.haml +8 -0
  24. data/app/views/cfp/proposals/_proposal.html.haml +15 -0
  25. data/app/views/cfp/proposals/edit.html.haml +9 -0
  26. data/app/views/cfp/proposals/index.html.haml +6 -0
  27. data/app/views/cfp/proposals/new.html.haml +9 -0
  28. data/app/views/layouts/cfp/application.html.haml +20 -0
  29. data/config/cucumber.yml +8 -0
  30. data/config/locales/en.yml +24 -0
  31. data/config/routes.rb +8 -0
  32. data/db/migrate/20121118223940_create_cfp_proposals.rb +14 -0
  33. data/db/migrate/20121119010335_add_cfp_columns_to_user.rb +7 -0
  34. data/db/migrate/20121119032241_create_cfp_comments.rb +11 -0
  35. data/db/migrate/20121120192955_create_cfp_ranks.rb +11 -0
  36. data/lib/cfp.rb +7 -0
  37. data/lib/cfp/engine.rb +5 -0
  38. data/lib/cfp/user.rb +26 -0
  39. data/lib/cfp/version.rb +3 -0
  40. data/lib/tasks/cfp_tasks.rake +4 -0
  41. data/lib/tasks/cucumber.rake +65 -0
  42. metadata +316 -0
@@ -0,0 +1,20 @@
1
+ Copyright 2012 YOURNAME
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,14 @@
1
+ # Cfp: Call for papers
2
+
3
+ Call For Papers Rails Engine that we use to organize [MagmaRails](http://www.magmarails.com).
4
+
5
+ # About the author
6
+
7
+ [Crowd Interactive](http://www.crowdint.com) is a leading Ruby and Rails
8
+ consultancy firm based in Mexico currently doing business with startups in
9
+ the United States. We specialize in building and growing your existing
10
+ development team, by adding engineers onsite or offsite. We pick our clients
11
+ carefully, as we only work with companies we believe in. Find out more about
12
+ us on our [website](http://www.crowdint.com).
13
+
14
+
@@ -0,0 +1,35 @@
1
+ #!/usr/bin/env rake
2
+ begin
3
+ require 'bundler/setup'
4
+ rescue LoadError
5
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
6
+ end
7
+ begin
8
+ require 'rdoc/task'
9
+ rescue LoadError
10
+ require 'rdoc/rdoc'
11
+ require 'rake/rdoctask'
12
+ RDoc::Task = Rake::RDocTask
13
+ end
14
+
15
+ require 'rspec/core/rake_task'
16
+ RSpec::Core::RakeTask.new(:spec)
17
+
18
+ RDoc::Task.new(:rdoc) do |rdoc|
19
+ rdoc.rdoc_dir = 'rdoc'
20
+ rdoc.title = 'Cfp'
21
+ rdoc.options << '--line-numbers'
22
+ rdoc.rdoc_files.include('README.rdoc')
23
+ rdoc.rdoc_files.include('lib/**/*.rb')
24
+ end
25
+
26
+ APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
27
+ load 'rails/tasks/engine.rake'
28
+
29
+ task :cucumber => "app:cucumber"
30
+ task :default => [:spec, :cucumber]
31
+ task 'db:test:prepare' => 'app:db:test:prepare'
32
+
33
+
34
+ Bundler::GemHelper.install_tasks
35
+
@@ -0,0 +1,18 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // the compiled file.
9
+ //
10
+ // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
11
+ // GO AFTER THE REQUIRES BELOW.
12
+ //
13
+ //= require_self
14
+ //= require_tree ./backbone
15
+
16
+ window.Cfp = {};
17
+ window.Cfp.Models = {};
18
+ window.Cfp.Views = {};
@@ -0,0 +1,3 @@
1
+ class Cfp.Models.Rank extends Backbone.Model
2
+ url: ->
3
+ 'ranks'
@@ -0,0 +1,13 @@
1
+ class Cfp.Views.RankingView extends Backbone.View
2
+ el: '#ranking'
3
+
4
+ events:
5
+ 'change #rank' : 'changeRank'
6
+
7
+ changeRank: ->
8
+ rank = new Cfp.Models.Rank
9
+ rank.save
10
+ value: @selectedRank()
11
+
12
+ selectedRank: =>
13
+ @$('#rank').val()
@@ -0,0 +1,13 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the top of the
9
+ * compiled file, but it's generally better to create a new file per style scope.
10
+ *
11
+ *= require_self
12
+ *= require_tree .
13
+ */
@@ -0,0 +1,16 @@
1
+ $error-color: #B94A48;
2
+
3
+ .field_with_errors {
4
+ label {
5
+ color: $error-color;
6
+ }
7
+
8
+ input, textarea {
9
+ border-color: $error-color;
10
+ color: $error-color;
11
+ }
12
+ }
13
+
14
+ .translation_missing {
15
+ background-color: red;
16
+ }
@@ -0,0 +1,4 @@
1
+ module Cfp
2
+ class ApplicationController < ActionController::Base
3
+ end
4
+ end
@@ -0,0 +1,34 @@
1
+ require_dependency "cfp/application_controller"
2
+
3
+ module Cfp
4
+ class CommentsController < ApplicationController
5
+ before_filter :check_for_reviewer
6
+ before_filter :load_proposal
7
+
8
+ def index
9
+ @comments = @proposal.comments
10
+ end
11
+
12
+ def new
13
+ @comment = Comment.new
14
+ end
15
+
16
+ def create
17
+ @comment = @proposal.comments.build(params[:comment])
18
+ @comment.user = current_user
19
+ if @comment.save
20
+ redirect_to proposal_comments_path(@proposal)
21
+ else
22
+ render :action => :new
23
+ end
24
+ end
25
+
26
+ def check_for_reviewer
27
+ redirect_to :proposals unless current_user.can_review?
28
+ end
29
+
30
+ def load_proposal
31
+ @proposal = Proposal.find(params[:proposal_id])
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,50 @@
1
+ require_dependency "cfp/application_controller"
2
+
3
+ module Cfp
4
+ class ProposalsController < ApplicationController
5
+ before_filter :load_proposal, :only => [:edit, :update, :destroy]
6
+
7
+ def index
8
+ @proposals = Proposal.scoped_for(current_user)
9
+ end
10
+
11
+ def new
12
+ @proposal = Proposal.new
13
+ end
14
+
15
+ def create
16
+ @proposal = Proposal.new proposal_params[:proposal]
17
+ @proposal.user = current_user
18
+ if @proposal.save
19
+ redirect_to :proposals, :notice => t('proposals.created.success')
20
+ else
21
+ render :action => :new
22
+ end
23
+ end
24
+
25
+ def edit
26
+ end
27
+
28
+ def update
29
+ if @proposal.can_be_edited_by?(current_user) && @proposal.update_attributes(proposal_params[:proposal])
30
+ redirect_to :proposals, :notice => t('proposals.edited.success')
31
+ else
32
+ render :action => "edit"
33
+ end
34
+ end
35
+
36
+ def destroy
37
+ @proposal.destroy if @proposal.can_be_edited_by?(current_user)
38
+ redirect_to :proposals, :notice => t('proposals.deleted.success')
39
+ end
40
+
41
+ private
42
+ def load_proposal
43
+ @proposal = Proposal.find(params[:id])
44
+ end
45
+
46
+ def proposal_params
47
+ params
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,34 @@
1
+ require_dependency "cfp/application_controller"
2
+
3
+ module Cfp
4
+ class RanksController < ApplicationController
5
+ respond_to :json
6
+ before_filter :check_for_reviewer, :load_proposal
7
+
8
+ def create
9
+ @rank = find_or_create_rank
10
+ @rank.value = params[:value]
11
+ @rank.save!
12
+
13
+ render :json => @rank
14
+ end
15
+
16
+ private
17
+ def find_or_create_rank
18
+ rank = @proposal.ranks.where(:user_id => current_user.id).first
19
+ unless rank
20
+ rank = @proposal.ranks.build
21
+ rank.user = current_user
22
+ end
23
+ rank
24
+ end
25
+
26
+ def check_for_reviewer
27
+ redirect_to :proposals unless current_user.can_review?
28
+ end
29
+
30
+ def load_proposal
31
+ @proposal = Proposal.find(params[:proposal_id])
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,4 @@
1
+ module Cfp
2
+ module ApplicationHelper
3
+ end
4
+ end
@@ -0,0 +1,13 @@
1
+ module Cfp
2
+ class Comment < ActiveRecord::Base
3
+ attr_accessible :body
4
+
5
+ validates :body, :presence => true
6
+
7
+ belongs_to :proposal
8
+ belongs_to :user, :class_name => "::User"
9
+
10
+ delegate :email, :to => :user
11
+
12
+ end
13
+ end
@@ -0,0 +1,32 @@
1
+ module Cfp
2
+ class Proposal < ActiveRecord::Base
3
+ RANK_SCALE = (0..2).to_a
4
+ attr_accessible :title, :abstract, :tags, :level
5
+
6
+ belongs_to :user, :class_name => "::User"
7
+ has_many :comments
8
+ has_many :ranks
9
+
10
+ validates :title, :presence => true
11
+ validates :abstract, :presence => true
12
+
13
+ delegate :email, :to => :user, :prefix => true
14
+
15
+ def self.scoped_for(user)
16
+ case
17
+ when user.can_review?
18
+ scoped
19
+ else
20
+ user.proposals
21
+ end
22
+ end
23
+
24
+ def can_be_edited_by?(user)
25
+ (self.user == user) || (user.is_admin?)
26
+ end
27
+
28
+ def average_ranking
29
+ ranks.average(:value)
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,5 @@
1
+ module Cfp
2
+ class Rank < ActiveRecord::Base
3
+ belongs_to :user
4
+ end
5
+ end
@@ -0,0 +1,2 @@
1
+ - if flash[:notice]
2
+ .alert= flash[:notice]
@@ -0,0 +1,3 @@
1
+ .navbar
2
+ .navbar-inner
3
+ .brand CFP
@@ -0,0 +1,3 @@
1
+ = content_tag_for :tr, comment do
2
+ %td= comment.body
3
+ %td= comment.email
@@ -0,0 +1,2 @@
1
+ = form.label :body, 'Comment'
2
+ = form.text_area :body, :class => "input-block-level"
@@ -0,0 +1,30 @@
1
+ .row
2
+ .span6
3
+ %h1= @proposal.title
4
+ .speaker
5
+ = @proposal.user_email
6
+ .abstract
7
+ = @proposal.abstract
8
+ .level
9
+ = @proposal.level
10
+ .tags
11
+ = @proposal.tags
12
+
13
+ #ranking.span6
14
+ = label_tag :rank, "Rank"
15
+ = select_tag "rank", options_for_select(Cfp::Proposal::RANK_SCALE)
16
+
17
+ .row
18
+ .span6
19
+ = link_to t('actions.comment'), new_proposal_comment_path(@proposal), :class => 'btn btn-primary'
20
+ .span6
21
+ = link_to t('actions.back_to_proposals'), proposals_path
22
+
23
+ %table.table.table-striped
24
+ = render @comments
25
+
26
+ - content_for :scripts do
27
+ :javascript
28
+ $(document).ready(function () {
29
+ window.app = new Cfp.Views.RankingView();
30
+ });
@@ -0,0 +1,9 @@
1
+ %h1 #{t('comments.new_for')} #{@proposal.title}
2
+
3
+ .row
4
+ .span5
5
+ = form_for [:proposal, @comment] do |form|
6
+ = render 'form', :form => form
7
+
8
+ .form-actions
9
+ = form.submit :class => "btn btn-primary"
@@ -0,0 +1,8 @@
1
+ = form.label :title
2
+ = form.text_field :title, :class => "input-block-level title"
3
+ = form.label :level
4
+ = form.text_field :level, :class => "input-block-level"
5
+ = form.label :abstract
6
+ = form.text_area :abstract, :class => "input-block-level"
7
+ = form.label :tags
8
+ = form.text_field :tags, :class => "input-block-level"
@@ -0,0 +1,15 @@
1
+ = content_tag_for :tr, proposal, :class => "row" do
2
+ %td= proposal.title
3
+ - if proposal.can_be_edited_by?(current_user)
4
+ %td= link_to t('actions.edit'), edit_proposal_path(proposal)
5
+ %td= link_to t('actions.delete'), proposal_path(proposal), :method => :delete, :confirm => t('actions.sure')
6
+ - else
7
+ %td
8
+ Edit
9
+ %td
10
+ Delete
11
+ - if current_user.can_review?
12
+ %td
13
+ = proposal.average_ranking
14
+ %td
15
+ = link_to t('actions.discuss'), proposal_comments_path(proposal)
@@ -0,0 +1,9 @@
1
+ %h1= t('proposals.edit')
2
+
3
+ .row
4
+ .span5.offset1
5
+ = form_for @proposal do |form|
6
+ %fieldset
7
+ = render 'form', :form => form
8
+
9
+ .form-actions= form.submit :class => 'btn btn-primary'
@@ -0,0 +1,6 @@
1
+ %h1 Proposals
2
+
3
+ = link_to t('proposals.submit'), new_proposal_path, :class => "btn btn-primary"
4
+
5
+ %table.table.table-striped
6
+ = render @proposals
@@ -0,0 +1,9 @@
1
+ %h1= t('proposals.submit')
2
+
3
+ .row
4
+ .span5.offset1
5
+ = form_for @proposal do |form|
6
+ %fieldset
7
+ = render 'form', :form => form
8
+
9
+ .form-actions= form.submit :class => 'btn btn-primary'
@@ -0,0 +1,20 @@
1
+ !!!
2
+ %html
3
+ %head
4
+ %title Cfp
5
+ = stylesheet_link_tag "//netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-combined.min.css"
6
+ = javascript_include_tag "//cdnjs.cloudflare.com/ajax/libs/jquery/1.8.3/jquery.min.js"
7
+ = javascript_include_tag "//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.4.2/underscore-min.js"
8
+ = javascript_include_tag "//cdnjs.cloudflare.com/ajax/libs/backbone.js/0.9.2/backbone-min.js"
9
+
10
+ = stylesheet_link_tag "cfp/application", :media => "all"
11
+ = javascript_include_tag "cfp/application"
12
+ = csrf_meta_tags
13
+
14
+ = yield :scripts
15
+
16
+ %body
17
+ .container
18
+ = render 'navbar'
19
+ = render 'alerts'
20
+ = yield
@@ -0,0 +1,8 @@
1
+ <%
2
+ rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
3
+ rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
4
+ std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} --strict --tags ~@wip"
5
+ %>
6
+ default: <%= std_opts %> features
7
+ wip: --tags @wip:3 --wip features
8
+ rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip
@@ -0,0 +1,24 @@
1
+ en:
2
+ actions:
3
+ edit: "Edit"
4
+ delete: "Delete"
5
+ sure: "Are you sure?"
6
+ discuss: "Discuss"
7
+ comment: "Comment"
8
+ back_to_proposals: "Back to Proposals"
9
+
10
+ proposals:
11
+ submit: "Submit Proposal"
12
+ edit: "Edit Proposal"
13
+ edited:
14
+ success: "The Proposal was edited succesfully"
15
+ created:
16
+ success: "The Proposal was created succesfully"
17
+ deleted:
18
+ success: "The Proposal was deleted succesfully"
19
+
20
+ create:
21
+ success: "Proposal created successfuly"
22
+
23
+ comments:
24
+ new_for: "New Comment for"
@@ -0,0 +1,8 @@
1
+ Cfp::Engine.routes.draw do
2
+ root :to => "proposals#index"
3
+
4
+ resources :proposals, :except => [:show] do
5
+ resources :comments
6
+ resources :ranks, :only => [ :create ]
7
+ end
8
+ end
@@ -0,0 +1,14 @@
1
+ class CreateCfpProposals < ActiveRecord::Migration
2
+ def change
3
+ create_table :cfp_proposals do |t|
4
+ t.integer :user_id
5
+ t.string :title
6
+ t.string :level
7
+ t.text :abstract
8
+ t.string :tags
9
+
10
+
11
+ t.timestamps
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,7 @@
1
+ class AddCfpColumnsToUser < ActiveRecord::Migration
2
+ def change
3
+ change_table :users do |t|
4
+ t.text :roles
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,11 @@
1
+ class CreateCfpComments < ActiveRecord::Migration
2
+ def change
3
+ create_table :cfp_comments do |t|
4
+ t.integer :user_id
5
+ t.integer :proposal_id
6
+ t.text :body
7
+
8
+ t.timestamps
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ class CreateCfpRanks < ActiveRecord::Migration
2
+ def change
3
+ create_table :cfp_ranks do |t|
4
+ t.integer :user_id
5
+ t.integer :proposal_id
6
+ t.integer :value
7
+
8
+ t.timestamps
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,7 @@
1
+ require "cfp/engine"
2
+
3
+ require "haml-rails"
4
+
5
+ module Cfp
6
+ autoload :User, 'cfp/user'
7
+ end
@@ -0,0 +1,5 @@
1
+ module Cfp
2
+ class Engine < ::Rails::Engine
3
+ isolate_namespace Cfp
4
+ end
5
+ end
@@ -0,0 +1,26 @@
1
+ module Cfp
2
+ module User
3
+ def self.included(base)
4
+ base.send(:before_validation, :setup_roles)
5
+ base.send(:has_many, :proposals, :class_name => "Cfp::Proposal")
6
+ base.send(:serialize, :roles)
7
+ base.send(:extend, ClassMethods)
8
+ end
9
+
10
+ def setup_roles
11
+ self.roles ||= []
12
+ end
13
+
14
+ def can_review?
15
+ roles.include?(:reviewer)
16
+ end
17
+
18
+ def is_admin?
19
+ roles.include?(:admin)
20
+ end
21
+
22
+ module ClassMethods
23
+
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,3 @@
1
+ module Cfp
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :cfp do
3
+ # # Task goes here
4
+ # end
@@ -0,0 +1,65 @@
1
+ # IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.
2
+ # It is recommended to regenerate this file in the future when you upgrade to a
3
+ # newer version of cucumber-rails. Consider adding your own code to a new file
4
+ # instead of editing this one. Cucumber will automatically load all features/**/*.rb
5
+ # files.
6
+
7
+
8
+ unless ARGV.any? {|a| a =~ /^gems/} # Don't load anything when running the gems:* tasks
9
+
10
+ vendored_cucumber_bin = Dir["#{Rails.root}/vendor/{gems,plugins}/cucumber*/bin/cucumber"].first
11
+ $LOAD_PATH.unshift(File.dirname(vendored_cucumber_bin) + '/../lib') unless vendored_cucumber_bin.nil?
12
+
13
+ begin
14
+ require 'cucumber/rake/task'
15
+
16
+ namespace :cucumber do
17
+ Cucumber::Rake::Task.new({:ok => 'db:test:prepare'}, 'Run features that should pass') do |t|
18
+ t.binary = vendored_cucumber_bin # If nil, the gem's binary is used.
19
+ t.fork = true # You may get faster startup if you set this to false
20
+ t.profile = 'default'
21
+ end
22
+
23
+ Cucumber::Rake::Task.new({:wip => 'db:test:prepare'}, 'Run features that are being worked on') do |t|
24
+ t.binary = vendored_cucumber_bin
25
+ t.fork = true # You may get faster startup if you set this to false
26
+ t.profile = 'wip'
27
+ end
28
+
29
+ Cucumber::Rake::Task.new({:rerun => 'db:test:prepare'}, 'Record failing features and run only them if any exist') do |t|
30
+ t.binary = vendored_cucumber_bin
31
+ t.fork = true # You may get faster startup if you set this to false
32
+ t.profile = 'rerun'
33
+ end
34
+
35
+ desc 'Run all features'
36
+ task :all => [:ok, :wip]
37
+
38
+ task :statsetup do
39
+ require 'rails/code_statistics'
40
+ ::STATS_DIRECTORIES << %w(Cucumber\ features features) if File.exist?('features')
41
+ ::CodeStatistics::TEST_TYPES << "Cucumber features" if File.exist?('features')
42
+ end
43
+ end
44
+ desc 'Alias for cucumber:ok'
45
+ task :cucumber => 'cucumber:ok'
46
+
47
+ task :default => :cucumber
48
+
49
+ task :features => :cucumber do
50
+ STDERR.puts "*** The 'features' task is deprecated. See rake -T cucumber ***"
51
+ end
52
+
53
+ # In case we don't have ActiveRecord, append a no-op task that we can depend upon.
54
+ task 'db:test:prepare' do
55
+ end
56
+
57
+ task :stats => 'cucumber:statsetup'
58
+ rescue LoadError
59
+ desc 'cucumber rake task not available (cucumber not installed)'
60
+ task :cucumber do
61
+ abort 'Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin'
62
+ end
63
+ end
64
+
65
+ end
metadata ADDED
@@ -0,0 +1,316 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cfp
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - David Padilla
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-11-21 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: coffee-script
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: devise
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ - !ruby/object:Gem::Dependency
47
+ name: haml-rails
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :runtime
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ - !ruby/object:Gem::Dependency
63
+ name: rails
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ~>
68
+ - !ruby/object:Gem::Version
69
+ version: 3.2.9
70
+ type: :runtime
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ~>
76
+ - !ruby/object:Gem::Version
77
+ version: 3.2.9
78
+ - !ruby/object:Gem::Dependency
79
+ name: autotest
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ type: :development
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ - !ruby/object:Gem::Dependency
95
+ name: autotest-growl
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ! '>='
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ type: :development
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ - !ruby/object:Gem::Dependency
111
+ name: capybara
112
+ requirement: !ruby/object:Gem::Requirement
113
+ none: false
114
+ requirements:
115
+ - - ! '>='
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ! '>='
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
126
+ - !ruby/object:Gem::Dependency
127
+ name: cucumber-rails
128
+ requirement: !ruby/object:Gem::Requirement
129
+ none: false
130
+ requirements:
131
+ - - ! '>='
132
+ - !ruby/object:Gem::Version
133
+ version: '0'
134
+ type: :development
135
+ prerelease: false
136
+ version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
138
+ requirements:
139
+ - - ! '>='
140
+ - !ruby/object:Gem::Version
141
+ version: '0'
142
+ - !ruby/object:Gem::Dependency
143
+ name: database_cleaner
144
+ requirement: !ruby/object:Gem::Requirement
145
+ none: false
146
+ requirements:
147
+ - - ! '>='
148
+ - !ruby/object:Gem::Version
149
+ version: '0'
150
+ type: :development
151
+ prerelease: false
152
+ version_requirements: !ruby/object:Gem::Requirement
153
+ none: false
154
+ requirements:
155
+ - - ! '>='
156
+ - !ruby/object:Gem::Version
157
+ version: '0'
158
+ - !ruby/object:Gem::Dependency
159
+ name: faker
160
+ requirement: !ruby/object:Gem::Requirement
161
+ none: false
162
+ requirements:
163
+ - - ! '>='
164
+ - !ruby/object:Gem::Version
165
+ version: '0'
166
+ type: :development
167
+ prerelease: false
168
+ version_requirements: !ruby/object:Gem::Requirement
169
+ none: false
170
+ requirements:
171
+ - - ! '>='
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ - !ruby/object:Gem::Dependency
175
+ name: launchy
176
+ requirement: !ruby/object:Gem::Requirement
177
+ none: false
178
+ requirements:
179
+ - - ! '>='
180
+ - !ruby/object:Gem::Version
181
+ version: '0'
182
+ type: :development
183
+ prerelease: false
184
+ version_requirements: !ruby/object:Gem::Requirement
185
+ none: false
186
+ requirements:
187
+ - - ! '>='
188
+ - !ruby/object:Gem::Version
189
+ version: '0'
190
+ - !ruby/object:Gem::Dependency
191
+ name: rspec-rails
192
+ requirement: !ruby/object:Gem::Requirement
193
+ none: false
194
+ requirements:
195
+ - - ! '>='
196
+ - !ruby/object:Gem::Version
197
+ version: '0'
198
+ type: :development
199
+ prerelease: false
200
+ version_requirements: !ruby/object:Gem::Requirement
201
+ none: false
202
+ requirements:
203
+ - - ! '>='
204
+ - !ruby/object:Gem::Version
205
+ version: '0'
206
+ - !ruby/object:Gem::Dependency
207
+ name: spork
208
+ requirement: !ruby/object:Gem::Requirement
209
+ none: false
210
+ requirements:
211
+ - - ! '>='
212
+ - !ruby/object:Gem::Version
213
+ version: '0'
214
+ type: :development
215
+ prerelease: false
216
+ version_requirements: !ruby/object:Gem::Requirement
217
+ none: false
218
+ requirements:
219
+ - - ! '>='
220
+ - !ruby/object:Gem::Version
221
+ version: '0'
222
+ - !ruby/object:Gem::Dependency
223
+ name: sqlite3
224
+ requirement: !ruby/object:Gem::Requirement
225
+ none: false
226
+ requirements:
227
+ - - ! '>='
228
+ - !ruby/object:Gem::Version
229
+ version: '0'
230
+ type: :development
231
+ prerelease: false
232
+ version_requirements: !ruby/object:Gem::Requirement
233
+ none: false
234
+ requirements:
235
+ - - ! '>='
236
+ - !ruby/object:Gem::Version
237
+ version: '0'
238
+ description: Call for Papers Rails Engine used for the organization of MagmaRails
239
+ email:
240
+ - david@crowdint.com
241
+ executables: []
242
+ extensions: []
243
+ extra_rdoc_files: []
244
+ files:
245
+ - app/assets/javascripts/cfp/application.js
246
+ - app/assets/javascripts/cfp/backbone/models/rank.js.coffee
247
+ - app/assets/javascripts/cfp/backbone/views/ranking_view.js.coffee
248
+ - app/assets/stylesheets/cfp/application.css
249
+ - app/assets/stylesheets/cfp/errors.css.scss
250
+ - app/controllers/cfp/application_controller.rb
251
+ - app/controllers/cfp/comments_controller.rb
252
+ - app/controllers/cfp/proposals_controller.rb
253
+ - app/controllers/cfp/ranks_controller.rb
254
+ - app/helpers/cfp/application_helper.rb
255
+ - app/models/cfp/comment.rb
256
+ - app/models/cfp/proposal.rb
257
+ - app/models/cfp/rank.rb
258
+ - app/views/cfp/application/_alerts.html.haml
259
+ - app/views/cfp/application/_navbar.html.haml
260
+ - app/views/cfp/comments/_comment.html.haml
261
+ - app/views/cfp/comments/_form.html.haml
262
+ - app/views/cfp/comments/index.html.haml
263
+ - app/views/cfp/comments/new.html.haml
264
+ - app/views/cfp/proposals/_form.html.haml
265
+ - app/views/cfp/proposals/_proposal.html.haml
266
+ - app/views/cfp/proposals/edit.html.haml
267
+ - app/views/cfp/proposals/index.html.haml
268
+ - app/views/cfp/proposals/new.html.haml
269
+ - app/views/layouts/cfp/application.html.haml
270
+ - config/cucumber.yml
271
+ - config/locales/en.yml
272
+ - config/routes.rb
273
+ - db/migrate/20121118223940_create_cfp_proposals.rb
274
+ - db/migrate/20121119010335_add_cfp_columns_to_user.rb
275
+ - db/migrate/20121119032241_create_cfp_comments.rb
276
+ - db/migrate/20121120192955_create_cfp_ranks.rb
277
+ - lib/cfp/engine.rb
278
+ - lib/cfp/user.rb
279
+ - lib/cfp/version.rb
280
+ - lib/cfp.rb
281
+ - lib/tasks/cfp_tasks.rake
282
+ - lib/tasks/cucumber.rake
283
+ - MIT-LICENSE
284
+ - Rakefile
285
+ - README.md
286
+ homepage: https://github.com/crowdint/cfp
287
+ licenses: []
288
+ post_install_message:
289
+ rdoc_options: []
290
+ require_paths:
291
+ - lib
292
+ required_ruby_version: !ruby/object:Gem::Requirement
293
+ none: false
294
+ requirements:
295
+ - - ! '>='
296
+ - !ruby/object:Gem::Version
297
+ version: '0'
298
+ segments:
299
+ - 0
300
+ hash: -1231296173352342553
301
+ required_rubygems_version: !ruby/object:Gem::Requirement
302
+ none: false
303
+ requirements:
304
+ - - ! '>='
305
+ - !ruby/object:Gem::Version
306
+ version: '0'
307
+ segments:
308
+ - 0
309
+ hash: -1231296173352342553
310
+ requirements: []
311
+ rubyforge_project:
312
+ rubygems_version: 1.8.23
313
+ signing_key:
314
+ specification_version: 3
315
+ summary: Call for Papers Rails Engine used for the organization of MagmaRails
316
+ test_files: []