Class: Statique

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
Singleton
Defined in:
lib/statique/app.rb,
lib/statique/cli.rb,
lib/statique/mode.rb,
lib/statique/version.rb,
lib/statique/cli/init.rb,
lib/statique/discover.rb,
lib/statique/document.rb,
lib/statique/cli/build.rb,
lib/statique/paginator.rb,
lib/statique/cli/server.rb,
lib/statique/configuration.rb,
lib/statique.rb

Defined Under Namespace

Classes: App, CLI, Configuration, Discover, Document, Error, Mode, Paginator

Constant Summary collapse

VERSION =
"0.1.4"

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeStatique

Returns a new instance of Statique.



32
33
34
35
36
37
# File 'lib/statique.rb', line 32

def initialize
  @mode = Mode.new
  @configuration = Configuration.new
  @discover = Discover.new(configuration.paths.content, self)
  @pwd = Pathname.pwd.freeze
end

Instance Attribute Details

#build_queueObject (readonly)

Returns the value of attribute build_queue.



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

def build_queue
  @build_queue
end

#configurationObject (readonly)

Returns the value of attribute configuration.



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

def configuration
  @configuration
end

#discoverObject (readonly)

Returns the value of attribute discover.



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

def discover
  @discover
end

#modeObject (readonly)

Returns the value of attribute mode.



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

def mode
  @mode
end

#pwdObject (readonly)

Returns the value of attribute pwd.



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

def pwd
  @pwd
end

Class Method Details

.uiObject



51
52
53
54
55
# File 'lib/statique.rb', line 51

def self.ui
  @ui ||= TTY::Logger.new(output: $stdout) do |config|
    config.level = :debug if ENV["DEBUG"] == "true"
  end
end

Instance Method Details

#statiqueObject



39
40
41
# File 'lib/statique.rb', line 39

def statique
  self.class.instance
end

#uiObject



47
48
49
# File 'lib/statique.rb', line 47

def ui
  self.class.ui
end

#url(document_or_path) ⇒ Object



57
58
59
# File 'lib/statique.rb', line 57

def url(document_or_path)
  File.join(configuration.root_url, document_or_path.is_a?(Document) ? document_or_path.path : document_or_path)
end

#versionObject



43
44
45
# File 'lib/statique.rb', line 43

def version
  VERSION
end