trusty-cms 4.2.1 → 4.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +91 -95
  3. data/LICENSE.md +1 -1
  4. data/app/helpers/admin/node_helper.rb +1 -1
  5. data/app/models/asset.rb +3 -3
  6. data/app/models/page.rb +3 -3
  7. data/app/models/standard_tags.rb +3 -3
  8. data/app/models/user.rb +1 -1
  9. data/config/database.mysql.yml +10 -2
  10. data/db/migrate/20210331134718_create_active_storage_tables.active_storage.rb +36 -0
  11. data/lib/generators/extension/templates/test_helper.rb +6 -8
  12. data/lib/login_system.rb +1 -1
  13. data/lib/trusty_cms.rb +1 -1
  14. data/spec/dummy/config/database.yml +6 -2
  15. data/trusty_cms.gemspec +2 -3
  16. data/vendor/extensions/clipped-extension/lib/asset_tags.rb +4 -4
  17. metadata +9 -174
  18. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/base.rb +0 -195
  19. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/check_box.rb +0 -65
  20. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/checkable.rb +0 -18
  21. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/collection_check_boxes.rb +0 -35
  22. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/collection_helpers.rb +0 -118
  23. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/collection_radio_buttons.rb +0 -30
  24. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/collection_select.rb +0 -30
  25. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/color_field.rb +0 -26
  26. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/date_field.rb +0 -14
  27. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/date_select.rb +0 -73
  28. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/datetime_field.rb +0 -31
  29. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/datetime_local_field.rb +0 -20
  30. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/datetime_select.rb +0 -10
  31. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/email_field.rb +0 -10
  32. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/file_field.rb +0 -10
  33. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/grouped_collection_select.rb +0 -31
  34. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/hidden_field.rb +0 -10
  35. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/label.rb +0 -80
  36. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/month_field.rb +0 -14
  37. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/number_field.rb +0 -20
  38. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/password_field.rb +0 -14
  39. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/placeholderable.rb +0 -24
  40. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/radio_button.rb +0 -32
  41. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/range_field.rb +0 -10
  42. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/search_field.rb +0 -27
  43. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/select.rb +0 -42
  44. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/tel_field.rb +0 -10
  45. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/text_area.rb +0 -24
  46. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/text_field.rb +0 -33
  47. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/time_field.rb +0 -14
  48. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/time_select.rb +0 -10
  49. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/time_zone_select.rb +0 -22
  50. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/translator.rb +0 -39
  51. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/url_field.rb +0 -10
  52. data/vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/week_field.rb +0 -14
@@ -2,6 +2,9 @@
2
2
  # This is only an example configuration. Please see the Rails
3
3
  # documentation for more details.
4
4
  #
5
+ defaults: &defaults
6
+ adapter: mysql
7
+ db: localhost
5
8
 
6
9
  development:
7
10
  adapter: mysql2
@@ -10,10 +13,15 @@ development:
10
13
  password:
11
14
 
12
15
  test: &TEST
13
- adapter: mysql2
16
+ adapter: mysql2
14
17
  database: trusty_cms_test
15
18
  username: root
16
- password:
19
+ password: ''
20
+ db: '127.0.0.1'
21
+ port: 0
22
+ encoding: utf8mb4
23
+ charset: utf8mb4
24
+ collation: utf8mb4_bin
17
25
 
18
26
  production:
19
27
  adapter: mysql2
@@ -0,0 +1,36 @@
1
+ # This migration comes from active_storage (originally 20170806125915)
2
+ class CreateActiveStorageTables < ActiveRecord::Migration[5.2]
3
+ def change
4
+ create_table :active_storage_blobs do |t|
5
+ t.string :key, null: false
6
+ t.string :filename, null: false
7
+ t.string :content_type
8
+ t.text :metadata
9
+ t.string :service_name, null: false
10
+ t.bigint :byte_size, null: false
11
+ t.string :checksum, null: false
12
+ t.datetime :created_at, null: false
13
+
14
+ t.index [ :key ], unique: true
15
+ end
16
+
17
+ create_table :active_storage_attachments do |t|
18
+ t.string :name, null: false
19
+ t.references :record, null: false, polymorphic: true, index: false
20
+ t.references :blob, null: false
21
+
22
+ t.datetime :created_at, null: false
23
+
24
+ t.index [ :record_type, :record_id, :name, :blob_id ], name: "index_active_storage_attachments_uniqueness", unique: true
25
+ t.foreign_key :active_storage_blobs, column: :blob_id
26
+ end
27
+
28
+ create_table :active_storage_variant_records do |t|
29
+ t.belongs_to :blob, null: false, index: false
30
+ t.string :variation_digest, null: false
31
+
32
+ t.index %i[ blob_id variation_digest ], name: "index_active_storage_variant_records_uniqueness", unique: true
33
+ t.foreign_key :active_storage_blobs, column: :blob_id
34
+ end
35
+ end
36
+ end
@@ -1,26 +1,24 @@
1
1
  require 'test/unit'
