rapidfire 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +124 -0
  4. data/Rakefile +36 -0
  5. data/app/assets/javascripts/rapidfire/application.js +12 -0
  6. data/app/assets/stylesheets/rapidfire/application.css +22 -0
  7. data/app/controllers/rapidfire/answer_groups_controller.rb +25 -0
  8. data/app/controllers/rapidfire/application_controller.rb +11 -0
  9. data/app/controllers/rapidfire/question_groups_controller.rb +30 -0
  10. data/app/controllers/rapidfire/questions_controller.rb +58 -0
  11. data/app/helpers/rapidfire/application_helper.rb +12 -0
  12. data/app/models/rapidfire/answer.rb +16 -0
  13. data/app/models/rapidfire/answer_group.rb +9 -0
  14. data/app/models/rapidfire/answer_group_builder.rb +53 -0
  15. data/app/models/rapidfire/question.rb +40 -0
  16. data/app/models/rapidfire/question_group.rb +8 -0
  17. data/app/models/rapidfire/question_proxy.rb +92 -0
  18. data/app/models/rapidfire/questions/checkbox.rb +21 -0
  19. data/app/models/rapidfire/questions/date.rb +16 -0
  20. data/app/models/rapidfire/questions/long.rb +6 -0
  21. data/app/models/rapidfire/questions/numeric.rb +21 -0
  22. data/app/models/rapidfire/questions/radio.rb +6 -0
  23. data/app/models/rapidfire/questions/select.rb +19 -0
  24. data/app/models/rapidfire/questions/short.rb +6 -0
  25. data/app/views/rapidfire/answer_groups/new.html.erb +11 -0
  26. data/app/views/rapidfire/answers/_checkbox.html.erb +11 -0
  27. data/app/views/rapidfire/answers/_date.html.erb +4 -0
  28. data/app/views/rapidfire/answers/_errors.html.erb +7 -0
  29. data/app/views/rapidfire/answers/_long.html.erb +4 -0
  30. data/app/views/rapidfire/answers/_numeric.html.erb +4 -0
  31. data/app/views/rapidfire/answers/_radio.html.erb +9 -0
  32. data/app/views/rapidfire/answers/_select.html.erb +4 -0
  33. data/app/views/rapidfire/answers/_short.html.erb +4 -0
  34. data/app/views/rapidfire/question_groups/_form.html.erb +15 -0
  35. data/app/views/rapidfire/question_groups/_question_group.html.erb +17 -0
  36. data/app/views/rapidfire/question_groups/index.html.erb +23 -0
  37. data/app/views/rapidfire/question_groups/new.html.erb +1 -0
  38. data/app/views/rapidfire/questions/_form.html.erb +40 -0
  39. data/app/views/rapidfire/questions/_question.html.erb +9 -0
  40. data/app/views/rapidfire/questions/edit.html.erb +1 -0
  41. data/app/views/rapidfire/questions/index.html.erb +21 -0
  42. data/app/views/rapidfire/questions/new.html.erb +1 -0
  43. data/config/database.yml +8 -0
  44. data/config/routes.rb +8 -0
  45. data/db/migrate/20130502170733_create_rapidfire_question_groups.rb +8 -0
  46. data/db/migrate/20130502195310_create_rapidfire_questions.rb +15 -0
  47. data/db/migrate/20130502195415_create_rapidfire_answer_groups.rb +12 -0
  48. data/db/migrate/20130502195504_create_rapidfire_answers.rb +13 -0
  49. data/lib/generators/rapidfire/views_generator.rb +23 -0
  50. data/lib/rapidfire.rb +6 -0
  51. data/lib/rapidfire/engine.rb +5 -0
  52. data/lib/rapidfire/version.rb +3 -0
  53. data/lib/tasks/rapidfire_tasks.rake +4 -0
  54. metadata +241 -0
