rules_view 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 (169) hide show
  1. data/.document +5 -0
  2. data/.gitignore +21 -0
  3. data/LICENSE +20 -0
  4. data/README.textile +129 -0
  5. data/Rakefile +47 -0
  6. data/VERSION +1 -0
  7. data/app/views/layouts/rules_view.html.erb +43 -0
  8. data/app/views/re_view/template.html.erb +196 -0
  9. data/autotest/discover.rb +2 -0
  10. data/generators/install_generator.rb +41 -0
  11. data/generators/layout_generator.rb +41 -0
  12. data/generators/manifests/application.rb +116 -0
  13. data/generators/manifests/application.yml +8 -0
  14. data/generators/manifests/layout.rb +17 -0
  15. data/generators/manifests/layout.yml +5 -0
  16. data/generators/manifests/templates/app/views/layouts/rules_view_layout.html.erb +47 -0
  17. data/generators/manifests/templates/config/initializers/rules_view.rb +1 -0
  18. data/generators/manifests/templates/doc/README.rules_view +97 -0
  19. data/generators/manifests/templates/public/javascripts/rules_view/jquery-1.4.2.min.js +154 -0
  20. data/generators/manifests/templates/public/javascripts/rules_view/jquery.autocomplete.pack.js +13 -0
  21. data/generators/manifests/templates/public/javascripts/rules_view/jquery.blockUI.js +486 -0
  22. data/generators/manifests/templates/public/javascripts/rules_view/jquery.fancybox-1.3.1.js +1077 -0
  23. data/generators/manifests/templates/public/javascripts/rules_view/re_view.js +148 -0
  24. data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/ie.css +35 -0
  25. data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/buttons/icons/cross.png +0 -0
  26. data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/buttons/icons/key.png +0 -0
  27. data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/buttons/icons/tick.png +0 -0
  28. data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/buttons/readme.txt +32 -0
  29. data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/buttons/screen.css +97 -0
  30. data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/fancy-type/readme.txt +14 -0
  31. data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/fancy-type/screen.css +71 -0
  32. data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/link-icons/icons/doc.png +0 -0
  33. data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/link-icons/icons/email.png +0 -0
  34. data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/link-icons/icons/external.png +0 -0
  35. data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/link-icons/icons/feed.png +0 -0
  36. data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/link-icons/icons/im.png +0 -0
  37. data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/link-icons/icons/pdf.png +0 -0
  38. data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/link-icons/icons/visited.png +0 -0
  39. data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/link-icons/icons/xls.png +0 -0
  40. data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/link-icons/readme.txt +18 -0
  41. data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/link-icons/screen.css +40 -0
  42. data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/rtl/readme.txt +10 -0
  43. data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/rtl/screen.css +110 -0
  44. data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/print.css +29 -0
  45. data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/screen.css +258 -0
  46. data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/src/forms.css +65 -0
  47. data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/src/grid.css +280 -0
  48. data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/src/grid.png +0 -0
  49. data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/src/ie.css +76 -0
  50. data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/src/print.css +85 -0
  51. data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/src/reset.css +45 -0
  52. data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/src/typography.css +106 -0
  53. data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/blank.gif +0 -0
  54. data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_close.png +0 -0
  55. data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_loading.png +0 -0
  56. data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_nav_left.png +0 -0
  57. data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_nav_right.png +0 -0
  58. data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_shadow_e.png +0 -0
  59. data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_shadow_n.png +0 -0
  60. data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_shadow_ne.png +0 -0
  61. data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_shadow_nw.png +0 -0
  62. data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_shadow_s.png +0 -0
  63. data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_shadow_se.png +0 -0
  64. data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_shadow_sw.png +0 -0
  65. data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_shadow_w.png +0 -0
  66. data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_title_left.png +0 -0
  67. data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_title_main.png +0 -0
  68. data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_title_over.png +0 -0
  69. data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_title_right.png +0 -0
  70. data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancybox-x.png +0 -0
  71. data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancybox-y.png +0 -0
  72. data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancybox.png +0 -0
  73. data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/jquery.fancybox-1.3.1.css +363 -0
  74. data/generators/manifests/templates/public/stylesheets/rules_view/images/re_view_box/shadowbox.png +0 -0
  75. data/generators/manifests/templates/public/stylesheets/rules_view/images/re_view_box/whitebox.jpg +0 -0
  76. data/generators/manifests/templates/public/stylesheets/rules_view/images/re_view_button/checked-off.gif +0 -0
  77. data/generators/manifests/templates/public/stylesheets/rules_view/images/re_view_button/checked-on.gif +0 -0
  78. data/generators/manifests/templates/public/stylesheets/rules_view/images/re_view_button/icon-add.png +0 -0
  79. data/generators/manifests/templates/public/stylesheets/rules_view/images/re_view_button/icon-delete.png +0 -0
  80. data/generators/manifests/templates/public/stylesheets/rules_view/images/re_view_button/list-add.png +0 -0
  81. data/generators/manifests/templates/public/stylesheets/rules_view/images/re_view_button/list-remove.png +0 -0
  82. data/generators/manifests/templates/public/stylesheets/rules_view/images/re_view_button/list-select.png +0 -0
  83. data/generators/manifests/templates/public/stylesheets/rules_view/images/re_view_button/oval-blue-left.gif +0 -0
  84. data/generators/manifests/templates/public/stylesheets/rules_view/images/re_view_button/oval-blue-right.gif +0 -0
  85. data/generators/manifests/templates/public/stylesheets/rules_view/images/re_view_button/oval-gray-left.gif +0 -0
  86. data/generators/manifests/templates/public/stylesheets/rules_view/images/re_view_button/oval-gray-right.gif +0 -0
  87. data/generators/manifests/templates/public/stylesheets/rules_view/images/re_view_button/oval-green-left.gif +0 -0
  88. data/generators/manifests/templates/public/stylesheets/rules_view/images/re_view_button/oval-green-right.gif +0 -0
  89. data/generators/manifests/templates/public/stylesheets/rules_view/images/re_view_button/oval-orange-left.gif +0 -0
  90. data/generators/manifests/templates/public/stylesheets/rules_view/images/re_view_button/oval-orange-right.gif +0 -0
  91. data/generators/manifests/templates/public/stylesheets/rules_view/images/re_view_button/oval-red-left.gif +0 -0
  92. data/generators/manifests/templates/public/stylesheets/rules_view/images/re_view_button/oval-red-right.gif +0 -0
  93. data/generators/manifests/templates/public/stylesheets/rules_view/images/re_view_error/re-alert-close.png +0 -0
  94. data/generators/manifests/templates/public/stylesheets/rules_view/images/re_view_navigate/breadcrumb.png +0 -0
  95. data/generators/manifests/templates/public/stylesheets/rules_view/jquery.autocomplete.css +53 -0
  96. data/generators/manifests/templates/public/stylesheets/rules_view/rules_view.css +738 -0
  97. data/init.rb +1 -0
  98. data/lib/rules_view/alerts.rb +51 -0
  99. data/lib/rules_view/boxes.rb +25 -0
  100. data/lib/rules_view/buttons.rb +113 -0
  101. data/lib/rules_view/config.rb +21 -0
  102. data/lib/rules_view/defer.rb +30 -0
  103. data/lib/rules_view/engine.rb +28 -0
  104. data/lib/rules_view/form_builder.rb +62 -0
  105. data/lib/rules_view/form_fields.rb +41 -0
  106. data/lib/rules_view/form_styles.rb +112 -0
  107. data/lib/rules_view/model_loader.rb +64 -0
  108. data/lib/rules_view/navigate.rb +40 -0
  109. data/lib/rules_view.rb +20 -0
  110. data/rules_view.gemspec +239 -0
  111. data/spec/lib/rules_view/alerts_spec.rb +145 -0
  112. data/spec/lib/rules_view/boxes_spec.rb +49 -0
  113. data/spec/lib/rules_view/buttons_spec.rb +184 -0
  114. data/spec/lib/rules_view/defer_spec.rb +90 -0
  115. data/spec/lib/rules_view/form_builder_fields_spec.rb +184 -0
  116. data/spec/lib/rules_view/form_builder_spec.rb +19 -0
  117. data/spec/lib/rules_view/form_fields_spec.rb +219 -0
  118. data/spec/lib/rules_view/form_styles_spec.rb +290 -0
  119. data/spec/lib/rules_view/model_loader_spec.rb +202 -0
  120. data/spec/lib/rules_view/navigate_spec.rb +61 -0
  121. data/spec/rails_3_0_0_root/.gitignore +4 -0
  122. data/spec/rails_3_0_0_root/.rspec +1 -0
  123. data/spec/rails_3_0_0_root/Gemfile +13 -0
  124. data/spec/rails_3_0_0_root/Gemfile.lock +101 -0
  125. data/spec/rails_3_0_0_root/README +256 -0
  126. data/spec/rails_3_0_0_root/Rakefile +7 -0
  127. data/spec/rails_3_0_0_root/app/controllers/application_controller.rb +3 -0
  128. data/spec/rails_3_0_0_root/app/helpers/application_helper.rb +2 -0
  129. data/spec/rails_3_0_0_root/app/views/layouts/application.html.erb +14 -0
  130. data/spec/rails_3_0_0_root/autotest/discover.rb +2 -0
  131. data/spec/rails_3_0_0_root/config/application.rb +42 -0
  132. data/spec/rails_3_0_0_root/config/boot.rb +13 -0
  133. data/spec/rails_3_0_0_root/config/database.yml +22 -0
  134. data/spec/rails_3_0_0_root/config/environment.rb +5 -0
  135. data/spec/rails_3_0_0_root/config/environments/development.rb +26 -0
  136. data/spec/rails_3_0_0_root/config/environments/production.rb +49 -0
  137. data/spec/rails_3_0_0_root/config/environments/test.rb +35 -0
  138. data/spec/rails_3_0_0_root/config/initializers/backtrace_silencers.rb +7 -0
  139. data/spec/rails_3_0_0_root/config/initializers/inflections.rb +10 -0
  140. data/spec/rails_3_0_0_root/config/initializers/mime_types.rb +5 -0
  141. data/spec/rails_3_0_0_root/config/initializers/secret_token.rb +7 -0
  142. data/spec/rails_3_0_0_root/config/initializers/session_store.rb +8 -0
  143. data/spec/rails_3_0_0_root/config/locales/en.yml +5 -0
  144. data/spec/rails_3_0_0_root/config/routes.rb +58 -0
  145. data/spec/rails_3_0_0_root/config.ru +4 -0
  146. data/spec/rails_3_0_0_root/db/seeds.rb +7 -0
  147. data/spec/rails_3_0_0_root/doc/README_FOR_APP +2 -0
  148. data/spec/rails_3_0_0_root/lib/tasks/.gitkeep +0 -0
  149. data/spec/rails_3_0_0_root/public/404.html +26 -0
  150. data/spec/rails_3_0_0_root/public/422.html +26 -0
  151. data/spec/rails_3_0_0_root/public/500.html +26 -0
  152. data/spec/rails_3_0_0_root/public/favicon.ico +0 -0
  153. data/spec/rails_3_0_0_root/public/images/rails.png +0 -0
  154. data/spec/rails_3_0_0_root/public/index.html +239 -0
  155. data/spec/rails_3_0_0_root/public/javascripts/application.js +2 -0
  156. data/spec/rails_3_0_0_root/public/javascripts/controls.js +965 -0
  157. data/spec/rails_3_0_0_root/public/javascripts/dragdrop.js +974 -0
  158. data/spec/rails_3_0_0_root/public/javascripts/effects.js +1123 -0
  159. data/spec/rails_3_0_0_root/public/javascripts/prototype.js +6001 -0
  160. data/spec/rails_3_0_0_root/public/javascripts/rails.js +175 -0
  161. data/spec/rails_3_0_0_root/public/robots.txt +5 -0
  162. data/spec/rails_3_0_0_root/public/stylesheets/.gitkeep +0 -0
  163. data/spec/rails_3_0_0_root/script/rails +6 -0
  164. data/spec/rails_3_0_0_root/spec/spec_helper.rb +27 -0
  165. data/spec/rails_3_0_0_root/vendor/plugins/.gitkeep +0 -0
  166. data/spec/spec_helper.rb +29 -0
  167. data/spec/support/create_memory_db.rb +2 -0
  168. data/tasks/rspec.rake +46 -0
  169. metadata +278 -0