2
2
  # Load the environment
3
3
  unless defined? TRUSTY_CMS_ROOT
4
- ENV["Rails.env"] = "test"
4
+ ENV['Rails.env'] = 'test'
5
5
  case
6
- when ENV["RADIANT_ENV_FILE"]
7
- require ENV["RADIANT_ENV_FILE"]
6
+ when ENV['RADIANT_ENV_FILE']
7
+ require ENV['RADIANT_ENV_FILE']
8
8
  when File.dirname(__FILE__) =~ %r{vendor/trusty_cms/vendor/extensions}
9
- require "#{File.expand_path(File.dirname(__FILE__) + "/../../../../../../")}/config/environment"
9
+ require "#{File.expand_path(File.dirname(__FILE__) + '/../../../../../../')}/config/environment"
10
10
  else
11
- require "#{File.expand_path(File.dirname(__FILE__) + "/../../../../")}/config/environment"
11
+ require "#{File.expand_path(File.dirname(__FILE__) + '/../../../../')}/config/environment"
12
12
  end
13
13
  end
14
14
  require "#{TRUSTY_CMS_ROOT}/test/test_helper"
15
15
 
16
16
  class ActiveSupport::TestCase
17
-
18
17
  # Include a helper to make testing Radius tags easier
19
18
  test_helper :extension_tags
20
19
 
21
20
  # Add the fixture directory to the fixture path
22
- self.fixture_path << File.dirname(__FILE__) + "/fixtures"
21
+ self.fixture_path << File.dirname(__FILE__) + '/fixtures'
23
22
 
24
23
  # Add more helper methods to be used by all extension tests here...
25
-
26
24
  end
data/lib/login_system.rb CHANGED
@@ -116,7 +116,7 @@ module LoginSystem
116
116
  permissions = controller_permissions[action.to_s.intern]
117
117
  if allowed_roles = permissions[:when]
118
118
  allowed_roles = [allowed_roles].flatten
119
- user.present? ? allowed_roles.any? { |role| user.has_role?(role) } : false
119
+ user.present? ? allowed_roles.any? { |role| user.role?(role) } : false
120
120
  elsif condition_method = permissions[:if]
121
121
  instance.send(condition_method)
122
122
  else
data/lib/trusty_cms.rb CHANGED
@@ -2,6 +2,6 @@ TRUSTY_CMS_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..')) unle
2
2
 
3
3
  unless defined? TrustyCms::VERSION
4
4
  module TrustyCms
5
- VERSION = '4.2.1'.freeze
5
+ VERSION = '4.2.2'.freeze
6
6
  end
7
7
  end
@@ -14,8 +14,12 @@ test: &TEST
14
14
  adapter: mysql2
15
15
  database: trusty_cms_test
16
16
  username: root
17
- password:
18
- host: localhost
17
+ password: ''
18
+ host: '127.0.0.1'
19
+ port: 3306
20
+ encoding: utf8mb4
21
+ charset: utf8mb4
22
+ collation: utf8mb4_bin
19
23
 
20
24
  production:
21
25
  adapter: mysql2
data/trusty_cms.gemspec CHANGED
@@ -30,12 +30,11 @@ a general purpose content managment system--not merely a blogging engine.'
30
30
  s.add_dependency 'devise'
31
31
  s.add_dependency 'execjs', '~> 2.7'
32
32
  s.add_dependency 'haml'
33
- s.add_dependency 'haml-rails'
33
+ s.add_dependency 'haml-rails', '~> 2.0'
34
34
  s.add_dependency 'highline', '>= 1.7.8', '< 2.1.0'
35
35
  s.add_dependency 'kraken-io'
36
36
  s.add_dependency 'mini_racer'
37
37
  s.add_dependency 'mysql2'
38
- s.add_dependency 'paperclip', '> 5.2'
39
38
  s.add_dependency 'rack', '>= 2.0.1', '< 2.3.0'
40
39
  s.add_dependency 'rack-cache', '~> 1.7'
41
40
  s.add_dependency 'radius', '~> 0.7'
