rules 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (231) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/README.md +79 -0
  3. data/Rakefile +38 -0
  4. data/db/migrate/20120831163952_create_rules.rb +11 -0
  5. data/db/migrate/20120831173835_create_rule_sets.rb +10 -0
  6. data/lib/rules.rb +18 -0
  7. data/lib/rules/engine.rb +11 -0
  8. data/lib/rules/evaluators.rb +18 -0
  9. data/lib/rules/evaluators/definitions.rb +73 -0
  10. data/lib/rules/evaluators/evaluator.rb +25 -0
  11. data/lib/rules/extensions/active_admin/dsl.rb +31 -0
  12. data/lib/rules/has_rules.rb +24 -0
  13. data/lib/rules/parameters.rb +20 -0
  14. data/lib/rules/parameters/attribute.rb +16 -0
  15. data/lib/rules/parameters/constant.rb +25 -0
  16. data/lib/rules/parameters/constant_definitions.rb +15 -0
  17. data/lib/rules/parameters/parameter.rb +13 -0
  18. data/lib/rules/rule.rb +52 -0
  19. data/lib/rules/rule_set.rb +50 -0
  20. data/lib/rules/version.rb +3 -0
  21. data/lib/tasks/rules_tasks.rake +4 -0
  22. data/spec/dummy/README.rdoc +261 -0
  23. data/spec/dummy/Rakefile +7 -0
  24. data/spec/dummy/app/admin/dashboards.rb +33 -0
  25. data/spec/dummy/app/admin/orders.rb +30 -0
  26. data/spec/dummy/app/assets/images/edit_example.png +0 -0
  27. data/spec/dummy/app/assets/javascripts/active_admin.js +1 -0
  28. data/spec/dummy/app/assets/javascripts/application.js +15 -0
  29. data/spec/dummy/app/assets/stylesheets/active_admin.css.scss +29 -0
  30. data/spec/dummy/app/assets/stylesheets/application.css +13 -0
  31. data/spec/dummy/app/controllers/application_controller.rb +3 -0
  32. data/spec/dummy/app/controllers/orders_controller.rb +8 -0
  33. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  34. data/spec/dummy/app/models/admin_user.rb +11 -0
  35. data/spec/dummy/app/models/order.rb +20 -0
  36. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  37. data/spec/dummy/app/views/orders/show.html.haml +2 -0
  38. data/spec/dummy/config.ru +4 -0
  39. data/spec/dummy/config/application.rb +65 -0
  40. data/spec/dummy/config/boot.rb +10 -0
  41. data/spec/dummy/config/database.yml +25 -0
  42. data/spec/dummy/config/environment.rb +5 -0
  43. data/spec/dummy/config/environments/development.rb +37 -0
  44. data/spec/dummy/config/environments/production.rb +67 -0
  45. data/spec/dummy/config/environments/test.rb +37 -0
  46. data/spec/dummy/config/initializers/active_admin.rb +149 -0
  47. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  48. data/spec/dummy/config/initializers/devise.rb +232 -0
  49. data/spec/dummy/config/initializers/inflections.rb +15 -0
  50. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  51. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  52. data/spec/dummy/config/initializers/session_store.rb +8 -0
  53. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  54. data/spec/dummy/config/locales/devise.en.yml +58 -0
  55. data/spec/dummy/config/locales/en.yml +5 -0
  56. data/spec/dummy/config/routes.rb +9 -0
  57. data/spec/dummy/db/development.sqlite3 +0 -0
  58. data/spec/dummy/db/migrate/20120821181654_create_orders.rb +13 -0
  59. data/spec/dummy/db/migrate/20120831163952_create_rules.rb +11 -0
  60. data/spec/dummy/db/migrate/20120831173835_create_rule_sets.rb +10 -0
  61. data/spec/dummy/db/migrate/20120901044842_devise_create_admin_users.rb +52 -0
  62. data/spec/dummy/db/migrate/20120901044906_create_admin_notes.rb +17 -0
  63. data/spec/dummy/db/migrate/20120901044907_move_admin_notes_to_comments.rb +25 -0
  64. data/spec/dummy/db/production.sqlite3 +0 -0
  65. data/spec/dummy/db/schema.rb +75 -0
  66. data/spec/dummy/db/seeds.rb +1 -0
  67. data/spec/dummy/db/test.sqlite3 +0 -0
  68. data/spec/dummy/log/development.log +8764 -0
  69. data/spec/dummy/log/production.log +74 -0
  70. data/spec/dummy/log/test.log +1573 -0
  71. data/spec/dummy/public/404.html +26 -0
  72. data/spec/dummy/public/422.html +26 -0
  73. data/spec/dummy/public/500.html +25 -0
  74. data/spec/dummy/public/favicon.ico +0 -0
  75. data/spec/dummy/script/rails +6 -0
  76. data/spec/dummy/tmp/cache/assets/C58/950/sprockets%2F615625588c137a1529206d80ee81fe93 +0 -0
  77. data/spec/dummy/tmp/cache/assets/C83/FF0/sprockets%2F75b536e9b6927c15b60310fa867e3613 +0 -0
  78. data/spec/dummy/tmp/cache/assets/C88/FD0/sprockets%2F6c558405457e9b59062515dc86bfa252 +0 -0
  79. data/spec/dummy/tmp/cache/assets/C99/A50/sprockets%2Ffd135176f584f5f5658ef48f41187352 +0 -0
  80. data/spec/dummy/tmp/cache/assets/C9B/B40/sprockets%2F29dc70cbda38311141464e041655de41 +0 -0
  81. data/spec/dummy/tmp/cache/assets/C9F/2F0/sprockets%2Faf814c1513450b5466432d2a565ca5c6 +0 -0
  82. data/spec/dummy/tmp/cache/assets/CA2/8F0/sprockets%2Fa283030e028b24b4ba4084e067888c3e +0 -0
  83. data/spec/dummy/tmp/cache/assets/CA7/860/sprockets%2F0b1c90a9344b3c3989fc2153d0d63193 +0 -0
  84. data/spec/dummy/tmp/cache/assets/CAC/4A0/sprockets%2F3d00565c9e04f1bd481d33b4f1985706 +0 -0
  85. data/spec/dummy/tmp/cache/assets/CAD/F70/sprockets%2F5a1855f4cda19a255ffc802226735517 +0 -0
  86. data/spec/dummy/tmp/cache/assets/CAE/DA0/sprockets%2F9a133e6ab132f569c40b5e82188f4290 +0 -0
  87. data/spec/dummy/tmp/cache/assets/CB2/140/sprockets%2F035ac84d6c64495d0067b926533f8bc3 +0 -0
  88. data/spec/dummy/tmp/cache/assets/CB2/920/sprockets%2F2db5288c0689b237264d0fb22b74d981 +0 -0
  89. data/spec/dummy/tmp/cache/assets/CB8/A30/sprockets%2Ff35759652c08bb7b3921c434d9ee1654 +0 -0
  90. data/spec/dummy/tmp/cache/assets/CCA/AE0/sprockets%2Ff80b892078268a51ddf973986035bf9d +0 -0
  91. data/spec/dummy/tmp/cache/assets/CD0/AC0/sprockets%2F6f2c1b921c2b86e16aee3245772240c1 +0 -0
  92. data/spec/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953 +0 -0
  93. data/spec/dummy/tmp/cache/assets/CDB/040/sprockets%2Fc732474e67003a4eb840eb44c5ca9385 +0 -0
  94. data/spec/dummy/tmp/cache/assets/CE0/300/sprockets%2F79b0286bc0a316d639ed5f83b1d33763 +0 -0
  95. data/spec/dummy/tmp/cache/assets/CE4/D80/sprockets%2Fd7f4b155b13ea1d8578693e62b0e6463 +0 -0
  96. data/spec/dummy/tmp/cache/assets/CF9/580/sprockets%2F9b6f302133d13906b7d823b4ae14f0aa +0 -0
  97. data/spec/dummy/tmp/cache/assets/CFD/B50/sprockets%2Fb21fb4d7213b3bf64d6317b3f22584b1 +0 -0
  98. data/spec/dummy/tmp/cache/assets/CFE/450/sprockets%2F088e843f7fffd845821822c7668a4d7e +0 -0
  99. data/spec/dummy/tmp/cache/assets/CFE/5D0/sprockets%2F5e63c7f47b86e8916fe1b8f88f470370 +0 -0
  100. data/spec/dummy/tmp/cache/assets/CFE/D50/sprockets%2Fc912074248a7b0bdc219a5eac3c52348 +0 -0
  101. data/spec/dummy/tmp/cache/assets/D0B/650/sprockets%2Fb66b60c6b42330849f5b7449bbe108bd +0 -0
  102. data/spec/dummy/tmp/cache/assets/D0B/EB0/sprockets%2Fa18a9144dadd3f628d2f061f91190d65 +0 -0
  103. data/spec/dummy/tmp/cache/assets/D0E/820/sprockets%2F1611a9cc354f4e02c97d26b3c6ce7466 +0 -0
  104. data/spec/dummy/tmp/cache/assets/D11/FD0/sprockets%2Ff7129bbf85d84e8bc056543e20281e3b +0 -0
  105. data/spec/dummy/tmp/cache/assets/D24/B00/sprockets%2F671d6f261d89a29e918b1ec7818db6a9 +0 -0
  106. data/spec/dummy/tmp/cache/assets/D29/AE0/sprockets%2Fb62ea1b010afb027501b4f18b8dd3689 +0 -0
  107. data/spec/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
  108. data/spec/dummy/tmp/cache/assets/D38/540/sprockets%2F86e1ad844bc9df4491a2a52b870421db +0 -0
  109. data/spec/dummy/tmp/cache/assets/D38/5F0/sprockets%2F0c09a45e38408ec6e0e9caf206d5028d +0 -0
  110. data/spec/dummy/tmp/cache/assets/D3A/CE0/sprockets%2F238bf80bfbe1e2a5bb9280e62162584f +0 -0
  111. data/spec/dummy/tmp/cache/assets/D3B/000/sprockets%2F961758db39c6223d18ea6b7aeac400d5 +0 -0
  112. data/spec/dummy/tmp/cache/assets/D3B/F60/sprockets%2Ffd56cbfde039018718a0933340af6ef2 +0 -0
  113. data/spec/dummy/tmp/cache/assets/D41/AB0/sprockets%2Fd112ea59edbe4b7335549d814cb1d848 +0 -0
  114. data/spec/dummy/tmp/cache/assets/D47/050/sprockets%2F237eeefd847c43be2e7810a77e80841b +0 -0
  115. data/spec/dummy/tmp/cache/assets/D48/0D0/sprockets%2F1ef4ab19f690478ac62ad77fcb284447 +0 -0
  116. data/spec/dummy/tmp/cache/assets/D48/640/sprockets%2F9f4f18d910b678b1d0777e04cdaf6f24 +0 -0
  117. data/spec/dummy/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655 +0 -0
  118. data/spec/dummy/tmp/cache/assets/D59/D70/sprockets%2Fed9f0de1b65ae8d7ef89087c83728461 +0 -0
  119. data/spec/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6 +0 -0
  120. data/spec/dummy/tmp/cache/assets/D60/6C0/sprockets%2Fd7ef2595e5c50eb96e9d3c3d8698f481 +0 -0
  121. data/spec/dummy/tmp/cache/assets/D65/B10/sprockets%2Fca02dba972b587d3a69b8c32c7200fc6 +0 -0
  122. data/spec/dummy/tmp/cache/assets/D65/EE0/sprockets%2Fd9062d87143bb5c1d9d73c3ea02d7eb1 +0 -0
  123. data/spec/dummy/tmp/cache/assets/D66/2A0/sprockets%2F7b7cb56109acc9205fbbb792187ad04b +0 -0
  124. data/spec/dummy/tmp/cache/assets/D72/9E0/sprockets%2Fdf58dccde6a5e1266ba5c386149108c6 +0 -0
  125. data/spec/dummy/tmp/cache/assets/D84/0C0/sprockets%2Fe48907efa9d3370f9a2f687a1a7b8d8d +0 -0
  126. data/spec/dummy/tmp/cache/assets/D93/4C0/sprockets%2F857ecd2092cee11f740b3cf2e373ad2a +0 -0
  127. data/spec/dummy/tmp/cache/assets/D94/FA0/sprockets%2F8b190b3f72af75f09bfab1f354a0c37b +0 -0
  128. data/spec/dummy/tmp/cache/assets/D98/550/sprockets%2F69a91a7b4aca241c17daf6a78ac6845a +0 -0
  129. data/spec/dummy/tmp/cache/assets/D9E/530/sprockets%2F8dbb0027bd9ce6b96c81b82bdec17814 +0 -0
  130. data/spec/dummy/tmp/cache/assets/DAA/990/sprockets%2F8e0ca45c660183bfe809afc1f69bf9a9 +0 -0
  131. data/spec/dummy/tmp/cache/assets/DC1/C40/sprockets%2Fa8cbeabf3ef2d34b43be61671536f2a2 +0 -0
  132. data/spec/dummy/tmp/cache/assets/DC7/8B0/sprockets%2Ffad93382facdc50f097e26ebf19010ea +0 -0
  133. data/spec/dummy/tmp/cache/assets/DCE/350/sprockets%2F812b6c1998c5ad61096ae7b16cdaeeea +0 -0
  134. data/spec/dummy/tmp/cache/assets/DD3/370/sprockets%2Ff23609d51b09058fdd08daeecfd7e5e3 +0 -0
  135. data/spec/dummy/tmp/cache/assets/DD7/6A0/sprockets%2Fd5b1cca8d0835fbe9957aa4ee5f8333e +0 -0
  136. data/spec/dummy/tmp/cache/assets/DD8/440/sprockets%2F7edf42cfb3ac43c7cd4f63c3980d7c86 +0 -0
  137. data/spec/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994 +0 -0
  138. data/spec/dummy/tmp/cache/assets/DDE/420/sprockets%2Ffb8b186d5bf0307f86f65fc787d2adeb +0 -0
  139. data/spec/dummy/tmp/cache/assets/DF5/270/sprockets%2Fc7f64f609aceac43da16557daacc421f +0 -0
  140. data/spec/dummy/tmp/cache/assets/DF5/410/sprockets%2Fd6efccfb4bfeb13ed0125e8c53424a65 +0 -0
  141. data/spec/dummy/tmp/cache/assets/DFF/180/sprockets%2Fdc24014f1fcc77f40c5e7de188ad8ebd +0 -0
  142. data/spec/dummy/tmp/cache/assets/E03/290/sprockets%2Fd469f86939a1cbd52d9b9aaf1db22dae +0 -0
  143. data/spec/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
  144. data/spec/dummy/tmp/cache/assets/E07/7C0/sprockets%2Fcc5def6ed69cb6a1b7f6084992ed3ca1 +0 -0
  145. data/spec/dummy/tmp/cache/assets/ECA/140/sprockets%2Fd8ebea8564753ddfde91fadbdacc9f5b +0 -0
  146. data/spec/dummy/tmp/cache/sass/1a9fc2ebd62e6e7cb58441dc0293552ac07c99a9/_bourbon.scssc +0 -0
  147. data/spec/dummy/tmp/cache/sass/40a0b76d82cd847e80571abbfe75b703bdb6b77f/active_admin.css.scssc +0 -0
  148. data/spec/dummy/tmp/cache/sass/597823364192c14f6a72ee20d1a1496a722ab1f2/_all.css.scssc +0 -0
  149. data/spec/dummy/tmp/cache/sass/597823364192c14f6a72ee20d1a1496a722ab1f2/_buttons.css.scssc +0 -0
  150. data/spec/dummy/tmp/cache/sass/597823364192c14f6a72ee20d1a1496a722ab1f2/_gradients.css.scssc +0 -0
  151. data/spec/dummy/tmp/cache/sass/597823364192c14f6a72ee20d1a1496a722ab1f2/_icons.css.scssc +0 -0
  152. data/spec/dummy/tmp/cache/sass/597823364192c14f6a72ee20d1a1496a722ab1f2/_reset.css.scssc +0 -0
  153. data/spec/dummy/tmp/cache/sass/597823364192c14f6a72ee20d1a1496a722ab1f2/_rounded.css.scssc +0 -0
  154. data/spec/dummy/tmp/cache/sass/597823364192c14f6a72ee20d1a1496a722ab1f2/_sections.css.scssc +0 -0
  155. data/spec/dummy/tmp/cache/sass/597823364192c14f6a72ee20d1a1496a722ab1f2/_shadows.css.scssc +0 -0
  156. data/spec/dummy/tmp/cache/sass/597823364192c14f6a72ee20d1a1496a722ab1f2/_typography.scssc +0 -0
  157. data/spec/dummy/tmp/cache/sass/597823364192c14f6a72ee20d1a1496a722ab1f2/_utilities.scssc +0 -0
  158. data/spec/dummy/tmp/cache/sass/597823364192c14f6a72ee20d1a1496a722ab1f2/_variables.css.scssc +0 -0
  159. data/spec/dummy/tmp/cache/sass/6d594ee297c7ebeecae08432451ce722569d1a35/_footer.scssc +0 -0
  160. data/spec/dummy/tmp/cache/sass/6d594ee297c7ebeecae08432451ce722569d1a35/_main_structure.scssc +0 -0
  161. data/spec/dummy/tmp/cache/sass/6d594ee297c7ebeecae08432451ce722569d1a35/_title_bar.scssc +0 -0
  162. data/spec/dummy/tmp/cache/sass/7f31076cc0ed50f35bd0098f8e2a34720ee15633/_batch_actions.css.scssc +0 -0
  163. data/spec/dummy/tmp/cache/sass/7f31076cc0ed50f35bd0098f8e2a34720ee15633/_blank_slates.scssc +0 -0
  164. data/spec/dummy/tmp/cache/sass/7f31076cc0ed50f35bd0098f8e2a34720ee15633/_breadcrumbs.scssc +0 -0
  165. data/spec/dummy/tmp/cache/sass/7f31076cc0ed50f35bd0098f8e2a34720ee15633/_buttons.scssc +0 -0
  166. data/spec/dummy/tmp/cache/sass/7f31076cc0ed50f35bd0098f8e2a34720ee15633/_columns.scssc +0 -0
  167. data/spec/dummy/tmp/cache/sass/7f31076cc0ed50f35bd0098f8e2a34720ee15633/_comments.css.scssc +0 -0
  168. data/spec/dummy/tmp/cache/sass/7f31076cc0ed50f35bd0098f8e2a34720ee15633/_date_picker.css.scssc +0 -0
  169. data/spec/dummy/tmp/cache/sass/7f31076cc0ed50f35bd0098f8e2a34720ee15633/_dropdown_menu.scssc +0 -0
  170. data/spec/dummy/tmp/cache/sass/7f31076cc0ed50f35bd0098f8e2a34720ee15633/_flash_messages.css.scssc +0 -0
  171. data/spec/dummy/tmp/cache/sass/7f31076cc0ed50f35bd0098f8e2a34720ee15633/_grid.scssc +0 -0
  172. data/spec/dummy/tmp/cache/sass/7f31076cc0ed50f35bd0098f8e2a34720ee15633/_links.scssc +0 -0
  173. data/spec/dummy/tmp/cache/sass/7f31076cc0ed50f35bd0098f8e2a34720ee15633/_pagination.scssc +0 -0
  174. data/spec/dummy/tmp/cache/sass/7f31076cc0ed50f35bd0098f8e2a34720ee15633/_panels.scssc +0 -0
  175. data/spec/dummy/tmp/cache/sass/7f31076cc0ed50f35bd0098f8e2a34720ee15633/_popovers.css.scssc +0 -0
  176. data/spec/dummy/tmp/cache/sass/7f31076cc0ed50f35bd0098f8e2a34720ee15633/_scopes.scssc +0 -0
  177. data/spec/dummy/tmp/cache/sass/7f31076cc0ed50f35bd0098f8e2a34720ee15633/_status_tags.scssc +0 -0
  178. data/spec/dummy/tmp/cache/sass/7f31076cc0ed50f35bd0098f8e2a34720ee15633/_table_tools.css.scssc +0 -0
  179. data/spec/dummy/tmp/cache/sass/7f31076cc0ed50f35bd0098f8e2a34720ee15633/_tables.css.scssc +0 -0
  180. data/spec/dummy/tmp/cache/sass/89a136914378618e18c0f75bc8c0f78e84403b0f/_base.css.scssc +0 -0
  181. data/spec/dummy/tmp/cache/sass/89a136914378618e18c0f75bc8c0f78e84403b0f/_forms.css.scssc +0 -0
  182. data/spec/dummy/tmp/cache/sass/89a136914378618e18c0f75bc8c0f78e84403b0f/_header.css.scssc +0 -0
  183. data/spec/dummy/tmp/cache/sass/89a136914378618e18c0f75bc8c0f78e84403b0f/_mixins.css.scssc +0 -0
  184. data/spec/dummy/tmp/cache/sass/89a136914378618e18c0f75bc8c0f78e84403b0f/_typography.css.scssc +0 -0
  185. data/spec/dummy/tmp/cache/sass/89a136914378618e18c0f75bc8c0f78e84403b0f/print.css.scssc +0 -0
  186. data/spec/dummy/tmp/cache/sass/a28435efd4cb26f8ebc9e55bbaf23e3537a13190/_button.scssc +0 -0
  187. data/spec/dummy/tmp/cache/sass/a28435efd4cb26f8ebc9e55bbaf23e3537a13190/_clearfix.scssc +0 -0
  188. data/spec/dummy/tmp/cache/sass/a28435efd4cb26f8ebc9e55bbaf23e3537a13190/_font-face.scssc +0 -0
  189. data/spec/dummy/tmp/cache/sass/a28435efd4cb26f8ebc9e55bbaf23e3537a13190/_font-family.scssc +0 -0
  190. data/spec/dummy/tmp/cache/sass/a28435efd4cb26f8ebc9e55bbaf23e3537a13190/_hide-text.scssc +0 -0
  191. data/spec/dummy/tmp/cache/sass/a28435efd4cb26f8ebc9e55bbaf23e3537a13190/_html5-input-types.scssc +0 -0
  192. data/spec/dummy/tmp/cache/sass/a28435efd4cb26f8ebc9e55bbaf23e3537a13190/_position.scssc +0 -0
  193. data/spec/dummy/tmp/cache/sass/a28435efd4cb26f8ebc9e55bbaf23e3537a13190/_timing-functions.scssc +0 -0
  194. data/spec/dummy/tmp/cache/sass/bb2f93296c9b1e89237438ea63572f38aae290c3/_deprecated-webkit-gradient.scssc +0 -0
  195. data/spec/dummy/tmp/cache/sass/bb2f93296c9b1e89237438ea63572f38aae290c3/_flex-grid.scssc +0 -0
  196. data/spec/dummy/tmp/cache/sass/bb2f93296c9b1e89237438ea63572f38aae290c3/_grid-width.scssc +0 -0
  197. data/spec/dummy/tmp/cache/sass/bb2f93296c9b1e89237438ea63572f38aae290c3/_linear-gradient.scssc +0 -0
  198. data/spec/dummy/tmp/cache/sass/bb2f93296c9b1e89237438ea63572f38aae290c3/_modular-scale.scssc +0 -0
  199. data/spec/dummy/tmp/cache/sass/bb2f93296c9b1e89237438ea63572f38aae290c3/_radial-gradient.scssc +0 -0
  200. data/spec/dummy/tmp/cache/sass/bb2f93296c9b1e89237438ea63572f38aae290c3/_render-gradients.scssc +0 -0
  201. data/spec/dummy/tmp/cache/sass/bb2f93296c9b1e89237438ea63572f38aae290c3/_tint-shade.scssc +0 -0
  202. data/spec/dummy/tmp/cache/sass/bb2f93296c9b1e89237438ea63572f38aae290c3/_transition-property-name.scssc +0 -0
  203. data/spec/dummy/tmp/cache/sass/da77e6f9a782ec4d4cbe7e3a439e89684c300b51/_animation.scssc +0 -0
  204. data/spec/dummy/tmp/cache/sass/da77e6f9a782ec4d4cbe7e3a439e89684c300b51/_appearance.scssc +0 -0
  205. data/spec/dummy/tmp/cache/sass/da77e6f9a782ec4d4cbe7e3a439e89684c300b51/_background-image.scssc +0 -0
  206. data/spec/dummy/tmp/cache/sass/da77e6f9a782ec4d4cbe7e3a439e89684c300b51/_background-size.scssc +0 -0
  207. data/spec/dummy/tmp/cache/sass/da77e6f9a782ec4d4cbe7e3a439e89684c300b51/_background.scssc +0 -0
  208. data/spec/dummy/tmp/cache/sass/da77e6f9a782ec4d4cbe7e3a439e89684c300b51/_border-image.scssc +0 -0
  209. data/spec/dummy/tmp/cache/sass/da77e6f9a782ec4d4cbe7e3a439e89684c300b51/_border-radius.scssc +0 -0
  210. data/spec/dummy/tmp/cache/sass/da77e6f9a782ec4d4cbe7e3a439e89684c300b51/_box-shadow.scssc +0 -0
  211. data/spec/dummy/tmp/cache/sass/da77e6f9a782ec4d4cbe7e3a439e89684c300b51/_box-sizing.scssc +0 -0
  212. data/spec/dummy/tmp/cache/sass/da77e6f9a782ec4d4cbe7e3a439e89684c300b51/_columns.scssc +0 -0
  213. data/spec/dummy/tmp/cache/sass/da77e6f9a782ec4d4cbe7e3a439e89684c300b51/_flex-box.scssc +0 -0
  214. data/spec/dummy/tmp/cache/sass/da77e6f9a782ec4d4cbe7e3a439e89684c300b51/_inline-block.scssc +0 -0
  215. data/spec/dummy/tmp/cache/sass/da77e6f9a782ec4d4cbe7e3a439e89684c300b51/_linear-gradient.scssc +0 -0
  216. data/spec/dummy/tmp/cache/sass/da77e6f9a782ec4d4cbe7e3a439e89684c300b51/_prefixer.scssc +0 -0
  217. data/spec/dummy/tmp/cache/sass/da77e6f9a782ec4d4cbe7e3a439e89684c300b51/_radial-gradient.scssc +0 -0
  218. data/spec/dummy/tmp/cache/sass/da77e6f9a782ec4d4cbe7e3a439e89684c300b51/_transform.scssc +0 -0
  219. data/spec/dummy/tmp/cache/sass/da77e6f9a782ec4d4cbe7e3a439e89684c300b51/_transition.scssc +0 -0
  220. data/spec/dummy/tmp/cache/sass/da77e6f9a782ec4d4cbe7e3a439e89684c300b51/_user-select.scssc +0 -0
  221. data/spec/dummy/tmp/cache/sass/ee5b745f862b39ff22bf2068a6582c3ee05d1a79/_dashboard.scssc +0 -0
  222. data/spec/dummy/tmp/cache/sass/ee5b745f862b39ff22bf2068a6582c3ee05d1a79/_logged_out.scssc +0 -0
  223. data/spec/dummy/tmp/pids/server.pid +1 -0
  224. data/spec/rules/evaluators/definitions_spec.rb +41 -0
  225. data/spec/rules/evaluators_spec.rb +32 -0
  226. data/spec/rules/parameters/attribute_spec.rb +12 -0
  227. data/spec/rules/parameters_spec.rb +5 -0
  228. data/spec/rules/rule_set_spec.rb +90 -0
  229. data/spec/rules/rule_spec.rb +188 -0
  230. data/spec/spec_helper.rb +38 -0
  231. metadata +519 -0
