remote_partial 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 (98) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/README.rdoc +63 -0
  3. data/Rakefile +40 -0
  4. data/app/helpers/remote_partial/application_helper.rb +4 -0
  5. data/app/helpers/remote_partial/host_app_helper.rb +11 -0
  6. data/app/models/remote_partial/builder.rb +30 -0
  7. data/app/models/remote_partial/exceptions.rb +24 -0
  8. data/app/models/remote_partial/partial.rb +57 -0
  9. data/app/models/remote_partial/resource_manager.rb +66 -0
  10. data/config/routes.rb +2 -0
  11. data/db/migrate/20130702072157_create_remote_partial_partials.rb +12 -0
  12. data/lib/remote_partial/engine.rb +11 -0
  13. data/lib/remote_partial/version.rb +3 -0
  14. data/lib/remote_partial.rb +23 -0
  15. data/lib/tasks/remote_partial_tasks.rake +10 -0
  16. data/test/dummy/README.rdoc +261 -0
  17. data/test/dummy/Rakefile +7 -0
  18. data/test/dummy/app/assets/javascripts/application.js +15 -0
  19. data/test/dummy/app/assets/javascripts/demos.js +2 -0
  20. data/test/dummy/app/assets/javascripts/samples.js +2 -0
  21. data/test/dummy/app/assets/stylesheets/application.css +13 -0
  22. data/test/dummy/app/assets/stylesheets/demos.css +4 -0
  23. data/test/dummy/app/assets/stylesheets/samples.css +4 -0
  24. data/test/dummy/app/controllers/application_controller.rb +3 -0
  25. data/test/dummy/app/controllers/demos_controller.rb +18 -0
  26. data/test/dummy/app/helpers/application_helper.rb +2 -0
  27. data/test/dummy/app/helpers/demos_helper.rb +2 -0
  28. data/test/dummy/app/helpers/samples_helper.rb +2 -0
  29. data/test/dummy/app/views/demos/_clock.html.erb +6 -0
  30. data/test/dummy/app/views/demos/_fixed.html.erb +3 -0
  31. data/test/dummy/app/views/demos/_ruby.html.erb +4 -0
  32. data/test/dummy/app/views/demos/index.html.erb +7 -0
  33. data/test/dummy/app/views/demos/show.html.erb +3 -0
  34. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  35. data/test/dummy/app/views/remote_partials/_clock.html.erb +1 -0
  36. data/test/dummy/app/views/remote_partials/_fixed.html.erb +2 -0
  37. data/test/dummy/app/views/remote_partials/_ruby.html.erb +11 -0
  38. data/test/dummy/app/views/remote_partials/_wcc.html.erb +810 -0
  39. data/test/dummy/config/application.rb +59 -0
  40. data/test/dummy/config/boot.rb +10 -0
  41. data/test/dummy/config/database.yml +25 -0
  42. data/test/dummy/config/environment.rb +5 -0
  43. data/test/dummy/config/environments/development.rb +37 -0
  44. data/test/dummy/config/environments/production.rb +67 -0
  45. data/test/dummy/config/environments/test.rb +37 -0
  46. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  47. data/test/dummy/config/initializers/inflections.rb +15 -0
  48. data/test/dummy/config/initializers/mime_types.rb +5 -0
  49. data/test/dummy/config/initializers/remote_partial.rb +16 -0
  50. data/test/dummy/config/initializers/secret_token.rb +7 -0
  51. data/test/dummy/config/initializers/session_store.rb +8 -0
  52. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  53. data/test/dummy/config/locales/en.yml +5 -0
  54. data/test/dummy/config/routes.rb +8 -0
  55. data/test/dummy/config.ru +4 -0
  56. data/test/dummy/db/development.sqlite3 +0 -0
  57. data/test/dummy/db/migrate/20130703141929_create_remote_partial_partials.remote_partial.rb +13 -0
  58. data/test/dummy/db/schema.rb +26 -0
  59. data/test/dummy/db/test.sqlite3 +0 -0
  60. data/test/dummy/log/development.log +4200 -0
  61. data/test/dummy/log/test.log +1397 -0
  62. data/test/dummy/public/404.html +26 -0
  63. data/test/dummy/public/422.html +26 -0
  64. data/test/dummy/public/500.html +25 -0
  65. data/test/dummy/public/favicon.ico +0 -0
  66. data/test/dummy/script/rails +6 -0
  67. data/test/dummy/test/functional/demos_controller_test.rb +20 -0
  68. data/test/dummy/test/unit/helpers/demos_helper_test.rb +13 -0
  69. data/test/dummy/test/unit/helpers/samples_helper_test.rb +4 -0
  70. data/test/dummy/tmp/cache/assets/BE9/0F0/sprockets%2Fb918d6cc641337193b96751002451244 +0 -0
  71. data/test/dummy/tmp/cache/assets/C2E/4E0/sprockets%2F5b29288e435665a224409e7d76530c95 +0 -0
  72. data/test/dummy/tmp/cache/assets/CB3/DC0/sprockets%2F157201713d2fd4954447e0bf4d8e853e +0 -0
  73. data/test/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953 +0 -0
  74. data/test/dummy/tmp/cache/assets/CE3/080/sprockets%2F7d4d7689d6fa8236f0b4848c03ba1215 +0 -0
  75. data/test/dummy/tmp/cache/assets/CE5/D30/sprockets%2F8c9834a63b25a66203918a75ff56e2ac +0 -0
  76. data/test/dummy/tmp/cache/assets/D16/E10/sprockets%2Fd5d9c442561ec08a55d5d843a0d9792d +0 -0
  77. data/test/dummy/tmp/cache/assets/D20/020/sprockets%2F488c2c97fede45c86a62f1aa14554957 +0 -0
  78. data/test/dummy/tmp/cache/assets/D2E/690/sprockets%2F840591ad233bc7bda28b7f6a2b27c205 +0 -0
  79. data/test/dummy/tmp/cache/assets/D30/990/sprockets%2F995cc20d042afc03241f58f7d6ca1f02 +0 -0
  80. data/test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
  81. data/test/dummy/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655 +0 -0
  82. data/test/dummy/tmp/cache/assets/D52/430/sprockets%2F6ada07f0c9869f9f35b05fa0988dc717 +0 -0
  83. data/test/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6 +0 -0
  84. data/test/dummy/tmp/cache/assets/DBB/BE0/sprockets%2Fc6eb578d23a69b5abb056e3abaa5c060 +0 -0
  85. data/test/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994 +0 -0
  86. data/test/dummy/tmp/cache/assets/E02/FA0/sprockets%2Fca8d5771d03e669be1d96acb6beb6cb6 +0 -0
  87. data/test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
  88. data/test/dummy/tmp/pids/server.pid +1 -0
  89. data/test/fixtures/remote_partial/partials.yml +10 -0
  90. data/test/integration/navigation_test.rb +10 -0
  91. data/test/remote_partial_test.rb +7 -0
  92. data/test/test_helper.rb +80 -0
  93. data/test/unit/remote_partial/builder_test.rb +113 -0
  94. data/test/unit/remote_partial/exception_test.rb +21 -0
  95. data/test/unit/remote_partial/partial_test.rb +66 -0
  96. data/test/unit/remote_partial/resource_manager_test.rb +76 -0
  97. data/test/unit/remote_partial_test.rb +26 -0
  98. metadata +291 -0
