Class: Propel::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/propel/runner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = [ ]) ⇒ Runner

Returns a new instance of Runner.



5
6
7
8
9
10
11
12
# File 'lib/propel/runner.rb', line 5

def initialize(args = [ ])
  @repository = GitRepository.new
  @options    = Configuration.new(args, @repository).options
  @logger     = Logger.new(@options)

  @repository.logger  = @logger
  @repository.options = @options
end

Instance Attribute Details

#loggerObject (readonly)

Returns the value of attribute logger.



3
4
5
# File 'lib/propel/runner.rb', line 3

def logger
  @logger
end

#repositoryObject (readonly)

Returns the value of attribute repository.



3
4
5
# File 'lib/propel/runner.rb', line 3

def repository
  @repository
end

Instance Method Details

#startObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/propel/runner.rb', line 14

def start
  @repository.ensure_attached_head!

  if @repository.changed?
    if remote_build_configured?

      if @options[:fix_ci]
        logger.puts("Thanks for trying to fix the build!", :green)
      else
        check_remote_build!
      end

    else
      logger.warn "Remote build is not configured. You should point propel to the status URL of your CI server."

    end

    propel!
  else
    logger.puts("There is nothing to propel - your HEAD is identical to #{@repository.remote_config} #{@repository.merge_config}.", :green)

  end
end