phcscriptcdnpro 7.1.3 → 8.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5e315641cca05c0c803826af6ff68a948683cb52
4
- data.tar.gz: 319fd9126e79a096742779872c24a62020729597
3
+ metadata.gz: 8d836c55bad29a634b0d636ad60b37a0b8d3756b
4
+ data.tar.gz: 9da475a7d7915a36ce2320edcfd15fa9b164a194
5
5
  SHA512:
6
- metadata.gz: a29958e7601cc43fcdeacde4073129df4e58e2b68066bcda69c4b00c87b6a4ec60dc7c95fd60b4c62528d48ea5ce959805f0706cb43f118474185851f3fdbb27
7
- data.tar.gz: 5039760636ea87471574d9c5c7945b83c412e6c33cca9c683c994ea022988c9ed42fbf6e23b5deacb215b472e71785c9ac7df71737d64c66582af0663837a73e
6
+ metadata.gz: 8b70ca8d179219990c8ac18cd5a581fe38967335b47ecae7240ceceb564520b57db0a6852bbf7a8d4b56594177dc89ceecf980ab7ee6b7441868ddeba6222671
7
+ data.tar.gz: e51aff6cb2a4c3a12b196a03a15407490b8cce46d24c06866001a00917951f474e57d9db9f03076048666afa316cfa37a5e46e1ab4054ab24a0db6e8452386a4
@@ -15,6 +15,7 @@ module Phcscriptcdnpro
15
15
 
16
16
  # DETAILS - Script Author
17
17
  def show
18
+ @script_authors = Script::Author.friendly.find(params[:id])
18
19
  end
19
20
 
20
21
  # NEW - Script Author
@@ -63,12 +64,12 @@ module Phcscriptcdnpro
63
64
 
64
65
  # Common Callbacks
65
66
  def set_script_author
66
- @script_author = Script::Author.find(params[:id])
67
+ @script_author = Script::Author.friendly.find(params[:id])
67
68
  end
68
69
 
69
70
  # Whitelist
70
71
  def script_author_params
71
- params.require(:script_author).permit(:authorfirstname, :authorlastname, :authorwebsite, :authorgithub, :authortwitter, :user_id, :user_name, :membership_id, :oganization_id)
72
+ params.require(:script_author).permit(:authorfirstname, :authorlastname, :authorwebsite, :authorgithub, :authortwitter, :slug, :user_id, :user_name, :membership_id, :oganization_id)
72
73
  end
73
74
 
74
75
  end
@@ -15,6 +15,7 @@ module Phcscriptcdnpro
15
15
 
16
16
  # DETAILS - Script Extension
17
17
  def show
18
+ @script_extensions = Script::Extension.friendly.find(params[:id])
18
19
  end
19
20
 
20
21
  # NEW - Script Extension
@@ -63,12 +64,12 @@ module Phcscriptcdnpro
63
64
 
64
65
  # Common Callbacks
65
66
  def set_script_extension
66
- @script_extension = Script::Extension.find(params[:id])
67
+ @script_extension = Script::Extension.friendly.find(params[:id])
67
68
  end
68
69
 
69
70
  # Whitelists
70
71
  def script_extension_params
71
- params.require(:script_extension).permit(:scriptextensionname, :scriptextensiondes, :scriptextension, :user_id, :user_name, :membership_id, :oganization_id)
72
+ params.require(:script_extension).permit(:scriptextensionname, :scriptextensiondes, :scriptextension, :user_id, :user_name, :slug, :membership_id, :oganization_id)
72
73
  end
73
74
 
74
75
  end
@@ -15,6 +15,7 @@ module Phcscriptcdnpro
15
15
 
16
16
  # DETAILS - Script Licences
17
17
  def show
18
+ @script_licences = Script::Licence.friendly.find(params[:id])
18
19
  end
19
20
 
20
21
  # NEW - Script Licences
@@ -63,12 +64,12 @@ module Phcscriptcdnpro
63
64
 
64
65
  # Common Callbacks
