noodall-components-disqus-comments 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 +31 -0
- data/Rakefile +37 -0
- data/app/models/comments.rb +2 -0
- data/app/views/admin/components/_comments.html.erb +6 -0
- data/app/views/components/_comments.html.erb +17 -0
- data/config/cucumber.yml +8 -0
- data/config/routes.rb +2 -0
- data/lib/generators/noodall/disqus_comments/setup/USAGE +6 -0
- data/lib/generators/noodall/disqus_comments/setup/setup_generator.rb +22 -0
- data/lib/noodall-components-disqus-comments.rb +19 -0
- data/lib/noodall/components/disqus_comments/engine.rb +8 -0
- data/lib/noodall/components/disqus_comments/version.rb +7 -0
- data/lib/tasks/cucumber.rake +65 -0
- data/lib/tasks/noodall-components-disqus-comments_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 +7 -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 +4 -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 +10 -0
- data/test/dummy/log/test.log +5526 -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/C46/EC0/sprockets%2Ff46a41a0c1627724e31d357564159a71 +0 -0
- data/test/dummy/tmp/cache/assets/C52/920/sprockets%2F05c725c250d660f184d862181692eb58 +0 -0
- data/test/dummy/tmp/cache/assets/C5B/FA0/sprockets%2F6be677356438813042c23ed70674f67c +0 -0
- data/test/dummy/tmp/cache/assets/C6E/DC0/sprockets%2Fc9eb0011a54969ef872307200a1c4307 +0 -0
- data/test/dummy/tmp/cache/assets/C88/FE0/sprockets%2F1df84573166448a26b7d84f0005b75e9 +0 -0
- data/test/dummy/tmp/cache/assets/C94/ED0/sprockets%2F3183c1c65067446ff7979183e7165fdb +0 -0
- data/test/dummy/tmp/cache/assets/C95/F10/sprockets%2F4b5e8909eb0877f04963705b8d94f063 +0 -0
- data/test/dummy/tmp/cache/assets/CA0/1A0/sprockets%2F37003e854108b7c586ab040abef39035 +0 -0
- data/test/dummy/tmp/cache/assets/CA1/120/sprockets%2F54491350696749aa3306ba08cd103dcb +0 -0
- data/test/dummy/tmp/cache/assets/CA1/4D0/sprockets%2F4dced9430c6312440873cbd48002373d +0 -0
- data/test/dummy/tmp/cache/assets/CAE/5F0/sprockets%2F817cb28551a7de5c0ba75398561505f0 +0 -0
- data/test/dummy/tmp/cache/assets/CB1/DF0/sprockets%2F5c60b591e83ca3c6d8513d7526a32847 +0 -0
- data/test/dummy/tmp/cache/assets/CB2/5D0/sprockets%2F692dd1c487bc1c55637903b8b258034e +0 -0
- data/test/dummy/tmp/cache/assets/CB3/BC0/sprockets%2Fab38a692314d07677256ce2702e8ef71 +0 -0
- data/test/dummy/tmp/cache/assets/CB3/F30/sprockets%2Ff45ae165a25885c0150806efaf914576 +0 -0
- data/test/dummy/tmp/cache/assets/CB8/040/sprockets%2Ff32b0c5bc81085d7497896848a2b33f1 +0 -0
- data/test/dummy/tmp/cache/assets/CCB/9C0/sprockets%2Fb31d0131174a2e95f2c28e491721dec0 +0 -0
- data/test/dummy/tmp/cache/assets/CD4/4C0/sprockets%2F7b60529cd1ba26b07ee5345a9982004a +0 -0
- data/test/dummy/tmp/cache/assets/CDD/B70/sprockets%2F1e4dd530f1510ed487b5cf18d2817681 +0 -0
- data/test/dummy/tmp/cache/assets/CDE/530/sprockets%2F27c2e7f3334b89f3741c67b20f0a438c +0 -0
- data/test/dummy/tmp/cache/assets/CE1/FF0/sprockets%2F37465322af9eb1b73c759c18712bc74c +0 -0
- data/test/dummy/tmp/cache/assets/CE3/3C0/sprockets%2Fb9c7424c04f428cfa84a1c7906354a96 +0 -0
- data/test/dummy/tmp/cache/assets/CE3/A40/sprockets%2F2af92d7fa06733037028810e8f1fe5e8 +0 -0
- data/test/dummy/tmp/cache/assets/CE4/7E0/sprockets%2F19163b89b7855f16b03d81c60e0d9ed3 +0 -0
- data/test/dummy/tmp/cache/assets/CE9/A50/sprockets%2Faf4cf842f965f3248e02b1c544d48367 +0 -0
- data/test/dummy/tmp/cache/assets/CE9/F70/sprockets%2F43672529e0633901afb757b7f9ee5fb1 +0 -0
- data/test/dummy/tmp/cache/assets/CEE/300/sprockets%2F05df23c05150dc12d256ce6538c1ba00 +0 -0
- data/test/dummy/tmp/cache/assets/CEE/8F0/sprockets%2F4cb8879855cbae0d55ff2d3227527691 +0 -0
- data/test/dummy/tmp/cache/assets/CEE/900/sprockets%2Fb69f7324763b9c4342a27fe837bab857 +0 -0
- data/test/dummy/tmp/cache/assets/CEF/290/sprockets%2F3f969f4582dbb198bb8245af7256007f +0 -0
- data/test/dummy/tmp/cache/assets/CF1/D00/sprockets%2F03f8e97ed3ad307d6e84f90963a45860 +0 -0
- data/test/dummy/tmp/cache/assets/CF3/430/sprockets%2F5456c036a50f81ca0a19ccd21b4e4115 +0 -0
- data/test/dummy/tmp/cache/assets/CFF/510/sprockets%2Fc36319f3a2a70d774c2bca27324c1a68 +0 -0
- data/test/dummy/tmp/cache/assets/D03/E30/sprockets%2Fde1b3bc714a11d969f162517a60be482 +0 -0
- data/test/dummy/tmp/cache/assets/D07/B80/sprockets%2F95b742ea2a452c8c051ff9621a7b7f10 +0 -0
- data/test/dummy/tmp/cache/assets/D0A/FC0/sprockets%2F441a4106c6f9b5d16f8137a5cfc7a057 +0 -0
- data/test/dummy/tmp/cache/assets/D10/9A0/sprockets%2Fd5cf80717ec826763b4c5cb8105b194b +0 -0
- data/test/dummy/tmp/cache/assets/D15/C10/sprockets%2Feb4421f6f57513348ea4b78fa837bd70 +0 -0
- data/test/dummy/tmp/cache/assets/D16/1E0/sprockets%2F3b6c26d3a65078db90f9f5482fc021f9 +0 -0
- data/test/dummy/tmp/cache/assets/D16/790/sprockets%2F2292d911baca267f5c5a9f892664e19a +0 -0
- data/test/dummy/tmp/cache/assets/D19/2C0/sprockets%2F791e48c6e058d94026bd693ddd0c9a42 +0 -0
- data/test/dummy/tmp/cache/assets/D1A/040/sprockets%2F8504324ef6e4b3df4a18ca9564816ee8 +0 -0
- data/test/dummy/tmp/cache/assets/D20/A10/sprockets%2F5f8deb01279e6e38a66720917c7bf7c5 +0 -0
- data/test/dummy/tmp/cache/assets/D26/C70/sprockets%2F5aa6461a208a34ea804c13dadda64464 +0 -0
- data/test/dummy/tmp/cache/assets/D27/260/sprockets%2F948b8709f7c4c91db4a46959cfd8242b +0 -0
- data/test/dummy/tmp/cache/assets/D29/300/sprockets%2F8180950b6b8e9b4e4cf3fad995178d76 +0 -0
- data/test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/test/dummy/tmp/cache/assets/D39/A00/sprockets%2F524dd77325e5edbd151c4cf78716bb01 +0 -0
- data/test/dummy/tmp/cache/assets/D42/000/sprockets%2Fa81f26d97ecbfc80a7309970c9a62d20 +0 -0
- data/test/dummy/tmp/cache/assets/D4E/870/sprockets%2F675a27a59ee05833a78d3fbdf835b0f9 +0 -0
- data/test/dummy/tmp/cache/assets/D54/ED0/sprockets%2F71c9fa01091d432b131da3bb73faf3d4 +0 -0
- data/test/dummy/tmp/cache/assets/D6B/E80/sprockets%2F1a45926e50cd49cf0fc1c1fe1f275c83 +0 -0
- data/test/dummy/tmp/cache/assets/D6D/EF0/sprockets%2F2cbf28a07c6ba5a5b67d963d50a4857d +0 -0
- data/test/dummy/tmp/cache/assets/D76/AA0/sprockets%2Fd7c6c2960cad657ede23fca17625b839 +0 -0
- data/test/dummy/tmp/cache/assets/D7B/2B0/sprockets%2Ff3e25bf4745b574590af961aefdb369c +0 -0
- data/test/dummy/tmp/cache/assets/D7E/C60/sprockets%2F3ec3f410bb16cf30217a1d10bb7ad66e +0 -0
- data/test/dummy/tmp/cache/assets/D84/210/sprockets%2Fabd0103ccec2b428ac62c94e4c40b384 +0 -0
- data/test/dummy/tmp/cache/assets/D85/B50/sprockets%2F583bc41d3bbc1799dec567fef888d561 +0 -0
- data/test/dummy/tmp/cache/assets/D87/160/sprockets%2Ff93ccf6f19b1f7dcb9d29476e24675d4 +0 -0
- data/test/dummy/tmp/cache/assets/D8D/F70/sprockets%2F5fb7f31be9c351bbb1733168f10aa6da +0 -0
- data/test/dummy/tmp/cache/assets/D8E/350/sprockets%2F6df2da8d16bb6c0e5cb471d2744b003f +0 -0
- data/test/dummy/tmp/cache/assets/D92/BE0/sprockets%2Fe30b86bf01d7b3a4a317e5bd64bfc267 +0 -0
- data/test/dummy/tmp/cache/assets/D93/DF0/sprockets%2F2f481e0ff455444ca1e1f8bcd2c22b9a +0 -0
- data/test/dummy/tmp/cache/assets/D99/6E0/sprockets%2F7242a4dca1b34df1d8f44d30ff8609ec +0 -0
- data/test/dummy/tmp/cache/assets/D9C/780/sprockets%2F5a939b851ecdde45f7b3e0bd3b7272c0 +0 -0
- data/test/dummy/tmp/cache/assets/D9D/390/sprockets%2F4fcdeda27839a34f1c3b8c9f6b211c63 +0 -0
- data/test/dummy/tmp/cache/assets/D9D/600/sprockets%2Fb60b7a926b81c21bef55d19dcfc757c2 +0 -0
- data/test/dummy/tmp/cache/assets/DA4/010/sprockets%2Fc67357ca10df88bb6f77fe7ffa83010a +0 -0
- data/test/dummy/tmp/cache/assets/DAA/3C0/sprockets%2F4bd80ec76a583795ee04cd6afc33f5c8 +0 -0
- data/test/dummy/tmp/cache/assets/DB0/010/sprockets%2F588762b089988f3fbaac4a35affbef43 +0 -0
- data/test/dummy/tmp/cache/assets/DB0/FE0/sprockets%2F596ce5093794c69e6fc2bc8ebde07d1b +0 -0
- data/test/dummy/tmp/cache/assets/DB2/B50/sprockets%2F7d5b1a37a520aa5f4ea03c61ed54adc2 +0 -0
- data/test/dummy/tmp/cache/assets/DBC/A10/sprockets%2F12f3a7b2b56fc3582aa4b5eb3aee580a +0 -0
- data/test/dummy/tmp/cache/assets/DC4/540/sprockets%2Fcf2a7b0442194fdfbbbbc8513f54ed61 +0 -0
- data/test/dummy/tmp/cache/assets/DCA/E20/sprockets%2F6c774d14ba1dbdd7e09be739bbce9112 +0 -0
- data/test/dummy/tmp/cache/assets/DCB/CB0/sprockets%2F00ad97ade6d4853333f6eb6fa72ceaa6 +0 -0
- data/test/dummy/tmp/cache/assets/DCB/F00/sprockets%2Fdd7febc2bc90b35b6c07825ce1565ed3 +0 -0
- data/test/dummy/tmp/cache/assets/DCF/830/sprockets%2F3bbd416fdf6d764f519fdcb14c733a6b +0 -0
- data/test/dummy/tmp/cache/assets/DD1/320/sprockets%2F8fcd363c78cfebfc578cfcca01890210 +0 -0
- data/test/dummy/tmp/cache/assets/DD5/B30/sprockets%2F0dafefedf822d4ee08963dc2d18168a6 +0 -0
- data/test/dummy/tmp/cache/assets/DED/870/sprockets%2F97d0bd75f3fffc4c1978fd92f9b483ec +0 -0
- data/test/dummy/tmp/cache/assets/DFB/050/sprockets%2Fd7c2c3a4fb6e14aa695add3d765aa4f8 +0 -0
- data/test/dummy/tmp/cache/assets/DFC/A90/sprockets%2Fdfb53c2301e6fb0a1fea6ffb905f479f +0 -0
- data/test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/test/dummy/tmp/cache/assets/E05/5A0/sprockets%2Fb00fa48a88c839d394ed491f1fffbbbb +0 -0
- data/test/dummy/tmp/cache/assets/E07/B90/sprockets%2F26931dfab63f4ecd9b4da4e99ea2ba97 +0 -0
- data/test/dummy/tmp/cache/assets/E1D/260/sprockets%2F4c1e99eb5c743ba30fc1dfca2fa231dd +0 -0
- data/test/dummy/tmp/cache/assets/E2A/DB0/sprockets%2Fe182761c0ed5ea9abe2cedc42b1f7cf8 +0 -0
- data/test/dummy/tmp/cache/assets/E2F/040/sprockets%2F4c60fdc94dcddb7374fa06cfbbe95c24 +0 -0
- data/test/dummy/tmp/cache/assets/E38/2F0/sprockets%2F9edd96d03a49ebd3b6d5b0fe3bfdb687 +0 -0
- metadata +330 -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,31 @@
|
|
1
|
+
# Noodall Comments Component using Disqus
|
2
|
+
|
3
|
+
Noodall Comments allows you to add Disqus comments to your Noodall Nodes.
|
4
|
+
|
5
|
+
## Install
|
6
|
+
|
7
|
+
Add to your `Gemfile`
|
8
|
+
|
9
|
+
gem 'noodall-components-disqus-comments', :git => 'git@github.com:noodall/noodall-components-disqus-comments.git'
|
10
|
+
|
11
|
+
Run `bundle install`
|
12
|
+
|
13
|
+
bundle install
|
14
|
+
|
15
|
+
## Configuration
|
16
|
+
|
17
|
+
You need to tell Disqus what your shortname is.
|
18
|
+
|
19
|
+
Add to your `config/initializers/noodall.rb`
|
20
|
+
|
21
|
+
NoodallComponentsDisqusComments.shortname = "<shortname here>"
|
22
|
+
|
23
|
+
To override developer mode in the development environment:
|
24
|
+
|
25
|
+
if Rails.env.development?
|
26
|
+
NoodallComponentsDisqusComments.developer_mode = 0
|
27
|
+
end
|
28
|
+
|
29
|
+
See their docs (http://docs.disqus.com/developers/universal/) for more information
|
30
|
+
|
31
|
+
This project rocks and uses MIT-LICENSE.
|
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 = 'NoodallComponentsDisqusComments'
|
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
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<div id="<%= slot_code %>" class="component comments <%= 'double' if expand %> <%= additional_classes %>">
|
2
|
+
<div id="disqus_thread"></div>
|
3
|
+
<script type="text/javascript">
|
4
|
+
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
|
5
|
+
var disqus_shortname = '<%= Noodall::Components::DisqusComments.shortname %>'; // required: replace example with your forum shortname
|
6
|
+
var disqus_developer = <%= Noodall::Components::DisqusComments.developer_mode %>; // developer mode is on
|
7
|
+
|
8
|
+
/* * * DON'T EDIT BELOW THIS LINE * * */
|
9
|
+
(function() {
|
10
|
+
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
|
11
|
+
dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
|
12
|
+
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
|
13
|
+
})();
|
14
|
+
</script>
|
15
|
+
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
|
16
|
+
<a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a>
|
17
|
+
</div>
|
data/config/cucumber.yml
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
<%
|
2
|
+
rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
|
3
|
+
rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
|
4
|
+
std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} --strict --tags ~@wip"
|
5
|
+
%>
|
6
|
+
default: <%= std_opts %> features
|
7
|
+
wip: --tags @wip:3 --wip features
|
8
|
+
rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip
|
data/config/routes.rb
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
module Noodall
|
2
|
+
module DisqusComments
|
3
|
+
class SetupGenerator < Rails::Generators::Base
|
4
|
+
|
5
|
+
def setup
|
6
|
+
add_initializer_config
|
7
|
+
end
|
8
|
+
|
9
|
+
private
|
10
|
+
|
11
|
+
def add_initializer_config
|
12
|
+
append_to_file 'config/initializers/noodall.rb' do
|
13
|
+
<<-EOS.strip_heredoc
|
14
|
+
|
15
|
+
# Set the Disqus Comments shortname
|
16
|
+
Noodall::Components::DisqusComments.shortname = '<short_name>'
|
17
|
+
EOS
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require "noodall/components/disqus_comments/engine"
|
2
|
+
|
3
|
+
module Noodall
|
4
|
+
module Components
|
5
|
+
module DisqusComments
|
6
|
+
class << self
|
7
|
+
|
8
|
+
# Unique identifier for this website
|
9
|
+
attr_accessor :shortname
|
10
|
+
|
11
|
+
# Whether developer mode is on or off
|
12
|
+
attr_accessor :developer_mode
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
# Developer mode default is "on"
|
19
|
+
Noodall::Components::DisqusComments.developer_mode = 1
|
@@ -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,7 @@
|
|
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
|
+
large_slots 1
|
7
|
+
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-disqus-comments"
|
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
|
+
|