trika_changelog 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 8e794694616954c9bb8162213e129e331c8ae6a4b5a9f00b61b6921866f3ef98
4
+ data.tar.gz: c4eed3a8ca16b7bc912710a03f4f1707d8a632e88465ee9be436dc90fa00905d
5
+ SHA512:
6
+ metadata.gz: 80e74c5a6c2a038799e6dc820bb5d63bddf468e194bf96f57ca051d3c39a8c69c4eae431dbd7759af3b0dccfffca99234840bd4a1f0a6a3074cf6a4eb7250b5b
7
+ data.tar.gz: a99058767b8dd4b5d4b3827391ca8305e71880fd38f3bb873f497af75229b8b50b7775bf92ef450dfdf4a854a88c8fe0377663c6b953360958a02af05073af2e
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2021 GunaTrika
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/README.md ADDED
@@ -0,0 +1,26 @@
1
+ # TrikaChangelog
2
+ Gem to show changelog.md file content in admin page. This will expose application release to all stockholders
3
+
4
+ ## Usage
5
+ Include this gem and add CHANGELOG.md file in project root folder
6
+
7
+ ## Installation
8
+ Add this line to your application's Gemfile:
9
+
10
+ ```ruby
11
+ gem 'trika_changelog'
12
+ ```
13
+
14
+ And then execute:
15
+ ```bash
16
+ $ bundle
17
+ ```
18
+
19
+ Or install it yourself as:
20
+ ```bash
21
+ $ gem install trika_changelog
22
+ ```
23
+
24
+
25
+ ## License
26
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,29 @@
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 = 'TrikaChangelog'
12
+ rdoc.options << '--line-numbers'
13
+ rdoc.rdoc_files.include('README.md')
14
+ rdoc.rdoc_files.include('lib/**/*.rb')
15
+ end
16
+
17
+ load 'rails/tasks/statistics.rake'
18
+
19
+ require 'bundler/gem_tasks'
20
+
21
+ require 'rake/testtask'
22
+
23
+ Rake::TestTask.new(:test) do |t|
24
+ t.libs << 'test'
25
+ t.pattern = 'test/**/*_test.rb'
26
+ t.verbose = false
27
+ end
28
+
29
+ task default: :test
File without changes
@@ -0,0 +1,32 @@
1
+ module Workarea
2
+ module Admin
3
+ class ChangelogsController < ApplicationController
4
+ before_action :get_changelog
5
+ def show
6
+ @changelog ||= @changelog_content
7
+ end
8
+
9
+ def get_changelog
10
+ text = File.read("#{Rails.root}/CHANGELOG.md") rescue nil
11
+ @changelog_content = "No changelog found, please contact the developement team" if text.blank?
12
+ options = {
13
+ filter_html: true,
14
+ hard_wrap: true,
15
+ link_attributes: { rel: 'nofollow', target: "_blank" },
16
+ space_after_headers: true,
17
+ fenced_code_blocks: true
18
+ }
19
+
20
+ extensions = {
21
+ autolink: true,
22
+ superscript: true,
23
+ disable_indented_code_blocks: true
24
+ }
25
+
26
+ renderer = Redcarpet::Render::HTML.new(options)
27
+ @markdown ||= Redcarpet::Markdown.new(renderer, extensions)
28
+ @changelog_content ||= @markdown.render(text).html_safe
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,2 @@
1
+ .header__action-link
2
+ = link_to 'Changelog', changelog_path, tabindex: 0
@@ -0,0 +1,3 @@
1
+ .view__container
2
+ %br
3
+ = @changelog
@@ -0,0 +1,4 @@
1
+ Workarea.append_partials(
2
+ 'admin.page_header',
3
+ 'workarea/admin/changelogs/nav-link'
4
+ )
data/config/routes.rb ADDED
@@ -0,0 +1,8 @@
1
+ Rails.application.routes.draw do
2
+
3
+ Workarea::Admin::Engine.routes.draw do
4
+ scope '(:locale)', constraints: Workarea::I18n.routes_constraint do
5
+ resource :changelog, only: [:show]
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :trika_changelog do
3
+ # # Task goes here
4
+ # end
@@ -0,0 +1,5 @@
1
+ require "trika_changelog/engine"
2
+
3
+ module TrikaChangelog
4
+ # Your code goes here...
5
+ end
@@ -0,0 +1,4 @@
1
+ module TrikaChangelog
2
+ class Engine < ::Rails::Engine
3
+ end
4
+ end
@@ -0,0 +1,3 @@
1
+ module TrikaChangelog
2
+ VERSION = '0.1.0'
3
+ end
metadata ADDED
@@ -0,0 +1,76 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: trika_changelog
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - GunaTrika
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2021-05-21 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 5.2.4
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 5.2.4.6
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: 5.2.4
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 5.2.4.6
33
+ description: Changelogs can be seen in admin
34
+ email:
35
+ - guna.r@trikatechnologies.com
36
+ executables: []
37
+ extensions: []
38
+ extra_rdoc_files: []
39
+ files:
40
+ - MIT-LICENSE
41
+ - README.md
42
+ - Rakefile
43
+ - app/assets/config/trika_changelog_manifest.js
44
+ - app/controllers/workarea/admin/changelogs_controller.rb
45
+ - app/views/workarea/admin/changelogs/_nav-link.html.haml
46
+ - app/views/workarea/admin/changelogs/show.html.haml
47
+ - config/initializers/appends.rb
48
+ - config/routes.rb
49
+ - lib/tasks/trika_changelog_tasks.rake
50
+ - lib/trika_changelog.rb
51
+ - lib/trika_changelog/engine.rb
52
+ - lib/trika_changelog/version.rb
53
+ homepage: https://github.com/trikatechnologies-workarea
54
+ licenses:
55
+ - MIT
56
+ metadata: {}
57
+ post_install_message:
58
+ rdoc_options: []
59
+ require_paths:
60
+ - lib
61
+ required_ruby_version: !ruby/object:Gem::Requirement
62
+ requirements:
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
66
+ required_rubygems_version: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: '0'
71
+ requirements: []
72
+ rubygems_version: 3.2.17
73
+ signing_key:
74
+ specification_version: 4
75
+ summary: Show change log in workarea admin tool bar
76
+ test_files: []