Module: Shining

Defined in:
lib/shining.rb,
lib/shining/preso.rb,
lib/shining/errors.rb,
lib/shining/heroku.rb,
lib/shining/player.rb,
lib/ext/filemethods.rb

Defined Under Namespace

Modules: FileMethods Classes: CantParseJSONFile, Heroku, NoSuchFile, Player, Preso

Constant Summary collapse

VERSION =
File.read Shining.root/'VERSION'

Class Method Summary collapse

Class Method Details

.error(message) ⇒ Object



30
31
32
# File 'lib/shining.rb', line 30

def error message
  STDERR.puts message unless quiet?
end

.quiet!Object



13
14
15
# File 'lib/shining.rb', line 13

def quiet!
  @quiet = true
end

.quiet?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/shining.rb', line 17

def quiet?
  !!@quiet
end

.rootObject



34
35
36
# File 'lib/shining.rb', line 34

def root
  @root ||= File.expand_path File.dirname(__FILE__)/'..'
end

.sample_content_for(format = 'html') ⇒ Object



42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/shining.rb', line 42

def sample_content_for format = 'html'
  case format
  when 'markdown', 'md'
    <<-CONTENTS
# #{name}
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



25
26
27
28
# File 'lib/shining.rb', line 25

def say something
  STDOUT.puts something unless quiet?
  yield if block_given?
end

.templates_pathObject



38
39
40
# File 'lib/shining.rb', line 38

def templates_path
  root/'templates'
end

.verbose!Object



21
22
23
# File 'lib/shining.rb', line 21

def verbose!
  @quiet = false
end