Module: Shining
- Extended by:
- Term::ANSIColor
- Defined in:
- lib/shining.rb,
lib/shining/preso.rb,
lib/shining/player.rb,
lib/ext/filemethods.rb
Defined Under Namespace
Modules: FileMethods
Classes: Player, Preso
Class Method Summary
collapse
Class Method Details
.error(message) ⇒ Object
19
20
21
|
# File 'lib/shining.rb', line 19
def error message
STDERR.puts red(bold(message))
end
|
.root ⇒ Object
23
24
25
|
# File 'lib/shining.rb', line 23
def root
@root ||= File.expand_path File.dirname(__FILE__)/'..'
end
|
.sample_content_for(format = 'html') ⇒ Object
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
# File 'lib/shining.rb', line 31
def sample_content_for format = 'html'
case format
when 'markdown'
<<-CONTENTS
# #{name}
This is a new slide. It needs some lovin'!
CONTENTS
when 'haml'
<<-CONTENTS
%h1.centered #{name}
%p.centered This is a new slide. It needs some lovin'!
CONTENTS
when 'html'
<<-CONTENTS
<h1 class="centered">#{name}</h1>
<p class="centered">This is a new slide. It needs some lovin'!</p>
CONTENTS
end
end
|
.say(something) ⇒ Object
14
15
16
17
|
# File 'lib/shining.rb', line 14
def say something
STDOUT.puts(blue(something)) unless defined?(Spec) yield if block_given?
end
|
.templates_path ⇒ Object
27
28
29
|
# File 'lib/shining.rb', line 27
def templates_path
root/'templates'
end
|