Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Initial models and controllers, no tests

  • Loading branch information...
commit 7923be90b5674b3d88dd96948e038d6cb65076e6 1 parent d7faffa
Ryan Daigle rwdaigle authored

Showing 2,986 changed files with 29,264 additions and 0 deletions. Show diff stats Hide diff stats

  1. +6 0 .gitignore
  2. +243 0 README
  3. +10 0 Rakefile
  4. +40 0 app/controllers/api/api_controller.rb
  5. +30 0 app/controllers/api/v1/statements_controller.rb
  6. +6 0 app/controllers/api/v1/v1_controller.rb
  7. +8 0 app/controllers/application_controller.rb
  8. +30 0 app/helpers/application_helper.rb
  9. +16 0 app/models/application.rb
  10. +14 0 app/models/statement.rb
  11. +110 0 config/boot.rb
  12. +46 0 config/environment.rb
  13. +17 0 config/environments/development.rb
  14. +28 0 config/environments/production.rb
  15. +28 0 config/environments/test.rb
  16. +7 0 config/initializers/backtrace_silencers.rb
  17. +3 0  config/initializers/exception_notifications.rb
  18. +10 0 config/initializers/inflections.rb
  19. +5 0 config/initializers/mime_types.rb
  20. +19 0 config/initializers/new_rails_defaults.rb
  21. +15 0 config/initializers/session_store.rb
  22. +1 0  config/initializers/will_paginate.rb
  23. +5 0 config/locales/en.yml
  24. +145 0 config/newrelic.yml
  25. +9 0 config/routes.rb
  26. +27 0 db/migrate/20090401132240_initial_release.rb
  27. +2 0  doc/README_FOR_APP
  28. +4 0 lib/tasks/db.rake
  29. +165 0 lib/tasks/rspec.rake
  30. +30 0 public/404.html
  31. +30 0 public/422.html
  32. +30 0 public/500.html
  33. 0  public/favicon.ico
  34. BIN  public/images/rails.png
  35. +275 0 public/index.html
  36. +2 0  public/javascripts/application.js
  37. +963 0 public/javascripts/controls.js
  38. +973 0 public/javascripts/dragdrop.js
  39. +1,128 0 public/javascripts/effects.js
  40. +4,320 0 public/javascripts/prototype.js
  41. +5 0 public/robots.txt
  42. +4 0 script/about
  43. +6 0 script/autospec
  44. +3 0  script/console
  45. +3 0  script/dbconsole
  46. +3 0  script/destroy
  47. +3 0  script/generate
  48. +3 0  script/performance/benchmarker
  49. +3 0  script/performance/profiler
  50. +3 0  script/plugin
  51. +3 0  script/runner
  52. +3 0  script/server
  53. +10 0 script/spec
  54. +9 0 script/spec_server
  55. +2 0  spec/rcov.opts
  56. +4 0 spec/spec.opts
  57. +47 0 spec/spec_helper.rb
  58. +267 0 vendor/gems/haml-2.1.0/.specification
  59. +138 0 vendor/gems/haml-2.1.0/FAQ
  60. +20 0 vendor/gems/haml-2.1.0/MIT-LICENSE
  61. +325 0 vendor/gems/haml-2.1.0/README.rdoc
  62. +1 0  vendor/gems/haml-2.1.0/REVISION
  63. +150 0 vendor/gems/haml-2.1.0/Rakefile
  64. +1 0  vendor/gems/haml-2.1.0/VERSION
  65. +7 0 vendor/gems/haml-2.1.0/bin/css2sass
  66. +9 0 vendor/gems/haml-2.1.0/bin/haml
  67. +7 0 vendor/gems/haml-2.1.0/bin/html2haml
  68. +8 0 vendor/gems/haml-2.1.0/bin/sass
  69. +434 0 vendor/gems/haml-2.1.0/extra/haml-mode.el
  70. +98 0 vendor/gems/haml-2.1.0/extra/sass-mode.el
  71. +8 0 vendor/gems/haml-2.1.0/init.rb
  72. +1,064 0 vendor/gems/haml-2.1.0/lib/haml.rb
  73. +255 0 vendor/gems/haml-2.1.0/lib/haml/buffer.rb
  74. +268 0 vendor/gems/haml-2.1.0/lib/haml/engine.rb
  75. +22 0 vendor/gems/haml-2.1.0/lib/haml/error.rb
  76. +395 0 vendor/gems/haml-2.1.0/lib/haml/exec.rb
  77. +275 0 vendor/gems/haml-2.1.0/lib/haml/filters.rb
  78. +466 0 vendor/gems/haml-2.1.0/lib/haml/helpers.rb
  79. +45 0 vendor/gems/haml-2.1.0/lib/haml/helpers/action_view_extensions.rb
  80. +181 0 vendor/gems/haml-2.1.0/lib/haml/helpers/action_view_mods.rb
  81. +222 0 vendor/gems/haml-2.1.0/lib/haml/html.rb
  82. +867 0 vendor/gems/haml-2.1.0/lib/haml/precompiler.rb
  83. +45 0 vendor/gems/haml-2.1.0/lib/haml/shared.rb
  84. +51 0 vendor/gems/haml-2.1.0/lib/haml/template.rb
  85. +58 0 vendor/gems/haml-2.1.0/lib/haml/template/patch.rb
  86. +72 0 vendor/gems/haml-2.1.0/lib/haml/template/plugin.rb
  87. +77 0 vendor/gems/haml-2.1.0/lib/haml/util.rb
  88. +973 0 vendor/gems/haml-2.1.0/lib/sass.rb
  89. +388 0 vendor/gems/haml-2.1.0/lib/sass/css.rb
  90. +501 0 vendor/gems/haml-2.1.0/lib/sass/engine.rb
  91. +33 0 vendor/gems/haml-2.1.0/lib/sass/environment.rb
  92. +35 0 vendor/gems/haml-2.1.0/lib/sass/error.rb
  93. +203 0 vendor/gems/haml-2.1.0/lib/sass/plugin.rb
  94. +56 0 vendor/gems/haml-2.1.0/lib/sass/plugin/merb.rb
  95. +24 0 vendor/gems/haml-2.1.0/lib/sass/plugin/rails.rb
  96. +44 0 vendor/gems/haml-2.1.0/lib/sass/repl.rb
  97. +38 0 vendor/gems/haml-2.1.0/lib/sass/script.rb
  98. +13 0 vendor/gems/haml-2.1.0/lib/sass/script/bool.rb
  99. +97 0 vendor/gems/haml-2.1.0/lib/sass/script/color.rb
  100. +28 0 vendor/gems/haml-2.1.0/lib/sass/script/funcall.rb
  101. +100 0 vendor/gems/haml-2.1.0/lib/sass/script/functions.rb
  102. +144 0 vendor/gems/haml-2.1.0/lib/sass/script/lexer.rb
  103. +60 0 vendor/gems/haml-2.1.0/lib/sass/script/literal.rb
  104. +231 0 vendor/gems/haml-2.1.0/lib/sass/script/number.rb
  105. +30 0 vendor/gems/haml-2.1.0/lib/sass/script/operation.rb
  106. +142 0 vendor/gems/haml-2.1.0/lib/sass/script/parser.rb
  107. +42 0 vendor/gems/haml-2.1.0/lib/sass/script/string.rb
  108. +21 0 vendor/gems/haml-2.1.0/lib/sass/script/unary_operation.rb
  109. +20 0 vendor/gems/haml-2.1.0/lib/sass/script/variable.rb
  110. +60 0 vendor/gems/haml-2.1.0/lib/sass/tree/attr_node.rb
  111. +26 0 vendor/gems/haml-2.1.0/lib/sass/tree/comment_node.rb
  112. +22 0 vendor/gems/haml-2.1.0/lib/sass/tree/debug_node.rb
  113. +50 0 vendor/gems/haml-2.1.0/lib/sass/tree/directive_node.rb
  114. +27 0 vendor/gems/haml-2.1.0/lib/sass/tree/file_node.rb
  115. +29 0 vendor/gems/haml-2.1.0/lib/sass/tree/for_node.rb
  116. +27 0 vendor/gems/haml-2.1.0/lib/sass/tree/if_node.rb
  117. +18 0 vendor/gems/haml-2.1.0/lib/sass/tree/mixin_def_node.rb
  118. +34 0 vendor/gems/haml-2.1.0/lib/sass/tree/mixin_node.rb
  119. +93 0 vendor/gems/haml-2.1.0/lib/sass/tree/node.rb
  120. +116 0 vendor/gems/haml-2.1.0/lib/sass/tree/rule_node.rb
  121. +24 0 vendor/gems/haml-2.1.0/lib/sass/tree/variable_node.rb
  122. +20 0 vendor/gems/haml-2.1.0/lib/sass/tree/while_node.rb
  123. +1 0  vendor/gems/haml-2.1.0/rails/init.rb
  124. +99 0 vendor/gems/haml-2.1.0/test/benchmark.rb
  125. +698 0 vendor/gems/haml-2.1.0/test/haml/engine_test.rb
  126. +225 0 vendor/gems/haml-2.1.0/test/haml/helper_test.rb
  127. +92 0 vendor/gems/haml-2.1.0/test/haml/html2haml_test.rb
  128. +52 0 vendor/gems/haml-2.1.0/test/haml/markaby/standard.mab
  129. +6 0 vendor/gems/haml-2.1.0/test/haml/mocks/article.rb
  130. +15 0 vendor/gems/haml-2.1.0/test/haml/results/content_for_layout.xhtml
  131. +9 0 vendor/gems/haml-2.1.0/test/haml/results/eval_suppressed.xhtml
  132. +67 0 vendor/gems/haml-2.1.0/test/haml/results/filters.xhtml
  133. +93 0 vendor/gems/haml-2.1.0/test/haml/results/helpers.xhtml
  134. +10 0 vendor/gems/haml-2.1.0/test/haml/results/helpful.xhtml
  135. +68 0 vendor/gems/haml-2.1.0/test/haml/results/just_stuff.xhtml
  136. +12 0 vendor/gems/haml-2.1.0/test/haml/results/list.xhtml
  137. +40 0 vendor/gems/haml-2.1.0/test/haml/results/nuke_inner_whitespace.xhtml
  138. +148 0 vendor/gems/haml-2.1.0/test/haml/results/nuke_outer_whitespace.xhtml
  139. +20 0 vendor/gems/haml-2.1.0/test/haml/results/original_engine.xhtml
  140. +5 0 vendor/gems/haml-2.1.0/test/haml/results/partial_layout.xhtml
  141. +21 0 vendor/gems/haml-2.1.0/test/haml/results/partials.xhtml
  142. +74 0 vendor/gems/haml-2.1.0/test/haml/results/silent_script.xhtml
  143. +42 0 vendor/gems/haml-2.1.0/test/haml/results/standard.xhtml
  144. +23 0 vendor/gems/haml-2.1.0/test/haml/results/tag_parsing.xhtml
  145. +5 0 vendor/gems/haml-2.1.0/test/haml/results/very_basic.xhtml
  146. +86 0 vendor/gems/haml-2.1.0/test/haml/results/whitespace_handling.xhtml
  147. +12 0 vendor/gems/haml-2.1.0/test/haml/rhtml/_av_partial_1.rhtml
  148. +8 0 vendor/gems/haml-2.1.0/test/haml/rhtml/_av_partial_2.rhtml
  149. +62 0 vendor/gems/haml-2.1.0/test/haml/rhtml/action_view.rhtml
  150. +54 0 vendor/gems/haml-2.1.0/test/haml/rhtml/standard.rhtml
  151. +185 0 vendor/gems/haml-2.1.0/test/haml/template_test.rb
  152. +9 0 vendor/gems/haml-2.1.0/test/haml/templates/_av_partial_1.haml
  153. +9 0 vendor/gems/haml-2.1.0/test/haml/templates/_av_partial_1_ugly.haml
  154. +5 0 vendor/gems/haml-2.1.0/test/haml/templates/_av_partial_2.haml
  155. +5 0 vendor/gems/haml-2.1.0/test/haml/templates/_av_partial_2_ugly.haml
  156. +3 0  vendor/gems/haml-2.1.0/test/haml/templates/_layout_for_partial.haml
  157. +8 0 vendor/gems/haml-2.1.0/test/haml/templates/_partial.haml
  158. +3 0  vendor/gems/haml-2.1.0/test/haml/templates/_text_area.haml
  159. +47 0 vendor/gems/haml-2.1.0/test/haml/templates/action_view.haml
  160. +47 0 vendor/gems/haml-2.1.0/test/haml/templates/action_view_ugly.haml
  161. +8 0 vendor/gems/haml-2.1.0/test/haml/templates/breakage.haml
  162. +10 0 vendor/gems/haml-2.1.0/test/haml/templates/content_for_layout.haml
  163. +11 0 vendor/gems/haml-2.1.0/test/haml/templates/eval_suppressed.haml
  164. +71 0 vendor/gems/haml-2.1.0/test/haml/templates/filters.haml
  165. +95 0 vendor/gems/haml-2.1.0/test/haml/templates/helpers.haml
  166. +11 0 vendor/gems/haml-2.1.0/test/haml/templates/helpful.haml
  167. +83 0 vendor/gems/haml-2.1.0/test/haml/templates/just_stuff.haml
  168. +12 0 vendor/gems/haml-2.1.0/test/haml/templates/list.haml
  169. +32 0 vendor/gems/haml-2.1.0/test/haml/templates/nuke_inner_whitespace.haml
  170. +144 0 vendor/gems/haml-2.1.0/test/haml/templates/nuke_outer_whitespace.haml
  171. +17 0 vendor/gems/haml-2.1.0/test/haml/templates/original_engine.haml
  172. +3 0  vendor/gems/haml-2.1.0/test/haml/templates/partial_layout.haml
  173. +1 0  vendor/gems/haml-2.1.0/test/haml/templates/partialize.haml
  174. +12 0 vendor/gems/haml-2.1.0/test/haml/templates/partials.haml
  175. +40 0 vendor/gems/haml-2.1.0/test/haml/templates/silent_script.haml
  176. +42 0 vendor/gems/haml-2.1.0/test/haml/templates/standard.haml
  177. +42 0 vendor/gems/haml-2.1.0/test/haml/templates/standard_ugly.haml
  178. +21 0 vendor/gems/haml-2.1.0/test/haml/templates/tag_parsing.haml
  179. +4 0 vendor/gems/haml-2.1.0/test/haml/templates/very_basic.haml
  180. +87 0 vendor/gems/haml-2.1.0/test/haml/templates/whitespace_handling.haml
  181. +12 0 vendor/gems/haml-2.1.0/test/linked_rails.rb
  182. +752 0 vendor/gems/haml-2.1.0/test/sass/engine_test.rb
  183. +96 0 vendor/gems/haml-2.1.0/test/sass/functions_test.rb
  184. +9 0 vendor/gems/haml-2.1.0/test/sass/more_results/more1.css
  185. +26 0 vendor/gems/haml-2.1.0/test/sass/more_results/more1_with_line_comments.css
  186. +29 0 vendor/gems/haml-2.1.0/test/sass/more_results/more_import.css
  187. +2 0  vendor/gems/haml-2.1.0/test/sass/more_templates/_more_partial.sass
  188. +23 0 vendor/gems/haml-2.1.0/test/sass/more_templates/more1.sass
  189. +11 0 vendor/gems/haml-2.1.0/test/sass/more_templates/more_import.sass
  190. +208 0 vendor/gems/haml-2.1.0/test/sass/plugin_test.rb
  191. +4 0 vendor/gems/haml-2.1.0/test/sass/results/alt.css
  192. +9 0 vendor/gems/haml-2.1.0/test/sass/results/basic.css
  193. +5 0 vendor/gems/haml-2.1.0/test/sass/results/compact.css
  194. +87 0 vendor/gems/haml-2.1.0/test/sass/results/complex.css
  195. +1 0  vendor/gems/haml-2.1.0/test/sass/results/compressed.css
  196. +19 0 vendor/gems/haml-2.1.0/test/sass/results/expanded.css
  197. +29 0 vendor/gems/haml-2.1.0/test/sass/results/import.css
  198. +49 0 vendor/gems/haml-2.1.0/test/sass/results/line_numbers.css
  199. +95 0 vendor/gems/haml-2.1.0/test/sass/results/mixins.css
  200. +24 0 vendor/gems/haml-2.1.0/test/sass/results/multiline.css
  201. +22 0 vendor/gems/haml-2.1.0/test/sass/results/nested.css
  202. +13 0 vendor/gems/haml-2.1.0/test/sass/results/parent_ref.css
  203. +16 0 vendor/gems/haml-2.1.0/test/sass/results/script.css
  204. +1 0  vendor/gems/haml-2.1.0/test/sass/results/subdir/nested_subdir/nested_subdir.css
  205. +3 0  vendor/gems/haml-2.1.0/test/sass/results/subdir/subdir.css
  206. +11 0 vendor/gems/haml-2.1.0/test/sass/results/units.css
  207. +152 0 vendor/gems/haml-2.1.0/test/sass/script_test.rb
  208. +2 0  vendor/gems/haml-2.1.0/test/sass/templates/_partial.sass
  209. +16 0 vendor/gems/haml-2.1.0/test/sass/templates/alt.sass
  210. +23 0 vendor/gems/haml-2.1.0/test/sass/templates/basic.sass
  211. +2 0  vendor/gems/haml-2.1.0/test/sass/templates/bork.sass
  212. +2 0  vendor/gems/haml-2.1.0/test/sass/templates/bork2.sass
  213. +17 0 vendor/gems/haml-2.1.0/test/sass/templates/compact.sass
  214. +309 0 vendor/gems/haml-2.1.0/test/sass/templates/complex.sass
  215. +15 0 vendor/gems/haml-2.1.0/test/sass/templates/compressed.sass
  216. +17 0 vendor/gems/haml-2.1.0/test/sass/templates/expanded.sass
  217. +11 0 vendor/gems/haml-2.1.0/test/sass/templates/import.sass
  218. +19 0 vendor/gems/haml-2.1.0/test/sass/templates/importee.sass
  219. +13 0 vendor/gems/haml-2.1.0/test/sass/templates/line_numbers.sass
  220. +76 0 vendor/gems/haml-2.1.0/test/sass/templates/mixins.sass
  221. +20 0 vendor/gems/haml-2.1.0/test/sass/templates/multiline.sass
  222. +25 0 vendor/gems/haml-2.1.0/test/sass/templates/nested.sass
  223. +25 0 vendor/gems/haml-2.1.0/test/sass/templates/parent_ref.sass
  224. +101 0 vendor/gems/haml-2.1.0/test/sass/templates/script.sass
  225. +2 0  vendor/gems/haml-2.1.0/test/sass/templates/subdir/nested_subdir/_nested_partial.sass
  226. +3 0  vendor/gems/haml-2.1.0/test/sass/templates/subdir/nested_subdir/nested_subdir.sass
  227. +6 0 vendor/gems/haml-2.1.0/test/sass/templates/subdir/subdir.sass
  228. +11 0 vendor/gems/haml-2.1.0/test/sass/templates/units.sass
  229. +21 0 vendor/gems/haml-2.1.0/test/test_helper.rb
  230. +132 0 vendor/gems/mislav-will_paginate-2.3.6/.specification
  231. +110 0 vendor/gems/mislav-will_paginate-2.3.6/CHANGELOG.rdoc
  232. +18 0 vendor/gems/mislav-will_paginate-2.3.6/LICENSE
  233. +107 0 vendor/gems/mislav-will_paginate-2.3.6/README.rdoc
  234. +62 0 vendor/gems/mislav-will_paginate-2.3.6/Rakefile
  235. BIN  vendor/gems/mislav-will_paginate-2.3.6/examples/apple-circle.gif
  236. +69 0 vendor/gems/mislav-will_paginate-2.3.6/examples/index.haml
  237. +92 0 vendor/gems/mislav-will_paginate-2.3.6/examples/index.html
  238. +90 0 vendor/gems/mislav-will_paginate-2.3.6/examples/pagination.css
  239. +91 0 vendor/gems/mislav-will_paginate-2.3.6/examples/pagination.sass
  240. +1 0  vendor/gems/mislav-will_paginate-2.3.6/init.rb
  241. +82 0 vendor/gems/mislav-will_paginate-2.3.6/lib/will_paginate.rb
  242. +16 0 vendor/gems/mislav-will_paginate-2.3.6/lib/will_paginate/array.rb
  243. +146 0 vendor/gems/mislav-will_paginate-2.3.6/lib/will_paginate/collection.rb
  244. +32 0 vendor/gems/mislav-will_paginate-2.3.6/lib/will_paginate/core_ext.rb
  245. +260 0 vendor/gems/mislav-will_paginate-2.3.6/lib/will_paginate/finder.rb
  246. +170 0 vendor/gems/mislav-will_paginate-2.3.6/lib/will_paginate/named_scope.rb
  247. +37 0 vendor/gems/mislav-will_paginate-2.3.6/lib/will_paginate/named_scope_patch.rb
  248. +9 0 vendor/gems/mislav-will_paginate-2.3.6/lib/will_paginate/version.rb
  249. +383 0 vendor/gems/mislav-will_paginate-2.3.6/lib/will_paginate/view_helpers.rb
  250. +21 0 vendor/gems/mislav-will_paginate-2.3.6/test/boot.rb
  251. +143 0 vendor/gems/mislav-will_paginate-2.3.6/test/collection_test.rb
  252. +8 0 vendor/gems/mislav-will_paginate-2.3.6/test/console
  253. +22 0 vendor/gems/mislav-will_paginate-2.3.6/test/database.yml
  254. +476 0 vendor/gems/mislav-will_paginate-2.3.6/test/finder_test.rb
  255. +3 0  vendor/gems/mislav-will_paginate-2.3.6/test/fixtures/admin.rb
  256. +14 0 vendor/gems/mislav-will_paginate-2.3.6/test/fixtures/developer.rb
  257. +13 0 vendor/gems/mislav-will_paginate-2.3.6/test/fixtures/developers_projects.yml
  258. +15 0 vendor/gems/mislav-will_paginate-2.3.6/test/fixtures/project.rb
  259. +6 0 vendor/gems/mislav-will_paginate-2.3.6/test/fixtures/projects.yml
  260. +29 0 vendor/gems/mislav-will_paginate-2.3.6/test/fixtures/replies.yml
  261. +7 0 vendor/gems/mislav-will_paginate-2.3.6/test/fixtures/reply.rb
  262. +38 0 vendor/gems/mislav-will_paginate-2.3.6/test/fixtures/schema.rb
  263. +10 0 vendor/gems/mislav-will_paginate-2.3.6/test/fixtures/topic.rb
  264. +30 0 vendor/gems/mislav-will_paginate-2.3.6/test/fixtures/topics.yml
  265. +2 0  vendor/gems/mislav-will_paginate-2.3.6/test/fixtures/user.rb
  266. +35 0 vendor/gems/mislav-will_paginate-2.3.6/test/fixtures/users.yml
  267. +37 0 vendor/gems/mislav-will_paginate-2.3.6/test/helper.rb
  268. +36 0 vendor/gems/mislav-will_paginate-2.3.6/test/lib/activerecord_test_case.rb
  269. +73 0 vendor/gems/mislav-will_paginate-2.3.6/test/lib/activerecord_test_connector.rb
  270. +11 0 vendor/gems/mislav-will_paginate-2.3.6/test/lib/load_fixtures.rb
  271. +165 0 vendor/gems/mislav-will_paginate-2.3.6/test/lib/view_test_process.rb
  272. +59 0 vendor/gems/mislav-will_paginate-2.3.6/test/tasks.rake
  273. +363 0 vendor/gems/mislav-will_paginate-2.3.6/test/view_test.rb
  274. +88 0 vendor/gems/yfactorial-utility_scopes-0.2.2/.specification
  275. +21 0 vendor/gems/yfactorial-utility_scopes-0.2.2/CHANGELOG
  276. +18 0 vendor/gems/yfactorial-utility_scopes-0.2.2/LICENSE
  277. +140 0 vendor/gems/yfactorial-utility_scopes-0.2.2/README.textile
  278. +23 0 vendor/gems/yfactorial-utility_scopes-0.2.2/Rakefile
  279. +1 0  vendor/gems/yfactorial-utility_scopes-0.2.2/init.rb
  280. +15 0 vendor/gems/yfactorial-utility_scopes-0.2.2/lib/utility_scopes.rb
  281. +10 0 vendor/gems/yfactorial-utility_scopes-0.2.2/lib/utility_scopes/eager.rb
  282. +41 0 vendor/gems/yfactorial-utility_scopes-0.2.2/lib/utility_scopes/except.rb
  283. +26 0 vendor/gems/yfactorial-utility_scopes-0.2.2/lib/utility_scopes/limited.rb
  284. +82 0 vendor/gems/yfactorial-utility_scopes-0.2.2/lib/utility_scopes/ordered.rb
  285. +10 0 vendor/gems/yfactorial-utility_scopes-0.2.2/spec/abstract_spec.rb
  286. +20 0 vendor/gems/yfactorial-utility_scopes-0.2.2/spec/eager_spec.rb
  287. +25 0 vendor/gems/yfactorial-utility_scopes-0.2.2/spec/except_spec.rb
  288. +2 0  vendor/gems/yfactorial-utility_scopes-0.2.2/spec/fixtures/article.rb
  289. +36 0 vendor/gems/yfactorial-utility_scopes-0.2.2/spec/limit_spec.rb
  290. +64 0 vendor/gems/yfactorial-utility_scopes-0.2.2/spec/ordered_spec.rb
  291. +5 0 vendor/gems/yfactorial-utility_scopes-0.2.2/spec/spec_helper.rb
  292. +1 0  vendor/plugins/cucumber/.gitattributes
  293. +522 0 vendor/plugins/cucumber/History.txt
  294. +20 0 vendor/plugins/cucumber/License.txt
  295. +332 0 vendor/plugins/cucumber/Manifest.txt
  296. +4 0 vendor/plugins/cucumber/README.txt
  297. +8 0 vendor/plugins/cucumber/Rakefile
  298. +6 0 vendor/plugins/cucumber/bin/cucumber
  299. +76 0 vendor/plugins/cucumber/config/hoe.rb
  300. +15 0 vendor/plugins/cucumber/config/requirements.rb
  301. +51 0 vendor/plugins/cucumber/cucumber.gemspec
  302. +1 0  vendor/plugins/cucumber/cucumber.yml
  303. +1 0  vendor/plugins/cucumber/examples/cs/.gitignore
