slideshow-models 4.0.0 → 4.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/slideshow/commands/manifest_finder.rb +28 -13
- data/lib/slideshow/opts.rb +8 -8
- data/lib/slideshow/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 497b834255f34416ffb537e7281ed34767d30a6c
|
4
|
+
data.tar.gz: e68d5e214b22c7e37af03b123e0ca71b21a0333f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73ba1e67d666e9c0ad5767474c41192bac0ccd7e0db7c63cfb0ff418e021155cb5b9d24dd3a03fca57dce00fd6316ba7464987ddfa82e19521f2086a9b03a221
|
7
|
+
data.tar.gz: a1d4353f9118dba6bf4f7c4acb381fae9dcc9e287ce90a2f319f8b5a264820bfcdf2810f04e42b19e0d6804a1839e31d7a3de436105b2063e3ae0c3796e84161
|
@@ -3,7 +3,7 @@
|
|
3
3
|
module Slideshow
|
4
4
|
|
5
5
|
class ManifestFinder
|
6
|
-
|
6
|
+
|
7
7
|
include LogUtils::Logging
|
8
8
|
|
9
9
|
include ManifestHelper
|
@@ -11,49 +11,64 @@ class ManifestFinder
|
|
11
11
|
|
12
12
|
def initialize( config )
|
13
13
|
@config = config
|
14
|
-
@usrdir = File.expand_path( Dir.pwd ) # save original (current) working directory
|
14
|
+
@usrdir = File.expand_path( Dir.pwd ) # save original (current) working directory
|
15
15
|
end
|
16
|
-
|
16
|
+
|
17
17
|
attr_reader :config
|
18
18
|
attr_reader :usrdir # original working dir (user called slideshow from)
|
19
19
|
|
20
20
|
|
21
21
|
def find_manifestsrc( manifest_arg ) ## rename - just use find_manifest ??
|
22
|
-
|
22
|
+
|
23
23
|
manifest_path_or_name = manifest_arg.dup ## make a copy
|
24
|
-
|
24
|
+
|
25
25
|
# add .txt file extension if missing (for convenience)
|
26
26
|
if manifest_path_or_name.downcase.ends_with?( '.txt' ) == false
|
27
27
|
manifest_path_or_name << '.txt'
|
28
28
|
end
|
29
|
-
|
29
|
+
|
30
30
|
logger.debug "manifest=#{manifest_path_or_name}"
|
31
|
-
|
32
|
-
# check if file exists (if yes use custom template package!) - allows you to override builtin package with same name
|
31
|
+
|
32
|
+
# check if file exists (if yes use custom template package!) - allows you to override builtin package with same name
|
33
33
|
if File.exists?( manifest_path_or_name )
|
34
34
|
manifestsrc = manifest_path_or_name
|
35
35
|
else
|
36
36
|
# check for builtin manifests
|
37
37
|
manifests = installed_template_manifests
|
38
|
-
matches = manifests.select { |m| m[0] == manifest_path_or_name }
|
38
|
+
matches = manifests.select { |m| m[0] == manifest_path_or_name }
|
39
39
|
|
40
40
|
if matches.empty?
|
41
41
|
puts "*** error: unknown template manifest '#{manifest_path_or_name}'"
|
42
|
-
|
42
|
+
puts
|
43
|
+
puts "Use"
|
44
|
+
puts " slideshow list # or"
|
45
|
+
puts " slideshow ls"
|
46
|
+
puts "to see what template packs you have installed."
|
47
|
+
puts
|
48
|
+
puts "Use"
|
49
|
+
puts " slideshow install #{manifest_path_or_name.sub('.txt','')} # or"
|
50
|
+
puts " slideshow i #{manifest_path_or_name.sub('.txt','')}"
|
51
|
+
puts "to (try to) install the missing template pack."
|
52
|
+
puts
|
53
|
+
puts "See github.com/slideshow-templates for some ready-to-use/download template packs"
|
54
|
+
puts "or use your very own."
|
55
|
+
puts
|
56
|
+
|
57
|
+
# todo: list installed manifests - why? why not?
|
43
58
|
exit 2
|
44
59
|
end
|
45
|
-
|
60
|
+
|
46
61
|
manifestsrc = matches[0][1]
|
47
62
|
end
|
48
63
|
|
49
64
|
### todo: use File.expand_path( xx, relative_to ) always with second arg
|
50
65
|
## do NOT default to cwd (because cwd will change!)
|
51
|
-
|
66
|
+
|
52
67
|
# Reference src with absolute path, because this can be used with different pwd
|
53
68
|
manifestsrc = File.expand_path( manifestsrc, usrdir )
|
54
69
|
manifestsrc
|
55
70
|
end
|
56
|
-
|
71
|
+
|
57
72
|
|
58
73
|
end # class ManifestFinder
|
59
74
|
|
data/lib/slideshow/opts.rb
CHANGED
@@ -8,10 +8,10 @@ class Opts
|
|
8
8
|
def header_level=(value)
|
9
9
|
@header_level = value.to_i
|
10
10
|
end
|
11
|
-
|
11
|
+
|
12
12
|
def header_level
|
13
13
|
## todo: check 0 is not nil?
|
14
|
-
@header_level || 2 ## note: (new) default is 2 -- note: 2 also breaks on 1
|
14
|
+
@header_level || 2 ## note: (new) default is 2 -- note: 2 also breaks on 1
|
15
15
|
end
|
16
16
|
|
17
17
|
def slide=(boolean)
|
@@ -35,7 +35,7 @@ class Opts
|
|
35
35
|
def verbose=(boolean) # add: alias for debug ??
|
36
36
|
@verbose = boolean
|
37
37
|
end
|
38
|
-
|
38
|
+
|
39
39
|
def verbose?
|
40
40
|
return false if @verbose.nil? # default verbose/debug flag is false
|
41
41
|
@verbose == true
|
@@ -55,7 +55,7 @@ class Opts
|
|
55
55
|
def quick_manifest=(value)
|
56
56
|
@quick_manifest = value
|
57
57
|
end
|
58
|
-
|
58
|
+
|
59
59
|
def quick_manifest
|
60
60
|
@quick_manifest || 'welcome'
|
61
61
|
end
|
@@ -81,7 +81,7 @@ class Opts
|
|
81
81
|
# fix: use os-agnostic delimiter (use : for Mac/Unix?)
|
82
82
|
@includes.nil? ? [] : @includes.split( ';' )
|
83
83
|
end
|
84
|
-
|
84
|
+
|
85
85
|
def has_includes?
|
86
86
|
@includes.nil? ? false : true
|
87
87
|
end
|
@@ -90,16 +90,16 @@ class Opts
|
|
90
90
|
def manifest=(value)
|
91
91
|
@manifest = value
|
92
92
|
end
|
93
|
-
|
93
|
+
|
94
94
|
def manifest
|
95
|
-
@manifest || '
|
95
|
+
@manifest || 's6blank'
|
96
96
|
end
|
97
97
|
|
98
98
|
|
99
99
|
def config_path=(value)
|
100
100
|
@config_path = value
|
101
101
|
end
|
102
|
-
|
102
|
+
|
103
103
|
def config_path
|
104
104
|
@config_path || File.join( Env.home, '.slideshow' )
|
105
105
|
end
|
data/lib/slideshow/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slideshow-models
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gerald Bauer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-10-
|
11
|
+
date: 2017-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: props
|