rules_view 0.0.1 → 0.0.2

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 (123) hide show
  1. data/README.textile +53 -26
  2. data/VERSION +1 -1
  3. data/app/views/layouts/rules_view.html.erb +15 -22
  4. data/generators/install_generator.rb +18 -2
  5. data/generators/layout_generator.rb +2 -2
  6. data/generators/manifests/rules_view_install.rb +50 -0
  7. data/generators/manifests/{application.yml → rules_view_install.yml} +0 -0
  8. data/generators/manifests/{layout.rb → rules_view_layout.rb} +1 -1
  9. data/generators/manifests/{layout.yml → rules_view_layout.yml} +0 -0
  10. data/generators/manifests/templates/app/views/layouts/rules_view_layout.html.erb +19 -27
  11. data/generators/manifests/templates/doc/README.rules_view +30 -0
  12. data/generators/manifests/templates/public/javascripts/rules_view/{re_view.js → rules_view.js} +0 -0
  13. data/lib/rules_view/defer.rb +7 -0
  14. data/spec/lib/rules_view/defer_spec.rb +19 -0
  15. data/spec/{rails_3_0_0_root → rails_3_0_1_root}/Gemfile +3 -2
  16. data/spec/{rails_3_0_0_root → rails_3_0_1_root}/README +0 -0
  17. data/spec/{rails_3_0_0_root → rails_3_0_1_root}/Rakefile +1 -1
  18. data/spec/{rails_3_0_0_root → rails_3_0_1_root}/app/controllers/application_controller.rb +0 -0
  19. data/spec/{rails_3_0_0_root → rails_3_0_1_root}/app/helpers/application_helper.rb +0 -0
  20. data/spec/{rails_3_0_0_root → rails_3_0_1_root}/app/views/layouts/application.html.erb +1 -1
  21. data/spec/{rails_3_0_0_root → rails_3_0_1_root}/autotest/discover.rb +0 -0
  22. data/spec/{rails_3_0_0_root → rails_3_0_1_root}/config/application.rb +1 -1
  23. data/spec/{rails_3_0_0_root → rails_3_0_1_root}/config/boot.rb +0 -0
  24. data/spec/{rails_3_0_0_root → rails_3_0_1_root}/config/database.yml +0 -0
  25. data/spec/{rails_3_0_0_root → rails_3_0_1_root}/config/environment.rb +1 -1
  26. data/spec/{rails_3_0_0_root → rails_3_0_1_root}/config/environments/development.rb +1 -1
  27. data/spec/{rails_3_0_0_root → rails_3_0_1_root}/config/environments/production.rb +1 -1
  28. data/spec/{rails_3_0_0_root → rails_3_0_1_root}/config/environments/test.rb +1 -1
  29. data/spec/{rails_3_0_0_root → rails_3_0_1_root}/config/initializers/backtrace_silencers.rb +0 -0
  30. data/spec/{rails_3_0_0_root → rails_3_0_1_root}/config/initializers/inflections.rb +0 -0
  31. data/spec/{rails_3_0_0_root → rails_3_0_1_root}/config/initializers/mime_types.rb +0 -0
  32. data/spec/{rails_3_0_0_root → rails_3_0_1_root}/config/initializers/secret_token.rb +1 -1
  33. data/spec/{rails_3_0_0_root → rails_3_0_1_root}/config/initializers/session_store.rb +2 -2
  34. data/spec/{rails_3_0_0_root → rails_3_0_1_root}/config/locales/en.yml +0 -0
  35. data/spec/{rails_3_0_0_root → rails_3_0_1_root}/config/routes.rb +1 -1
  36. data/spec/{rails_3_0_0_root → rails_3_0_1_root}/config.ru +1 -1
  37. data/spec/{rails_3_0_0_root → rails_3_0_1_root}/db/seeds.rb +0 -0
  38. data/spec/{rails_3_0_0_root → rails_3_0_1_root}/doc/README_FOR_APP +0 -0
  39. data/spec/{rails_3_0_0_root/lib/tasks/.gitkeep → rails_3_0_1_root/log/development.log} +0 -0
  40. data/spec/{rails_3_0_0_root/public/favicon.ico → rails_3_0_1_root/log/production.log} +0 -0
  41. data/spec/{rails_3_0_0_root/public/stylesheets/.gitkeep → rails_3_0_1_root/log/server.log} +0 -0
  42. data/spec/rails_3_0_1_root/log/test.log +145 -0
  43. data/spec/{rails_3_0_0_root → rails_3_0_1_root}/public/404.html +0 -0
  44. data/spec/{rails_3_0_0_root → rails_3_0_1_root}/public/422.html +0 -0
  45. data/spec/{rails_3_0_0_root → rails_3_0_1_root}/public/500.html +0 -0
  46. data/spec/{rails_3_0_0_root/vendor/plugins/.gitkeep → rails_3_0_1_root/public/favicon.ico} +0 -0
  47. data/spec/{rails_3_0_0_root → rails_3_0_1_root}/public/images/rails.png +0 -0
  48. data/spec/{rails_3_0_0_root → rails_3_0_1_root}/public/index.html +0 -0
  49. data/spec/{rails_3_0_0_root → rails_3_0_1_root}/public/javascripts/application.js +0 -0
  50. data/spec/{rails_3_0_0_root → rails_3_0_1_root}/public/javascripts/controls.js +0 -0
  51. data/spec/{rails_3_0_0_root → rails_3_0_1_root}/public/javascripts/dragdrop.js +0 -0
  52. data/spec/{rails_3_0_0_root → rails_3_0_1_root}/public/javascripts/effects.js +0 -0
  53. data/spec/{rails_3_0_0_root → rails_3_0_1_root}/public/javascripts/prototype.js +0 -0
  54. data/spec/{rails_3_0_0_root → rails_3_0_1_root}/public/javascripts/rails.js +0 -0
  55. data/spec/{rails_3_0_0_root → rails_3_0_1_root}/public/robots.txt +0 -0
  56. data/spec/{rails_3_0_0_root → rails_3_0_1_root}/script/rails +0 -0
  57. data/spec/{rails_3_0_0_root → rails_3_0_1_root}/spec/spec_helper.rb +0 -0
  58. data/spec/spec_helper.rb +1 -1
  59. data/tasks/rspec.rake +10 -10
  60. metadata +116 -135
  61. data/.document +0 -5
  62. data/.gitignore +0 -21
  63. data/Rakefile +0 -47
  64. data/generators/manifests/application.rb +0 -116
  65. data/generators/manifests/templates/public/javascripts/rules_view/jquery-1.4.2.min.js +0 -154
  66. data/generators/manifests/templates/public/javascripts/rules_view/jquery.autocomplete.pack.js +0 -13
  67. data/generators/manifests/templates/public/javascripts/rules_view/jquery.blockUI.js +0 -486
  68. data/generators/manifests/templates/public/javascripts/rules_view/jquery.fancybox-1.3.1.js +0 -1077
  69. data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/ie.css +0 -35
  70. data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/buttons/icons/cross.png +0 -0
  71. data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/buttons/icons/key.png +0 -0
  72. data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/buttons/icons/tick.png +0 -0
  73. data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/buttons/readme.txt +0 -32
  74. data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/buttons/screen.css +0 -97
  75. data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/fancy-type/readme.txt +0 -14
  76. data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/fancy-type/screen.css +0 -71
  77. data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/link-icons/icons/doc.png +0 -0
  78. data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/link-icons/icons/email.png +0 -0
  79. data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/link-icons/icons/external.png +0 -0
  80. data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/link-icons/icons/feed.png +0 -0
  81. data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/link-icons/icons/im.png +0 -0
  82. data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/link-icons/icons/pdf.png +0 -0
  83. data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/link-icons/icons/visited.png +0 -0
  84. data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/link-icons/icons/xls.png +0 -0
  85. data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/link-icons/readme.txt +0 -18
  86. data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/link-icons/screen.css +0 -40
  87. data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/rtl/readme.txt +0 -10
  88. data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/plugins/rtl/screen.css +0 -110
  89. data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/print.css +0 -29
  90. data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/screen.css +0 -258
  91. data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/src/forms.css +0 -65
  92. data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/src/grid.css +0 -280
  93. data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/src/grid.png +0 -0
  94. data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/src/ie.css +0 -76
  95. data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/src/print.css +0 -85
  96. data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/src/reset.css +0 -45
  97. data/generators/manifests/templates/public/stylesheets/rules_view/blueprint/src/typography.css +0 -106
  98. data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/blank.gif +0 -0
  99. data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_close.png +0 -0
  100. data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_loading.png +0 -0
  101. data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_nav_left.png +0 -0
  102. data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_nav_right.png +0 -0
  103. data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_shadow_e.png +0 -0
  104. data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_shadow_n.png +0 -0
  105. data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_shadow_ne.png +0 -0
  106. data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_shadow_nw.png +0 -0
  107. data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_shadow_s.png +0 -0
  108. data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_shadow_se.png +0 -0
  109. data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_shadow_sw.png +0 -0
  110. data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_shadow_w.png +0 -0
  111. data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_title_left.png +0 -0
  112. data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_title_main.png +0 -0
  113. data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_title_over.png +0 -0
  114. data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancy_title_right.png +0 -0
  115. data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancybox-x.png +0 -0
  116. data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancybox-y.png +0 -0
  117. data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/fancybox.png +0 -0
  118. data/generators/manifests/templates/public/stylesheets/rules_view/fancybox/jquery.fancybox-1.3.1.css +0 -363
  119. data/generators/manifests/templates/public/stylesheets/rules_view/jquery.autocomplete.css +0 -53
  120. data/rules_view.gemspec +0 -239
  121. data/spec/rails_3_0_0_root/.gitignore +0 -4
  122. data/spec/rails_3_0_0_root/.rspec +0 -1
  123. data/spec/rails_3_0_0_root/Gemfile.lock +0 -101
