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.2.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)


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

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

.frameworkObject



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

def self.framework
  @@framework
end

.framework=(framework) ⇒ Object



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

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"


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

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

.media_rootObject



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

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

.media_root=(path) ⇒ Object



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

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

Raises:



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

def self.root=(path)
  raise PupuRootNotFound unless File.directory?(path)
  @@root = path
end

.strategyObject

strategies: submodules, copy



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

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

.strategy=(strategy) ⇒ Object



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

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"


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

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