tramway-page 1.3 → 1.3.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d2b93651091515ca7189e47beca79ad1298a72dead84e437eb69c1d2c989e443
4
- data.tar.gz: df5bd4d45a263db057dec974fd1b6036df09e5f3e5b7710c91a7e23436243feb
3
+ metadata.gz: fb1ed06a4cf485671e9082163dcd40170f4355d4a341d2a5398f590c45e42e5f
4
+ data.tar.gz: 40635e0a287cdad418de79eb0bbf8b2c248e8c1c88ab58bda053f2e511c591e1
5
5
  SHA512:
6
- metadata.gz: b9cf310446fd69927204ba5bdf1fa0145c88a53abfeedac740f765553794b57d4e8edcb7e13ce759c7aba7002be8c3d3782f732e5cd0d9328af7f994537c030b
7
- data.tar.gz: bde4179419cec974680341dff947871106abd6ef051d72328d11910a7a7d9aeb5774101a1d36af282cf56dce861ad80158b5fec35e26a13d8b810c9c70f333a3
6
+ metadata.gz: 9fe0be21f9c8d6c5e2a3e82027bb01852f913c5a73d2e1b1deda29ad0990a94b75b600be985b7071f61fe3080cb1f2a4887382a39b5a792d948f34a182eed090
7
+ data.tar.gz: 4010e1e8eb7decd715f583f7e85a5a6f418ea1c5ef6d455a12a5d2d03b1aabc0d9390bdd05459da729bd1bd5ccc96c9431b85cbb7ce994cfdabfeed6e7a3263d
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  begin
2
4
  require 'bundler/setup'
3
5
  rescue LoadError
@@ -14,14 +16,11 @@ RDoc::Task.new(:rdoc) do |rdoc|
14
16
  rdoc.rdoc_files.include('lib/**/*.rb')
15
17
  end
16
18
 
17
- APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
19
+ APP_RAKEFILE = File.expand_path('test/dummy/Rakefile', __dir__)
18
20
  load 'rails/tasks/engine.rake'
19
21
 
20
-
21
22
  load 'rails/tasks/statistics.rake'
22
23
 
23
-
24
-
25
24
  require 'bundler/gem_tasks'
26
25
 
27
26
  require 'rake/testtask'
@@ -32,5 +31,4 @@ Rake::TestTask.new(:test) do |t|
32
31
  t.verbose = false
33
32
  end
34
33
 
35
-
36
34
  task default: :test
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Tramway
2
4
  module Page
3
5
  class ApplicationController < ActionController::Base
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class ::Tramway::Page::PagesController < ::Tramway::Page::ApplicationController
2
4
  layout 'tramway/landing/application'
3
5
 
@@ -1,7 +1,9 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class Tramway::Page::PageDecorator < ::Tramway::Core::ApplicationDecorator
2
4
  class << self
3
5
  def collections
4
- [ :all ]
6
+ [:all]
5
7
  end
6
8
  end
7
9
 
@@ -1,12 +1,14 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class Tramway::Page::PageForm < ::Tramway::Core::ApplicationForm
2
4
  properties :title, :body, :slug, :view
3
5
 
4
6
  def initialize(object)
5
7
  super(object).tap do
6
8
  form_properties title: :string,
7
- body: :ckeditor,
8
- slug: :string,
9
- view: :string
9
+ body: :ckeditor,
10
+ slug: :string,
11
+ view: :string
10
12
  end
11
13
  end
12
14
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Tramway
2
4
  module Page
3
5
  module ApplicationHelper
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Tramway
2
4
  module Page
3
5
  class ApplicationJob < ActiveJob::Base
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Tramway
2
4
  module Page
3
5
  class ApplicationMailer < ActionMailer::Base
@@ -1,2 +1,4 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class Tramway::Page::Page < ::Tramway::Core::ApplicationRecord
2
4
  end
@@ -0,0 +1,5 @@
1
+ - content_for :title do
2
+ = @page.title
3
+
4
+ .container{ style: 'margin-top: 30px' }
5
+ != @page.body
@@ -1 +1,3 @@
1
+ # frozen_string_literal: true
2
+
1
3
  ::Tramway::Admin.set_available_models(::Tramway::Page::Page, project: :page)
data/config/routes.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  Tramway::Page::Engine.routes.draw do
2
4
  get '/:slug' => 'pages#show', as: :page
3
5
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # desc "Explaining what the task does"
2
4
  # task :tramway_page do
3
5
  # # Task goes here
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Tramway
2
4
  module Page
3
5
  class Engine < ::Rails::Engine
@@ -1,13 +1,14 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rails/generators'
2
4
  require 'tramway/core/generators/install_generator'
3
5
 
4
6
  module Tramway::Page::Generators
5
7
  class InstallGenerator < ::Tramway::Core::Generators::InstallGenerator
6
8
  include Rails::Generators::Migration
7
- source_root File.expand_path('../templates', __FILE__)
9
+ source_root File.expand_path('templates', __dir__)
8
10
 
9
- def run_other_generators
10
- end
11
+ def run_other_generators; end
11
12
 
12
13
  def self.next_migration_number(path)
13
14
  next_migration_number = current_migration_number(path) + 1
@@ -15,9 +16,9 @@ module Tramway::Page::Generators
15
16
  end
16
17
 
17
18
  def copy_migrations
18
- migrations = [
19
- :create_tramway_page_pages,
20
- :add_view_to_tramway_page_pages
19
+ migrations = %i[
20
+ create_tramway_page_pages
21
+ add_view_to_tramway_page_pages
21
22
  ]
22
23
  migrations.each do |migration|
23
24
  migration_template "#{migration}.rb", "db/migrate/#{migration}.rb"
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class AddViewToTramwayPagePages < ActiveRecord::Migration[5.1]
2
4
  def change
3
5
  add_column :tramway_page_pages, :view, :text
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class CreateTramwayPagePages < ActiveRecord::Migration[5.1]
2
4
  def change
3
5
  create_table :tramway_page_pages do |t|
@@ -1,5 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Tramway
2
4
  module Page
3
- VERSION = '1.3'
5
+ VERSION = '1.3.1'
4
6
  end
5
7
  end
data/lib/tramway/page.rb CHANGED
@@ -1,4 +1,6 @@
1
- require "tramway/page/engine"
1
+ # frozen_string_literal: true
2
+
3
+ require 'tramway/page/engine'
2
4
  require 'tramway/page/generators/install_generator'
3
5
 
4
6
  module Tramway
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tramway-page
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.3'
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Kalashnikov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-09 00:00:00.000000000 Z
11
+ date: 2019-10-13 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Description of Tramway::Page.
14
14
  email:
@@ -32,6 +32,7 @@ files:
32
32
  - app/mailers/tramway/page/application_mailer.rb
33
33
  - app/models/tramway/page/page.rb
34
34
  - app/views/tramway/page/pages/show.html.haml
35
+ - app/views/tramway/page/pages/views/_article.html.haml
35
36
  - config/initializers/tramway.rb
36
37
  - config/locales/models.yml
37
38
  - config/routes.rb