card-mod-content 0.11.7 → 0.13.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca747c0b4f5e5daf200645b98669e4548f9bda3ba18690bb10172c21b338d1a9
|
4
|
+
data.tar.gz: 1d0d4662153d1161ce5b8c054f6e1533a2db6c8605fece3111c38e71a57cffda
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 15dfbb475308d689a33b725813d3f0269bead4dcb89679f66a6c81b62f19da89bb84f5aad4321af38d20fc9998862be36b65e58290b9e1c5771fba19c7b09459
|
7
|
+
data.tar.gz: b1e3735b17553af224025ea1215c864c6dd38159bdecd57548c9d9016ff9b9caae93afa33f55d9a5a2c5fe16dd694f2c336290dd3b6a1371a07de5827f3a6bb9
|
@@ -0,0 +1,24 @@
|
|
1
|
+
def source_paths
|
2
|
+
[]
|
3
|
+
end
|
4
|
+
|
5
|
+
def find_file file_path
|
6
|
+
unknown_file?(file_path) ? nil : file_path
|
7
|
+
end
|
8
|
+
|
9
|
+
def unknown_file? file_path
|
10
|
+
return false if File.exist? file_path
|
11
|
+
|
12
|
+
Rails.logger.info "couldn't locate file #{file_path}"
|
13
|
+
true
|
14
|
+
end
|
15
|
+
|
16
|
+
def existing_source_paths
|
17
|
+
Array.wrap(source_paths).reject do |file_path|
|
18
|
+
unknown_file?(file_path)
|
19
|
+
end.compact
|
20
|
+
end
|
21
|
+
|
22
|
+
def source_changed? since:
|
23
|
+
existing_source_paths.any? { |path| ::File.mtime(path) > since }
|
24
|
+
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
include_set Abstract::Sources
|
2
|
+
|
1
3
|
class << self
|
2
4
|
def included host_class
|
3
5
|
track_mod_name host_class, caller
|
@@ -31,12 +33,6 @@ def source_dir
|
|
31
33
|
end
|
32
34
|
end
|
33
35
|
|
34
|
-
def find_file filename
|
35
|
-
File.join(mod_path, source_dir, filename).tap do |file_path|
|
36
|
-
return nil if unknown_file? filename, file_path
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
36
|
def mod_path
|
41
37
|
modname = file_content_mod_name
|
42
38
|
if (match = modname.match(/^card-mod-(\w*)/))
|
@@ -45,28 +41,17 @@ def mod_path
|
|
45
41
|
Cardio::Mod.dirs.path modname
|
46
42
|
end
|
47
43
|
|
48
|
-
def
|
49
|
-
return false if File.exist? file_path
|
50
|
-
|
51
|
-
Rails.logger.info "couldn't locate file #{filename} at #{file_path}"
|
52
|
-
true
|
53
|
-
end
|
54
|
-
|
55
|
-
def existing_source_paths
|
44
|
+
def source_paths
|
56
45
|
Array.wrap(source_files).map do |filename|
|
57
|
-
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
def source_changed? since:
|
62
|
-
existing_source_paths.any? { |path| ::File.mtime(path) > since }
|
46
|
+
::File.join mod_path, source_dir, filename
|
47
|
+
end
|
63
48
|
end
|
64
49
|
|
65
50
|
def content
|
66
|
-
Array.wrap(
|
67
|
-
if (source_path = find_file
|
51
|
+
Array.wrap(source_paths).map do |path|
|
52
|
+
if (source_path = find_file path)
|
68
53
|
Rails.logger.debug "reading file: #{source_path}"
|
69
|
-
File.read source_path
|
54
|
+
::File.read source_path
|
70
55
|
end
|
71
56
|
end.compact.join "\n"
|
72
57
|
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
format :html do
|
2
|
+
view :input do
|
3
|
+
"Content can't be edited."
|
4
|
+
end
|
5
|
+
|
6
|
+
def short_content
|
7
|
+
fa_icon("exclamation-circle", class: "text-muted pr-2") +
|
8
|
+
wrap_with(:span, "read-only", class: "text-muted")
|
9
|
+
end
|
10
|
+
|
11
|
+
def standard_submit_button
|
12
|
+
multi_card_editor? ? super : ""
|
13
|
+
end
|
14
|
+
end
|
data/set/all/chunk.rb
CHANGED
@@ -110,13 +110,15 @@ format do
|
|
110
110
|
|
111
111
|
def process_nested_chunk chunk, virtual, &block
|
112
112
|
if chunk.referee_card&.virtual?
|
113
|
-
|
113
|
+
process_virtual_chunk chunk, virtual, &block
|
114
114
|
else
|
115
115
|
yield chunk
|
116
116
|
end
|
117
117
|
end
|
118
118
|
|
119
|
-
def process_virtual_chunk chunk, &block
|
119
|
+
def process_virtual_chunk chunk, virtual, &block
|
120
|
+
return if virtual
|
121
|
+
|
120
122
|
subformat(chunk.referee_card).each_nested_field_chunk(&block)
|
121
123
|
end
|
122
124
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: card-mod-content
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.13.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ethan McCutchen
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2021-08-
|
13
|
+
date: 2021-08-06 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: card
|
@@ -18,14 +18,14 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - '='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 1.
|
21
|
+
version: 1.103.2
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
26
|
- - '='
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
version: 1.
|
28
|
+
version: 1.103.2
|
29
29
|
description: ''
|
30
30
|
email:
|
31
31
|
- info@decko.org
|
@@ -33,6 +33,7 @@ executables: []
|
|
33
33
|
extensions: []
|
34
34
|
extra_rdoc_files: []
|
35
35
|
files:
|
36
|
+
- db/migrate_core_cards/20201115133753_add_asset_file_card.rb
|
36
37
|
- lib/card/content/chunk/escaped_literal.rb
|
37
38
|
- lib/card/content/chunk/keep_escaped_literal.rb
|
38
39
|
- lib/card/content/chunk/link.rb
|
@@ -41,9 +42,11 @@ files:
|
|
41
42
|
- lib/card/content/chunk/reference.rb
|
42
43
|
- lib/card/content/chunk/uri.rb
|
43
44
|
- lib/card/content/chunk/view_stub.rb
|
44
|
-
- set/abstract/
|
45
|
+
- set/abstract/00_sources.rb
|
46
|
+
- set/abstract/01_code_file.rb
|
45
47
|
- set/abstract/haml_file.rb
|
46
48
|
- set/abstract/lock.rb
|
49
|
+
- set/abstract/read_only.rb
|
47
50
|
- set/abstract/templated_nests.rb
|
48
51
|
- set/abstract/vendor_code_file.rb
|
49
52
|
- set/all/chunk.rb
|