@@ -0,0 +1,175 @@
1
+ (function() {
2
+ // Technique from Juriy Zaytsev
3
+ // http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/
4
+ function isEventSupported(eventName) {
5
+ var el = document.createElement('div');
6
+ eventName = 'on' + eventName;
7
+ var isSupported = (eventName in el);
8
+ if (!isSupported) {
9
+ el.setAttribute(eventName, 'return;');
10
+ isSupported = typeof el[eventName] == 'function';
11
+ }
12
+ el = null;
13
+ return isSupported;
14
+ }
15
+
16
+ function isForm(element) {
17
+ return Object.isElement(element) && element.nodeName.toUpperCase() == 'FORM'
18
+ }
19
+
20
+ function isInput(element) {
21
+ if (Object.isElement(element)) {
22
+ var name = element.nodeName.toUpperCase()
23
+ return name == 'INPUT' || name == 'SELECT' || name == 'TEXTAREA'
24
+ }
25
+ else return false
26
+ }
27
+
28
+ var submitBubbles = isEventSupported('submit'),
29
+ changeBubbles = isEventSupported('change')
30
+
31
+ if (!submitBubbles || !changeBubbles) {
32
+ // augment the Event.Handler class to observe custom events when needed
33
+ Event.Handler.prototype.initialize = Event.Handler.prototype.initialize.wrap(
34
+ function(init, element, eventName, selector, callback) {
35
+ init(element, eventName, selector, callback)
36
+ // is the handler being attached to an element that doesn't support this event?
37
+ if ( (!submitBubbles && this.eventName == 'submit' && !isForm(this.element)) ||
38
+ (!changeBubbles && this.eventName == 'change' && !isInput(this.element)) ) {
39
+ // "submit" => "emulated:submit"
40
+ this.eventName = 'emulated:' + this.eventName
41
+ }
42
+ }
43
+ )
44
+ }
45
+
46
+ if (!submitBubbles) {
47
+ // discover forms on the page by observing focus events which always bubble
48
+ document.on('focusin', 'form', function(focusEvent, form) {
49
+ // special handler for the real "submit" event (one-time operation)
50
+ if (!form.retrieve('emulated:submit')) {
51
+ form.on('submit', function(submitEvent) {
52
+ var emulated = form.fire('emulated:submit', submitEvent, true)
53
+ // if custom event received preventDefault, cancel the real one too
54
+ if (emulated.returnValue === false) submitEvent.preventDefault()
55
+ })
56
+ form.store('emulated:submit', true)
57
+ }
58
+ })
59
+ }
60
+
61
+ if (!changeBubbles) {
62
+ // discover form inputs on the page
63
+ document.on('focusin', 'input, select, texarea', function(focusEvent, input) {
64
+ // special handler for real "change" events
65
+ if (!input.retrieve('emulated:change')) {
66
+ input.on('change', function(changeEvent) {
67
+ input.fire('emulated:change', changeEvent, true)
68
+ })
69
+ input.store('emulated:change', true)
70
+ }
71
+ })
72
+ }
73
+
74
+ function handleRemote(element) {
75
+ var method, url, params;
76
+
77
+ var event = element.fire("ajax:before");
78
+ if (event.stopped) return false;
79
+
80
+ if (element.tagName.toLowerCase() === 'form') {
81
+ method = element.readAttribute('method') || 'post';
82
+ url = element.readAttribute('action');
83
+ params = element.serialize();
84
+ } else {
85
+ method = element.readAttribute('data-method') || 'get';
86
+ url = element.readAttribute('href');
87
+ params = {};
88
+ }
89
+
90
+ new Ajax.Request(url, {
91
+ method: method,
92
+ parameters: params,
93
+ evalScripts: true,
94
+
95
+ onComplete: function(request) { element.fire("ajax:complete", request); },
96
+ onSuccess: function(request) { element.fire("ajax:success", request); },
97
+ onFailure: function(request) { element.fire("ajax:failure", request); }
98
+ });
99
+
100
+ element.fire("ajax:after");
101
+ }
102
+
103
+ function handleMethod(element) {
104
+ var method = element.readAttribute('data-method'),
105
+ url = element.readAttribute('href'),
106
+ csrf_param = $$('meta[name=csrf-param]')[0],
107
+ csrf_token = $$('meta[name=csrf-token]')[0];
108
+
109
+ var form = new Element('form', { method: "POST", action: url, style: "display: none;" });
110
+ element.parentNode.insert(form);
111
+
112
+ if (method !== 'post') {
113
+ var field = new Element('input', { type: 'hidden', name: '_method', value: method });
114
+ form.insert(field);
115
+ }
116
+
117
+ if (csrf_param) {
118
+ var param = csrf_param.readAttribute('content'),
119
+ token = csrf_token.readAttribute('content'),
120
+ field = new Element('input', { type: 'hidden', name: param, value: token });
121
+ form.insert(field);
122
+ }
123
+
124
+ form.submit();
125
+ }
126
+
127
+
128
+ document.on("click", "*[data-confirm]", function(event, element) {
129
+ var message = element.readAttribute('data-confirm');
130
+ if (!confirm(message)) event.stop();
131
+ });
132
+
133
+ document.on("click", "a[data-remote]", function(event, element) {
134
+ if (event.stopped) return;
135
+ handleRemote(element);
136
+ event.stop();
137
+ });
138
+
139
+ document.on("click", "a[data-method]", function(event, element) {
140
+ if (event.stopped) return;
141
+ handleMethod(element);
142
+ event.stop();
143
+ });
144
+
145
+ document.on("submit", function(event) {
146
+ var element = event.findElement(),
147
+ message = element.readAttribute('data-confirm');
148
+ if (message && !confirm(message)) {
149
+ event.stop();
150
+ return false;
151
+ }
152
+
153
+ var inputs = element.select("input[type=submit][data-disable-with]");
154
+ inputs.each(function(input) {
155
+ input.disabled = true;
156
+ input.writeAttribute('data-original-value', input.value);
157
+ input.value = input.readAttribute('data-disable-with');
158
+ });
159
+
160
+ var element = event.findElement("form[data-remote]");
161
+ if (element) {
162
+ handleRemote(element);
163
+ event.stop();
164
+ }
165
+ });
166
+
167
+ document.on("ajax:after", "form", function(event, element) {
168
+ var inputs = element.select("input[type=submit][disabled=true][data-disable-with]");
169
+ inputs.each(function(input) {
170
+ input.value = input.readAttribute('data-original-value');
171
+ input.removeAttribute('data-original-value');
172
+ input.disabled = false;
173
+ });
174
+ });
175
+ })();
@@ -0,0 +1,5 @@
1
+ # See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file
2
+ #
3
+ # To ban all spiders from the entire site uncomment the next two lines:
4
+ # User-Agent: *
5
+ # Disallow: /
File without changes
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3
+
4
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
5
+ require File.expand_path('../../config/boot', __FILE__)
6
+ require 'rails/commands'
@@ -0,0 +1,27 @@
1
+ # This file is copied to spec/ when you run 'rails generate rspec:install'
2
+ ENV["RAILS_ENV"] ||= 'test'
3
+ require File.expand_path("../../config/environment", __FILE__)
4
+ require 'rspec/rails'
5
+
6
+ # Requires supporting ruby files with custom matchers and macros, etc,
7
+ # in spec/support/ and its subdirectories.
8
+ Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
9
+
10
+ RSpec.configure do |config|
11
+ # == Mock Framework
12
+ #
13
+ # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
14
+ #
15
+ # config.mock_with :mocha
16
+ # config.mock_with :flexmock
17
+ # config.mock_with :rr
18
+ config.mock_with :rspec
19
+
20
+ # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
21
+ config.fixture_path = "#{::Rails.root}/spec/fixtures"
22
+
23
+ # If you're not using ActiveRecord, or you'd prefer not to run each of your
24
+ # examples within a transaction, remove the following line or assign false
25
+ # instead of true.
26
+ config.use_transactional_fixtures = true
27
+ end
File without changes
@@ -0,0 +1,29 @@
1
+ # This file is copied to spec/ when you run 'rails generate rspec:install'
2
+ ENV["RAILS_ENV"] ||= 'test'
3
+ # require File.expand_path("../../config/environment", __FILE__)
4
+ require File.expand_path(File.dirname(__FILE__) + "/rails_3_0_0_root/config/environment", __FILE__)
5
+ require 'rspec/rails'
6
+
7
+ # Requires supporting ruby files with custom matchers and macros, etc,
8
+ # in spec/support/ and its subdirectories.
9
+ # Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
10
+ Dir[File.dirname(__FILE__) + "/support/**/*.rb"].each {|f| require f}
11
+
12
+ RSpec.configure do |config|
13
+ # == Mock Framework
14
+ #
15
+ # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
16
+ #
17
+ # config.mock_with :mocha
18
+ # config.mock_with :flexmock
19
+ # config.mock_with :rr
20
+ config.mock_with :rspec
21
+
22
+ # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
23
+ config.fixture_path = "#{::Rails.root}/spec/fixtures"
24
+
25
+ # If you're not using ActiveRecord, or you'd prefer not to run each of your
26
+ # examples within a transaction, remove the following line or assign false
27
+ # instead of true.
28
+ config.use_transactional_fixtures = true
29
+ end
@@ -0,0 +1,2 @@
1
+ ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :database => ":memory:")
2
+
data/tasks/rspec.rake ADDED
@@ -0,0 +1,46 @@
1
+ ENV['BUNDLE_GEMFILE'] = File.dirname(__FILE__) + '/../spec/rails_3_0_0_root/Gemfile'
2
+
3
+ require 'rake'
4
+ require 'rake/testtask'
5
+ require 'rspec'
6
+ require 'rspec/core/rake_task'
7
+
8
+
9
+ desc "Run the test suite"
10
+ task :spec => ['spec:setup', 'spec:rules_view', 'spec:cleanup']
11
+
12
+ namespace :spec do
13
+ desc "Setup the test environment"
14
+ task :setup do
15
+ rules_view_rails_path = File.expand_path(File.dirname(__FILE__) + '/../spec/rails_3_0_0_root')
16
+
17
+ system "cd #{rules_view_rails_path} && bundle install"
18
+ system "cd #{rules_view_rails_path} && ./script/rails generate rules_view:install"
19
+ end
20
+
21
+ desc "Cleanup the test environment"
22
+ task :cleanup do
23
+ rules_view_rails_path = File.expand_path(File.dirname(__FILE__) + '/../spec/rails_3_0_0_root')
24
+
25
+ FileUtils.rm_rf("#{rules_view_rails_path}/public/stylesheets/rules_view")
26
+ FileUtils.rm_rf("#{rules_view_rails_path}/public/javascripts/rules_view")
27
+ FileUtils.rm_rf("#{rules_view_rails_path}/config/initializers/rules_view.rb")
28
+ FileUtils.rm_rf("#{rules_view_rails_path}/doc/README.rules_view")
29
+ FileUtils.rm_rf("#{rules_view_rails_path}/Gemfile.lock")
30
+ end
31
+
32
+ desc "Test the rules_view"
33
+ RSpec::Core::RakeTask.new(:rules_view) do |task|
34
+ rules_engine_root = File.expand_path(File.dirname(__FILE__) + '/..')
35
+ task.pattern = rules_engine_root + '/spec/lib/rules_view/**/*_spec.rb'
36
+ end
37
+
38
+ desc "Run the coverage report"
39
+ RSpec::Core::RakeTask.new(:rcov) do |task|
40
+ rules_engine_root = File.expand_path(File.dirname(__FILE__) + '/..')
41
+ task.pattern = rules_engine_root + '/spec/lib/**/*_spec.rb'
42
+ task.rcov=true
43
+ task.rcov_opts = %w{--rails --exclude osx\/objc,gems\/,spec\/,features\/}
44
+ end
45
+ end
46
+
metadata ADDED
@@ -0,0 +1,278 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rules_view
3
+ version: !ruby/object:Gem::Version
4
+ hash: 29
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 1
10
+ version: 0.0.1
11
+ platform: ruby
12
+ authors:
13
+ - Chris Douglas
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2010-10-21 00:00:00 +11:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: rspec
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ hash: 13
30
+ segments:
31
+ - 1
32
+ - 2
33
+ - 9
34
+ version: 1.2.9
35
+ type: :development
36
+ version_requirements: *id001
37
+ description: Ruby Rails Rules Engine Framework Views
38
+ email: dougo.chris@gmail.com
39
+ executables: []
40
+
41
+ extensions: []
42
+
43
+ extra_rdoc_files:
44
+ - LICENSE
45
+ - README.textile
46
+ files:
47
+ - .document
48
+ - .gitignore
49
+ - LICENSE
50
+ - README.textile
51
+ - Rakefile
52
+ - VERSION
53
+ - app/views/layouts/rules_view.html.erb
54
+ - app/views/re_view/template.html.erb
55
+ - autotest/discover.rb
56
+ - generators/install_generator.rb
57
+ - generators/layout_generator.rb
58
+ - generators/manifests/application.rb
59
+ - generators/manifests/application.yml
60
+ - generators/manifests/layout.rb
61
+ - generators/manifests/layout.yml
62
+ - generators/manifests/templates/app/views/layouts/rules_view_layout.html.erb
63
+ - generators/manifests/templates/config/initializers/rules_view.rb
64
+ - generators/manifests/templates/doc/README.rules_view
65
+ - generators/manifests/templates/public/javascripts/rules_view/jquery-1.4.2.min.js
66
+ - generators/manifests/templates/public/javascripts/rules_view/jquery.autocomplete.pack.js
67
+ - generators/manifests/templates/public/javascripts/rules_view/jquery.blockUI.js
68
+ - generators/manifests/templates/public/javascripts/rules_view/jquery.fancybox-1.3.1.js
69
+ - generators/manifests/templates/public/javascripts/rules_view/re_view.js
70
+ - generators/manifests/templates/public/stylesheets/rules_view/blueprint/ie.css
71
+ - generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/buttons/icons/cross.png
72
+ - generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/buttons/icons/key.png
73
+ - generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/buttons/icons/tick.png
74
+ - generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/buttons/readme.txt
75
+ - generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/buttons/screen.css
76
+ - generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/fancy-type/readme.txt
77
+ - generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/fancy-type/screen.css
78
+ - generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/link-icons/icons/doc.png
79
+ - generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/link-icons/icons/email.png
80
+ - generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/link-icons/icons/external.png
81
+ - generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/link-icons/icons/feed.png
82
+ - generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/link-icons/icons/im.png
83
+ - generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/link-icons/icons/pdf.png
84
+ - generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/link-icons/icons/visited.png
85
+ - generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/link-icons/icons/xls.png
86
+ - generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/link-icons/readme.txt
87
+ - generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/link-icons/screen.css
88
+ - generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/rtl/readme.txt
89
+ - generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/rtl/screen.css
90
+ - generators/manifests/templates/public/stylesheets/rules_view/blueprint/print.css
91
+ - generators/manifests/templates/public/stylesheets/rules_view/blueprint/screen.css
92
+ - generators/manifests/templates/public/stylesheets/rules_view/blueprint/src/forms.css
93
+ - generators/manifests/templates/public/stylesheets/rules_view/blueprint/src/grid.css
94
+ - generators/manifests/templates/public/stylesheets/rules_view/blueprint/src/grid.png
95
+ - generators/manifests/templates/public/stylesheets/rules_view/blueprint/src/ie.css
96
+ - generators/manifests/templates/public/stylesheets/rules_view/blueprint/src/print.css
97
+ - generators/manifests/templates/public/stylesheets/rules_view/blueprint/src/reset.css
98
+ - generators/manifests/templates/public/stylesheets/rules_view/blueprint/src/typography.css
99
+ - generators/manifests/templates/public/stylesheets/rules_view/fancybox/blank.gif
100
+ - generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_close.png
101
+ - generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_loading.png
102
+ - generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_nav_left.png
103
+ - generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_nav_right.png
104
+ - generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_shadow_e.png
105
+ - generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_shadow_n.png
106
+ - generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_shadow_ne.png
107
+ - generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_shadow_nw.png
108
+ - generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_shadow_s.png
109
+ - generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_shadow_se.png
110
+ - generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_shadow_sw.png
111
+ - generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_shadow_w.png
112
+ - generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_title_left.png
113
+ - generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_title_main.png
114
+ - generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_title_over.png
115
+ - generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_title_right.png
116
+ - generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancybox-x.png
117
+ - generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancybox-y.png
118
+ - generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancybox.png
119
+ - generators/manifests/templates/public/stylesheets/rules_view/fancybox/jquery.fancybox-1.3.1.css
120
+ - generators/manifests/templates/public/stylesheets/rules_view/images/re_view_box/shadowbox.png
121
+ - generators/manifests/templates/public/stylesheets/rules_view/images/re_view_box/whitebox.jpg
122
+ - generators/manifests/templates/public/stylesheets/rules_view/images/re_view_button/checked-off.gif
123
+ - generators/manifests/templates/public/stylesheets/rules_view/images/re_view_button/checked-on.gif
124
+ - generators/manifests/templates/public/stylesheets/rules_view/images/re_view_button/icon-add.png
125
+ - generators/manifests/templates/public/stylesheets/rules_view/images/re_view_button/icon-delete.png
126
+ - generators/manifests/templates/public/stylesheets/rules_view/images/re_view_button/list-add.png
127
+ - generators/manifests/templates/public/stylesheets/rules_view/images/re_view_button/list-remove.png
128
+ - generators/manifests/templates/public/stylesheets/rules_view/images/re_view_button/list-select.png
129
+ - generators/manifests/templates/public/stylesheets/rules_view/images/re_view_button/oval-blue-left.gif
130
+ - generators/manifests/templates/public/stylesheets/rules_view/images/re_view_button/oval-blue-right.gif
131
+ - generators/manifests/templates/public/stylesheets/rules_view/images/re_view_button/oval-gray-left.gif
132
+ - generators/manifests/templates/public/stylesheets/rules_view/images/re_view_button/oval-gray-right.gif
133
+ - generators/manifests/templates/public/stylesheets/rules_view/images/re_view_button/oval-green-left.gif
134
+ - generators/manifests/templates/public/stylesheets/rules_view/images/re_view_button/oval-green-right.gif
135
+ - generators/manifests/templates/public/stylesheets/rules_view/images/re_view_button/oval-orange-left.gif
136
+ - generators/manifests/templates/public/stylesheets/rules_view/images/re_view_button/oval-orange-right.gif
137
+ - generators/manifests/templates/public/stylesheets/rules_view/images/re_view_button/oval-red-left.gif
138
+ - generators/manifests/templates/public/stylesheets/rules_view/images/re_view_button/oval-red-right.gif
139
+ - generators/manifests/templates/public/stylesheets/rules_view/images/re_view_error/re-alert-close.png
140
+ - generators/manifests/templates/public/stylesheets/rules_view/images/re_view_navigate/breadcrumb.png
141
+ - generators/manifests/templates/public/stylesheets/rules_view/jquery.autocomplete.css
142
+ - generators/manifests/templates/public/stylesheets/rules_view/rules_view.css
143
+ - init.rb
144
+ - lib/rules_view.rb
145
+ - lib/rules_view/alerts.rb
146
+ - lib/rules_view/boxes.rb
147
+ - lib/rules_view/buttons.rb
148
+ - lib/rules_view/config.rb
149
+ - lib/rules_view/defer.rb
150
+ - lib/rules_view/engine.rb
151
+ - lib/rules_view/form_builder.rb
152
+ - lib/rules_view/form_fields.rb
153
+ - lib/rules_view/form_styles.rb
154
+ - lib/rules_view/model_loader.rb
155
+ - lib/rules_view/navigate.rb
156
+ - rules_view.gemspec
157
+ - spec/lib/rules_view/alerts_spec.rb
158
+ - spec/lib/rules_view/boxes_spec.rb
159
+ - spec/lib/rules_view/buttons_spec.rb
160
+ - spec/lib/rules_view/defer_spec.rb
161
+ - spec/lib/rules_view/form_builder_fields_spec.rb
162
+ - spec/lib/rules_view/form_builder_spec.rb
163
+ - spec/lib/rules_view/form_fields_spec.rb
164
+ - spec/lib/rules_view/form_styles_spec.rb
165
+ - spec/lib/rules_view/model_loader_spec.rb
166
+ - spec/lib/rules_view/navigate_spec.rb
167
+ - spec/rails_3_0_0_root/.gitignore
168
+ - spec/rails_3_0_0_root/.rspec
169
+ - spec/rails_3_0_0_root/Gemfile
170
+ - spec/rails_3_0_0_root/Gemfile.lock
171
+ - spec/rails_3_0_0_root/README
172
+ - spec/rails_3_0_0_root/Rakefile
173
+ - spec/rails_3_0_0_root/app/controllers/application_controller.rb
174
+ - spec/rails_3_0_0_root/app/helpers/application_helper.rb
175
+ - spec/rails_3_0_0_root/app/views/layouts/application.html.erb
176
+ - spec/rails_3_0_0_root/autotest/discover.rb
177
+ - spec/rails_3_0_0_root/config.ru
178
+ - spec/rails_3_0_0_root/config/application.rb
179
+ - spec/rails_3_0_0_root/config/boot.rb
180
+ - spec/rails_3_0_0_root/config/database.yml
181
+ - spec/rails_3_0_0_root/config/environment.rb
182
+ - spec/rails_3_0_0_root/config/environments/development.rb
183
+ - spec/rails_3_0_0_root/config/environments/production.rb
184
+ - spec/rails_3_0_0_root/config/environments/test.rb
185
+ - spec/rails_3_0_0_root/config/initializers/backtrace_silencers.rb
186
+ - spec/rails_3_0_0_root/config/initializers/inflections.rb
187
+ - spec/rails_3_0_0_root/config/initializers/mime_types.rb
188
+ - spec/rails_3_0_0_root/config/initializers/secret_token.rb
189
+ - spec/rails_3_0_0_root/config/initializers/session_store.rb
190
+ - spec/rails_3_0_0_root/config/locales/en.yml
191
+ - spec/rails_3_0_0_root/config/routes.rb
192
+ - spec/rails_3_0_0_root/db/seeds.rb
193
+ - spec/rails_3_0_0_root/doc/README_FOR_APP
194
+ - spec/rails_3_0_0_root/lib/tasks/.gitkeep
195
+ - spec/rails_3_0_0_root/public/404.html
196
+ - spec/rails_3_0_0_root/public/422.html
197
+ - spec/rails_3_0_0_root/public/500.html
198
+ - spec/rails_3_0_0_root/public/favicon.ico
199
+ - spec/rails_3_0_0_root/public/images/rails.png
200
+ - spec/rails_3_0_0_root/public/index.html
201
+ - spec/rails_3_0_0_root/public/javascripts/application.js
202
+ - spec/rails_3_0_0_root/public/javascripts/controls.js
203
+ - spec/rails_3_0_0_root/public/javascripts/dragdrop.js
204
+ - spec/rails_3_0_0_root/public/javascripts/effects.js
205
+ - spec/rails_3_0_0_root/public/javascripts/prototype.js
206
+ - spec/rails_3_0_0_root/public/javascripts/rails.js
207
+ - spec/rails_3_0_0_root/public/robots.txt
208
+ - spec/rails_3_0_0_root/public/stylesheets/.gitkeep
209
+ - spec/rails_3_0_0_root/script/rails
210
+ - spec/rails_3_0_0_root/spec/spec_helper.rb
211
+ - spec/rails_3_0_0_root/vendor/plugins/.gitkeep
212
+ - spec/spec_helper.rb
213
+ - spec/support/create_memory_db.rb
214
+ - tasks/rspec.rake
215
+ has_rdoc: true
216
+ homepage: http://github.com/dougochris/rules_view
217
+ licenses: []
218
+
219
+ post_install_message:
220
+ rdoc_options:
221
+ - --charset=UTF-8
222
+ require_paths:
223
+ - lib
224
+ required_ruby_version: !ruby/object:Gem::Requirement
225
+ none: false
226
+ requirements:
227
+ - - ">="
228
+ - !ruby/object:Gem::Version
229
+ hash: 3
230
+ segments:
231
+ - 0
232
+ version: "0"
233
+ required_rubygems_version: !ruby/object:Gem::Requirement
234
+ none: false
235
+ requirements:
236
+ - - ">="
237
+ - !ruby/object:Gem::Version
238
+ hash: 3
239
+ segments:
240
+ - 0
241
+ version: "0"
242
+ requirements: []
243
+
244
+ rubyforge_project:
245
+ rubygems_version: 1.3.7
246
+ signing_key:
247
+ specification_version: 3
248
+ summary: views and styles used in my rules engine and other projects
249
+ test_files:
250
+ - spec/lib/rules_view/alerts_spec.rb
251
+ - spec/lib/rules_view/boxes_spec.rb
252
+ - spec/lib/rules_view/buttons_spec.rb
253
+ - spec/lib/rules_view/defer_spec.rb
254
+ - spec/lib/rules_view/form_builder_fields_spec.rb
255
+ - spec/lib/rules_view/form_builder_spec.rb
256
+ - spec/lib/rules_view/form_fields_spec.rb
257
+ - spec/lib/rules_view/form_styles_spec.rb
258
+ - spec/lib/rules_view/model_loader_spec.rb
259
+ - spec/lib/rules_view/navigate_spec.rb
260
+ - spec/rails_3_0_0_root/app/controllers/application_controller.rb
261
+ - spec/rails_3_0_0_root/app/helpers/application_helper.rb
262
+ - spec/rails_3_0_0_root/autotest/discover.rb
263
+ - spec/rails_3_0_0_root/config/application.rb
264
+ - spec/rails_3_0_0_root/config/boot.rb
265
+ - spec/rails_3_0_0_root/config/environment.rb
266
+ - spec/rails_3_0_0_root/config/environments/development.rb
267
+ - spec/rails_3_0_0_root/config/environments/production.rb
268
+ - spec/rails_3_0_0_root/config/environments/test.rb
269
+ - spec/rails_3_0_0_root/config/initializers/backtrace_silencers.rb
270
+ - spec/rails_3_0_0_root/config/initializers/inflections.rb
271
+ - spec/rails_3_0_0_root/config/initializers/mime_types.rb
272
+ - spec/rails_3_0_0_root/config/initializers/secret_token.rb
273
+ - spec/rails_3_0_0_root/config/initializers/session_store.rb
274
+ - spec/rails_3_0_0_root/config/routes.rb
275
+ - spec/rails_3_0_0_root/db/seeds.rb
276
+ - spec/rails_3_0_0_root/spec/spec_helper.rb
277
+ - spec/spec_helper.rb
278
+ - spec/support/create_memory_db.rb