revealing 1.0.3 → 1.0.4
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 +4 -4
- data/.gitignore +2 -0
- data/README.markdown +3 -2
- data/lib/revealing/tasks/assets.rake +22 -1
- data/lib/revealing/tasks.rb +2 -1
- data/lib/revealing/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f88e8404c6aaf20a49dbd3ee4c7a3d3d9eda17e567a4f6f6d63c51ea465256f6
|
4
|
+
data.tar.gz: fae690feb332b5a8d7d9c1840ad6a7981725f70bdc9646eabe2cbcfcd6d9fd07
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b2d5cf5426276b23307d29fb11e84b25b2221e694a69ac7667cf90e4a1a5f5798492aa5309e0d837a6c0b357e2bb3d2afe3367e328c87d3d5f2989330a5039b5
|
7
|
+
data.tar.gz: e5c7a73f5b15a7da7d7553d857843d2bd5a84667d904042e84590b7abbd8bd7f8c56db65c5826e55b8a08f66362d7dfc9c6621422ff04d1ec12c0ec503be1782
|
data/README.markdown
CHANGED
@@ -33,10 +33,11 @@ This gem provides a set of [`Rake`](https://github.com/ruby/rake) tasks to creat
|
|
33
33
|
# TODO
|
34
34
|
|
35
35
|
1. `revealing doctor` to analyze tools
|
36
|
-
1.
|
37
|
-
1. Read desired
|
36
|
+
1. Rubocop
|
37
|
+
1. Read desired dependencies (URLs or version numbers) from ENV vars or a YAML file (with sensible defaults coming from this project)
|
38
38
|
1. Re-add ditaa processing
|
39
39
|
1. Add mathjax (copy to target if present, otherwise use CDN)
|
40
|
+
1. Add guard-livereload to the generated project
|
40
41
|
1. Expose customization of
|
41
42
|
* highlight-style
|
42
43
|
* slide-level
|
@@ -1,5 +1,24 @@
|
|
1
1
|
prereq 'gm'
|
2
2
|
|
3
|
+
def refute_duplicate_basename(assets)
|
4
|
+
assets = assets.map{ |f| Pathname(f) }
|
5
|
+
basenames = assets.map{ |f| f.basename }
|
6
|
+
|
7
|
+
if basenames.length != basenames.uniq.length
|
8
|
+
# https://stackoverflow.com/a/8922931/3212907
|
9
|
+
duplicate_basenames = basenames.select{ |e| basenames.count(e) > 1 }.uniq
|
10
|
+
list = assets.select{ |a| duplicate_basenames.include?(a.basename) }
|
11
|
+
warn "Error: The following assets have the same base name and would override another in the output:"
|
12
|
+
warn ''
|
13
|
+
warn list.join("\n")
|
14
|
+
warn ''
|
15
|
+
warn "Consider renaming them to be unique."
|
16
|
+
fail
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
refute_duplicate_basename(RESIZABLE_ASSETS)
|
21
|
+
|
3
22
|
RESIZED_ASSETS.zip(RESIZABLE_ASSETS).each do |target, source|
|
4
23
|
desc "Resize #{source} to #{target}"
|
5
24
|
file target => ['gm', source] do
|
@@ -7,9 +26,11 @@ RESIZED_ASSETS.zip(RESIZABLE_ASSETS).each do |target, source|
|
|
7
26
|
end
|
8
27
|
end
|
9
28
|
|
29
|
+
refute_duplicate_basename(ASSET_SOURCES)
|
30
|
+
|
10
31
|
ASSETS.zip(ASSET_SOURCES).each do |target, source|
|
11
32
|
desc "Copy #{source} to #{target}"
|
12
|
-
file target =>
|
33
|
+
file target => source do
|
13
34
|
cp source, target
|
14
35
|
end
|
15
36
|
end
|
data/lib/revealing/tasks.rb
CHANGED
@@ -22,8 +22,9 @@ REVEAL_JS_TARGET_DIR = TARGET_DIR / REVEAL_JS
|
|
22
22
|
|
23
23
|
RESIZABLE_ASSETS = (FileList[SOURCE_DIR / '**/*.png'] + FileList[SOURCE_DIR / '**/*.jpg'])
|
24
24
|
RESIZED_ASSETS = RESIZABLE_ASSETS.pathmap("#{TARGET_DIR}/%f")
|
25
|
-
ASSET_SOURCES = FileList[SOURCE_DIR / '
|
25
|
+
ASSET_SOURCES = FileList[SOURCE_DIR / '**/*'].select{ |f| Pathname(f).file? } - RESIZABLE_ASSETS - SOURCE_FILES
|
26
26
|
ASSETS = ASSET_SOURCES.pathmap("#{TARGET_DIR}/%f") - RESIZED_ASSETS
|
27
|
+
|
27
28
|
HEADERS = FileList['headers/*'] # These are included literal; no need to copy them
|
28
29
|
|
29
30
|
load "#{__dir__}/tasks/prereq.rake"
|
data/lib/revealing/version.rb
CHANGED