@@ -44,7 +43,7 @@ a general purpose content managment system--not merely a blogging engine.'
44
43
  s.add_dependency 'rdoc', '>= 5.1', '< 7.0'
45
44
  s.add_dependency 'RedCloth', '4.3.2'
46
45
  s.add_dependency 'roadie-rails'
47
- s.add_dependency 'sassc-rails'
46
+ s.add_dependency 'sass-rails'
48
47
  s.add_dependency 'stringex', '>= 2.7.1', '< 2.9.0'
49
48
  s.add_dependency 'tzinfo', '>= 1.2.3', '< 2.1.0'
50
49
  s.add_dependency 'uglifier', '>= 3.2', '< 5.0'
@@ -125,7 +125,7 @@ module AssetTags
125
125
  asset, options = asset_and_options(tag)
126
126
  raise TagError, "'container' attribute required" unless options['container']
127
127
  size = options['size'] ? options.delete('size') : 'icon'
128
- raise TagError, "asset #{tag.locals.asset.title} has no '#{size}' thumbnail" unless tag.locals.asset.has_style?(size)
128
+ raise TagError, "asset #{tag.locals.asset.title} has no '#{size}' thumbnail" unless tag.locals.asset.style?(size)
129
129
  container = options.delete('container')
130
130
  ((container.to_i - asset.height(size).to_i)/2).to_s
131
131
  end
@@ -152,7 +152,7 @@ module AssetTags
152
152
  tag 'asset:orientation' do |tag|
153
153
  asset, options = asset_and_options(tag)
154
154
  size = options['size'] ? options.delete('size') : 'original'
155
- raise TagError, "asset #{tag.locals.asset.title} has no '#{size}' thumbnail" unless tag.locals.asset.has_style?(size)
155
+ raise TagError, "asset #{tag.locals.asset.title} has no '#{size}' thumbnail" unless tag.locals.asset.style?(size)
156
156
  asset.orientation(size)
157
157
  end
158
158
 
@@ -162,7 +162,7 @@ module AssetTags
162
162
  tag 'asset:aspect' do |tag|
163
163
  asset, options = asset_and_options(tag)
164
164
  size = options['size'] ? options.delete('size') : 'original'
165
- raise TagError, "asset #{tag.locals.asset.title} has no '#{size}' thumbnail" unless tag.locals.asset.has_style?(size)
165
+ raise TagError, "asset #{tag.locals.asset.title} has no '#{size}' thumbnail" unless tag.locals.asset.style?(size)
166
166
  asset.aspect(size)
167
167
  end
168
168
 
@@ -217,7 +217,7 @@ module AssetTags
217
217
  tag 'asset:image' do |tag|
218
218
  tag.locals.asset, options = asset_and_options(tag)
219
219
  size = options.delete('size') || 'original'
220
- raise TagError, "asset #{tag.locals.asset.title} has no '#{size}' thumbnail" unless tag.locals.asset.has_style?(size)
220
+ raise TagError, "asset #{tag.locals.asset.title} has no '#{size}' thumbnail" unless tag.locals.asset.style?(size)
221
221
  options['alt'] ||= tag.locals.asset.title
222
222
  url = tag.locals.asset.thumbnail(size)
223
223
  ActionController::Base.helpers.image_tag(url, options)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trusty-cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.1
4
+ version: 4.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - TrustyCms CMS dev team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-20 00:00:00.000000000 Z
11
+ date: 2021-04-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: acts_as_list
@@ -136,16 +136,16 @@ dependencies:
136
136
  name: haml-rails
137
137
  requirement: !ruby/object:Gem::Requirement
138
138
  requirements:
139
- - - ">="
139
+ - - "~>"
140
140
  - !ruby/object:Gem::Version
141
- version: '0'
141
+ version: '2.0'
142
142
  type: :runtime
143
143
  prerelease: false
144
144
  version_requirements: !ruby/object:Gem::Requirement
145
145
  requirements:
146
- - - ">="
146
+ - - "~>"
147
147
  - !ruby/object:Gem::Version
148
- version: '0'
148
+ version: '2.0'
149
149
  - !ruby/object:Gem::Dependency
150
150
  name: highline
151
151
  requirement: !ruby/object:Gem::Requirement
@@ -208,20 +208,6 @@ dependencies:
208
208
  - - ">="
209
209
  - !ruby/object:Gem::Version
210
210
  version: '0'
