Class: Docman::Application
- Inherits:
-
Object
- Object
- Docman::Application
- Includes:
- Singleton
- Defined in:
- lib/application.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#deploy_target ⇒ Object
Returns the value of attribute deploy_target.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
- #build(deploy_target, state, options = false) ⇒ Object
- #deploy(deploy_target, name, type, version) ⇒ Object
- #init(name, repo) ⇒ Object
-
#initialize ⇒ Application
constructor
A new instance of Application.
- #state(name, type, version) ⇒ Object
Constructor Details
#initialize ⇒ Application
Returns a new instance of Application.
19 20 21 22 23 |
# File 'lib/application.rb', line 19 def initialize # TODO: Define workspace properly @workspace_dir = Dir.pwd @config = YAML::load_file(File.join(Pathname(__FILE__).dirname.parent, 'config', 'config.yaml')) end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
14 15 16 |
# File 'lib/application.rb', line 14 def config @config end |
#deploy_target ⇒ Object
Returns the value of attribute deploy_target.
15 16 17 |
# File 'lib/application.rb', line 15 def deploy_target @deploy_target end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
14 15 16 |
# File 'lib/application.rb', line 14 def end |
Class Method Details
.bin ⇒ Object
46 47 48 |
# File 'lib/application.rb', line 46 def self.bin File.join root, 'bin' end |
.lib ⇒ Object
50 51 52 |
# File 'lib/application.rb', line 50 def self.lib File.join root, 'lib' end |
.root ⇒ Object
42 43 44 |
# File 'lib/application.rb', line 42 def self.root Pathname(__FILE__).dirname.parent end |
Instance Method Details
#build(deploy_target, state, options = false) ⇒ Object
29 30 31 32 |
# File 'lib/application.rb', line 29 def build(deploy_target, state, = false) = DocrootController.new(@workspace_dir, deploy_target, ).build(state) end |
#deploy(deploy_target, name, type, version) ⇒ Object
34 35 36 |
# File 'lib/application.rb', line 34 def deploy(deploy_target, name, type, version) DocrootController.new(@workspace_dir, deploy_target).deploy(name, type, version) end |
#init(name, repo) ⇒ Object
25 26 27 |
# File 'lib/application.rb', line 25 def init(name, repo) `mkdir #{name} && cd #{name} && git clone #{repo} config` end |
#state(name, type, version) ⇒ Object
38 39 40 |
# File 'lib/application.rb', line 38 def state(name, type, version) DocrootController.new(@workspace_dir, deploy_target).state(name, type, version) end |