tinymce-rails 4.9.11 → 4.9.11.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -5
- data/lib/tinymce/rails/asset_installer/compile.rb +2 -2
- data/lib/tinymce/rails/asset_installer.rb +1 -1
- data/lib/tinymce/rails/asset_manifest.rb +9 -4
- data/lib/tinymce/rails/configuration.rb +2 -2
- data/lib/tinymce/rails/configuration_file.rb +4 -3
- data/lib/tinymce/rails/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9119c17e2bcb3d33ab9b959c0c6c41c8d529106e51ab483f338d1e64423481d4
|
4
|
+
data.tar.gz: 7e358486b6a0f1db1794349cfeb7413538208df73d14bc3b6d221d2069222c91
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5222c58b96aabcf11ea4e41328be95d4f6461aaab3406dc148b5cff078b5d4f2b12c96ca01c5f3c5c83d8c6a9730667afd57640e6c54b4a3e7ef27d57af28bfa
|
7
|
+
data.tar.gz: ec2c6ed08479406cbc7829e702557b9ea9a754f5ab091e9119d216150b463fcfcc061dd83f6d2e8b719aa203dd9b68cd24c4117c3370b4aafd4158cf1604c911
|
data/README.md
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
Rails Integration for TinyMCE
|
2
2
|
=============================
|
3
3
|
|
4
|
-
The `tinymce-rails` gem integrates the [TinyMCE](
|
4
|
+
The `tinymce-rails` gem integrates the [TinyMCE](https://www.tiny.cloud/) editor with the Rails asset pipeline.
|
5
5
|
|
6
|
-
This gem is compatible with Rails
|
6
|
+
This gem is compatible with Rails 5.0 and higher.
|
7
7
|
|
8
|
-
This is the branch for TinyMCE 4.
|
8
|
+
This is the branch for TinyMCE 4. Please see the [`main`](https://github.com/spohlenz/tinymce-rails) branch for TinyMCE 7, and alternate branches for [TinyMCE 6](https://github.com/spohlenz/tinymce-rails/tree/tinymce-6), [TinyMCE 5](https://github.com/spohlenz/tinymce-rails/tree/tinymce-5) & [TinyMCE 3.5.x](https://github.com/spohlenz/tinymce-rails/tree/tinymce-3).
|
9
9
|
|
10
|
-
[![Build Status](https://
|
10
|
+
[![Build Status](https://img.shields.io/github/actions/workflow/status/spohlenz/tinymce-rails/rspec.yml?branch=tinymce-4)](https://github.com/spohlenz/tinymce-rails/actions?query=branch%3Atinymce-4)
|
11
11
|
|
12
12
|
**New in 3.5.11, 4.1.10 and 4.2.1:** Alternative asset installation methods (copy vs compile/symlink). See the [Asset Compilation](#asset-compilation) section below for details.
|
13
13
|
|
@@ -52,7 +52,7 @@ alternate:
|
|
52
52
|
- table
|
53
53
|
```
|
54
54
|
|
55
|
-
See the [TinyMCE 4 Documentation](https://www.
|
55
|
+
See the [TinyMCE 4 Documentation](https://www.tiny.cloud/docs-4x/configure/) for a full list of configuration options.
|
56
56
|
|
57
57
|
|
58
58
|
**3. Include the TinyMCE assets**
|
@@ -24,14 +24,14 @@ module TinyMCE
|
|
24
24
|
def symlink_asset(src, dest)
|
25
25
|
with_asset(src, dest) do |src, dest|
|
26
26
|
create_symlink(src, dest)
|
27
|
-
create_symlink("#{src}.gz", "#{dest}.gz") if File.
|
27
|
+
create_symlink("#{src}.gz", "#{dest}.gz") if File.exist?("#{src}.gz")
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
31
31
|
def create_symlink(src, dest)
|
32
32
|
target = File.basename(src)
|
33
33
|
|
34
|
-
unless File.
|
34
|
+
unless File.exist?(dest) && File.symlink?(dest) && File.readlink(dest) == target
|
35
35
|
logger.info "Creating symlink #{dest}"
|
36
36
|
FileUtils.ln_s(target, dest, :force => true)
|
37
37
|
else
|
@@ -6,6 +6,7 @@ module TinyMCE
|
|
6
6
|
def self.load(manifest_path)
|
7
7
|
JsonManifest.try(manifest_path, ".sprockets-manifest*.json") ||
|
8
8
|
JsonManifest.try(manifest_path, "manifest*.json") ||
|
9
|
+
JsonManifest.try(manifest_path) ||
|
9
10
|
YamlManifest.try(manifest_path) ||
|
10
11
|
NullManifest.new
|
11
12
|
end
|
@@ -37,7 +38,7 @@ module TinyMCE
|
|
37
38
|
class YamlManifest < AssetManifest
|
38
39
|
def self.try(manifest_path)
|
39
40
|
yaml_file = File.join(manifest_path, "manifest.yml")
|
40
|
-
new(yaml_file) if File.
|
41
|
+
new(yaml_file) if File.exist?(yaml_file)
|
41
42
|
end
|
42
43
|
|
43
44
|
def initialize(file)
|
@@ -75,9 +76,13 @@ module TinyMCE
|
|
75
76
|
end
|
76
77
|
|
77
78
|
class JsonManifest < AssetManifest
|
78
|
-
def self.try(manifest_path, pattern)
|
79
|
-
|
80
|
-
|
79
|
+
def self.try(manifest_path, pattern=nil)
|
80
|
+
if pattern
|
81
|
+
paths = Dir[File.join(manifest_path, pattern)]
|
82
|
+
new(paths.first) if paths.any?
|
83
|
+
elsif File.file?(manifest_path)
|
84
|
+
new(manifest_path)
|
85
|
+
end
|
81
86
|
end
|
82
87
|
|
83
88
|
def initialize(file)
|
@@ -14,7 +14,7 @@ module TinyMCE::Rails
|
|
14
14
|
}
|
15
15
|
end
|
16
16
|
|
17
|
-
FUNCTION_REGEX = /^function\s*\(/
|
17
|
+
FUNCTION_REGEX = /^function\s*\(([\w\d\s_,]*)\)\s*\{([^}]*)\}|\(([\w\d\s_,]*)\)\s*=>\s*\{([^}]*)\}/
|
18
18
|
RELATIVE_PATH_REGEX = /^(\/|\.{1,2})\S*/
|
19
19
|
|
20
20
|
COMMA = ",".freeze
|
@@ -47,7 +47,7 @@ module TinyMCE::Rails
|
|
47
47
|
# Check for files provided in the content_css option to replace them with their actual path.
|
48
48
|
# If no corresponding stylesheet is found for a file, it will remain unchanged.
|
49
49
|
"content_css" => ->(value) {
|
50
|
-
helpers = ActionView::Base.new(ActionView::LookupContext.new([]))
|
50
|
+
helpers = ActionView::Base.new(ActionView::LookupContext.new([]), {}, nil)
|
51
51
|
separator = OPTION_SEPARATORS["content_css"]
|
52
52
|
|
53
53
|
value.split(separator).map { |file|
|
@@ -25,13 +25,13 @@ module TinyMCE::Rails
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def last_updated
|
28
|
-
File.
|
28
|
+
File.exist?(path) && File.mtime(path)
|
29
29
|
end
|
30
30
|
|
31
31
|
def load_configuration
|
32
32
|
@last_loaded = last_updated
|
33
33
|
|
34
|
-
return Configuration.new_with_defaults if !File.
|
34
|
+
return Configuration.new_with_defaults if !File.exist?(path)
|
35
35
|
|
36
36
|
options = load_yaml(path)
|
37
37
|
|
@@ -43,7 +43,8 @@ module TinyMCE::Rails
|
|
43
43
|
end
|
44
44
|
|
45
45
|
def load_yaml(path)
|
46
|
-
|
46
|
+
result = ERB.new(IO.read(path)).result
|
47
|
+
YAML.respond_to?(:unsafe_load) ? YAML.unsafe_load(result) : YAML.load(result)
|
47
48
|
end
|
48
49
|
end
|
49
50
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tinymce-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.9.11
|
4
|
+
version: 4.9.11.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Pohlenz
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-05-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -145,7 +145,7 @@ homepage: https://github.com/spohlenz/tinymce-rails
|
|
145
145
|
licenses:
|
146
146
|
- MIT
|
147
147
|
metadata: {}
|
148
|
-
post_install_message:
|
148
|
+
post_install_message:
|
149
149
|
rdoc_options: []
|
150
150
|
require_paths:
|
151
151
|
- lib
|
@@ -160,8 +160,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
160
160
|
- !ruby/object:Gem::Version
|
161
161
|
version: '0'
|
162
162
|
requirements: []
|
163
|
-
rubygems_version: 3.
|
164
|
-
signing_key:
|
163
|
+
rubygems_version: 3.5.9
|
164
|
+
signing_key:
|
165
165
|
specification_version: 4
|
166
166
|
summary: Rails asset pipeline integration for TinyMCE.
|
167
167
|
test_files: []
|