65
66
  def set_script_licence
66
- @script_licence = Script::Licence.find(params[:id])
67
+ @script_licence = Script::Licence.friendly.find(params[:id])
67
68
  end
68
69
 
69
70
  # Whitelists
70
71
  def script_licence_params
71
- params.require(:script_licence).permit(:lcncname, :lcncdescription, :lcncdescript, :lcnccomgpl, :lcncarvlfsf, :lcncarvlosi, :lcncarvlcopyfree, :lcncarvldebian, :lcncarvlfedora, :user_id, :user_name, :membership_id, :oganization_id)
72
+ params.require(:script_licence).permit(:lcncname, :lcncdescription, :lcncdescript, :lcnccomgpl, :lcncarvlfsf, :lcncarvlosi, :lcncarvlcopyfree, :lcncarvldebian, :lcncarvlfedora, :user_id, :slug, :user_name, :membership_id, :oganization_id)
72
73
  end
73
74
 
74
75
  end
@@ -15,6 +15,7 @@ module Phcscriptcdnpro
15
15
 
16
16
  # DETAILS - Script Listings
17
17
  def show
18
+ @script_listings = Script::Listing.friendly.find(params[:id])
18
19
  end
19
20
 
20
21
  # NEW - Script Listings
@@ -63,12 +64,12 @@ module Phcscriptcdnpro
63
64
 
64
65
  # Common Callbacks
65
66
  def set_script_listing
66
- @script_listing = Script::Listing.find(params[:id])
67
+ @script_listing = Script::Listing.friendly.find(params[:id])
67
68
  end
68
69
 
69
70
  # Whitelist
70
71
  def script_listing_params
71
- params.require(:script_listing).permit(:scripttitle, :scriptdescription, :descriptionsource, :scriptwebsite, :scripttwitter, :scriptgithub, :scriptinitialrelease, :scriptlastestrelease, :scriptbetarelease, :scriptstatus, :user_id, :user_name, :membership_id, :oganization_id, :version_id, :author_id, :licence_id)
72
+ params.require(:script_listing).permit(:scripttitle, :scriptdescription, :descriptionsource, :scriptwebsite, :scripttwitter, :scriptgithub, :scriptinitialrelease, :scriptlastestrelease, :scriptbetarelease, :scriptstatus, :slug, :user_id, :user_name, :membership_id, :oganization_id, :version_id, :author_id, :licence_id)
72
73
  end
73
74
 
74
75
  end
@@ -17,7 +17,7 @@ module Phcscriptcdnpro
17
17
  # DETAILED PROFILE - Script Authors
18
18
  def show
19
19
  script_listing = Script::Listing.find(params[:listing_id])
20
- @script_url = script_listing.urls.find(params[:id])
20
+ @script_url = script_listing.urls.friendly.find(params[:id])
21
21
  end
22
22
 
23
23
  # NEW - Script Athors
@@ -72,12 +72,12 @@ module Phcscriptcdnpro
72
72
 
73
73
  # Common Callbacks
74
74
  def set_script_url
75
- @script_url = Script::Url.find(params[:id])
75
+ @script_url = Script::Url.friendly.find(params[:id])
76
76
  end
77
77
 
78
78
  # Whitelists
79
79
  def script_url_params
80
- params.require(:script_url).permit(:scripturl, :scripturlrelease, :scripturlcdnupdate, :user_id, :user_name, :membership_id, :oganization_id, :listing_id, :version_id, :extension_id)
80
+ params.require(:script_url).permit(:scripturl, :scripturlrelease, :scripturlcdnupdate. :slug, :user_id, :user_name, :membership_id, :oganization_id, :listing_id, :version_id, :extension_id)
81
81
  end
82
82
 
83
83
  end
@@ -15,6 +15,7 @@ module Phcscriptcdnpro
15
15
 
16
16
  # DETAILS - Script Versions
17
17
  def show
18
+ @script_versions = Script::Version.friendly.find(params[:id])
18
19
  end
