phcscriptcdn 1.2.0 → 2.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 +20 -0
- data/README.md +3 -3
- data/Rakefile +18 -12
- data/app/assets/config/phcscriptcdn_manifest.js +2 -0
- data/app/assets/javascripts/phcscriptcdn/application.js +1 -4
- data/app/assets/javascripts/phcscriptcdn/scriptcdn/{scripts.js → authors.js} +0 -0
- data/app/assets/javascripts/phcscriptcdn/scriptcdn/{scripturls.js → information.js} +0 -0
- data/app/assets/javascripts/phcscriptcdn/scriptcdn/{scriptversions.js → mains.js} +0 -0
- data/app/assets/javascripts/phcscriptcdn/scriptcdn/urls.js +2 -0
- data/app/assets/javascripts/phcscriptcdn/scriptcdn/versions.js +2 -0
- data/app/assets/stylesheets/phcscriptcdn/application.css +15 -0
- data/app/assets/stylesheets/phcscriptcdn/scriptcdn/authors.scss +3 -0
- data/app/assets/stylesheets/phcscriptcdn/scriptcdn/information.scss +3 -0
- data/app/assets/stylesheets/phcscriptcdn/scriptcdn/mains.scss +3 -0
- data/app/assets/stylesheets/phcscriptcdn/scriptcdn/urls.scss +3 -0
- data/app/assets/stylesheets/phcscriptcdn/scriptcdn/versions.scss +3 -0
- data/app/assets/stylesheets/scaffolds.scss +89 -0
- data/app/controllers/phcscriptcdn/application_controller.rb +4 -1
- data/app/controllers/phcscriptcdn/scriptcdn/authors_controller.rb +69 -0
- data/app/controllers/phcscriptcdn/scriptcdn/informations_controller.rb +69 -0
- data/app/controllers/phcscriptcdn/scriptcdn/mains_controller.rb +62 -0
- data/app/controllers/phcscriptcdn/scriptcdn/urls_controller.rb +84 -0
- data/app/controllers/phcscriptcdn/scriptcdn/versions_controller.rb +69 -0
- data/app/jobs/phcscriptcdn/application_job.rb +4 -0
- data/app/models/phcscriptcdn/application_record.rb +5 -0
- data/app/models/phcscriptcdn/scriptcdn/author.rb +8 -0
- data/app/models/phcscriptcdn/scriptcdn/information.rb +8 -0
- data/app/models/phcscriptcdn/scriptcdn/main.rb +11 -0
- data/app/models/phcscriptcdn/scriptcdn/url.rb +8 -0
- data/app/models/phcscriptcdn/scriptcdn/version.rb +8 -0
- data/app/models/phcscriptcdn/scriptcdn.rb +5 -5
- data/app/views/layouts/phcscriptcdn/application.html.erb +2 -2
- data/app/views/layouts/phcscriptcdn/frontend.html.erb +21 -0
- data/app/views/phcscriptcdn/scriptcdn/authors/_form.html.erb +29 -0
- data/app/views/phcscriptcdn/scriptcdn/authors/_formpatch.html.erb +29 -0
- data/app/views/phcscriptcdn/scriptcdn/authors/edit.html.erb +3 -0
- data/app/views/phcscriptcdn/scriptcdn/authors/index.html.erb +23 -0
- data/app/views/phcscriptcdn/scriptcdn/authors/new.html.erb +3 -0
- data/app/views/phcscriptcdn/scriptcdn/information/_form.html.erb +49 -0
- data/app/views/phcscriptcdn/scriptcdn/information/_formpatch.html.erb +49 -0
- data/app/views/phcscriptcdn/scriptcdn/information/edit.html.erb +3 -0
- data/app/views/phcscriptcdn/scriptcdn/information/index.html.erb +26 -0
- data/app/views/phcscriptcdn/scriptcdn/information/new.html.erb +3 -0
- data/app/views/phcscriptcdn/scriptcdn/information/show.html.erb +58 -0
- data/app/views/phcscriptcdn/scriptcdn/mains/_form.html.erb +13 -0
- data/app/views/phcscriptcdn/scriptcdn/mains/edit.html.erb +3 -0
- data/app/views/phcscriptcdn/scriptcdn/mains/index.html.erb +19 -0
- data/app/views/phcscriptcdn/scriptcdn/mains/new.html.erb +3 -0
- data/app/views/phcscriptcdn/scriptcdn/urls/_form.html.erb +17 -0
- data/app/views/phcscriptcdn/scriptcdn/urls/_formpatch.html.erb +17 -0
- data/app/views/phcscriptcdn/scriptcdn/urls/edit.html.erb +3 -0
- data/app/views/phcscriptcdn/scriptcdn/urls/index.html.erb +21 -0
- data/app/views/phcscriptcdn/scriptcdn/urls/new.html.erb +3 -0
- data/app/views/phcscriptcdn/scriptcdn/versions/_form.html.erb +13 -0
- data/app/views/phcscriptcdn/scriptcdn/versions/_formpatch.html.erb +13 -0
- data/app/views/phcscriptcdn/scriptcdn/versions/edit.html.erb +3 -0
- data/app/views/phcscriptcdn/scriptcdn/versions/index.html.erb +20 -0
- data/app/views/phcscriptcdn/scriptcdn/versions/new.html.erb +3 -0
- data/config/routes.rb +1 -2
- data/db/migrate/20160704004828_create_phcscriptcdn_scriptcdn_authors.rb +20 -0
- data/db/migrate/20160704005455_create_phcscriptcdn_scriptcdn_information.rb +27 -0
- data/db/migrate/20160704011123_create_phcscriptcdn_scriptcdn_urls.rb +19 -0
- data/db/migrate/20160704011452_create_phcscriptcdn_scriptcdn_versions.rb +15 -0
- data/db/migrate/20160704011727_create_phcscriptcdn_scriptcdn_mains.rb +11 -0
- data/lib/phcscriptcdn/engine.rb +3 -3
- data/lib/phcscriptcdn/version.rb +2 -2
- metadata +116 -166
- data/LICENSE +0 -238
- data/app/assets/stylesheets/phcscriptcdn/application.css.scss +0 -10
- data/app/assets/stylesheets/phcscriptcdn/custom.scss +0 -4
- data/app/assets/stylesheets/phcscriptcdn/scriptcdn/scripts.css +0 -4
- data/app/assets/stylesheets/phcscriptcdn/scriptcdn/scripturls.css +0 -4
- data/app/assets/stylesheets/phcscriptcdn/scriptcdn/scriptversions.css +0 -4
- data/app/controllers/phcscriptcdn/scriptcdn/scripts_controller.rb +0 -66
- data/app/controllers/phcscriptcdn/scriptcdn/scripturls_controller.rb +0 -88
- data/app/controllers/phcscriptcdn/scriptcdn/scriptversions_controller.rb +0 -62
- data/app/helpers/phcscriptcdn/scriptcdn/scripts_helper.rb +0 -4
- data/app/helpers/phcscriptcdn/scriptcdn/scripturls_helper.rb +0 -4
- data/app/helpers/phcscriptcdn/scriptcdn/scriptversions_helper.rb +0 -4
- data/app/models/phcscriptcdn/scriptcdn/script.rb +0 -15
- data/app/models/phcscriptcdn/scriptcdn/scripturl.rb +0 -14
- data/app/models/phcscriptcdn/scriptcdn/scriptversion.rb +0 -15
- data/app/views/phcscriptcdn/scriptcdn/scripts/_form.html.erb +0 -22
- data/app/views/phcscriptcdn/scriptcdn/scripts/edit.html.erb +0 -12
- data/app/views/phcscriptcdn/scriptcdn/scripts/index.html.erb +0 -36
- data/app/views/phcscriptcdn/scriptcdn/scripts/index_scriptlist.html.erb +0 -8
- data/app/views/phcscriptcdn/scriptcdn/scripts/new.html.erb +0 -11
- data/app/views/phcscriptcdn/scriptcdn/scripts/show.html.erb +0 -19
- data/app/views/phcscriptcdn/scriptcdn/scripts/show_scriptlisting.html.erb +0 -16
- data/app/views/phcscriptcdn/scriptcdn/scripturls/_form.html.erb +0 -22
- data/app/views/phcscriptcdn/scriptcdn/scripturls/_formpatch.html.erb +0 -22
- data/app/views/phcscriptcdn/scriptcdn/scripturls/edit.html.erb +0 -12
- data/app/views/phcscriptcdn/scriptcdn/scripturls/index.html.erb +0 -37
- data/app/views/phcscriptcdn/scriptcdn/scripturls/new.html.erb +0 -12
- data/app/views/phcscriptcdn/scriptcdn/scripturls/show.html.erb +0 -11
- data/app/views/phcscriptcdn/scriptcdn/scriptversions/_form.html.erb +0 -19
- data/app/views/phcscriptcdn/scriptcdn/scriptversions/edit.html.erb +0 -12
- data/app/views/phcscriptcdn/scriptcdn/scriptversions/index.html.erb +0 -37
- data/app/views/phcscriptcdn/scriptcdn/scriptversions/new.html.erb +0 -12
- data/db/migrate/20160222025658_create_phcscriptcdn_scriptcdn_scripts.rb +0 -12
- data/db/migrate/20160222030223_create_phcscriptcdn_scriptcdn_scriptversions.rb +0 -12
- data/db/migrate/20160222030446_create_phcscriptcdn_scriptcdn_scripturls.rb +0 -13
- data/lib/generators/phcscriptcdn/views_generator.rb +0 -59
@@ -1,36 +0,0 @@
|
|
1
|
-
<%= render 'phcnotifi/notifications' %>
|
2
|
-
|
3
|
-
<!-- Main Content -->
|
4
|
-
<div class="wrapper wrapper-content">
|
5
|
-
<div class="panel panel-default">
|
6
|
-
<div class="panel-heading">
|
7
|
-
<i class="fa fa-code"></i> Script CDN List
|
8
|
-
</div>
|
9
|
-
<div class="panel-body">
|
10
|
-
<table class="table table-bordered table-striped table-hover">
|
11
|
-
|
12
|
-
<thead>
|
13
|
-
<tr>
|
14
|
-
<th>Script Name</th>
|
15
|
-
<th></th>
|
16
|
-
</tr>
|
17
|
-
</thead>
|
18
|
-
|
19
|
-
<tbody>
|
20
|
-
<% @scriptcdn_scripts.each do |scriptcdn_script| %>
|
21
|
-
<tr>
|
22
|
-
<td><%= scriptcdn_script.scrptname %></td>
|
23
|
-
<td><div class="btn-group" role="group" aria-label="Script CDN">
|
24
|
-
<%= link_to 'Show', scriptcdn_script, class: "btn btn-w-m btn-primary btn-xs btn-phc-custom" %>
|
25
|
-
<%= link_to 'Edit', edit_scriptcdn_script_path(scriptcdn_script), class: "btn btn-w-m btn-primary btn-xs btn-phc-custom" %>
|
26
|
-
<%= link_to 'Destroy', scriptcdn_script, class: "btn btn-w-m btn-danger btn-xs btn-phc-custom", method: :delete, data: { confirm: 'Are you sure?' } %>
|
27
|
-
</div></td>
|
28
|
-
</tr>
|
29
|
-
<% end %>
|
30
|
-
</tbody>
|
31
|
-
|
32
|
-
</table>
|
33
|
-
<%= link_to 'New Script', new_scriptcdn_script_path, class: "btn btn-w-m btn-primary btn-phc-custom" %>
|
34
|
-
</div>
|
35
|
-
</div>
|
36
|
-
</div>
|
@@ -1,11 +0,0 @@
|
|
1
|
-
<%= render 'phcnotifi/notifications' %>
|
2
|
-
<div class="wrapper wrapper-content">
|
3
|
-
<div class="panel panel-default">
|
4
|
-
<div class="panel-heading">
|
5
|
-
<i class="fa fa-code"></i> Add a New Script
|
6
|
-
</div>
|
7
|
-
<div class="panel-body">
|
8
|
-
<%= render 'form' %>
|
9
|
-
</div>
|
10
|
-
</div>
|
11
|
-
</div>
|
@@ -1,19 +0,0 @@
|
|
1
|
-
<%= render 'phcnotifi/notifications' %>
|
2
|
-
|
3
|
-
<p>
|
4
|
-
<strong>Script Name:</strong>
|
5
|
-
<%= @scriptcdn_script.scrptname %>
|
6
|
-
</p>
|
7
|
-
|
8
|
-
<p>
|
9
|
-
<strong>Script Description:</strong>
|
10
|
-
<%= @scriptcdn_script.scrptdescription %>
|
11
|
-
</p>
|
12
|
-
|
13
|
-
<p>
|
14
|
-
<strong>Script Version:</strong>
|
15
|
-
<%= @scriptcdn_script.scriptversion_id %>
|
16
|
-
</p>
|
17
|
-
|
18
|
-
<%= link_to 'Edit', edit_scriptcdn_script_path(@scriptcdn_script) %> |
|
19
|
-
<%= link_to 'Back', scriptcdn_scripts_path %>
|
@@ -1,16 +0,0 @@
|
|
1
|
-
<%= render 'phcnotifi/notifications' %>
|
2
|
-
|
3
|
-
<p>
|
4
|
-
<strong>Script Name:</strong>
|
5
|
-
<%= @scriptcdn_script.scrptname %>
|
6
|
-
</p>
|
7
|
-
|
8
|
-
<p>
|
9
|
-
<strong>Script Description:</strong>
|
10
|
-
<%= @scriptcdn_script.scrptdescription %>
|
11
|
-
</p>
|
12
|
-
|
13
|
-
<p>
|
14
|
-
<strong>Script Version:</strong>
|
15
|
-
<%= @scriptcdn_script.scriptversion_id %>
|
16
|
-
</p>
|
@@ -1,22 +0,0 @@
|
|
1
|
-
<%= form_for([@scriptcdn_scripturl.scriptversion, @scriptcdn_scripturl], url: scriptcdn_scriptversion_scripturls_path) do |f| %>
|
2
|
-
|
3
|
-
<%= render 'phcnotifi/validations', :object => @scriptcdn_scripturl %>
|
4
|
-
|
5
|
-
<div class="field">
|
6
|
-
<label><%= f.label :scrpturlphc, "Script URL (AWS)" %></label>
|
7
|
-
<%= f.text_field :scrpturlphc, class: "form-control" %>
|
8
|
-
</div>
|
9
|
-
<div class="field">
|
10
|
-
<label><%= f.label :scrpturltype, "Script Type" %></label>
|
11
|
-
<%= f.select :scrpturltype, [['CSS','css'],['JS','js'],['font','Font']], class: "form-control" %>
|
12
|
-
</div>
|
13
|
-
<div class="form-group">
|
14
|
-
<label><%= f.label :scriptversion_id, "Script Version" %></label>
|
15
|
-
<%= collection_select(:scriptcdn_scripturl, :scriptversion_id, Phcscriptcdn::Scriptcdn::Scriptversion.order('scrptversion'), :id, :scrptversion, {}, {class: "form-control"}) %>
|
16
|
-
</div>
|
17
|
-
|
18
|
-
<div class="actions">
|
19
|
-
<%= f.submit "Submit", class: "btn btn-primary btn-sm"%>
|
20
|
-
</div>
|
21
|
-
|
22
|
-
<% end %>
|
@@ -1,22 +0,0 @@
|
|
1
|
-
<%= form_for([@scriptcdn_scripturl.scriptversion, @scriptcdn_scripturl], url: scriptcdn_scriptversion_scripturl_path, method: :patch) do |f| %>
|
2
|
-
|
3
|
-
<%= render 'phcnotifi/validations', :object => @scriptcdn_scripturl %>
|
4
|
-
|
5
|
-
<div class="field">
|
6
|
-
<label><%= f.label :scrpturlphc, "Script URL (AWS)" %></label>
|
7
|
-
<%= f.text_field :scrpturlphc, class: "form-control" %>
|
8
|
-
</div>
|
9
|
-
<div class="field">
|
10
|
-
<label><%= f.label :scrpturltype, "Script Type" %></label>
|
11
|
-
<%= f.select :scrpturltype, [['CSS','css'],['JS','js'],['font','Font']], class: "form-control" %>
|
12
|
-
</div>
|
13
|
-
<div class="form-group">
|
14
|
-
<label><%= f.label :scriptversion_id, "Script Version" %></label>
|
15
|
-
<%= collection_select(:scriptcdn_scripturl, :scriptversion_id, Phcscriptcdn::Scriptcdn::Scriptversion.order('scrptversion'), :id, :scrptversion, {}, {class: "form-control"}) %>
|
16
|
-
</div>
|
17
|
-
|
18
|
-
<div class="actions">
|
19
|
-
<%= f.submit "Submit", class: "btn btn-primary btn-sm"%>
|
20
|
-
</div>
|
21
|
-
|
22
|
-
<% end %>
|
@@ -1,12 +0,0 @@
|
|
1
|
-
<%= render 'phcnotifi/notifications' %>
|
2
|
-
|
3
|
-
<div class="wrapper wrapper-content">
|
4
|
-
<div class="panel panel-default">
|
5
|
-
<div class="panel-heading">
|
6
|
-
<i class="fa fa-code"></i> Edit Script URL
|
7
|
-
</div>
|
8
|
-
<div class="panel-body">
|
9
|
-
<%= render 'formpatch' %>
|
10
|
-
</div>
|
11
|
-
</div>
|
12
|
-
</div>
|
@@ -1,37 +0,0 @@
|
|
1
|
-
<%= render 'phcnotifi/notifications' %>
|
2
|
-
|
3
|
-
<!-- Main Content -->
|
4
|
-
<div class="wrapper wrapper-content">
|
5
|
-
<div class="panel panel-default">
|
6
|
-
<div class="panel-heading">
|
7
|
-
<h4><i class="fa fa-code"></i> Script URL List</h4> <p></p>
|
8
|
-
</div>
|
9
|
-
<div class="panel-body">
|
10
|
-
<table class="table table-bordered table-striped table-hover">
|
11
|
-
|
12
|
-
<thead>
|
13
|
-
<tr>
|
14
|
-
<th>Script URL</th>
|
15
|
-
<th>Script Type</th>
|
16
|
-
<th></th>
|
17
|
-
</tr>
|
18
|
-
</thead>
|
19
|
-
|
20
|
-
<tbody>
|
21
|
-
<% @scriptcdn_scripturls.each do |scriptcdn_scripturl| %>
|
22
|
-
<tr>
|
23
|
-
<td><%= scriptcdn_scripturl.scrpturlphc %></td>
|
24
|
-
<td><%= scriptcdn_scripturl.scrpturltype %></td>
|
25
|
-
<td><div class="btn-group" role="group" aria-label="Script CDN">
|
26
|
-
<%= link_to 'Edit', edit_scriptcdn_scriptversion_scripturl_path(scriptcdn_scripturl.scriptversion, scriptcdn_scripturl), class: "btn btn-w-m btn-primary btn-xs btn-phc-custom" %>
|
27
|
-
<%= link_to 'Destroy', scriptcdn_scriptversion_scripturl_path(scriptcdn_scripturl.scriptversion, scriptcdn_scripturl), class: "btn btn-w-m btn-danger btn-xs btn-phc-custom", method: :delete, data: { confirm: 'Are you sure?' } %>
|
28
|
-
</div></td>
|
29
|
-
</tr>
|
30
|
-
<% end %>
|
31
|
-
</tbody>
|
32
|
-
|
33
|
-
</table>
|
34
|
-
<%= link_to 'New Script URL', new_scriptcdn_scriptversion_scripturl_path, class: "btn btn-w-m btn-primary btn-phc-custom" %>
|
35
|
-
</div>
|
36
|
-
</div>
|
37
|
-
</div>
|
@@ -1,12 +0,0 @@
|
|
1
|
-
<%= render 'phcnotifi/notifications' %>
|
2
|
-
|
3
|
-
<div class="wrapper wrapper-content">
|
4
|
-
<div class="panel panel-default">
|
5
|
-
<div class="panel-heading">
|
6
|
-
<i class="fa fa-code"></i> Add a New Script URL
|
7
|
-
</div>
|
8
|
-
<div class="panel-body">
|
9
|
-
<%= render 'form' %>
|
10
|
-
</div>
|
11
|
-
</div>
|
12
|
-
</div>
|
@@ -1,19 +0,0 @@
|
|
1
|
-
<%= form_for(@scriptcdn_scriptversion) do |f| %>
|
2
|
-
|
3
|
-
<%= render 'phcnotifi/validations', :object => @scriptcdn_scriptversion %>
|
4
|
-
|
5
|
-
<div class="form-group">
|
6
|
-
<label><%= f.label :scrptversionpakname, "Version Pak Name" %></label>
|
7
|
-
<%= f.text_field :scrptversionpakname %>
|
8
|
-
</div>
|
9
|
-
|
10
|
-
<div class="form-group">
|
11
|
-
<label><%= f.label :scrptversion, "Script Versions" %></label>
|
12
|
-
<%= f.text_field :scrptversion %>
|
13
|
-
</div>
|
14
|
-
|
15
|
-
<div class="actions">
|
16
|
-
<%= f.submit "Submit", class: "btn btn-primary btn-sm" %>
|
17
|
-
</div>
|
18
|
-
|
19
|
-
<% end %>
|
@@ -1,12 +0,0 @@
|
|
1
|
-
<%= render 'phcnotifi/notifications' %>
|
2
|
-
|
3
|
-
<div class="wrapper wrapper-content">
|
4
|
-
<div class="panel panel-default">
|
5
|
-
<div class="panel-heading">
|
6
|
-
<i class="fa fa-code"></i> Edit Script Version Pak Information
|
7
|
-
</div>
|
8
|
-
<div class="panel-body">
|
9
|
-
<%= render 'form' %>
|
10
|
-
</div>
|
11
|
-
</div>
|
12
|
-
</div>
|
@@ -1,37 +0,0 @@
|
|
1
|
-
<%= render 'phcnotifi/notifications' %>
|
2
|
-
|
3
|
-
<!-- Main Content -->
|
4
|
-
<div class="wrapper wrapper-content">
|
5
|
-
<div class="panel panel-default">
|
6
|
-
<div class="panel-heading">
|
7
|
-
<i class="fa fa-code"></i> Script Version List
|
8
|
-
</div>
|
9
|
-
<div class="panel-body">
|
10
|
-
<table class="table table-bordered table-striped table-hover">
|
11
|
-
|
12
|
-
<thead>
|
13
|
-
<tr>
|
14
|
-
<th>Script Version Packages</th>
|
15
|
-
<th></th>
|
16
|
-
<th></th>
|
17
|
-
</tr>
|
18
|
-
</thead>
|
19
|
-
|
20
|
-
<tbody>
|
21
|
-
<% @scriptcdn_scriptversions.each do |scriptcdn_scriptversion| %>
|
22
|
-
<tr>
|
23
|
-
<td><%= scriptcdn_scriptversion.scrptversionpakname %></td>
|
24
|
-
<td><%= scriptcdn_scriptversion.scrptversion %></td>
|
25
|
-
<td>
|
26
|
-
<%= link_to 'Edit', edit_scriptcdn_scriptversion_path(scriptcdn_scriptversion), class: "btn btn-w-m btn-primary btn-xs btn-phc-custom" %>
|
27
|
-
<%= link_to 'Destroy', scriptcdn_scriptversion, class: "btn btn-w-m btn-primary btn-phc-custom btn-xs btn-phc-custom", method: :delete, data: { confirm: 'Are you sure?' } %>
|
28
|
-
</td>
|
29
|
-
</tr>
|
30
|
-
<% end %>
|
31
|
-
</tbody>
|
32
|
-
|
33
|
-
</table>
|
34
|
-
<%= link_to 'Add a New Version Option', new_scriptcdn_scriptversion_path, class: "btn btn-w-m btn-primary btn-phc-custom" %>
|
35
|
-
</div>
|
36
|
-
</div>
|
37
|
-
</div>
|
@@ -1,12 +0,0 @@
|
|
1
|
-
<%= render 'phcnotifi/notifications' %>
|
2
|
-
|
3
|
-
<div class="wrapper wrapper-content">
|
4
|
-
<div class="panel panel-default">
|
5
|
-
<div class="panel-heading">
|
6
|
-
<i class="fa fa-code"></i> Create a New Script Version Pak
|
7
|
-
</div>
|
8
|
-
<div class="panel-body">
|
9
|
-
<%= render 'form' %>
|
10
|
-
</div>
|
11
|
-
</div>
|
12
|
-
</div>
|
@@ -1,12 +0,0 @@
|
|
1
|
-
class CreatePhcscriptcdnScriptcdnScriptversions < ActiveRecord::Migration
|
2
|
-
def change
|
3
|
-
create_table :phcscriptcdn_scriptcdn_scriptversions do |t|
|
4
|
-
|
5
|
-
t.string :scrptversionpakname
|
6
|
-
t.string :scrptversion
|
7
|
-
|
8
|
-
t.timestamps null: false
|
9
|
-
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
@@ -1,13 +0,0 @@
|
|
1
|
-
class CreatePhcscriptcdnScriptcdnScripturls < ActiveRecord::Migration
|
2
|
-
def change
|
3
|
-
create_table :phcscriptcdn_scriptcdn_scripturls do |t|
|
4
|
-
|
5
|
-
t.string :scrpturlphc
|
6
|
-
t.string :scrpturltype
|
7
|
-
t.references :scriptversion, index: true
|
8
|
-
|
9
|
-
t.timestamps null: false
|
10
|
-
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
@@ -1,59 +0,0 @@
|
|
1
|
-
require 'rails/generators/base'
|
2
|
-
|
3
|
-
module Phcscriptcdn
|
4
|
-
|
5
|
-
module Generators
|
6
|
-
|
7
|
-
module ViewPathTemplates
|
8
|
-
extend ActiveSupport::Concern
|
9
|
-
|
10
|
-
included do
|
11
|
-
class_option :views, aliases: "-v", type: :array, desc: "Select specific view directories to generate (layouts, phcscriptcdn)"
|
12
|
-
|
13
|
-
public_task :copy_views
|
14
|
-
end
|
15
|
-
|
16
|
-
# module ClassMethods
|
17
|
-
# def hide!
|
18
|
-
# Rails::Generators.hide_namespace self.namespace
|
19
|
-
# end
|
20
|
-
# end
|
21
|
-
|
22
|
-
def copy_views
|
23
|
-
if options[:views]
|
24
|
-
options[:views].each do |directory|
|
25
|
-
view_directory directory.to_sym
|
26
|
-
end
|
27
|
-
else
|
28
|
-
view_directory :layouts
|
29
|
-
view_directory :phcscriptcdn
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
protected
|
34
|
-
|
35
|
-
def view_directory(name, _target_path = nil)
|
36
|
-
directory name.to_s, _target_path || "#{target_path}/#{name}" do |content|
|
37
|
-
content
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
def target_path
|
42
|
-
@target_path ||= "app/views"
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
class SharedViewsGenerator < Rails::Generators::Base
|
47
|
-
include ViewPathTemplates
|
48
|
-
source_root File.expand_path("../../../../app/views", __FILE__)
|
49
|
-
desc "Copies phcscriptcdn views to your application."
|
50
|
-
hide!
|
51
|
-
end
|
52
|
-
|
53
|
-
class ViewsGenerator < Rails::Generators::Base
|
54
|
-
desc "Copies phcscriptcdn views to your application."
|
55
|
-
invoke SharedViewsGenerator
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|
59
|
-
end
|