Class: Monolith::Application

Inherits:
Repository show all
Defined in:
lib/monolith/application.rb

Instance Attribute Summary collapse

Attributes inherited from Repository

#path, #url

Instance Method Summary collapse

Methods inherited from Repository

#branches, #clone, #name, #prepare, #relative_path, #remote

Constructor Details

#initialize(config) ⇒ Application

Returns a new instance of Application.



5
6
7
8
# File 'lib/monolith/application.rb', line 5

def initialize(config)
  @config = config
  super(config.path)
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



3
4
5
# File 'lib/monolith/application.rb', line 3

def config
  @config
end

Instance Method Details

#branch?(name) ⇒ Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/monolith/application.rb', line 10

def branch?(name)
  config.branches.empty? || config.branches.include?(name)
end

#checkout_masterObject



14
15
16
# File 'lib/monolith/application.rb', line 14

def checkout_master
  run("checkout master")
end

#createObject



18
19
20
# File 'lib/monolith/application.rb', line 18

def create
  RepositoryCreator.new(self).create
end

#merge(repo, branch) ⇒ Object



22
23
24
# File 'lib/monolith/application.rb', line 22

def merge(repo, branch)
  BranchMerger.new(self, repo, branch).merge
end

#repositoriesObject



26
27
28
# File 'lib/monolith/application.rb', line 26

def repositories
  RepositoryFinder.new(self)
end