19
20
 
20
21
  # NEW - Script Versions
@@ -63,12 +64,12 @@ module Phcscriptcdnpro
63
64
 
64
65
  # Common Callbacks
65
66
  def set_script_version
66
- @script_version = Script::Version.find(params[:id])
67
+ @script_version = Script::Version.friendly.find(params[:id])
67
68
  end
68
69
 
69
70
  # Only allow a trusted parameter "white list" through.
70
71
  def script_version_params
71
- params.require(:script_version).permit(:scriptversion, :user_id, :user_name, :membership_id, :oganization_id)
72
+ params.require(:script_version).permit(:scriptversion, :user_id, :user_name, :slug, :membership_id, :oganization_id)
72
73
  end
73
74
 
74
75
  end
@@ -0,0 +1,92 @@
1
+ # FriendlyId Global Configuration
2
+ #
3
+ # Use this to set up shared configuration options for your entire application.
4
+ # Any of the configuration options shown here can also be applied to single
5
+ # models by passing arguments to the `friendly_id` class method or defining
6
+ # methods in your model.
7
+ #
8
+ # To learn more, check out the guide:
9
+ #
10
+ # http://norman.github.io/friendly_id/file.Guide.html
11
+
12
+ FriendlyId.defaults do |config|
13
+ # ## Reserved Words
14
+ #
15
+ # Some words could conflict with Rails's routes when used as slugs, or are
16
+ # undesirable to allow as slugs. Edit this list as needed for your app.
17
+ config.use :reserved
18
+
19
+ config.reserved_words = %w(new edit index session login logout users admin
20
+ stylesheets assets javascripts images)
21
+
22
+ # ## Friendly Finders
23
+ #
24
+ # Uncomment this to use friendly finders in all models. By default, if
25
+ # you wish to find a record by its friendly id, you must do:
26
+ #
27
+ # MyModel.friendly.find('foo')
28
+ #
29
+ # If you uncomment this, you can do:
30
+ #
31
+ # MyModel.find('foo')
32
+ #
33
+ # This is significantly more convenient but may not be appropriate for
34
+ # all applications, so you must explicity opt-in to this behavior. You can
35
+ # always also configure it on a per-model basis if you prefer.
36
+ #
37
+ # Something else to consider is that using the :finders addon boosts
38
+ # performance because it will avoid Rails-internal code that makes runtime
39
+ # calls to `Module.extend`.
40
+ #
41
+ # config.use :finders
42
+ #
43
+ # ## Slugs
44
+ #
45
+ # Most applications will use the :slugged module everywhere. If you wish
46
+ # to do so, uncomment the following line.
47
+ #
48
+ # config.use :slugged
49
+ #
50
+ # By default, FriendlyId's :slugged addon expects the slug column to be named
51
+ # 'slug', but you can change it if you wish.
52
+ #
53
+ # config.slug_column = 'slug'
54
+ #
55
+ # When FriendlyId can not generate a unique ID from your base method, it appends
56
+ # a UUID, separated by a single dash. You can configure the character used as the
57
+ # separator. If you're upgrading from FriendlyId 4, you may wish to replace this
58
+ # with two dashes.
59
+ #
60
+ # config.sequence_separator = '-'
61
+ #
62
+ # Note that you must use the :slugged addon **prior** to the line which
63
+ # configures the sequence separator, or else FriendlyId will raise an undefined
64
+ # method error.
65
+ #
66
+ # ## Tips and Tricks
67
+ #
68
+ # ### Controlling when slugs are generated
69
+ #
70
+ # As of FriendlyId 5.0, new slugs are generated only when the slug field is
71
+ # nil, but if you're using a column as your base method can change this
72
+ # behavior by overriding the `should_generate_new_friendly_id?` method that
73
+ # FriendlyId adds to your model. The change below makes FriendlyId 5.0 behave
74
+ # more like 4.0.
75
+ #
76
+ # config.use Module.new {
77
+ # def should_generate_new_friendly_id?
78
+ # slug.blank? || <your_column_name_here>_changed?
79
+ # end
80
+ # }
81
+ #
82
+ # FriendlyId uses Rails's `parameterize` method to generate slugs, but for
83
+ # languages that don't use the Roman alphabet, that's not usually sufficient.
84
+ # Here we use the Babosa library to transliterate Russian Cyrillic slugs to
85
+ # ASCII. If you use this, don't forget to add "babosa" to your Gemfile.
86
+ #
87
+ # config.use Module.new {
88
+ # def normalize_friendly_id(text)
89
+ # text.to_slug.normalize! :transliterations => [:russian, :latin]
90
+ # end
91
+ # }
92
+ end
@@ -17,6 +17,8 @@ class CreatePhcscriptcdnproScriptListings < ActiveRecord::Migration[5.0]
17
17
  t.date :scriptlastestreleasecdn