data/README.textile CHANGED
@@ -1,31 +1,53 @@
1
- = rules_view
1
+ h1. rules_view
2
2
 
3
3
  To add the rules view to you application
4
+
5
+ <pre>
4
6
  > script/rails generate rules_view:install
5
7
 
8
+ > mkdir public/javascripts/jquery
9
+ > curl http://github.com/rails/jquery-ujs/raw/master/src/rails.js > public/javascripts/rails.js
10
+ > curl http://code.jquery.com/jquery-1.4.3.min.js > public/javascripts/jquery/jquery-1.4.3.min.js
11
+ > curl http://github.com/malsup/blockui/raw/master/jquery.blockUI.js?v2.31 > public/javascripts/jquery/jquery.blockUI.js
12
+ > curl http://fancybox.googlecode.com/files/jquery.fancybox-1.3.1.zip > public/javascripts/jquery/jquery.fancybox-1.3.1.zip
13
+ > unzip public/javascripts/jquery/jquery.fancybox-1.3.1.zip -d public/javascripts/jquery
14
+ > rm public/javascripts/jquery/jquery.fancybox-1.3.1.zip
15
+
16
+ > mkdir public/stylesheets/blueprint
17
+ > mkdir public/stylesheets/blueprint/src
18
+ > curl http://github.com/joshuaclayton/blueprint-css/raw/master/blueprint/ie.css > public/stylesheets/blueprint/ie.css
19
+ > curl http://github.com/joshuaclayton/blueprint-css/raw/master/blueprint/print.css > public/stylesheets/blueprint/print.css
20
+ > curl http://github.com/joshuaclayton/blueprint-css/raw/master/blueprint/screen.css > public/stylesheets/blueprint/screen.css
21
+ > curl http://github.com/joshuaclayton/blueprint-css/raw/master/blueprint/src/grid.png > public/stylesheets/blueprint/src/grid.png
22
+ </pre>
23
+
6
24
  Then set the layout to use in the controller