211
- - !ruby/object:Gem::Dependency
212
- name: paperclip
213
- requirement: !ruby/object:Gem::Requirement
214
- requirements:
215
- - - ">"
216
- - !ruby/object:Gem::Version
217
- version: '5.2'
218
- type: :runtime
219
- prerelease: false
220
- version_requirements: !ruby/object:Gem::Requirement
221
- requirements:
222
- - - ">"
223
- - !ruby/object:Gem::Version
224
- version: '5.2'
225
211
  - !ruby/object:Gem::Dependency
226
212
  name: rack
227
213
  requirement: !ruby/object:Gem::Requirement
@@ -347,7 +333,7 @@ dependencies:
347
333
  - !ruby/object:Gem::Version
348
334
  version: '0'
349
335
  - !ruby/object:Gem::Dependency
350
- name: sassc-rails
336
+ name: sass-rails
351
337
  requirement: !ruby/object:Gem::Requirement
352
338
  requirements:
353
339
  - - ">="
@@ -896,6 +882,7 @@ files:
896
882
  - db/migrate/20160527141249_add_password_reset_to_users.rb
897
883
  - db/migrate/20161027141250_add_position_to_pages.rb
898
884
  - db/migrate/20200117141251_create_admin_users.rb
885
+ - db/migrate/20210331134718_create_active_storage_tables.active_storage.rb
899
886
  - db/schema.rb
900
887
  - lib/active_record_extensions/active_record_extensions.rb
901
888
  - lib/annotatable.rb
@@ -8555,158 +8542,6 @@ files:
8555
8542
  - spec/spec_helper.rb
8556
8543
  - spec/support/custom_actions.rb
8557
8544
  - trusty_cms.gemspec
