Module: Pupu

Defined in:
lib/pupu/github.rb,
lib/pupu.rb,
lib/pupu/cli.rb,
lib/pupu/dsl.rb,
lib/pupu/pupu.rb,
lib/pupu/parser.rb,
lib/pupu/helpers.rb,
lib/pupu/version.rb,
lib/pupu/metadata.rb,
lib/pupu/exceptions.rb,
lib/pupu/adapters/rango.rb

Overview

TODO: standalone installer class

Defined Under Namespace

Modules: Helpers Classes: AssetNotFound, CLI, DSL, GitHub, MediaDirectoryNotExist, Metadata, Page, Parser, PluginIsAlreadyInstalled, PluginNotFoundError, Pupu, PupuRootNotFound

Constant Summary collapse

VERSION =
"0.1"

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.environmentObject



8
9
10
# File 'lib/pupu/adapters/merb.rb', line 8

def Pupu.environment
  Merb.environment
end

.environment?(environment) ⇒ Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/pupu/pupu.rb', line 28

def self.environment?(environment)
  self.environment.eql?(environment)
end

.frameworkObject



20
21
22
# File 'lib/pupu/pupu.rb', line 20

def self.framework
  @@framework
end

.framework=(framework) ⇒ Object



24
25
26
# File 'lib/pupu/pupu.rb', line 24

def self.framework=(framework)
  @@framework = framework
end

.loggerObject



12
13
14
# File 'lib/pupu/adapters/merb.rb', line 12

def Pupu.logger
  Merb.logger
end

.media_prefix=(prefix) ⇒ Object

Examples:

Pupu.media_prefix(“media”).url

=> "/media/pupu/autocompleter/javascripts/autocompleter.js"


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

def self.media_prefix=(prefix)
  MediaPath.rewrite { |path| File.join(prefix, path) }
end

.media_rootObject



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

def self.media_root
  @@media_root ||= Dir.pwd
end

.media_root=(path) ⇒ Object



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

def self.media_root=(path)
  MediaPath.media_root = path
  @@media_root = path
end

.rootObject

this must be set in adapters



12
13
14
# File 'lib/pupu/pupu.rb', line 12

def self.root
  @@root ||= Dir.pwd
end

.root=(path) ⇒ Object



16
17
18
# File 'lib/pupu/pupu.rb', line 16

def self.root=(path)
  @@root = path
end

.strategyObject

strategies: submodules, copy



54
55
56
# File 'lib/pupu/pupu.rb', line 54

def self.strategy
  @@strategy ||= :copy
end

.strategy=(strategy) ⇒ Object



58
59
60
# File 'lib/pupu/pupu.rb', line 58

def self.strategy=(strategy)
  @@strategy = strategy
end

Instance Method Details

#rewrite(&block) ⇒ Object

Examples:

Pupu.rewrite { |path| “media.domain.org/#path” }.url

# => "http://media.domain.org/pupu/autocompleter/javascripts/autocompleter.js"


49
50
51
# File 'lib/pupu/pupu.rb', line 49

def rewrite(&block)
  MediaPath.rewrite(&block)
end