Sorry, we could not display the entire diff because too many files (2,986) changed.
6 .gitignore
... ... @@ -0,0 +1,6 @@
  1 +.DS_Store
  2 +log/*.log
  3 +tmp
  4 +config/database.yml
  5 +db/*.sqlite3
  6 +*.tmproj
243 README
... ... @@ -0,0 +1,243 @@
  1 +== Welcome to Rails
  2 +
  3 +Rails is a web-application framework that includes everything needed to create
  4 +database-backed web applications according to the Model-View-Control pattern.
  5 +
  6 +This pattern splits the view (also called the presentation) into "dumb" templates
  7 +that are primarily responsible for inserting pre-built data in between HTML tags.
  8 +The model contains the "smart" domain objects (such as Account, Product, Person,
  9 +Post) that holds all the business logic and knows how to persist themselves to
  10 +a database. The controller handles the incoming requests (such as Save New Account,
  11 +Update Product, Show Post) by manipulating the model and directing data to the view.
  12 +
  13 +In Rails, the model is handled by what's called an object-relational mapping
  14 +layer entitled Active Record. This layer allows you to present the data from
  15 +database rows as objects and embellish these data objects with business logic
  16 +methods. You can read more about Active Record in
  17 +link:files/vendor/rails/activerecord/README.html.
  18 +
  19 +The controller and view are handled by the Action Pack, which handles both
  20 +layers by its two parts: Action View and Action Controller. These two layers
  21 +are bundled in a single package due to their heavy interdependence. This is
  22 +unlike the relationship between the Active Record and Action Pack that is much
  23 +more separate. Each of these packages can be used independently outside of
  24 +Rails. You can read more about Action Pack in
  25 +link:files/vendor/rails/actionpack/README.html.
  26 +
  27 +
  28 +== Getting Started
  29 +
  30 +1. At the command prompt, start a new Rails application using the <tt>rails</tt> command
  31 + and your application name. Ex: rails myapp
  32 +2. Change directory into myapp and start the web server: <tt>script/server</tt> (run with --help for options)
  33 +3. Go to http://localhost:3000/ and get "Welcome aboard: You're riding the Rails!"
  34 +4. Follow the guidelines to start developing your application
  35 +
  36 +
  37 +== Web Servers
  38 +
  39 +By default, Rails will try to use Mongrel if it's are installed when started with script/server, otherwise Rails will use WEBrick, the webserver that ships with Ruby. But you can also use Rails
  40 +with a variety of other web servers.
  41 +
  42 +Mongrel is a Ruby-based webserver with a C component (which requires compilation) that is
  43 +suitable for development and deployment of Rails applications. If you have Ruby Gems installed,
  44 +getting up and running with mongrel is as easy as: <tt>gem install mongrel</tt>.
  45 +More info at: http://mongrel.rubyforge.org
  46 +
  47 +Say other Ruby web servers like Thin and Ebb or regular web servers like Apache or LiteSpeed or
  48 +Lighttpd or IIS. The Ruby web servers are run through Rack and the latter can either be setup to use
  49 +FCGI or proxy to a pack of Mongrels/Thin/Ebb servers.
  50 +
  51 +== Apache .htaccess example for FCGI/CGI
  52 +
  53 +# General Apache options
  54 +AddHandler fastcgi-script .fcgi
  55 +AddHandler cgi-script .cgi
  56 +Options +FollowSymLinks +ExecCGI
  57 +
  58 +# If you don't want Rails to look in certain directories,
  59 +# use the following rewrite rules so that Apache won't rewrite certain requests
  60 +#
  61 +# Example:
  62 +# RewriteCond %{REQUEST_URI} ^/notrails.*
  63 +# RewriteRule .* - [L]
  64 +
  65 +# Redirect all requests not available on the filesystem to Rails
  66 +# By default the cgi dispatcher is used which is very slow
  67 +#
  68 +# For better performance replace the dispatcher with the fastcgi one
  69 +#
  70 +# Example:
  71 +# RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
  72 +RewriteEngine On
  73 +
  74 +# If your Rails application is accessed via an Alias directive,
  75 +# then you MUST also set the RewriteBase in this htaccess file.
  76 +#
  77 +# Example:
  78 +# Alias /myrailsapp /path/to/myrailsapp/public
  79 +# RewriteBase /myrailsapp
  80 +
  81 +RewriteRule ^$ index.html [QSA]
  82 +RewriteRule ^([^.]+)$ $1.html [QSA]
  83 +RewriteCond %{REQUEST_FILENAME} !-f
  84 +RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
  85 +
  86 +# In case Rails experiences terminal errors
  87 +# Instead of displaying this message you can supply a file here which will be rendered instead
  88 +#
  89 +# Example:
  90 +# ErrorDocument 500 /500.html
  91 +
  92 +ErrorDocument 500 "<h2>Application error</h2>Rails application failed to start properly"
  93 +
  94 +
  95 +== Debugging Rails
  96 +
  97 +Sometimes your application goes wrong. Fortunately there are a lot of tools that
  98 +will help you debug it and get it back on the rails.
  99 +
  100 +First area to check is the application log files. Have "tail -f" commands running
  101 +on the server.log and development.log. Rails will automatically display debugging
  102 +and runtime information to these files. Debugging info will also be shown in the
  103 +browser on requests from 127.0.0.1.
  104 +
  105 +You can also log your own messages directly into the log file from your code using
  106 +the Ruby logger class from inside your controllers. Example:
  107 +
  108 + class WeblogController < ActionController::Base
  109 + def destroy
  110 + @weblog = Weblog.find(params[:id])
  111 + @weblog.destroy
  112 + logger.info("#{Time.now} Destroyed Weblog ID ##{@weblog.id}!")
  113 + end
  114 + end
  115 +
  116 +The result will be a message in your log file along the lines of:
  117 +
  118 + Mon Oct 08 14:22:29 +1000 2007 Destroyed Weblog ID #1
  119 +
  120 +More information on how to use the logger is at http://www.ruby-doc.org/core/
  121 +
  122 +Also, Ruby documentation can be found at http://www.ruby-lang.org/ including:
  123 +
  124 +* The Learning Ruby (Pickaxe) Book: http://www.ruby-doc.org/docs/ProgrammingRuby/
  125 +* Learn to Program: http://pine.fm/LearnToProgram/ (a beginners guide)
  126 +
  127 +These two online (and free) books will bring you up to speed on the Ruby language
  128 +and also on programming in general.
  129 +
  130 +
  131 +== Debugger
  132 +
  133 +Debugger support is available through the debugger command when you start your Mongrel or
  134 +Webrick server with --debugger. This means that you can break out of execution at any point
  135 +in the code, investigate and change the model, AND then resume execution!
  136 +You need to install ruby-debug to run the server in debugging mode. With gems, use 'gem install ruby-debug'
  137 +Example:
  138 +
  139 + class WeblogController < ActionController::Base
  140 + def index
  141 + @posts = Post.find(:all)
  142 + debugger
  143 + end
  144 + end
  145 +
  146 +So the controller will accept the action, run the first line, then present you
  147 +with a IRB prompt in the server window. Here you can do things like:
  148 +
  149 + >> @posts.inspect
  150 + => "[#<Post:0x14a6be8 @attributes={\"title\"=>nil, \"body\"=>nil, \"id\"=>\"1\"}>,
  151 + #<Post:0x14a6620 @attributes={\"title\"=>\"Rails you know!\", \"body\"=>\"Only ten..\", \"id\"=>\"2\"}>]"
  152 + >> @posts.first.title = "hello from a debugger"
  153 + => "hello from a debugger"
  154 +
  155 +...and even better is that you can examine how your runtime objects actually work:
  156 +
  157 + >> f = @posts.first
  158 + => #<Post:0x13630c4 @attributes={"title"=>nil, "body"=>nil, "id"=>"1"}>
  159 + >> f.
  160 + Display all 152 possibilities? (y or n)
  161 +
  162 +Finally, when you're ready to resume execution, you enter "cont"
  163 +
  164 +
  165 +== Console
  166 +
  167 +You can interact with the domain model by starting the console through <tt>script/console</tt>.
  168 +Here you'll have all parts of the application configured, just like it is when the
  169 +application is running. You can inspect domain models, change values, and save to the
  170 +database. Starting the script without arguments will launch it in the development environment.
  171 +Passing an argument will specify a different environment, like <tt>script/console production</tt>.
  172 +
  173 +To reload your controllers and models after launching the console run <tt>reload!</tt>
  174 +
  175 +== dbconsole
  176 +
  177 +You can go to the command line of your database directly through <tt>script/dbconsole</tt>.
  178 +You would be connected to the database with the credentials defined in database.yml.
  179 +Starting the script without arguments will connect you to the development database. Passing an
  180 +argument will connect you to a different database, like <tt>script/dbconsole production</tt>.
  181 +Currently works for mysql, postgresql and sqlite.
  182 +
  183 +== Description of Contents
  184 +
  185 +app
  186 + Holds all the code that's specific to this particular application.
  187 +
  188 +app/controllers
  189 + Holds controllers that should be named like weblogs_controller.rb for
  190 + automated URL mapping. All controllers should descend from ApplicationController
  191 + which itself descends from ActionController::Base.
  192 +
  193 +app/models
  194 + Holds models that should be named like post.rb.
  195 + Most models will descend from ActiveRecord::Base.
  196 +
  197 +app/views
  198 + Holds the template files for the view that should be named like
  199 + weblogs/index.html.erb for the WeblogsController#index action. All views use eRuby
  200 + syntax.
  201 +
  202 +app/views/layouts
  203 + Holds the template files for layouts to be used with views. This models the common
  204 + header/footer method of wrapping views. In your views, define a layout using the
  205 + <tt>layout :default</tt> and create a file named default.html.erb. Inside default.html.erb,
  206 + call <% yield %> to render the view using this layout.
  207 +
  208 +app/helpers
  209 + Holds view helpers that should be named like weblogs_helper.rb. These are generated
  210 + for you automatically when using script/generate for controllers. Helpers can be used to
  211 + wrap functionality for your views into methods.
  212 +
  213 +config
  214 + Configuration files for the Rails environment, the routing map, the database, and other dependencies.
  215 +
  216 +db
  217 + Contains the database schema in schema.rb. db/migrate contains all
  218 + the sequence of Migrations for your schema.
  219 +
  220 +doc
  221 + This directory is where your application documentation will be stored when generated
  222 + using <tt>rake doc:app</tt>
  223 +
  224 +lib
  225 + Application specific libraries. Basically, any kind of custom code that doesn't
  226 + belong under controllers, models, or helpers. This directory is in the load path.
  227 +
  228 +public
  229 + The directory available for the web server. Contains subdirectories for images, stylesheets,
  230 + and javascripts. Also contains the dispatchers and the default HTML files. This should be
  231 + set as the DOCUMENT_ROOT of your web server.
  232 +
  233 +script
  234 + Helper scripts for automation and generation.
  235 +
  236 +test
  237 + Unit and functional tests along with fixtures. When using the script/generate scripts, template
  238 + test files will be generated for you and placed in this directory.
  239 +
  240 +vendor
  241 + External libraries that the application depends on. Also includes the plugins subdirectory.
  242 + If the app has frozen rails, those gems also go here, under vendor/rails/.
  243 + This directory is in the load path.
10 Rakefile
... ... @@ -0,0 +1,10 @@
  1 +# Add your own tasks in files placed in lib/tasks ending in .rake,
  2 +# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
  3 +
  4 +require(File.join(File.dirname(__FILE__), 'config', 'boot'))
  5 +
  6 +require 'rake'
  7 +require 'rake/testtask'
  8 +require 'rake/rdoctask'
  9 +
  10 +require 'tasks/rails'
40 app/controllers/api/api_controller.rb
... ... @@ -0,0 +1,40 @@
  1 +module Api
  2 + class ApiController < ApplicationController
  3 +
  4 + # Turn off CSR/forgery protection
  5 + skip_before_filter :verify_authenticity_token
  6 +
  7 + # All API requests must be authenticated
  8 + before_filter :basic_app_authenticate, :require_app_authentication
  9 +
  10 + #-- Authentication/Authorization helpers
  11 +
  12 + def current_app
  13 + @application
  14 + end
  15 +
  16 + def current_device_id
  17 + @device_id
  18 + end
  19 +
  20 + def basic_app_authenticate
  21 + authenticate_or_request_with_http_basic("Remote Logger API") do |device_id, app_token|
  22 + @application = Application.find_by_token(app_token)
  23 + @device_id = device_id
  24 + end
  25 + end
  26 +
  27 + #-- Authentication/Authorization filters
  28 +
  29 + def require_app_authentication
  30 + if !current_app or !current_device_id
  31 + respond_to do |wants|
  32 + message = 'Application token or device identifier were missing and/or invalid'
  33 + wants.html { render :text => message, :status => 401 }
  34 + wants.xml { render :xml => { :errors => { :error => message }}, :status => 401 }
  35 + wants.json { render :json => { :errors => { :error => message }}, :status => 401 }
  36 + end
  37 + end
  38 + end
  39 + end
  40 +end
30 app/controllers/api/v1/statements_controller.rb
... ... @@ -0,0 +1,30 @@
  1 +module Api
  2 + module V1
  3 +
  4 + class StatementsController < V1Controller
  5 +
  6 + make_resourceful do
  7 +
  8 + actions :create
  9 +
  10 + response_for(:create) do |format|
  11 + format.html { render :text => 'Statement successfully created', :status => :created }
  12 + format.xml { render :xml => current_object, :status => :created, :location => api_v1_statement_url(current_object, :format => :xml) }
  13 + format.js { render :json => current_object, :status => :created, :location => api_v1_statement_url(current_object, :format => :json) }
  14 + end
  15 +
  16 + response_for(:create_fails) do |format|
  17 + format.html { render :text => current_object.errors.full_messages.join('\n'), :status => 400 }
  18 + format.xml { render :xml => current_object.errors, :status => 400 }
  19 + format.js { render :json => current_object.errors, :status => 400 }
  20 + end
  21 + end
  22 +
  23 + #-- Make resourceful overrides
  24 +
  25 + def build_object
  26 + @current_object ||= current_application.statements.build(object_parameters)
  27 + end
  28 + end
  29 + end
  30 +end
6 app/controllers/api/v1/v1_controller.rb
... ... @@ -0,0 +1,6 @@
  1 +module Api
  2 + module V1
  3 + class V1Controller < ApiController
  4 + end
  5 + end
  6 +end
8 app/controllers/application_controller.rb
... ... @@ -0,0 +1,8 @@
  1 +class ApplicationController < ActionController::Base
  2 +
  3 + include ExceptionNotifiable
  4 +
  5 + helper :all
  6 + protect_from_forgery
  7 +
  8 +end
30 app/helpers/application_helper.rb
... ... @@ -0,0 +1,30 @@
  1 +module ApplicationHelper
  2 +
  3 + # Print out all flash messages in a span of the same
  4 + # class as the message type
  5 + def flash_messages
  6 + html = flash.collect do |type, message|
  7 + content_tag(:div, message, :class => type)
  8 + end
  9 + flash.clear # Not sure why we have to manually do this sometimes
  10 + html
  11 + end
  12 +
  13 + # Are there any flash messages to display?
  14 + def flash_messages?; flash.any?; end
  15 +
  16 + # Set the page title
  17 + def page_title(title)
  18 + content_for :page_title, title
  19 + end
  20 +
  21 + # Set the html header title
  22 + def head_title(title)
  23 + content_for :head_title, title
  24 + end
  25 +
  26 + # Get the authenticity token (useful for an ajax call)
  27 + def auth_token
  28 + (protect_against_forgery? ? form_authenticity_token : nil)
  29 + end
  30 +end
16 app/models/application.rb
... ... @@ -0,0 +1,16 @@
  1 +class Application < ActiveRecord::Base
  2 +
  3 + has_many :statements, :dependent => :delete_all
  4 +
  5 + validates_presence_of :name, :token
  6 + validates_uniqueness_of :token
  7 + validates_uniqueness_of :name, :scope => "account_id"
  8 +
  9 + before_validation :generate_token
  10 +
  11 + private
  12 +
  13 + def generate_token
  14 + self.token = ActiveSupport::SecureRandom.hex(16) if token.nil?
  15 + end
  16 +end
14 app/models/statement.rb
... ... @@ -0,0 +1,14 @@
  1 +class Statement < ActiveRecord::Base
  2 +
  3 + belongs_to :application
  4 +
  5 + validates_presence_of :application, :device_id, :level, :message
  6 +
  7 + before_validation_on_create :normalize_level
  8 +
  9 + private
  10 +
  11 + def normalize_level
  12 + self.level = level.upcase if level
  13 + end
  14 +end
110 config/boot.rb
... ... @@ -0,0 +1,110 @@
  1 +# Don't change this file!
  2 +# Configure your app in config/environment.rb and config/environments/*.rb
  3 +
  4 +RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
  5 +
  6 +module Rails
  7 + class << self
  8 + def boot!
  9 + unless booted?
  10 + preinitialize
  11 + pick_boot.run
  12 + end
  13 + end
  14 +
  15 + def booted?
  16 + defined? Rails::Initializer
  17 + end
  18 +
  19 + def pick_boot
  20 + (vendor_rails? ? VendorBoot : GemBoot).new
  21 + end
  22 +
  23 + def vendor_rails?
  24 + File.exist?("#{RAILS_ROOT}/vendor/rails")
  25 + end
  26 +
  27 + def preinitialize
  28 + load(preinitializer_path) if File.exist?(preinitializer_path)
  29 + end
  30 +
  31 + def preinitializer_path
  32 + "#{RAILS_ROOT}/config/preinitializer.rb"
  33 + end
  34 + end
  35 +
  36 + class Boot
  37 + def run
  38 + load_initializer
  39 + Rails::Initializer.run(:set_load_path)
  40 + end
  41 + end
  42 +
  43 + class VendorBoot < Boot
  44 + def load_initializer
  45 + require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
  46 + Rails::Initializer.run(:install_gem_spec_stubs)
  47 + Rails::GemDependency.add_frozen_gem_path
  48 + end
  49 + end
  50 +
  51 + class GemBoot < Boot
  52 + def load_initializer
  53 + self.class.load_rubygems
  54 + load_rails_gem
  55 + require 'initializer'
  56 + end
  57 +
  58 + def load_rails_gem
  59 + if version = self.class.gem_version
  60 + gem 'rails', version
  61 + else
  62 + gem 'rails'
  63 + end
  64 + rescue Gem::LoadError => load_error
  65 + $stderr.puts %(Missing the Rails #{version} gem. Please `gem install -v=#{version} rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.)
  66 + exit 1
  67 + end
  68 +
  69 + class << self
  70 + def rubygems_version
  71 + Gem::RubyGemsVersion rescue nil
  72 + end
  73 +
  74 + def gem_version
  75 + if defined? RAILS_GEM_VERSION
  76 + RAILS_GEM_VERSION
  77 + elsif ENV.include?('RAILS_GEM_VERSION')
  78 + ENV['RAILS_GEM_VERSION']
  79 + else
  80 + parse_gem_version(read_environment_rb)
  81 + end
  82 + end
  83 +
  84 + def load_rubygems
  85 + require 'rubygems'
  86 + min_version = '1.3.1'
  87 + unless rubygems_version >= min_version
  88 + $stderr.puts %Q(Rails requires RubyGems >= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.)
  89 + exit 1
  90 + end
  91 +
  92 + rescue LoadError
  93 + $stderr.puts %Q(Rails requires RubyGems >= #{min_version}. Please install RubyGems and try again: http://rubygems.rubyforge.org)
  94 + exit 1
  95 + end
  96 +
  97 + def parse_gem_version(text)
  98 + $1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/
  99 + end
  100 +
  101 + private
  102 + def read_environment_rb
  103 + File.read("#{RAILS_ROOT}/config/environment.rb")
  104 + end
  105 + end
  106 + end
  107 +end
  108 +
  109 +# All that for this:
  110 +Rails.boot!
46 config/environment.rb
... ... @@ -0,0 +1,46 @@
  1 +# Be sure to restart your server when you modify this file
  2 +
  3 +# Specifies gem version of Rails to use when vendor/rails is not present
  4 +RAILS_GEM_VERSION = '2.3.2' unless defined? RAILS_GEM_VERSION
  5 +
  6 +# Bootstrap the Rails environment, frameworks, and default configuration
  7 +require File.join(File.dirname(__FILE__), 'boot')
  8 +
  9 +Rails::Initializer.run do |config|
  10 +
  11 + config.gem 'mislav-will_paginate', :lib => 'will_paginate', :source => 'http://gems.github.com'
  12 + config.gem 'yfactorial-utility_scopes', :lib => 'utility_scopes', :source => 'http://gems.github.com/'
  13 + config.gem 'haml', :version => '2.1.0'
  14 +
  15 + # Settings in config/environments/* take precedence over those specified here.
  16 + # Application configuration should go into files in config/initializers
  17 + # -- all .rb files in that directory are automatically loaded.
  18 +
  19 + # Add additional load paths for your own custom dirs
  20 + # config.load_paths += %W( #{RAILS_ROOT}/extras )
  21 +
  22 + # Specify gems that this application depends on and have them installed with rake gems:install
  23 + # config.gem "bj"
  24 + # config.gem "hpricot", :version => '0.6', :source => "http://code.whytheluckystiff.net"
  25 + # config.gem "sqlite3-ruby", :lib => "sqlite3"
  26 + # config.gem "aws-s3", :lib => "aws/s3"
  27 +
  28 + # Only load the plugins named here, in the order given (default is alphabetical).
  29 + # :all can be used as a placeholder for all plugins not explicitly named
  30 + # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
  31 +
  32 + # Skip frameworks you're not going to use. To use Rails without a database,
  33 + # you must remove the Active Record framework.
  34 + config.frameworks -= [ :active_resource, :action_mailer ]
  35 +
  36 + # Activate observers that should always be running
  37 + # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
  38 +
  39 + # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
  40 + # Run "rake -D time" for a list of tasks for finding time zone names.
  41 + config.time_zone = 'UTC'
  42 +
  43 + # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
  44 + # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}')]
  45 + # config.i18n.default_locale = :de
  46 +end
17 config/environments/development.rb
... ... @@ -0,0 +1,17 @@
  1 +# Settings specified here will take precedence over those in config/environment.rb
  2 +
  3 +# In the development environment your application's code is reloaded on
  4 +# every request. This slows down response time but is perfect for development
  5 +# since you don't have to restart the webserver when you make code changes.
  6 +config.cache_classes = false
  7 +
  8 +# Log error messages when you accidentally call methods on nil.
  9 +config.whiny_nils = true
  10 +
  11 +# Show full error reports and disable caching
  12 +config.action_controller.consider_all_requests_local = true
  13 +config.action_view.debug_rjs = true
  14 +config.action_controller.perform_caching = false
  15 +
  16 +# Don't care if the mailer can't send
  17 +config.action_mailer.raise_delivery_errors = false
28 config/environments/production.rb
... ... @@ -0,0 +1,28 @@
  1 +# Settings specified here will take precedence over those in config/environment.rb
  2 +
  3 +# The production environment is meant for finished, "live" apps.
  4 +# Code is not reloaded between requests
  5 +config.cache_classes = true
  6 +
  7 +# Full error reports are disabled and caching is turned on
  8 +config.action_controller.consider_all_requests_local = false
  9 +config.action_controller.perform_caching = true
  10 +config.action_view.cache_template_loading = true
  11 +
  12 +# See everything in the log (default is :info)
  13 +# config.log_level = :debug
  14 +
  15 +# Use a different logger for distributed setups
  16 +# config.logger = SyslogLogger.new
  17 +
  18 +# Use a different cache store in production
  19 +# config.cache_store = :mem_cache_store
  20 +
  21 +# Enable serving of images, stylesheets, and javascripts from an asset server
  22 +# config.action_controller.asset_host = "http://assets.example.com"
  23 +
  24 +# Disable delivery errors, bad email addresses will be ignored
  25 +# config.action_mailer.raise_delivery_errors = false
  26 +
  27 +# Enable threaded mode
  28 +# config.threadsafe!
28 config/environments/test.rb
... ... @@ -0,0 +1,28 @@
  1 +# Settings specified here will take precedence over those in config/environment.rb
  2 +
  3 +# The test environment is used exclusively to run your application's
  4 +# test suite. You never need to work with it otherwise. Remember that
  5 +# your test database is "scratch space" for the test suite and is wiped
  6 +# and recreated between test runs. Don't rely on the data there!
  7 +config.cache_classes = true
  8 +
  9 +# Log error messages when you accidentally call methods on nil.
  10 +config.whiny_nils = true
  11 +
  12 +# Show full error reports and disable caching
  13 +config.action_controller.consider_all_requests_local = true
  14 +config.action_controller.perform_caching = false
  15 +config.action_view.cache_template_loading = true
  16 +
  17 +# Disable request forgery protection in test environment
  18 +config.action_controller.allow_forgery_protection = false
  19 +
  20 +# Tell Action Mailer not to deliver emails to the real world.
  21 +# The :test delivery method accumulates sent emails in the
  22 +# ActionMailer::Base.deliveries array.
  23 +config.action_mailer.delivery_method = :test
  24 +
  25 +# Use SQL instead of Active Record's schema dumper when creating the test database.
  26 +# This is necessary if your schema can't be completely dumped by the schema dumper,
  27 +# like if you have constraints or database-specific column types
  28 +# config.active_record.schema_format = :sql
7 config/initializers/backtrace_silencers.rb
... ... @@ -0,0 +1,7 @@
  1 +# Be sure to restart your server when you modify this file.
  2 +
  3 +# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
  4 +# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
  5 +
  6 +# You can also remove all the silencers if you're trying do debug a problem that might steem from framework code.
  7 +# Rails.backtrace_cleaner.remove_silencers!
3  config/initializers/exception_notifications.rb
... ... @@ -0,0 +1,3 @@
  1 +ExceptionNotifier.exception_recipients = %w(ryan.daigle+remotelogger@gmail.com)
  2 +ExceptionNotifier.sender_address = %("RemoteLogger Error" <errors@remotelogger.com>)
  3 +ExceptionNotifier.email_prefix = ENV['RAILS_ENV'] ? "[#{ENV['RAILS_ENV'].upcase}]" : ''
10 config/initializers/inflections.rb
... ... @@ -0,0 +1,10 @@
  1 +# Be sure to restart your server when you modify this file.
  2 +
  3 +# Add new inflection rules using the following format
  4 +# (all these examples are active by default):
  5 +# ActiveSupport::Inflector.inflections do |inflect|
  6 +# inflect.plural /^(ox)$/i, '\1en'
  7 +# inflect.singular /^(ox)en/i, '\1'
  8 +# inflect.irregular 'person', 'people'
  9 +# inflect.uncountable %w( fish sheep )
  10 +# end
5 config/initializers/mime_types.rb
... ... @@ -0,0 +1,5 @@
  1 +# Be sure to restart your server when you modify this file.
  2 +
  3 +# Add new mime types for use in respond_to blocks:
  4 +# Mime::Type.register "text/richtext", :rtf
  5 +# Mime::Type.register_alias "text/html", :iphone
19 config/initializers/new_rails_defaults.rb
... ... @@ -0,0 +1,19 @@
  1 +# Be sure to restart your server when you modify this file.
  2 +
  3 +# These settings change the behavior of Rails 2 apps and will be defaults
  4 +# for Rails 3. You can remove this initializer when Rails 3 is released.
  5 +
  6 +if defined?(ActiveRecord)
  7 + # Include Active Record class name as root for JSON serialized output.
  8 + ActiveRecord::Base.include_root_in_json = true
  9 +
  10 + # Store the full class name (including module namespace) in STI type column.
  11 + ActiveRecord::Base.store_full_sti_class = true
  12 +end
  13 +
  14 +# Use ISO 8601 format for JSON serialized times and dates.
  15 +ActiveSupport.use_standard_json_time_format = true
  16 +
  17 +# Don't escape HTML entities in JSON, leave that for the #json_escape helper.
  18 +# if you're including raw json in an HTML page.
  19 +ActiveSupport.escape_html_entities_in_json = false
15 config/initializers/session_store.rb
... ... @@ -0,0 +1,15 @@
  1 +# Be sure to restart your server when you modify this file.
  2 +
  3 +# Your secret key for verifying cookie session data integrity.
  4 +# If you change this key, all old sessions will become invalid!
  5 +# Make sure the secret is at least 30 characters and all random,
  6 +# no regular words or you'll be exposed to dictionary attacks.
  7 +ActionController::Base.session = {
  8 + :key => '_remotelogger-server_session',
  9 + :secret => 'b1216823238e1883d49fa246d05bfc9d27c8606ce322c03f6cbd325f7a4c4829b9392c2f935ad10d99fc96eafbda4b7d32258665011e5af8c8eaeef27ed5f457'
  10 +}
  11 +
  12 +# Use the database for sessions instead of the cookie-based default,
  13 +# which shouldn't be used to store highly confidential information
  14 +# (create the session table with "rake db:sessions:create")
  15 +# ActionController::Base.session_store = :active_record_store
1  config/initializers/will_paginate.rb
... ... @@ -0,0 +1 @@
  1 +ActiveRecord::Base.class_eval { def self.per_page; 10; end }
5 config/locales/en.yml
... ... @@ -0,0 +1,5 @@
  1 +# Sample localization file for English. Add more files in this directory for other locales.
  2 +# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
  3 +
  4 +en:
  5 + hello: "Hello world"
145 config/newrelic.yml
... ... @@ -0,0 +1,145 @@
  1 +#
  2 +# This file configures the NewRelic RPM Agent, NewRelic RPM monitors Rails
  3 +# applications with deep visibility and low overhead. For more information,
  4 +# visit www.newrelic.com.
  5 +#
  6 +# This configuration file is custom generated for Y|Factorial, LLC
  7 +#
  8 +# here are the settings that are common to all environments
  9 +common: &default_settings
  10 + # ============================== LICENSE KEY ===============================
  11 + # You must specify the licence key associated with your New Relic account.
  12 + # This key binds your Agent's data to your account in the New Relic RPM service.
  13 + license_key: 'fecac1a2d4c32983cf851c90b77d867849928135'
  14 +
  15 + # Agent Enabled
  16 + # Use this setting to force the agent to run or not run.
  17 + # Default is 'auto' which means the agent will install and run only if a
  18 + # valid dispatcher such as Mongrel is running. This prevents it from running
  19 + # with Rake or the console. Set to false to completely turn the agent off
  20 + # regardless of the other settings. Valid values are true, false and auto.
  21 + # agent_enabled: auto
  22 +
  23 + # Application Name
  24 + # Set this to be the name of your application as you'd like it show up in RPM.
  25 + # RPM will then auto-map instances of your application into a RPM "application"
  26 + # on your home dashboard page. This setting does not prevent you from manually
  27 + # defining applications.
  28 + app_name: RemoteLogger
  29 +
  30 + # the 'enabled' setting is used to turn on the NewRelic Agent. When false,
  31 + # your application is not instrumented and the Agent does not start up or
  32 + # collect any data; it is a complete shut-off.
  33 + #
  34 + # when turned on, the agent collects performance data by inserting lightweight
  35 + # tracers on key methods inside the rails framework and asynchronously aggregating
  36 + # and reporting this performance data to the NewRelic RPM service at NewRelic.com.
  37 + # below.
  38 + enabled: true
  39 +
  40 + # The newrelic agent generates its own log file to keep its logging information
  41 + # separate from that of your application. Specify its log level here.
  42 + log_level: info
  43 +
  44 + # The newrelic agent communicates with the RPM service via http by default.
  45 + # If you want to communicate via https to increase security, then turn on
  46 + # SSL by setting this value to true. Note, this will result in increased
  47 + # CPU overhead to perform the encryption involved in SSL communication, but this
  48 + # work is done asynchronously to the threads that process your application code, so
  49 + # it should not impact response times.
  50 + ssl: false
  51 +
  52 +
  53 + # Proxy settings for connecting to the RPM server.
  54 + #
  55 + # If a proxy is used, the host setting is required. Other settings are optional. Default
  56 + # port is 8080.
  57 + #
  58 + # proxy_host: hostname
  59 + # proxy_port: 8080
  60 + # proxy_user:
  61 + # proxy_pass:
  62 +
  63 +
  64 + # Tells transaction tracer and error collector (when enabled) whether or not to capture HTTP params.
  65 + # When true, the RoR filter_parameter_logging mechanism is used so that sensitive parameters are not recorded
  66 + capture_params: true
  67 +
  68 +
  69 + # Transaction tracer captures deep information about slow
  70 + # transactions and sends this to the RPM service once a minute. Included in the
  71 + # transaction is the exact call sequence of the transactions including any SQL statements
  72 + # issued.
  73 + transaction_tracer:
  74 +
  75 + # Transaction tracer is enabled by default. Set this to false to turn it off. This feature
  76 + # is only available at the Silver and above product levels.
  77 + enabled: true
  78 +
  79 +
  80 + # When transaction tracer is on, SQL statements can optionally be recorded. The recorder
  81 + # has three modes, "off" which sends no SQL, "raw" which sends the SQL statement in its
  82 + # original form, and "obfuscated", which strips out numeric and string literals
  83 + record_sql: raw
  84 +
  85 + # Threshold in seconds for when to collect stack trace for a SQL call. In other words,
  86 + # when SQL statements exceed this threshold, then capture and send to RPM the current
  87 + # stack trace. This is helpful for pinpointing where long SQL calls originate from
  88 + stack_trace_threshold: 0.500
  89 +
  90 + # Error collector captures information about uncaught exceptions and sends them to RPM for
  91 + # viewing
  92 + error_collector:
  93 +
  94 + # Error collector is enabled by default. Set this to false to turn it off. This feature
  95 + # is only available at the Silver and above product levels
  96 + enabled: true
  97 +
  98 + # Tells error collector whether or not to capture a source snippet around the place of the
  99 + # error when errors are View related.
  100 + capture_source: true
  101 +
  102 + # To stop specific errors from reporting to RPM, set this property to comma separated
  103 + # values
  104 + #
  105 + #ignore_errors: ActionController::RoutingError, ...
  106 +
  107 +
  108 +# override default settings based on your application's environment
  109 +
  110 +# NOTE if your application has other named environments, you should
  111 +# provide newrelic conifguration settings for these enviromnents here.
  112 +
  113 +development:
  114 + <<: *default_settings
  115 + # turn off communication to RPM service in development mode.
  116 + # NOTE: for initial evaluation purposes, you may want to temporarily turn
  117 + # the agent on in development mode.
  118 + enabled: false
  119 +
  120 + # When running in Developer Mode, the New Relic Agent will present
  121 + # performance information on the last 100 transactions you have
  122 + # executed since starting the mongrel. to view this data, go to
  123 + # http://localhost:3000/newrelic
  124 + developer: true
  125 +
  126 +test:
  127 + <<: *default_settings
  128 + # it almost never makes sense to turn on the agent when running unit, functional or
  129 + # integration tests or the like.
  130 + enabled: false
  131 +
  132 +# Turn on the agent in production for 24x7 monitoring. NewRelic testing shows
  133 +# an average performance impact of < 5 ms per transaction, you you can leave this on
  134 +# all the time without incurring any user-visible performance degredation.
  135 +production:
  136 + <<: *default_settings
  137 + enabled: true
  138 +
  139 +# many applications have a staging environment which behaves identically to production.
  140 +# Support for that environment is provided here. By default, the staging environment has
  141 +# the agent turned on.
  142 +staging:
  143 + <<: *default_settings
  144 + enabled: true
  145 + app_name: RemoteLogger (Staging)
9 config/routes.rb
... ... @@ -0,0 +1,9 @@
  1 +ActionController::Routing::Routes.draw do |map|
  2 +
  3 + # Initial version of API
  4 + map.namespace :api do |api|
  5 + api.namespace :v1 do |v1|
  6 + v1.resources :statements, :only => [:show, :create]
  7 + end
  8 + end
  9 +end
27 db/migrate/20090401132240_initial_release.rb
... ... @@ -0,0 +1,27 @@
  1 +class InitialRelease < ActiveRecord::Migration
  2 +
  3 + def self.up
  4 +
  5 + create_table :applications do |t|
  6 + t.belongs_to :account
  7 + t.string :name, :token, :null => false
  8 + t.timestamps
  9 + end
  10 + add_index :applications, :token
  11 + add_index :applications, :account_id
  12 +
  13 + create_table :statements do |t|
  14 + t.belongs_to :application, :null => false
  15 + t.string :device_id, :level, :null => false
  16 + t.text :message, :null => false
  17 + t.timestamp :logged_at
  18 + t.timestamps
  19 + end
  20 + add_index :statements, :application_id
  21 + add_index :statements, :level
  22 + add_index :statements, [:logged_at, :created_at]
  23 + end
  24 +
  25 + def self.down
  26 + end
  27 +end
2  doc/README_FOR_APP
... ... @@ -0,0 +1,2 @@
  1 +Use this README file to introduce your application and point to useful places in the API for learning more.
  2 +Run "rake doc:app" to generate API documentation for your models, controllers, helpers, and libraries.
4 lib/tasks/db.rake
... ... @@ -0,0 +1,4 @@
  1 +namespace :db do
  2 + desc "Drop the dbs, and does a full migrate to bring it back up"
  3 + task :revert => ['db:drop', 'db:create', 'db:migrate']
  4 +end
165 lib/tasks/rspec.rake
... ... @@ -0,0 +1,165 @@
  1 +gem 'test-unit', '1.2.3' if RUBY_VERSION.to_f >= 1.9
  2 +
  3 +# Don't load rspec if running "rake gems:*"
  4 +unless ARGV.any? {|a| a =~ /^gems/}
  5 +
  6 +begin