bcome 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/bin/bcome +7 -3
  3. data/bin/boot.rb +22 -14
  4. data/lib/bcome/version.rb +1 -1
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0bc3b83a397c5195c615dc733ac8a73ddf83b5b9
4
- data.tar.gz: bffd288b51aac1466ede8d57fb753022b5f6ef81
3
+ metadata.gz: a78ef0e9b999c6dc1c605b73791e5d853be3e5fa
4
+ data.tar.gz: 5585b40b46f2f0b962893161aaa566a698d8ddfd
5
5
  SHA512:
6
- metadata.gz: e3d3259982bb41800c7b459b67d506d9c729f612300d2611b6c199fbc4175a67231750c2ea26688c500afcedae33102ec76a8bbf2ce44cc23eb17cb0afbbc508
7
- data.tar.gz: cae0dc41508b1c793fb75fd335acf51dd69716376b7c27aa671efb248d1571f2c4c379e4ba904658f0454747966364fe70a3fd957a2b94ae917c2b243a9470ec
6
+ metadata.gz: 4dc3a5c6bfeb933f670a63865cd57f5f697373c6793328a74d46d17c453bbabaf023379da4a16fbb97b1116747c769af5c800aad817f0a37770715fc207970fe
7
+ data.tar.gz: 0315e88f28e40b7d65fe161b4d982df9a404bb8f674a52c1e003beebc83d75e8df870b7f649a89d5b8108d8ec54c6cd8098f249ff991cc267334e9b346182b7e
data/bin/bcome CHANGED
@@ -11,6 +11,10 @@ require 'bcome'
11
11
  load Bcome::Boot.boot_path
12
12
 
13
13
  ## Load the shell
14
- require 'irb/ext/multi-irb'
15
- IRB.parse_opts_with_ignoring_script
16
- IRB.irb nil, @context_object
14
+ unless @no_shell
15
+ require 'irb/ext/multi-irb'
16
+ IRB.parse_opts_with_ignoring_script
17
+ IRB.irb nil, @context_object
18
+ end
19
+
20
+ @ssh_to.node.ssh if @ssh_in && @ssh_to
data/bin/boot.rb CHANGED
@@ -41,29 +41,30 @@ RENDER = ::Bcome::RenderIrb.new
41
41
 
42
42
  quick_context = ENV['bcome_context'] ? ENV['bcome_context'] : ARGV[0]
43
43
 
44
+ quick_contexts = []
45
+
44
46
  if quick_context
47
+
48
+ ## Our context might be a shortcut context, in which case load it
45
49
  quick_context =~ /(.+):(.+)/
46
50
  platform_key = $1
47
51
  context_reference = $2
48
52
 
49
- unless platform_key && context_reference
50
- puts "Quick context is missing platform key or the context reference".failure
51
- exit 1
52
- end
53
-
54
- unless platform = ESTATE.resource_for_identifier(platform_key)
55
- puts "Cannot find platform named #{platform_key}".failure
56
- exit
53
+ if platform_key && context_reference
54
+ if platform = ESTATE.resource_for_identifier(platform_key)
55
+ if platform.has_quick_contexts? && (context = platform.quick_context_for_reference(context_reference))
56
+ quick_contexts = context[:keys]
57
+ end
58
+ end
57
59
  end
58
60
 
59
- unless platform.has_quick_contexts? && (context = platform.quick_context_for_reference(context_reference))
60
- puts "No quick context found on platform #{platform_key} for reference #{context_reference}".failure
61
- exit
61
+ unless quick_contexts.any? # we didn't find a shortcut
62
+ quick_contexts = quick_context.split(":")
62
63
  end
63
-
64
- quick_contexts = context[:keys]
65
64
  end
66
65
 
66
+ @no_shell = true if quick_contexts.last == "ssh"
67
+
67
68
  #########################
68
69
  ## QUICK CONTEXT & BOOT #
69
70
  #########################
@@ -79,7 +80,14 @@ if quick_contexts.any?
79
80
  is_first_context = true
80
81
 
81
82
  spawn = false
82
- quick_contexts.each do |resource_context_key|
83
+ quick_contexts.each_with_index do |resource_context_key, index|
84
+
85
+ if resource_context_key == "ssh" && index == (quick_contexts.size - 1) ## If last shortcut is SSH, we'll skip so we can execute it
86
+ @ssh_in = true
87
+ @ssh_to = @context_object
88
+ break
89
+ end
90
+
83
91
  next_context_resource = @context_object.resource_for_identifier(resource_context_key)
84
92
 
85
93
  # Initialize our object namespace, but only from our lowest level namespace object. This
data/lib/bcome/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Bcome
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bcome
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guillaume Roderick (Webzakimbo)
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-30 00:00:00.000000000 Z
11
+ date: 2015-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk