trusty-cms 4.3.1 → 5.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (201) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +2 -1
  3. data/Gemfile.lock +99 -87
  4. data/app/assets/config/trusty-cms-manifest.js +6 -0
  5. data/app/assets/javascripts/ckeditor/config.js +2 -2
  6. data/app/assets/stylesheets/admin/partials/_content.scss +1 -0
  7. data/app/controllers/admin/assets_controller.rb +6 -2
  8. data/app/models/asset.rb +39 -48
  9. data/app/models/asset_type.rb +6 -2
  10. data/app/views/admin/assets/edit.html.haml +5 -3
  11. data/config/database.yml +2 -2
  12. data/config/locales/en.yml +1 -0
  13. data/coverage/index.html +1 -1
  14. data/lib/trusty_cms/deprecation.rb +13 -0
  15. data/lib/trusty_cms.rb +1 -1
  16. data/node_modules/path-parse/index.js +17 -35
  17. data/node_modules/path-parse/package.json +1 -1
  18. data/node_modules/postcss/CHANGELOG.md +27 -0
  19. data/node_modules/postcss/README.md +21 -0
  20. data/node_modules/postcss/lib/at-rule.js +2 -4
  21. data/node_modules/postcss/lib/comment.js +2 -4
  22. data/node_modules/postcss/lib/container.js +27 -122
  23. data/node_modules/postcss/lib/css-syntax-error.js +5 -7
  24. data/node_modules/postcss/lib/declaration.js +2 -4
  25. data/node_modules/postcss/lib/input.js +3 -5
  26. data/node_modules/postcss/lib/lazy-result.js +10 -17
  27. data/node_modules/postcss/lib/map-generator.js +10 -17
  28. data/node_modules/postcss/lib/node.js +2 -4
  29. data/node_modules/postcss/lib/parser.js +2 -4
  30. data/node_modules/postcss/lib/postcss.d.ts +25 -19
  31. data/node_modules/postcss/lib/previous-map.js +17 -6
  32. data/node_modules/postcss/lib/processor.js +16 -15
  33. data/node_modules/postcss/lib/result.js +2 -4
  34. data/node_modules/postcss/lib/root.js +10 -17
  35. data/node_modules/postcss/lib/rule.js +2 -4
  36. data/node_modules/postcss/lib/stringifier.js +2 -4
  37. data/node_modules/postcss/lib/warning.js +2 -4
  38. data/node_modules/postcss/package.json +16 -12
  39. data/spec/dummy/log/test.log +542 -443
  40. data/spec/dummy/tmp/cache/747/A70/TrustyCms%3A%3AConfig +0 -0
  41. data/spec/dummy/tmp/cache/85C/FA0/TrustyCms.cache_mtime +1 -1
  42. data/trusty_cms.gemspec +4 -2
  43. data/vendor/extensions/clipped-extension/lib/clipped/engine.rb +1 -1
  44. data/yarn.lock +6 -6
  45. metadata +69 -345
  46. data/app/assets/config/trusty-cms/manifest.js +0 -7
  47. data/config/initializers/interpolation.rb +0 -6
  48. data/node_modules/path-parse/test.js +0 -77
  49. data/node_modules/postcss/docs/api/assets/scripts.min.js +0 -8
  50. data/node_modules/postcss/docs/api/assets/styles.min.css +0 -1
  51. data/node_modules/postcss/docs/api/index.html +0 -22716
  52. data/spec/dummy/log/development.log +0 -158
  53. data/spec/dummy/node_modules/jquery/AUTHORS.txt +0 -327
  54. data/spec/dummy/node_modules/jquery/LICENSE.txt +0 -20
  55. data/spec/dummy/node_modules/jquery/README.md +0 -62
  56. data/spec/dummy/node_modules/jquery/bower.json +0 -14
  57. data/spec/dummy/node_modules/jquery/dist/jquery.js +0 -10872
  58. data/spec/dummy/node_modules/jquery/dist/jquery.min.js +0 -2
  59. data/spec/dummy/node_modules/jquery/dist/jquery.min.map +0 -1
  60. data/spec/dummy/node_modules/jquery/dist/jquery.slim.js +0 -8777
  61. data/spec/dummy/node_modules/jquery/dist/jquery.slim.min.js +0 -2
  62. data/spec/dummy/node_modules/jquery/dist/jquery.slim.min.map +0 -1
  63. data/spec/dummy/node_modules/jquery/external/sizzle/LICENSE.txt +0 -36
  64. data/spec/dummy/node_modules/jquery/external/sizzle/dist/sizzle.js +0 -2478
  65. data/spec/dummy/node_modules/jquery/external/sizzle/dist/sizzle.min.js +0 -3
  66. data/spec/dummy/node_modules/jquery/external/sizzle/dist/sizzle.min.map +0 -1
  67. data/spec/dummy/node_modules/jquery/package.json +0 -117
  68. data/spec/dummy/node_modules/jquery/src/ajax/jsonp.js +0 -103
  69. data/spec/dummy/node_modules/jquery/src/ajax/load.js +0 -77
  70. data/spec/dummy/node_modules/jquery/src/ajax/script.js +0 -74
  71. data/spec/dummy/node_modules/jquery/src/ajax/var/location.js +0 -5
  72. data/spec/dummy/node_modules/jquery/src/ajax/var/nonce.js +0 -5
  73. data/spec/dummy/node_modules/jquery/src/ajax/var/rquery.js +0 -5
  74. data/spec/dummy/node_modules/jquery/src/ajax/xhr.js +0 -170
  75. data/spec/dummy/node_modules/jquery/src/ajax.js +0 -873
  76. data/spec/dummy/node_modules/jquery/src/attributes/attr.js +0 -141
  77. data/spec/dummy/node_modules/jquery/src/attributes/classes.js +0 -186
  78. data/spec/dummy/node_modules/jquery/src/attributes/prop.js +0 -143
  79. data/spec/dummy/node_modules/jquery/src/attributes/support.js +0 -33
  80. data/spec/dummy/node_modules/jquery/src/attributes/val.js +0 -191
  81. data/spec/dummy/node_modules/jquery/src/attributes.js +0 -13
  82. data/spec/dummy/node_modules/jquery/src/callbacks.js +0 -236
  83. data/spec/dummy/node_modules/jquery/src/core/DOMEval.js +0 -43
  84. data/spec/dummy/node_modules/jquery/src/core/access.js +0 -72
  85. data/spec/dummy/node_modules/jquery/src/core/camelCase.js +0 -23
  86. data/spec/dummy/node_modules/jquery/src/core/init.js +0 -129
  87. data/spec/dummy/node_modules/jquery/src/core/isAttached.js +0 -26
  88. data/spec/dummy/node_modules/jquery/src/core/nodeName.js +0 -13
  89. data/spec/dummy/node_modules/jquery/src/core/parseHTML.js +0 -65
  90. data/spec/dummy/node_modules/jquery/src/core/parseXML.js +0 -30
  91. data/spec/dummy/node_modules/jquery/src/core/ready-no-deferred.js +0 -97
  92. data/spec/dummy/node_modules/jquery/src/core/ready.js +0 -86
  93. data/spec/dummy/node_modules/jquery/src/core/readyException.js +0 -13
  94. data/spec/dummy/node_modules/jquery/src/core/stripAndCollapse.js +0 -14
  95. data/spec/dummy/node_modules/jquery/src/core/support.js +0 -20
  96. data/spec/dummy/node_modules/jquery/src/core/toType.js +0 -20
  97. data/spec/dummy/node_modules/jquery/src/core/var/rsingleTag.js +0 -7
  98. data/spec/dummy/node_modules/jquery/src/core.js +0 -400
  99. data/spec/dummy/node_modules/jquery/src/css/addGetHookIf.js +0 -26
  100. data/spec/dummy/node_modules/jquery/src/css/adjustCSS.js +0 -74
  101. data/spec/dummy/node_modules/jquery/src/css/curCSS.js +0 -65
  102. data/spec/dummy/node_modules/jquery/src/css/finalPropName.js +0 -42
  103. data/spec/dummy/node_modules/jquery/src/css/hiddenVisibleSelectors.js +0 -15
  104. data/spec/dummy/node_modules/jquery/src/css/showHide.js +0 -105
  105. data/spec/dummy/node_modules/jquery/src/css/support.js +0 -133
  106. data/spec/dummy/node_modules/jquery/src/css/var/cssExpand.js +0 -5
  107. data/spec/dummy/node_modules/jquery/src/css/var/getStyles.js +0 -17
  108. data/spec/dummy/node_modules/jquery/src/css/var/isHiddenWithinTree.js +0 -34
  109. data/spec/dummy/node_modules/jquery/src/css/var/rboxStyle.js +0 -7
  110. data/spec/dummy/node_modules/jquery/src/css/var/rnumnonpx.js +0 -7
  111. data/spec/dummy/node_modules/jquery/src/css/var/swap.js +0 -26
  112. data/spec/dummy/node_modules/jquery/src/css.js +0 -494
  113. data/spec/dummy/node_modules/jquery/src/data/Data.js +0 -162
  114. data/spec/dummy/node_modules/jquery/src/data/var/acceptData.js +0 -19
  115. data/spec/dummy/node_modules/jquery/src/data/var/dataPriv.js +0 -7
  116. data/spec/dummy/node_modules/jquery/src/data/var/dataUser.js +0 -7
  117. data/spec/dummy/node_modules/jquery/src/data.js +0 -180
  118. data/spec/dummy/node_modules/jquery/src/deferred/exceptionHook.js +0 -21
  119. data/spec/dummy/node_modules/jquery/src/deferred.js +0 -399
  120. data/spec/dummy/node_modules/jquery/src/deprecated/ajax-event-alias.js +0 -22
  121. data/spec/dummy/node_modules/jquery/src/deprecated/event.js +0 -48
  122. data/spec/dummy/node_modules/jquery/src/deprecated.js +0 -87
  123. data/spec/dummy/node_modules/jquery/src/dimensions.js +0 -57
  124. data/spec/dummy/node_modules/jquery/src/effects/Tween.js +0 -125
  125. data/spec/dummy/node_modules/jquery/src/effects/animatedSelector.js +0 -15
  126. data/spec/dummy/node_modules/jquery/src/effects.js +0 -701
  127. data/spec/dummy/node_modules/jquery/src/event/focusin.js +0 -58
  128. data/spec/dummy/node_modules/jquery/src/event/support.js +0 -11
  129. data/spec/dummy/node_modules/jquery/src/event/trigger.js +0 -201
  130. data/spec/dummy/node_modules/jquery/src/event.js +0 -892
  131. data/spec/dummy/node_modules/jquery/src/exports/amd.js +0 -26
  132. data/spec/dummy/node_modules/jquery/src/exports/global.js +0 -34
  133. data/spec/dummy/node_modules/jquery/src/jquery.js +0 -41
  134. data/spec/dummy/node_modules/jquery/src/manipulation/_evalUrl.js +0 -32
  135. data/spec/dummy/node_modules/jquery/src/manipulation/buildFragment.js +0 -106
  136. data/spec/dummy/node_modules/jquery/src/manipulation/getAll.js +0 -32
  137. data/spec/dummy/node_modules/jquery/src/manipulation/setGlobalEval.js +0 -22
  138. data/spec/dummy/node_modules/jquery/src/manipulation/support.js +0 -41
  139. data/spec/dummy/node_modules/jquery/src/manipulation/var/rscriptType.js +0 -5
  140. data/spec/dummy/node_modules/jquery/src/manipulation/var/rtagName.js +0 -8
  141. data/spec/dummy/node_modules/jquery/src/manipulation/wrapMap.js +0 -30
  142. data/spec/dummy/node_modules/jquery/src/manipulation.js +0 -480
  143. data/spec/dummy/node_modules/jquery/src/offset.js +0 -238
  144. data/spec/dummy/node_modules/jquery/src/queue/delay.js +0 -24
  145. data/spec/dummy/node_modules/jquery/src/queue.js +0 -145
  146. data/spec/dummy/node_modules/jquery/src/selector-native.js +0 -241
  147. data/spec/dummy/node_modules/jquery/src/selector-sizzle.js +0 -19
  148. data/spec/dummy/node_modules/jquery/src/selector.js +0 -3
  149. data/spec/dummy/node_modules/jquery/src/serialize.js +0 -136
  150. data/spec/dummy/node_modules/jquery/src/traversing/findFilter.js +0 -97
  151. data/spec/dummy/node_modules/jquery/src/traversing/var/dir.js +0 -22
  152. data/spec/dummy/node_modules/jquery/src/traversing/var/rneedsContext.js +0 -8
  153. data/spec/dummy/node_modules/jquery/src/traversing/var/siblings.js +0 -17
  154. data/spec/dummy/node_modules/jquery/src/traversing.js +0 -198
  155. data/spec/dummy/node_modules/jquery/src/var/ObjectFunctionString.js +0 -7
  156. data/spec/dummy/node_modules/jquery/src/var/arr.js +0 -5
  157. data/spec/dummy/node_modules/jquery/src/var/class2type.js +0 -6
  158. data/spec/dummy/node_modules/jquery/src/var/document.js +0 -5
  159. data/spec/dummy/node_modules/jquery/src/var/documentElement.js +0 -7
  160. data/spec/dummy/node_modules/jquery/src/var/flat.js +0 -16
  161. data/spec/dummy/node_modules/jquery/src/var/fnToString.js +0 -7
  162. data/spec/dummy/node_modules/jquery/src/var/getProto.js +0 -5
  163. data/spec/dummy/node_modules/jquery/src/var/hasOwn.js +0 -7
  164. data/spec/dummy/node_modules/jquery/src/var/indexOf.js +0 -7
  165. data/spec/dummy/node_modules/jquery/src/var/isFunction.js +0 -13
  166. data/spec/dummy/node_modules/jquery/src/var/isWindow.js +0 -8
  167. data/spec/dummy/node_modules/jquery/src/var/pnum.js +0 -5
  168. data/spec/dummy/node_modules/jquery/src/var/push.js +0 -7
  169. data/spec/dummy/node_modules/jquery/src/var/rcheckableType.js +0 -5
  170. data/spec/dummy/node_modules/jquery/src/var/rcssNum.js +0 -9
  171. data/spec/dummy/node_modules/jquery/src/var/rnothtmlwhite.js +0 -8
  172. data/spec/dummy/node_modules/jquery/src/var/slice.js +0 -7
  173. data/spec/dummy/node_modules/jquery/src/var/support.js +0 -6
  174. data/spec/dummy/node_modules/jquery/src/var/toString.js +0 -7
  175. data/spec/dummy/node_modules/jquery/src/wrap.js +0 -78
  176. data/spec/dummy/node_modules/jquery-ui-bundle/AUTHORS.txt +0 -333
  177. data/spec/dummy/node_modules/jquery-ui-bundle/LICENSE.txt +0 -43
  178. data/spec/dummy/node_modules/jquery-ui-bundle/external/jquery/jquery.js +0 -11008
  179. data/spec/dummy/node_modules/jquery-ui-bundle/images/ui-icons_444444_256x240.png +0 -0
  180. data/spec/dummy/node_modules/jquery-ui-bundle/images/ui-icons_555555_256x240.png +0 -0
  181. data/spec/dummy/node_modules/jquery-ui-bundle/images/ui-icons_777620_256x240.png +0 -0
  182. data/spec/dummy/node_modules/jquery-ui-bundle/images/ui-icons_777777_256x240.png +0 -0
  183. data/spec/dummy/node_modules/jquery-ui-bundle/images/ui-icons_cc0000_256x240.png +0 -0
  184. data/spec/dummy/node_modules/jquery-ui-bundle/images/ui-icons_ffffff_256x240.png +0 -0
  185. data/spec/dummy/node_modules/jquery-ui-bundle/index.html +0 -559
  186. data/spec/dummy/node_modules/jquery-ui-bundle/jquery-ui.css +0 -1312
  187. data/spec/dummy/node_modules/jquery-ui-bundle/jquery-ui.js +0 -18706
  188. data/spec/dummy/node_modules/jquery-ui-bundle/jquery-ui.min.css +0 -7
  189. data/spec/dummy/node_modules/jquery-ui-bundle/jquery-ui.min.js +0 -13
  190. data/spec/dummy/node_modules/jquery-ui-bundle/jquery-ui.structure.css +0 -886
  191. data/spec/dummy/node_modules/jquery-ui-bundle/jquery-ui.structure.min.css +0 -5
  192. data/spec/dummy/node_modules/jquery-ui-bundle/jquery-ui.theme.css +0 -443
  193. data/spec/dummy/node_modules/jquery-ui-bundle/jquery-ui.theme.min.css +0 -5
  194. data/spec/dummy/node_modules/jquery-ui-bundle/package.json +0 -33
  195. data/spec/dummy/node_modules/jquery-ujs/CONTRIBUTING.md +0 -109
  196. data/spec/dummy/node_modules/jquery-ujs/MIT-LICENSE +0 -20
  197. data/spec/dummy/node_modules/jquery-ujs/README.md +0 -86
  198. data/spec/dummy/node_modules/jquery-ujs/RELEASE.md +0 -23
  199. data/spec/dummy/node_modules/jquery-ujs/bower.json +0 -19
  200. data/spec/dummy/node_modules/jquery-ujs/package.json +0 -26
  201. data/spec/dummy/node_modules/jquery-ujs/src/rails.js +0 -555
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ae1333499a79a83bd6a8a0a46673e1b5ef54e589b3e7cf0ec3447d473396b769
4
- data.tar.gz: 3ca5980f13834a3cdfce5ca580a39259394345ca1c034580b09aa0c0df9662ee
3
+ metadata.gz: f0fc7adbc55517598d8eb365fe2518df17faab505fece52ec5dcb3374459b45c
4
+ data.tar.gz: 9de9c0c248cbe41a2c4b55592c9a3412f5cc50279e680de125c7ced575c0a0ac
5
5
  SHA512:
6
- metadata.gz: 0e0d9815b5f9d3a5cdf4bfe06e23e6f8a018639c3871aae42e38e3f97623f0f469d5740bad25edf621b7277b8acdeb095de3fef5e475ea69e7643952cd91048b
7
- data.tar.gz: 96869827969eedee8b76da2dee964ed2308bbbf5e58c0010a274970559bb890d5be2a6c2d431d5212aac1a6bd140c86c2beacb8978303eaebb09798e9970f5c7
6
+ metadata.gz: 737f21b157db73ad8763d0bcb2576e8f6ff9ddff69d3be98713aae5903c71432e48db36df8f16b4def7e226f18d2f8fe4d4905ef80623f5638a4b245f2ebbe26
7
+ data.tar.gz: f472cff774a907272ac9a4a60a9a73ac9ef081fe4cd29411abf55238e1ef62640384f00a5be9c7f7fe68e968b05c9fa680438614378501e0cc7e7eebb50e4581
data/Gemfile CHANGED
@@ -12,10 +12,11 @@ gem 'trustygems', '~> 0.2.0'
12
12
  gemspec
13
13
 
14
14
  group :development, :test do
15
+ gem 'activestorage-validator'
15
16
  gem 'acts_as_list'
16
17
  gem 'database_cleaner'
17
18
  gem 'factory_bot_rails', '6.2.0'
18
- gem 'kt-paperclip', '~> 7.0.0'
19
+ gem 'file_validators'
19
20
  gem 'launchy', '~> 2.5.0'
20
21
  gem 'mysql2'
21
22
  gem 'poltergeist', '~> 1.18.1'
data/Gemfile.lock CHANGED
@@ -1,17 +1,19 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- trusty-cms (4.3.1)
4
+ trusty-cms (5.0.0)
5
5
  RedCloth (= 4.3.2)
6
+ activestorage-validator
6
7
  acts_as_list (>= 0.9.5, < 1.1.0)
7
8
  acts_as_tree (~> 2.9.1)
8
- ckeditor (>= 4.2.2, < 4.3.0)
9
+ ckeditor (>= 4.2.2, < 4.4.0)
9
10
  delocalize (>= 0.2, < 2.0)
10
11
  devise
11
12
  execjs (~> 2.7)
12
13
  haml
13
14
  haml-rails (~> 2.0)
14
15
  highline (>= 1.7.8, < 2.1.0)
16
+ image_processing
15
17
  kraken-io
16
18
  mini_racer
17
19
  mysql2
@@ -33,60 +35,62 @@ GEM
33
35
  remote: https://rubygems.org/
34
36
  specs:
35
37
  RedCloth (4.3.2)
36
- actioncable (6.1.3.2)
37
- actionpack (= 6.1.3.2)
38
- activesupport (= 6.1.3.2)
38
+ actioncable (6.1.4.1)
39
+ actionpack (= 6.1.4.1)
40
+ activesupport (= 6.1.4.1)
39
41
  nio4r (~> 2.0)
40
42
  websocket-driver (>= 0.6.1)
41
- actionmailbox (6.1.3.2)
42
- actionpack (= 6.1.3.2)
43
- activejob (= 6.1.3.2)
44
- activerecord (= 6.1.3.2)
45
- activestorage (= 6.1.3.2)
46
- activesupport (= 6.1.3.2)
43
+ actionmailbox (6.1.4.1)
44
+ actionpack (= 6.1.4.1)
45
+ activejob (= 6.1.4.1)
46
+ activerecord (= 6.1.4.1)
47
+ activestorage (= 6.1.4.1)
48
+ activesupport (= 6.1.4.1)
47
49
  mail (>= 2.7.1)
48
- actionmailer (6.1.3.2)
49
- actionpack (= 6.1.3.2)
50
- actionview (= 6.1.3.2)
51
- activejob (= 6.1.3.2)
52
- activesupport (= 6.1.3.2)
50
+ actionmailer (6.1.4.1)
51
+ actionpack (= 6.1.4.1)
52
+ actionview (= 6.1.4.1)
53
+ activejob (= 6.1.4.1)
54
+ activesupport (= 6.1.4.1)
53
55
  mail (~> 2.5, >= 2.5.4)
54
56
  rails-dom-testing (~> 2.0)
55
- actionpack (6.1.3.2)
56
- actionview (= 6.1.3.2)
57
- activesupport (= 6.1.3.2)
57
+ actionpack (6.1.4.1)
58
+ actionview (= 6.1.4.1)
59
+ activesupport (= 6.1.4.1)
58
60
  rack (~> 2.0, >= 2.0.9)
59
61
  rack-test (>= 0.6.3)
60
62
  rails-dom-testing (~> 2.0)
61
63
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
62
- actiontext (6.1.3.2)
63
- actionpack (= 6.1.3.2)
64
- activerecord (= 6.1.3.2)
65
- activestorage (= 6.1.3.2)
66
- activesupport (= 6.1.3.2)
64
+ actiontext (6.1.4.1)
65
+ actionpack (= 6.1.4.1)
66
+ activerecord (= 6.1.4.1)
67
+ activestorage (= 6.1.4.1)
68
+ activesupport (= 6.1.4.1)
67
69
  nokogiri (>= 1.8.5)
68
- actionview (6.1.3.2)
69
- activesupport (= 6.1.3.2)
70
+ actionview (6.1.4.1)
71
+ activesupport (= 6.1.4.1)
70
72
  builder (~> 3.1)
71
73
  erubi (~> 1.4)
72
74
  rails-dom-testing (~> 2.0)
73
75
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
74
- activejob (6.1.3.2)
75
- activesupport (= 6.1.3.2)
76
+ activejob (6.1.4.1)
77
+ activesupport (= 6.1.4.1)
76
78
  globalid (>= 0.3.6)
77
- activemodel (6.1.3.2)
78
- activesupport (= 6.1.3.2)
79
- activerecord (6.1.3.2)
80
- activemodel (= 6.1.3.2)
81
- activesupport (= 6.1.3.2)
82
- activestorage (6.1.3.2)
83
- actionpack (= 6.1.3.2)
84
- activejob (= 6.1.3.2)
85
- activerecord (= 6.1.3.2)
86
- activesupport (= 6.1.3.2)
79
+ activemodel (6.1.4.1)
80
+ activesupport (= 6.1.4.1)
81
+ activerecord (6.1.4.1)
82
+ activemodel (= 6.1.4.1)
83
+ activesupport (= 6.1.4.1)
84
+ activestorage (6.1.4.1)
85
+ actionpack (= 6.1.4.1)
86
+ activejob (= 6.1.4.1)
87
+ activerecord (= 6.1.4.1)
88
+ activesupport (= 6.1.4.1)
87
89
  marcel (~> 1.0.0)
88
- mini_mime (~> 1.0.2)
89
- activesupport (6.1.3.2)
90
+ mini_mime (>= 1.1.0)
91
+ activestorage-validator (0.1.4)
92
+ rails (>= 5.2.0)
93
+ activesupport (6.1.4.1)
90
94
  concurrent-ruby (~> 1.0, >= 1.0.2)
91
95
  i18n (>= 1.6, < 2)
92
96
  minitest (>= 5.1)
@@ -96,7 +100,7 @@ GEM
96
100
  activerecord (>= 4.2)
97
101
  acts_as_tree (2.9.1)
98
102
  activerecord (>= 3.0.0)
99
- addressable (2.7.0)
103
+ addressable (2.8.0)
100
104
  public_suffix (>= 2.0.2, < 5.0)
101
105
  bcrypt (3.1.16)
102
106
  builder (3.2.4)
@@ -109,17 +113,15 @@ GEM
109
113
  rack-test (>= 0.6.3)
110
114
  regexp_parser (>= 1.5, < 3.0)
111
115
  xpath (~> 3.2)
112
- ckeditor (4.2.4)
113
- cocaine
116
+ ckeditor (4.3.0)
114
117
  orm_adapter (~> 0.5.0)
118
+ terrapin
115
119
  climate_control (0.2.0)
116
120
  cliver (0.3.2)
117
- cocaine (0.6.0)
118
- terrapin (= 0.6.0)
119
121
  coderay (1.1.3)
120
122
  concurrent-ruby (1.1.9)
121
123
  crass (1.0.6)
122
- css_parser (1.9.0)
124
+ css_parser (1.10.0)
123
125
  addressable
124
126
  database_cleaner (2.0.1)
125
127
  database_cleaner-active_record (~> 2.0.0)
@@ -145,10 +147,13 @@ GEM
145
147
  factory_bot_rails (6.2.0)
146
148
  factory_bot (~> 6.2.0)
147
149
  railties (>= 5.0.0)
148
- ffi (1.15.3)
149
- globalid (0.4.2)
150
- activesupport (>= 4.2.0)
151
- haml (5.2.1)
150
+ ffi (1.15.4)
151
+ file_validators (3.0.0)
152
+ activemodel (>= 3.2)
153
+ mime-types (>= 1.0)
154
+ globalid (0.5.2)
155
+ activesupport (>= 5.0)
156
+ haml (5.2.2)
152
157
  temple (>= 0.8.0)
153
158
  tilt
154
159
  haml-rails (2.0.1)
@@ -163,45 +168,47 @@ GEM
163
168
  haml (>= 4.0, < 6)
164
169
  nokogiri (>= 1.6.0)
165
170
  ruby_parser (~> 3.5)
166
- httparty (0.18.1)
171
+ httparty (0.20.0)
167
172
  mime-types (~> 3.0)
168
173
  multi_xml (>= 0.5.2)
169
174
  i18n (1.8.10)
170
175
  concurrent-ruby (~> 1.0)
176
+ image_processing (1.12.1)
177
+ mini_magick (>= 4.9.5, < 5)
178
+ ruby-vips (>= 2.0.17, < 3)
171
179
  json (2.5.1)
172
180
  kraken-io (0.1.3)
173
181
  activesupport
174
182
  httparty
175
183
  json
176
184
  multipart-post
177
- kt-paperclip (7.0.0)
178
- activemodel (>= 4.2.0)
179
- activesupport (>= 4.2.0)
180
- marcel (~> 1.0.1)
181
- mime-types
182
- terrapin (~> 0.6.0)
183
185
  launchy (2.5.0)
184
186
  addressable (~> 2.7)
185
187
  libv8-node (15.14.0.1-x86_64-darwin-18)
186
- loofah (2.10.0)
188
+ libv8-node (15.14.0.1-x86_64-darwin-20)
189
+ libv8-node (15.14.0.1-x86_64-linux)
190
+ loofah (2.12.0)
187
191
  crass (~> 1.0.2)
188
192
  nokogiri (>= 1.5.9)
189
193
  mail (2.7.1)
190
194
  mini_mime (>= 0.1.1)
191
- marcel (1.0.1)
195
+ marcel (1.0.2)
192
196
  method_source (1.0.0)
193
197
  mime-types (3.3.1)
194
198
  mime-types-data (~> 3.2015)
195
199
  mime-types-data (3.2021.0225)
196
- mini_mime (1.0.3)
200
+ mini_magick (4.11.0)
201
+ mini_mime (1.1.1)
197
202
  mini_racer (0.4.0)
198
203
  libv8-node (~> 15.14.0.0)
199
204
  minitest (5.14.4)
200
205
  multi_xml (0.6.0)
201
206
  multipart-post (2.1.1)
202
207
  mysql2 (0.5.3)
203
- nio4r (2.5.7)
204
- nokogiri (1.11.7-x86_64-darwin)
208
+ nio4r (2.5.8)
209
+ nokogiri (1.12.4-x86_64-darwin)
210
+ racc (~> 1.4)
211
+ nokogiri (1.12.4-x86_64-linux)
205
212
  racc (~> 1.4)
206
213
  orm_adapter (0.5.0)
207
214
  poltergeist (1.18.1)
@@ -217,40 +224,40 @@ GEM
217
224
  public_suffix (4.0.6)
218
225
  racc (1.5.2)
219
226
  rack (2.2.3)
220
- rack-cache (1.12.1)
227
+ rack-cache (1.13.0)
221
228
  rack (>= 0.4)
222
229
  rack-test (1.1.0)
223
230
  rack (>= 1.0, < 3)
224
231
  radius (0.7.5)
225
- rails (6.1.3.2)
226
- actioncable (= 6.1.3.2)
227
- actionmailbox (= 6.1.3.2)
228
- actionmailer (= 6.1.3.2)
229
- actionpack (= 6.1.3.2)
230
- actiontext (= 6.1.3.2)
231
- actionview (= 6.1.3.2)
232
- activejob (= 6.1.3.2)
233
- activemodel (= 6.1.3.2)
234
- activerecord (= 6.1.3.2)
235
- activestorage (= 6.1.3.2)
236
- activesupport (= 6.1.3.2)
232
+ rails (6.1.4.1)
233
+ actioncable (= 6.1.4.1)
234
+ actionmailbox (= 6.1.4.1)
235
+ actionmailer (= 6.1.4.1)
236
+ actionpack (= 6.1.4.1)
237
+ actiontext (= 6.1.4.1)
238
+ actionview (= 6.1.4.1)
239
+ activejob (= 6.1.4.1)
240
+ activemodel (= 6.1.4.1)
241
+ activerecord (= 6.1.4.1)
242
+ activestorage (= 6.1.4.1)
243
+ activesupport (= 6.1.4.1)
237
244
  bundler (>= 1.15.0)
238
- railties (= 6.1.3.2)
245
+ railties (= 6.1.4.1)
239
246
  sprockets-rails (>= 2.0.0)
240
247
  rails-dom-testing (2.0.3)
241
248
  activesupport (>= 4.2.0)
242
249
  nokogiri (>= 1.6)
243
- rails-html-sanitizer (1.3.0)
250
+ rails-html-sanitizer (1.4.2)
244
251
  loofah (~> 2.3)
245
252
  rails-observers (0.1.5)
246
253
  activemodel (>= 4.0)
247
- railties (6.1.3.2)
248
- actionpack (= 6.1.3.2)
249
- activesupport (= 6.1.3.2)
254
+ railties (6.1.4.1)
255
+ actionpack (= 6.1.4.1)
256
+ activesupport (= 6.1.4.1)
250
257
  method_source
251
- rake (>= 0.8.7)
258
+ rake (>= 0.13)
252
259
  thor (~> 1.0)
253
- rake (13.0.3)
260
+ rake (13.0.6)
254
261
  rdoc (6.3.2)
255
262
  regexp_parser (2.1.1)
256
263
  responders (3.0.1)
@@ -270,7 +277,7 @@ GEM
270
277
  rspec-mocks (3.10.2)
271
278
  diff-lcs (>= 1.2.0, < 2.0)
272
279
  rspec-support (~> 3.10.0)
273
- rspec-rails (5.0.1)
280
+ rspec-rails (5.0.2)
274
281
  actionpack (>= 5.2)
275
282
  activesupport (>= 5.2)
276
283
  railties (>= 5.2)
@@ -279,7 +286,9 @@ GEM
279
286
  rspec-mocks (~> 3.10)
280
287
  rspec-support (~> 3.10)
281
288
  rspec-support (3.10.2)
282
- ruby_parser (3.16.0)
289
+ ruby-vips (2.1.3)
290
+ ffi (~> 1.12)
291
+ ruby_parser (3.17.0)
283
292
  sexp_processor (~> 4.15, >= 4.15.1)
284
293
  sass-rails (6.0.0)
285
294
  sassc-rails (~> 2.1, >= 2.1.1)
@@ -323,19 +332,22 @@ GEM
323
332
  websocket-driver (0.7.5)
324
333
  websocket-extensions (>= 0.1.0)
325
334
  websocket-extensions (0.1.5)
326
- will_paginate (3.3.0)
335
+ will_paginate (3.3.1)
327
336
  xpath (3.2.0)
328
337
  nokogiri (~> 1.8)
329
338
  zeitwerk (2.4.2)
330
339
 
331
340
  PLATFORMS
332
341
  x86_64-darwin-18
342
+ x86_64-darwin-20
343
+ x86_64-linux
333
344
 
334
345
  DEPENDENCIES
346
+ activestorage-validator
335
347
  acts_as_list
336
348
  database_cleaner
337
349
  factory_bot_rails (= 6.2.0)
338
- kt-paperclip (~> 7.0.0)
350
+ file_validators
339
351
  launchy (~> 2.5.0)
340
352
  mysql2
341
353
  poltergeist (~> 1.18.1)
@@ -347,4 +359,4 @@ DEPENDENCIES
347
359
  trustygems (~> 0.2.0)
348
360
 
349
361
  BUNDLED WITH