25
+
26
+ <pre>
7
27
  class MyCoolController < ApplicationController
8
28
  layout 'rules_view'
9
29
  ...
30
+ </pre>
10
31
 
11
32
  To install and modify the rules_view layout
12
- > script/rails generate rules_view:layout [layout_name]
13
33
 
14
- Then set the layout to use in the controller
15
- class MyCoolController < ApplicationController
16
- layout '[layout_name]'
17
- ...
34
+ <pre>
35
+ > script/rails generate rules_view:layout [layout_name]
36
+ </pre>
37
+
38
+ See doc/README.rules_view for usage and instructions
18
39
 
19
- ##########################################################
20
- = form_styles
40
+ h2. form_styles
21
41
 
42
+ <pre>
22
43
  - re_build_form_field (value options) # options :class, :id, :disabled, :span
23
44
  - re_build_form_label (value options) # options :class, :id, :disabled, :span, :error, :required
24
45
  - re_build_form_data (value options) # options :class, :id, :disabled, :span, :error, :required, :hint, :text
46
+ </pre>
25
47
 
26
- ##########################################################
27
- = form_builder
48
+ h2. form_builder
28
49
 
50
+ <pre>
29
51
  - re_form_for (record_or_name_or_array, *args, &proc)
30
52
  - re_fields_for (record_or_name_or_array, *args, &proc)
31
53
  - re_form_remote_for (record_or_name_or_array, *args, &proc)
@@ -41,10 +63,11 @@ class MyCoolController < ApplicationController
41
63
  - time_select (name, value, *args)
42
64
  - time_zone_select (name, value, *args)
43
65
  - check_box (name, value = "1", checked = false, options = {})
66
+ </pre>
44
67
 
45
- ##########################################################
46
- = form_fields
68
+ h2. form_fields
47
69
 
70
+ <pre>
48
71
  - re_text_field (label, name, value, *args)
49
72
  - re_password_field (label, name, value, *args)
50
73
  - re_file_field (label, name, value, *args)
@@ -57,22 +80,25 @@ class MyCoolController < ApplicationController
57
80
  - re_check_box (label, name, value = "1", checked = false, options = {})
