slideshow-models 2.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/HISTORY.md +171 -0
- data/Manifest.txt +37 -0
- data/README.md +23 -0
- data/Rakefile +37 -0
- data/config/slideshow.builtin.yml +8 -0
- data/config/slideshow.index.yml +69 -0
- data/config/slideshow.yml +76 -0
- data/lib/slideshow/commands/fetch.rb +123 -0
- data/lib/slideshow/commands/gen.rb +330 -0
- data/lib/slideshow/commands/list.rb +72 -0
- data/lib/slideshow/commands/plugins.rb +46 -0
- data/lib/slideshow/commands/quick.rb +88 -0
- data/lib/slideshow/config.rb +243 -0
- data/lib/slideshow/filters/debug_filter.rb +75 -0
- data/lib/slideshow/filters/headers_filter.rb +46 -0
- data/lib/slideshow/filters/slide_filter.rb +114 -0
- data/lib/slideshow/filters/text_filter.rb +140 -0
- data/lib/slideshow/headers.rb +89 -0
- data/lib/slideshow/helpers/background_helper.rb +151 -0
- data/lib/slideshow/helpers/capture_helper.rb +138 -0
- data/lib/slideshow/helpers/directive_helper.rb +45 -0
- data/lib/slideshow/helpers/markdown_helper.rb +20 -0
- data/lib/slideshow/helpers/source_helper.rb +41 -0
- data/lib/slideshow/helpers/step_helper.rb +35 -0
- data/lib/slideshow/helpers/syntax/coderay_helper.rb +86 -0
- data/lib/slideshow/helpers/syntax/sh_helper.rb +63 -0
- data/lib/slideshow/helpers/syntax/uv_helper.rb +92 -0
- data/lib/slideshow/helpers/text_helper.rb +132 -0
- data/lib/slideshow/manifest_helpers.rb +99 -0
- data/lib/slideshow/markup/markdown.rb +20 -0
- data/lib/slideshow/markup/mediawiki.rb +40 -0
- data/lib/slideshow/markup/rest.rb +19 -0
- data/lib/slideshow/markup/textile.rb +70 -0
- data/lib/slideshow/models.rb +98 -0
- data/lib/slideshow/plugin_helpers.rb +64 -0
- data/lib/slideshow/slide.rb +120 -0
- data/lib/slideshow/version.rb +28 -0
- metadata +197 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 1909475f8777c608a8bf86b2939961778e1d514b
|
4
|
+
data.tar.gz: cb59c6eb9e2e315114879810996fc6e6cbf067ff
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d9eab29dea1952d365b35ef5ffb216fa1926d788846148310436eeb4fedac6192a01fbd4a3e388a94effbcc8ba00c1b01295308ae7492856dfa1d323bc4ccf2a
|
7
|
+
data.tar.gz: d33bace3aaa76166a71d0b93ac892409af422f9a56804fd81de95997dbd205f49bf1e017c198214c0289d7807e8f5b1cd2629b48bb6be7a6a2fcd1cea139e7f4
|
data/HISTORY.md
ADDED
@@ -0,0 +1,171 @@
|
|
1
|
+
=== 0.9.8 / 2011-02-06
|
2
|
+
|
3
|
+
* Added support for HTTPS and HTTP redirect for downloads
|
4
|
+
* Update builtin S6 blank template
|
5
|
+
|
6
|
+
=== 0.9.7 / 2010-07-22
|
7
|
+
|
8
|
+
* Added support for reStructedText (using pandoc-ruby gem)
|
9
|
+
* Update builtin S6 blank templates (toggle slide counter, debug, etc.)
|
10
|
+
* Update SyntaxHighlighter helper
|
11
|
+
|
12
|
+
=== 0.9.6 / 2010-07-18
|
13
|
+
|
14
|
+
* Update builtin S6 blank templates (adding autoplay, custom transitions, custom title selector, and more)
|
15
|
+
|
16
|
+
=== 0.9.5 / 2010-07-14
|
17
|
+
|
18
|
+
* Minor fix (for custom converter methods)
|
19
|
+
|
20
|
+
=== 0.9.4 / 2010-07-14
|
21
|
+
|
22
|
+
* Added support for custom converter methods (for Markdown processing)
|
23
|
+
|
24
|
+
=== 0.9.3 / 2010-07-13
|
25
|
+
|
26
|
+
* Added support for pandoc-ruby (for Markdown processing); skip %-filters; break slides using div/h1 rule [Thanks David Sanson]
|
27
|
+
|
28
|
+
=== 0.9.2 / 2010-07-11
|
29
|
+
|
30
|
+
* Change default template pack from s6gradients to s6blank
|
31
|
+
* Added syntax highlighting helper (sh) for SyntaxHighlighter JavaScript Library
|
32
|
+
* Added gradient and background helper
|
33
|
+
* Added simplified parameters for Django-style expressions and statements
|
34
|
+
* Added support for %-directives (e.g. %helper, %css, %yourown, etc)
|
35
|
+
* Minor fixes
|
36
|
+
|
37
|
+
=== 0.9 / 2010-07-04
|
38
|
+
|
39
|
+
* Added support for !SLIDE (and alternative syntax %slide)
|
40
|
+
* Added support for comments using %, %begin/%end and %end
|
41
|
+
* Added more helpers (step, google_analytics, left/right for two-column layouts)
|
42
|
+
* Added support for Django-style expressions and statements as an alternative to <% %>
|
43
|
+
* Added support for configuring text filters in slideshow.yml
|
44
|
+
* Added support for configuring Markdown engines in slideshow.yml
|
45
|
+
* Added fetch shortcuts (configure in slideshow.yml)
|
46
|
+
* Added support for template manifests w/o .txt extensions
|
47
|
+
* Removed old options -s5,--fullerscreen (use -t s5blank or -t fullerscreen instead)
|
48
|
+
|
49
|
+
=== 0.8.5 / 2010-06-25
|
50
|
+
|
51
|
+
* Added workaround for RedCloth 4 (Java-only) multi-byte character bug
|
52
|
+
|
53
|
+
=== 0.8.4 / 2010-06-24
|
54
|
+
|
55
|
+
* Added support for proxy via HTTP_PROXY env for fetching templates from the internet
|
56
|
+
|
57
|
+
=== 0.8.3 / 2010-06-23
|
58
|
+
|
59
|
+
* Added support for @slides and @content variables in templates
|
60
|
+
|
61
|
+
=== 0.8.2 / 2010-06-19
|
62
|
+
|
63
|
+
* Add pdf templates to built-in S6 template package
|
64
|
+
* Started to add hash support to S6 script
|
65
|
+
|
66
|
+
=== 0.8.1 / 2010-06-13
|
67
|
+
|
68
|
+
* Add patches for Ruby 1.9 compatibility [Thanks Lorenzo Riccucci]
|
69
|
+
* Replaced BlueCloth 1.x with Kramdown 0.8 as default markdown engine
|
70
|
+
* Minor fixes
|
71
|
+
|
72
|
+
=== 0.8 / 2009-03-14
|
73
|
+
|
74
|
+
* Added -f/--fetch URI option; lets you fetch templates from the internet
|
75
|
+
* Added -l/--list option; list all installed templates
|
76
|
+
* Added -c/--config PATH option; lets you set config folder (default is ~/.slideshow)
|
77
|
+
* Moved S5 v11 blank package out of core/gem
|
78
|
+
|
79
|
+
=== 0.7.8 / 2009-03-09
|
80
|
+
|
81
|
+
* Added SLIDESHOWOPT env variable; lets you set default command line options (e.g. -o slides)
|
82
|
+
* Using Hoe Rake tasks to manage gem; adding required files and build script
|
83
|
+
* Move templates folder to top-level (out of lib/)
|
84
|
+
* Minor code clean-up
|
85
|
+
|
86
|
+
=== 0.7.7 / 2009-03-02
|
87
|
+
|
88
|
+
* Added new helpers for syntax highlighting (using ultraviolet and coderay gems)
|
89
|
+
|
90
|
+
=== 0.7.6 / 2009-02-24
|
91
|
+
|
92
|
+
* Added plugin/helpers support
|
93
|
+
* Added include and content_for helpers
|
94
|
+
* Added __SKIP__/__END__ pragmas
|
95
|
+
|
96
|
+
=== 0.7.5 / 2009-02-19
|
97
|
+
|
98
|
+
* Updated s6 templates (added support for steps/incrementals)
|
99
|
+
|
100
|
+
=== 0.7.4 / 2009-02-06
|
101
|
+
|
102
|
+
* Added sample template package generation for S5 v11 blank package
|
103
|
+
|
104
|
+
=== 0.7.3 / 2009-02-04
|
105
|
+
|
106
|
+
* Added check for installed markdown libs/gems
|
107
|
+
* Added support for rdiscount, rpeg-markdown libs/gems
|
108
|
+
|
109
|
+
=== 0.7.2 / 2009-01-27
|
110
|
+
|
111
|
+
* Added support for output directory switch -o/--output and relative or absolute source file [Thanks Jorge L. Cangas]
|
112
|
+
|
113
|
+
=== 0.7.1 / 2009-01-26
|
114
|
+
|
115
|
+
* Fixed newline in manifests for file paths on unix bug
|
116
|
+
|
117
|
+
=== 0.7 / 2009-01-26
|
118
|
+
|
119
|
+
* Adding support for custom template packages using manifests
|
120
|
+
|
121
|
+
=== 0.6.1 / 2008-08-31
|
122
|
+
|
123
|
+
* Fixed gradient header bug [Thanks Suraj N. Kurapati]
|
124
|
+
|
125
|
+
=== 0.6 / 2008-08-26
|
126
|
+
|
127
|
+
* Added support for custom templates
|
128
|
+
|
129
|
+
=== 0.5.2 / 2008-07-23
|
130
|
+
|
131
|
+
* Pumped RedCloth gem dependency to use new 4.0 release
|
132
|
+
|
133
|
+
=== 0.5.1 / 2008-07-08
|
134
|
+
|
135
|
+
* Added support for S6 JavaScript slide shows as new default
|
136
|
+
|
137
|
+
=== 0.5 / 2008-07-03
|
138
|
+
|
139
|
+
* Added support for S5
|
140
|
+
|
141
|
+
=== 0.4.2 / 2008-05-20
|
142
|
+
|
143
|
+
* Added escaping of code blocks and unescaping of html entities in highlighted code
|
144
|
+
|
145
|
+
=== 0.4.1 / 2008-05-19
|
146
|
+
|
147
|
+
* {{{ and }}} shortcuts now supported standing in for <pre class='code'> and </pre>
|
148
|
+
* Added patch for h1 pattern
|
149
|
+
|
150
|
+
=== 0.4 / 2008-05-17
|
151
|
+
|
152
|
+
* Added support for code syntax highlighting using Ultraviolet gem [Thanks zimbatm]
|
153
|
+
|
154
|
+
=== 0.3.1 / 2008-05-17
|
155
|
+
|
156
|
+
* Switched markdown processor to maruku gem [Thanks zimbatm]
|
157
|
+
* Fix gem executable install for unix systems [Thanks zimbatm]
|
158
|
+
|
159
|
+
=== 0.3 / 2008-03-09
|
160
|
+
|
161
|
+
* Added support for Markdown using BlueCloth
|
162
|
+
* Moved all templates into templates folder processed using erb (embedded ruby)
|
163
|
+
|
164
|
+
=== 0.2 / 2008-02-26
|
165
|
+
|
166
|
+
* Added theming support using svg gradients
|
167
|
+
* Added compatibility support for Opera Show (no browser plugin/addon required)
|
168
|
+
|
169
|
+
=== 0.1 / 2008-02-17
|
170
|
+
|
171
|
+
* Everything is new. First release
|
data/Manifest.txt
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
HISTORY.md
|
2
|
+
Manifest.txt
|
3
|
+
README.md
|
4
|
+
Rakefile
|
5
|
+
config/slideshow.builtin.yml
|
6
|
+
config/slideshow.index.yml
|
7
|
+
config/slideshow.yml
|
8
|
+
lib/slideshow/commands/fetch.rb
|
9
|
+
lib/slideshow/commands/gen.rb
|
10
|
+
lib/slideshow/commands/list.rb
|
11
|
+
lib/slideshow/commands/plugins.rb
|
12
|
+
lib/slideshow/commands/quick.rb
|
13
|
+
lib/slideshow/config.rb
|
14
|
+
lib/slideshow/filters/debug_filter.rb
|
15
|
+
lib/slideshow/filters/headers_filter.rb
|
16
|
+
lib/slideshow/filters/slide_filter.rb
|
17
|
+
lib/slideshow/filters/text_filter.rb
|
18
|
+
lib/slideshow/headers.rb
|
19
|
+
lib/slideshow/helpers/background_helper.rb
|
20
|
+
lib/slideshow/helpers/capture_helper.rb
|
21
|
+
lib/slideshow/helpers/directive_helper.rb
|
22
|
+
lib/slideshow/helpers/markdown_helper.rb
|
23
|
+
lib/slideshow/helpers/source_helper.rb
|
24
|
+
lib/slideshow/helpers/step_helper.rb
|
25
|
+
lib/slideshow/helpers/syntax/coderay_helper.rb
|
26
|
+
lib/slideshow/helpers/syntax/sh_helper.rb
|
27
|
+
lib/slideshow/helpers/syntax/uv_helper.rb
|
28
|
+
lib/slideshow/helpers/text_helper.rb
|
29
|
+
lib/slideshow/manifest_helpers.rb
|
30
|
+
lib/slideshow/markup/markdown.rb
|
31
|
+
lib/slideshow/markup/mediawiki.rb
|
32
|
+
lib/slideshow/markup/rest.rb
|
33
|
+
lib/slideshow/markup/textile.rb
|
34
|
+
lib/slideshow/models.rb
|
35
|
+
lib/slideshow/plugin_helpers.rb
|
36
|
+
lib/slideshow/slide.rb
|
37
|
+
lib/slideshow/version.rb
|
data/README.md
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# slideshow-models gem - slide show (S9) models 'n' machinery for easy (re)use
|
2
|
+
|
3
|
+
* home :: [github.com/slideshow-s9/slideshow-models](https://github.com/slideshow-s9/slideshow-models)
|
4
|
+
* bugs :: [github.com/slideshow-s9/slideshow-models/issues](https://github.com/slideshow-s9/slideshow-models/issues)
|
5
|
+
* gem :: [rubygems.org/gems/slideshow-models](https://rubygems.org/gems/slideshow-models)
|
6
|
+
* rdoc :: [rubydoc.info/gems/slideshow-models](http://rubydoc.info/gems/slideshow-models)
|
7
|
+
* forum :: [groups.google.com/group/webslideshow](http://groups.google.com/group/webslideshow)
|
8
|
+
|
9
|
+
## USAGE
|
10
|
+
|
11
|
+
To be done
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
## LICENSE
|
16
|
+
|
17
|
+
The `slideshow-models` scripts and templates are dedicated to the public domain.
|
18
|
+
Use it as you please with no restrictions whatsoever.
|
19
|
+
|
20
|
+
## QUESTION? COMMENTS?
|
21
|
+
|
22
|
+
Send them along to the [Free Web Slide Show Alternatives (S5, S6, S9, Slidy And Friends) Forum/Mailing List](http://groups.google.com/group/webslideshow).
|
23
|
+
Thanks!
|
data/Rakefile
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'hoe'
|
2
|
+
require './lib/slideshow/version.rb'
|
3
|
+
|
4
|
+
Hoe.spec 'slideshow-models' do
|
5
|
+
|
6
|
+
self.version = Slideshow::VERSION
|
7
|
+
|
8
|
+
self.summary = "slideshow-models - slide show (S9) models 'n' machinery for easy (re)use"
|
9
|
+
self.description = summary
|
10
|
+
|
11
|
+
self.urls = ['https://github.com/slideshow-s9/slideshow-models']
|
12
|
+
|
13
|
+
self.author = 'Gerald Bauer'
|
14
|
+
self.email = 'webslideshow@googlegroups.com'
|
15
|
+
|
16
|
+
self.extra_deps = [
|
17
|
+
['props', '>= 1.1.2'],
|
18
|
+
['logutils', '>= 0.6.1'],
|
19
|
+
['markdown', '>= 1.2.0'],
|
20
|
+
['textutils', '>= 0.10.0'],
|
21
|
+
['pakman', '>= 0.5.0'],
|
22
|
+
['activesupport'],
|
23
|
+
## ['wikicloth', '>= 0.8.0'] make it a soft dependency # mediawiki markup engine
|
24
|
+
## ['RedCloth','>= 4.2.9'] make it a soft dependency # textile markup engine
|
25
|
+
]
|
26
|
+
|
27
|
+
# switch extension to .markdown for gihub formatting
|
28
|
+
self.readme_file = 'README.md'
|
29
|
+
self.history_file = 'HISTORY.md'
|
30
|
+
|
31
|
+
self.licenses = ['Public Domain']
|
32
|
+
|
33
|
+
self.spec_extras = {
|
34
|
+
required_ruby_version: '>= 1.9.2'
|
35
|
+
}
|
36
|
+
|
37
|
+
end
|
@@ -0,0 +1,69 @@
|
|
1
|
+
###########################################################################################
|
2
|
+
# Slide Show (S9) Update Index for Template Packs, Quick Starter Samples 'n' Plugins
|
3
|
+
|
4
|
+
# find the latest version online at
|
5
|
+
# - https://github.com/slideshow-s9/registry
|
6
|
+
#
|
7
|
+
# use $ slideshow update -- for automatic update e.g. download the latest slideshow.index.yml file
|
8
|
+
|
9
|
+
|
10
|
+
#############
|
11
|
+
# shortcuts for fetching template packs (w/ optional quick starter samples)
|
12
|
+
# maps shortcut to URI
|
13
|
+
|
14
|
+
|
15
|
+
s6blank: https://raw.github.com/slideshow-templates/slideshow-s6-blank/master/s6blank.txt
|
16
|
+
|
17
|
+
s6syntax: https://raw.github.com/slideshow-templates/slideshow-s6-syntax-highlighter/master/s6syntax.txt
|
18
|
+
|
19
|
+
s5blank: https://raw.github.com/slideshow-templates/slideshow-s5-blank/master/s5blank.txt
|
20
|
+
|
21
|
+
s5themes: https://raw.github.com/slideshow-templates/slideshow-s5-themes/master/s5themes.txt
|
22
|
+
|
23
|
+
g5: https://raw.github.com/slideshow-templates/slideshow-google-html5-slides/master/g5.txt
|
24
|
+
|
25
|
+
slidy:
|
26
|
+
- https://raw.github.com/slideshow-templates/slideshow-slidy/master/slidy.txt
|
27
|
+
- https://raw.github.com/slideshow-templates/slideshow-slidy/master/slidy.txt.quick
|
28
|
+
|
29
|
+
csss:
|
30
|
+
- https://raw.github.com/slideshow-templates/slideshow-csss/master/csss.txt
|
31
|
+
- https://raw.github.com/slideshow-templates/slideshow-csss/master/csss.txt.quick
|
32
|
+
|
33
|
+
deck.js:
|
34
|
+
- https://raw.github.com/slideshow-templates/slideshow-deck.js/master/deck.js.txt
|
35
|
+
- https://raw.github.com/slideshow-templates/slideshow-deck.js/master/deck.js.txt.quick
|
36
|
+
|
37
|
+
impress.js:
|
38
|
+
- https://raw.github.com/slideshow-templates/slideshow-impress.js/master/impress.js.txt
|
39
|
+
- https://raw.github.com/slideshow-templates/slideshow-impress.js/master/impress.js.txt.quick
|
40
|
+
|
41
|
+
shower: https://raw.github.com/slideshow-templates/slideshow-shower/master/shower.txt
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
reveal.js: https://raw.github.com/avillafiorita/slideshow-reveal.js/master/reveal.txt
|
46
|
+
|
47
|
+
# alias - rename manifest to reveal.js.txt -- possible?
|
48
|
+
reveal: https://raw.github.com/avillafiorita/slideshow-reveal.js/master/reveal.txt
|
49
|
+
|
50
|
+
|
51
|
+
##############
|
52
|
+
# Plugins
|
53
|
+
|
54
|
+
analytics: https://raw.github.com/slideshow-s9/slideshow-plugins/master/analytics/analytics.txt.plugin
|
55
|
+
|
56
|
+
tables: https://raw.github.com/slideshow-s9/slideshow-plugins/master/tables/tables.txt.plugin
|
57
|
+
|
58
|
+
snippets: https://raw.github.com/slideshow-s9/slideshow-plugins/master/snippets/snippets.txt.plugin
|
59
|
+
|
60
|
+
plugins:
|
61
|
+
- https://raw.github.com/slideshow-s9/slideshow-plugins/master/analytics/analytics.txt.plugin
|
62
|
+
- https://raw.github.com/slideshow-s9/slideshow-plugins/master/tables/tables.txt.plugin
|
63
|
+
- https://raw.github.com/slideshow-s9/slideshow-plugins/master/snippets/snippets.txt.plugin
|
64
|
+
|
65
|
+
|
66
|
+
#############################
|
67
|
+
# Quick Starter Stamples
|
68
|
+
|
69
|
+
formatting: https://raw.github.com/slideshow-s9/formatting/master/formatting.txt.quick
|
@@ -0,0 +1,76 @@
|
|
1
|
+
#########################################
|
2
|
+
# slideshow configuration defaults
|
3
|
+
#
|
4
|
+
# override settings in:
|
5
|
+
# ~/slideshow.yml in home folder
|
6
|
+
# or
|
7
|
+
# ./slideshow.yml in working folder
|
8
|
+
|
9
|
+
|
10
|
+
######################
|
11
|
+
# lets you define default/fallback headers
|
12
|
+
|
13
|
+
headers:
|
14
|
+
generator: "<%= Slideshow.generator %>"
|
15
|
+
author: Your Name Here
|
16
|
+
email: Your Email Here
|
17
|
+
company: Your Company Here
|
18
|
+
title: Your Title Here
|
19
|
+
subtitle: Your Subtitle Here
|
20
|
+
footer: Your Footer Here
|
21
|
+
subfooter: Your Subfooter Here
|
22
|
+
date: "<%= Date.today %>"
|
23
|
+
|
24
|
+
# todo: use nested config?? eg.
|
25
|
+
# gradient:
|
26
|
+
# theme: dark
|
27
|
+
# color1:
|
28
|
+
gradient-theme: diagonal
|
29
|
+
gradient-colors: red orange
|
30
|
+
|
31
|
+
# todo: use nested config??
|
32
|
+
#
|
33
|
+
# SyntaxHighligher (sh) | ultraviolet (uv) | coderay (cr)
|
34
|
+
code-engine: sh
|
35
|
+
# Text Mate Hyperlink for Source?
|
36
|
+
code-txmt: false
|
37
|
+
# todo: add code-linenumbers??
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
|
42
|
+
# your google analytics code
|
43
|
+
analytics:
|
44
|
+
google: UA-XXX
|
45
|
+
|
46
|
+
|
47
|
+
########################################################3
|
48
|
+
### text/markup (textile, markdown) processing config
|
49
|
+
|
50
|
+
# filters to run before markup processing
|
51
|
+
filters:
|
52
|
+
- skip-end-directive
|
53
|
+
- directives_bang_style_to_percent_style
|
54
|
+
- directives_percent_style
|
55
|
+
- comments-percent-style
|
56
|
+
- leading-headers
|
57
|
+
- erb-django-style
|
58
|
+
- erb-rename-helper-hack
|
59
|
+
- dump_content_to_file_debug_text_erb
|
60
|
+
- erb
|
61
|
+
- code-block-curly-style
|
62
|
+
- dump_content_to_file_debug_text
|
63
|
+
|
64
|
+
|
65
|
+
# markup (textile, markdown, rest) config
|
66
|
+
|
67
|
+
textile:
|
68
|
+
extnames: [ .textile, .t ]
|
69
|
+
|
70
|
+
rest:
|
71
|
+
extnames: [ .rst, .rest ]
|
72
|
+
|
73
|
+
mediawiki:
|
74
|
+
extnames: [ .wiki, .mediawiki, .mw ]
|
75
|
+
|
76
|
+
# NB: markdown now configured in markdown.yml (using markdown gem)
|
@@ -0,0 +1,123 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
module Slideshow
|
4
|
+
|
5
|
+
class Fetch
|
6
|
+
|
7
|
+
### fix: remove opts, use config (wrapped!!)
|
8
|
+
|
9
|
+
include LogUtils::Logging
|
10
|
+
|
11
|
+
def initialize( opts, config )
|
12
|
+
@opts = opts
|
13
|
+
@config = config
|
14
|
+
end
|
15
|
+
|
16
|
+
attr_reader :opts, :config
|
17
|
+
|
18
|
+
|
19
|
+
def fetch_all
|
20
|
+
config.default_fetch_shortcuts.each do |shortcut|
|
21
|
+
fetch( shortcut )
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
|
26
|
+
def update # update shortcut index
|
27
|
+
dest = config.shortcut_index_file
|
28
|
+
|
29
|
+
destfull = File.expand_path( dest )
|
30
|
+
destpath = File.dirname( destfull )
|
31
|
+
FileUtils.makedirs( destpath ) unless File.directory?( destpath )
|
32
|
+
|
33
|
+
logger.debug "destfull=>#{destfull}<"
|
34
|
+
logger.debug "destpath=>#{destpath}<"
|
35
|
+
|
36
|
+
## todo/fix: use a config setting for index url (do NOT hard core)
|
37
|
+
src = 'https://raw.github.com/slideshow-s9/registry/master/slideshow.index.yml'
|
38
|
+
|
39
|
+
puts "Updating shortcut index - downloading '#{src}'..."
|
40
|
+
::Fetcher::Worker.new.copy( src, destfull )
|
41
|
+
end
|
42
|
+
|
43
|
+
|
44
|
+
def fetch( shortcut_or_source )
|
45
|
+
|
46
|
+
logger.debug "fetch >#{shortcut_or_source}<"
|
47
|
+
|
48
|
+
## check for builtin shortcut (assume no / or \)
|
49
|
+
if shortcut_or_source.index( '/' ).nil? && shortcut_or_source.index( '\\' ).nil?
|
50
|
+
shortcut = shortcut_or_source
|
51
|
+
sources = config.map_fetch_shortcut( shortcut )
|
52
|
+
|
53
|
+
if sources.empty?
|
54
|
+
puts "** Error: No mapping found for shortcut '#{shortcut}'."
|
55
|
+
return
|
56
|
+
end
|
57
|
+
puts " Mapping fetch shortcut '#{shortcut}' to: #{sources.join(',')}"
|
58
|
+
else
|
59
|
+
sources = [shortcut_or_source] # pass arg through unmapped
|
60
|
+
end
|
61
|
+
|
62
|
+
sources.each do |source|
|
63
|
+
|
64
|
+
## if manifest includes .plugin assume it's a plugin
|
65
|
+
if source.include?( '.txt.plugin' ) || source.include?( '.plugin.txt' )
|
66
|
+
fetch_plugin( source )
|
67
|
+
elsif source.include?( '.txt.quick' ) || source.include?( '.quick.txt' )
|
68
|
+
fetch_quick( source )
|
69
|
+
else # otherwise assume it's a template pack
|
70
|
+
fetch_template( source )
|
71
|
+
end
|
72
|
+
|
73
|
+
end
|
74
|
+
|
75
|
+
end # method run
|
76
|
+
|
77
|
+
|
78
|
+
def fetch_template( src )
|
79
|
+
# src = 'http://github.com/geraldb/slideshow/raw/d98e5b02b87ee66485431b1bee8fb6378297bfe4/code/templates/fullerscreen.txt'
|
80
|
+
# src = 'http://github.com/geraldb/sandbox/raw/13d4fec0908fbfcc456b74dfe2f88621614b5244/s5blank/s5blank.txt'
|
81
|
+
uri = URI.parse( src )
|
82
|
+
logger.debug "scheme: #{uri.scheme}, host: #{uri.host}, port: #{uri.port}, path: #{uri.path}"
|
83
|
+
|
84
|
+
pakname = File.basename( uri.path ).downcase.gsub('.txt','')
|
85
|
+
pakpath = File.expand_path( "#{config.config_dir}/templates/#{pakname}" )
|
86
|
+
|
87
|
+
logger.debug "packname >#{pakname}<"
|
88
|
+
logger.debug "pakpath >#{pakpath}<"
|
89
|
+
|
90
|
+
Pakman::Fetcher.new.fetch_pak( src, pakpath )
|
91
|
+
end
|
92
|
+
|
93
|
+
def fetch_quick( src )
|
94
|
+
uri = URI.parse( src )
|
95
|
+
logger.debug "scheme: #{uri.scheme}, host: #{uri.host}, port: #{uri.port}, path: #{uri.path}"
|
96
|
+
|
97
|
+
# downcase basename w/ extension (remove .txt)
|
98
|
+
pakname = File.basename( uri.path ).downcase.gsub('.txt','')
|
99
|
+
pakpath = File.expand_path( "#{config.config_dir}/templates/#{pakname}" )
|
100
|
+
|
101
|
+
logger.debug "pakname >#{pakname}<"
|
102
|
+
logger.debug "pakpath >#{pakpath}<"
|
103
|
+
|
104
|
+
Pakman::Fetcher.new.fetch_pak( src, pakpath )
|
105
|
+
end
|
106
|
+
|
107
|
+
def fetch_plugin( src )
|
108
|
+
uri = URI.parse( src )
|
109
|
+
logger.debug "scheme: #{uri.scheme}, host: #{uri.host}, port: #{uri.port}, path: #{uri.path}"
|
110
|
+
|
111
|
+
# downcase basename w/ extension (remove .txt)
|
112
|
+
pakname = File.basename( uri.path ).downcase.gsub('.txt','').gsub('.plugin','')
|
113
|
+
pakpath = File.expand_path( "#{config.config_dir}/plugins/#{pakname}" )
|
114
|
+
|
115
|
+
logger.debug "pakname >#{pakname}<"
|
116
|
+
logger.debug "pakpath >#{pakpath}<"
|
117
|
+
|
118
|
+
Pakman::Fetcher.new.fetch_pak( src, pakpath )
|
119
|
+
end
|
120
|
+
|
121
|
+
end # class Fetch
|
122
|
+
|
123
|
+
end # module Slideshow
|