noodall-components-quote 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/MIT-LICENSE +20 -0
- data/README.markdown +25 -0
- data/Rakefile +37 -0
- data/app/models/quote.rb +8 -0
- data/app/views/admin/components/_quote.html.erb +28 -0
- data/app/views/components/_quote.html.erb +9 -0
- data/config/routes.rb +2 -0
- data/lib/noodall-components-quote.rb +4 -0
- data/lib/noodall-components-quote/engine.rb +4 -0
- data/lib/noodall-components-quote/version.rb +3 -0
- data/lib/tasks/cucumber.rake +65 -0
- data/lib/tasks/noodall-components-quote_tasks.rake +4 -0
- data/test/dummy/Rakefile +7 -0
- data/test/dummy/app/assets/javascripts/application.js +9 -0
- data/test/dummy/app/assets/stylesheets/application.css +7 -0
- data/test/dummy/app/controllers/application_controller.rb +26 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/models/content_page.rb +8 -0
- data/test/dummy/app/models/user.rb +20 -0
- data/test/dummy/app/views/admin/nodes/_content_page.html.erb +45 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/app/views/nodes/content_page.html.erb +5 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/config/application.rb +51 -0
- data/test/dummy/config/boot.rb +10 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +30 -0
- data/test/dummy/config/environments/production.rb +60 -0
- data/test/dummy/config/environments/test.rb +39 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/inflections.rb +10 -0
- data/test/dummy/config/initializers/mime_types.rb +5 -0
- data/test/dummy/config/initializers/noodall.rb +1 -0
- data/test/dummy/config/initializers/noodall_dragonfly.rb +8 -0
- data/test/dummy/config/initializers/secret_token.rb +7 -0
- data/test/dummy/config/initializers/session_store.rb +8 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +10 -0
- data/test/dummy/config/locales/en.yml +5 -0
- data/test/dummy/config/mongo.yml +6 -0
- data/test/dummy/config/routes.rb +3 -0
- data/test/dummy/log/development.log +2 -0
- data/test/dummy/log/test.log +4996 -0
- data/test/dummy/public/404.html +26 -0
- data/test/dummy/public/422.html +26 -0
- data/test/dummy/public/500.html +26 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/script/rails +6 -0
- data/test/dummy/tmp/cache/762/0A0/global_update_time +0 -0
- data/test/dummy/tmp/cache/assets/C15/AB0/sprockets%2Ff0065594cb31b867823133b060085d72 +0 -0
- data/test/dummy/tmp/cache/assets/C3F/5E0/sprockets%2Fc306313426065c24b800c5273ed5e348 +0 -0
- data/test/dummy/tmp/cache/assets/C74/670/sprockets%2F3981f069f7a96682c2b366bf49889355 +0 -0
- data/test/dummy/tmp/cache/assets/C89/560/sprockets%2F508294d61b41bbab93832396f396e493 +0 -0
- data/test/dummy/tmp/cache/assets/C8C/710/sprockets%2Fcc72f6168841b64e8468bd6f77472010 +0 -0
- data/test/dummy/tmp/cache/assets/C8C/9B0/sprockets%2F9e82832acb4770b57f848d4f29005841 +0 -0
- data/test/dummy/tmp/cache/assets/C91/6D0/sprockets%2F36b598f922dc85433b449f474251df54 +0 -0
- data/test/dummy/tmp/cache/assets/CAD/220/sprockets%2F606db81d8a1595f4e0365a0473182be7 +0 -0
- data/test/dummy/tmp/cache/assets/CB7/290/sprockets%2F3f18162b8a7658d278f4320f71d38d2d +0 -0
- data/test/dummy/tmp/cache/assets/CBA/3A0/sprockets%2F6a9c387d1f24473a640805e9b94423ff +0 -0
- data/test/dummy/tmp/cache/assets/CBB/1E0/sprockets%2F9518404e78db5e74d0590dc2283fb917 +0 -0
- data/test/dummy/tmp/cache/assets/CC6/CA0/sprockets%2Fe84d769a5990967243cb0e3f772c2e29 +0 -0
- data/test/dummy/tmp/cache/assets/CCC/430/sprockets%2F3120e67b7c0705c098913083ada0adb7 +0 -0
- data/test/dummy/tmp/cache/assets/CD2/610/sprockets%2Fb0a68a401430d5b669e5897fbd0600b2 +0 -0
- data/test/dummy/tmp/cache/assets/CD2/B00/sprockets%2F6e350f7128c098051e1d63b1eb610be6 +0 -0
- data/test/dummy/tmp/cache/assets/CDC/030/sprockets%2Fd25a8225706528f78d7bb13ce037ac63 +0 -0
- data/test/dummy/tmp/cache/assets/CE0/BF0/sprockets%2F3226b8918a3c3cae94980c058c5800ee +0 -0
- data/test/dummy/tmp/cache/assets/CE2/F80/sprockets%2F34f0d095b9e2a7bac7839904e97100d5 +0 -0
- data/test/dummy/tmp/cache/assets/CE3/9F0/sprockets%2F522daf2a5be9818870ee4716705f4a17 +0 -0
- data/test/dummy/tmp/cache/assets/CEE/7A0/sprockets%2Fc47599969db015fa1578a6d18a04f8a5 +0 -0
- data/test/dummy/tmp/cache/assets/CEF/360/sprockets%2Fa20f850288c727f56374e9de3771adf5 +0 -0
- data/test/dummy/tmp/cache/assets/CEF/5F0/sprockets%2Fc925b5cae611c80d133fc689957837e6 +0 -0
- data/test/dummy/tmp/cache/assets/CF1/530/sprockets%2F1399e99b8f1dae5138070c86553bb7f6 +0 -0
- data/test/dummy/tmp/cache/assets/CF8/850/sprockets%2F85969f780f7487cc5152ced089ac422f +0 -0
- data/test/dummy/tmp/cache/assets/CFA/5A0/sprockets%2F121d764aa3a7f51060b84e3536b0ce7a +0 -0
- data/test/dummy/tmp/cache/assets/CFB/820/sprockets%2F3c101ba654c085113155f9d3db5e0c9c +0 -0
- data/test/dummy/tmp/cache/assets/CFD/B00/sprockets%2F7f0479353858c8f8815e36bdea5f2e94 +0 -0
- data/test/dummy/tmp/cache/assets/CFF/230/sprockets%2F4777923cc17b0b116bd95abd2772ca10 +0 -0
- data/test/dummy/tmp/cache/assets/D02/900/sprockets%2F69932284cb1a2d117e7ab536915aacd0 +0 -0
- data/test/dummy/tmp/cache/assets/D0B/380/sprockets%2Fba25a37b75402323591499a9aef4bd3f +0 -0
- data/test/dummy/tmp/cache/assets/D0D/2D0/sprockets%2Fbe47518e9b137d1dcbe8734b04c42338 +0 -0
- data/test/dummy/tmp/cache/assets/D0F/860/sprockets%2F43721444d2b17706bd98146de3ef7ace +0 -0
- data/test/dummy/tmp/cache/assets/D1C/0D0/sprockets%2F47edd4a851ccdf3d81d892d546472095 +0 -0
- data/test/dummy/tmp/cache/assets/D1D/7A0/sprockets%2F2d7d015e89a819eedc179641f1e54b76 +0 -0
- data/test/dummy/tmp/cache/assets/D1F/2B0/sprockets%2F8171859f8939b420da92c53a0e65deff +0 -0
- data/test/dummy/tmp/cache/assets/D20/340/sprockets%2Fa3762f8625018bd99f6eca73a68b648c +0 -0
- data/test/dummy/tmp/cache/assets/D20/960/sprockets%2F465ea6122562e758fbac8c9383cb6f69 +0 -0
- data/test/dummy/tmp/cache/assets/D2A/B70/sprockets%2Ff20481790bc1a834aeb2702d5dd1d18a +0 -0
- data/test/dummy/tmp/cache/assets/D2C/AD0/sprockets%2Fa4d5c756e4f4f25f8d9b75fb63077975 +0 -0
- data/test/dummy/tmp/cache/assets/D2F/6C0/sprockets%2F01ad576a34408058ae7abeae06e0f518 +0 -0
- data/test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/test/dummy/tmp/cache/assets/D37/0B0/sprockets%2F122e9fdb3703d2ee871c4bd2616fb353 +0 -0
- data/test/dummy/tmp/cache/assets/D37/250/sprockets%2F7f4c3bf3c85603c059303ae2fc6b76b1 +0 -0
- data/test/dummy/tmp/cache/assets/D37/9A0/sprockets%2F24fb10d2b9f361ff826deec2045294d0 +0 -0
- data/test/dummy/tmp/cache/assets/D3B/060/sprockets%2F6e198fce718d7a5d33d2c522ebb23207 +0 -0
- data/test/dummy/tmp/cache/assets/D3B/720/sprockets%2Facea2e3e92ba40501b7641794dd5f973 +0 -0
- data/test/dummy/tmp/cache/assets/D3C/040/sprockets%2F2c084de8a28b082383cb3c49f3d9af13 +0 -0
- data/test/dummy/tmp/cache/assets/D44/DF0/sprockets%2F6b189886c2a973b2c61be35dbb9aa942 +0 -0
- data/test/dummy/tmp/cache/assets/D46/640/sprockets%2F8ce377034e3a139ad749e2ed90f7a65a +0 -0
- data/test/dummy/tmp/cache/assets/D48/3E0/sprockets%2F8e5c1734eb3549fc958c8cc30a6ca824 +0 -0
- data/test/dummy/tmp/cache/assets/D49/350/sprockets%2Ff773cf266e73990d5c81eb0c608dd50d +0 -0
- data/test/dummy/tmp/cache/assets/D4E/0F0/sprockets%2F6b832925c38ccdd927dd458836a6fcc2 +0 -0
- data/test/dummy/tmp/cache/assets/D4E/AA0/sprockets%2Fe58a300d97997eceb943ebcd1b508585 +0 -0
- data/test/dummy/tmp/cache/assets/D4F/120/sprockets%2F80e9c01bf9f520b9bd584f67aff26809 +0 -0
- data/test/dummy/tmp/cache/assets/D54/1D0/sprockets%2Fedfa864887f43db6d08714708ae1d78e +0 -0
- data/test/dummy/tmp/cache/assets/D54/ED0/sprockets%2F71c9fa01091d432b131da3bb73faf3d4 +0 -0
- data/test/dummy/tmp/cache/assets/D56/320/sprockets%2Feb2645cf8ff7ba307909149fc6891d8d +0 -0
- data/test/dummy/tmp/cache/assets/D58/180/sprockets%2F00e2b05a007b6ad6ebaf78d29203de54 +0 -0
- data/test/dummy/tmp/cache/assets/D61/490/sprockets%2Fa34cad241fe74b350aa385f87710cc7b +0 -0
- data/test/dummy/tmp/cache/assets/D64/E80/sprockets%2F01eab3b05fb5fad33039278f1853fdb7 +0 -0
- data/test/dummy/tmp/cache/assets/D65/930/sprockets%2Ffefc7bbbf113f4c7e73144aa61549402 +0 -0
- data/test/dummy/tmp/cache/assets/D68/A70/sprockets%2F0ab2a93b790f8457d3cc9235dc2e5ea1 +0 -0
- data/test/dummy/tmp/cache/assets/D6A/BE0/sprockets%2Fc3fc54935f7db15f2e175c082c0b8bd2 +0 -0
- data/test/dummy/tmp/cache/assets/D6F/1E0/sprockets%2Fe2dde506f854a8b2dc33fc90be487025 +0 -0
- data/test/dummy/tmp/cache/assets/D74/550/sprockets%2F71837f9ff64afcac26227505abd2f5e5 +0 -0
- data/test/dummy/tmp/cache/assets/D76/2C0/sprockets%2Fc352d5e16e1c878b859b5b2fe66ecb40 +0 -0
- data/test/dummy/tmp/cache/assets/D79/F90/sprockets%2Fdda22965bc89a8bc5e2d8962d7203ff3 +0 -0
- data/test/dummy/tmp/cache/assets/D84/210/sprockets%2Fabd0103ccec2b428ac62c94e4c40b384 +0 -0
- data/test/dummy/tmp/cache/assets/D87/920/sprockets%2Fd34d00ada5a72e49b6dd0ea7e34370a1 +0 -0
- data/test/dummy/tmp/cache/assets/D90/060/sprockets%2Fc3a80ea7cbb4ee570344ecbc1c880704 +0 -0
- data/test/dummy/tmp/cache/assets/D90/AB0/sprockets%2Fde2627dd102e1ed9f200a19bcb5ad496 +0 -0
- data/test/dummy/tmp/cache/assets/D92/2A0/sprockets%2F3fd76a2624317fdec3abb653db4cb083 +0 -0
- data/test/dummy/tmp/cache/assets/D98/D40/sprockets%2F1cdd29fa04a71af5479c1ea81c82dd90 +0 -0
- data/test/dummy/tmp/cache/assets/D9F/B90/sprockets%2F42bf4609bb0c5b9fe70f132485f5dfdc +0 -0
- data/test/dummy/tmp/cache/assets/DAC/B30/sprockets%2F9fa862890874baab5a96ae36be5ed80e +0 -0
- data/test/dummy/tmp/cache/assets/DB1/A70/sprockets%2F68acfb84a9a1bf8dfcf81239581ff456 +0 -0
- data/test/dummy/tmp/cache/assets/DBB/2F0/sprockets%2Fb30026772bcdc44eed37db914db0dc4a +0 -0
- data/test/dummy/tmp/cache/assets/DBF/4D0/sprockets%2Ffd049a7d3b4b80e9e410ab4b241dace8 +0 -0
- data/test/dummy/tmp/cache/assets/DC2/B10/sprockets%2Fec4aebb617fcfab93b31d4719d21e153 +0 -0
- data/test/dummy/tmp/cache/assets/DCD/A60/sprockets%2Fa7fa7fc38ee6d1316f03ee5be66ac225 +0 -0
- data/test/dummy/tmp/cache/assets/DDF/F90/sprockets%2Fbcdba73e98849727ca8bdfc8b3bc5916 +0 -0
- data/test/dummy/tmp/cache/assets/DE4/330/sprockets%2F6c8ca38c5cbef78917867a3a4fdbdc87 +0 -0
- data/test/dummy/tmp/cache/assets/DEB/FA0/sprockets%2Feca88d0de0b0ad0c0b8a32a983c80dd7 +0 -0
- data/test/dummy/tmp/cache/assets/DF2/D70/sprockets%2F406a4aa8de3fff2680e2bdc84c0c2dc4 +0 -0
- data/test/dummy/tmp/cache/assets/DF7/0C0/sprockets%2F34ca55d1f6a9bd8063dd39a3f0d6ecbb +0 -0
- data/test/dummy/tmp/cache/assets/DFF/6C0/sprockets%2F569b9b38ef8ecdd0ae2ae1d72e4427aa +0 -0
- data/test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/test/dummy/tmp/cache/assets/E44/EB0/sprockets%2Fdf6ced787a6181f87ac3ce64ed7ebf5e +0 -0
- data/test/dummy/tmp/cache/assets/E4F/9E0/sprockets%2Fbdad1ed46bdd7c3b1ed8c4a9c6f211b3 +0 -0
- data/test/dummy/tmp/cache/assets/E52/780/sprockets%2Fafe13b5b3afeff0e50a438c6d0e9c3cd +0 -0
- data/test/dummy/tmp/cache/assets/E55/3F0/sprockets%2Fb47daa9c41ce8ff09fe3dab90ab41f3a +0 -0
- data/test/dummy/tmp/cache/assets/E62/2E0/sprockets%2Ffde38caea8b8c7aa1aafc6956a1791ef +0 -0
- metadata +342 -0
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright 2012 Steve England
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.markdown
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# Noodall Quote Component
|
2
|
+
|
3
|
+
A simple quote component for Noodall
|
4
|
+
|
5
|
+
## Install
|
6
|
+
|
7
|
+
Add to your `Gemfile`
|
8
|
+
|
9
|
+
gem 'noodall-components-quote', :git => 'git@github.com:noodall/noodall-components-quote.git'
|
10
|
+
|
11
|
+
Run `bundle install`
|
12
|
+
|
13
|
+
bundle install
|
14
|
+
|
15
|
+
## Configuration
|
16
|
+
|
17
|
+
Noodall Quote adds a `Quote` component. Add it to your slots.
|
18
|
+
|
19
|
+
In `config/initializers/noodall.rb`
|
20
|
+
|
21
|
+
Noodall::Node.slot :large, Quote
|
22
|
+
Noodall::Node.slot :small, Quote
|
23
|
+
|
24
|
+
You can now add `Quote` components to your Nodes.
|
25
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
#!/usr/bin/env rake
|
2
|
+
begin
|
3
|
+
require 'bundler/setup'
|
4
|
+
rescue LoadError
|
5
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
6
|
+
end
|
7
|
+
begin
|
8
|
+
require 'rdoc/task'
|
9
|
+
rescue LoadError
|
10
|
+
require 'rdoc/rdoc'
|
11
|
+
require 'rake/rdoctask'
|
12
|
+
RDoc::Task = Rake::RDocTask
|
13
|
+
end
|
14
|
+
|
15
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
16
|
+
rdoc.rdoc_dir = 'rdoc'
|
17
|
+
rdoc.title = 'NoodallComponentsQuote'
|
18
|
+
rdoc.options << '--line-numbers'
|
19
|
+
rdoc.rdoc_files.include('README.rdoc')
|
20
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
21
|
+
end
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
Bundler::GemHelper.install_tasks
|
26
|
+
|
27
|
+
require 'rake/testtask'
|
28
|
+
|
29
|
+
Rake::TestTask.new(:test) do |t|
|
30
|
+
t.libs << 'lib'
|
31
|
+
t.libs << 'test'
|
32
|
+
t.pattern = 'test/**/*_test.rb'
|
33
|
+
t.verbose = false
|
34
|
+
end
|
35
|
+
|
36
|
+
|
37
|
+
task :default => :test
|
data/app/models/quote.rb
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
<%= fields_for :node do |n| %>
|
2
|
+
<%= n.fields_for slot_name, component do |f| %>
|
3
|
+
<%= f.hidden_field :_type %>
|
4
|
+
<p>
|
5
|
+
<%= f.label :citation %><br/>
|
6
|
+
<span class="input-wrap"><%= f.text_field :citation %></span>
|
7
|
+
</p>
|
8
|
+
<p>
|
9
|
+
<%= f.label :quote %><br/>
|
10
|
+
<span class="input-wrap"><%= f.text_area :quote, rows: 5 %></span>
|
11
|
+
</p>
|
12
|
+
<p class="file-selectable">
|
13
|
+
<% unless component.asset.nil? %>
|
14
|
+
<span class="file-detail"><%= component.asset.image? ? image_tag( component.asset.url('70x70#') ) : asset_icon(component.asset) %></span>
|
15
|
+
<% end -%>
|
16
|
+
<span class="select-file" data-file-types="images">Select File</span>
|
17
|
+
<%= f.hidden_field :asset_id, :class => "asset_id" %>
|
18
|
+
</p>
|
19
|
+
<p>
|
20
|
+
<%= f.label :link %><br />
|
21
|
+
<span class="input-wrap">
|
22
|
+
<%= f.text_field :link %><br/>
|
23
|
+
<span class="link-node">Content</span> |
|
24
|
+
<span class="link-asset">Asset</span>
|
25
|
+
</span>
|
26
|
+
</p>
|
27
|
+
<% end %>
|
28
|
+
<% end %>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<div id="<%= slot_code %>" class="component quote <%= 'double' if expand %> <%= additional_classes %> <%= 'has-image' unless component.asset.nil? %>">
|
2
|
+
<%= image_tag component.asset.url('232x150#'), alt: component.citation unless component.asset.nil? %>
|
3
|
+
<blockquote><%= simple_format component.quote %></blockquote>
|
4
|
+
<% if component.link.blank? %>
|
5
|
+
<span class="author"><%= component.citation %></span>
|
6
|
+
<% else %>
|
7
|
+
<%= link_to component.citation, component.link, :class => "author" %>
|
8
|
+
<% end %>
|
9
|
+
</div>
|
data/config/routes.rb
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.
|
2
|
+
# It is recommended to regenerate this file in the future when you upgrade to a
|
3
|
+
# newer version of cucumber-rails. Consider adding your own code to a new file
|
4
|
+
# instead of editing this one. Cucumber will automatically load all features/**/*.rb
|
5
|
+
# files.
|
6
|
+
|
7
|
+
|
8
|
+
unless ARGV.any? {|a| a =~ /^gems/} # Don't load anything when running the gems:* tasks
|
9
|
+
|
10
|
+
vendored_cucumber_bin = Dir["#{Rails.root}/vendor/{gems,plugins}/cucumber*/bin/cucumber"].first
|
11
|
+
$LOAD_PATH.unshift(File.dirname(vendored_cucumber_bin) + '/../lib') unless vendored_cucumber_bin.nil?
|
12
|
+
|
13
|
+
begin
|
14
|
+
require 'cucumber/rake/task'
|
15
|
+
|
16
|
+
namespace :cucumber do
|
17
|
+
Cucumber::Rake::Task.new({:ok => 'db:test:prepare'}, 'Run features that should pass') do |t|
|
18
|
+
t.binary = vendored_cucumber_bin # If nil, the gem's binary is used.
|
19
|
+
t.fork = true # You may get faster startup if you set this to false
|
20
|
+
t.profile = 'default'
|
21
|
+
end
|
22
|
+
|
23
|
+
Cucumber::Rake::Task.new({:wip => 'db:test:prepare'}, 'Run features that are being worked on') do |t|
|
24
|
+
t.binary = vendored_cucumber_bin
|
25
|
+
t.fork = true # You may get faster startup if you set this to false
|
26
|
+
t.profile = 'wip'
|
27
|
+
end
|
28
|
+
|
29
|
+
Cucumber::Rake::Task.new({:rerun => 'db:test:prepare'}, 'Record failing features and run only them if any exist') do |t|
|
30
|
+
t.binary = vendored_cucumber_bin
|
31
|
+
t.fork = true # You may get faster startup if you set this to false
|
32
|
+
t.profile = 'rerun'
|
33
|
+
end
|
34
|
+
|
35
|
+
desc 'Run all features'
|
36
|
+
task :all => [:ok, :wip]
|
37
|
+
|
38
|
+
task :statsetup do
|
39
|
+
require 'rails/code_statistics'
|
40
|
+
::STATS_DIRECTORIES << %w(Cucumber\ features features) if File.exist?('features')
|
41
|
+
::CodeStatistics::TEST_TYPES << "Cucumber features" if File.exist?('features')
|
42
|
+
end
|
43
|
+
end
|
44
|
+
desc 'Alias for cucumber:ok'
|
45
|
+
task :cucumber => 'cucumber:ok'
|
46
|
+
|
47
|
+
task :default => :cucumber
|
48
|
+
|
49
|
+
task :features => :cucumber do
|
50
|
+
STDERR.puts "*** The 'features' task is deprecated. See rake -T cucumber ***"
|
51
|
+
end
|
52
|
+
|
53
|
+
# In case we don't have ActiveRecord, append a no-op task that we can depend upon.
|
54
|
+
task 'db:test:prepare' do
|
55
|
+
end
|
56
|
+
|
57
|
+
task :stats => 'cucumber:statsetup'
|
58
|
+
rescue LoadError
|
59
|
+
desc 'cucumber rake task not available (cucumber not installed)'
|
60
|
+
task :cucumber do
|
61
|
+
abort 'Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin'
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
end
|
data/test/dummy/Rakefile
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
#!/usr/bin/env rake
|
2
|
+
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
3
|
+
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
4
|
+
|
5
|
+
require File.expand_path('../config/application', __FILE__)
|
6
|
+
|
7
|
+
Dummy::Application.load_tasks
|
@@ -0,0 +1,9 @@
|
|
1
|
+
// This is a manifest file that'll be compiled into including all the files listed below.
|
2
|
+
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
|
3
|
+
// be included in the compiled file accessible from http://example.com/assets/application.js
|
4
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
5
|
+
// the compiled file.
|
6
|
+
//
|
7
|
+
//= require jquery
|
8
|
+
//= require jquery_ujs
|
9
|
+
//= require_tree .
|
@@ -0,0 +1,7 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll automatically include all the stylesheets available in this directory
|
3
|
+
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
|
4
|
+
* the top of the compiled file, but it's generally better to create a new file per style scope.
|
5
|
+
*= require_self
|
6
|
+
*= require_tree .
|
7
|
+
*/
|
@@ -0,0 +1,26 @@
|
|
1
|
+
class ApplicationController < ActionController::Base
|
2
|
+
@@current_user = User.find_or_create_by_full_name("Demo User")
|
3
|
+
|
4
|
+
def self.current_user=(user)
|
5
|
+
@@current_user = user
|
6
|
+
end
|
7
|
+
|
8
|
+
def current_user
|
9
|
+
@@current_user
|
10
|
+
end
|
11
|
+
helper_method :current_user
|
12
|
+
|
13
|
+
def destroy_user_session_path
|
14
|
+
''
|
15
|
+
end
|
16
|
+
helper_method :destroy_user_session_path
|
17
|
+
|
18
|
+
def authenticate_user!
|
19
|
+
true
|
20
|
+
end
|
21
|
+
|
22
|
+
def anybody_signed_in?
|
23
|
+
true
|
24
|
+
end
|
25
|
+
protect_from_forgery
|
26
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
class ContentPage < Noodall::Node
|
2
|
+
# Define which Node Templates can be used as children of Nodes using this template
|
3
|
+
sub_templates ContentPage
|
4
|
+
|
5
|
+
# Define the number of each slot type this Node Template allows. Slots are defined in 'config/initializers/noodall.rb'
|
6
|
+
# small_slots 4
|
7
|
+
quote_slots 1
|
8
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
class User
|
2
|
+
include MongoMapper::Document
|
3
|
+
include Canable::Cans
|
4
|
+
|
5
|
+
key :email, String
|
6
|
+
key :full_name, String
|
7
|
+
key :groups, Array
|
8
|
+
|
9
|
+
cattr_accessor :editor_groups
|
10
|
+
|
11
|
+
def admin?
|
12
|
+
groups.include?('website administrator')
|
13
|
+
end
|
14
|
+
|
15
|
+
def editor?
|
16
|
+
return true if self.class.editor_groups.blank?
|
17
|
+
admin? or (self.class.editor_groups & groups).size > 0
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
<%= render :partial => 'noodall/admin/nodes/body', :locals => { :f => f } %>
|
2
|
+
<% content_for :component_table do %>
|
3
|
+
<!--
|
4
|
+
modify this table to look like your template and link slots to correct anchors
|
5
|
+
<table class="component-table">
|
6
|
+
<tr>
|
7
|
+
<td rowspan="2" class="content"></td>
|
8
|
+
<td colspan="2" rowspan="4" class="content"></td>
|
9
|
+
<td><a href="#small_component_form_0" class="slot_link">4</a></td>
|
10
|
+
</tr>
|
11
|
+
<tr>
|
12
|
+
<td><a href="#small_component_form_1" class="slot_link">5</a></td>
|
13
|
+
</tr>
|
14
|
+
<tr>
|
15
|
+
<td></td>
|
16
|
+
<td><a href="#small_component_form_2" class="slot_link">6</a></td>
|
17
|
+
</tr>
|
18
|
+
<tr>
|
19
|
+
<td></td>
|
20
|
+
<td><a href="#small_component_form_3" class="slot_link">7</a></td>
|
21
|
+
</tr>
|
22
|
+
<tr>
|
23
|
+
<td></td>
|
24
|
+
<td colspan="2"><a href="#wide_component_form_0" class="slot_link">1</a></td>
|
25
|
+
<td></td>
|
26
|
+
</tr>
|
27
|
+
<tr>
|
28
|
+
<td></td>
|
29
|
+
<td colspan="2"><a href="#wide_component_form_1" class="slot_link">2</a></td>
|
30
|
+
<td></td>
|
31
|
+
</tr>
|
32
|
+
<tr>
|
33
|
+
<td></td>
|
34
|
+
<td colspan="2"><a href="#wide_component_form_2" class="slot_link">3</a></td>
|
35
|
+
<td></td>
|
36
|
+
</tr>
|
37
|
+
<tr>
|
38
|
+
<td></td>
|
39
|
+
<td></td>
|
40
|
+
<td></td>
|
41
|
+
<td></td>
|
42
|
+
</tr>
|
43
|
+
</table>
|
44
|
+
-->
|
45
|
+
<% end -%>
|
@@ -0,0 +1,51 @@
|
|
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 "noodall-components-quote"
|
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 the asset pipeline
|
45
|
+
config.assets.enabled = true
|
46
|
+
|
47
|
+
# Version of your assets, change this if you want to expire all your assets
|
48
|
+
config.assets.version = '1.0'
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|