58
81
  - re_form_text (label, text = "", options = {})
59
82
  - re_form_blank (options = {})
83
+ </pre>
60
84
 
61
- ##########################################################
62
- = alert
85
+ h2. alert
63
86
 
87
+ <pre>
64
88
  - re_alert
65
89
  - re_alert_js
90
+ </pre>
66
91
 
67
- ##########################################################
68
- = boxes
92
+ h2. boxes
69
93
 
94
+ <pre>
70
95
  - re_whitebox(&block)
71
96
  - re_shadowbox(&block)
97
+ </pre>
72
98
 
73
- ##########################################################
74
- = buttons
99
+ h2. buttons
75
100
 
101
+ <pre>
76
102
  - re_button_submit(title, color, options ={})
77
103
 
78
104
  - re_button_submit_gray(title, options = {})
@@ -98,23 +124,24 @@ class MyCoolController < ApplicationController
98
124
  - re_button_select(url, options = {})
99
125
  - re_button_checked(url, options = {})
100
126
  - re_button_unchecked(url, options = {})
127
+ </pre>
101
128
 
129
+ h2. navigate
102
130
 
103
- ##########################################################
104
- = navigate
105
-
131
+ <pre>
106
132
  - re_breadcrumbs (*links)
107
133
  - re_breadcrumbs_right (*links)
134
+ </pre>
108
135
 
109
- ##########################################################
110
- = defer
136
+ h2. defer
111
137
 
138
+ <pre>
112
139
  - set_re_javascript_include (javascript_include_or_array)
113
140
  - set_re_breadcrumbs (*links)
114
141
  - set_re_breadcrumbs_right (*links)
142
+ </pre>
115
143
 
116
-
117
- == Note on Patches/Pull Requests
144
+ h2. Note on Patches/Pull Requests
118
145
 
119
146
  * Fork the project.
120
147
  * Make your feature addition or bug fix.
