foreplay 0.9.11 → 0.9.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 33731b365e619f93a9a5f950b59bbeec1c1f6bde
4
- data.tar.gz: ba47694849c84746f1cd75d9bdcb3ac51403bccc
3
+ metadata.gz: fd947f263c336b9ee4804c52ef96e2a324185e52
4
+ data.tar.gz: dba7b672e1ea208a90bfb78b68f3c3f0414a038d
5
5
  SHA512:
6
- metadata.gz: 2f87782c848542519af918f6e46e55f05260bca250f1eda2db647b9c7c245d13e872cddbf789b7f317e1f07fcddd1fb8de1edc15c24178439d0632dd29782625
7
- data.tar.gz: 101180a567f815cd9033a2f464e0b277662214e6d84883ff87d045ccf022b3a72340d69c7c61cef47032ba2d8e1648a51d27877f5b66300774e5d9ed4f25662a
6
+ metadata.gz: 783a8c5a52cce85e2ea6b595484cabe6c3bb3aceb120df29f0db988bb88be629ab0053318daa224cb1fda219704dff59f5a148165df58429e2555e1b9181c6fc
7
+ data.tar.gz: 8018019cfd60afde106770c319494e1a1c52e33740cd3fd4e90772ddfd5f521ae6f7e6c715b1c3207e0e74d7b996510d53add7b7385278db04fa04a9ad5bbfca
data/.rubocop.yml CHANGED
@@ -42,7 +42,7 @@ LineLength:
42
42
 
43
43
  MethodLength:
44
44
  Description: 'Avoid methods longer than 10 lines of code.'
45
- Max: 18 # 27 # 85
45
+ Max: 14 # 18 # 27 # 85
46
46
 
47
47
  AbcSize:
48
- Max: 23 # 62
48
+ Max: 21 # 23 # 62
@@ -16,7 +16,10 @@ class Foreplay::Engine::Logger
16
16
  end
17
17
 
18
18
  def formatted_message
19
- @formatted_message ||= header + message.gsub(/\s+\z/, '').gsub(/(\r\n*)/, "\\1#{margin}")
19
+ @formatted_message ||= header + message
20
+ .gsub(/\A\s*/, '')
21
+ .gsub(/\s+\z/, '')
22
+ .gsub(/(\r\n*)/, "\\1#{margin}")
20
23
  end
21
24
 
22
25
  def header
@@ -40,19 +40,30 @@ module Foreplay::Engine::Port
40
40
  ]
41
41
  end
42
42
 
43
- def port_details
44
- return @port_details if @port_details
43
+ def current_port_remote
44
+ return @current_port_remote if @current_port_remote
45
45
 
46
- current_port_string = Foreplay::Engine::Remote.new(server, port_steps, instructions).__send__(mode).strip!
46
+ @current_port_remote = Foreplay::Engine::Remote
47
+ .new(server, port_steps, instructions)
48
+ .__send__(mode)
49
+ .strip!
50
+ .to_i
47
51
 
48
- if current_port_string.blank?
49
- log 'No instance is currently deployed', host: host
50
- else
51
- log "Current instance is using port #{current_port_string}", host: host
52
- end
52
+ message = if @current_port_remote.blank?
53
+ 'No instance is currently deployed'
54
+ else
55
+ "Current instance is using port #{@current_port_remote}"
56
+ end
57
+
58
+ log message, host: host
59
+ @current_port_remote
60
+ end
61
+
62
+ def port_details
63
+ return @port_details if @port_details
53
64
 
54
- cp = current_port_string.to_i
55
- port = instructions['port']
65
+ cp = current_port_remote
66
+ port = instructions['port'].to_i
56
67
  ports = [port + 1000, port]
57
68
  cp, fp = cp == port ? ports : ports.reverse
58
69
 
@@ -14,6 +14,8 @@
14
14
  commentary: 'If you have a .rvmrc file there may be a delay now while we install a new ruby'
15
15
  - command: 'if [ -f .ruby-version ] ; then rvm install `cat .ruby-version` ; else echo "No .ruby-version file found" ; fi'
16
16
  commentary: 'If you have a .ruby-version file there may be a delay now while we install a new ruby'
17
+ - command: 'rvm info'
18
+ commentary: 'Showing RVM environment'
17
19
  - key: 'env'
18
20
  delimiter: '='
19
21
  prefix: '.'
@@ -25,26 +25,27 @@ class Foreplay::Engine
25
25
  end
26
26
 
27
27
  def execute
28
- # Explain what we're going to do
29
28
  puts "#{mode.capitalize}ing #{environment.dup.yellow} environment, "\
30
29
  "#{explanatory_text(filters, 'role')}, #{explanatory_text(filters, 'server')}"
31
30
 
32
- actionable_roles.map do |role, instructions|
33
- Foreplay::Engine::Role.new(
34
- environment,
35
- mode,
36
- build_instructions(role, instructions)
37
- ).threads
38
- end.flatten.each(&:join)
31
+ actionable_roles.map { |role, instructions| threads(role, instructions) }.flatten.each(&:join)
39
32
 
40
33
  puts mode == :deploy ? 'Finished deployment' : 'Deployment configuration check was successful'
41
34
  end
42
35
 
36
+ private
37
+
43
38
  def actionable_roles
44
39
  roles.select { |role, _i| role != DEFAULTS_KEY && role != filters['role'] }
45
40
  end
46
41
 
47
- private
42
+ def threads(role, instructions)
43
+ Foreplay::Engine::Role.new(
44
+ environment,
45
+ mode,
46
+ build_instructions(role, instructions)
47
+ ).threads
48
+ end
48
49
 
49
50
  def explanatory_text(hsh, key)
50
51
  hsh.key?(key) ? "#{hsh[key].dup.yellow} #{key}" : "all #{key}s"
@@ -1,3 +1,3 @@
1
1
  module Foreplay
2
- VERSION = '0.9.11'
2
+ VERSION = '0.9.12'
3
3
  end
@@ -137,6 +137,7 @@ describe Foreplay::Launcher do
137
137
  'rvm rvmrc warning ignore 50000',
138
138
  'gpg --keyserver hkp://pool.sks-keyservers.net --recv-keys D39DC0E3',
139
139
  'cd 50000 && mkdir -p tmp doc log config',
140
+ 'rvm info',
140
141
  'if [ -f .ruby-version ] ; then rvm install `cat .ruby-version` ; else echo "No .ruby-version file found" ; fi',
141
142
  'echo "RAILS_ENV=production" > .env',
142
143
  'echo "concurrency: web=1,worker=0,scheduler=0" > .foreman',
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreplay
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.11
4
+ version: 0.9.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Xenapto