phcdevworks_scripts 5.8.0 → 8.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/MIT-LICENSE +1 -1
- data/README.md +21 -28
- data/Rakefile +5 -29
- data/app/assets/config/phcdevworks_scripts_manifest.js +2 -1
- data/app/assets/stylesheets/phcdevworks_scripts/application.scss +15 -2
- data/app/controllers/phcdevworks_scripts/application_controller.rb +8 -8
- data/app/controllers/phcdevworks_scripts/script/authors_controller.rb +2 -2
- data/app/controllers/phcdevworks_scripts/script/extensions_controller.rb +2 -2
- data/app/controllers/phcdevworks_scripts/script/listings_controller.rb +2 -2
- data/app/controllers/phcdevworks_scripts/script/urls_controller.rb +1 -1
- data/app/controllers/phcdevworks_scripts/script/versions_controller.rb +1 -1
- data/app/controllers/phcdevworks_scripts/snippet/posts_controller.rb +1 -1
- data/app/controllers/phcdevworks_scripts/snippet/urls_controller.rb +1 -1
- data/app/models/phcdevworks_scripts/script/author.rb +7 -9
- data/app/models/phcdevworks_scripts/script/extension.rb +7 -7
- data/app/models/phcdevworks_scripts/script/listing.rb +8 -8
- data/app/models/phcdevworks_scripts/script/url.rb +3 -3
- data/app/models/phcdevworks_scripts/script/version.rb +2 -2
- data/app/models/phcdevworks_scripts/script_author_versions.rb +1 -1
- data/app/models/phcdevworks_scripts/script_extension_versions.rb +1 -1
- data/app/models/phcdevworks_scripts/script_listing_versions.rb +1 -1
- data/app/models/phcdevworks_scripts/script_url_versions.rb +1 -1
- data/app/models/phcdevworks_scripts/snippet/post.rb +5 -5
- data/app/models/phcdevworks_scripts/snippet/url.rb +1 -1
- data/app/views/layouts/phcdevworks_scripts/application.html.erb +76 -16
- data/app/views/layouts/phcdevworks_scripts/components/backend/sidebars/_side_menu.html.erb +56 -34
- data/app/views/phcdevworks_scripts/script/authors/_form.html.erb +8 -8
- data/app/views/phcdevworks_scripts/script/authors/index.html.erb +4 -4
- data/app/views/phcdevworks_scripts/script/extensions/_form.html.erb +6 -6
- data/app/views/phcdevworks_scripts/script/extensions/index.html.erb +2 -2
- data/app/views/phcdevworks_scripts/script/listings/_form.html.erb +22 -21
- data/app/views/phcdevworks_scripts/script/listings/index.html.erb +4 -4
- data/app/views/phcdevworks_scripts/script/urls/_form.html.erb +8 -8
- data/app/views/phcdevworks_scripts/snippet/posts/_form.html.erb +5 -4
- data/app/views/phcdevworks_scripts/snippet/posts/index.html.erb +2 -2
- data/app/views/phcdevworks_scripts/snippet/posts/show.html.erb +2 -2
- data/app/views/phcdevworks_scripts/snippet/urls/_form.html.erb +2 -2
- data/db/migrate/20170517064030_create_phcdevworks_scripts_script_extension_versions.rb +18 -0
- data/db/migrate/{20170517064049_create_phcdevworks_scripts_listing_versions.rb → 20170517064049_create_phcdevworks_scripts_script_listing_versions.rb} +4 -3
- data/db/migrate/20170517064114_create_phcdevworks_scripts_script_version_versions.rb +2 -1
- data/db/migrate/{20170517064030_create_phcdevworks_scripts_extension_versions.rb → 20170517064150_create_phcdevworks_scripts_script_url_versions.rb} +4 -3
- data/db/migrate/{20170517064150_create_phcdevworks_scripts_url_versions.rb → 20170517064208_create_phcdevworks_scripts_script_author_versions.rb} +18 -17
- data/db/migrate/20190818022002_create_phcdevworks_scripts_snippet_posts.rb +4 -2
- data/db/migrate/20190818022024_create_phcdevworks_scripts_snippet_urls.rb +3 -3
- data/db/migrate/20190818022939_create_phcdevworks_scripts_script_authors.rb +5 -5
- data/db/migrate/20190818023353_create_phcdevworks_scripts_script_listings.rb +13 -11
- data/db/migrate/20190818023709_create_phcdevworks_scripts_script_extensions.rb +3 -3
- data/db/migrate/20190818023911_create_phcdevworks_scripts_script_urls.rb +7 -7
- data/db/migrate/20191102092649_create_phcdevworks_scripts_snippet_url_versions.rb +0 -1
- data/db/migrate/20191102092711_create_phcdevworks_scripts_snippet_post_versions.rb +0 -1
- data/lib/phcdevworks_scripts.rb +1 -0
- data/lib/phcdevworks_scripts/engine.rb +45 -35
- data/lib/phcdevworks_scripts/version.rb +1 -1
- metadata +119 -54
- data/app/assets/javascripts/phcdevworks_scripts/application.js +0 -2
- data/app/assets/javascripts/phcdevworks_scripts/script/authors.coffee +0 -3
- data/app/assets/javascripts/phcdevworks_scripts/script/extensions.coffee +0 -3
- data/app/assets/javascripts/phcdevworks_scripts/script/listings.coffee +0 -3
- data/app/assets/javascripts/phcdevworks_scripts/script/urls.coffee +0 -3
- data/app/assets/javascripts/phcdevworks_scripts/script/versions.coffee +0 -3
- data/app/assets/javascripts/phcdevworks_scripts/snippet/posts.coffee +0 -3
- data/app/assets/javascripts/phcdevworks_scripts/snippet/urls.coffee +0 -3
- data/db/migrate/20170517064208_create_phcdevworks_scripts_author_versions.rb +0 -17
- data/db/migrate/20170517064427_create_phcdevworks_scripts_licence_versions.rb +0 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c5b6f7e9d4eee7ba11870a41de1e6cbd14af7a12830b39f3831f79c0570b7369
|
4
|
+
data.tar.gz: 256aba18490066fa44f1b8127ec104cba828def014bf80cb7ac1f9b292006fa1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac70b34dc928b5150d39e39c72d7c2508999d7e5927725ca9cd7da7d7a8111d470bf3aa1f7f238499959096591d7e1f6ec6c5bac6d752a2b7e96d44084560316
|
7
|
+
data.tar.gz: 5eb05f67314353c3ab5d1349af1b97b7562fac87c24ee8ac80e5a7a358187743f9eff42141ec17457c149a24eca2a4fbdffd4f6982dc02c8d1548ca69fd333f8
|
data/MIT-LICENSE
CHANGED
data/README.md
CHANGED
@@ -1,35 +1,28 @@
|
|
1
|
-
|
1
|
+
# PhcdevworksScripts
|
2
|
+
Short description and motivation.
|
2
3
|
|
3
|
-
|
4
|
+
## Usage
|
5
|
+
How to use my plugin.
|
4
6
|
|
5
|
-
|
6
|
-
|
7
|
-
- Script versions and script CDN URLs.
|
8
|
-
- Store script snippets and URLs.
|
7
|
+
## Installation
|
8
|
+
Add this line to your application's Gemfile:
|
9
9
|
|
10
|
-
|
10
|
+
```ruby
|
11
|
+
gem 'phcdevworks_scripts'
|
12
|
+
```
|
11
13
|
|
12
|
-
|
13
|
-
|
14
|
+
And then execute:
|
15
|
+
```bash
|
16
|
+
$ bundle
|
17
|
+
```
|
14
18
|
|
15
|
-
|
16
|
-
|
19
|
+
Or install it yourself as:
|
20
|
+
```bash
|
21
|
+
$ gem install phcdevworks_scripts
|
22
|
+
```
|
17
23
|
|
18
|
-
|
19
|
-
|
24
|
+
## Contributing
|
25
|
+
Contribution directions go here.
|
20
26
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
mount Phcscriptcdnpro::Engine, :at => '/'
|
25
|
-
|
26
|
-
#### Step 4 - Recompile Assets
|
27
|
-
To properly function re-compile your application's assets to copy over required files.
|
28
|
-
|
29
|
-
rails assets:clobber
|
30
|
-
rails assets:precompile
|
31
|
-
|
32
|
-
#### Step 5 - Generate Contact Form View (Customization)
|
33
|
-
All PHCDevworks Scripts views and layouts can be overwritten by copying files to your application.
|
34
|
-
|
35
|
-
rails generate phcdevworks_scripts:views
|
27
|
+
## License
|
28
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
CHANGED
@@ -1,32 +1,8 @@
|
|
1
|
-
|
2
|
-
require 'bundler/setup'
|
3
|
-
rescue LoadError
|
4
|
-
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
5
|
-
end
|
1
|
+
require "bundler/setup"
|
6
2
|
|
7
|
-
|
3
|
+
APP_RAKEFILE = File.expand_path("spec/test_app/Rakefile", __dir__)
|
4
|
+
load "rails/tasks/engine.rake"
|
8
5
|
|
9
|
-
|
10
|
-
rdoc.rdoc_dir = 'rdoc'
|
11
|
-
rdoc.title = 'PhcdevworksScripts'
|
12
|
-
rdoc.options << '--line-numbers'
|
13
|
-
rdoc.rdoc_files.include('README.md')
|
14
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
15
|
-
end
|
6
|
+
load "rails/tasks/statistics.rake"
|
16
7
|
|
17
|
-
|
18
|
-
load 'rails/tasks/engine.rake'
|
19
|
-
|
20
|
-
load 'rails/tasks/statistics.rake'
|
21
|
-
|
22
|
-
require 'bundler/gem_tasks'
|
23
|
-
|
24
|
-
require 'rake/testtask'
|
25
|
-
|
26
|
-
Rake::TestTask.new(:test) do |t|
|
27
|
-
t.libs << 'test'
|
28
|
-
t.pattern = 'test/**/*_test.rb'
|
29
|
-
t.verbose = false
|
30
|
-
end
|
31
|
-
|
32
|
-
task default: :test
|
8
|
+
require "bundler/gem_tasks"
|
@@ -1,2 +1,15 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
+
* listed below.
|
4
|
+
*
|
5
|
+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
+
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
|
7
|
+
*
|
8
|
+
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
9
|
+
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
|
10
|
+
* files in this directory. Styles in this file should be added after the last require_* statement.
|
11
|
+
* It is generally better to create a new file per style scope.
|
12
|
+
*
|
13
|
+
*= require_tree .
|
14
|
+
*= require_self
|
15
|
+
*/
|
@@ -1,13 +1,13 @@
|
|
1
1
|
module PhcdevworksScripts
|
2
|
-
|
2
|
+
class ApplicationController < ActionController::Base
|
3
3
|
|
4
|
-
|
5
|
-
|
4
|
+
# Security Filters
|
5
|
+
protect_from_forgery with: :exception
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
7
|
+
# Load Requried Helper Files
|
8
|
+
helper PhcdevworksActiveMenus::Engine.helpers
|
9
|
+
helper PhcdevworksNotifications::Engine.helpers
|
10
|
+
helper PhcdevworksTitleseo::Engine.helpers
|
11
11
|
|
12
|
-
|
12
|
+
end
|
13
13
|
end
|
@@ -17,7 +17,7 @@ module PhcdevworksScripts
|
|
17
17
|
# GET /script/authors/1
|
18
18
|
def show
|
19
19
|
@script_authors = Script::Author.friendly.find(params[:id])
|
20
|
-
@versions = PhcdevworksScripts::
|
20
|
+
@versions = PhcdevworksScripts::ScriptAuthorVersions.where(item_id: params[:id], item_type: 'PhcdevworksScripts::Script::Author')
|
21
21
|
end
|
22
22
|
|
23
23
|
# GET /script/authors/new
|
@@ -76,7 +76,7 @@ module PhcdevworksScripts
|
|
76
76
|
|
77
77
|
# Whitelist
|
78
78
|
def script_author_params
|
79
|
-
params.require(:script_author).permit(:
|
79
|
+
params.require(:script_author).permit(:script_author_first_name, :script_author_last_name, :script_author_website, :script_author_github, :slug, :user_id, :org_id)
|
80
80
|
end
|
81
81
|
|
82
82
|
end
|
@@ -17,7 +17,7 @@ module PhcdevworksScripts
|
|
17
17
|
# GET /script/extensions/1
|
18
18
|
def show
|
19
19
|
@script_extensions = Script::Extension.friendly.find(params[:id])
|
20
|
-
@versions = PhcdevworksScripts::
|
20
|
+
@versions = PhcdevworksScripts::ScriptExtensionVersions.where(item_id: params[:id], item_type: 'PhcdevworksScripts::Script::Extension')
|
21
21
|
end
|
22
22
|
|
23
23
|
# GET /script/extensions/new
|
@@ -76,7 +76,7 @@ module PhcdevworksScripts
|
|
76
76
|
|
77
77
|
# Whitelist
|
78
78
|
def script_extension_params
|
79
|
-
params.require(:script_extension).permit(:
|
79
|
+
params.require(:script_extension).permit(:script_extension_name, :script_extension_description, :script_extension, :slug, :user_id, :org_id)
|
80
80
|
end
|
81
81
|
|
82
82
|
end
|
@@ -17,7 +17,7 @@ module PhcdevworksScripts
|
|
17
17
|
# GET /script/listings/1
|
18
18
|
def show
|
19
19
|
@script_listings = Script::Listing.friendly.find(params[:id])
|
20
|
-
@versions = PhcdevworksScripts::
|
20
|
+
@versions = PhcdevworksScripts::ScriptListingVersions.where(item_id: params[:id], item_type: 'PhcdevworksScripts::Script::Listing')
|
21
21
|
end
|
22
22
|
|
23
23
|
# GET /script/listings/new
|
@@ -76,7 +76,7 @@ module PhcdevworksScripts
|
|
76
76
|
|
77
77
|
# Whitelist
|
78
78
|
def script_listing_params
|
79
|
-
params.require(:script_listing).permit(:
|
79
|
+
params.require(:script_listing).permit(:script_listing_title, :script_listing_description, :script_listing_script_source, :script_listing_script_website, :script_listing_script_repo, :script_listing_script_initial_release, :listing_script_lastest_release, :script_listing_script_beta_release, :script_listing_script_lastest_release, :script_listing_script_lastest_release_cdn, :author_id, :slug, :user_id, :org_id)
|
80
80
|
end
|
81
81
|
|
82
82
|
end
|
@@ -71,7 +71,7 @@ module PhcdevworksScripts
|
|
71
71
|
|
72
72
|
# Whitelist
|
73
73
|
def script_url_params
|
74
|
-
params.require(:script_url).permit(:
|
74
|
+
params.require(:script_url).permit(:script_cdn_url, :script_cdn_url_release, :script_cdn_url_cdn_update, :version_id, :extension_id, :slug, :user_id, :org_id)
|
75
75
|
end
|
76
76
|
|
77
77
|
end
|
@@ -17,7 +17,7 @@ module PhcdevworksScripts
|
|
17
17
|
# GET /script/versions/1
|
18
18
|
def show
|
19
19
|
@script_versions = Script::Version.friendly.find(params[:id])
|
20
|
-
@versions = PhcdevworksScripts::
|
20
|
+
@versions = PhcdevworksScripts::ScriptVersionVersions.where(item_id: params[:id], item_type: 'PhcdevworksScripts::Script::Version')
|
21
21
|
end
|
22
22
|
|
23
23
|
# GET /script/versions/new
|
@@ -75,7 +75,7 @@ module PhcdevworksScripts
|
|
75
75
|
|
76
76
|
# Whitelist
|
77
77
|
def snippet_post_params
|
78
|
-
params.require(:snippet_post).permit(:
|
78
|
+
params.require(:snippet_post).permit(:snippet_post_title, :snippet_post_code, :slug, :user_id, :org_id)
|
79
79
|
end
|
80
80
|
|
81
81
|
end
|
@@ -70,7 +70,7 @@ module PhcdevworksScripts
|
|
70
70
|
|
71
71
|
# Whitelist
|
72
72
|
def snippet_url_params
|
73
|
-
params.require(:snippet_url).permit(:
|
73
|
+
params.require(:snippet_url).permit(:snippet_post_url, :post_id, :slug, :user_id, :org_id)
|
74
74
|
end
|
75
75
|
|
76
76
|
end
|
@@ -11,24 +11,22 @@ module PhcdevworksScripts
|
|
11
11
|
has_many :listings, class_name: 'PhcdevworksScripts::Script::Listing'
|
12
12
|
|
13
13
|
# Form Fields Validation
|
14
|
-
validates :
|
15
|
-
|
14
|
+
validates :script_author_first_name,
|
15
|
+
presence: true
|
16
16
|
|
17
|
-
validates :
|
17
|
+
validates :script_author_website,
|
18
18
|
presence: true,
|
19
19
|
format: { with: URI::regexp(%w(http https)), message: "Please follow this URL format http or https://www.**********.com" }
|
20
20
|
|
21
|
-
validates :
|
21
|
+
validates :script_author_github,
|
22
22
|
presence: true,
|
23
23
|
format: { with: URI::regexp(%w(http https)), message: "Please follow this URL format http or https://www.**********.com" }
|
24
24
|
|
25
25
|
# Clean URL Define
|
26
|
-
friendly_id :
|
26
|
+
friendly_id :script_author_nice_urls, use: [:slugged, :finders]
|
27
27
|
|
28
|
-
def
|
29
|
-
[
|
30
|
-
[:author_first_name, :author_last_name]
|
31
|
-
]
|
28
|
+
def script_author_nice_urls
|
29
|
+
[:script_author_first_name, :script_author_last_name]
|
32
30
|
end
|
33
31
|
|
34
32
|
end
|
@@ -12,20 +12,20 @@ module PhcdevworksScripts
|
|
12
12
|
has_many :urls, class_name: 'PhcdevworksScripts::Script::Url'
|
13
13
|
|
14
14
|
# Form Fields Validation
|
15
|
-
validates :
|
15
|
+
validates :script_extension_name,
|
16
16
|
presence: true
|
17
17
|
|
18
|
-
validates :
|
18
|
+
validates :script_extension_description,
|
19
19
|
presence: true
|
20
20
|
|
21
|
-
validates :
|
21
|
+
validates :script_extension,
|
22
22
|
presence: true
|
23
|
-
|
23
|
+
|
24
24
|
# Clean URL Define
|
25
|
-
friendly_id :
|
25
|
+
friendly_id :script_extension_nice_urls, use: [:slugged, :finders]
|
26
26
|
|
27
|
-
def
|
28
|
-
[:
|
27
|
+
def script_extension_nice_urls
|
28
|
+
[:script_extension]
|
29
29
|
end
|
30
30
|
|
31
31
|
end
|
@@ -12,26 +12,26 @@ module PhcdevworksScripts
|
|
12
12
|
belongs_to :author, class_name: 'PhcdevworksScripts::Script::Author'
|
13
13
|
|
14
14
|
# Form Fields Validation
|
15
|
-
validates :
|
15
|
+
validates :script_listing_title,
|
16
16
|
presence: true
|
17
17
|
|
18
|
-
validates :
|
18
|
+
validates :script_listing_description,
|
19
19
|
presence: true
|
20
20
|
|
21
|
-
validates :
|
21
|
+
validates :script_listing_script_source,
|
22
22
|
format: { with: URI::regexp(%w(http https)), message: "Please follow this URL format http or https://www.**********.com" }
|
23
23
|
|
24
|
-
validates :
|
24
|
+
validates :script_listing_script_website,
|
25
25
|
format: { with: URI::regexp(%w(http https)), message: "Please follow this URL format http or https://www.**********.com" }
|
26
26
|
|
27
|
-
validates :
|
27
|
+
validates :script_listing_script_repo,
|
28
28
|
format: { with: URI::regexp(%w(http https)), message: "Please follow this URL format http or https://www.**********.com" }
|
29
29
|
|
30
30
|
# Clean URL Define
|
31
|
-
friendly_id :
|
31
|
+
friendly_id :script_listing_nice_urls, use: [:slugged, :finders]
|
32
32
|
|
33
|
-
def
|
34
|
-
[:
|
33
|
+
def script_listing_nice_urls
|
34
|
+
[:script_listing_title]
|
35
35
|
end
|
36
36
|
|
37
37
|
end
|
@@ -10,14 +10,14 @@ module PhcdevworksScripts
|
|
10
10
|
belongs_to :version, class_name: 'PhcdevworksScripts::Script::Version', optional: true
|
11
11
|
|
12
12
|
# Form Fields Validation
|
13
|
-
validates :
|
13
|
+
validates :script_cdn_url,
|
14
14
|
presence: true,
|
15
15
|
format: { with: URI::regexp(%w(http https)), message: "Please follow this URL format http or https://www.**********.com" }
|
16
16
|
|
17
|
-
validates :
|
17
|
+
validates :script_cdn_url_release,
|
18
18
|
presence: true
|
19
19
|
|
20
|
-
validates :
|
20
|
+
validates :script_cdn_url_cdn_update,
|
21
21
|
presence: true
|
22
22
|
|
23
23
|
end
|
@@ -16,9 +16,9 @@ module PhcdevworksScripts
|
|
16
16
|
presence: true
|
17
17
|
|
18
18
|
# Clean URL Define
|
19
|
-
friendly_id :
|
19
|
+
friendly_id :script_version_nice_urls, use: [:slugged, :finders]
|
20
20
|
|
21
|
-
def
|
21
|
+
def script_version_nice_urls
|
22
22
|
[:script_version_number]
|
23
23
|
end
|
24
24
|
|
@@ -11,17 +11,17 @@ module PhcdevworksScripts
|
|
11
11
|
has_many :urls, class_name: 'PhcdevworksScripts::Snippet::Url'
|
12
12
|
|
13
13
|
# Form Fields Validation
|
14
|
-
validates :
|
14
|
+
validates :snippet_post_title,
|
15
15
|
presence: true
|
16
16
|
|
17
|
-
validates :
|
17
|
+
validates :snippet_post_code,
|
18
18
|
presence: true
|
19
19
|
|
20
20
|
# Clean URL Define
|
21
|
-
friendly_id :
|
21
|
+
friendly_id :snippet_post_nice_urls, use: [:slugged, :finders]
|
22
22
|
|
23
|
-
def
|
24
|
-
[:
|
23
|
+
def snippet_post_nice_urls
|
24
|
+
[:snippet_post_title]
|
25
25
|
end
|
26
26
|
|
27
27
|
end
|
@@ -11,7 +11,7 @@ module PhcdevworksScripts
|
|
11
11
|
belongs_to :post, class_name: 'PhcdevworksScripts::Snippet::Post'
|
12
12
|
|
13
13
|
# Form Fields Validation
|
14
|
-
validates :
|
14
|
+
validates :snippet_post_url,
|
15
15
|
presence: true,
|
16
16
|
format: { :with => phc_domain_regx, message: "Please follow this URL format http or https://www.**********.com" }
|
17
17
|
|