@@ -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,4 @@
1
+ /*
2
+ Place all the styles related to the matching controller here.
3
+ They will automatically be included in application.css.
4
+ */
@@ -0,0 +1,4 @@
1
+ /*
2
+ Place all the styles related to the matching controller here.
3
+ They will automatically be included in application.css.
4
+ */
@@ -0,0 +1,3 @@
1
+ class ApplicationController < ActionController::Base
2
+ protect_from_forgery
3
+ end
@@ -0,0 +1,18 @@
1
+ class DemosController < ApplicationController
2
+ def index
3
+ @demos = demos
4
+ end
5
+
6
+ def show
7
+ @demo = params[:id]
8
+ end
9
+
10
+ private
11
+ def demos
12
+ [
13
+ 'fixed',
14
+ 'clock',
15
+ 'ruby'
16
+ ]
17
+ end
18
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
@@ -0,0 +1,2 @@
1
+ module DemosHelper
2
+ end
@@ -0,0 +1,2 @@
1
+ module SamplesHelper
2
+ end
@@ -0,0 +1,6 @@
1
+ <p>
2
+ Below is the time as shown on a remote site. This time is frozen at the
3
+ point when this remote partial was last updated.
4
+ </p>
5
+
6
+ <%= render_remote_partial 'clock' %>
@@ -0,0 +1,3 @@
1
+ <p>In this example, the content of the fixed partial is inserted below:</p>
2
+
3
+ <%= render_remote_partial 'fixed' %>
@@ -0,0 +1,4 @@
1
+ <h2>We love Ruby</h2>
2
+ <p>This is some content grabbed from ruby-lang.org</p>
3
+
4
+ <%= render_remote_partial 'ruby' %>
@@ -0,0 +1,7 @@
1
+ <h1>Demos</h1>
2
+ <p>The following demos are available:</p>
3
+ <ul>
4
+ <% @demos.each do |demo| %>
5
+ <li><%= link_to demo, demo_path(demo) %></li>
6
+ <% end %>
7
+ </ul>
@@ -0,0 +1,3 @@
1
+ <p><%= link_to 'Home', root_path %></p>
2
+ <h1><%= @demo.humanize %></h2>
3
+ <%= render partial: @demo %>
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Remote Partial Dummy App</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 @@
1
+ <strong id="ct" class="big">Thursday, July 4, 2013 at 4:18:38 PM</strong>
@@ -0,0 +1,2 @@
1
+ <h2>Some content</h2>
2
+ <p>From remote_partials/_fixed.html.erb<p>
@@ -0,0 +1,11 @@
1
+ <div id="intro">
2
+ <h1>Ruby is...</h1>
3
+
4
+ <p>
5
+ A dynamic, open source programming language with a focus on
6
+ simplicity and productivity. It has an elegant syntax that is
7
+ natural to read and easy to write.
8
+ </p>
9
+
10
+ <a href="about/">Read More...</a>
11
+ </div>