cheftacular 2.12.0 → 2.12.1

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: e2f0c0d7f232e7617f6c0f511806a71d37f7b7fa
4
- data.tar.gz: 43aeba1d59eec85f9c5fc7d5f20b168cb8283cf9
3
+ metadata.gz: beb5fbd1287af65d3d6bb6cc57548ebfd4dfcdc6
4
+ data.tar.gz: 49b01ae599af945412cfa5e192f10099fdc9b54c
5
5
  SHA512:
6
- metadata.gz: 2b2567debc1835e4079e46486301ce31ee675efcc24cb1e89c739178d29a97f33fb237c28800733a6466fd5b8b55dbfb1d1cc821b456e0ef547a802ae59b295e
7
- data.tar.gz: f8a09335967bd9bc172e77a00a710708bde5cc1c24a34c99bbcde186aea7d89865b96f796ceeff463af8af8e882207c362702e506bceb8c9075d8dce88a407de
6
+ metadata.gz: c838c68b82fc04160920297b30ac80ccef096d18254c9eedb76f15014b9d789edeea667ecd42108e8064ff3d36ac5a08ee4c248be7a63490856cc141c4a3a232
7
+ data.tar.gz: 57709f757fc71defb4224104a4b95940287a45ac292df54f3337ffbf6c83067d3f225d0eec3082bd6e320e10e838b6a8a62f6041f0482467ea9aa1124ff912ae
@@ -5,7 +5,9 @@ class Cheftacular
5
5
  @config['documentation']['action'][__method__]['long_description'] = [
6
6
  "`cft console` will create a console session on the first node found for a repository.",
7
7
  [
8
- " 1. Attempts to setup a console for the unique stack, stacks currently supported for console is only Rails."
8
+ " 1. Attempts to setup a console for the unique stack, stacks currently supported for console is only Rails.",
9
+
10
+ " 2. If there is a node in the repository set that has the role `preferred_console`, this node will come before others."
9
11
  ]
10
12
  ]
11
13
 
@@ -18,13 +20,17 @@ class Cheftacular
18
20
  self.send("console_#{ @config['getter'].get_current_stack }")
19
21
  end
20
22
 
21
- def console_ruby_on_rails
23
+ def console_ruby_on_rails node_args=[{unless: 'role[rails]'}]
22
24
  nodes = @config['getter'].get_true_node_objects
23
25
 
24
26
  #must have rails stack to run migrations and not be a db, only want ONE node
25
- nodes = @config['parser'].exclude_nodes( nodes, [{ unless: "role[#{ @options['role'] }]" }, { unless: 'role[rails]' }], true )
27
+ node_args << { unless: "role[#{ @options['role'] }]" }
28
+
29
+ consolable_nodes = @config['parser'].exclude_nodes( nodes, (node_args + [{ unless: "role[preferred_console]" }]).flatten, true )
30
+
31
+ consolable_nodes = @config['parser'].exclude_nodes( nodes, node_args, true ) if consolable_nodes.empty?
26
32
 
27
- nodes.each do |n|
33
+ consolable_nodes.each do |n|
28
34
  puts("Beginning console run for #{ n.name } (#{ n.public_ipaddress }) on role #{ @options['role'] }") unless @options['quiet']
29
35
 
30
36
  start_console_ruby_on_rails(n.public_ipaddress, n.run_list)
@@ -1,5 +1,5 @@
1
1
  class Cheftacular
2
2
  #major_version.minor_version.bugfixes
3
- VERSION = "2.12.0"
3
+ VERSION = "2.12.1"
4
4
  RUBY_VERSION = "2.2.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cheftacular
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.12.0
4
+ version: 2.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Louis Alridge
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-30 00:00:00.000000000 Z
11
+ date: 2016-01-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hashie