answers-core 0.0.0
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.
- checksums.yaml +7 -0
- data/Rakefile +6 -0
- data/answers-core.gemspec +30 -0
- data/app/assets/fonts/answers/League_Gothic-webfont.eot +0 -0
- data/app/assets/fonts/answers/League_Gothic-webfont.svg +230 -0
- data/app/assets/fonts/answers/League_Gothic-webfont.ttf +0 -0
- data/app/assets/fonts/answers/League_Gothic-webfont.woff +0 -0
- data/app/assets/images/OaklandCityTree.png +0 -0
- data/app/assets/images/background_image.jpg +0 -0
- data/app/assets/images/background_pattern.png +0 -0
- data/app/assets/images/beta.png +0 -0
- data/app/assets/images/bg_transparent.png +0 -0
- data/app/assets/images/border.png +0 -0
- data/app/assets/images/brigade.png +0 -0
- data/app/assets/images/cfa.png +0 -0
- data/app/assets/images/cfa_logo.png +0 -0
- data/app/assets/images/cfa_logo_footer.png +0 -0
- data/app/assets/images/favicon.ico +0 -0
- data/app/assets/images/forest.jpeg +0 -0
- data/app/assets/images/getting_started_btn.png +0 -0
- data/app/assets/images/govuk.png +0 -0
- data/app/assets/images/openoaklandlogo.png +0 -0
- data/app/assets/images/quick_answers_icon.png +0 -0
- data/app/assets/images/quick_answers_icon_small.png +0 -0
- data/app/assets/images/searchIcon.png +0 -0
- data/app/assets/images/wmd-buttons.png +0 -0
- data/app/assets/images/yellow_bg.png +0 -0
- data/app/assets/javascripts/answers.js +19 -0
- data/app/assets/javascripts/answers/Markdown.Extra.js +304 -0
- data/app/assets/javascripts/answers/active_admin.js +62 -0
- data/app/assets/javascripts/answers/pagedown/LICENSE.txt +32 -0
- data/app/assets/javascripts/answers/pagedown/Markdown.Converter.js +1332 -0
- data/app/assets/javascripts/answers/pagedown/Markdown.Editor.js +2212 -0
- data/app/assets/javascripts/answers/pagedown/Markdown.Sanitizer.js +108 -0
- data/app/assets/javascripts/answers/pagedown/README.txt +0 -0
- data/app/assets/javascripts/answers/pagedown/demo/browser/demo.css +120 -0
- data/app/assets/javascripts/answers/pagedown/demo/browser/demo.html +83 -0
- data/app/assets/javascripts/answers/pagedown/demo/node/demo.js +44 -0
- data/app/assets/javascripts/answers/pagedown/local/Markdown.local.fr.js +43 -0
- data/app/assets/javascripts/answers/pagedown/node-pagedown.js +2 -0
- data/app/assets/javascripts/answers/pagedown/package.json +12 -0
- data/app/assets/javascripts/answers/pagedown/resources/wmd-buttons.psd +0 -0
- data/app/assets/javascripts/answers/pagedown/wmd-buttons.png +0 -0
- data/app/assets/javascripts/answers/skip_nav.js +8 -0
- data/app/assets/stylesheets/answers/active_admin.css.scss +17 -0
- data/app/assets/stylesheets/answers/active_admin_custom.css.scss +35 -0
- data/app/assets/stylesheets/answers/formatting.css +82 -0
- data/app/assets/stylesheets/answers/mobile.css +149 -0
- data/app/assets/stylesheets/answers/tags.css.scss +3 -0
- data/app/assets/stylesheets/answers/theme.css +916 -0
- data/app/controllers/answers/answers_controller.rb +26 -0
- data/app/controllers/answers/api/v1/answers_controller.rb +38 -0
- data/app/controllers/answers/api/v1/api_controller.rb +13 -0
- data/app/controllers/answers/api/v1/questions_controller.rb +39 -0
- data/app/controllers/answers/api/v1/taggings_controller.rb +46 -0
- data/app/controllers/answers/api/v1/tags_controller.rb +38 -0
- data/app/controllers/answers/application_controller.rb +27 -0
- data/app/controllers/answers/home_controller.rb +17 -0
- data/app/controllers/answers/questions_controller.rb +33 -0
- data/app/controllers/answers/search_controller.rb +22 -0
- data/app/controllers/answers/tags_controller.rb +36 -0
- data/app/helpers/answers/tags_helper.rb +7 -0
- data/app/models/.gitkeep +0 -0
- data/app/models/answers/ability.rb +28 -0
- data/app/models/answers/administrator.rb +5 -0
- data/app/models/answers/answer.rb +6 -0
- data/app/models/answers/api/v1/api_user.rb +5 -0
- data/app/models/answers/question.rb +31 -0
- data/app/models/answers/user.rb +30 -0
- data/app/views/answers/admin/contacts/_article.html.erb +0 -0
- data/app/views/answers/admin/dashboard/_dashboard.html.erb +5 -0
- data/app/views/answers/admin/guide_steps/_form.html.erb +17 -0
- data/app/views/answers/api/v1/answers/_answer.json.jbuilder +2 -0
- data/app/views/answers/api/v1/answers/index.json.jbuilder +1 -0
- data/app/views/answers/api/v1/answers/show.json.jbuilder +1 -0
- data/app/views/answers/api/v1/questions/_question.json.jbuilder +2 -0
- data/app/views/answers/api/v1/questions/index.json.jbuilder +1 -0
- data/app/views/answers/api/v1/questions/show.json.jbuilder +1 -0
- data/app/views/answers/api/v1/taggings/_tagging.json.jbuilder +3 -0
- data/app/views/answers/api/v1/taggings/index.json.jbuilder +1 -0
- data/app/views/answers/api/v1/taggings/show.json.jbuilder +1 -0
- data/app/views/answers/api/v1/tags/_tag.json.jbuilder +2 -0
- data/app/views/answers/api/v1/tags/index.json.jbuilder +1 -0
- data/app/views/answers/api/v1/tags/show.json.jbuilder +1 -0
- data/app/views/answers/devise/confirmations/new.html.erb +12 -0
- data/app/views/answers/devise/mailer/confirmation_instructions.html.erb +5 -0
- data/app/views/answers/devise/mailer/reset_password_instructions.html.erb +8 -0
- data/app/views/answers/devise/mailer/unlock_instructions.html.erb +7 -0
- data/app/views/answers/devise/passwords/edit.html.erb +24 -0
- data/app/views/answers/devise/passwords/new.html.erb +20 -0
- data/app/views/answers/devise/registrations/edit.html.erb +25 -0
- data/app/views/answers/devise/registrations/new.html.erb +18 -0
- data/app/views/answers/devise/sessions/new.html.erb +25 -0
- data/app/views/answers/devise/shared/_links.erb +25 -0
- data/app/views/answers/devise/unlocks/new.html.erb +12 -0
- data/app/views/answers/home/_article.html.erb +3 -0
- data/app/views/answers/home/_category.html.erb +8 -0
- data/app/views/answers/home/about.html.erb +72 -0
- data/app/views/answers/home/index.html.erb +44 -0
- data/app/views/answers/questions/index.html.erb +21 -0
- data/app/views/answers/questions/show.html.erb +31 -0
- data/app/views/answers/search/index.html.erb +32 -0
- data/app/views/answers/shared/_articles_sidebar.html.erb +22 -0
- data/app/views/answers/shared/_autocomplete.html.erb +8 -0
- data/app/views/answers/shared/_categories_sidebar.html.erb +12 -0
- data/app/views/answers/shared/_search_form.html.erb +4 -0
- data/app/views/answers/shared/admin/_administration.html.erb +38 -0
- data/app/views/answers/shared/admin/_article_actions.html.erb +86 -0
- data/app/views/answers/shared/admin/_article_content.html.erb +27 -0
- data/app/views/answers/shared/admin/_article_details.html.erb +11 -0
- data/app/views/answers/shared/admin/_article_form.html.erb +20 -0
- data/app/views/answers/shared/admin/_author_pic.html.erb +0 -0
- data/app/views/answers/tags/index.html.erb +34 -0
- data/app/views/answers/tags/show.html.erb +31 -0
- data/app/views/layouts/answers/application.html.erb +97 -0
- data/config.ru +5 -0
- data/config/initializers/active_admin.rb +245 -0
- data/config/initializers/devise.rb +228 -0
- data/config/locales/devise.en.yml +57 -0
- data/config/locales/en.yml +129 -0
- data/config/routes.rb +22 -0
- data/config/secrets.yml +68 -0
- data/db/migrate/20140911060606_answers_up.rb +79 -0
- data/lib/answers-core.rb +1 -0
- data/lib/answers.rb +175 -0
- data/lib/answers/admin/answer.rb +29 -0
- data/lib/answers/admin/dashboard.rb +75 -0
- data/lib/answers/admin/question.rb +57 -0
- data/lib/answers/admin/tag.rb +12 -0
- data/lib/answers/admin/users.rb +65 -0
- data/lib/answers/core.rb +25 -0
- data/lib/answers/core/configuration.rb +90 -0
- data/lib/answers/core/engine.rb +116 -0
- data/lib/answers/engine.rb +62 -0
- data/lib/answers/errors.rb +13 -0
- data/lib/answers/plugin.rb +75 -0
- data/lib/answers/plugins.rb +73 -0
- data/lib/answers/version.rb +16 -0
- data/lib/api_client.rb +20 -0
- data/lib/assets/.gitkeep +0 -0
- data/lib/assets/eng_stop.csv +1 -0
- data/lib/generators/answers/clash_keywords.yml +3 -0
- data/lib/generators/answers/cms/cms_generator.rb +314 -0
- data/lib/generators/answers/cms/templates/.gitignore +91 -0
- data/lib/generators/answers/cms/templates/app/decorators/controllers/answers/.keep +0 -0
- data/lib/generators/answers/cms/templates/app/decorators/models/answers/.keep +0 -0
- data/lib/generators/answers/cms/templates/app/views/sitemap/index.xml.builder +15 -0
- data/lib/generators/answers/cms/templates/config/database.yml.mysql +20 -0
- data/lib/generators/answers/cms/templates/config/database.yml.postgresql +58 -0
- data/lib/generators/answers/cms/templates/config/database.yml.sqlite3 +18 -0
- data/lib/generators/answers/core/core_generator.rb +10 -0
- data/lib/generators/answers/core/templates/config/initializers/answers/core.rb.erb +35 -0
- data/lib/generators/answers/dummy/dummy_generator.rb +86 -0
- data/lib/generators/answers/dummy/templates/rails/Rakefile +7 -0
- data/lib/generators/answers/dummy/templates/rails/application.js +3 -0
- data/lib/generators/answers/dummy/templates/rails/application.rb.erb +12 -0
- data/lib/generators/answers/dummy/templates/rails/boot.rb.erb +6 -0
- data/lib/generators/answers/dummy/templates/rails/database.yml +34 -0
- data/lib/generators/answers/dummy/templates/rails/routes.rb +3 -0
- data/lib/generators/answers/engine/USAGE +24 -0
- data/lib/generators/answers/engine/engine_generator.rb +44 -0
- data/lib/generators/answers/engine/templates/.gitignore +2 -0
- data/lib/generators/answers/engine/templates/Gemfile +42 -0
- data/lib/generators/answers/engine/templates/Rakefile +19 -0
- data/lib/generators/answers/engine/templates/answers-extension_plural_name.gemspec +19 -0
- data/lib/generators/answers/engine/templates/app/controllers/answers/namespace/admin/plural_name_controller.rb.erb +14 -0
- data/lib/generators/answers/engine/templates/app/controllers/answers/namespace/plural_name_controller.rb.erb +34 -0
- data/lib/generators/answers/engine/templates/app/models/answers/namespace/singular_name.rb.erb +37 -0
- data/lib/generators/answers/engine/templates/app/views/answers/namespace/admin/plural_name/_actions.html.erb +25 -0
- data/lib/generators/answers/engine/templates/app/views/answers/namespace/admin/plural_name/_form.html.erb +65 -0
- data/lib/generators/answers/engine/templates/app/views/answers/namespace/admin/plural_name/_plural_name.html.erb +2 -0
- data/lib/generators/answers/engine/templates/app/views/answers/namespace/admin/plural_name/_records.html.erb +16 -0
- data/lib/generators/answers/engine/templates/app/views/answers/namespace/admin/plural_name/_singular_name.html.erb +33 -0
- data/lib/generators/answers/engine/templates/app/views/answers/namespace/admin/plural_name/_sortable_list.html.erb +5 -0
- data/lib/generators/answers/engine/templates/app/views/answers/namespace/admin/plural_name/edit.html.erb +1 -0
- data/lib/generators/answers/engine/templates/app/views/answers/namespace/admin/plural_name/index.html.erb +7 -0
- data/lib/generators/answers/engine/templates/app/views/answers/namespace/admin/plural_name/new.html.erb +1 -0
- data/lib/generators/answers/engine/templates/app/views/answers/namespace/plural_name/index.html.erb +11 -0
- data/lib/generators/answers/engine/templates/app/views/answers/namespace/plural_name/show.html.erb +39 -0
- data/lib/generators/answers/engine/templates/config/locales/cs.yml +28 -0
- data/lib/generators/answers/engine/templates/config/locales/en.yml +28 -0
- data/lib/generators/answers/engine/templates/config/locales/es.yml +29 -0
- data/lib/generators/answers/engine/templates/config/locales/fr.yml +28 -0
- data/lib/generators/answers/engine/templates/config/locales/it.yml +28 -0
- data/lib/generators/answers/engine/templates/config/locales/nb.yml +28 -0
- data/lib/generators/answers/engine/templates/config/locales/nl.yml +28 -0
- data/lib/generators/answers/engine/templates/config/locales/sk.yml +28 -0
- data/lib/generators/answers/engine/templates/config/locales/tr.yml +28 -0
- data/lib/generators/answers/engine/templates/config/locales/zh-CN.yml +30 -0
- data/lib/generators/answers/engine/templates/config/routes.rb.erb +19 -0
- data/lib/generators/answers/engine/templates/db/migrate/1_create_namespace_plural_name.rb.erb +39 -0
- data/lib/generators/answers/engine/templates/db/seeds.rb.erb +21 -0
- data/lib/generators/answers/engine/templates/lib/answers-extension_plural_name.rb.erb +1 -0
- data/lib/generators/answers/engine/templates/lib/answers/plural_name.rb.erb +21 -0
- data/lib/generators/answers/engine/templates/lib/answers/plural_name/engine.rb.erb +23 -0
- data/lib/generators/answers/engine/templates/lib/generators/answers/extension_plural_name_generator.rb.erb +19 -0
- data/lib/generators/answers/engine/templates/lib/tasks/answers/extension_plural_name.rake +13 -0
- data/lib/generators/answers/engine/templates/readme.md +10 -0
- data/lib/generators/answers/engine/templates/script/rails +10 -0
- data/lib/generators/answers/engine/templates/spec/features/answers/namespace/admin/plural_name_spec.rb.erb +200 -0
- data/lib/generators/answers/engine/templates/spec/models/answers/namespace/singular_name_spec.rb.erb +20 -0
- data/lib/generators/answers/engine/templates/spec/spec_helper.rb +31 -0
- data/lib/generators/answers/engine/templates/spec/support/factories/answers/plural_name.rb.erb +7 -0
- data/lib/generators/answers/engine/templates/tasks/rspec.rake +6 -0
- data/lib/generators/answers/engine/templates/tasks/testing.rake +8 -0
- data/lib/generators/answers/generator.rb +292 -0
- data/lib/markdownifier.rb +11 -0
- data/log/.gitkeep +0 -0
- data/log/development.log +12870 -0
- data/log/newrelic_agent.log +1339 -0
- data/log/test.log +233181 -0
- data/public/404.html +25 -0
- data/public/422.html +25 -0
- data/public/500.html +24 -0
- data/public/favicon.ico +0 -0
- data/public/robots.txt +5 -0
- data/script/delayed_job +5 -0
- data/spec/controllers/answers_controller_spec.rb +55 -0
- data/spec/controllers/api/v1/answers_controller_spec.rb +144 -0
- data/spec/controllers/api/v1/questions_controller_spec.rb +144 -0
- data/spec/controllers/api/v1/taggings_controller_spec.rb +126 -0
- data/spec/controllers/api/v1/tags_controller_spec.rb +126 -0
- data/spec/controllers/home_controller_spec.rb +60 -0
- data/spec/controllers/questions_controller_spec.rb +55 -0
- data/spec/controllers/tags_controller_spec.rb +42 -0
- data/spec/factories/answers.rb +10 -0
- data/spec/factories/questions.rb +8 -0
- data/spec/factories/tags.rb +8 -0
- data/spec/factories/user.rb +32 -0
- data/spec/features/admin_dashboard_spec.rb +53 -0
- data/spec/features/admin_user_spec.rb +61 -0
- data/spec/features/searches_spec.rb +101 -0
- data/spec/fixtures/Article/_before_validation/sets_access_count_if_nil.yml +223 -0
- data/spec/fixtures/Article/_delete_orphaned_keywords/updating_an_article/destroys_orphaned_keywords_associated.yml +223 -0
- data/spec/fixtures/Article/_delete_orphaned_keywords/when_deleting_an_article/destroys_all_keywords_associated.yml +223 -0
- data/spec/fixtures/Article/_find_by_friendly_id/when_an_article_does_not_exist/does_not_raise_an_exception.yml +223 -0
- data/spec/fixtures/Article/_find_by_friendly_id/when_an_article_exists/returns_the_corresponding_article.yml +223 -0
- data/spec/fixtures/Article/_find_by_type/excludes_articles_not_matching_specified_type.yml +223 -0
- data/spec/fixtures/Article/_find_by_type/returns_articles_matching_type.yml +223 -0
- data/spec/fixtures/Article/_hits/before_an_article_has_been_viewed/has_zero_hits.yml +223 -0
- data/spec/fixtures/Article/_hits/returns_number_of_views/has_seven_views.yml +223 -0
- data/spec/fixtures/Article/_indexable_/returns_false_if_article_is_not_published.yml +223 -0
- data/spec/fixtures/Article/_indexable_/returns_true_if_article_is_published.yml +223 -0
- data/spec/fixtures/Article/_legacy_/returns_true_if_render_markdown_is_false.yml +223 -0
- data/spec/fixtures/Article/_qm_after_create/creates_wordcounts_for_relevant_keywords.yml +223 -0
- data/spec/fixtures/Article/_record_hit/viewing_an_article/increases_hit_by_one.yml +223 -0
- data/spec/fixtures/Article/_related/has_no_related_articles/.yml +223 -0
- data/spec/fixtures/Article/_related/has_related_articles/.yml +223 -0
- data/spec/fixtures/Article/_remove_stop_words/removes_common_english_words_from_the_string.yml +223 -0
- data/spec/fixtures/Article/_search/_search_titles/query_is_present_in_the_title/.yml +223 -0
- data/spec/fixtures/Article/_search/_search_titles/returns_an_empty_array_when_the_search_term_is_present_in_an_article_but_not_the_title.yml +223 -0
- data/spec/fixtures/Article/_search/matches_articles_in_the_database.yml +223 -0
- data/spec/fixtures/Article/_search/query_does_not_match_anything_in_the_database/returns_an_empty_array.yml +223 -0
- data/spec/fixtures/Article/_search/query_is_a_single_space/.yml +223 -0
- data/spec/fixtures/Article/_search/query_is_an_empty_string/.yml +223 -0
- data/spec/fixtures/Article/_to_s/when_an_article_has_a_category/returns_a_string_containing_title_id_and_category.yml +223 -0
- data/spec/fixtures/Article/can_be_published/an_unpublished_article/is_published.yml +223 -0
- data/spec/fixtures/Article/can_be_published/an_unpublished_article/returns_status_Published.yml +223 -0
- data/spec/fixtures/Article/has_a_friendly_url.yml +223 -0
- data/spec/fixtures/Article/is_valid_with_a_title.yml +223 -0
- data/spec/fixtures/Searches/search_results/1_result_found/.yml +22047 -0
- data/spec/fixtures/Searches/search_results/no_results_found/.yml +393 -0
- data/spec/fixtures/Searches/search_results/several_results_found/should_contain_the_title_and_preview_of_both_articles.yml +223 -0
- data/spec/fixtures/Searches/search_results/several_results_found/show_the_query.yml +277 -0
- data/spec/fixtures/articles.yml +428 -0
- data/spec/fixtures/categories.yml +17 -0
- data/spec/fixtures/contacts.yml +11 -0
- data/spec/fixtures/dragon_keyword_cassette.yml +77 -0
- data/spec/fixtures/oakland_answers.yml +2379 -0
- data/spec/helpers/tags_helper_spec.rb +15 -0
- data/spec/lib/markdownifier_spec.rb +12 -0
- data/spec/models/ability_spec.rb +36 -0
- data/spec/models/answer_spec.rb +5 -0
- data/spec/models/question_spec.rb +70 -0
- data/spec/models/user_spec.rb +55 -0
- data/spec/routing/answers_routing_spec.rb +19 -0
- data/spec/routing/questions_routing_spec.rb +19 -0
- data/spec/routing/routes_spec.rb +13 -0
- data/spec/security/brakeman_spec.rb +37 -0
- data/spec/spec_helper.rb +61 -0
- data/spec/support/login_helpers.rb +10 -0
- data/spec/support/wait_for_ajax_helper.rb +7 -0
- data/spec/support/wait_for_dom_helper.rb +12 -0
- data/spec/views/questions/index.html.erb_spec.rb +16 -0
- data/spec/views/questions/show.html.erb_spec.rb +14 -0
- data/spec/views/tags/index.html.erb_spec.rb +5 -0
- data/spec/views/tags/show.html.erb_spec.rb +5 -0
- data/vendor/assets/javascripts/.gitkeep +0 -0
- data/vendor/assets/stylesheets/.gitkeep +0 -0
- data/vendor/assets/stylesheets/bootstrap.css +3990 -0
- data/vendor/crudgen/lib/generators/crudgen/install_generator.rb +23 -0
- data/vendor/plugins/.gitkeep +0 -0
- metadata +484 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# Rails
|
|
2
|
+
.bundle
|
|
3
|
+
db/*.sqlite3
|
|
4
|
+
db/*.sqlite3-journal
|
|
5
|
+
*.log
|
|
6
|
+
tmp
|
|
7
|
+
tmp/**/*
|
|
8
|
+
|
|
9
|
+
# Documentation
|
|
10
|
+
doc/api
|
|
11
|
+
doc/app
|
|
12
|
+
.yardoc
|
|
13
|
+
.yardopts
|
|
14
|
+
coverage
|
|
15
|
+
|
|
16
|
+
# Public Uploads
|
|
17
|
+
public/system/*
|
|
18
|
+
public/themes/*
|
|
19
|
+
|
|
20
|
+
# Public Cache
|
|
21
|
+
public/javascripts/cache
|
|
22
|
+
public/stylesheets/cache
|
|
23
|
+
public/answers/*
|
|
24
|
+
|
|
25
|
+
# Vendor Cache
|
|
26
|
+
vendor/cache
|
|
27
|
+
|
|
28
|
+
# Acts as Indexed
|
|
29
|
+
index/**/*
|
|
30
|
+
|
|
31
|
+
# Answers Specific
|
|
32
|
+
*.tmproj
|
|
33
|
+
*.autobackupbyanswers.*
|
|
34
|
+
answers-*.gem
|
|
35
|
+
|
|
36
|
+
# Mac
|
|
37
|
+
.DS_Store
|
|
38
|
+
|
|
39
|
+
# Windows
|
|
40
|
+
Thumbs.db
|
|
41
|
+
|
|
42
|
+
# NetBeans
|
|
43
|
+
nbproject
|
|
44
|
+
|
|
45
|
+
# Eclipse
|
|
46
|
+
.project
|
|
47
|
+
|
|
48
|
+
# Redcar
|
|
49
|
+
.redcar
|
|
50
|
+
|
|
51
|
+
# Rubinius
|
|
52
|
+
*.rbc
|
|
53
|
+
|
|
54
|
+
# Vim
|
|
55
|
+
*.swp
|
|
56
|
+
*.swo
|
|
57
|
+
|
|
58
|
+
# RubyMine
|
|
59
|
+
.idea
|
|
60
|
+
|
|
61
|
+
# E-texteditor
|
|
62
|
+
.eprj
|
|
63
|
+
|
|
64
|
+
# Backup
|
|
65
|
+
*~
|
|
66
|
+
|
|
67
|
+
# Capybara Bug
|
|
68
|
+
capybara-*html
|
|
69
|
+
|
|
70
|
+
# sass
|
|
71
|
+
.sass-cache
|
|
72
|
+
.sass-cache/*
|
|
73
|
+
|
|
74
|
+
#rvm
|
|
75
|
+
.rvmrc
|
|
76
|
+
.rvmrc.*
|
|
77
|
+
|
|
78
|
+
# vendor/extensions dummy applications.
|
|
79
|
+
vendor/extensions/**/spec/dummy
|
|
80
|
+
|
|
81
|
+
# ANSWERS DEVELOPMENT ====================================================
|
|
82
|
+
# Always keep this section at the bottom.
|
|
83
|
+
|
|
84
|
+
config/database.yml
|
|
85
|
+
config/rackspace_cloudfiles.yml
|
|
86
|
+
your_*.*
|
|
87
|
+
db/schema.rb
|
|
88
|
+
public/answers
|
|
89
|
+
config/ideal_load_path
|
|
90
|
+
|
|
91
|
+
# END ANSWERS DEVELOPMENT =================================================
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
xml.instruct!
|
|
2
|
+
|
|
3
|
+
xml.urlset "xmlns" => "http://www.sitemaps.org/schemas/sitemap/0.9" do
|
|
4
|
+
|
|
5
|
+
@locales.each do |locale|
|
|
6
|
+
::I18n.locale = locale
|
|
7
|
+
# Add XML entry only if there is a valid page_url found above.
|
|
8
|
+
xml.url do
|
|
9
|
+
xml.loc url_for(page_url)
|
|
10
|
+
xml.lastmod page.updated_at.to_date
|
|
11
|
+
end if page_url.present? and page.show_in_menu?
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
development: &development
|
|
2
|
+
adapter: mysql2
|
|
3
|
+
host: localhost
|
|
4
|
+
username: root
|
|
5
|
+
password:
|
|
6
|
+
database: your_local_database
|
|
7
|
+
|
|
8
|
+
test: &test
|
|
9
|
+
adapter: mysql2
|
|
10
|
+
host: localhost
|
|
11
|
+
username: root
|
|
12
|
+
password:
|
|
13
|
+
database: your_test_database
|
|
14
|
+
|
|
15
|
+
production: &production
|
|
16
|
+
adapter: mysql2
|
|
17
|
+
host: localhost
|
|
18
|
+
database: your_production_database
|
|
19
|
+
username: your_production_database_login
|
|
20
|
+
password: your_production_database_password
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# PostgreSQL. Versions 7.4 and 8.x are supported.
|
|
2
|
+
#
|
|
3
|
+
# Install the pg driver:
|
|
4
|
+
# gem install pg
|
|
5
|
+
# On Mac OS X with macports:
|
|
6
|
+
# gem install pg -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config
|
|
7
|
+
# On Windows:
|
|
8
|
+
# gem install pg
|
|
9
|
+
# Choose the win32 build.
|
|
10
|
+
# Install PostgreSQL and put its /bin directory on your path.
|
|
11
|
+
#
|
|
12
|
+
# Configure Using Gemfile
|
|
13
|
+
# gem 'pg'
|
|
14
|
+
#
|
|
15
|
+
development:
|
|
16
|
+
adapter: postgresql
|
|
17
|
+
encoding: unicode
|
|
18
|
+
database: answers_database_development
|
|
19
|
+
pool: 5
|
|
20
|
+
username: postgres
|
|
21
|
+
password: postgres
|
|
22
|
+
min_messages: warning
|
|
23
|
+
|
|
24
|
+
# Connect on a TCP socket. Omitted by default since the client uses a
|
|
25
|
+
# domain socket that doesn't need configuration. Windows does not have
|
|
26
|
+
# domain sockets, so uncomment these lines.
|
|
27
|
+
#host: localhost
|
|
28
|
+
#port: 5432
|
|
29
|
+
|
|
30
|
+
# Schema search path. The server defaults to $user,public
|
|
31
|
+
#schema_search_path: myapp,sharedapp,public
|
|
32
|
+
|
|
33
|
+
# Minimum log levels, in increasing order:
|
|
34
|
+
# debug5, debug4, debug3, debug2, debug1,
|
|
35
|
+
# log, notice, warning, error, fatal, and panic
|
|
36
|
+
# The server defaults to notice.
|
|
37
|
+
#min_messages: warning
|
|
38
|
+
|
|
39
|
+
# Warning: The database defined as "test" will be erased and
|
|
40
|
+
# re-generated from your development database when you run "rake".
|
|
41
|
+
# Do not set this db to the same as development or production.
|
|
42
|
+
test:
|
|
43
|
+
adapter: postgresql
|
|
44
|
+
encoding: unicode
|
|
45
|
+
database: answers_database_test
|
|
46
|
+
pool: 5
|
|
47
|
+
username: postgres
|
|
48
|
+
password: postgres
|
|
49
|
+
min_messages: warning
|
|
50
|
+
|
|
51
|
+
production:
|
|
52
|
+
adapter: postgresql
|
|
53
|
+
encoding: unicode
|
|
54
|
+
database: answers_database_production
|
|
55
|
+
pool: 5
|
|
56
|
+
username: postgres
|
|
57
|
+
password: postgres
|
|
58
|
+
min_messages: warning
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# SQLite version 3.x
|
|
2
|
+
development:
|
|
3
|
+
adapter: <%= "jdbc" if defined?(JRUBY_PLATFORM) %>sqlite3
|
|
4
|
+
database: db/development.sqlite3
|
|
5
|
+
timeout: 5000
|
|
6
|
+
|
|
7
|
+
# Warning: The database defined as 'test' will be erased and
|
|
8
|
+
# re-generated from your development database when you run 'rake'.
|
|
9
|
+
# Do not set this db to the same as development or production.
|
|
10
|
+
test:
|
|
11
|
+
adapter: <%= "jdbc" if defined?(JRUBY_PLATFORM) %>sqlite3
|
|
12
|
+
database: db/test.sqlite3
|
|
13
|
+
timeout: 5000
|
|
14
|
+
|
|
15
|
+
production:
|
|
16
|
+
adapter: <%= "jdbc" if defined?(JRUBY_PLATFORM) %>sqlite3
|
|
17
|
+
database: db/production.sqlite3
|
|
18
|
+
timeout: 5000
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
module Answers
|
|
2
|
+
class CoreGenerator < Rails::Generators::Base
|
|
3
|
+
source_root File.expand_path('../templates', __FILE__)
|
|
4
|
+
|
|
5
|
+
def generate_answers_initializer
|
|
6
|
+
template "config/initializers/answers/core.rb.erb",
|
|
7
|
+
File.join(destination_root, "config", "initializers", "answers", "core.rb")
|
|
8
|
+
end
|
|
9
|
+
end
|
|
10
|
+
end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
Answers::Core.configure do |config|
|
|
2
|
+
# When true will rescue all not found errors and display a friendly error page
|
|
3
|
+
config.rescue_not_found = Rails.env.production?
|
|
4
|
+
|
|
5
|
+
# When true this will force SSL redirection in all Answers backend controllers.
|
|
6
|
+
# config.force_ssl = <%= Answers::Core.force_ssl.inspect %>
|
|
7
|
+
|
|
8
|
+
# When true will use Amazon's Simple Storage Service instead of
|
|
9
|
+
# the default file system for storing resources and images
|
|
10
|
+
config.s3_backend = !(ENV['S3_KEY'].nil? || ENV['S3_SECRET'].nil?)
|
|
11
|
+
|
|
12
|
+
# Whenever Answers caches anything and can set a cache key, it will add
|
|
13
|
+
# a prefix to the cache key containing the string you set here.
|
|
14
|
+
# config.base_cache_key = <%= Answers::Core.base_cache_key.inspect %>
|
|
15
|
+
|
|
16
|
+
# Site name
|
|
17
|
+
# config.site_name = <%= Answers::Core.site_name.inspect %>
|
|
18
|
+
|
|
19
|
+
# This activates Google Analytics tracking within your website. If this
|
|
20
|
+
# config is left blank or set to UA-xxxxxx-x then no remote calls to
|
|
21
|
+
# Google Analytics are made.
|
|
22
|
+
# config.google_analytics_page_code = <%= Answers::Core.google_analytics_page_code.inspect %>
|
|
23
|
+
|
|
24
|
+
# Enable/disable authenticity token on frontend
|
|
25
|
+
# config.authenticity_token_on_frontend = <%= Answers::Core.authenticity_token_on_frontend.inspect %>
|
|
26
|
+
|
|
27
|
+
# Register extra javascript for backend
|
|
28
|
+
# config.register_javascript "prototype-rails"
|
|
29
|
+
|
|
30
|
+
# Register extra stylesheet for backend (optional options)
|
|
31
|
+
# config.register_stylesheet "custom", :media => 'screen'
|
|
32
|
+
|
|
33
|
+
# Specify a different backend path than the default of /answers.
|
|
34
|
+
# config.backend_route = <%= Answers::Core.backend_route.inspect %>
|
|
35
|
+
end
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
require 'rails/generators'
|
|
2
|
+
require 'rails/generators/rails/app/app_generator'
|
|
3
|
+
|
|
4
|
+
module Answers
|
|
5
|
+
class DummyGenerator < Rails::Generators::Base
|
|
6
|
+
desc "Creates blank Rails application, installs Answers, and all sample data"
|
|
7
|
+
|
|
8
|
+
class_option :database, :default => ''
|
|
9
|
+
|
|
10
|
+
def self.source_paths
|
|
11
|
+
paths = self.superclass.source_paths
|
|
12
|
+
paths << File.expand_path('../templates', __FILE__)
|
|
13
|
+
paths.flatten
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
PASSTHROUGH_OPTIONS = [
|
|
17
|
+
:skip_active_record, :skip_javascript, :database, :javascript, :quiet, :pretend, :force, :skip
|
|
18
|
+
]
|
|
19
|
+
|
|
20
|
+
def generate_test_dummy
|
|
21
|
+
opts = (options || {}).slice(*PASSTHROUGH_OPTIONS)
|
|
22
|
+
opts[:database] = 'sqlite3' if opts[:database].blank?
|
|
23
|
+
opts[:force] = true
|
|
24
|
+
opts[:skip_bundle] = true
|
|
25
|
+
|
|
26
|
+
invoke Rails::Generators::AppGenerator, [ File.expand_path(dummy_path, destination_root) ], opts
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def test_dummy_config
|
|
30
|
+
@database = options[:database]
|
|
31
|
+
|
|
32
|
+
template "rails/database.yml", "#{dummy_path}/config/database.yml", :force => true
|
|
33
|
+
template "rails/boot.rb.erb", "#{dummy_path}/config/boot.rb", :force => true
|
|
34
|
+
template "rails/application.rb.erb", "#{dummy_path}/config/application.rb", :force => true
|
|
35
|
+
template "rails/routes.rb", "#{dummy_path}/config/routes.rb", :force => true
|
|
36
|
+
template "rails/Rakefile", "#{dummy_path}/Rakefile", :force => true
|
|
37
|
+
template "rails/application.js", "#{dummy_path}/app/assets/javascripts/application.js", :force => true
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def test_dummy_clean
|
|
41
|
+
inside dummy_path do
|
|
42
|
+
remove_file ".gitignore"
|
|
43
|
+
remove_file "doc"
|
|
44
|
+
remove_file "Gemfile"
|
|
45
|
+
remove_file "lib/tasks"
|
|
46
|
+
remove_file "app/assets/images/rails.png"
|
|
47
|
+
remove_file "public/index.html"
|
|
48
|
+
remove_file "public/robots.txt"
|
|
49
|
+
remove_file "README"
|
|
50
|
+
remove_file "test"
|
|
51
|
+
remove_file "vendor"
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
attr :database
|
|
56
|
+
|
|
57
|
+
protected
|
|
58
|
+
|
|
59
|
+
def dummy_path
|
|
60
|
+
'spec/dummy'
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def module_name
|
|
64
|
+
'Dummy'
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
def application_definition
|
|
68
|
+
@application_definition ||= begin
|
|
69
|
+
dummy_application_path = File.expand_path("#{dummy_path}/config/application.rb", destination_root)
|
|
70
|
+
unless options[:pretend] || !File.exists?(dummy_application_path)
|
|
71
|
+
contents = File.read(dummy_application_path)
|
|
72
|
+
contents[(contents.index("module #{module_name}"))..-1]
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
alias :store_application_definition! :application_definition
|
|
77
|
+
|
|
78
|
+
def camelized
|
|
79
|
+
@camelized ||= name.gsub(/\W/, '_').squeeze('_').camelize
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
def gemfile_path
|
|
83
|
+
'../../../../Gemfile'
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
end
|
|
@@ -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,12 @@
|
|
|
1
|
+
require File.expand_path('../boot', __FILE__)
|
|
2
|
+
|
|
3
|
+
require 'rails/all'
|
|
4
|
+
|
|
5
|
+
require 'bundler/setup'
|
|
6
|
+
require 'devise'
|
|
7
|
+
# If you have a Gemfile, require the default gems, the ones in the
|
|
8
|
+
# current environment and also include :assets gems if in development
|
|
9
|
+
# or test environments.
|
|
10
|
+
Bundler.require *Rails.groups(:assets)
|
|
11
|
+
|
|
12
|
+
<%= application_definition %>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
login: &login
|
|
2
|
+
<% if /mysql$/ === @database %>
|
|
3
|
+
adapter: mysql<%= '2' unless /jdbc/ === @database %>
|
|
4
|
+
encoding: utf8
|
|
5
|
+
reconnect: false
|
|
6
|
+
pool: 5
|
|
7
|
+
username: root
|
|
8
|
+
password:
|
|
9
|
+
#socket: /tmp/mysql.sock
|
|
10
|
+
<% elsif /postgresql/ === @database %>
|
|
11
|
+
adapter: postgresql
|
|
12
|
+
encoding: unicode
|
|
13
|
+
database: answers_database_development
|
|
14
|
+
pool: 5
|
|
15
|
+
username: postgres
|
|
16
|
+
password: postgres
|
|
17
|
+
min_messages: warning
|
|
18
|
+
<% else %>
|
|
19
|
+
adapter: sqlite3
|
|
20
|
+
pool: 5
|
|
21
|
+
timeout: 5000
|
|
22
|
+
<% end %>
|
|
23
|
+
|
|
24
|
+
development:
|
|
25
|
+
<<: *login
|
|
26
|
+
database: dummy_dev
|
|
27
|
+
|
|
28
|
+
test:
|
|
29
|
+
<<: *login
|
|
30
|
+
database: dummy_test
|
|
31
|
+
|
|
32
|
+
production:
|
|
33
|
+
<<: *login
|
|
34
|
+
database: dummy_prod
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
Description:
|
|
2
|
+
Generates a custom plugin for Answers automatically. It works very similar
|
|
3
|
+
to the Rails scaffold generator.
|
|
4
|
+
|
|
5
|
+
A generated plugin gives you all the basic files needed to manage the model
|
|
6
|
+
the plugin will be for.
|
|
7
|
+
|
|
8
|
+
The first attribute should always be the one which is the title or name of
|
|
9
|
+
the model.
|
|
10
|
+
|
|
11
|
+
There must be at least one attribute.
|
|
12
|
+
|
|
13
|
+
Additional Supported Field Types
|
|
14
|
+
|
|
15
|
+
All field types that are supported by the Rails Scaffold generator are supported with the addition
|
|
16
|
+
of these Answers specific ones:
|
|
17
|
+
|
|
18
|
+
text - text area with a visual editor
|
|
19
|
+
image - link to an image picker dialogue
|
|
20
|
+
resource - link to a resource picker dialogue
|
|
21
|
+
|
|
22
|
+
Examples:
|
|
23
|
+
rails generate answers:engine product title:string description:text image:image brochure:resource
|
|
24
|
+
rails generate answers:engine product title:string description:text image:image brochure:resource --i18n title description
|