8558
- - vendor/bundle/ruby/2.6.0/cache/RedCloth-4.3.2.gem
8559
- - vendor/bundle/ruby/2.6.0/cache/actioncable-6.0.3.4.gem
8560
- - vendor/bundle/ruby/2.6.0/cache/actionmailbox-6.0.3.4.gem
8561
- - vendor/bundle/ruby/2.6.0/cache/actionmailer-6.0.3.4.gem
8562
- - vendor/bundle/ruby/2.6.0/cache/actionpack-6.0.3.4.gem
8563
- - vendor/bundle/ruby/2.6.0/cache/actiontext-6.0.3.4.gem
8564
- - vendor/bundle/ruby/2.6.0/cache/actionview-6.0.3.4.gem
8565
- - vendor/bundle/ruby/2.6.0/cache/activejob-6.0.3.4.gem
8566
- - vendor/bundle/ruby/2.6.0/cache/activemodel-6.0.3.4.gem
8567
- - vendor/bundle/ruby/2.6.0/cache/activerecord-6.0.3.4.gem
8568
- - vendor/bundle/ruby/2.6.0/cache/activestorage-6.0.3.4.gem
8569
- - vendor/bundle/ruby/2.6.0/cache/activesupport-6.0.3.4.gem
8570
- - vendor/bundle/ruby/2.6.0/cache/acts_as_list-1.0.3.gem
8571
- - vendor/bundle/ruby/2.6.0/cache/acts_as_tree-2.8.0.gem
8572
- - vendor/bundle/ruby/2.6.0/cache/addressable-2.7.0.gem
8573
- - vendor/bundle/ruby/2.6.0/cache/bcrypt-3.1.16.gem
8574
- - vendor/bundle/ruby/2.6.0/cache/builder-3.2.4.gem
8575
- - vendor/bundle/ruby/2.6.0/cache/byebug-11.1.3.gem
8576
- - vendor/bundle/ruby/2.6.0/cache/capybara-3.34.0.gem
8577
- - vendor/bundle/ruby/2.6.0/cache/ckeditor-4.2.4.gem
8578
- - vendor/bundle/ruby/2.6.0/cache/climate_control-0.2.0.gem
8579
- - vendor/bundle/ruby/2.6.0/cache/cliver-0.3.2.gem
8580
- - vendor/bundle/ruby/2.6.0/cache/cocaine-0.6.0.gem
8581
- - vendor/bundle/ruby/2.6.0/cache/coderay-1.1.3.gem
8582
- - vendor/bundle/ruby/2.6.0/cache/concurrent-ruby-1.1.7.gem
8583
- - vendor/bundle/ruby/2.6.0/cache/crass-1.0.6.gem
8584
- - vendor/bundle/ruby/2.6.0/cache/css_parser-1.7.1.gem
8585
- - vendor/bundle/ruby/2.6.0/cache/database_cleaner-1.8.5.gem
8586
- - vendor/bundle/ruby/2.6.0/cache/delocalize-1.2.0.gem
8587
- - vendor/bundle/ruby/2.6.0/cache/devise-4.7.3.gem
8588
- - vendor/bundle/ruby/2.6.0/cache/diff-lcs-1.4.4.gem
8589
- - vendor/bundle/ruby/2.6.0/cache/docile-1.3.4.gem
8590
- - vendor/bundle/ruby/2.6.0/cache/erubi-1.10.0.gem
8591
- - vendor/bundle/ruby/2.6.0/cache/erubis-2.7.0.gem
8592
- - vendor/bundle/ruby/2.6.0/cache/execjs-2.7.0.gem
8593
- - vendor/bundle/ruby/2.6.0/cache/factory_bot-6.1.0.gem
8594
- - vendor/bundle/ruby/2.6.0/cache/factory_bot_rails-6.1.0.gem
8595
- - vendor/bundle/ruby/2.6.0/cache/ffi-1.14.2.gem
8596
- - vendor/bundle/ruby/2.6.0/cache/globalid-0.4.2.gem
8597
- - vendor/bundle/ruby/2.6.0/cache/haml-5.2.1.gem
8598
- - vendor/bundle/ruby/2.6.0/cache/haml-rails-1.0.0.gem
8599
- - vendor/bundle/ruby/2.6.0/cache/highline-2.0.3.gem
8600
- - vendor/bundle/ruby/2.6.0/cache/html2haml-2.2.0.gem
8601
- - vendor/bundle/ruby/2.6.0/cache/httparty-0.18.1.gem
8602
- - vendor/bundle/ruby/2.6.0/cache/i18n-1.8.7.gem
8603
- - vendor/bundle/ruby/2.6.0/cache/json-2.5.1.gem
8604
- - vendor/bundle/ruby/2.6.0/cache/kraken-io-0.1.3.gem
8605
- - vendor/bundle/ruby/2.6.0/cache/launchy-2.5.0.gem
8606
- - vendor/bundle/ruby/2.6.0/cache/libv8-8.4.255.0-x86_64-darwin-18.gem
8607
- - vendor/bundle/ruby/2.6.0/cache/loofah-2.8.0.gem
8608
- - vendor/bundle/ruby/2.6.0/cache/mail-2.7.1.gem
8609
- - vendor/bundle/ruby/2.6.0/cache/marcel-0.3.3.gem
8610
- - vendor/bundle/ruby/2.6.0/cache/method_source-1.0.0.gem
8611
- - vendor/bundle/ruby/2.6.0/cache/mime-types-3.3.1.gem
8612
- - vendor/bundle/ruby/2.6.0/cache/mime-types-data-3.2020.1104.gem
8613
- - vendor/bundle/ruby/2.6.0/cache/mimemagic-0.3.5.gem
8614
- - vendor/bundle/ruby/2.6.0/cache/mini_mime-1.0.2.gem
8615
- - vendor/bundle/ruby/2.6.0/cache/mini_portile2-2.5.0.gem
8616
- - vendor/bundle/ruby/2.6.0/cache/mini_racer-0.3.1.gem
8617
- - vendor/bundle/ruby/2.6.0/cache/minitest-5.14.3.gem
8618
- - vendor/bundle/ruby/2.6.0/cache/multi_xml-0.6.0.gem
8619
- - vendor/bundle/ruby/2.6.0/cache/multipart-post-2.1.1.gem
8620
- - vendor/bundle/ruby/2.6.0/cache/mysql2-0.5.3.gem
8621
- - vendor/bundle/ruby/2.6.0/cache/nio4r-2.5.4.gem
8622
- - vendor/bundle/ruby/2.6.0/cache/nokogiri-1.11.1-x86_64-darwin.gem
8623
- - vendor/bundle/ruby/2.6.0/cache/orm_adapter-0.5.0.gem
8624
- - vendor/bundle/ruby/2.6.0/cache/paperclip-6.1.0.gem
8625
- - vendor/bundle/ruby/2.6.0/cache/poltergeist-1.18.1.gem
8626
- - vendor/bundle/ruby/2.6.0/cache/pry-0.13.1.gem
8627
- - vendor/bundle/ruby/2.6.0/cache/pry-byebug-3.9.0.gem
8628
- - vendor/bundle/ruby/2.6.0/cache/public_suffix-4.0.6.gem
8629
- - vendor/bundle/ruby/2.6.0/cache/racc-1.5.2.gem
8630
- - vendor/bundle/ruby/2.6.0/cache/rack-2.2.3.gem
8631
- - vendor/bundle/ruby/2.6.0/cache/rack-cache-1.12.1.gem
8632
- - vendor/bundle/ruby/2.6.0/cache/rack-test-1.1.0.gem
8633
- - vendor/bundle/ruby/2.6.0/cache/radius-0.7.5.gem
8634
- - vendor/bundle/ruby/2.6.0/cache/rails-6.0.3.4.gem
8635
- - vendor/bundle/ruby/2.6.0/cache/rails-dom-testing-2.0.3.gem
8636
- - vendor/bundle/ruby/2.6.0/cache/rails-html-sanitizer-1.3.0.gem
8637
- - vendor/bundle/ruby/2.6.0/cache/rails-observers-0.1.5.gem
8638
- - vendor/bundle/ruby/2.6.0/cache/railties-6.0.3.4.gem
8639
- - vendor/bundle/ruby/2.6.0/cache/rake-13.0.3.gem
8640
- - vendor/bundle/ruby/2.6.0/cache/rdoc-6.3.0.gem
8641
- - vendor/bundle/ruby/2.6.0/cache/regexp_parser-1.8.2.gem
8642
- - vendor/bundle/ruby/2.6.0/cache/responders-3.0.1.gem
8643
- - vendor/bundle/ruby/2.6.0/cache/roadie-4.0.0.gem
8644
- - vendor/bundle/ruby/2.6.0/cache/roadie-rails-2.2.0.gem
8645
- - vendor/bundle/ruby/2.6.0/cache/rspec-core-3.10.1.gem
8646
- - vendor/bundle/ruby/2.6.0/cache/rspec-expectations-3.10.1.gem
8647
- - vendor/bundle/ruby/2.6.0/cache/rspec-mocks-3.10.1.gem
8648
- - vendor/bundle/ruby/2.6.0/cache/rspec-rails-4.0.2.gem
8649
- - vendor/bundle/ruby/2.6.0/cache/rspec-support-3.10.1.gem
8650
- - vendor/bundle/ruby/2.6.0/cache/ruby_parser-3.15.1.gem
8651
- - vendor/bundle/ruby/2.6.0/cache/sassc-2.4.0.gem
8652
- - vendor/bundle/ruby/2.6.0/cache/sassc-rails-2.1.2.gem
8653
- - vendor/bundle/ruby/2.6.0/cache/sexp_processor-4.15.2.gem
8654
- - vendor/bundle/ruby/2.6.0/cache/simplecov-0.21.2.gem
8655
- - vendor/bundle/ruby/2.6.0/cache/simplecov-html-0.12.3.gem
8656
- - vendor/bundle/ruby/2.6.0/cache/simplecov_json_formatter-0.1.2.gem
8657
- - vendor/bundle/ruby/2.6.0/cache/sprockets-4.0.2.gem
8658
- - vendor/bundle/ruby/2.6.0/cache/sprockets-rails-3.2.2.gem
8659
- - vendor/bundle/ruby/2.6.0/cache/stringex-2.8.5.gem
8660
- - vendor/bundle/ruby/2.6.0/cache/temple-0.8.2.gem
8661
- - vendor/bundle/ruby/2.6.0/cache/terrapin-0.6.0.gem
8662
- - vendor/bundle/ruby/2.6.0/cache/thor-1.0.1.gem
8663
- - vendor/bundle/ruby/2.6.0/cache/thread_safe-0.3.6.gem
8664
- - vendor/bundle/ruby/2.6.0/cache/tilt-2.0.10.gem
8665
- - vendor/bundle/ruby/2.6.0/cache/trustygems-0.2.1.gem
8666
- - vendor/bundle/ruby/2.6.0/cache/tzinfo-1.2.9.gem
8667
- - vendor/bundle/ruby/2.6.0/cache/uglifier-4.2.0.gem
8668
- - vendor/bundle/ruby/2.6.0/cache/uuidtools-2.2.0.gem
8669
- - vendor/bundle/ruby/2.6.0/cache/warden-1.2.9.gem
8670
- - vendor/bundle/ruby/2.6.0/cache/websocket-driver-0.7.3.gem
8671
- - vendor/bundle/ruby/2.6.0/cache/websocket-extensions-0.1.5.gem
8672
- - vendor/bundle/ruby/2.6.0/cache/will_paginate-3.3.0.gem
8673
- - vendor/bundle/ruby/2.6.0/cache/xpath-3.2.0.gem
8674
- - vendor/bundle/ruby/2.6.0/cache/zeitwerk-2.4.2.gem
8675
- - vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/base.rb
8676
- - vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/check_box.rb
8677
- - vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/checkable.rb
8678
- - vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/collection_check_boxes.rb
8679
- - vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/collection_helpers.rb
8680
- - vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/collection_radio_buttons.rb
8681
- - vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/collection_select.rb
8682
- - vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/color_field.rb
8683
- - vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/date_field.rb
8684
- - vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/date_select.rb
8685
- - vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/datetime_field.rb
8686
- - vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/datetime_local_field.rb
8687
- - vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/datetime_select.rb
8688
- - vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/email_field.rb
8689
- - vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/file_field.rb
8690
- - vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/grouped_collection_select.rb
8691
- - vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/hidden_field.rb
8692
- - vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/label.rb
8693
- - vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/month_field.rb
8694
- - vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/number_field.rb
8695
- - vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/password_field.rb
8696
- - vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/placeholderable.rb
8697
- - vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/radio_button.rb
8698
- - vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/range_field.rb
8699
- - vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/search_field.rb
8700
- - vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/select.rb
8701
- - vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/tel_field.rb
8702
- - vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/text_area.rb
8703
- - vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/text_field.rb
8704
- - vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/time_field.rb
8705
- - vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/time_select.rb
8706
- - vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/time_zone_select.rb
8707
- - vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/translator.rb
8708
- - vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/url_field.rb
8709
- - vendor/bundle/ruby/2.6.0/gems/actionview-6.0.3.4/lib/action_view/helpers/tags/week_field.rb
8710
8545
  - vendor/extensions/clipped-extension/clipped_extension.rb
