phccodesnipper 6.0.0 → 6.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +36 -28
- data/Rakefile +7 -5
- data/app/controllers/phccodesnipper/application_controller.rb +15 -17
- data/app/controllers/phccodesnipper/script/snippets_controller.rb +50 -50
- data/app/controllers/phccodesnipper/script/urls_controller.rb +55 -60
- data/app/helpers/phccodesnipper/application_helper.rb +2 -0
- data/app/helpers/phccodesnipper/script/snippets_helper.rb +5 -1
- data/app/helpers/phccodesnipper/script/urls_helper.rb +5 -1
- data/app/jobs/phccodesnipper/application_job.rb +2 -0
- data/app/mailers/phccodesnipper/application_mailer.rb +2 -0
- data/app/models/phccodesnipper/application_record.rb +2 -0
- data/app/models/phccodesnipper/script/snippet.rb +20 -18
- data/app/models/phccodesnipper/script/url.rb +13 -11
- data/app/models/phccodesnipper/script.rb +2 -0
- data/app/views/layouts/phccodesnipper/components/frontend/header/_main_nav.html.erb +30 -0
- data/app/views/phccodesnipper/script/snippets/show.html.erb +4 -1
- data/app/views/phccodesnipper/script/urls/index.html.erb +2 -3
- data/app/views/phccodesnipper/script/urls/show.html.erb +1 -4
- data/config/routes.rb +7 -7
- data/db/migrate/20190502060733_create_phccodesnipper_script_urls.rb +2 -4
- data/db/migrate/20190508091330_create_phccodesnipper_script_snippets.rb +2 -4
- data/db/migrate/20190513040626_create_friendly_id_slugs.rb +9 -6
- data/lib/phccodesnipper/engine.rb +41 -42
- data/lib/phccodesnipper/version.rb +3 -1
- data/lib/phccodesnipper.rb +4 -2
- data/lib/tasks/phccodesnipper_tasks.rake +1 -0
- metadata +55 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cc816b874135a2a239379676042e2f2802487a8f143c39ffe5eb833b747d233a
|
4
|
+
data.tar.gz: e337d530adf6b824af0d19073ae0d47c7a696b7c2c08bb8e91d54d0aa98065b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2a94521717a68985d34e21d56241728775b3ca4f0a8aaf86ded93a589b155f9726a11795bdf261317e548f1011ec324af6f1b54a82e61e823aa1bdd55b61dc5
|
7
|
+
data.tar.gz: c6f2b41bd14936687de8c119a16017f8f07f41ee5a3f46ce9285306bd7275d03004a77237282ce43f6e15338165adba1efa12c02ede6b93d5bf46a8ad3c1df5a
|
data/README.md
CHANGED
@@ -1,28 +1,36 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
1
|
+
#### PHCCodeSnipper Documentation
|
2
|
+
Ruby on Rails 7 engine to manage member information and business directory listings.
|
3
|
+
|
4
|
+
- Fast setup of membership management and web directory modules.
|
5
|
+
- Directory and listings manager with a web directory API.
|
6
|
+
- Member's list, contact information, and listings manager.
|
7
|
+
- Easy app integration with views that can be customized.
|
8
|
+
- [Pro version](https://bradpotts.github.io/phccodesnipperpro/) has multi-tenancy capabilities.
|
9
|
+
|
10
|
+
#### Step 1 - Add PHCCodeSnipper to your gemfile and run the install command
|
11
|
+
|
12
|
+
gem 'phccodesnipper'
|
13
|
+
bundle install
|
14
|
+
|
15
|
+
#### Step 2 - Add [PHCDevworks Accounts Devise](https://github.com/phcdevworks/phcdevworks_accounts_devise) to your gemfile
|
16
|
+
This plugin is optimized for PHCDevworks Accounts which uses Devise.
|
17
|
+
|
18
|
+
gem 'phcdevworks_accounts_devise'
|
19
|
+
bundle install
|
20
|
+
|
21
|
+
#### Step 3 - Mount PHCCodeSnipper & Add Routes
|
22
|
+
Mount PHCCodeSnipper by adding code below to your routes file.
|
23
|
+
|
24
|
+
mount PhcdevworksAccountsDevise::Engine, :at => '/'
|
25
|
+
mount Phccodesnipper::Engine, :at => '/'
|
26
|
+
|
27
|
+
#### Step 4 - Copy All Required Database Tables
|
28
|
+
To copy PHCCodeSnipper and PHCDevworks Accounts Devise database migrations.
|
29
|
+
|
30
|
+
rails railties:install:migrations
|
31
|
+
|
32
|
+
#### Step 5 - Recompile Assets
|
33
|
+
To ensure proper function re-compile your application's assets.
|
34
|
+
|
35
|
+
rails assets:clobber && rails assets:precompile
|
36
|
+
|
data/Rakefile
CHANGED
@@ -1,8 +1,10 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
load "rails/tasks/engine.rake"
|
3
|
+
require 'bundler/setup'
|
5
4
|
|
6
|
-
|
5
|
+
APP_RAKEFILE = File.expand_path('spec/test_app/Rakefile', __dir__)
|
6
|
+
load 'rails/tasks/engine.rake'
|
7
7
|
|
8
|
-
|
8
|
+
load 'rails/tasks/statistics.rake'
|
9
|
+
|
10
|
+
require 'bundler/gem_tasks'
|
@@ -1,21 +1,19 @@
|
|
1
|
-
|
2
|
-
class ApplicationController < ActionController::Base
|
3
|
-
|
4
|
-
# Security Filters
|
5
|
-
protect_from_forgery with: :exception
|
1
|
+
# frozen_string_literal: true
|
6
2
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
helper PhcdevworksCore::Engine.helpers
|
12
|
-
|
13
|
-
# Papertrail Whodunnit Username
|
14
|
-
def user_for_paper_trail
|
15
|
-
current_user ? current_user.username : 'Public user'
|
16
|
-
end
|
3
|
+
module Phccodesnipper
|
4
|
+
class ApplicationController < ActionController::Base
|
5
|
+
# Security Filters
|
6
|
+
protect_from_forgery with: :exception
|
17
7
|
|
18
|
-
|
8
|
+
# Load Requried Helper Files
|
9
|
+
helper PhcdevworksActiveMenus::Engine.helpers
|
10
|
+
helper PhcdevworksNotifications::Engine.helpers
|
11
|
+
helper PhcdevworksTitleseo::Engine.helpers
|
12
|
+
helper PhcdevworksCore::Engine.helpers
|
19
13
|
|
20
|
-
|
14
|
+
# Papertrail Whodunnit Username
|
15
|
+
def user_for_paper_trail
|
16
|
+
current_user ? current_user.username : 'Public user'
|
17
|
+
end
|
18
|
+
end
|
21
19
|
end
|
@@ -1,67 +1,67 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
class Script::SnippetsController < ApplicationController
|
3
|
+
require_dependency 'phccodesnipper/application_controller'
|
5
4
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
5
|
+
module Phccodesnipper
|
6
|
+
module Script
|
7
|
+
class SnippetsController < ApplicationController
|
8
|
+
# Include Core Helpers, Security & Action Filters
|
9
|
+
include PhcdevworksCore::PhcdevPluginsHelper
|
10
|
+
before_action :authenticate_user!
|
11
|
+
before_action :set_script_snippet, only: %i[show edit update destroy]
|
10
12
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
13
|
+
# INDEX
|
14
|
+
def index
|
15
|
+
@script_snippets = Script::Snippet.all
|
16
|
+
end
|
15
17
|
|
16
|
-
|
17
|
-
|
18
|
-
end
|
18
|
+
# SHOW
|
19
|
+
def show; end
|
19
20
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
21
|
+
# NEW
|
22
|
+
def new
|
23
|
+
@script_snippet = Script::Snippet.new
|
24
|
+
end
|
24
25
|
|
25
|
-
|
26
|
-
|
27
|
-
end
|
26
|
+
# EDIT
|
27
|
+
def edit; end
|
28
28
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
29
|
+
# CREATE
|
30
|
+
def create
|
31
|
+
@script_snippet = Script::Snippet.new(script_snippet_params)
|
32
|
+
if @script_snippet.save
|
33
|
+
redirect_to @script_snippet, flash: { success: 'Code snippet was successfully created.' }
|
34
|
+
else
|
35
|
+
render :new
|
36
|
+
end
|
36
37
|
end
|
37
|
-
end
|
38
38
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
39
|
+
# UPDATE
|
40
|
+
def update
|
41
|
+
if @script_snippet.update(script_snippet_params)
|
42
|
+
redirect_to @script_snippet, flash: { success: 'Code snippet was successfully updated.' }
|
43
|
+
else
|
44
|
+
render :edit
|
45
|
+
end
|
45
46
|
end
|
46
|
-
end
|
47
47
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
48
|
+
# DELETE
|
49
|
+
def destroy
|
50
|
+
@script_snippet.destroy
|
51
|
+
redirect_to script_snippets_url, flash: { error: 'Code snippet was successfully destroyed.' }
|
52
|
+
end
|
53
53
|
|
54
|
-
|
54
|
+
private
|
55
55
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
56
|
+
# Common Callbacks
|
57
|
+
def set_script_snippet
|
58
|
+
@script_snippet = Script::Snippet.find(params[:id])
|
59
|
+
end
|
60
60
|
|
61
|
-
|
62
|
-
|
63
|
-
|
61
|
+
# Whitelist
|
62
|
+
def script_snippet_params
|
63
|
+
params.require(:script_snippet).permit(:snippet_title, :snippet_code)
|
64
|
+
end
|
64
65
|
end
|
65
|
-
|
66
66
|
end
|
67
67
|
end
|
@@ -1,76 +1,71 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
class Script::UrlsController < ApplicationController
|
5
|
-
|
6
|
-
# Include Core Helpers, Security & Action Filters
|
7
|
-
include PhcdevworksCore::PhcdevPluginsHelper
|
8
|
-
before_action :authenticate_user!
|
9
|
-
before_action :set_script_url, only: [:show, :edit, :update, :destroy]
|
3
|
+
require_dependency 'phccodesnipper/application_controller'
|
10
4
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
5
|
+
module Phccodesnipper
|
6
|
+
module Script
|
7
|
+
class UrlsController < ApplicationController
|
8
|
+
# Include Core Helpers, Security & Action Filters
|
9
|
+
include PhcdevworksCore::PhcdevPluginsHelper
|
10
|
+
before_action :authenticate_user!
|
11
|
+
before_action :set_script_url, only: %i[show edit update destroy]
|
16
12
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
13
|
+
# INDEX
|
14
|
+
def index
|
15
|
+
snippet = Script::Snippet.find(params[:snippet_id])
|
16
|
+
@script_urls = snippet.urls.all
|
17
|
+
end
|
22
18
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
19
|
+
# NEW
|
20
|
+
def new
|
21
|
+
script_snippet = Script::Snippet.find(params[:snippet_id])
|
22
|
+
@script_url = script_snippet.urls.build
|
23
|
+
end
|
28
24
|
|
29
|
-
|
30
|
-
|
31
|
-
end
|
25
|
+
# EDIT
|
26
|
+
def edit; end
|
32
27
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
28
|
+
# CREATE
|
29
|
+
def create
|
30
|
+
@script_snippet = Script::Snippet.find(params[:snippet_id])
|
31
|
+
@script_url = @script_snippet.urls.create(script_url_params)
|
32
|
+
@script_url.user_id = current_user.id
|
33
|
+
if @script_url.save
|
34
|
+
redirect_to script_snippet_urls_path, flash: { success: 'Script URL was successfully created.' }
|
35
|
+
else
|
36
|
+
render :new
|
37
|
+
end
|
42
38
|
end
|
43
|
-
end
|
44
39
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
40
|
+
# UPDATE
|
41
|
+
def update
|
42
|
+
@script_snippet = Script::Snippet.find(params[:snippet_id])
|
43
|
+
if @script_url.update(script_url_params)
|
44
|
+
redirect_to script_snippet_urls_path, flash: { success: 'Script URL was successfully updated.' }
|
45
|
+
else
|
46
|
+
render :edit
|
47
|
+
end
|
52
48
|
end
|
53
|
-
end
|
54
49
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
50
|
+
# DELETE
|
51
|
+
def destroy
|
52
|
+
@script_snippet = Script::Snippet.find(params[:snippet_id])
|
53
|
+
@script_url = @script_snippet.urls.find(params[:id])
|
54
|
+
@script_url.destroy
|
55
|
+
redirect_to script_snippet_urls_path, flash: { error: 'Script URL was successfully removed.' }
|
56
|
+
end
|
62
57
|
|
63
|
-
|
58
|
+
private
|
64
59
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
60
|
+
# Common Callbacks
|
61
|
+
def set_script_url
|
62
|
+
@script_url = Script::Url.find(params[:id])
|
63
|
+
end
|
69
64
|
|
70
|
-
|
71
|
-
|
72
|
-
|
65
|
+
# Whitelist
|
66
|
+
def script_url_params
|
67
|
+
params.require(:script_url).permit(:script_url, :snippet_id)
|
68
|
+
end
|
73
69
|
end
|
74
|
-
|
75
70
|
end
|
76
71
|
end
|
@@ -1,27 +1,29 @@
|
|
1
|
-
|
2
|
-
class Script::Snippet < ApplicationRecord
|
1
|
+
# frozen_string_literal: true
|
3
2
|
|
4
|
-
|
5
|
-
|
3
|
+
module Phccodesnipper
|
4
|
+
module Script
|
5
|
+
class Snippet < ApplicationRecord
|
6
|
+
# Clean URL Initialize
|
7
|
+
extend FriendlyId
|
6
8
|
|
7
|
-
|
8
|
-
|
9
|
+
# Relationships
|
10
|
+
has_many :urls, class_name: 'Phccodesnipper::Script::Url'
|
9
11
|
|
10
|
-
|
11
|
-
|
12
|
-
|
12
|
+
# Form Fields Validation
|
13
|
+
validates :snippet_title,
|
14
|
+
presence: true
|
13
15
|
|
14
|
-
|
15
|
-
|
16
|
+
validates :snippet_code,
|
17
|
+
presence: true
|
16
18
|
|
17
|
-
|
18
|
-
|
19
|
+
# Clean URL Define
|
20
|
+
friendly_id :phc_nice_url_slug, use: %i[slugged finders]
|
19
21
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
22
|
+
def phc_nice_url_slug
|
23
|
+
[
|
24
|
+
[:snippet_title]
|
25
|
+
]
|
26
|
+
end
|
24
27
|
end
|
25
|
-
|
26
28
|
end
|
27
29
|
end
|
@@ -1,16 +1,18 @@
|
|
1
|
-
|
2
|
-
class Script::Url < ApplicationRecord
|
3
|
-
|
4
|
-
# Include Core Validations
|
5
|
-
phc_domain_regx = URI::regexp(%w(http https))
|
1
|
+
# frozen_string_literal: true
|
6
2
|
|
7
|
-
|
8
|
-
|
3
|
+
module Phccodesnipper
|
4
|
+
module Script
|
5
|
+
class Url < ApplicationRecord
|
6
|
+
# Include Core Validations
|
7
|
+
phc_domain_regx = URI::DEFAULT_PARSER.make_regexp(%w[http https])
|
9
8
|
|
10
|
-
|
11
|
-
|
12
|
-
presence: true,
|
13
|
-
format: { :with => phc_domain_regx, message: "Please follow this URL format http or https://www.**********.com" }
|
9
|
+
# Relationships
|
10
|
+
belongs_to :snippet, class_name: 'Phccodesnipper::Script::Snippet'
|
14
11
|
|
12
|
+
# Form Fields Validation
|
13
|
+
validates :script_url,
|
14
|
+
presence: true,
|
15
|
+
format: { with: phc_domain_regx, message: 'Please follow this URL format http or https://www.**********.com' }
|
16
|
+
end
|
15
17
|
end
|
16
18
|
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
<!-- -PHCDEV- Main Wrapper - Header - Navbar - Container -->
|
2
|
+
<div class="container">
|
3
|
+
|
4
|
+
<!-- -PHCDEV- Main Wrapper - Header - Navbar - Container - Branding -->
|
5
|
+
<a href="index.html" class="navbar-brand">
|
6
|
+
<span class="brand-logo"></span>
|
7
|
+
<span class="brand-text">
|
8
|
+
<span class="text-theme">PHC</span>CodeSnipper
|
9
|
+
</span>
|
10
|
+
</a>
|
11
|
+
<!-- -PHCDEV- Main Wrapper - Header - Navbar - Container - Branding -->
|
12
|
+
|
13
|
+
<!-- -PHCDEV- Main Wrapper - Header - Navbar - Container - Mobile Button -->
|
14
|
+
<button type="button" class="navbar-toggle collapsed" data-bs-toggle="collapse" data-bs-target="#header-navbar">
|
15
|
+
<span class="icon-bar"></span>
|
16
|
+
<span class="icon-bar"></span>
|
17
|
+
<span class="icon-bar"></span>
|
18
|
+
</button>
|
19
|
+
<!-- -PHCDEV- Main Wrapper - Header - Navbar - Container - Mobile Button -->
|
20
|
+
|
21
|
+
<!-- -PHCDEV- Main Wrapper - Header - Navbar - Container - Navigation -->
|
22
|
+
<div class="collapse navbar-collapse" id="header-navbar">
|
23
|
+
<ul class="nav navbar-nav navbar-end">
|
24
|
+
<li class="nav-item"><%= link_to "Code Snippets", phccodesnipper.script_snippets_path, class: "nav-link" %></li>
|
25
|
+
</ul>
|
26
|
+
</div>
|
27
|
+
<!-- -PHCDEV- Main Wrapper - Header - Navbar - Container - Navigation -->
|
28
|
+
|
29
|
+
</div>
|
30
|
+
<!-- -PHCDEV- Main Wrapper - Header - Navbar - Container -->
|
@@ -33,10 +33,13 @@
|
|
33
33
|
|
34
34
|
<!-- -PHCDEV- Panel - Body -->
|
35
35
|
<div class="panel-body">
|
36
|
-
<div class="btn-group d-flex" role="group">
|
36
|
+
<div class="btn-group d-flex mb-3" role="group">
|
37
37
|
<%= link_to "Update", phccodesnipper.edit_script_snippet_path, class: "btn btn-primary" %>
|
38
38
|
<%= link_to "Remove", phccodesnipper.script_snippet_path, method: :delete, data: { confirm: "Are you sure?" }, class: "btn btn-danger" %>
|
39
39
|
</div>
|
40
|
+
<div class="btn-group d-flex" role="group">
|
41
|
+
<%= link_to "Add URL", phccodesnipper.script_snippet_urls_path(@script_snippet), class: "btn btn-success" %>
|
42
|
+
</div>
|
40
43
|
</div>
|
41
44
|
<!-- -PHCDEV- Panel - Body -->
|
42
45
|
|
@@ -43,9 +43,8 @@
|
|
43
43
|
<td><%= script_url.script_url %></td>
|
44
44
|
<td>
|
45
45
|
<div class="btn-group d-flex" role="group">
|
46
|
-
<%= link_to "
|
47
|
-
<%= link_to "
|
48
|
-
<%= link_to "Remove", script_snippet_url_path(script_url.snippet, script_url), method: :delete, data: { confirm: "Are you sure? This action cannot be reversed." }, class: "btn btn-danger btn-xs" %>
|
46
|
+
<%= link_to "Update URL", edit_script_snippet_url_path(script_url.snippet, script_url), class: "btn btn-primary btn-xs" %>
|
47
|
+
<%= link_to "Remove URL", script_snippet_url_path(script_url.snippet, script_url), method: :delete, data: { confirm: "Are you sure? This action cannot be reversed." }, class: "btn btn-danger btn-xs" %>
|
49
48
|
</div>
|
50
49
|
</td>
|
51
50
|
</tr>
|
@@ -33,10 +33,7 @@
|
|
33
33
|
|
34
34
|
<!-- -PHCDEV- Panel - Body -->
|
35
35
|
<div class="panel-body">
|
36
|
-
|
37
|
-
<%= link_to "Update", phccodesnipper.edit_script_snippet_url_path, class: "btn btn-primary" %>
|
38
|
-
<%= link_to "Remove", phccodesnipper.script_snippet_url_path(@script_url), method: :delete, data: { confirm: "Are you sure?" }, class: "btn btn-danger" %>
|
39
|
-
</div>
|
36
|
+
<%= link_to "Update", phccodesnipper.edit_script_snippet_url_path, class: "btn btn-primary" %>
|
40
37
|
</div>
|
41
38
|
<!-- -PHCDEV- Panel - Body -->
|
42
39
|
|
data/config/routes.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
3
|
+
Phccodesnipper::Engine.routes.draw do
|
4
|
+
# Script Snippet Routes
|
5
|
+
namespace :script do
|
6
|
+
resources :snippets, class_name: 'Phccodesnipper::Script::Snippet' do
|
7
|
+
resources :urls, class_name: 'Phccodesnipper::Script::Url'
|
8
8
|
end
|
9
|
-
|
9
|
+
end
|
10
10
|
end
|
@@ -1,8 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
class CreatePhccodesnipperScriptUrls < ActiveRecord::Migration[7.0]
|
2
4
|
def change
|
3
|
-
|
4
5
|
create_table :phccodesnipper_script_urls do |t|
|
5
|
-
|
6
6
|
t.string :script_url
|
7
7
|
|
8
8
|
t.string :slug
|
@@ -10,8 +10,6 @@ class CreatePhccodesnipperScriptUrls < ActiveRecord::Migration[7.0]
|
|
10
10
|
|
11
11
|
t.references :snippet
|
12
12
|
t.timestamps
|
13
|
-
|
14
13
|
end
|
15
|
-
|
16
14
|
end
|
17
15
|
end
|
@@ -1,8 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
class CreatePhccodesnipperScriptSnippets < ActiveRecord::Migration[7.0]
|
2
4
|
def change
|
3
|
-
|
4
5
|
create_table :phccodesnipper_script_snippets do |t|
|
5
|
-
|
6
6
|
t.string :snippet_title
|
7
7
|
t.text :snippet_code
|
8
8
|
|
@@ -10,8 +10,6 @@ class CreatePhccodesnipperScriptSnippets < ActiveRecord::Migration[7.0]
|
|
10
10
|
t.string :user_id
|
11
11
|
|
12
12
|
t.timestamps
|
13
|
-
|
14
13
|
end
|
15
|
-
|
16
14
|
end
|
17
15
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
MIGRATION_CLASS =
|
2
4
|
if ActiveRecord::VERSION::MAJOR >= 5
|
3
5
|
ActiveRecord::Migration["#{ActiveRecord::VERSION::MAJOR}.#{ActiveRecord::VERSION::MINOR}"]
|
@@ -8,14 +10,15 @@ MIGRATION_CLASS =
|
|
8
10
|
class CreateFriendlyIdSlugs < MIGRATION_CLASS
|
9
11
|
def change
|
10
12
|
create_table :friendly_id_slugs do |t|
|
11
|
-
t.string :slug, :
|
12
|
-
t.integer :sluggable_id, :
|
13
|
-
t.string :sluggable_type, :
|
13
|
+
t.string :slug, null: false
|
14
|
+
t.integer :sluggable_id, null: false
|
15
|
+
t.string :sluggable_type, limit: 50
|
14
16
|
t.string :scope
|
15
17
|
t.datetime :created_at
|
16
18
|
end
|
17
|
-
add_index :friendly_id_slugs, [
|
18
|
-
add_index :friendly_id_slugs, [
|
19
|
-
add_index :friendly_id_slugs, [
|
19
|
+
add_index :friendly_id_slugs, %i[sluggable_type sluggable_id]
|
20
|
+
add_index :friendly_id_slugs, %i[slug sluggable_type], length: { slug: 140, sluggable_type: 50 }
|
21
|
+
add_index :friendly_id_slugs, %i[slug sluggable_type scope],
|
22
|
+
length: { slug: 70, sluggable_type: 50, scope: 70 }, unique: true
|
20
23
|
end
|
21
24
|
end
|
@@ -1,44 +1,43 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Phccodesnipper
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
end
|
42
|
-
|
43
|
-
end
|
4
|
+
class Engine < ::Rails::Engine
|
5
|
+
# Load Main Dependencies
|
6
|
+
require 'jbuilder'
|
7
|
+
require 'paper_trail'
|
8
|
+
require 'friendly_id'
|
9
|
+
|
10
|
+
# Load Theme Dependencies
|
11
|
+
require 'phcthemes_admin_panel_pack'
|
12
|
+
require 'phcthemes_web_theme_pack'
|
13
|
+
|
14
|
+
# Load Helper Dependencies
|
15
|
+
require 'phcdevworks_core'
|
16
|
+
require 'phcdevworks_active_menus'
|
17
|
+
require 'phcdevworks_notifications'
|
18
|
+
require 'phcdevworks_titleseo'
|
19
|
+
|
20
|
+
# Load Upload Dependencies
|
21
|
+
require 'aws-sdk-s3'
|
22
|
+
require 'google-cloud-storage'
|
23
|
+
require 'mini_magick'
|
24
|
+
|
25
|
+
# Frontend Dependencies
|
26
|
+
require 'wicked'
|
27
|
+
require 'gravtastic'
|
28
|
+
|
29
|
+
# Mailer Dependencies
|
30
|
+
require 'mail_form'
|
31
|
+
|
32
|
+
# Engine Namespace
|
33
|
+
isolate_namespace Phccodesnipper
|
34
|
+
|
35
|
+
# Rspec Generators
|
36
|
+
config.generators do |g|
|
37
|
+
g.test_framework :rspec
|
38
|
+
g.fixture_replacement :factory_bot
|
39
|
+
g.factory_bot dir: 'spec/factories'
|
40
|
+
g.factory_bot suffix: 'factory'
|
41
|
+
end
|
42
|
+
end
|
44
43
|
end
|
data/lib/phccodesnipper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phccodesnipper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.
|
4
|
+
version: 6.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- BradPotts
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-07-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -184,28 +184,28 @@ dependencies:
|
|
184
184
|
requirements:
|
185
185
|
- - "~>"
|
186
186
|
- !ruby/object:Gem::Version
|
187
|
-
version: '1.
|
187
|
+
version: '1.114'
|
188
188
|
type: :runtime
|
189
189
|
prerelease: false
|
190
190
|
version_requirements: !ruby/object:Gem::Requirement
|
191
191
|
requirements:
|
192
192
|
- - "~>"
|
193
193
|
- !ruby/object:Gem::Version
|
194
|
-
version: '1.
|
194
|
+
version: '1.114'
|
195
195
|
- !ruby/object:Gem::Dependency
|
196
196
|
name: google-cloud-storage
|
197
197
|
requirement: !ruby/object:Gem::Requirement
|
198
198
|
requirements:
|
199
199
|
- - "~>"
|
200
200
|
- !ruby/object:Gem::Version
|
201
|
-
version: '1.
|
201
|
+
version: '1.37'
|
202
202
|
type: :runtime
|
203
203
|
prerelease: false
|
204
204
|
version_requirements: !ruby/object:Gem::Requirement
|
205
205
|
requirements:
|
206
206
|
- - "~>"
|
207
207
|
- !ruby/object:Gem::Version
|
208
|
-
version: '1.
|
208
|
+
version: '1.37'
|
209
209
|
- !ruby/object:Gem::Dependency
|
210
210
|
name: mini_magick
|
211
211
|
requirement: !ruby/object:Gem::Requirement
|
@@ -248,6 +248,48 @@ dependencies:
|
|
248
248
|
- - "~>"
|
249
249
|
- !ruby/object:Gem::Version
|
250
250
|
version: '5.1'
|
251
|
+
- !ruby/object:Gem::Dependency
|
252
|
+
name: rubocop-performance
|
253
|
+
requirement: !ruby/object:Gem::Requirement
|
254
|
+
requirements:
|
255
|
+
- - "~>"
|
256
|
+
- !ruby/object:Gem::Version
|
257
|
+
version: '1.14'
|
258
|
+
type: :development
|
259
|
+
prerelease: false
|
260
|
+
version_requirements: !ruby/object:Gem::Requirement
|
261
|
+
requirements:
|
262
|
+
- - "~>"
|
263
|
+
- !ruby/object:Gem::Version
|
264
|
+
version: '1.14'
|
265
|
+
- !ruby/object:Gem::Dependency
|
266
|
+
name: rubocop-rails
|
267
|
+
requirement: !ruby/object:Gem::Requirement
|
268
|
+
requirements:
|
269
|
+
- - "~>"
|
270
|
+
- !ruby/object:Gem::Version
|
271
|
+
version: '2.15'
|
272
|
+
type: :development
|
273
|
+
prerelease: false
|
274
|
+
version_requirements: !ruby/object:Gem::Requirement
|
275
|
+
requirements:
|
276
|
+
- - "~>"
|
277
|
+
- !ruby/object:Gem::Version
|
278
|
+
version: '2.15'
|
279
|
+
- !ruby/object:Gem::Dependency
|
280
|
+
name: rubocop-rspec
|
281
|
+
requirement: !ruby/object:Gem::Requirement
|
282
|
+
requirements:
|
283
|
+
- - "~>"
|
284
|
+
- !ruby/object:Gem::Version
|
285
|
+
version: '2.12'
|
286
|
+
type: :development
|
287
|
+
prerelease: false
|
288
|
+
version_requirements: !ruby/object:Gem::Requirement
|
289
|
+
requirements:
|
290
|
+
- - "~>"
|
291
|
+
- !ruby/object:Gem::Version
|
292
|
+
version: '2.12'
|
251
293
|
- !ruby/object:Gem::Dependency
|
252
294
|
name: spring
|
253
295
|
requirement: !ruby/object:Gem::Requirement
|
@@ -317,6 +359,7 @@ files:
|
|
317
359
|
- app/views/layouts/phccodesnipper/components/backend/footer/_footer.html.erb
|
318
360
|
- app/views/layouts/phccodesnipper/components/backend/navigation/_top_menu.html.erb
|
319
361
|
- app/views/layouts/phccodesnipper/components/backend/sidebars/_side_menu.html.erb
|
362
|
+
- app/views/layouts/phccodesnipper/components/frontend/header/_main_nav.html.erb
|
320
363
|
- app/views/phccodesnipper/script/snippets/_form.html.erb
|
321
364
|
- app/views/phccodesnipper/script/snippets/edit.html.erb
|
322
365
|
- app/views/phccodesnipper/script/snippets/index.html.erb
|
@@ -335,11 +378,15 @@ files:
|
|
335
378
|
- lib/phccodesnipper/engine.rb
|
336
379
|
- lib/phccodesnipper/version.rb
|
337
380
|
- lib/tasks/phccodesnipper_tasks.rake
|
338
|
-
homepage: https://
|
381
|
+
homepage: https://bradpotts.github.io/phccodesnipper/
|
339
382
|
licenses:
|
340
383
|
- MIT
|
341
384
|
metadata:
|
342
|
-
homepage_uri: https://
|
385
|
+
homepage_uri: https://bradpotts.github.io/phccodesnipper/
|
386
|
+
documentation_uri: https://bradpotts.github.io/phccodesnipper/
|
387
|
+
changelog_uri: https://bradpotts.github.io/phccodesnipper/releases
|
388
|
+
wiki_uri: https://github.com/bradpotts/phccodesnipper/wiki/
|
389
|
+
source_code_uri: https://github.com/bradpotts/phccodesnipper/
|
343
390
|
post_install_message:
|
344
391
|
rdoc_options: []
|
345
392
|
require_paths:
|