cama_meta_tag 1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/Rakefile +37 -0
  4. data/app/controllers/plugins/cama_meta_tag/admin_controller.rb +11 -0
  5. data/app/helpers/plugins/cama_meta_tag/main_helper.rb +46 -0
  6. data/app/models/plugins/cama_meta_tag/cama_meta_tag.rb +6 -0
  7. data/app/views/plugins/cama_meta_tag/admin/_meta_tag_fields.html.erb +34 -0
  8. data/app/views/plugins/cama_meta_tag/admin/settings.html.erb +20 -0
  9. data/config/camaleon_plugin.json +19 -0
  10. data/config/initializers/custom_models.rb +5 -0
  11. data/config/locales/en.yml +166 -0
  12. data/config/routes.rb +15 -0
  13. data/lib/cama_meta_tag/engine.rb +4 -0
  14. data/lib/cama_meta_tag/version.rb +3 -0
  15. data/lib/cama_meta_tag.rb +4 -0
  16. data/lib/tasks/cama_meta_tag_tasks.rake +4 -0
  17. data/test/cama_meta_tag_test.rb +7 -0
  18. data/test/dummy/README.rdoc +28 -0
  19. data/test/dummy/Rakefile +6 -0
  20. data/test/dummy/app/assets/javascripts/application.js +13 -0
  21. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  22. data/test/dummy/app/controllers/application_controller.rb +5 -0
  23. data/test/dummy/app/helpers/application_helper.rb +2 -0
  24. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  25. data/test/dummy/bin/bundle +3 -0
  26. data/test/dummy/bin/rails +4 -0
  27. data/test/dummy/bin/rake +4 -0
  28. data/test/dummy/bin/setup +29 -0
  29. data/test/dummy/config/application.rb +26 -0
  30. data/test/dummy/config/boot.rb +5 -0
  31. data/test/dummy/config/database.yml +25 -0
  32. data/test/dummy/config/environment.rb +5 -0
  33. data/test/dummy/config/environments/development.rb +41 -0
  34. data/test/dummy/config/environments/production.rb +79 -0
  35. data/test/dummy/config/environments/test.rb +42 -0
  36. data/test/dummy/config/initializers/assets.rb +11 -0
  37. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  38. data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
  39. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  40. data/test/dummy/config/initializers/inflections.rb +16 -0
  41. data/test/dummy/config/initializers/mime_types.rb +4 -0
  42. data/test/dummy/config/initializers/session_store.rb +3 -0
  43. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  44. data/test/dummy/config/locales/en.yml +23 -0
  45. data/test/dummy/config/routes.rb +56 -0
  46. data/test/dummy/config/secrets.yml +22 -0
  47. data/test/dummy/config.ru +4 -0
  48. data/test/dummy/public/404.html +67 -0
  49. data/test/dummy/public/422.html +67 -0
  50. data/test/dummy/public/500.html +66 -0
  51. data/test/dummy/public/favicon.ico +0 -0
  52. data/test/integration/navigation_test.rb +8 -0
  53. data/test/test_helper.rb +20 -0
  54. metadata +176 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: c0cde311027ac2b926b287a706c9cd7422dba11e
4
+ data.tar.gz: 5d1f01d63dbf83ae0c592b49618f244c2008dc0a
5
+ SHA512:
6
+ metadata.gz: 3a6b7987526385bfe9fa07a2f1375b8bc11429197708bc61d9a0cdc487ea86a4ce630578b793bf73cf0b963037cf207e5b7cc565279eb5570038ef30850b2b48
7
+ data.tar.gz: eac6ad710d00c6184f40138ad3ca7056e4e8120ed590894ee119cc00a6cc4eec9650a19f1a2aa9701ae8c1fd8e1f7ecdb3ba4d73740de3f8b4cb680548c1b937
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2016 Owen Peredo
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/Rakefile ADDED
@@ -0,0 +1,37 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
6
+
7
+ require 'rdoc/task'
8
+
9
+ RDoc::Task.new(:rdoc) do |rdoc|
10
+ rdoc.rdoc_dir = 'rdoc'
11
+ rdoc.title = 'CamaMetaTag'
12
+ rdoc.options << '--line-numbers'
13
+ rdoc.rdoc_files.include('README.rdoc')
14
+ rdoc.rdoc_files.include('lib/**/*.rb')
15
+ end
16
+
17
+ APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
18
+ load 'rails/tasks/engine.rake'
19
+
20
+
21
+ load 'rails/tasks/statistics.rake'
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,11 @@
1
+ class Plugins::CamaMetaTag::AdminController < CamaleonCms::Apps::PluginsAdminController
2
+ include Plugins::CamaMetaTag::MainHelper
3
+ def settings
4
+ # actions for admin panel
5
+ end
6
+
7
+ def save_settings
8
+ current_plugin.set_option('enabled_for_post_types', params[:enabled_for_post_types])
9
+ redirect_to(url_for(action: :settings), notice: t('.settings_saved'))
10
+ end
11
+ end
@@ -0,0 +1,46 @@
1
+ module Plugins::CamaMetaTag::MainHelper
2
+ def self.included(klass)
3
+ # klass.helper_method [:my_helper_method] rescue "" # here your methods accessible from views
4
+ end
5
+
6
+ # here all actions on going to active
7
+ # you can run sql commands like this:
8
+ # results = ActiveRecord::Base.connection.execute(query);
9
+ # plugin: plugin model
10
+ def cama_meta_tag_on_active(plugin)
11
+ end
12
+
13
+ # here all actions on going to inactive
14
+ # plugin: plugin model
15
+ def cama_meta_tag_on_inactive(plugin)
16
+ end
17
+
18
+ def cama_meta_tag_on_seo(args)
19
+ if is_page?
20
+ tmp = {
21
+ title: args[:object].get_option('seo_title').to_s.translate,
22
+ keywords: args[:object].get_option('keywords').to_s.translate,
23
+ descr: args[:object].get_option('seo_description').to_s.translate,
24
+ author: args[:object].get_option('seo_author').to_s.translate,
25
+ image: args[:object].get_option('seo_image').to_s.translate
26
+ }
27
+ args[:seo_data][:title] = tmp[:title] if tmp[:title].present?
28
+ args[:seo_data][:keywords] = tmp[:keywords] if tmp[:keywords].present?
29
+ args[:seo_data][:description] = tmp[:descr] if tmp[:descr].present?
30
+ args[:seo_data][:author] = tmp[:author] if tmp[:author].present?
31
+ if tmp[:image].present?
32
+ args[:seo_data][:image] = tmp[:image]
33
+ args[:seo_data][:twitter][:image] = tmp[:image]
34
+ args[:seo_data][:og][:image] = tmp[:image]
35
+ end
36
+ end
37
+ end
38
+
39
+ # def cama_meta_tags_plugin_links(args)
40
+ # # args[:links] << link_to(cama_t('plugins.cama_meta_tag.admin.settings_label'), admin_plugins_cama_meta_tag_settings_path)
41
+ # end
42
+
43
+ def cama_meta_tag_post_form_custom_html(args)
44
+ args[:html] << render(partial: plugin_view('admin/meta_tag_fields'), locals: {post: args[:post], post_type: args[:post_type]}) if args[:post].manage_seo?
45
+ end
46
+ end
@@ -0,0 +1,6 @@
1
+ # class Plugins::CamaMetaTag::CamaMetaTag < ActiveRecord::Base
2
+ # belongs_to :site, class_name: "CamleonCms::Site"
3
+
4
+ # here create your models normally
5
+ # notice: your tables in database will be plugins_cama_meta_tag in plural (check rails documentation)
6
+ # end
@@ -0,0 +1,34 @@
1
+ <% t_scope = 'plugins.cama_meta_tag.admin.meta_tag_fields' %>
2
+ <script>jQuery(function(){ $('#form-post #post_keywords').closest('.form-group').remove() })</script>
3
+ <div class="panel panel-default panel-toggled">
4
+ <div class="panel-heading">
5
+ <div><b><%= cama_t('.title_seo', scope: t_scope) %></b></div>
6
+ <ul class="panel-controls">
7
+ <li><a class="panel-collapse" href="#"><span class="fa fa-angle-up"></span></a></li>
8
+ </ul>
9
+ </div>
10
+ <div class="panel-body">
11
+ <div class="form-group">
12
+ <%= label_tag 'options[seo_title]', cama_t('.seo_title', scope: t_scope) %>
13
+ <%= text_field_tag 'options[seo_title]', post.get_option('seo_title'), class: 'form-control translatable' %>
14
+ </div>
15
+ <div class="form-group">
16
+ <%= label_tag 'options[keywords]', cama_t('.seo_keywords', scope: t_scope) %>
17
+ <%= text_field_tag 'options[keywords]', post.get_option('keywords'), class: 'form-control translatable' %>
18
+ </div>
19
+ <div class="form-group">
20
+ <%= label_tag 'options[seo_description]', cama_t('.seo_descr', scope: t_scope) %>
21
+ <%= text_area_tag 'options[seo_description]', post.get_option('seo_description'), class: 'form-control translatable' %>
22
+ </div>
23
+
24
+ <div class="form-group">
25
+ <%= label_tag 'options[seo_author]', cama_t('.seo_author', scope: t_scope) %>
26
+ <%= text_field_tag 'options[seo_author]', post.get_option('seo_author'), class: 'form-control' %>
27
+ </div>
28
+ <div class="form-group">
29
+ <%= label_tag 'options[seo_image]', cama_t('.seo_image', scope: t_scope) %> <br>
30
+ <%= hidden_field_tag 'options[seo_image]', post.get_option('seo_image') %>
31
+ </div>
32
+ </div>
33
+ </div>
34
+ <script type="application/javascript">jQuery(function(){ $("#form-post #options_seo_image").input_upload({label: '', title: '<%= cama_t('.seo_image', scope: t_scope) %>', type: 'image'}); })</script>
@@ -0,0 +1,20 @@
1
+ <%= form_tag url_for(action: :save_settings), method: :post, class: 'panel panel-default' do %>
2
+ <div class="panel-heading">
3
+ <h4><%= t('.title_settings') %></h4>
4
+ </div>
5
+ <div class="panel-body">
6
+ <label><%= t('camaleon_cms.admin.post_type.post_types') %></label>
7
+ <% current_site.the_post_types.decorate.each do |post_type| %>
8
+ <div class="checkbox">
9
+ <label>
10
+ <input type="checkbox" name="enabled_for_post_types[]" value="<%= post_type.id %>" <%= "checked" if current_plugin.get_option('enabled_for_post_types', []).include?(post_type.id.to_s) rescue false %> />
11
+ <%= post_type.the_title %>
12
+ </label>
13
+ </div>
14
+ <% end %>
15
+ <small><%= t('.post_types_descr', default: 'Select your post types where to apply seo fields.') %></small>
16
+ </div>
17
+ <div class="panel-footer">
18
+ <button class="btn btn-primary pull-right" type="submit"><%= t('camaleon_cms.admin.button.submit') %></button>
19
+ </div>
20
+ <% end %>
@@ -0,0 +1,19 @@
1
+ {
2
+ "title": "Cama Meta Tags",
3
+ "descr": "",
4
+ "key": "cama_meta_tag", // must be the name of the folder of your plugin, sample: app/views/plugins/<my_plugin> ==> 'my_plugin'
5
+ "helpers": [
6
+ "Plugins::CamaMetaTag::MainHelper"
7
+ ],
8
+ "hooks": {
9
+ "on_active": [
10
+ "cama_meta_tag_on_active"
11
+ ],
12
+ "on_inactive": [
13
+ "cama_meta_tag_on_inactive"
14
+ ],
15
+ "seo": ["cama_meta_tag_on_seo"],
16
+ "post_form_custom_html": ["cama_meta_tag_post_form_custom_html"]
17
+ //here you can add all your hooks (read documentation)
18
+ }
19
+ }
@@ -0,0 +1,5 @@
1
+ #Rails.application.config.to_prepare do
2
+ # CamaleonCms::Site.class_eval do
3
+ # has_many :attack, class_name: "Plugins::Attack::Models::Attack"
4
+ # end
5
+ # end
@@ -0,0 +1,166 @@
1
+ en:
2
+ plugins:
3
+ cama_meta_tag:
4
+ admin:
5
+ settings_label: 'Settings'
6
+ settings:
7
+ post_types_descr: 'Select your post types where to apply seo fields.'
8
+ title_settings: 'Meta Tag Settings'
9
+ save_settings:
10
+ settings_saved: 'Settings Saved'
11
+ meta_tag_fields:
12
+ title_seo: 'Seo Settings'
13
+ seo_title: 'Title'
14
+ seo_keywords: 'Keywords'
15
+ seo_descr: 'Description'
16
+ seo_author: 'Author'
17
+ seo_image: 'Image (Ideal: 1200 x 1200 or larger with a square aspect ratio)'
18
+
19
+ nl:
20
+ plugins:
21
+ cama_meta_tag:
22
+ admin:
23
+ settings_label: 'instellingen'
24
+ settings:
25
+ post_types_descr: 'Selecteer uw bericht typen waar te seo velden toe te passen.'
26
+ title_settings: 'Meta Tag instellingen'
27
+ save_settings:
28
+ settings_saved: 'Instellingen opgeslagen'
29
+ meta_tag_fields:
30
+ title_seo: 'Seo Instellingen'
31
+ seo_title: 'Titel'
32
+ seo_keywords: 'Trefwoorden'
33
+ seo_descr: 'Beschrijving'
34
+ seo_author: 'Auteur'
35
+ seo_image: 'Afbeelding (Ideal: 1200 x 1200 of groter met een vierkant aspect ratio)'
36
+
37
+ pt:
38
+ plugins:
39
+ cama_meta_tag:
40
+ admin:
41
+ settings_label: 'Configurações'
42
+ settings:
43
+ post_types_descr: 'Selecione os tipos de postagem onde aplicar campos seo.'
44
+ title_settings: 'Definições da Meta Tag'
45
+ save_settings:
46
+ settings_saved: 'Configurações salvas'
47
+ meta_tag_fields:
48
+ title_seo: 'Configurações de Seo'
49
+ seo_title: 'Título'
50
+ seo_keywords: 'Palavras-chave'
51
+ seo_descr: 'Descrição'
52
+ seo_author: 'Autor'
53
+ seo_image: 'Imagem (Ideal: 1200 x 1200 ou maior com uma relação de aspecto quadrada)'
54
+
55
+
56
+
57
+ pt-BR:
58
+ plugins:
59
+ cama_meta_tag:
60
+ admin:
61
+ settings_label: 'Configurações'
62
+ settings:
63
+ post_types_descr: 'Selecione os tipos de postagem onde aplicar campos seo.'
64
+ title_settings: 'Definições da Meta Tag'
65
+ save_settings:
66
+ settings_saved: 'Configurações salvas'
67
+ meta_tag_fields:
68
+ title_seo: 'Configurações de Seo'
69
+ seo_title: 'Título'
70
+ seo_keywords: 'Palavras-chave'
71
+ seo_descr: 'Descrição'
72
+ seo_author: 'Autor'
73
+ seo_image: 'Imagem (Ideal: 1200 x 1200 ou maior com uma relação de aspecto quadrada)'
74
+
75
+
76
+
77
+ de:
78
+ plugins:
79
+ cama_meta_tag:
80
+ admin:
81
+ settings_label: 'Einstellungen'
82
+ settings:
83
+ post_types_descr: 'Wählen Sie Ihre Posttypen aus, wo Sie seo Felder anwenden können.'
84
+ title_settings: 'Meta-Tag-Einstellungen'
85
+ save_settings:
86
+ settings_saved: 'Einstellungen gespeichert'
87
+ meta_tag_fields:
88
+ title_seo: 'Seo Einstellungen'
89
+ seo_title: 'Titel'
90
+ seo_keywords: 'Schlüsselwörter'
91
+ seo_descr: 'Beschreibung'
92
+ seo_author: 'Autor'
93
+ seo_image: 'Bild (Ideal: 1200 x 1200 oder größer mit einem quadratischen Seitenverhältnis)'
94
+
95
+
96
+ it:
97
+ plugins:
98
+ cama_meta_tag:
99
+ admin:
100
+ settings_label: 'Impostazioni'
101
+ settings:
102
+ post_types_descr: 'Selezionate la tipologia di pubblicare dove applicare i campi di SEO.'
103
+ title_settings: 'Impostazioni Meta Tag'
104
+ save_settings:
105
+ settings_saved: 'Impostazioni salvate'
106
+ meta_tag_fields:
107
+ title_seo: 'Impostazioni Seo'
108
+ seo_title: 'Titolo'
109
+ seo_keywords: 'Parole'
110
+ seo_descr: 'Descrizione'
111
+ seo_author: 'Autore'
112
+ seo_image: 'Immagine (ideale: 1200 x 1200 o superiore con un rapporto di aspetto di quadratura)'
113
+
114
+ zh-CN:
115
+ plugins:
116
+ cama_meta_tag:
117
+ admin:
118
+ settings_label: '设置'
119
+ settings:
120
+ post_types_descr: '选择您的帖子类型在哪里应用seo字段。'
121
+ title_settings: '元标记设置'
122
+ save_settings:
123
+ settings_saved: '设置已保存'
124
+ meta_tag_fields:
125
+ title_seo: 'Seo设置'
126
+ seo_title: '标题'
127
+ seo_keywords: '关键词'
128
+ seo_descr: '描述'
129
+ seo_author: '作者'
130
+ seo_image: '图片(理想:1200 x 1200或更大,正方形高宽比)'
131
+
132
+ ru:
133
+ plugins:
134
+ cama_meta_tag:
135
+ admin:
136
+ settings_label: 'настройки'
137
+ settings:
138
+ post_types_descr: 'Укажите типы почтовых где применить сео поля.'
139
+ title_settings: 'Мета Настройки тегов'
140
+ save_settings:
141
+ settings_saved: 'Настройки сохранены'
142
+ meta_tag_fields:
143
+ title_seo: 'Настройки Сео'
144
+ seo_title: 'заглавие'
145
+ seo_keywords: 'Ключевые слова'
146
+ seo_descr: 'Описание'
147
+ seo_author: 'автор'
148
+ seo_image: 'Изображение (Идеально: 1200 х 1200 или больше с квадратным соотношением сторон)'
149
+
150
+ es:
151
+ plugins:
152
+ cama_meta_tag:
153
+ admin:
154
+ settings_label: 'Ajustes'
155
+ settings:
156
+ post_types_descr: 'Seleccione los tipos de publicación donde aplicar los campos de seo.'
157
+ title_settings: 'Configuración de etiquetas de meta'
158
+ save_settings:
159
+ settings_saved: 'Ajustes guardados'
160
+ meta_tag_fields:
161
+ title_seo: 'Configuración de Seo'
162
+ seo_title: 'Título'
163
+ seo_keywords: 'Palabras claves'
164
+ seo_descr: 'Descripción'
165
+ seo_author: 'Autor'
166
+ seo_image: 'Imagen (Ideal: 1200 x 1200 o mayor con una relación de aspecto cuadrada)'
data/config/routes.rb ADDED
@@ -0,0 +1,15 @@
1
+ Rails.application.routes.draw do
2
+ scope PluginRoutes.system_info["relative_url_root"] do
3
+ #Admin Panel
4
+ scope :admin, as: 'admin', path: PluginRoutes.system_info['admin_path_name'] do
5
+ namespace 'plugins' do
6
+ namespace 'cama_meta_tag' do
7
+ controller :admin do
8
+ get :settings
9
+ post :save_settings
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,4 @@
1
+ module CamaMetaTag
2
+ class Engine < ::Rails::Engine
3
+ end
4
+ end
@@ -0,0 +1,3 @@
1
+ module CamaMetaTag
2
+ VERSION = "1.0"
3
+ end
@@ -0,0 +1,4 @@
1
+ require "cama_meta_tag/engine"
2
+
3
+ module CamaMetaTag
4
+ end
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :cama_meta_tag do
3
+ # # Task goes here
4
+ # end
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class CamaMetaTagTest < ActiveSupport::TestCase
4
+ test "truth" do
5
+ assert_kind_of Module, CamaMetaTag
6
+ end
7
+ end
@@ -0,0 +1,28 @@
1
+ == README
2
+
3
+ This README would normally document whatever steps are necessary to get the
4
+ application up and running.
5
+
6
+ Things you may want to cover:
7
+
8
+ * Ruby version
9
+
10
+ * System dependencies
11
+
12
+ * Configuration
13
+
14
+ * Database creation
15
+
16
+ * Database initialization
17
+
18
+ * How to run the test suite
19
+
20
+ * Services (job queues, cache servers, search engines, etc.)
21
+
22
+ * Deployment instructions
23
+
24
+ * ...
25
+
26
+
27
+ Please feel free to use a different markup language if you do not plan to run
28
+ <tt>rake doc:app</tt>.
@@ -0,0 +1,6 @@
1
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
2
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
+
4
+ require File.expand_path('../config/application', __FILE__)
5
+
6
+ Rails.application.load_tasks
@@ -0,0 +1,13 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // compiled file.
9
+ //
10
+ // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
11
+ // about supported directives.
12
+ //
13
+ //= require_tree .
@@ -0,0 +1,15 @@
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 any plugin's vendor/assets/stylesheets directory 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 bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any styles
10
+ * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
11
+ * file per style scope.
12
+ *
13
+ *= require_tree .
14
+ *= require_self
15
+ */
@@ -0,0 +1,5 @@
1
+ class ApplicationController < ActionController::Base
2
+ # Prevent CSRF attacks by raising an exception.
3
+ # For APIs, you may want to use :null_session instead.
4
+ protect_from_forgery with: :exception
5
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Dummy</title>
5
+ <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
6
+ <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
7
+ <%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+
11
+ <%= yield %>
12
+
13
+ </body>
14
+ </html>
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
+ load Gem.bin_path('bundler', 'bundle')
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
3
+ require_relative '../config/boot'
4
+ require 'rails/commands'
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require_relative '../config/boot'
3
+ require 'rake'
4
+ Rake.application.run
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+ require 'pathname'
3
+
4
+ # path to your application root.
5
+ APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
6
+
7
+ Dir.chdir APP_ROOT do
8
+ # This script is a starting point to setup your application.
9
+ # Add necessary setup steps to this file:
10
+
11
+ puts "== Installing dependencies =="
12
+ system "gem install bundler --conservative"
13
+ system "bundle check || bundle install"
14
+
15
+ # puts "\n== Copying sample files =="
16
+ # unless File.exist?("config/database.yml")
17
+ # system "cp config/database.yml.sample config/database.yml"
18
+ # end
19
+
20
+ puts "\n== Preparing database =="
21
+ system "bin/rake db:setup"
22
+
23
+ puts "\n== Removing old logs and tempfiles =="
24
+ system "rm -f log/*"
25
+ system "rm -rf tmp/cache"
26
+
27
+ puts "\n== Restarting application server =="
28
+ system "touch tmp/restart.txt"
29
+ end
@@ -0,0 +1,26 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ require 'rails/all'
4
+
5
+ Bundler.require(*Rails.groups)
6
+ require "cama_meta_tag"
7
+
8
+ module Dummy
9
+ class Application < Rails::Application
10
+ # Settings in config/environments/* take precedence over those specified here.
11
+ # Application configuration should go into files in config/initializers
12
+ # -- all .rb files in that directory are automatically loaded.
13
+
14
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
15
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
16
+ # config.time_zone = 'Central Time (US & Canada)'
17
+
18
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
19
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
20
+ # config.i18n.default_locale = :de
21
+
22
+ # Do not swallow errors in after_commit/after_rollback callbacks.
23
+ config.active_record.raise_in_transactional_callbacks = true
24
+ end
25
+ end
26
+
@@ -0,0 +1,5 @@
1
+ # Set up gems listed in the Gemfile.
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__)
3
+
4
+ require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
5
+ $LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__)
@@ -0,0 +1,25 @@
1
+ # SQLite version 3.x
2
+ # gem install sqlite3
3
+ #
4
+ # Ensure the SQLite 3 gem is defined in your Gemfile
5
+ # gem 'sqlite3'
6
+ #
7
+ default: &default
8
+ adapter: sqlite3
9
+ pool: 5
10
+ timeout: 5000
11
+
12
+ development:
13
+ <<: *default
14
+ database: db/development.sqlite3
15
+
16
+ # Warning: The database defined as "test" will be erased and
17
+ # re-generated from your development database when you run "rake".
18
+ # Do not set this db to the same as development or production.
19
+ test:
20
+ <<: *default
21
+ database: db/test.sqlite3
22
+
23
+ production:
24
+ <<: *default
25
+ database: db/production.sqlite3
@@ -0,0 +1,5 @@
1
+ # Load the Rails application.
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the Rails application.
5
+ Rails.application.initialize!