18
18
 
19
19
  t.string :scriptstatus
20
+
21
+ t.string :slug
20
22
 
21
23
  t.string :user_id
22
24
  t.string :user_name
@@ -9,6 +9,8 @@ class CreatePhcscriptcdnproScriptAuthors < ActiveRecord::Migration[5.0]
9
9
  t.string :authorwebsite
10
10
  t.string :authorgithub
11
11
  t.string :authortwitter
12
+
13
+ t.string :slug
12
14
 
13
15
  t.string :user_id
14
16
  t.string :user_name
@@ -6,6 +6,8 @@ class CreatePhcscriptcdnproScriptExtensions < ActiveRecord::Migration[5.0]
6
6
  t.string :scriptextensionname
7
7
  t.text :scriptextensiondes
8
8
  t.string :scriptextension
9
+
10
+ t.string :slug
9
11
 
10
12
  t.string :user_id
11
13
  t.string :user_name
@@ -13,6 +13,8 @@ class CreatePhcscriptcdnproScriptLicences < ActiveRecord::Migration[5.0]
13
13
  t.string :lcncarvlcopyfree
14
14
  t.string :lcncarvldebian
15
15
  t.string :lcncarvlfedora
16
+
17
+ t.string :slug
16
18
 
17
19
  t.string :user_id
18
20
  t.string :user_name
@@ -10,6 +10,8 @@ class CreatePhcscriptcdnproScriptUrls < ActiveRecord::Migration[5.0]
10
10
  t.references :listing
11
11
  t.references :version
12
12
  t.references :extension
13
+
14
+ t.string :slug
13
15
 
14
16
  t.string :user_id
15
17
  t.string :user_name
@@ -7,6 +7,9 @@ class CreatePhcscriptcdnproScriptVersions < ActiveRecord::Migration[5.0]
7
7
 
8
8
  t.string :user_id
9
9
  t.string :user_name
10
+
11
+ t.string :slug
12
+
10
13
  t.string :membership_id
11
14
  t.string :oganization_id
12
15
 
@@ -0,0 +1,15 @@
1
+ class CreateFriendlyIdSlugs < ActiveRecord::Migration
2
+ def change
3
+ create_table :friendly_id_slugs do |t|
4
+ t.string :slug, :null => false
5
+ t.integer :sluggable_id, :null => false
6
+ t.string :sluggable_type, :limit => 50
7
+ t.string :scope
8
+ t.datetime :created_at
9
+ end
10
+ add_index :friendly_id_slugs, :sluggable_id
11
+ add_index :friendly_id_slugs, [:slug, :sluggable_type], length: { slug: 140, sluggable_type: 50 }
12
+ add_index :friendly_id_slugs, [:slug, :sluggable_type, :scope], length: { slug: 70, sluggable_type: 50, scope: 70 }, unique: true
13
+ add_index :friendly_id_slugs, :sluggable_type
14
+ end
15
+ end
@@ -21,6 +21,9 @@ module Phcscriptcdnpro
21
21
  require 'country_select'
22
22
  require 'gravtastic'
23
23
 
