tramway-news 1.0.3 → 1.0.5

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: 920e4d7b09f2f148225a94ac5c385e4b875c493c44455e33cfbbb5f7a0166615
4
- data.tar.gz: 8ded5e540d72fe99b2eef839ebe2774d7280cb247fcd62a39dfca9cfd6753743
3
+ metadata.gz: 2fe1021e16dab5cde280b0862ab88aef39d0a5d497014373a6f423adca82f474
4
+ data.tar.gz: 9738e6788044ae66cae8621e1575a1b75095c47ec33a2bef8baf90876b9f60fd
5
5
  SHA512:
6
- metadata.gz: 3e9b2aa51369d1db5ee51bbf62b8cfade25ce555707b0a1e0012aba585a70a0e8a5cf1b5415dcdbc206441885d8b27806bb014e59c8c11c25489738c4a4c5867
7
- data.tar.gz: 1eeb473e82242e8c71dcc06d229031ed926eec82d60871c52d1f21cc5a6de09f826adfe18e725dd970487304d010136d21429dd1a598ebcb74096299a62132f2
6
+ metadata.gz: 8cdb0b5436830510bae3c192b77007e7c2f23abaa302bef332eb8c292713a0aa9846bfc25e92689a39ac2552b84db4a8c183cbc5c65305fd16d3939505ed8ea5
7
+ data.tar.gz: 2897a330c8801ec972b090f2647fc85522408c6421d5dde05d645bf09115e81ed80d7754344512f071bf32173ba0f22841f57ec5c7ccc9ca100a4cd7356deb21
data/README.md CHANGED
@@ -21,6 +21,13 @@ Or install it yourself as:
21
21
  $ gem install tramway-news
22
22
  ```
23
23
 
24
+ ### Versions table
25
+
26
+ | tramway-news | tramway-landing |
27
+ | ------------- | --------------- |
28
+ | < 1.0.4.2 | 1.x |
29
+ | >= 1.0.4.2 | 2.x |
30
+
24
31
  ## Contributing
25
32
  Contribution directions go here.
26
33
 
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 News
3
5
  class ApplicationController < ActionController::Base
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class ::Tramway::News::NewsController < ::Tramway::News::ApplicationController
2
4
  layout 'tramway/landing/application'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class Tramway::Landing::Cards::NewsDecorator < ::Tramway::Landing::BlockTypes::CardsDecorator
2
4
  def image
3
5
  object.photo.card.url
@@ -1,10 +1,14 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class Tramway::News::NewsDecorator < ::Tramway::Core::ApplicationDecorator
2
4
  class << self
3
5
  def collections
4
- [ :all ]
6
+ [:all]
5
7
  end
6
8
  end
7
9
 
10
+ delegate_attributes :title
11
+
8
12
  def lead
9
13
  object.body.first 200
10
14
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class ::Tramway::News::UserDecorator < ::Tramway::Core::ApplicationDecorator
2
4
  def short_name
3
5
  "#{object.first_name} #{object.last_name}"
@@ -1,4 +1,6 @@
1
- class Tramway::News::NewsForm < ::Tramway::Core::ApplicationForm
1
+ # frozen_string_literal: true
2
+
3
+ class Admin::Tramway::News::NewsForm < ::Tramway::Core::ApplicationForm
2
4
  properties :title, :body, :published_at, :photo
3
5
 
4
6
  def initialize(object)
@@ -1,7 +1,9 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Tramway
2
4
  module News
3
5
  module ApplicationHelper
4
- include ::FontAwesome::Rails::IconHelper
6
+ include ::FontAwesome5::Rails::IconHelper
5
7
 
6
8
  def title(text)
7
9
  content_for :title do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Tramway
2
4
  module News
3
5
  class ApplicationJob < ActiveJob::Base
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Tramway
2
4
  module News
3
5
  class ApplicationMailer < ActionMailer::Base
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Tramway
2
4
  module News
3
5
  class ApplicationRecord < ActiveRecord::Base
@@ -1,5 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class ::Tramway::News::News < ::Tramway::Core::ApplicationRecord
2
- mount_uploader :photo, PhotoUploader
4
+ uploader :photo, :photo, extensions: [ :jpg, :jpeg, :png ]
3
5
 
4
6
  def author
5
7
  audits.where(action: :create).first.user
@@ -1,7 +1,4 @@
1
1
  - title @news.title
2
- = content_for :head_content do
3
- = stylesheet_link_tag 'tramway/news/application'
4
-
5
2
  .container
6
3
  .row
7
4
  .col-md-12
@@ -1 +1,6 @@
1
+ # frozen_string_literal: true
2
+
1
3
  ::Tramway::Admin.set_available_models(::Tramway::News::News, project: :news)
4
+ ::Tramway::Landing.head_content = lambda do
5
+ stylesheet_link_tag 'tramway/news/application'
6
+ end
data/config/routes.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  Tramway::News::Engine.routes.draw do
2
4
  resources :news, only: :show
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_news do
3
5
  # # Task goes here
data/lib/tramway/news.rb CHANGED
@@ -1,4 +1,6 @@
1
- require "tramway/news/engine"
1
+ # frozen_string_literal: true
2
+
3
+ require 'tramway/news/engine'
2
4
  require 'tramway/news/generators/install_generator'
3
5
 
4
6
  module Tramway
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Tramway
2
4
  module News
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::News::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
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class CreateTramwayNewsNews < ActiveRecord::Migration[5.1]
2
4
  def change
3
5
  create_table :tramway_news_news do |t|
@@ -1,5 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Tramway
2
4
  module News
3
- VERSION = '1.0.3'
5
+ VERSION = '1.0.5'
4
6
  end
5
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tramway-news
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Kalashnikov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-21 00:00:00.000000000 Z
11
+ date: 2021-05-29 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Rails engine for news
14
14
  email:
@@ -28,7 +28,7 @@ files:
28
28
  - app/decorators/tramway/landing/cards/news_decorator.rb
29
29
  - app/decorators/tramway/news/news_decorator.rb
30
30
  - app/decorators/tramway/news/user_decorator.rb
31
- - app/forms/tramway/news/news_form.rb
31
+ - app/forms/admin/tramway/news/news_form.rb
32
32
  - app/helpers/tramway/news/application_helper.rb
33
33
  - app/jobs/tramway/news/application_job.rb
34
34
  - app/mailers/tramway/news/application_mailer.rb
@@ -45,7 +45,7 @@ files:
45
45
  - lib/tramway/news/generators/install_generator.rb
46
46
  - lib/tramway/news/generators/templates/create_tramway_news_news.rb
47
47
  - lib/tramway/news/version.rb
48
- homepage: https://github.com/ulmic/tramway-news
48
+ homepage: https://github.com/ulmic/tramway-dev
49
49
  licenses:
50
50
  - MIT
51
51
  metadata: {}
@@ -64,8 +64,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
64
64
  - !ruby/object:Gem::Version
65
65
  version: '0'
66
66
  requirements: []
67
- rubyforge_project:
68
- rubygems_version: 2.7.6
67
+ rubygems_version: 3.2.3
69
68
  signing_key:
70
69
  specification_version: 4
71
70
  summary: Rails engine for news