phcscriptcdn 4.0.0 → 4.1.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 +9 -9
- data/Rakefile +12 -11
- data/app/controllers/phcscriptcdn/application_controller.rb +10 -10
- data/app/controllers/phcscriptcdn/script/authors_controller.rb +62 -61
- data/app/controllers/phcscriptcdn/script/extensions_controller.rb +62 -60
- data/app/controllers/phcscriptcdn/script/licences_controller.rb +61 -61
- data/app/controllers/phcscriptcdn/script/listings_controller.rb +61 -61
- data/app/controllers/phcscriptcdn/script/urls_controller.rb +70 -70
- data/app/controllers/phcscriptcdn/script/versions_controller.rb +61 -61
- data/config/routes.rb +28 -28
- data/db/migrate/20160731205205_create_phcscriptcdn_script_extensions.rb +13 -13
- data/db/migrate/20160731205917_create_phcscriptcdn_script_listings.rb +32 -31
- data/db/migrate/20160731205954_create_phcscriptcdn_script_versions.rb +14 -14
- data/db/migrate/20160731210626_create_phcscriptcdn_script_urls.rb +20 -20
- data/db/migrate/20160731210723_create_phcscriptcdn_script_authors.rb +19 -19
- data/db/migrate/20160801032225_create_phcscriptcdn_script_licences.rb +23 -23
- data/lib/phcscriptcdn/engine.rb +48 -47
- data/lib/phcscriptcdn/version.rb +1 -1
- metadata +20 -38
@@ -1,65 +1,65 @@
|
|
1
1
|
require_dependency "phcscriptcdn/application_controller"
|
2
2
|
|
3
3
|
module Phcscriptcdn
|
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
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
4
|
+
class Script::ListingsController < ApplicationController
|
5
|
+
|
6
|
+
# Filters & Security
|
7
|
+
before_action :set_script_listing, only: [:show, :edit, :update, :destroy]
|
8
|
+
|
9
|
+
# INDEX - Script Listings
|
10
|
+
def index
|
11
|
+
@script_listings = Script::Listing.all
|
12
|
+
end
|
13
|
+
|
14
|
+
# DETAILS - Script Listings
|
15
|
+
def show
|
16
|
+
end
|
17
|
+
|
18
|
+
# NEW - Script Listings
|
19
|
+
def new
|
20
|
+
@script_listing = Script::Listing.new
|
21
|
+
end
|
22
|
+
|
23
|
+
# EDIT - Script Listings
|
24
|
+
def edit
|
25
|
+
end
|
26
|
+
|
27
|
+
# POST - Script Listings
|
28
|
+
def create
|
29
|
+
@script_listing = Script::Listing.new(script_listing_params)
|
30
|
+
if @script_listing.save
|
31
|
+
redirect_to script_listings_path, notice: 'Listing was successfully created.'
|
32
|
+
else
|
33
|
+
render :new
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
# PATCH/PUT - Script Listings
|
38
|
+
def update
|
39
|
+
if @script_listing.update(script_listing_params)
|
40
|
+
redirect_to script_listings_path, notice: 'Listing was successfully updated.'
|
41
|
+
else
|
42
|
+
render :edit
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
# DELETE - Script Listings
|
47
|
+
def destroy
|
48
|
+
@script_listing.destroy
|
49
|
+
redirect_to script_listings_path, notice: 'Listing was successfully destroyed.'
|
50
|
+
end
|
51
|
+
|
52
|
+
private
|
53
|
+
|
54
|
+
# Common Callbacks
|
55
|
+
def set_script_listing
|
56
|
+
@script_listing = Script::Listing.find(params[:id])
|
57
|
+
end
|
58
|
+
|
59
|
+
# Whitelist
|
60
|
+
def script_listing_params
|
61
|
+
params.require(:script_listing).permit(:scripttitle, :scriptdescription, :descriptionsource, :scriptwebsite, :scripttwitter, :scriptgithub, :scriptinitialrelease, :scriptlastestrelease, :scriptbetarelease, :scriptstatus, :user_id, :user_name, :version_id, :author_id, :licence_id)
|
62
|
+
end
|
63
|
+
|
64
|
+
end
|
65
65
|
end
|
@@ -1,74 +1,74 @@
|
|
1
1
|
require_dependency "phcscriptcdn/application_controller"
|
2
2
|
|
3
3
|
module Phcscriptcdn
|
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
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
4
|
+
class Script::UrlsController < ApplicationController
|
5
|
+
|
6
|
+
# Filters & Security
|
7
|
+
before_action :set_script_url, only: [:show, :edit, :update, :destroy]
|
8
|
+
|
9
|
+
# INDEX - Script Authors
|
10
|
+
def index
|
11
|
+
script_listing = Script::Listing.find(params[:listing_id])
|
12
|
+
@script_urls = script_listing.urls
|
13
|
+
end
|
14
|
+
|
15
|
+
# DETAILED PROFILE - Script Authors
|
16
|
+
def show
|
17
|
+
script_listing = Script::Listing.find(params[:listing_id])
|
18
|
+
@script_url = script_listing.urls.find(params[:id])
|
19
|
+
end
|
20
|
+
|
21
|
+
# NEW - Script Athors
|
22
|
+
def new
|
23
|
+
script_listing = Script::Listing.find(params[:listing_id])
|
24
|
+
@script_url = script_listing.urls.build
|
25
|
+
end
|
26
|
+
|
27
|
+
# EDIT - Script Athors
|
28
|
+
def edit
|
29
|
+
script_listing = Script::Listing.find(params[:listing_id])
|
30
|
+
@script_url = script_listing.urls.find(params[:id])
|
31
|
+
end
|
32
|
+
|
33
|
+
# POST - Script Athors
|
34
|
+
def create
|
35
|
+
@script_listing = Script::Listing.find(params[:listing_id])
|
36
|
+
@script_url = @script_listing.urls.create(script_url_params)
|
37
|
+
if @script_url.save
|
38
|
+
redirect_to script_listing_urls_path, notice: 'Author was successfully created.'
|
39
|
+
else
|
40
|
+
render :new
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
# PATCH/PUT - Script Athors
|
45
|
+
def update
|
46
|
+
if @script_url.update(script_url_params)
|
47
|
+
redirect_to script_listing_urls_path, notice: 'Author was successfully updated.'
|
48
|
+
else
|
49
|
+
render :edit
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
# DELETE - Script Athors
|
54
|
+
def destroy
|
55
|
+
@script_listing = Script::Listing.find(params[:listing_id])
|
56
|
+
@script_url = @script_listing.urls.find(params[:id])
|
57
|
+
@script_url.destroy
|
58
|
+
redirect_to script_listing_urls_path, notice: 'Author was successfully destroyed.'
|
59
|
+
end
|
60
|
+
|
61
|
+
private
|
62
|
+
|
63
|
+
# Common Callbacks
|
64
|
+
def set_script_url
|
65
|
+
@script_url = Script::Url.find(params[:id])
|
66
|
+
end
|
67
|
+
|
68
|
+
# Whitelists
|
69
|
+
def script_url_params
|
70
|
+
params.require(:script_url).permit(:scripturl, :scripturlrelease, :scripturlcdnupdate, :user_id, :user_name, :listing_id, :version_id, :extension_id)
|
71
|
+
end
|
72
|
+
|
73
|
+
end
|
74
74
|
end
|
@@ -1,65 +1,65 @@
|
|
1
1
|
require_dependency "phcscriptcdn/application_controller"
|
2
2
|
|
3
3
|
module Phcscriptcdn
|
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
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
4
|
+
class Script::VersionsController < ApplicationController
|
5
|
+
|
6
|
+
# Filters & Security
|
7
|
+
before_action :set_script_version, only: [:show, :edit, :update, :destroy]
|
8
|
+
|
9
|
+
# INDEX - Script Versions
|
10
|
+
def index
|
11
|
+
@script_versions = Script::Version.all
|
12
|
+
end
|
13
|
+
|
14
|
+
# DETAILS - Script Versions
|
15
|
+
def show
|
16
|
+
end
|
17
|
+
|
18
|
+
# NEW - Script Versions
|
19
|
+
def new
|
20
|
+
@script_version = Script::Version.new
|
21
|
+
end
|
22
|
+
|
23
|
+
# EDIT - Script Versions
|
24
|
+
def edit
|
25
|
+
end
|
26
|
+
|
27
|
+
# POST - Script Versions
|
28
|
+
def create
|
29
|
+
@script_version = Script::Version.new(script_version_params)
|
30
|
+
if @script_version.save
|
31
|
+
redirect_to script_versions_url, notice: 'Version was successfully created.'
|
32
|
+
else
|
33
|
+
render :new
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
# PATCH/PUT - Script Versions
|
38
|
+
def update
|
39
|
+
if @script_version.update(script_version_params)
|
40
|
+
redirect_to script_versions_url, notice: 'Version was successfully updated.'
|
41
|
+
else
|
42
|
+
render :edit
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
# DELETE - Script Versions
|
47
|
+
def destroy
|
48
|
+
@script_version.destroy
|
49
|
+
redirect_to script_versions_url, notice: 'Version was successfully destroyed.'
|
50
|
+
end
|
51
|
+
|
52
|
+
private
|
53
|
+
|
54
|
+
# Common Callbacks
|
55
|
+
def set_script_version
|
56
|
+
@script_version = Script::Version.find(params[:id])
|
57
|
+
end
|
58
|
+
|
59
|
+
# Only allow a trusted parameter "white list" through.
|
60
|
+
def script_version_params
|
61
|
+
params.require(:script_version).permit(:scriptversion, :user_id, :user_name)
|
62
|
+
end
|
63
|
+
|
64
|
+
end
|
65
65
|
end
|
data/config/routes.rb
CHANGED
@@ -1,33 +1,33 @@
|
|
1
1
|
Phcscriptcdn::Engine.routes.draw do
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
3
|
+
# CDN Frontend
|
4
|
+
namespace :frontend do
|
5
|
+
# Frontend Routes
|
6
|
+
resources :cdnpages
|
7
|
+
end
|
8
|
+
|
9
|
+
# Script CDN Listing System
|
10
|
+
namespace :script do
|
11
|
+
# Main Script Module
|
12
|
+
resources :listings, class_name: 'Phcscriptcdn::Script::Listing' do
|
13
|
+
resources :urls, class_name: 'Phcscriptcdn::Script::Url'
|
14
|
+
resources :authors, class_name: 'Phcscriptcdn::Script::Author'
|
15
|
+
end
|
16
|
+
resources :extensions, class_name: 'Phcscriptcdn::Script::Extension'
|
17
|
+
resources :versions, class_name: 'Phcscriptcdn::Script::Version'
|
18
|
+
resources :licences, class_name: 'Phcscriptcdn::Script::Licence'
|
19
|
+
end
|
20
|
+
|
21
|
+
# Application API
|
22
|
+
namespace :api, :path => "", :constraints => {:subdomain => "api"} do
|
23
|
+
namespace :v1 do
|
24
|
+
# Routes for API
|
25
|
+
resources :mains, defaults: {format: 'json'}
|
26
|
+
resources :informations, defaults: {format: 'json'}
|
27
|
+
resources :versions, defaults: {format: 'json'}
|
28
|
+
end
|
29
|
+
end
|
8
30
|
|
9
|
-
|
10
|
-
namespace :script do
|
11
|
-
# Main Script Module
|
12
|
-
resources :listings, class_name: 'Phcscriptcdn::Script::Listing' do
|
13
|
-
resources :urls, class_name: 'Phcscriptcdn::Script::Url'
|
14
|
-
resources :authors, class_name: 'Phcscriptcdn::Script::Author'
|
15
|
-
end
|
16
|
-
resources :extensions, class_name: 'Phcscriptcdn::Script::Extension'
|
17
|
-
resources :versions, class_name: 'Phcscriptcdn::Script::Version'
|
18
|
-
resources :licences, class_name: 'Phcscriptcdn::Script::Licence'
|
19
|
-
end
|
20
|
-
|
21
|
-
# Application API
|
22
|
-
namespace :api, :path => "", :constraints => {:subdomain => "api"} do
|
23
|
-
namespace :v1 do
|
24
|
-
|
25
|
-
# Routes for API
|
26
|
-
resources :mains, defaults: {format: 'json'}
|
27
|
-
resources :informations, defaults: {format: 'json'}
|
28
|
-
resources :versions, defaults: {format: 'json'}
|
31
|
+
end
|
29
32
|
|
30
|
-
end
|
31
|
-
end
|
32
33
|
|
33
|
-
end
|