@@ -124,6 +151,6 @@ class MyCoolController < ApplicationController
124
151
  (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
125
152
  * Send me a pull request. Bonus points for topic branches.
126
153
 
127
- == Copyright
154
+ h2. Copyright
128
155
 
129
156
  Copyright (c) 2010 Chris Douglas. See LICENSE for details.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.1
1
+ 0.0.2
@@ -1,34 +1,26 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
- <html xmlns="http://www.w3.org/1999/xhtml">
1
+ <!DOCTYPE html>
2
+ <html>
3
3
  <head>
4
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
5
- <title> <%%= (page_title = yield :defer_page_title) ? page_title : controller.controller_name.humanize %> </title>
4
+ <title> <%= (page_title = yield :defer_re_title) ? page_title : controller.controller_name.humanize %> </title>
6
5
 
7
- <link rel="stylesheet" href="/stylesheets/rules_view/blueprint/screen.css" type="text/css" media="screen, projection">
8
- <link rel="stylesheet" href="/stylesheets/rules_view/blueprint/print.css" type="text/css" media="print">
6
+ <link rel="stylesheet" href="/stylesheets/blueprint/screen.css" type="text/css" media="screen, projection">
7
+ <link rel="stylesheet" href="/stylesheets/blueprint/print.css" type="text/css" media="print">
9
8
  <!--[if lt IE 8]>
10
- <link rel="stylesheet" href="/stylesheets/rules_view/blueprint/ie.css" type="text/css" media="screen, projection">
9
+ <link rel="stylesheet" href="/stylesheets/blueprint/ie.css" type="text/css" media="screen, projection">
11
10
  <![endif]-->
12
11
 
13
- <%= javascript_include_tag 'rules_view/jquery-1.4.2.min',
14
- 'rules_view/jquery.blockUI',
15
- 'rules_view/jquery.autocomplete.pack',
16
- 'rules_view/jquery.fancybox-1.3.1',
17
- 'rules_view/rules_view',
18
- 'application',
19
- :cache => true %>
20
-
21
- <%= stylesheet_link_tag 'rules_view/rules_view',
22
- 'rules_view/jquery.autocomplete',
23
- 'rules_view/fancybox/jquery.fancybox-1.3.1',
24
- # 'application',
25
- :cache => true %>
26
-
27
- <%= yield :defer_re_javascript_include %>
12
+ <%= javascript_include_tag 'jquery/jquery-1.4.3.min.js' %>
13
+ <%= javascript_include_tag 'jquery/jquery.blockUI.js' %>
14
+ <%= javascript_include_tag 'jquery/jquery.fancybox-1.3.1/fancybox/jquery.fancybox-1.3.1.js' %>
15
+ <%= stylesheet_link_tag '/javascripts/jquery/jquery.fancybox-1.3.1/fancybox/jquery.fancybox-1.3.1.css' %>
16
+ <%= stylesheet_link_tag 'rules_view/rules_view' %>
28
17
 
18
+ <%= stylesheet_link_tag :all %>
19
+ <%= javascript_include_tag :defaults %>
29
20
  <%= csrf_meta_tag %>
30
21
  </head>
31
22
  <body>
23
+
32
24
  <div class="container re_container">
33
25
  <%#= render '/layouts/header' %>
34
26
 
@@ -39,5 +31,6 @@
39
31
  <div class="clear top-10"></div>
40
32
  <%#= render '/layouts/footer' %>
41
33
  </div>
34
+
42
35
  </body>
43
36
  </html>
@@ -1,4 +1,4 @@
1
- require "#{File.dirname(__FILE__)}/manifests/application.rb"
1
+ require "#{File.dirname(__FILE__)}/manifests/rules_view_install.rb"
2
2
 
3
3
  module RulesView
4
4
  module Generators
@@ -11,7 +11,7 @@ module RulesView
11
11
  end
12
12
 
13
13
  def install
14
- ApplicationManifest.populate_record(self, "rules_view")
14
+ RulesViewInstallManifest.populate_record(self, "rules_view")
15
15
  puts InstallGenerator.description_all
16
16
  end
17
17
 
@@ -21,6 +21,22 @@ module RulesView
21
21
  To add the rules view to you application
22
22
  > script/rails generate rules_view:install
23
23
 
24
+ > mkdir public/javascripts/jquery
25
+ > curl http://github.com/rails/jquery-ujs/raw/master/src/rails.js > public/javascripts/rails.js
26
+ > curl http://code.jquery.com/jquery-1.4.3.min.js > public/javascripts/jquery/jquery-1.4.3.min.js
27
+ > curl http://github.com/malsup/blockui/raw/master/jquery.blockUI.js?v2.31 > public/javascripts/jquery/jquery.blockUI.js
28
+ > curl http://fancybox.googlecode.com/files/jquery.fancybox-1.3.1.zip > public/javascripts/jquery/jquery.fancybox-1.3.1.zip
29
+ > unzip public/javascripts/jquery/jquery.fancybox-1.3.1.zip -d public/javascripts/jquery
30
+ > rm public/javascripts/jquery/jquery.fancybox-1.3.1.zip
31
+
32
+
33
+ > mkdir public/stylesheets/blueprint
34
+ > mkdir public/stylesheets/blueprint/src
35
+ > curl http://github.com/joshuaclayton/blueprint-css/raw/master/blueprint/ie.css > public/stylesheets/blueprint/ie.css
36
+ > curl http://github.com/joshuaclayton/blueprint-css/raw/master/blueprint/print.css > public/stylesheets/blueprint/print.css
37
+ > curl http://github.com/joshuaclayton/blueprint-css/raw/master/blueprint/screen.css > public/stylesheets/blueprint/screen.css
38
+ > curl http://github.com/joshuaclayton/blueprint-css/raw/master/blueprint/src/grid.png > public/stylesheets/blueprint/src/grid.png
39
+
24
40
  Then set the layout to use in the controller
25
41
  class MyCoolController < ApplicationController
26
42
  layout 'rules_view'
@@ -1,4 +1,4 @@
1
- require "#{File.dirname(__FILE__)}/manifests/layout.rb"
1
+ require "#{File.dirname(__FILE__)}/manifests/rules_view_layout.rb"
2
2
 
3
3
  module RulesView
4
4
  module Generators
@@ -15,7 +15,7 @@ module RulesView
15
15
  if @layout_name.blank?
16
16
  puts " ***************** layout_name required ***************** "
17
17
  else
18
- LayoutManifest.populate_record(self, @layout_name)
18
+ RulesViewLayoutManifest.populate_record(self, @layout_name)
19
19
  end
20
20
  puts LayoutGenerator.description
21
21
  end
@@ -0,0 +1,50 @@
1
+ class RulesViewInstallManifest
2
+ def self.populate_record(m, rule_name)
3
+
4
+ %W(
5
+ config/initializers
6
+ doc
7
+ public/javascripts/rules_view
8
+ public/stylesheets/rules_view
9
+ public/stylesheets/rules_view/images
10
+ public/stylesheets/rules_view/images/re_view_box
11
+ public/stylesheets/rules_view/images/re_view_button
12
+ public/stylesheets/rules_view/images/re_view_error
13
+ public/stylesheets/rules_view/images/re_view_navigate
14
+ ).each do |dirname|
15
+ m.empty_directory dirname
16
+ end
17
+
18
+ %W(
19
+ config/initializers/rules_view.rb
20
+ doc/README.rules_view
21
+ public/javascripts/rules_view/rules_view.js
22
+ public/stylesheets/rules_view/images/re_view_box/shadowbox.png
23
+ public/stylesheets/rules_view/images/re_view_box/whitebox.jpg
24
+ public/stylesheets/rules_view/images/re_view_button/checked-off.gif
25
+ public/stylesheets/rules_view/images/re_view_button/checked-on.gif
26
+ public/stylesheets/rules_view/images/re_view_button/icon-add.png
27
+ public/stylesheets/rules_view/images/re_view_button/icon-delete.png
28
+ public/stylesheets/rules_view/images/re_view_button/list-add.png
29
+ public/stylesheets/rules_view/images/re_view_button/list-remove.png
30
+ public/stylesheets/rules_view/images/re_view_button/list-select.png
31
+ public/stylesheets/rules_view/images/re_view_button/oval-blue-left.gif
32
+ public/stylesheets/rules_view/images/re_view_button/oval-blue-right.gif
33
+ public/stylesheets/rules_view/images/re_view_button/oval-gray-left.gif
34
+ public/stylesheets/rules_view/images/re_view_button/oval-gray-right.gif
35
+ public/stylesheets/rules_view/images/re_view_button/oval-green-left.gif
36
+ public/stylesheets/rules_view/images/re_view_button/oval-green-right.gif
37
+ public/stylesheets/rules_view/images/re_view_button/oval-orange-left.gif
38
+ public/stylesheets/rules_view/images/re_view_button/oval-orange-right.gif
39
+ public/stylesheets/rules_view/images/re_view_button/oval-red-left.gif
40
+ public/stylesheets/rules_view/images/re_view_button/oval-red-right.gif
41
+ public/stylesheets/rules_view/images/re_view_error/re-alert-close.png
42
+ public/stylesheets/rules_view/images/re_view_navigate/breadcrumb.png
43
+ public/stylesheets/rules_view/rules_view.css
44
+ ).each do |filename|
45
+ m.copy_file filename, filename
46
+ end
47
+
48
+
49
+ end
50
+ end
@@ -1,4 +1,4 @@
1
- class LayoutManifest
1
+ class RulesViewLayoutManifest
2
2
  def self.populate_record(m, rule_name)
3
3
 
4
4
  %W(
@@ -1,37 +1,29 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
- <html xmlns="http://www.w3.org/1999/xhtml">
1
+ <!DOCTYPE html>
2
+ <html>
3
3
  <head>
4
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
5
- <title> <%%= (page_title = yield :defer_page_title) ? page_title : controller.controller_name.humanize %> </title>
4
+ <title> <%%= (page_title = yield :defer_re_title) ? page_title : controller.controller_name.humanize %> </title>
6
5
 
7
- <link rel="stylesheet" href="/stylesheets/rules_engine/blueprint/screen.css" type="text/css" media="screen, projection">
8
- <link rel="stylesheet" href="/stylesheets/rules_engine/blueprint/print.css" type="text/css" media="print">
6
+ <link rel="stylesheet" href="/stylesheets/blueprint/screen.css" type="text/css" media="screen, projection">
7
+ <link rel="stylesheet" href="/stylesheets/blueprint/print.css" type="text/css" media="print">
9
8
  <!--[if lt IE 8]>
10
- <link rel="stylesheet" href="/stylesheets/rules_engine/blueprint/ie.css" type="text/css" media="screen, projection">
9
+ <link rel="stylesheet" href="/stylesheets/blueprint/ie.css" type="text/css" media="screen, projection">
11
10
  <![endif]-->
12
11
 
13
- <link rel="stylesheet" href="/stylesheets/rules_view/blueprint/screen.css" type="text/css" media="screen, projection">
14
- <link rel="stylesheet" href="/stylesheets/rules_view/blueprint/print.css" type="text/css" media="print">
15
- <!--[if lt IE 8]>
16
- <link rel="stylesheet" href="/stylesheets/rules_view/blueprint/ie.css" type="text/css" media="screen, projection">
17
- <![endif]-->
18
-
19
- <%%= javascript_include_tag 'rules_view/jquery-1.4.2.min',
20
- 'rules_view/jquery.blockUI',
21
- 'rules_view/jquery.autocomplete.pack',
22
- 'rules_view/jquery.fancybox-1.3.1',
23
- 'rules_view/rules_view',
24
- :cache => true %%>
12
+ <%%= javascript_include_tag 'jquery/jquery-1.4.3.min.js' %>
13
+ <%%= javascript_include_tag 'jquery/jquery.blockUI.js' %>
14
+ <%%= javascript_include_tag 'jquery/jquery.fancybox-1.3.1/fancybox/jquery.fancybox-1.3.1.js' %>
15
+ <%%= stylesheet_link_tag '/javascripts/jquery/jquery.fancybox-1.3.1/fancybox/jquery.fancybox-1.3.1.css' %>
16
+ <%%= stylesheet_link_tag 'rules_view/rules_view' %>
25
17
 
26
- <%%= stylesheet_link_tag 'rules_view/rules_view',
27
- 'rules_view/jquery.autocomplete',
28
- 'rules_view/fancybox/jquery.fancybox-1.3.1',
29
- :cache => true %%>
30
-
31
- <%%= csrf_meta_tag %%>
32
- <%%= yield :defer_re_javascript_include %%>
18
+ <%%= stylesheet_link_tag :all %>
19
+ <%%= javascript_include_tag :defaults %>
20
+
21
+ <%%= yield :defer_re_javascript_include %>
22
+
23
+ <%%= csrf_meta_tag %>
33
24
  </head>
34
25
  <body>
26
+
35
27
  <div class="container re_container">
36
28
  <%%#= render '/layouts/header' %>
37
29
 
@@ -39,9 +31,9 @@
39
31
  <%%= re_alert %>
40
32
 
41
33
  <%%= yield %>
42
-
43
34
  <div class="clear top-10"></div>
44
35
  <%%#= render '/layouts/footer' %>
45
36
  </div>
37
+
46
38
  </body>
47
39
  </html>
@@ -1,3 +1,33 @@
1
+ ##########################################################
2
+ = rules_view
3
+
4
+ To add the rules view to you application
5
+ > script/rails generate rules_view:install
6
+
7
+ > mkdir public/javascripts/jquery
8
+ > curl http://github.com/rails/jquery-ujs/raw/master/src/rails.js > public/javascripts/rails.js
9
+ > curl http://code.jquery.com/jquery-1.4.3.min.js > public/javascripts/jquery/jquery-1.4.3.min.js
10
+ > curl http://github.com/malsup/blockui/raw/master/jquery.blockUI.js?v2.31 > public/javascripts/jquery/jquery.blockUI.js
11
+ > curl http://fancybox.googlecode.com/files/jquery.fancybox-1.3.1.zip > public/javascripts/jquery/jquery.fancybox-1.3.1.zip
12
+ > unzip public/javascripts/jquery/jquery.fancybox-1.3.1.zip -d public/javascripts/jquery
13
+ > rm public/javascripts/jquery/jquery.fancybox-1.3.1.zip
14
+
15
+ > mkdir public/stylesheets/blueprint
16
+ > mkdir public/stylesheets/blueprint/src
17
+ > curl http://github.com/joshuaclayton/blueprint-css/raw/master/blueprint/ie.css > public/stylesheets/blueprint/ie.css
18
+ > curl http://github.com/joshuaclayton/blueprint-css/raw/master/blueprint/print.css > public/stylesheets/blueprint/print.css
19
+ > curl http://github.com/joshuaclayton/blueprint-css/raw/master/blueprint/screen.css > public/stylesheets/blueprint/screen.css
20
+ > curl http://github.com/joshuaclayton/blueprint-css/raw/master/blueprint/src/grid.png > public/stylesheets/blueprint/src/grid.png
21
+
22
+ Then set the layout to use in the controller
23
+
24
+ class MyCoolController < ApplicationController
25
+ layout 'rules_view'
26
+ ...
27
+
28
+ To install and modify the rules_view layout
29
+ > script/rails generate rules_view:layout [layout_name]
30
+
1
31
  ##########################################################
2
32
  = form_styles
3
33
 
@@ -1,5 +1,12 @@
1
1
  module RulesView
2
2
  module Defer
3
+
4
+ def set_re_title(title)
5
+ content_for :defer_re_title do
6
+ title
7
+ end
8
+ end
9
+
3
10
 
4
11
  def set_re_javascript_include(javascript_include_or_array)
5
12
  content_for :defer_re_javascript_include do
@@ -1,5 +1,24 @@
1
1
  require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
2
2
 
3
+ describe "set_re_title" do
4
+ include RSpec::Rails::HelperExampleGroup
5
+
6
+ it "should be accessible to rails apps by default" do
7
+ ActionView::Base.new.methods.should include("set_re_title")
8
+ end
9
+
10
+ it "should set defer_re_title" do
11
+ helper.should_receive(:content_for).with(:defer_re_title)
12
+ helper.set_re_title('me')
13
+ end
14
+
15
+ it "should set defer_re_title variable " do
16
+ helper.set_re_title('me')
17
+ helper.instance_variable_get(:@_content_for)[:defer_re_title].should == 'me'
18
+ end
19
+ end
20
+
21
+
3
22
  describe "set_re_javascript_include" do
4
23
  include RSpec::Rails::HelperExampleGroup
5
24
 
@@ -1,6 +1,7 @@
1
1
  source 'http://rubygems.org'
2
2
 
3
- gem 'rails', '3.0.0'
3
+ gem 'rails', '3.0.1'
4
+
4
5
  gem 'rules_view', :path => '../../'
5
6
 
6
7
  gem 'sqlite3-ruby', :require => 'sqlite3'
@@ -10,4 +11,4 @@ group :development, :test do
10
11
  gem "webrat"
11
12
 
12
13
  gem 'rcov'
13
- end
14
+ end
File without changes
@@ -4,4 +4,4 @@
4
4
  require File.expand_path('../config/application', __FILE__)
5
5
  require 'rake'
6
6
 
7
- Rails300Root::Application.load_tasks
7
+ Rails301Root::Application.load_tasks
@@ -1,7 +1,7 @@
1
1
  <!DOCTYPE html>
2
2
  <html>
3
3
  <head>
4
- <title>Rails300Root</title>
4
+ <title>Rails301Root</title>
5
5
  <%= stylesheet_link_tag :all %>
6
6
  <%= javascript_include_tag :defaults %>
7
7
  <%= csrf_meta_tag %>
@@ -6,7 +6,7 @@ require 'rails/all'
6
6
  # you've limited to :test, :development, or :production.
7
7
  Bundler.require(:default, Rails.env) if defined?(Bundler)
8
8
 
9
- module Rails300Root
9
+ module Rails301Root
10
10
  class Application < Rails::Application
11
11
  # Settings in config/environments/* take precedence over those specified here.
12
12
  # Application configuration should go into files in config/initializers
@@ -2,4 +2,4 @@
2
2
  require File.expand_path('../application', __FILE__)
3
3
 
4
4
  # Initialize the rails application
5
- Rails300Root::Application.initialize!
5
+ Rails301Root::Application.initialize!
@@ -1,4 +1,4 @@
1
- Rails300Root::Application.configure do
1
+ Rails301Root::Application.configure do
2
2
  # Settings specified here will take precedence over those in config/environment.rb
3
3
 
4
4
  # In the development environment your application's code is reloaded on
@@ -1,4 +1,4 @@
1
- Rails300Root::Application.configure do
1
+ Rails301Root::Application.configure do
2
2
  # Settings specified here will take precedence over those in config/environment.rb
3
3
 
4
4
  # The production environment is meant for finished, "live" apps.
@@ -1,4 +1,4 @@
1
- Rails300Root::Application.configure do
1
+ Rails301Root::Application.configure do
2
2
  # Settings specified here will take precedence over those in config/environment.rb
3
3
 
4
4
  # The test environment is used exclusively to run your application's
@@ -4,4 +4,4 @@
4
4
  # If you change this key, all old signed cookies will become invalid!
5
5
  # Make sure the secret is at least 30 characters and all random,
6
6
  # no regular words or you'll be exposed to dictionary attacks.
7
- Rails300Root::Application.config.secret_token = '7edf3c861d8e6feb25e2c09ce0160090c7747150fa89205d74b48b4a2cec4e4febe40fb65afa5431a4844bc3cb0eb19f43115b2350ae23ed6495e98915544200'
7
+ Rails301Root::Application.config.secret_token = '4d0200b2f94bd85b2de5c558fccb334e1d5ede9b1611a3eba2afddf868a8cb20b0a4da795e483ba51f9ddcaa2c27880ac955e0274541a3890a82879c050d6f41'
@@ -1,8 +1,8 @@
1
1
  # Be sure to restart your server when you modify this file.
2
2
 
3
- Rails300Root::Application.config.session_store :cookie_store, :key => '_rails_3_0_0_root_session'
3
+ Rails301Root::Application.config.session_store :cookie_store, :key => '_rails_3_0_1_root_session'
4
4
 
5
5
  # Use the database for sessions instead of the cookie-based default,
6
6
  # which shouldn't be used to store highly confidential information
7
7
  # (create the session table with "rake db:sessions:create")
8
- # Rails300Root::Application.config.session_store :active_record_store
8
+ # Rails301Root::Application.config.session_store :active_record_store
@@ -1,4 +1,4 @@
1
- Rails300Root::Application.routes.draw do
1
+ Rails301Root::Application.routes.draw do
2
2
  # The priority is based upon order of creation:
3
3
  # first created -> highest priority.
4
4
 
@@ -1,4 +1,4 @@
1
1
  # This file is used by Rack-based servers to start the application.
2
2
 
3
3
  require ::File.expand_path('../config/environment', __FILE__)
4
- run Rails300Root::Application
4
+ run Rails301Root::Application