24
+ # URLS
25
+ require 'friendly_id'
26
+
24
27
  # API Dependencies
25
28
  require 'rabl'
26
29
  require 'oj'
@@ -1,3 +1,3 @@
1
1
  module Phcscriptcdnpro
2
- VERSION = "7.1.3"
2
+ VERSION = "8.0.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phcscriptcdnpro
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.1.3
4
+ version: 8.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - BradPotts
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-14 00:00:00.000000000 Z
11
+ date: 2017-04-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -64,6 +64,40 @@ dependencies:
64
64
  - - ">="
65
65
  - !ruby/object:Gem::Version
66
66
  version: 7.0.1
67
+ - !ruby/object:Gem::Dependency
68
+ name: authrocket
69
+ requirement: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - "~>"
72
+ - !ruby/object:Gem::Version
73
+ version: '2.2'
74
+ type: :runtime
75
+ prerelease: false
76
+ version_requirements: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - "~>"
79
+ - !ruby/object:Gem::Version
80
+ version: '2.2'
81
+ - !ruby/object:Gem::Dependency
82
+ name: phcaccountspro
83
+ requirement: !ruby/object:Gem::Requirement
84
+ requirements:
85
+ - - "~>"
86
+ - !ruby/object:Gem::Version
87
+ version: '5.1'
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: 5.1.2
91
+ type: :runtime
92
+ prerelease: false
93
+ version_requirements: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - "~>"
96
+ - !ruby/object:Gem::Version
97
+ version: '5.1'
98
+ - - ">="
99
+ - !ruby/object:Gem::Version
100
+ version: 5.1.2
67
101
  - !ruby/object:Gem::Dependency
68
102
  name: jquery-rails
69
103
  requirement: !ruby/object:Gem::Requirement
@@ -315,65 +349,65 @@ dependencies:
315
349
  - !ruby/object:Gem::Version
316
350
  version: '1.7'
317
351
  - !ruby/object:Gem::Dependency
318
- name: phcadmin3
352
+ name: phctitleseo
319
353
  requirement: !ruby/object:Gem::Requirement
320
354
  requirements:
321
355
  - - "~>"
322
356
  - !ruby/object:Gem::Version
323
- version: '2.1'
357
+ version: '5.1'
324
358
  - - ">="
325
359
  - !ruby/object:Gem::Version
326
- version: 2.1.2
360
+ version: 5.1.2
327
361
  type: :runtime
328
362
  prerelease: false
329
363
  version_requirements: !ruby/object:Gem::Requirement
330
364
  requirements:
331
365
  - - "~>"
332
366
  - !ruby/object:Gem::Version
333
- version: '2.1'
367
+ version: '5.1'
334
368
  - - ">="
335
369
  - !ruby/object:Gem::Version
336
- version: 2.1.2
370
+ version: 5.1.2
337
371
  - !ruby/object:Gem::Dependency
338
- name: phctitleseo
372
+ name: phcnotifi
339
373
  requirement: !ruby/object:Gem::Requirement
340
374
  requirements:
341
375
  - - "~>"
342
376
  - !ruby/object:Gem::Version
343
- version: '5.1'
377
+ version: '4.1'
344
378
  - - ">="
345
379
  - !ruby/object:Gem::Version
346
- version: 5.1.2
380
+ version: 4.1.2
347
381
  type: :runtime
348
382
  prerelease: false
349
383
  version_requirements: !ruby/object:Gem::Requirement
350
384
  requirements:
351
385
  - - "~>"
352
386
  - !ruby/object:Gem::Version
353
- version: '5.1'
387
+ version: '4.1'
354
388
  - - ">="
355
389
  - !ruby/object:Gem::Version
356
- version: 5.1.2
390
+ version: 4.1.2
357
391
  - !ruby/object:Gem::Dependency
358
- name: phcnotifi
392
+ name: phcpresspro
359
393
  requirement: !ruby/object:Gem::Requirement
360
394
  requirements:
361
395
  - - "~>"
