Class: RLS::Runner

Inherits:
Struct
  • Object
show all
Defined in:
lib/rls.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(m, *args, &block) ⇒ Object (private)



33
34
35
# File 'lib/rls.rb', line 33

def method_missing(m, *args, &block)
  options.key?(m.to_sym) ? options[m.to_sym] : super
end

Instance Attribute Details

#optionsObject

Returns the value of attribute options

Returns:

  • (Object)

    the current value of options



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

def options
  @options
end

Instance Method Details

#release!Object



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/rls.rb', line 4

def release!
  puts 'Debug run...' if debug
  # TODO: show diff log since last deploy
  # TODO: ensure all commits are pushed to github
  # TODO: ask to run tests?
  # deploy
  execute "git push #{options[:remote]} #{branch} #{force ? '-ff' : ''}"
  # notify newrelic
  execute "newrelic deployments -a '#{app_name}' -e '#{env}'" if notify_newrelic?
  # TODO: run any migrations (backup before)
end