jinda 0.7.7.2 → 0.7.7.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +12 -1
- data/app/config/routes.rb +44 -0
- data/lib/generators/jinda/templates/README.md +3 -1
- data/lib/generators/jinda/templates/app/assets/stylesheets/application.css.scss +2 -2
- data/lib/generators/jinda/templates/app/assets/stylesheets/jinda_jqm.css.scss +32 -0
- data/lib/generators/jinda/templates/app/mailers/{application_mailer.rb → application_mailer.rb-org} +0 -0
- data/lib/generators/jinda/templates/config/mongoid.yml +3 -3
- data/lib/jinda/version.rb +1 -1
- data/test/Gemfile +2 -0
- data/test/dummy/Dockerfile +26 -0
- data/test/dummy/Gemfile +99 -0
- data/test/dummy/Gemfile.lock +515 -0
- data/test/dummy/{db/development.sqlite3 → README.md} +0 -0
- data/test/dummy/README.md.bak +24 -0
- data/test/dummy/Rakefile +1 -1
- data/test/dummy/app/assets/config/manifest.js +2 -1
- data/test/dummy/app/assets/config/manifest.js-rails +2 -0
- data/test/dummy/app/assets/javascripts/application.js +15 -0
- data/test/dummy/app/assets/stylesheets/{application.css → application.css.bak} +3 -3
- data/test/dummy/app/assets/stylesheets/application.css.scss +15 -0
- data/test/dummy/app/assets/stylesheets/jinda_jqm.css.scss +32 -0
- data/test/dummy/app/controllers/admins_controller.rb +6 -0
- data/test/dummy/app/controllers/api/v1/notes_controller.rb +81 -0
- data/test/dummy/app/controllers/application_controller.rb +39 -0
- data/test/dummy/app/controllers/application_controller.rb.bak +2 -0
- data/test/dummy/app/controllers/articles_controller.rb +110 -0
- data/test/dummy/app/controllers/comments_controller.rb +31 -0
- data/test/dummy/app/controllers/docs_controller.rb +56 -0
- data/test/dummy/app/controllers/identities_controller.rb +5 -0
- data/test/dummy/app/controllers/notes_controller.rb +84 -0
- data/test/dummy/app/controllers/password_resets.rb +28 -0
- data/test/dummy/app/controllers/password_resets_controller.rb +34 -0
- data/test/dummy/app/controllers/sessions_controller.rb +44 -0
- data/test/dummy/app/controllers/sitemap_controller.rb +12 -0
- data/test/dummy/app/controllers/users_controller.rb +35 -0
- data/test/dummy/app/helpers/admins_helper.rb +2 -0
- data/test/dummy/app/helpers/application_helper.rb +31 -0
- data/test/dummy/app/helpers/application_helper.rb.bak +2 -0
- data/test/dummy/app/helpers/articles_helper.rb +2 -0
- data/test/dummy/app/helpers/basic_helper.rb +2 -0
- data/test/dummy/app/helpers/comments_helper.rb +2 -0
- data/test/dummy/app/helpers/ctrs_helper.rb +2 -0
- data/test/dummy/app/helpers/devs_helper.rb +2 -0
- data/test/dummy/app/helpers/pictures_helper.rb +2 -0
- data/test/dummy/app/helpers/sitemap_helper.rb +2 -0
- data/test/dummy/app/helpers/users_helper.rb +2 -0
- data/test/dummy/app/jinda/index.mm +486 -0
- data/test/dummy/app/jinda/template/index.mm +366 -0
- data/test/dummy/app/jinda/template/linkview.haml +21 -0
- data/test/dummy/app/jinda/template/view.html.erb +34 -0
- data/test/dummy/app/mailers/application_mailer.rb +2 -2
- data/test/dummy/app/mailers/application_mailer.rb-org +4 -0
- data/test/dummy/app/mailers/jinda_mailer.rb +7 -0
- data/test/dummy/app/mailers/note_mailer.rb +10 -0
- data/test/dummy/app/mailers/user_mailer.rb +15 -0
- data/test/dummy/app/models/address.rb +14 -0
- data/test/dummy/app/models/article.rb +14 -0
- data/test/dummy/app/models/comment.rb +14 -0
- data/test/dummy/app/models/identity.rb +18 -0
- data/test/dummy/app/models/jinda/doc.rb +36 -0
- data/test/dummy/app/models/jinda/module.rb +11 -0
- data/test/dummy/app/models/jinda/notice.rb +14 -0
- data/test/dummy/app/models/jinda/role.rb +8 -0
- data/test/dummy/app/models/jinda/runseq.rb +24 -0
- data/test/dummy/app/models/jinda/service.rb +17 -0
- data/test/dummy/app/models/jinda/xmain.rb +38 -0
- data/test/dummy/app/models/note.rb +22 -0
- data/test/dummy/app/models/param.rb +41 -0
- data/test/dummy/app/models/person.rb +14 -0
- data/test/dummy/app/models/user.rb +66 -0
- data/test/dummy/app/views/adminbsbs/content.haml +241 -0
- data/test/dummy/app/views/admins/edit_role/edit_role.html.erb +7 -0
- data/test/dummy/app/views/admins/edit_role/select_user.html.erb +4 -0
- data/test/dummy/app/views/api/v1/note.haml +0 -0
- data/test/dummy/app/views/articles/_report.haml +35 -0
- data/test/dummy/app/views/articles/edit.haml +23 -0
- data/test/dummy/app/views/articles/edit_article/edit_article.html.erb +15 -0
- data/test/dummy/app/views/articles/edit_article/select_article.html.erb +12 -0
- data/test/dummy/app/views/articles/index.haml +5 -0
- data/test/dummy/app/views/articles/my.haml +5 -0
- data/test/dummy/app/views/articles/new_article/form_article.html.erb +16 -0
- data/test/dummy/app/views/articles/show.html.haml +58 -0
- data/test/dummy/app/views/articles/xedit_article/edit_article.html.erb +13 -0
- data/test/dummy/app/views/ctrs/vfolder1/viewfile1.html.erb +23 -0
- data/test/dummy/app/views/ctrs/vfolder1/viewfile2.html.erb +23 -0
- data/test/dummy/app/views/ctrs/vfolder2/viewfile2.html.erb +23 -0
- data/test/dummy/app/views/custom/_adsense.haml +6 -0
- data/test/dummy/app/views/docs/doc_edit/doc_edit.html.erb +21 -0
- data/test/dummy/app/views/docs/doc_edit/doc_select.html.erb +14 -0
- data/test/dummy/app/views/docs/doc_new/doc_form.html.erb +32 -0
- data/test/dummy/app/views/docs/doc_new/doc_form.md +36 -0
- data/test/dummy/app/views/docs/doc_xedit/doc_edit.html.erb +21 -0
- data/test/dummy/app/views/docs/edit/select_note.html.erb +14 -0
- data/test/dummy/app/views/docs/index.haml +21 -0
- data/test/dummy/app/views/docs/my.haml +27 -0
- data/test/dummy/app/views/identities/new.html.haml +32 -0
- data/test/dummy/app/views/jinda/_activity.md +10 -0
- data/test/dummy/app/views/jinda/_menu.haml +27 -0
- data/test/dummy/app/views/jinda/_menu_mm.haml +44 -0
- data/test/dummy/app/views/jinda/_model.md +5 -0
- data/test/dummy/app/views/jinda/_modul.md +9 -0
- data/test/dummy/app/views/jinda/_pending_home.haml +5 -0
- data/test/dummy/app/views/jinda/_pending_page.haml +24 -0
- data/test/dummy/app/views/jinda/_service.md +24 -0
- data/test/dummy/app/views/jinda/_static.haml +13 -0
- data/test/dummy/app/views/jinda/doc-thai.md +37 -0
- data/test/dummy/app/views/jinda/doc.md +36 -0
- data/test/dummy/app/views/jinda/error_logs.haml +22 -0
- data/test/dummy/app/views/jinda/feed.rss.builder +27 -0
- data/test/dummy/app/views/jinda/help.haml +20 -0
- data/test/dummy/app/views/jinda/index.html.haml +53 -0
- data/test/dummy/app/views/jinda/logs.haml +22 -0
- data/test/dummy/app/views/jinda/notice_logs.haml +18 -0
- data/test/dummy/app/views/jinda/pending.haml +1 -0
- data/test/dummy/app/views/jinda/run_form.haml +42 -0
- data/test/dummy/app/views/jinda/run_output.haml +38 -0
- data/test/dummy/app/views/jinda/search.haml +20 -0
- data/test/dummy/app/views/jinda/status.haml +61 -0
- data/test/dummy/app/views/jinda_mailer/gmail.html.erb +9 -0
- data/test/dummy/app/views/layouts/_head.html.erb +10 -0
- data/test/dummy/app/views/layouts/_meta_tag.html.erb +19 -0
- data/test/dummy/app/views/layouts/application.haml +4 -0
- data/test/dummy/app/views/layouts/{application.html.erb → application.html.erb.bak} +2 -1
- data/test/dummy/app/views/layouts/bsb/_footer.haml +7 -0
- data/test/dummy/app/views/layouts/bsb/_header.haml +147 -0
- data/test/dummy/app/views/layouts/bsb/_menu.haml +47 -0
- data/test/dummy/app/views/layouts/bsb/_menu_mm.haml +34 -0
- data/test/dummy/app/views/layouts/bsb/_rightbar.haml +123 -0
- data/test/dummy/app/views/layouts/bsb/_sidebar.haml +155 -0
- data/test/dummy/app/views/layouts/bsb/application.haml-bsb +47 -0
- data/test/dummy/app/views/layouts/gmail.html.erb +9 -0
- data/test/dummy/app/views/layouts/jqm/_full.haml +33 -0
- data/test/dummy/app/views/layouts/jqm/_page.haml +16 -0
- data/test/dummy/app/views/layouts/jqm/application.haml-jqm +4 -0
- data/test/dummy/app/views/layouts/mailer.html.haml +3 -0
- data/test/dummy/app/views/layouts/mailer.text.haml +1 -0
- data/test/dummy/app/views/layouts/mobile.html.erb +13 -0
- data/test/dummy/app/views/layouts/mobilejq.html.erb +31 -0
- data/test/dummy/app/views/layouts/print.html.erb +22 -0
- data/test/dummy/app/views/layouts/utf8.html.erb +22 -0
- data/test/dummy/app/views/note_mailer/gmail.html.haml +7 -0
- data/test/dummy/app/views/note_mailer/gmail.text.haml +8 -0
- data/test/dummy/app/views/notes/delete/select_note.html.erb +14 -0
- data/test/dummy/app/views/notes/edit/edit_note.html.erb +10 -0
- data/test/dummy/app/views/notes/edit/select_note.html.erb +14 -0
- data/test/dummy/app/views/notes/index.haml +71 -0
- data/test/dummy/app/views/notes/mail/display_mail.html.erb +20 -0
- data/test/dummy/app/views/notes/mail/select_note.html.erb +19 -0
- data/test/dummy/app/views/notes/mail/show.html.haml +13 -0
- data/test/dummy/app/views/notes/my.haml +21 -0
- data/test/dummy/app/views/notes/new/new_note.html.erb +13 -0
- data/test/dummy/app/views/notes/show.haml +10 -0
- data/test/dummy/app/views/notes/xedit/edit_note.html.erb +10 -0
- data/test/dummy/app/views/password_resets/edit.html.erb +21 -0
- data/test/dummy/app/views/password_resets/new.html.haml +11 -0
- data/test/dummy/app/views/sessions/new.html.haml +22 -0
- data/test/dummy/app/views/sitemap/index.xml.haml +10 -0
- data/test/dummy/app/views/user_mailer/password_reset.html.haml +3 -0
- data/test/dummy/app/views/user_mailer/password_reset.text.erb +3 -0
- data/test/dummy/app/views/user_mailer/password_reset.text.haml +3 -0
- data/test/dummy/app/views/users/index.haml +13 -0
- data/test/dummy/app/views/users/pwd/enter.html.erb +6 -0
- data/test/dummy/app/views/users/user/enter_user.html.erb +10 -0
- data/test/dummy/bin/rails +3 -3
- data/test/dummy/bin/rake +2 -2
- data/test/dummy/bin/setup +9 -17
- data/test/dummy/config/application.rb +51 -9
- data/test/dummy/config/boot.rb +3 -4
- data/test/dummy/config/cloudinary.yml +9 -0
- data/test/dummy/config/credentials.yml.enc +1 -0
- data/test/dummy/config/environment.rb +7 -1
- data/test/dummy/config/environments/development.rb +20 -20
- data/test/dummy/config/environments/production.rb +16 -40
- data/test/dummy/config/environments/test.rb +19 -11
- data/test/dummy/config/initializers/assets.rb +1 -1
- data/test/dummy/config/initializers/content_security_policy.rb +21 -24
- data/test/dummy/config/initializers/filter_parameter_logging.rb +6 -2
- data/test/dummy/config/initializers/fix_mongoid_generator.rb-org +14 -0
- data/test/dummy/config/initializers/inflections.rb +4 -4
- data/test/dummy/config/initializers/jinda.rb +14 -0
- data/test/dummy/config/initializers/mongoid.rb +10 -0
- data/test/dummy/config/initializers/omniauth.rb +17 -0
- data/test/dummy/config/initializers/permissions_policy.rb +11 -0
- data/test/dummy/config/locales/en.yml +3 -3
- data/test/dummy/config/mongoid.yml +196 -0
- data/test/dummy/config/mongoid.yml-docker +182 -0
- data/test/dummy/config/mongoid.yml-localhost +182 -0
- data/test/dummy/config/puma.rb +7 -2
- data/test/dummy/config/routes.rb +5 -1
- data/test/dummy/config.ru +2 -1
- data/test/dummy/db/seeds.rb +6 -0
- data/test/dummy/docker-compose.yml +19 -0
- data/test/dummy/dot/dot.env +2 -0
- data/test/dummy/entrypoint.sh +13 -0
- data/test/dummy/log/development.log +697 -6
- data/test/dummy/public/robots.txt +1 -0
- data/test/dummy/spec/controllers/api/v1_get_index_spec.rb +23 -0
- data/test/dummy/spec/controllers/api/v1_get_my_spec.rb +14 -0
- data/test/dummy/spec/controllers/api/v1_post_spec.rb +19 -0
- data/test/dummy/spec/controllers/sessions_controller_spec.rb +98 -0
- data/test/dummy/spec/features/userlogins_spec.rb +23 -0
- data/test/dummy/spec/mailers/note_spec.rb +24 -0
- data/test/dummy/spec/mailers/previews/note_preview.rb +9 -0
- data/test/dummy/spec/models/note_spec.rb +41 -0
- data/test/dummy/spec/models/user_spec.rb +12 -0
- data/test/dummy/spec/rails_helper.rb +42 -0
- data/test/dummy/spec/spec_helper.rb +80 -0
- data/test/dummy/spec/support/authentication_helper.rb +20 -0
- data/test/dummy/spec/support/databasecleaner.rb +13 -0
- data/test/dummy/spec/support/factory_bot.rb +12 -0
- data/test/dummy/spec/support/omniauth_macros.rb +38 -0
- data/test/dummy/spec/support/request_spec_helper.rb +8 -0
- data/test/dummy/spec/views/articles/_article.html.erb_spec.rbx +14 -0
- data/test/dummy/tmp/development_secret.txt +1 -1
- metadata +188 -17
- data/test/dummy/app/javascript/packs/application.js +0 -15
- data/test/dummy/app/models/application_record.rb +0 -3
- data/test/dummy/config/database.yml +0 -25
- data/test/dummy/config/initializers/application_controller_renderer.rb +0 -8
- data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/test/dummy/config/initializers/cookies_serializer.rb +0 -5
- data/test/dummy/config/initializers/mime_types.rb +0 -4
- data/test/dummy/config/initializers/wrap_parameters.rb +0 -14
- data/test/dummy/config/spring.rb +0 -6
- data/test/dummy/config/storage.yml +0 -34
@@ -0,0 +1,13 @@
|
|
1
|
+
- title @note.title
|
2
|
+
- description @note.body
|
3
|
+
|
4
|
+
- @title= 'Show Note'
|
5
|
+
- doc = Note.find_by :id => $xvars["select_note"]["id"]
|
6
|
+
= fields_for doc do |f|
|
7
|
+
= f.label :title, "Title"
|
8
|
+
= f.text_field :title
|
9
|
+
%br/
|
10
|
+
= f.label :body, "Body Content"
|
11
|
+
= f.cktext_area :body, :cols=>50, :rows=>6
|
12
|
+
|
13
|
+
= link_to image_tag('pencil.png', style:'border:none; float:none;'), {controller: "jinda", action: "init", s: 'notes:xedit', note_id: @note.id}, data: { confirm: "Please Confirm" }
|
@@ -0,0 +1,21 @@
|
|
1
|
+
- @title= "My Notes"
|
2
|
+
%P
|
3
|
+
- @page_title = 'My Notes'
|
4
|
+
= paginate @notes
|
5
|
+
%table{:class=>"module-table", :data-mode => "reflow", :data-role => "table"}
|
6
|
+
%tr
|
7
|
+
%th Title
|
8
|
+
%th Body
|
9
|
+
%th Created
|
10
|
+
%th Updated
|
11
|
+
%th Delete
|
12
|
+
%th Edit
|
13
|
+
- @notes.each do |note|
|
14
|
+
%tr
|
15
|
+
%td= link_to note.title, :controller=>"notes", :action=>"show", :id=>note.id
|
16
|
+
%td= note.body
|
17
|
+
%td= note.created_at.strftime('%m/%d/%Y')
|
18
|
+
%td= note.updated_at.strftime('%m/%d/%Y')
|
19
|
+
%td(align='center')= link_to image_tag('delete.png', style:'border:none; float:none;'), "#", :onclick=>"if (confirm('Please Confirm')) {location.hash='/notes/destroy/#{note.id}';}"
|
20
|
+
%td(align='center')= link_to image_tag('pencil.png', style:'border:none; float:none;'), {controller: "jinda", action: "init", s: 'notes:xedit', note_id: note.id}, data: { confirm: "Please Confirm" }
|
21
|
+
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<%- @title= 'New Note' %>
|
2
|
+
<%
|
3
|
+
doc = Note.new :issue_on=> Date.today, :process_at => Time.now
|
4
|
+
%>
|
5
|
+
<div name= "note_new">
|
6
|
+
|
7
|
+
<%= fields_for doc, validate: true do |f| %>
|
8
|
+
<%= f.label :title, "Title" %>
|
9
|
+
<%= f.text_field :title, :required => true %><Br>
|
10
|
+
<%= f.label :body, "Body Content" %>
|
11
|
+
<%= f.text_area :body, :cols=>50, :rows=>6, required: true %>
|
12
|
+
<% end %>
|
13
|
+
</div>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
- @title= 'Show Note'
|
2
|
+
- doc = Note.find_by :id => @note.id
|
3
|
+
|
4
|
+
%h3.ui-bar.ui-bar-a.ui-corner-all Title: #{@note.title}
|
5
|
+
|
6
|
+
.ui-body.ui-body-a.ui-corner-all
|
7
|
+
|
8
|
+
%p #{@note.body}
|
9
|
+
|
10
|
+
= link_to image_tag('pencil.png', style:'border:none; float:none;'), {controller: "jinda", action: "init", s: 'notes:xedit', note_id: @note.id}, data: { confirm: "Please Confirm" }
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<%- @title= 'Edit Note' %>
|
2
|
+
<%
|
3
|
+
doc = Note.find_by :id=> $xvars["p"]["note_id"]
|
4
|
+
%>
|
5
|
+
<%= fields_for doc do |f| %>
|
6
|
+
<%= f.label :title, "Title" %>
|
7
|
+
<%= f.text_field :title %><Br>
|
8
|
+
<%= f.label :body, "Body Content" %>
|
9
|
+
<%= f.text_area :body, :cols=>50, :rows=>6 %>
|
10
|
+
<% end %>
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<%= form_for @user, :url => password_reset_path(params[:id]) do |f| %>
|
2
|
+
<% if @user.errors.any? %>
|
3
|
+
<div class="error_messages">
|
4
|
+
<h2>Form is invalid</h2>
|
5
|
+
<ul>
|
6
|
+
<% for message in @user.errors.full_messages %>
|
7
|
+
<li><%= message %></li>
|
8
|
+
<% end %>
|
9
|
+
</ul>
|
10
|
+
</div>
|
11
|
+
<% end %>
|
12
|
+
<div class="field">
|
13
|
+
<%= f.label :password %>
|
14
|
+
<%= f.password_field :password %>
|
15
|
+
</div>
|
16
|
+
<div class="field">
|
17
|
+
<%= f.label :password_confirmation %>
|
18
|
+
<%= f.password_field :password_confirmation %>
|
19
|
+
</div>
|
20
|
+
<div class="actions"><%= f.submit "Update Password" %></div>
|
21
|
+
<% end %>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
.container
|
2
|
+
.signup-form
|
3
|
+
.sign_in
|
4
|
+
= form_tag password_resets_path, :method => :post do
|
5
|
+
.form-group.form-control
|
6
|
+
= label_tag :email
|
7
|
+
= text_field_tag :email, params[:email]
|
8
|
+
%button.btn.btn-success.btn-block.actions{:type => "submit"}
|
9
|
+
%i.fas.fa-sign-in-alt
|
10
|
+
Reset Password
|
11
|
+
|
@@ -0,0 +1,22 @@
|
|
1
|
+
.container
|
2
|
+
.signup-form
|
3
|
+
= form_tag "/auth/identity/callback", {'data-ajax'=>'false'} do
|
4
|
+
%h1.h3.mb-3.font-weight-normal{:style => "text-align: center"} Sign in
|
5
|
+
.sign_in
|
6
|
+
.label-warning
|
7
|
+
= flash[:alert]
|
8
|
+
.form-group.form-control
|
9
|
+
= label_tag :auth_key, "User name"
|
10
|
+
= text_field_tag :auth_key
|
11
|
+
.form-group.form-control
|
12
|
+
= label_tag :password, "Password"
|
13
|
+
= password_field_tag :password
|
14
|
+
.form-group
|
15
|
+
= label_tag :remember_me
|
16
|
+
= check_box_tag :remember_me, 1, params.permit[:remember_me]
|
17
|
+
%button.btn.btn-success.btn-block.actions{:type => "submit"}
|
18
|
+
%i.fas.fa-sign-in-alt
|
19
|
+
Sign in
|
20
|
+
= link_to 'Forgotten password?', new_password_reset_path, data: {icon: 'info', mini: 'true', role: 'button'}
|
21
|
+
%hr/
|
22
|
+
|
@@ -0,0 +1,10 @@
|
|
1
|
+
/= From https://makandracards.com/makandra/689-know-your-haml-comments
|
2
|
+
|
3
|
+
!!! XML
|
4
|
+
%urlset{:xmlns => "http://www.sitemaps.org/schemas/sitemap/0.9"}
|
5
|
+
- for article in @articles
|
6
|
+
%url
|
7
|
+
%loc #{article_url(article)}
|
8
|
+
%lastmod=article.updated_at.strftime('%Y-%m-%d')
|
9
|
+
%changefreq monthly
|
10
|
+
%priority 0.5
|
@@ -0,0 +1,13 @@
|
|
1
|
+
.field(data-role="fieldcontain")
|
2
|
+
%label.ui-input-text Name
|
3
|
+
= b current_ma_user.code
|
4
|
+
.field(data-role="fieldcontain")
|
5
|
+
%label.ui-input-text Email
|
6
|
+
= b current_ma_user.email
|
7
|
+
.field(data-role="fieldcontain")
|
8
|
+
%label.ui-input-text Role
|
9
|
+
= b current_ma_user.role
|
10
|
+
|
11
|
+
- if @xmains
|
12
|
+
%h2 Pending Tasks
|
13
|
+
= render :partial=>"jinda/pending_page", :locals=>{:xmains=>@xmains}
|
data/test/dummy/bin/rails
CHANGED
@@ -1,4 +1,4 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
APP_PATH = File.expand_path(
|
3
|
-
require_relative
|
4
|
-
require
|
2
|
+
APP_PATH = File.expand_path("../config/application", __dir__)
|
3
|
+
require_relative "../config/boot"
|
4
|
+
require "rails/commands"
|
data/test/dummy/bin/rake
CHANGED
data/test/dummy/bin/setup
CHANGED
@@ -1,33 +1,25 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
require
|
2
|
+
require "fileutils"
|
3
3
|
|
4
4
|
# path to your application root.
|
5
|
-
APP_ROOT = File.expand_path(
|
5
|
+
APP_ROOT = File.expand_path("..", __dir__)
|
6
6
|
|
7
7
|
def system!(*args)
|
8
8
|
system(*args) || abort("\n== Command #{args} failed ==")
|
9
9
|
end
|
10
10
|
|
11
11
|
FileUtils.chdir APP_ROOT do
|
12
|
-
# This script is a way to
|
13
|
-
# This script is idempotent, so that you can run it at
|
12
|
+
# This script is a way to set up or update your development environment automatically.
|
13
|
+
# This script is idempotent, so that you can run it at any time and get an expectable outcome.
|
14
14
|
# Add necessary setup steps to this file.
|
15
15
|
|
16
|
-
puts
|
17
|
-
system!
|
18
|
-
system(
|
19
|
-
|
20
|
-
# puts "\n== Copying sample files =="
|
21
|
-
# unless File.exist?('config/database.yml')
|
22
|
-
# FileUtils.cp 'config/database.yml.sample', 'config/database.yml'
|
23
|
-
# end
|
24
|
-
|
25
|
-
puts "\n== Preparing database =="
|
26
|
-
system! 'bin/rails db:prepare'
|
16
|
+
puts "== Installing dependencies =="
|
17
|
+
system! "gem install bundler --conservative"
|
18
|
+
system("bundle check") || system!("bundle install")
|
27
19
|
|
28
20
|
puts "\n== Removing old logs and tempfiles =="
|
29
|
-
system!
|
21
|
+
system! "bin/rails log:clear tmp:clear"
|
30
22
|
|
31
23
|
puts "\n== Restarting application server =="
|
32
|
-
system!
|
24
|
+
system! "bin/rails restart"
|
33
25
|
end
|
@@ -1,19 +1,61 @@
|
|
1
|
-
require_relative
|
1
|
+
require_relative "boot"
|
2
2
|
|
3
|
-
require
|
3
|
+
require "rails"
|
4
|
+
# Pick the frameworks you want:
|
5
|
+
require "active_model/railtie"
|
6
|
+
require "active_job/railtie"
|
7
|
+
# require "active_record/railtie"
|
8
|
+
# require "active_storage/engine"
|
9
|
+
require "action_controller/railtie"
|
10
|
+
require "action_mailer/railtie"
|
11
|
+
# require "action_mailbox/engine"
|
12
|
+
# require "action_text/engine"
|
13
|
+
require "action_view/railtie"
|
14
|
+
require "action_cable/engine"
|
15
|
+
# require "rails/test_unit/railtie"
|
4
16
|
|
17
|
+
# Require the gems listed in Gemfile, including any gems
|
18
|
+
# you've limited to :test, :development, or :production.
|
5
19
|
Bundler.require(*Rails.groups)
|
6
|
-
require "jinda"
|
7
20
|
|
8
21
|
module Dummy
|
9
22
|
class Application < Rails::Application
|
23
|
+
|
24
|
+
# Jinda default
|
25
|
+
config.generators do |g|
|
26
|
+
g.orm :mongoid
|
27
|
+
g.template_engine :haml
|
28
|
+
g.test_framework :rspec
|
29
|
+
g.integration_tool :rspec
|
30
|
+
end
|
31
|
+
|
32
|
+
# config time zone
|
33
|
+
config.time_zone = "Central Time (US & Canada)"
|
34
|
+
|
35
|
+
# gmail config
|
36
|
+
# config.action_mailer.delivery_method = :smtp
|
37
|
+
# config.action_mailer.smtp_settings = {
|
38
|
+
# :address => "smtp.gmail.com",
|
39
|
+
# :port => 587,
|
40
|
+
# :user_name => 'user@gmail.com',
|
41
|
+
# :password => 'secret',
|
42
|
+
# :authentication => 'plain',
|
43
|
+
# :enable_starttls_auto => true }
|
44
|
+
# config.action_mailer.raise_delivery_errors = true
|
45
|
+
# config.action_mailer.perform_deliveries = true
|
46
|
+
|
10
47
|
# Initialize configuration defaults for originally generated Rails version.
|
11
|
-
config.load_defaults
|
48
|
+
config.load_defaults 7.0
|
12
49
|
|
13
|
-
#
|
14
|
-
#
|
15
|
-
#
|
16
|
-
#
|
50
|
+
# Configuration for the application, engines, and railties goes here.
|
51
|
+
#
|
52
|
+
# These settings can be overridden in specific environments using the files
|
53
|
+
# in config/environments, which are processed later.
|
54
|
+
#
|
55
|
+
# config.time_zone = "Central Time (US & Canada)"
|
56
|
+
# config.eager_load_paths << Rails.root.join("extras")
|
57
|
+
|
58
|
+
# Don't generate system test files.
|
59
|
+
config.generators.system_tests = nil
|
17
60
|
end
|
18
61
|
end
|
19
|
-
|
data/test/dummy/config/boot.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
|
-
|
2
|
-
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../Gemfile', __dir__)
|
1
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
|
3
2
|
|
4
|
-
require
|
5
|
-
|
3
|
+
require "bundler/setup" # Set up gems listed in the Gemfile.
|
4
|
+
require "bootsnap/setup" # Speed up boot time by caching expensive operations.
|
@@ -0,0 +1 @@
|
|
1
|
+
xOGPelyaT1v3CYb4FMvcnfeMGaZCqYxH+8aLnGqPEUiT3xTZ4p//+p7hk+9nCg4OlSf41OEZ1NXk3i0w0hB1dxEBuRmJ753h8RFqyYpUIRK0spp4IT0yco7a7n5Ga0Mk2GKjI30umX7mIZceXgaYXTGh8eZPBFhnXy7tB3uT8wC2Xj9L14MzgGb4BuVi+ahzJSEyt/4UhkrDDp1Fhp3jkGTl9dANcDQCl3OG1Dm2i9jhpGeJtX+XkPhUNquZ/OxnIYjdKdchiBIsLITsMEff0F/etO4Lhe6C42eqi4jaoiSTtgRht0dRe1IaqajIkq3R4MEf1QYUDZvzBTnJwtpsaBNx5H8nITuhrCa9Mf/kMecjP/qyhsKnJx+cjL7Qf8qm917sCahQr3AKHW8zKFz7MovZfuW6A2u4YxSJ--PIknWU8u9P4xf4A6--0GSRBaYsp1y2hRpDTuQ5GQ==
|
@@ -1,5 +1,11 @@
|
|
1
1
|
# Load the Rails application.
|
2
|
-
require_relative
|
2
|
+
require_relative "application"
|
3
3
|
|
4
4
|
# Initialize the Rails application.
|
5
5
|
Rails.application.initialize!
|
6
|
+
|
7
|
+
# hack to fix cloudinary error https://github.com/archiloque/rest-client/issues/141
|
8
|
+
class Hash
|
9
|
+
remove_method :read
|
10
|
+
rescue
|
11
|
+
end
|
@@ -1,8 +1,10 @@
|
|
1
|
+
require "active_support/core_ext/integer/time"
|
2
|
+
|
1
3
|
Rails.application.configure do
|
2
4
|
# Settings specified here will take precedence over those in config/application.rb.
|
3
5
|
|
4
|
-
# In the development environment your application's code is reloaded
|
5
|
-
#
|
6
|
+
# In the development environment your application's code is reloaded any time
|
7
|
+
# it changes. This slows down response time but is perfect for development
|
6
8
|
# since you don't have to restart the web server when you make code changes.
|
7
9
|
config.cache_classes = false
|
8
10
|
|
@@ -12,15 +14,18 @@ Rails.application.configure do
|
|
12
14
|
# Show full error reports.
|
13
15
|
config.consider_all_requests_local = true
|
14
16
|
|
17
|
+
# Enable server timing
|
18
|
+
config.server_timing = true
|
19
|
+
|
15
20
|
# Enable/disable caching. By default caching is disabled.
|
16
21
|
# Run rails dev:cache to toggle caching.
|
17
|
-
if Rails.root.join(
|
22
|
+
if Rails.root.join("tmp/caching-dev.txt").exist?
|
18
23
|
config.action_controller.perform_caching = true
|
19
24
|
config.action_controller.enable_fragment_cache_logging = true
|
20
25
|
|
21
26
|
config.cache_store = :memory_store
|
22
27
|
config.public_file_server.headers = {
|
23
|
-
|
28
|
+
"Cache-Control" => "public, max-age=#{2.days.to_i}"
|
24
29
|
}
|
25
30
|
else
|
26
31
|
config.action_controller.perform_caching = false
|
@@ -28,35 +33,30 @@ Rails.application.configure do
|
|
28
33
|
config.cache_store = :null_store
|
29
34
|
end
|
30
35
|
|
31
|
-
# Store uploaded files on the local file system (see config/storage.yml for options).
|
32
|
-
config.active_storage.service = :local
|
33
|
-
|
34
36
|
# Don't care if the mailer can't send.
|
35
37
|
config.action_mailer.raise_delivery_errors = false
|
38
|
+
config.assets.check_precompiled_asset = false
|
36
39
|
|
37
40
|
config.action_mailer.perform_caching = false
|
38
41
|
|
39
42
|
# Print deprecation notices to the Rails logger.
|
40
43
|
config.active_support.deprecation = :log
|
41
44
|
|
42
|
-
# Raise
|
43
|
-
config.
|
45
|
+
# Raise exceptions for disallowed deprecations.
|
46
|
+
config.active_support.disallowed_deprecation = :raise
|
44
47
|
|
45
|
-
#
|
46
|
-
config.
|
47
|
-
|
48
|
-
# Debug mode disables concatenation and preprocessing of assets.
|
49
|
-
# This option may cause significant delays in view rendering with a large
|
50
|
-
# number of complex assets.
|
51
|
-
config.assets.debug = true
|
48
|
+
# Tell Active Support which deprecation messages to disallow.
|
49
|
+
config.active_support.disallowed_deprecation_warnings = []
|
52
50
|
|
53
51
|
# Suppress logger output for asset requests.
|
54
52
|
config.assets.quiet = true
|
55
53
|
|
56
54
|
# Raises error for missing translations.
|
57
|
-
# config.
|
55
|
+
# config.i18n.raise_on_missing_translations = true
|
56
|
+
|
57
|
+
# Annotate rendered view with file names.
|
58
|
+
# config.action_view.annotate_rendered_view_with_filenames = true
|
58
59
|
|
59
|
-
#
|
60
|
-
#
|
61
|
-
# config.file_watcher = ActiveSupport::EventedFileUpdateChecker
|
60
|
+
# Uncomment if you wish to allow Action Cable access from any origin.
|
61
|
+
# config.action_cable.disable_request_forgery_protection = true
|
62
62
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require "active_support/core_ext/integer/time"
|
2
|
+
|
1
3
|
Rails.application.configure do
|
2
4
|
# Settings specified here will take precedence over those in config/application.rb.
|
3
5
|
|
@@ -20,35 +22,33 @@ Rails.application.configure do
|
|
20
22
|
|
21
23
|
# Disable serving static files from the `/public` folder by default since
|
22
24
|
# Apache or NGINX already handles this.
|
23
|
-
config.public_file_server.enabled = ENV[
|
25
|
+
config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present?
|
24
26
|
|
25
27
|
# Compress CSS using a preprocessor.
|
26
28
|
# config.assets.css_compressor = :sass
|
27
29
|
|
28
30
|
# Do not fallback to assets pipeline if a precompiled asset is missed.
|
29
31
|
config.assets.compile = false
|
32
|
+
config.assets.compile = true
|
30
33
|
|
31
34
|
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
32
|
-
# config.
|
35
|
+
# config.asset_host = "http://assets.example.com"
|
33
36
|
|
34
37
|
# Specifies the header that your server uses for sending files.
|
35
|
-
# config.action_dispatch.x_sendfile_header =
|
36
|
-
# config.action_dispatch.x_sendfile_header =
|
37
|
-
|
38
|
-
# Store uploaded files on the local file system (see config/storage.yml for options).
|
39
|
-
config.active_storage.service = :local
|
38
|
+
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache
|
39
|
+
# config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX
|
40
40
|
|
41
41
|
# Mount Action Cable outside main process or domain.
|
42
42
|
# config.action_cable.mount_path = nil
|
43
|
-
# config.action_cable.url =
|
44
|
-
# config.action_cable.allowed_request_origins = [
|
43
|
+
# config.action_cable.url = "wss://example.com/cable"
|
44
|
+
# config.action_cable.allowed_request_origins = [ "http://example.com", /http:\/\/example.*/ ]
|
45
45
|
|
46
46
|
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
47
47
|
# config.force_ssl = true
|
48
48
|
|
49
|
-
#
|
50
|
-
#
|
51
|
-
config.log_level = :
|
49
|
+
# Include generic and useful information about system operation, but avoid logging too much
|
50
|
+
# information to avoid inadvertent exposure of personally identifiable information (PII).
|
51
|
+
config.log_level = :info
|
52
52
|
|
53
53
|
# Prepend all log lines with the following tags.
|
54
54
|
config.log_tags = [ :request_id ]
|
@@ -70,43 +70,19 @@ Rails.application.configure do
|
|
70
70
|
# the I18n.default_locale when a translation cannot be found).
|
71
71
|
config.i18n.fallbacks = true
|
72
72
|
|
73
|
-
#
|
74
|
-
config.active_support.
|
73
|
+
# Don't log any deprecations.
|
74
|
+
config.active_support.report_deprecations = false
|
75
75
|
|
76
76
|
# Use default logging formatter so that PID and timestamp are not suppressed.
|
77
77
|
config.log_formatter = ::Logger::Formatter.new
|
78
78
|
|
79
79
|
# Use a different logger for distributed setups.
|
80
|
-
# require
|
81
|
-
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new
|
80
|
+
# require "syslog/logger"
|
81
|
+
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new "app-name")
|
82
82
|
|
83
83
|
if ENV["RAILS_LOG_TO_STDOUT"].present?
|
84
84
|
logger = ActiveSupport::Logger.new(STDOUT)
|
85
85
|
logger.formatter = config.log_formatter
|
86
86
|
config.logger = ActiveSupport::TaggedLogging.new(logger)
|
87
87
|
end
|
88
|
-
|
89
|
-
# Do not dump schema after migrations.
|
90
|
-
config.active_record.dump_schema_after_migration = false
|
91
|
-
|
92
|
-
# Inserts middleware to perform automatic connection switching.
|
93
|
-
# The `database_selector` hash is used to pass options to the DatabaseSelector
|
94
|
-
# middleware. The `delay` is used to determine how long to wait after a write
|
95
|
-
# to send a subsequent read to the primary.
|
96
|
-
#
|
97
|
-
# The `database_resolver` class is used by the middleware to determine which
|
98
|
-
# database is appropriate to use based on the time delay.
|
99
|
-
#
|
100
|
-
# The `database_resolver_context` class is used by the middleware to set
|
101
|
-
# timestamps for the last write to the primary. The resolver uses the context
|
102
|
-
# class timestamps to determine how long to wait before reading from the
|
103
|
-
# replica.
|
104
|
-
#
|
105
|
-
# By default Rails will store a last write timestamp in the session. The
|
106
|
-
# DatabaseSelector middleware is designed as such you can define your own
|
107
|
-
# strategy for connection switching and pass that into the middleware through
|
108
|
-
# these configuration options.
|
109
|
-
# config.active_record.database_selector = { delay: 2.seconds }
|
110
|
-
# config.active_record.database_resolver = ActiveRecord::Middleware::DatabaseSelector::Resolver
|
111
|
-
# config.active_record.database_resolver_context = ActiveRecord::Middleware::DatabaseSelector::Resolver::Session
|
112
88
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require "active_support/core_ext/integer/time"
|
2
|
+
|
1
3
|
# The test environment is used exclusively to run your application's
|
2
4
|
# test suite. You never need to work with it otherwise. Remember that
|
3
5
|
# your test database is "scratch space" for the test suite and is wiped
|
@@ -6,18 +8,18 @@
|
|
6
8
|
Rails.application.configure do
|
7
9
|
# Settings specified here will take precedence over those in config/application.rb.
|
8
10
|
|
9
|
-
config.
|
10
|
-
config.
|
11
|
+
# Turn false under Spring and add config.action_view.cache_template_loading = true.
|
12
|
+
config.cache_classes = true
|
11
13
|
|
12
|
-
#
|
13
|
-
#
|
14
|
-
#
|
15
|
-
config.eager_load =
|
14
|
+
# Eager loading loads your whole application. When running a single test locally,
|
15
|
+
# this probably isn't necessary. It's a good idea to do in a continuous integration
|
16
|
+
# system, or in some way before deploying your code.
|
17
|
+
config.eager_load = ENV["CI"].present?
|
16
18
|
|
17
19
|
# Configure public file server for tests with Cache-Control for performance.
|
18
20
|
config.public_file_server.enabled = true
|
19
21
|
config.public_file_server.headers = {
|
20
|
-
|
22
|
+
"Cache-Control" => "public, max-age=#{1.hour.to_i}"
|
21
23
|
}
|
22
24
|
|
23
25
|
# Show full error reports and disable caching.
|
@@ -31,9 +33,6 @@ Rails.application.configure do
|
|
31
33
|
# Disable request forgery protection in test environment.
|
32
34
|
config.action_controller.allow_forgery_protection = false
|
33
35
|
|
34
|
-
# Store uploaded files on the local file system in a temporary directory.
|
35
|
-
config.active_storage.service = :test
|
36
|
-
|
37
36
|
config.action_mailer.perform_caching = false
|
38
37
|
|
39
38
|
# Tell Action Mailer not to deliver emails to the real world.
|
@@ -44,6 +43,15 @@ Rails.application.configure do
|
|
44
43
|
# Print deprecation notices to the stderr.
|
45
44
|
config.active_support.deprecation = :stderr
|
46
45
|
|
46
|
+
# Raise exceptions for disallowed deprecations.
|
47
|
+
config.active_support.disallowed_deprecation = :raise
|
48
|
+
|
49
|
+
# Tell Active Support which deprecation messages to disallow.
|
50
|
+
config.active_support.disallowed_deprecation_warnings = []
|
51
|
+
|
47
52
|
# Raises error for missing translations.
|
48
|
-
# config.
|
53
|
+
# config.i18n.raise_on_missing_translations = true
|
54
|
+
|
55
|
+
# Annotate rendered view with file names.
|
56
|
+
# config.action_view.annotate_rendered_view_with_filenames = true
|
49
57
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# Be sure to restart your server when you modify this file.
|
2
2
|
|
3
3
|
# Version of your assets, change this if you want to expire all your assets.
|
4
|
-
Rails.application.config.assets.version =
|
4
|
+
Rails.application.config.assets.version = "1.0"
|
5
5
|
|
6
6
|
# Add additional assets to the asset load path.
|
7
7
|
# Rails.application.config.assets.paths << Emoji.images_path
|