8711
8546
  - vendor/extensions/clipped-extension/lib/admin/assets_helper.rb
8712
8547
  - vendor/extensions/clipped-extension/lib/asset_tags.rb
@@ -8801,7 +8636,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
8801
8636
  - !ruby/object:Gem::Version
8802
8637
  version: 1.3.1
8803
8638
  requirements: []
8804
- rubygems_version: 3.0.3
8639
+ rubygems_version: 3.0.9
8805
8640
  signing_key:
8806
8641
  specification_version: 4
8807
8642
  summary: A no-fluff content management system designed for small teams.
@@ -1,195 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module ActionView
4
- module Helpers
5
- module Tags # :nodoc:
6
- class Base # :nodoc:
7
- include Helpers::ActiveModelInstanceTag, Helpers::TagHelper, Helpers::FormTagHelper
8
- include FormOptionsHelper
9
-
10
- attr_reader :object
11
-
12
- def initialize(object_name, method_name, template_object, options = {})
13
- @object_name, @method_name = object_name.to_s.dup, method_name.to_s.dup
14
- @template_object = template_object
15
-
16
- @object_name.sub!(/\[\]$/, "") || @object_name.sub!(/\[\]\]$/, "]")
17
- @object = retrieve_object(options.delete(:object))
18
- @skip_default_ids = options.delete(:skip_default_ids)
19
- @allow_method_names_outside_object = options.delete(:allow_method_names_outside_object)
20
- @options = options
21
-
22
- if Regexp.last_match
23
- @generate_indexed_names = true
24
- @auto_index = retrieve_autoindex(Regexp.last_match.pre_match)
25
- else
26
- @generate_indexed_names = false
27
- @auto_index = nil
28
- end
29
- end
30
-
31
- # This is what child classes implement.
32
- def render
33
- raise NotImplementedError, "Subclasses must implement a render method"
34
- end
35
-
36
- private
37
- def value
38
- if @allow_method_names_outside_object
39
- object.public_send @method_name if object && object.respond_to?(@method_name)
40
- else
41
- object.public_send @method_name if object
42
- end
43
- end
44
-
45
- def value_before_type_cast
46
- unless object.nil?
47
- method_before_type_cast = @method_name + "_before_type_cast"
48
-
49
- if value_came_from_user? && object.respond_to?(method_before_type_cast)
50
- object.public_send(method_before_type_cast)
51
- else
52
- value
53
- end
54
- end
55
- end
56
-
57
- def value_came_from_user?
58
- method_name = "#{@method_name}_came_from_user?"
59
- !object.respond_to?(method_name) || object.public_send(method_name)
60
- end
61
-
62
- def retrieve_object(object)
63
- if object
64
- object
65
- elsif @template_object.instance_variable_defined?("@#{@object_name}")
66
- @template_object.instance_variable_get("@#{@object_name}")
67
- end
68
- rescue NameError
69
- # As @object_name may contain the nested syntax (item[subobject]) we need to fallback to nil.
70
- nil
71
- end
72
-
73
- def retrieve_autoindex(pre_match)
74
- object = self.object || @template_object.instance_variable_get("@#{pre_match}")
75
- if object && object.respond_to?(:to_param)
76
- object.to_param
77
- else
78
- raise ArgumentError, "object[] naming but object param and @object var don't exist or don't respond to to_param: #{object.inspect}"
79
- end
80
- end
81
-
82
- def add_default_name_and_id_for_value(tag_value, options)
83
- if tag_value.nil?
84
- add_default_name_and_id(options)
85
- else
86
- specified_id = options["id"]
87
- add_default_name_and_id(options)
88
-
89
- if specified_id.blank? && options["id"].present?
90
- options["id"] += "_#{sanitized_value(tag_value)}"
91
- end
92
- end
93
- end
94
-
95
- def add_default_name_and_id(options)
96
- index = name_and_id_index(options)
97
- options["name"] = options.fetch("name") { tag_name(options["multiple"], index) }
98
-
99
- if generate_ids?
100
- options["id"] = options.fetch("id") { tag_id(index) }
101
- if namespace = options.delete("namespace")
102
- options["id"] = options["id"] ? "#{namespace}_#{options['id']}" : namespace
103
- end
104
- end
105
- end
106
-
107
- def tag_name(multiple = false, index = nil)
108
- # a little duplication to construct less strings
109
- case
110
- when @object_name.empty?
111
- "#{sanitized_method_name}#{multiple ? "[]" : ""}"
112
- when index
113
- "#{@object_name}[#{index}][#{sanitized_method_name}]#{multiple ? "[]" : ""}"
114
- else
115
- "#{@object_name}[#{sanitized_method_name}]#{multiple ? "[]" : ""}"
116
- end
117
- end
118
-
119
- def tag_id(index = nil)
120
- # a little duplication to construct less strings
121
- case
122
- when @object_name.empty?
123
- sanitized_method_name.dup
124
- when index
125
- "#{sanitized_object_name}_#{index}_#{sanitized_method_name}"
126
- else
127
- "#{sanitized_object_name}_#{sanitized_method_name}"
128
- end
129
- end
130
-
131
- def sanitized_object_name
132
- @sanitized_object_name ||= @object_name.gsub(/\]\[|[^-a-zA-Z0-9:.]/, "_").sub(/_$/, "")
133
- end
134
-
135
- def sanitized_method_name
136
- @sanitized_method_name ||= @method_name.sub(/\?$/, "")
137
- end
138
-
139
- def sanitized_value(value)
140
- value.to_s.gsub(/[\s\.]/, "_").gsub(/[^-[[:word:]]]/, "").downcase
141
- end
142
-
143
- def select_content_tag(option_tags, options, html_options)
144
- html_options = html_options.stringify_keys
145
- add_default_name_and_id(html_options)
146
-
147
- if placeholder_required?(html_options)
148
- raise ArgumentError, "include_blank cannot be false for a required field." if options[:include_blank] == false
149
- options[:include_blank] ||= true unless options[:prompt]
150
- end
151
-
152
- value = options.fetch(:selected) { value() }
153
- select = content_tag("select", add_options(option_tags, options, value), html_options)
154
-
155
- if html_options["multiple"] && options.fetch(:include_hidden, true)
156
- tag("input", disabled: html_options["disabled"], name: html_options["name"], type: "hidden", value: "") + select
157
- else
158
- select
159
- end
160
- end
161
-
162
- def placeholder_required?(html_options)
163
- # See https://html.spec.whatwg.org/multipage/forms.html#attr-select-required
164
- html_options["required"] && !html_options["multiple"] && html_options.fetch("size", 1).to_i == 1
165
- end
166
-
167
- def add_options(option_tags, options, value = nil)
168
- if options[:include_blank]
169
- option_tags = tag_builder.content_tag_string("option", options[:include_blank].kind_of?(String) ? options[:include_blank] : nil, value: "") + "\n" + option_tags
170
- end
171
- if value.blank? && options[:prompt]
172
- tag_options = { value: "" }.tap do |prompt_opts|
173
- prompt_opts[:disabled] = true if options[:disabled] == ""
174
- prompt_opts[:selected] = true if options[:selected] == ""
175
- end
176
- option_tags = tag_builder.content_tag_string("option", prompt_text(options[:prompt]), tag_options) + "\n" + option_tags
177
- end
178
- option_tags
179
- end
180
-
181
- def name_and_id_index(options)
182
- if options.key?("index")
183
- options.delete("index") || ""
184
- elsif @generate_indexed_names
185
- @auto_index || ""
186
- end
187
- end
188
-
189
- def generate_ids?
190
- !@skip_default_ids
191
- end
192
- end
193
- end
194
- end
195
- end