350
- 2.2.19
362
+ 2.2.27
@@ -0,0 +1,6 @@
1
+ //= link_tree ../images
2
+ //= link_directory ../javascripts .js
3
+ //= link_directory ../stylesheets .css
4
+ //= link admin/assets.css
5
+ //= link admin/assets_admin.js
6
+ //= link admin/custom_file_upload.js
@@ -3,8 +3,8 @@ CKEDITOR.editorConfig = function( config ) {
3
3
  config.removeFormatTags = "";
4
4
  config.protectedSource.push(/<r:([\S]+).*<\/r:\1>/g);
5
5
  config.protectedSource.push(/<r:[^>/]*\/>/g);
6
-
7
- config.forcePasteAsPlainText = true;
6
+ //let paste from word be available
7
+ // config.forcePasteAsPlainText = false;
8
8
  // if you want to remove clipboard, you have to remove all of these:
9
9
  // clipboard, pastetext, pastefromword
10
10
  config.removePlugins = "save, newpage, preview, print, templates, forms, flash, smiley, language, pagebreak, iframe, bidi";
@@ -6,6 +6,7 @@ main {
6
6
 
7
7
  .reversed main {
8
8
  .content {
9
+ line-height: 1.5;
9
10
  padding: 1em;
10
11
  }
11
12
  }
@@ -1,6 +1,9 @@
1
1
  class Admin::AssetsController < Admin::ResourceController
2
2
  paginate_models(per_page: 50)
3
3
  COMPRESS_FILE_TYPE = ['image/jpeg', 'image/png', 'image/gif', 'image/svg+xml'].freeze
4
+ before_action do
5
+ ActiveStorage::Current.host = request.base_url
6
+ end
4
7
 
5
8
  def index
6
9
  assets = Asset.order('created_at DESC')
@@ -67,8 +70,9 @@ class Admin::AssetsController < Admin::ResourceController
67
70
  private
68
71
 
69
72
  def compress(uploaded_asset)
73
+ require 'open-uri'
70
74
  data = $kraken.upload(uploaded_asset.tempfile.path, 'lossy' => true)
71
- File.write(uploaded_asset.tempfile, open(data.kraked_url).read, { mode: 'wb' })
75
+ File.write(uploaded_asset.tempfile, URI.open(data.kraked_url).read, mode: 'wb')
72
76
  uploaded_asset
73
77
  end
74
78
 
@@ -81,4 +85,4 @@ class Admin::AssetsController < Admin::ResourceController
81
85
  def asset_params
82
86
  params.permit(:id, :for_attachment, asset: [:caption, :for_attachment, asset: []])
83
87
  end
84
- end
88
+ end
data/app/models/asset.rb CHANGED
@@ -1,6 +1,4 @@
1
1
  class Asset < ActiveRecord::Base
2
- include Paperclip::Glue
3
-
4
2
  has_many :page_attachments, dependent: :destroy
5
3
  has_many :pages, through: :page_attachments
6
4
  has_site if respond_to? :has_site
@@ -33,52 +31,43 @@ class Asset < ActiveRecord::Base
33
31
  end
34
32
  }
35
33
 
36
- has_attached_file :asset,
37
- styles: lambda { |attachment|
38
- AssetType.for(attachment).paperclip_styles
39
- },
40
- processors: lambda { |asset|
41
- asset.paperclip_processors
42
- },
43
- whiny: false,
44
- storage: TrustyCms.config['paperclip.storage'],
45
- path: TrustyCms.config['paperclip.path'],
46
- url: TrustyCms.config['paperclip.url'],
47
- fog_credentials: TrustyCmsClippedExtension::Cloud.credentials,
48
- fog_directory: TrustyCms.config['paperclip.fog.directory'],
49
- fog_public: TrustyCms.config['paperclip.fog.public?'] || true,
50
- fog_host: TrustyCmsClippedExtension::Cloud.host,
51
- fog_file: {
52
- 'Cache-Control' => 'max-age=31536000',
53
- }
54
-
55
- validates_attachment_content_type :asset, content_type: ['application/zip', 'image/jpg', 'image/jpeg', 'image/png', 'image/gif', 'application/pdf', 'application/javascript', 'text/javascript', 'text/css']
56
-
34
+ has_one_attached :asset
35
+ validates :asset,
36
+ presence: true,
37
+ blob:
38
+ {
39
+ content_type: %w[application/zip image/jpg image/jpeg image/png image/gif application/pdf text/css],
40
+ size_range: 1..5.megabytes,
41
+ }
57
42
  before_save :assign_title
58
43
  before_save :assign_uuid
59
44
 
60
- after_post_process :read_dimensions
61
-
62
- validates_attachment_presence :asset, message: 'You must choose a file to upload!'
63
- if TrustyCms.config['paperclip.skip_filetype_validation'] != 'true' && TrustyCms.config['paperclip.content_types']
64
- validates_attachment_content_type :asset, content_type: TrustyCms.config['paperclip.content_types'].gsub(' ', '').split(',')
65
- else
66
- validates_attachment_presence :asset, message: 'Your uploaded file must have an extension in its name!'
67
- end
68
- validates_attachment_size :asset, less_than: (TrustyCms.config['assets.max_asset_size'] || 5).to_i.megabytes
69
-
70
45
  def asset_type
71
46
  AssetType.for(asset)
72
47
  end
73
- delegate :paperclip_processors, :paperclip_styles, :style_dimensions, :style_format, to: :asset_type
48
+ delegate :paperclip_processors, :paperclip_styles, :active_storage_styles, :style_dimensions, :style_format,
49
+ to: :asset_type
74
50
 
75
51
  def thumbnail(style_name = 'original')
76
- return asset.url if style_name.to_sym == :original
77
- return asset.url(style_name.to_sym) if style?(style_name)
52
+ return asset.url if style_name == 'original'
53
+ return asset_variant(style_name).processed.url if asset.variable?
78
54
 
79
55
  asset_type.icon(style_name)
80
56
  end
81
57
 
58
+ def asset_variant(style_name)
59
+ case style_name
60
+ when 'thumbnail'
61
+ asset.variant(gravity: 'Center', resize: '100x100^', crop: '100x100+0+0')
62
+ when 'normal'
63
+ asset.variant(gravity: 'Center', resize: '640x640^')
64
+ when 'small'
65
+ asset.variant(gravity: 'Center', resize: '320x320^')
66
+ when 'icon'
67
+ asset.variant(gravity: 'Center', resize: '50x50^')
68
+ end
69
+ end
70
+
82
71
  def style?(style_name = 'original')
83
72
  style_name == 'original' || paperclip_styles.keys.include?(style_name.to_sym)
84
73
  end
@@ -110,7 +99,10 @@ class Asset < ActiveRecord::Base
110
99
  end
111
100
 
112
101
  def geometry(style_name = 'original')
113
- raise Paperclip::StyleError, "Requested style #{style_name} is not defined for this asset." unless style?(style_name)
102
+ unless style?(style_name)
103
+ raise Paperclip::StyleError,
104
+ "Requested style #{style_name} is not defined for this asset."
105
+ end
114
106
 
115
107
  @geometry ||= {}
116
108
  begin
@@ -118,8 +110,9 @@ class Asset < ActiveRecord::Base
118
110
  original_geometry
119
111
  else
120
112
  style = asset.styles[style_name.to_sym]
121
- original_geometry.transformed_by(style.geometry) # this can return dimensions for fully specified style sizes but not for relative sizes when there are no original dimensions
122
- end
113
+ original_geometry.transformed_by(style.geometry)
114
+ # this can return dimensions for fully specified style sizes but not for relative sizes when there are no original dimensions
115
+ end
123
116
  rescue Paperclip::TransformationError => e
124
117
  Rails.logger.warn "geometry transformation error: #{e}"
125
118
  original_geometry # returns a blank geometry if the real geometry cannot be calculated
@@ -174,19 +167,17 @@ class Asset < ActiveRecord::Base
174
167
  # original file and calculate thumbnail dimensions later, on demand.
175
168
 
176
169
  def read_dimensions
177
- if image?
178
- if file = asset.queued_for_write[:original]
179
- geometry = Paperclip::Geometry.from_file(file)
180
- self.original_width = geometry.width
181
- self.original_height = geometry.height
182
- self.original_extension = File.extname(file.path)
183
- end
170
+ if image? && file = asset.queued_for_write[:original]
171
+ geometry = Paperclip::Geometry.from_file(file)
172
+ self.original_width = geometry.width
173
+ self.original_height = geometry.height
174
+ self.original_extension = File.extname(file.path)
184
175
  end
185
176
  true
186
177
  end
187
178
 
188
179
  def assign_title
189
- self.title = asset_file_name.downcase.sub(original_extension, '').sub('.', '')
180
+ self.title = asset.filename.base
190
181
  end
191
182
 
192
183
  def assign_uuid
@@ -235,7 +226,7 @@ class Asset < ActiveRecord::Base
235
226
 
236
227
  # this is a convenience for image-pickers
237
228
  def self.thumbnail_options
238
- asset_sizes = thumbnail_sizes.collect do |k, v|
229
+ asset_sizes = thumbnail_sizes.map do |k, v|
239
230
  size_id = k
240
231
  size_description = "#{k}: "
241
232
  size_description << (v.is_a?(Array) ? v.join(' as ') : v)
@@ -104,6 +104,10 @@ class AssetType
104
104
  @paperclip_styles
105
105
  end
106
106
 
107
+ def active_storage_styles
108
+ @active_storage_styles ||= normalize_style_rules(configured_styles.merge(styles))
109
+ end
110
+
107
111
  # Takes a motley collection of differently-defined styles and renders them into the standard hash-of-hashes format.
108
112
  # Solitary strings are assumed to be #
109
113
  def normalize_style_rules(styles = {})
@@ -173,8 +177,8 @@ class AssetType
173
177
  # class methods
174
178
 
175
179
  def self.for(attachment)
176
- extension = File.extname(attachment.original_filename).sub(/^\.+/, '')
177
- from_extension(extension) || from_mimetype(attachment.instance_read(:content_type)) || catchall
180
+ extension = attachment.record.original_extension
181
+ from_extension(extension) || from_mimetype(attachment.content_type) || catchall
178
182
  end
179
183
 
180
184
  def self.from_extension(extension)
@@ -16,10 +16,12 @@
16
16
  = "#{t("clipped_extension.filename")}: #{@asset.asset_file_name unless @asset.new_record?}"
17
17
  %br
18
18
  %label.url
19
- = "#{t("clipped_extension.asset_url")}: #{image_path @asset.thumbnail unless @asset.new_record?}"
19
+ = "#{t("clipped_extension.asset_url")}: #{image_path @asset.asset.url unless @asset.new_record?}"
20
+ %br
21
+ %label.id
22
+ = "#{t("clipped_extension.asset_id")}: #{@asset.asset.id unless @asset.new_record?}"
20
23
  %p.asset
21
- - display_size = TrustyCms::config['assets.display_size'] || 'normal'
22
- = image_tag @asset.thumbnail(display_size.to_sym), :class => 'preview'
24
+ = image_tag @asset.thumbnail("normal"), :class => 'preview'
23
25
 
24
26
  = updated_stamp @asset
25
27
 
data/config/database.yml CHANGED
@@ -1,4 +1,4 @@
1
- test: &TEST
1
+ test:
2
2
  adapter: mysql2
3
3
  database: trusty_cms_test
4
- username:
4
+ username:
@@ -66,6 +66,7 @@ en:
66
66
  asset_page_attachment_note: 'Attached assets. These can be inserted with drag and drop or shown with the <code>&lt;r:assets:each /&gt;</code> tag.'
67
67
  asset_note: 'Attached assets. '
68
68
  asset_url: 'Asset URL'
69
+ asset_id: 'Asset ID'
69
70
  assets: 'Assets'
70
71
  assets_explanation: 'Assets and images can be uploaded and then attached or inserted into pages, snippets and layouts. Click on an asset name above to edit it or click <code>Remove</code> to delete it.'
71
72
  assets_title: 'Assets'
data/coverage/index.html CHANGED
@@ -14,7 +14,7 @@
14
14
  <img src="./assets/0.12.3/loading.gif" alt="loading"/>
15
15
  </div>
16
16
  <div id="wrapper" class="hide">
17
- <div class="timestamp">Generated <abbr class="timeago" title="2021-03-03T13:17:38-05:00">2021-03-03T13:17:38-05:00</abbr></div>
17
+ <div class="timestamp">Generated <abbr class="timeago" title="2021-10-05T10:51:28-04:00">2021-10-05T10:51:28-04:00</abbr></div>
18
18
  <ul class="group_tabs"></ul>
19
19
 
20
20
  <div id="content">
@@ -0,0 +1,13 @@
1
+ require 'active_support'
2
+
3
+ class AssetType
4
+ def paperclip_processors
5
+ ActiveSupport::Deprecation.warn('Paperclip processors will be deprecated soon in favor of ActiveStorage.')
6
+
7
+ active_storage_styles
8
+ end
9
+
10
+ def paperclip_styles
11
+ ActiveSupport::Deprecation.warn('Paperclip styles will be deprecated soon in favor of ActiveStorage.')
12
+ end
13
+ end
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.3.1'.freeze
5
+ VERSION = '5.0.0'.freeze
6
6
  end
7
7
  end