@@ -0,0 +1 @@
1
+ <%= render partial: 'form', locals: {question: @question} %>
@@ -0,0 +1,21 @@
1
+ <h2>
2
+ Questions
3
+ <%= link_to "New Question", new_question_group_question_path(@question_group) %>
4
+ </h2>
5
+ <hr/>
6
+
7
+ <table>
8
+ <colgroup>
9
+ <col>
10
+ <col width="250">
11
+ </colgroup>
12
+ <thead>
13
+ <tr>
14
+ <th>Question</th>
15
+ <th></th>
16
+ </tr>
17
+ </thead>
18
+ <tbody>
19
+ <%= render partial: "question", collection: @questions %>
20
+ </tbody>
21
+ </table>
@@ -0,0 +1 @@
1
+ <%= render partial: 'form', locals: {question: @question} %>
@@ -0,0 +1,8 @@
1
+ # Warning: The database defined as "test" will be erased and
2
+ # re-generated from your development database when you run "rake".
3
+ # Do not set this db to the same as development or production.
4
+ test:
5
+ adapter: sqlite3
6
+ database: db/test.sqlite3
7
+ pool: 5
8
+ timeout: 5000
data/config/routes.rb ADDED
@@ -0,0 +1,8 @@
1
+ Rapidfire::Engine.routes.draw do
2
+ resources :question_groups do
3
+ resources :questions
4
+ resources :answer_groups, only: [:new, :create]
5
+ end
6
+
7
+ root :to => "question_groups#index"
8
+ end
@@ -0,0 +1,8 @@
1
+ class CreateRapidfireQuestionGroups < ActiveRecord::Migration
2
+ def change
3
+ create_table :rapidfire_question_groups do |t|
4
+ t.string :name
5
+ t.timestamps
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,15 @@
1
+ class CreateRapidfireQuestions < ActiveRecord::Migration
2
+ def change
3
+ create_table :rapidfire_questions do |t|
4
+ t.references :question_group
5
+ t.string :type
6
+ t.string :question_text
7
+ t.integer :position
8
+ t.text :answer_options
9
+ t.text :validation_rules
10
+
11
+ t.timestamps
12
+ end
13
+ add_index :rapidfire_questions, :question_group_id
14
+ end
15
+ end
@@ -0,0 +1,12 @@
1
+ class CreateRapidfireAnswerGroups < ActiveRecord::Migration
2
+ def change
3
+ create_table :rapidfire_answer_groups do |t|
4
+ t.references :question_group
5
+ t.references :user, polymorphic: true
6
+
7
+ t.timestamps
8
+ end
9
+ add_index :rapidfire_answer_groups, :question_group_id
10
+ add_index :rapidfire_answer_groups, [:user_id, :user_type]
11
+ end
12
+ end
@@ -0,0 +1,13 @@
1
+ class CreateRapidfireAnswers < ActiveRecord::Migration
2
+ def change
3
+ create_table :rapidfire_answers do |t|
4
+ t.references :answer_group
5
+ t.references :question
6
+ t.text :answer_text
7
+
8
+ t.timestamps
9
+ end
10
+ add_index :rapidfire_answers, :answer_group_id
11
+ add_index :rapidfire_answers, :question_id
12
+ end
13
+ end
@@ -0,0 +1,23 @@
1
+ # inspired by devise and forem
2
+ require 'rails/generators'
3
+
4
+ module Rapidfire
5
+ module Generators
6
+ class ViewsGenerator < Rails::Generators::Base
7
+ source_root File.expand_path("../../../../app/views/rapidfire", __FILE__)
8
+ desc "Copies default Rapidfire views to your application."
9
+
10
+ def copy_views
11
+ view_directory :answer_groups
12
+ view_directory :answers
13
+ view_directory :question_groups
14
+ view_directory :questions
15
+ end
16
+
17
+ protected
18
+ def view_directory(name)
19
+ directory name.to_s, "app/views/rapidfire/#{name}"
20
+ end
21
+ end
22
+ end
23
+ end
data/lib/rapidfire.rb ADDED
@@ -0,0 +1,6 @@
1
+ require "rapidfire/engine"
2
+
3
+ module Rapidfire
4
+ class AccessDenied < StandardError
5
+ end
6
+ end
@@ -0,0 +1,5 @@
1
+ module Rapidfire
2
+ class Engine < ::Rails::Engine
3
+ isolate_namespace Rapidfire
4
+ end
5
+ end
@@ -0,0 +1,3 @@
1
+ module Rapidfire
2
+ VERSION = "1.0.0"
3
+ end
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :rapidfire do
3
+ # # Task goes here
4
+ # end
metadata ADDED
@@ -0,0 +1,241 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rapidfire
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Yuva Kumar
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-07-08 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '3.0'
20
+ - - <
21
+ - !ruby/object:Gem::Version
22
+ version: 4.0.0
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '3.0'
30
+ - - <
31
+ - !ruby/object:Gem::Version
32
+ version: 4.0.0
33
+ - !ruby/object:Gem::Dependency
34
+ name: sqlite3
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - '>='
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ type: :development
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - '>='
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ - !ruby/object:Gem::Dependency
48
+ name: quiet_assets
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - '>='
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ - !ruby/object:Gem::Dependency
62
+ name: rspec-rails
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - '>='
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
68
+ type: :development
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - '>='
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ - !ruby/object:Gem::Dependency
76
+ name: shoulda
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - '>='
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ type: :development
83
+ prerelease: false
84
+ version_requirements: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - '>='
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ - !ruby/object:Gem::Dependency
90
+ name: database_cleaner
91
+ requirement: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - '>='
94
+ - !ruby/object:Gem::Version
95
+ version: '0'
96
+ type: :development
97
+ prerelease: false
98
+ version_requirements: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - '>='
101
+ - !ruby/object:Gem::Version
102
+ version: '0'
103
+ - !ruby/object:Gem::Dependency
104
+ name: factory_girl_rails
105
+ requirement: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ type: :development
111
+ prerelease: false
112
+ version_requirements: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - '>='
115
+ - !ruby/object:Gem::Version
116
+ version: '0'
117
+ - !ruby/object:Gem::Dependency
118
+ name: capybara
119
+ requirement: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - '='
122
+ - !ruby/object:Gem::Version
123
+ version: 2.0.3
124
+ type: :development
125
+ prerelease: false
126
+ version_requirements: !ruby/object:Gem::Requirement
127
+ requirements:
128
+ - - '='
129
+ - !ruby/object:Gem::Version
130
+ version: 2.0.3
131
+ - !ruby/object:Gem::Dependency
132
+ name: capybara-webkit
133
+ requirement: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - '>='
136
+ - !ruby/object:Gem::Version
137
+ version: '0'
138
+ type: :development
139
+ prerelease: false
140
+ version_requirements: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - '>='
143
+ - !ruby/object:Gem::Version
144
+ version: '0'
145
+ - !ruby/object:Gem::Dependency
146
+ name: launchy
147
+ requirement: !ruby/object:Gem::Requirement
148
+ requirements:
149
+ - - '>='
150
+ - !ruby/object:Gem::Version
151
+ version: '0'
152
+ type: :development
153
+ prerelease: false
154
+ version_requirements: !ruby/object:Gem::Requirement
155
+ requirements:
156
+ - - '>='
157
+ - !ruby/object:Gem::Version
158
+ version: '0'
159
+ description: One stop solution for all survey related requirements! Its tad easy!.
160
+ email:
161
+ - yuva@codemancers.com
162
+ executables: []
163
+ extensions: []
164
+ extra_rdoc_files: []
165
+ files:
166
+ - app/assets/javascripts/rapidfire/application.js
167
+ - app/assets/stylesheets/rapidfire/application.css
168
+ - app/controllers/rapidfire/answer_groups_controller.rb
169
+ - app/controllers/rapidfire/application_controller.rb
170
+ - app/controllers/rapidfire/question_groups_controller.rb
171
+ - app/controllers/rapidfire/questions_controller.rb
172
+ - app/helpers/rapidfire/application_helper.rb
173
+ - app/models/rapidfire/answer.rb
174
+ - app/models/rapidfire/answer_group.rb
175
+ - app/models/rapidfire/answer_group_builder.rb
176
+ - app/models/rapidfire/question.rb
177
+ - app/models/rapidfire/question_group.rb
178
+ - app/models/rapidfire/question_proxy.rb
179
+ - app/models/rapidfire/questions/checkbox.rb
180
+ - app/models/rapidfire/questions/date.rb
181
+ - app/models/rapidfire/questions/long.rb
182
+ - app/models/rapidfire/questions/numeric.rb
183
+ - app/models/rapidfire/questions/radio.rb
184
+ - app/models/rapidfire/questions/select.rb
185
+ - app/models/rapidfire/questions/short.rb
186
+ - app/views/rapidfire/answer_groups/new.html.erb
187
+ - app/views/rapidfire/answers/_checkbox.html.erb
188
+ - app/views/rapidfire/answers/_date.html.erb
189
+ - app/views/rapidfire/answers/_errors.html.erb
190
+ - app/views/rapidfire/answers/_long.html.erb
191
+ - app/views/rapidfire/answers/_numeric.html.erb
192
+ - app/views/rapidfire/answers/_radio.html.erb
193
+ - app/views/rapidfire/answers/_select.html.erb
194
+ - app/views/rapidfire/answers/_short.html.erb
195
+ - app/views/rapidfire/question_groups/_form.html.erb
196
+ - app/views/rapidfire/question_groups/_question_group.html.erb
197
+ - app/views/rapidfire/question_groups/index.html.erb
198
+ - app/views/rapidfire/question_groups/new.html.erb
199
+ - app/views/rapidfire/questions/_form.html.erb
200
+ - app/views/rapidfire/questions/_question.html.erb
201
+ - app/views/rapidfire/questions/edit.html.erb
202
+ - app/views/rapidfire/questions/index.html.erb
203
+ - app/views/rapidfire/questions/new.html.erb
204
+ - config/database.yml
205
+ - config/routes.rb
206
+ - db/migrate/20130502170733_create_rapidfire_question_groups.rb
207
+ - db/migrate/20130502195310_create_rapidfire_questions.rb
208
+ - db/migrate/20130502195415_create_rapidfire_answer_groups.rb
209
+ - db/migrate/20130502195504_create_rapidfire_answers.rb
210
+ - lib/generators/rapidfire/views_generator.rb
211
+ - lib/rapidfire/engine.rb
212
+ - lib/rapidfire/version.rb
213
+ - lib/rapidfire.rb
214
+ - lib/tasks/rapidfire_tasks.rake
215
+ - MIT-LICENSE
216
+ - Rakefile
217
+ - README.md
218
+ homepage: https://github.com/code-mancers/rapidfire
219
+ licenses: []
220
+ metadata: {}
221
+ post_install_message:
222
+ rdoc_options: []
223
+ require_paths:
224
+ - lib
225
+ required_ruby_version: !ruby/object:Gem::Requirement
226
+ requirements:
227
+ - - '>='
228
+ - !ruby/object:Gem::Version
229
+ version: '0'
230
+ required_rubygems_version: !ruby/object:Gem::Requirement
231
+ requirements:
232
+ - - '>='
233
+ - !ruby/object:Gem::Version
234
+ version: '0'
235
+ requirements: []
236
+ rubyforge_project:
237
+ rubygems_version: 2.0.3
238
+ signing_key:
239
+ specification_version: 4
240
+ summary: Surveys made easy.
241
+ test_files: []