@@ -0,0 +1,30 @@
1
+ ActiveAdmin.register Order do
2
+ show do |f|
3
+ attributes_table do
4
+ row :id
5
+ row :quantity
6
+ row :price
7
+ row :customer
8
+ row :placed
9
+ row :shipped
10
+ row :created_at
11
+ row :updated_at
12
+ end
13
+
14
+ show_rules
15
+ end
16
+
17
+ form do |f|
18
+ f.inputs 'Details' do
19
+ f.input :quantity
20
+ f.input :price
21
+ f.input :customer
22
+ f.input :placed
23
+ f.input :shipped
24
+ end
25
+
26
+ f.has_rules
27
+
28
+ f.buttons
29
+ end
30
+ end
@@ -0,0 +1 @@
1
+ //= require active_admin/base
@@ -0,0 +1,15 @@
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 jquery
14
+ //= require jquery_ujs
15
+ //= require_tree .
@@ -0,0 +1,29 @@
1
+ // SASS variable overrides must be declared before loading up Active Admin's styles.
2
+ //
3
+ // To view the variables that Active Admin provides, take a look at
4
+ // `app/assets/stylesheets/active_admin/mixins/_variables.css.scss` in the
5
+ // Active Admin source.
6
+ //
7
+ // For example, to change the sidebar width:
8
+ // $sidebar-width: 242px;
9
+
10
+ // Active Admin's got SASS!
11
+ @import "active_admin/mixins";
12
+ @import "active_admin/base";
13
+
14
+ // Overriding any non-variable SASS must be done after the fact.
15
+ // For example, to change the default status-tag color:
16
+ //
17
+ // body.active_admin {
18
+ // .status_tag { background: #6090DB; }
19
+ // }
20
+ //
21
+ // Notice that Active Admin CSS rules are nested within a
22
+ // 'body.active_admin' selector to prevent conflicts with
23
+ // other pages in the app. It is best to wrap your changes in a
24
+ // namespace so they are properly recognized. You have options
25
+ // if you e.g. want different styles for different namespaces:
26
+ //
27
+ // .active_admin applies to any Active Admin namespace
28
+ // .admin_namespace applies to the admin namespace (eg: /admin)
29
+ // .other_namespace applies to a custom namespace named other (eg: /other)
@@ -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,3 @@
1
+ class ApplicationController < ActionController::Base
2
+ protect_from_forgery
3
+ end
@@ -0,0 +1,8 @@
1
+ class OrdersController < ApplicationController
2
+ def show
3
+ @order = Order.last || Order.create!
4
+ end
5
+
6
+ def create
7
+ end
8
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
@@ -0,0 +1,11 @@
1
+ class AdminUser < ActiveRecord::Base
2
+ # Include default devise modules. Others available are:
3
+ # :token_authenticatable, :confirmable,
4
+ # :lockable, :timeoutable and :omniauthable
5
+ devise :database_authenticatable,
6
+ :recoverable, :rememberable, :trackable, :validatable
7
+
8
+ # Setup accessible (or protected) attributes for your model
9
+ attr_accessible :email, :password, :password_confirmation, :remember_me
10
+ # attr_accessible :title, :body
11
+ end
@@ -0,0 +1,20 @@
1
+ class Order < ActiveRecord::Base
2
+ attr_accessible :customer, :placed, :price, :quantity, :shipped
3
+
4
+ include Rules::HasRules
5
+
6
+ has_rule_attributes({
7
+ customer_email: {
8
+ name: 'customer email address'
9
+ },
10
+ order_price: {
11
+ name: 'order price'
12
+ }
13
+ })
14
+
15
+ def check_if_valid
16
+ evaluate \
17
+ customer: customer,
18
+ price: price
19
+ end
20
+ end
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Dummy</title>
5
+ <%= stylesheet_link_tag "application", :media => "all" %>
6
+ <%= javascript_include_tag "application" %>
7
+ <%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+
11
+ <%= yield %>
12
+
13
+ </body>
14
+ </html>
@@ -0,0 +1,2 @@
1
+ = form_for @order do |f|
2
+ = rules_for @order.rule_set
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run Dummy::Application
@@ -0,0 +1,65 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ # Pick the frameworks you want:
4
+ require "active_record/railtie"
5
+ require "action_controller/railtie"
6
+ require "action_mailer/railtie"
7
+ require "active_resource/railtie"
8
+ require "sprockets/railtie"
9
+ # require "rails/test_unit/railtie"
10
+
11
+ Bundler.require
12
+ require "rules"
13
+
14
+ module Dummy
15
+ class Application < Rails::Application
16
+ # Settings in config/environments/* take precedence over those specified here.
17
+ # Application configuration should go into files in config/initializers
18
+ # -- all .rb files in that directory are automatically loaded.
19
+
20
+ # Custom directories with classes and modules you want to be autoloadable.
21
+ # config.autoload_paths += %W(#{config.root}/extras)
22
+
23
+ # Only load the plugins named here, in the order given (default is alphabetical).
24
+ # :all can be used as a placeholder for all plugins not explicitly named.
25
+ # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
26
+
27
+ # Activate observers that should always be running.
28
+ # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
29
+
30
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
31
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
32
+ # config.time_zone = 'Central Time (US & Canada)'
33
+
34
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
35
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
36
+ # config.i18n.default_locale = :de
37
+
38
+ # Configure the default encoding used in templates for Ruby 1.9.
39
+ config.encoding = "utf-8"
40
+
41
+ # Configure sensitive parameters which will be filtered from the log file.
42
+ config.filter_parameters += [:password]
43
+
44
+ # Enable escaping HTML in JSON.
45
+ config.active_support.escape_html_entities_in_json = true
46
+
47
+ # Use SQL instead of Active Record's schema dumper when creating the database.
48
+ # This is necessary if your schema can't be completely dumped by the schema dumper,
49
+ # like if you have constraints or database-specific column types
50
+ # config.active_record.schema_format = :sql
51
+
52
+ # Enforce whitelist mode for mass assignment.
53
+ # This will create an empty whitelist of attributes available for mass-assignment for all models
54
+ # in your app. As such, your models will need to explicitly whitelist or blacklist accessible
55
+ # parameters by using an attr_accessible or attr_protected declaration.
56
+ config.active_record.whitelist_attributes = true
57
+
58
+ # Enable the asset pipeline
59
+ config.assets.enabled = true
60
+
61
+ # Version of your assets, change this if you want to expire all your assets
62
+ config.assets.version = '1.0'
63
+ end
64
+ end
65
+
@@ -0,0 +1,10 @@
1
+ require 'rubygems'
2
+ gemfile = File.expand_path('../../../../Gemfile', __FILE__)
3
+
4
+ if File.exist?(gemfile)
5
+ ENV['BUNDLE_GEMFILE'] = gemfile
6
+ require 'bundler'
7
+ Bundler.setup
8
+ end
9
+
10
+ $:.unshift File.expand_path('../../../../lib', __FILE__)
@@ -0,0 +1,25 @@
1
+ # SQLite version 3.x
2
+ # gem install sqlite3
3
+ #
4
+ # Ensure the SQLite 3 gem is defined in your Gemfile
5
+ # gem 'sqlite3'
6
+ development:
7
+ adapter: sqlite3
8
+ database: db/development.sqlite3
9
+ pool: 5
10
+ timeout: 5000
11
+
12
+ # Warning: The database defined as "test" will be erased and
13
+ # re-generated from your development database when you run "rake".
14
+ # Do not set this db to the same as development or production.
15
+ test:
16
+ adapter: sqlite3
17
+ database: db/test.sqlite3
18
+ pool: 5
19
+ timeout: 5000
20
+
21
+ production:
22
+ adapter: sqlite3
23
+ database: db/production.sqlite3
24
+ pool: 5
25
+ timeout: 5000
@@ -0,0 +1,5 @@
1
+ # Load the rails application
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the rails application
5
+ Dummy::Application.initialize!
@@ -0,0 +1,37 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # In the development environment your application's code is reloaded on
5
+ # every request. This slows down response time but is perfect for development
6
+ # since you don't have to restart the web server when you make code changes.
7
+ config.cache_classes = false
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.consider_all_requests_local = 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
18
+
19
+ # Print deprecation notices to the Rails logger
20
+ config.active_support.deprecation = :log
21
+
22
+ # Only use best-standards-support built into browsers
23
+ config.action_dispatch.best_standards_support = :builtin
24
+
25
+ # Raise exception on mass assignment protection for Active Record models
26
+ config.active_record.mass_assignment_sanitizer = :strict
27
+
28
+ # Log the query plan for queries taking more than this (works
29
+ # with SQLite, MySQL, and PostgreSQL)
30
+ config.active_record.auto_explain_threshold_in_seconds = 0.5
31
+
32
+ # Do not compress assets
33
+ config.assets.compress = false
34
+
35
+ # Expands the lines which load the assets
36
+ config.assets.debug = true
37
+ end
@@ -0,0 +1,67 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
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.consider_all_requests_local = false
9
+ config.action_controller.perform_caching = true
10
+
11
+ # Disable Rails's static asset server (Apache or nginx will already do this)
12
+ config.serve_static_assets = false
13
+
14
+ # Compress JavaScripts and CSS
15
+ config.assets.compress = true
16
+
17
+ # Don't fallback to assets pipeline if a precompiled asset is missed
18
+ config.assets.compile = false
19
+
20
+ # Generate digests for assets URLs
21
+ config.assets.digest = true
22
+
23
+ # Defaults to nil and saved in location specified by config.assets.prefix
24
+ # config.assets.manifest = YOUR_PATH
25
+
26
+ # Specifies the header that your server uses for sending files
27
+ # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
28
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
29
+
30
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
31
+ # config.force_ssl = true
32
+
33
+ # See everything in the log (default is :info)
34
+ # config.log_level = :debug
35
+
36
+ # Prepend all log lines with the following tags
37
+ # config.log_tags = [ :subdomain, :uuid ]
38
+
39
+ # Use a different logger for distributed setups
40
+ # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
41
+
42
+ # Use a different cache store in production
43
+ # config.cache_store = :mem_cache_store
44
+
45
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server
46
+ # config.action_controller.asset_host = "http://assets.example.com"
47
+
48
+ # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
49
+ # config.assets.precompile += %w( search.js )
50
+
51
+ # Disable delivery errors, bad email addresses will be ignored
52
+ # config.action_mailer.raise_delivery_errors = false
53
+
54
+ # Enable threaded mode
55
+ # config.threadsafe!
56
+
57
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
58
+ # the I18n.default_locale when a translation can not be found)
59
+ config.i18n.fallbacks = true
60
+
61
+ # Send deprecation notices to registered listeners
62
+ config.active_support.deprecation = :notify
63
+
64
+ # Log the query plan for queries taking more than this (works
65
+ # with SQLite, MySQL, and PostgreSQL)
66
+ # config.active_record.auto_explain_threshold_in_seconds = 0.5
67
+ end
@@ -0,0 +1,37 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # The test environment is used exclusively to run your application's
5
+ # test suite. You never need to work with it otherwise. Remember that
6
+ # your test database is "scratch space" for the test suite and is wiped
7
+ # and recreated between test runs. Don't rely on the data there!
8
+ config.cache_classes = true
9
+
10
+ # Configure static asset server for tests with Cache-Control for performance
11
+ config.serve_static_assets = true
12
+ config.static_cache_control = "public, max-age=3600"
13
+
14
+ # Log error messages when you accidentally call methods on nil
15
+ config.whiny_nils = true
16
+
17
+ # Show full error reports and disable caching
18
+ config.consider_all_requests_local = true
19
+ config.action_controller.perform_caching = false
20
+
21
+ # Raise exceptions instead of rendering exception templates
22
+ config.action_dispatch.show_exceptions = false
23
+
24
+ # Disable request forgery protection in test environment
25
+ config.action_controller.allow_forgery_protection = false
26
+
27
+ # Tell Action Mailer not to deliver emails to the real world.
28
+ # The :test delivery method accumulates sent emails in the
29
+ # ActionMailer::Base.deliveries array.
30
+ config.action_mailer.delivery_method = :test
31
+
32
+ # Raise exception on mass assignment protection for Active Record models
33
+ config.active_record.mass_assignment_sanitizer = :strict
34
+
35
+ # Print deprecation notices to the stderr
36
+ config.active_support.deprecation = :stderr
37
+ end
@@ -0,0 +1,149 @@
1
+ ActiveAdmin.setup do |config|
2
+
3
+ # == Site Title
4
+ #
5
+ # Set the title that is displayed on the main layout
6
+ # for each of the active admin pages.
7
+ #
8
+ config.site_title = "Dummy"
9
+
10
+ # Set the link url for the title. For example, to take
11
+ # users to your main site. Defaults to no link.
12
+ #
13
+ # config.site_title_link = "/"
14
+
15
+ # Set an optional image to be displayed for the header
16
+ # instead of a string (overrides :site_title)
17
+ #
18
+ # Note: Recommended image height is 21px to properly fit in the header
19
+ #
20
+ # config.site_title_image = "/images/logo.png"
21
+
22
+ # == Default Namespace
23
+ #
24
+ # Set the default namespace each administration resource
25
+ # will be added to.
26
+ #
27
+ # eg:
28
+ # config.default_namespace = :hello_world
29
+ #
30
+ # This will create resources in the HelloWorld module and
31
+ # will namespace routes to /hello_world/*
32
+ #
33
+ # To set no namespace by default, use:
34
+ # config.default_namespace = false
35
+ #
36
+ # Default:
37
+ # config.default_namespace = :admin
38
+ #
39
+ # You can customize the settings for each namespace by using
40
+ # a namespace block. For example, to change the site title
41
+ # within a namespace:
42
+ #
43
+ # config.namespace :admin do |admin|
44
+ # admin.site_title = "Custom Admin Title"
45
+ # end
46
+ #
47
+ # This will ONLY change the title for the admin section. Other
48
+ # namespaces will continue to use the main "site_title" configuration.
49
+
50
+ # == User Authentication
51
+ #
52
+ # Active Admin will automatically call an authentication
53
+ # method in a before filter of all controller actions to
54
+ # ensure that there is a currently logged in admin user.
55
+ #
56
+ # This setting changes the method which Active Admin calls
57
+ # within the controller.
58
+ config.authentication_method = :authenticate_admin_user!
59
+
60
+
61
+ # == Current User
62
+ #
63
+ # Active Admin will associate actions with the current
64
+ # user performing them.
65
+ #
66
+ # This setting changes the method which Active Admin calls
67
+ # to return the currently logged in user.
68
+ config.current_user_method = :current_admin_user
69
+
70
+
71
+ # == Logging Out
72
+ #
73
+ # Active Admin displays a logout link on each screen. These
74
+ # settings configure the location and method used for the link.
75
+ #
76
+ # This setting changes the path where the link points to. If it's
77
+ # a string, the strings is used as the path. If it's a Symbol, we
78
+ # will call the method to return the path.
79
+ #
80
+ # Default:
81
+ config.logout_link_path = :destroy_admin_user_session_path
82
+
83
+ # This setting changes the http method used when rendering the
84
+ # link. For example :get, :delete, :put, etc..
85
+ #
86
+ # Default:
87
+ # config.logout_link_method = :get
88
+
89
+ # == Root
90
+ #
91
+ # Set the action to call for the root path. You can set different
92
+ # roots for each namespace.
93
+ #
94
+ # Default:
95
+ # config.root_to = 'dashboard#index'
96
+
97
+ # == Admin Comments
98
+ #
99
+ # Admin comments allow you to add comments to any model for admin use.
100
+ # Admin comments are enabled by default.
101
+ #
102
+ # Default:
103
+ # config.allow_comments = true
104
+ #
105
+ # You can turn them on and off for any given namespace by using a
106
+ # namespace config block.
107
+ #
108
+ # Eg:
109
+ # config.namespace :without_comments do |without_comments|
110
+ # without_comments.allow_comments = false
111
+ # end
112
+
113
+
114
+ # == Batch Actions
115
+ #
116
+ # Enable and disable Batch Actions
117
+ #
118
+ config.batch_actions = true
119
+
120
+
121
+ # == Controller Filters
122
+ #
123
+ # You can add before, after and around filters to all of your
124
+ # Active Admin resources from here.
125
+ #
126
+ # config.before_filter :do_something_awesome
127
+
128
+
129
+ # == Register Stylesheets & Javascripts
130
+ #
131
+ # We recommend using the built in Active Admin layout and loading
132
+ # up your own stylesheets / javascripts to customize the look
133
+ # and feel.
134
+ #
135
+ # To load a stylesheet:
136
+ # config.register_stylesheet 'my_stylesheet.css'
137
+
138
+ # You can provide an options hash for more control, which is passed along to stylesheet_link_tag():
139
+ # config.register_stylesheet 'my_print_stylesheet.css', :media => :print
140
+ #
141
+ # To load a javascript file:
142
+ # config.register_javascript 'my_javascript.js'
143
+
144
+
145
+ # == CSV options
146
+ #
147
+ # Set the CSV builder separator (default is ",")
148
+ # config.csv_column_separator = ','
149
+ end