362
396
  - !ruby/object:Gem::Version
363
- version: '4.1'
397
+ version: '9.1'
364
398
  - - ">="
365
399
  - !ruby/object:Gem::Version
366
- version: 4.1.2
400
+ version: 9.1.3
367
401
  type: :runtime
368
402
  prerelease: false
369
403
  version_requirements: !ruby/object:Gem::Requirement
370
404
  requirements:
371
405
  - - "~>"
372
406
  - !ruby/object:Gem::Version
373
- version: '4.1'
407
+ version: '9.1'
374
408
  - - ">="
375
409
  - !ruby/object:Gem::Version
376
- version: 4.1.2
410
+ version: 9.1.3
377
411
  - !ruby/object:Gem::Dependency
378
412
  name: phctheme1
379
413
  requirement: !ruby/object:Gem::Requirement
@@ -415,25 +449,45 @@ dependencies:
415
449
  - !ruby/object:Gem::Version
416
450
  version: 5.1.2
417
451
  - !ruby/object:Gem::Dependency
418
- name: phcpresspro
452
+ name: phcadmin3
419
453
  requirement: !ruby/object:Gem::Requirement
420
454
  requirements:
421
455
  - - "~>"
422
456
  - !ruby/object:Gem::Version
423
- version: '9.1'
457
+ version: '2.1'
424
458
  - - ">="
425
459
  - !ruby/object:Gem::Version
426
- version: 9.1.3
460
+ version: 2.1.2
427
461
  type: :runtime
428
462
  prerelease: false
429
463
  version_requirements: !ruby/object:Gem::Requirement
430
464
  requirements:
431
465
  - - "~>"
432
466
  - !ruby/object:Gem::Version
433
- version: '9.1'
467
+ version: '2.1'
434
468
  - - ">="
435
469
  - !ruby/object:Gem::Version
436
- version: 9.1.3
470
+ version: 2.1.2
471
+ - !ruby/object:Gem::Dependency
472
+ name: friendly_id
473
+ requirement: !ruby/object:Gem::Requirement
474
+ requirements:
475
+ - - "~>"
476
+ - !ruby/object:Gem::Version
477
+ version: '5.2'
478
+ - - ">="
479
+ - !ruby/object:Gem::Version
480
+ version: 5.2.1
481
+ type: :runtime
482
+ prerelease: false
483
+ version_requirements: !ruby/object:Gem::Requirement
484
+ requirements:
485
+ - - "~>"
486
+ - !ruby/object:Gem::Version
487
+ version: '5.2'
488
+ - - ">="
489
+ - !ruby/object:Gem::Version
490
+ version: 5.2.1
437
491
  - !ruby/object:Gem::Dependency
438
492
  name: rspec-rails
439
493
  requirement: !ruby/object:Gem::Requirement
@@ -669,6 +723,7 @@ files:
669
723
  - app/views/phcscriptcdnpro/script/versions/index.html.erb
670
724
  - app/views/phcscriptcdnpro/script/versions/new.html.erb
671
725
  - app/views/phcscriptcdnpro/script/versions/show.html.erb
726
+ - config/initializers/friendly_id.rb
672
727
  - config/routes.rb
673
728
  - db/migrate/20160821183652_create_phcscriptcdnpro_script_listings.rb
674
729
  - db/migrate/20160821183714_create_phcscriptcdnpro_script_authors.rb
@@ -676,6 +731,7 @@ files:
676
731
  - db/migrate/20160821183805_create_phcscriptcdnpro_script_licences.rb
677
732
  - db/migrate/20160821183830_create_phcscriptcdnpro_script_urls.rb
678
733
  - db/migrate/20160821183946_create_phcscriptcdnpro_script_versions.rb
734
+ - db/migrate/20170423035208_create_friendly_id_slugs.rb
679
735
  - lib/phcscriptcdnpro.rb
680
736
  - lib/phcscriptcdnpro/engine.rb
681
737
  - lib/phcscriptcdnpro/version.rb