bcome 0.7.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (173) hide show
  1. checksums.yaml +4 -4
  2. data/bin/bcome +8 -39
  3. data/lib/bcome.rb +12 -3
  4. data/lib/objects/bcome/version.rb +3 -0
  5. data/lib/objects/bootup.rb +81 -0
  6. data/lib/objects/command/local.rb +40 -0
  7. data/lib/objects/config_factory.rb +36 -0
  8. data/lib/objects/driver/base.rb +30 -0
  9. data/lib/objects/driver/bucket.rb +20 -0
  10. data/lib/objects/driver/ec2.rb +44 -0
  11. data/lib/objects/driver/static.rb +4 -0
  12. data/lib/objects/exception/argument_error_invoking_method_from_command_line.rb +7 -0
  13. data/lib/objects/exception/base.rb +15 -0
  14. data/lib/objects/exception/can_only_subselect_on_inventory.rb +7 -0
  15. data/lib/objects/exception/cannot_find_internal_registry_klass.rb +7 -0
  16. data/lib/objects/exception/cannot_find_subselection_parent.rb +7 -0
  17. data/lib/objects/exception/cant_find_key_in_cloud_tags.rb +7 -0
  18. data/lib/objects/exception/cant_find_key_in_metadata.rb +7 -0
  19. data/lib/objects/exception/cant_find_proxy_host_by_identifier.rb +7 -0
  20. data/lib/objects/exception/cant_find_proxy_host_by_namespace.rb +7 -0
  21. data/lib/objects/exception/could_not_initiate_ssh_connection.rb +7 -0
  22. data/lib/objects/exception/could_not_initiate_ssh_connection_through_backend_proxy.rb +7 -0
  23. data/lib/objects/exception/deprecation_warning.rb +11 -0
  24. data/lib/objects/exception/duplicate_command_line_argument_key.rb +7 -0
  25. data/lib/objects/exception/ec2_driver_missing_provisioning_region.rb +7 -0
  26. data/lib/objects/exception/failed_to_run_local_command.rb +7 -0
  27. data/lib/objects/exception/interactive_session_halt.rb +4 -0
  28. data/lib/objects/exception/invalid_bcome_breadcrumb.rb +7 -0
  29. data/lib/objects/exception/invalid_breadcrumb.rb +7 -0
  30. data/lib/objects/exception/invalid_context_command.rb +7 -0
  31. data/lib/objects/exception/invalid_identifier.rb +7 -0
  32. data/lib/objects/exception/invalid_machines_cache_config.rb +7 -0
  33. data/lib/objects/exception/invalid_matcher_query.rb +7 -0
  34. data/lib/objects/exception/invalid_meta_data_config.rb +7 -0
  35. data/lib/objects/exception/invalid_network_config.rb +7 -0
  36. data/lib/objects/exception/invalid_network_driver_type.rb +7 -0
  37. data/lib/objects/exception/invalid_proxy_config.rb +7 -0
  38. data/lib/objects/exception/invalid_regexp_matcher_in_registry.rb +7 -0
  39. data/lib/objects/exception/invalid_registry_arguments_type.rb +7 -0
  40. data/lib/objects/exception/invalid_registry_data_config.rb +7 -0
  41. data/lib/objects/exception/invalid_restriction_key_in_registry.rb +7 -0
  42. data/lib/objects/exception/invalid_ssh_config.rb +7 -0
  43. data/lib/objects/exception/inventories_cannot_have_subviews.rb +7 -0
  44. data/lib/objects/exception/malformed_command_line_arguments.rb +7 -0
  45. data/lib/objects/exception/method_invocation_requires_parameter.rb +7 -0
  46. data/lib/objects/exception/method_name_conflict_in_registry.rb +7 -0
  47. data/lib/objects/exception/missing_argument_for_registry_command.rb +7 -0
  48. data/lib/objects/exception/missing_description_on_view.rb +7 -0
  49. data/lib/objects/exception/missing_execute_on_registry_object.rb +7 -0
  50. data/lib/objects/exception/missing_identifier_on_view.rb +7 -0
  51. data/lib/objects/exception/missing_ip_address_on_server.rb +7 -0
  52. data/lib/objects/exception/missing_network_config.rb +7 -0
  53. data/lib/objects/exception/missing_params_for_rsync.rb +7 -0
  54. data/lib/objects/exception/missing_params_for_scp.rb +7 -0
  55. data/lib/objects/exception/missing_subselection_key.rb +7 -0
  56. data/lib/objects/exception/missing_type_on_view.rb +7 -0
  57. data/lib/objects/exception/no_node_found_for_breadcrumb.rb +7 -0
  58. data/lib/objects/exception/no_node_named_by_identifier.rb +7 -0
  59. data/lib/objects/exception/node_identifiers_must_be_unique.rb +7 -0
  60. data/lib/objects/exception/orchestration_script_does_not_exist.rb +7 -0
  61. data/lib/objects/exception/proxy_host_node_does_not_have_public_ip_address.rb +7 -0
  62. data/lib/objects/exception/unknown_method_for_namespace.rb +7 -0
  63. data/lib/objects/interactive/session.rb +45 -0
  64. data/lib/objects/interactive/session_item/base.rb +36 -0
  65. data/lib/objects/interactive/session_item/capture_input.rb +20 -0
  66. data/lib/objects/interactive/session_item/transparent_ssh.rb +111 -0
  67. data/lib/objects/modules/context.rb +13 -0
  68. data/lib/objects/modules/registry_management.rb +14 -0
  69. data/lib/objects/modules/ui_output.rb +9 -0
  70. data/lib/objects/modules/workspace_commands.rb +198 -0
  71. data/lib/objects/modules/workspace_menu.rb +128 -0
  72. data/lib/objects/node/attributes.rb +47 -0
  73. data/lib/objects/node/base.rb +248 -0
  74. data/lib/objects/node/cache_handler.rb +24 -0
  75. data/lib/objects/node/collection.rb +51 -0
  76. data/lib/objects/node/factory.rb +108 -0
  77. data/lib/objects/node/inventory/base.rb +88 -0
  78. data/lib/objects/node/inventory/defined.rb +112 -0
  79. data/lib/objects/node/inventory/subselect.rb +54 -0
  80. data/lib/objects/node/meta/base.rb +36 -0
  81. data/lib/objects/node/meta/cloud.rb +4 -0
  82. data/lib/objects/node/meta/local.rb +4 -0
  83. data/lib/objects/node/meta_data_factory.rb +23 -0
  84. data/lib/objects/node/meta_data_loader.rb +32 -0
  85. data/lib/objects/node/resources/base.rb +98 -0
  86. data/lib/objects/node/resources/inventory.rb +25 -0
  87. data/lib/objects/node/resources/sub_inventory.rb +56 -0
  88. data/lib/objects/node/server/base.rb +218 -0
  89. data/lib/objects/node/server/dynamic.rb +39 -0
  90. data/lib/objects/node/server/static.rb +31 -0
  91. data/lib/objects/orchestration/base.rb +13 -0
  92. data/lib/objects/orchestrator.rb +24 -0
  93. data/lib/objects/parser/bread_crumb.rb +31 -0
  94. data/lib/objects/progress_bar.rb +30 -0
  95. data/lib/objects/registry/arguments/base.rb +36 -0
  96. data/lib/objects/registry/arguments/command_line.rb +35 -0
  97. data/lib/objects/registry/arguments/console.rb +15 -0
  98. data/lib/objects/registry/command/base.rb +66 -0
  99. data/lib/objects/registry/command/external.rb +55 -0
  100. data/lib/objects/registry/command/group.rb +76 -0
  101. data/lib/objects/registry/command/internal.rb +34 -0
  102. data/lib/objects/registry/command_list.rb +33 -0
  103. data/lib/objects/registry/loader.rb +70 -0
  104. data/lib/objects/ssh/bootstrap.rb +19 -0
  105. data/lib/objects/ssh/command.rb +46 -0
  106. data/lib/objects/ssh/command_exec.rb +65 -0
  107. data/lib/objects/ssh/connection_handler.rb +101 -0
  108. data/lib/objects/ssh/driver.rb +204 -0
  109. data/lib/objects/ssh/proxy_data.rb +56 -0
  110. data/lib/objects/ssh/script_exec.rb +43 -0
  111. data/lib/objects/system/local.rb +30 -0
  112. data/lib/objects/workspace.rb +75 -0
  113. data/patches/irb.rb +20 -7
  114. data/patches/string.rb +75 -0
  115. data/patches/string_stylesheet.rb +61 -0
  116. metadata +175 -93
  117. data/bin/bcome-bash-setup +0 -18
  118. data/bin/bcome-setup +0 -43
  119. data/bin/boot.rb +0 -148
  120. data/bin/boot_no_shell.rb +0 -3
  121. data/filters/ec2_filter.rb +0 -12
  122. data/lib/bcome/version.rb +0 -3
  123. data/lib/become_object.rb +0 -111
  124. data/lib/boot.rb +0 -13
  125. data/lib/command.rb +0 -56
  126. data/lib/context_functions.rb +0 -65
  127. data/lib/filters/base.rb +0 -10
  128. data/lib/filters/ec2_filter.rb +0 -4
  129. data/lib/functions.rb +0 -70
  130. data/lib/helpers/command_helper.rb +0 -13
  131. data/lib/helpers/environment_ssh.rb +0 -122
  132. data/lib/helpers/fog_helper.rb +0 -108
  133. data/lib/helpers/instance_command.rb +0 -71
  134. data/lib/helpers/instance_ssh.rb +0 -83
  135. data/lib/helpers/selections.rb +0 -117
  136. data/lib/interactive/interactive_session_halt.rb +0 -4
  137. data/lib/interactive/session.rb +0 -44
  138. data/lib/interactive/session_item/base.rb +0 -30
  139. data/lib/interactive/session_item/transparent_ssh.rb +0 -133
  140. data/lib/nodes/base.rb +0 -60
  141. data/lib/nodes/environment.rb +0 -30
  142. data/lib/nodes/estate.rb +0 -44
  143. data/lib/nodes/instance.rb +0 -94
  144. data/lib/nodes/platform.rb +0 -17
  145. data/lib/nodes/view.rb +0 -31
  146. data/lib/object.rb +0 -21
  147. data/lib/orchestrator/command_group/base.rb +0 -56
  148. data/lib/orchestrator/command_group/custom.rb +0 -13
  149. data/lib/orchestrator/command_group/direct.rb +0 -53
  150. data/lib/orchestrator/direct_command/group.rb +0 -21
  151. data/lib/orchestrator/direct_command/instance.rb +0 -19
  152. data/lib/orchestrator/factory.rb +0 -38
  153. data/lib/orchestrator/loader.rb +0 -47
  154. data/lib/orchestrator/node_target/all.rb +0 -14
  155. data/lib/orchestrator/node_target/all_excluding_roles.rb +0 -14
  156. data/lib/orchestrator/node_target/all_with_roles.rb +0 -14
  157. data/lib/orchestrator/node_target/base.rb +0 -43
  158. data/lib/orchestrator/node_target/single.rb +0 -12
  159. data/lib/orchestrator/recipe.rb +0 -60
  160. data/lib/orchestrator/registry.rb +0 -37
  161. data/lib/orchestrator/validate_and_set.rb +0 -10
  162. data/lib/patches/string.rb +0 -86
  163. data/lib/progress_bar.rb +0 -31
  164. data/lib/render_irb.rb +0 -53
  165. data/lib/scp.rb +0 -40
  166. data/lib/ssh.rb +0 -51
  167. data/lib/stack/base.rb +0 -148
  168. data/lib/stack/environment.rb +0 -222
  169. data/lib/stack/estate.rb +0 -50
  170. data/lib/stack/instance.rb +0 -130
  171. data/lib/stack/platform.rb +0 -74
  172. data/lib/stack/view.rb +0 -56
  173. data/lib/workspace_context.rb +0 -40
@@ -0,0 +1,7 @@
1
+ module ::Bcome::Exception
2
+ class CantFindProxyHostByNamespace < ::Bcome::Exception::Base
3
+ def message_prefix
4
+ 'Can\'t find proxy host by namespace'
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module ::Bcome::Exception
2
+ class CouldNotInitiateSshConnection < ::Bcome::Exception::Base
3
+ def message_prefix
4
+ 'Could not initiate SSH connection. Check your SSH config settings for namespace'
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module ::Bcome::Exception
2
+ class CouldNotInitiateSshConnectionThroughBackendProxy < ::Bcome::Exception::Base
3
+ def message_prefix
4
+ 'Could not initiate SSH connection. Check your SSH config settings for namespace'
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,11 @@
1
+ module Bcome::Exception
2
+ class DeprecationWarning < ::Bcome::Exception::Base
3
+
4
+ def message_prefix
5
+ msg = "Your configuration relies on a deprecated version of Bcome, with which version #{::Bcome::VERSION} is not compatible.\n\n"
6
+ msg += "Pin your bcome gem to version 0.7.0, or see our new documentation at https://github.com/webzakimbo/bcome-kontrol for changes"
7
+ msg
8
+ end
9
+
10
+ end
11
+ end
@@ -0,0 +1,7 @@
1
+ module ::Bcome::Exception
2
+ class DuplicateCommandLineArgumentKey < ::Bcome::Exception::Base
3
+ def message_prefix
4
+ 'Duplicate command line argument key'
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module ::Bcome::Exception
2
+ class Ec2DriverMissingProvisioningRegion < ::Bcome::Exception::Base
3
+ def message_prefix
4
+ 'Missing provisioning region for network data: '
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module Bcome::Exception
2
+ class FailedToRunLocalCommand < ::Bcome::Exception::Base
3
+ def message_prefix
4
+ 'Failed to run local command: '
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,4 @@
1
+ module Bcome::Exception
2
+ class InteractiveSessionHalt < RuntimeError
3
+ end
4
+ end
@@ -0,0 +1,7 @@
1
+ module ::Bcome::Exception
2
+ class InvalidBcomeBreadcrumb < ::Bcome::Exception::Base
3
+ def message_prefix
4
+ 'Invalid bcome breadcrumb'
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module ::Bcome::Exception
2
+ class InvalidBreadcrumb < ::Bcome::Exception::Base
3
+ def message_prefix
4
+ 'Invalid breadcrumb: '
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module ::Bcome::Exception
2
+ class InvalidContextCommand < ::Bcome::Exception::Base
3
+ def message_prefix
4
+ 'Invalid config in registry file '
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module ::Bcome::Exception
2
+ class InvalidIdentifier < ::Bcome::Exception::Base
3
+ def message_prefix
4
+ 'View has invalid identifier'
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module ::Bcome::Exception
2
+ class InvalidMachinesCacheConfig < ::Bcome::Exception::Base
3
+ def message_prefix
4
+ 'Your machines cache configuration is invalid'
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module ::Bcome::Exception
2
+ class InvalidMatcherQuery < ::Bcome::Exception::Base
3
+ def message_prefix
4
+ 'Invalid matcher query'
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module ::Bcome::Exception
2
+ class InvalidMetaDataConfig < ::Bcome::Exception::Base
3
+ def message_prefix
4
+ 'Invalid meta data config in metadata file '
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module ::Bcome::Exception
2
+ class InvalidNetworkConfig < ::Bcome::Exception::Base
3
+ def message_prefix
4
+ 'Your network configuration is invalid'
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module ::Bcome::Exception
2
+ class InvalidNetworkDriverType < ::Bcome::Exception::Base
3
+ def message_prefix
4
+ 'Invalid network driver type'
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module ::Bcome::Exception
2
+ class InvalidProxyConfig < ::Bcome::Exception::Base
3
+ def message_prefix
4
+ 'Invalid proxy config'
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module ::Bcome::Exception
2
+ class InvalidRegexpMatcherInRegistry < ::Bcome::Exception::Base
3
+ def message_prefix
4
+ 'Invalid regex matcher in registry '
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module ::Bcome::Exception
2
+ class InvalidRegistryArgumentType < ::Bcome::Exception::Base
3
+ def message_prefix
4
+ 'Invalid registry argument type'
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module ::Bcome::Exception
2
+ class InvalidRegistryDataConfig < ::Bcome::Exception::Base
3
+ def message_prefix
4
+ 'Invalid config in registry file '
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module Bcome::Exception
2
+ class InvalidRestrictionKeyInRegistry < ::Bcome::Exception::Base
3
+ def message_prefix
4
+ 'Invalid restriction key in registry: '
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module Bcome::Exception
2
+ class InvalidSshConfig < ::Bcome::Exception::Base
3
+ def message_prefix
4
+ 'Invalid Ssh Config'
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module Bcome::Exception
2
+ class InventoriesCannotHaveSubViews < ::Bcome::Exception::Base
3
+ def message_prefix
4
+ "You can't configure an inventory with subviews"
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module ::Bcome::Exception
2
+ class MalformedCommandLineArguments < ::Bcome::Exception::Base
3
+ def message_prefix
4
+ 'Malformed command line arguments'
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module ::Bcome::Exception
2
+ class MethodInvocationRequiresParameter < ::Bcome::Exception::Base
3
+ def message_prefix
4
+ 'Method invocation requires parameter: '
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module ::Bcome::Exception
2
+ class MethodNameConflictInRegistry < ::Bcome::Exception::Base
3
+ def message_prefix
4
+ 'Method name conflict in registry. The following console_command name in your registry conflicts with either a reserved bcome method name, or another method name in your registry: '
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module Bcome::Exception
2
+ class MissingArgumentForRegistryCommand < ::Bcome::Exception::Base
3
+ def message_prefix
4
+ 'Cannot find argument for registry command in either your defaults or your user supplied arguments'
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module Bcome::Exception
2
+ class MissingDescriptionOnView < ::Bcome::Exception::Base
3
+ def message_prefix
4
+ 'One of your views is missing a description field'
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module ::Bcome::Exception
2
+ class MissingExecuteOnRegistryObject < ::Bcome::Exception::Base
3
+ def message_prefix
4
+ "Registry orchestration object is missing an 'execute' method for registry class "
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module ::Bcome::Exception
2
+ class MissingIdentifierOnView < ::Bcome::Exception::Base
3
+ def message_prefix
4
+ 'One of your views is missing an identifier field'
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module ::Bcome::Exception
2
+ class MissingIpaddressOnServer < ::Bcome::Exception::Base
3
+ def message_prefix
4
+ 'A static server must specify either a public or internal ip address'
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module ::Bcome::Exception
2
+ class MissingNetworkConfig < ::Bcome::Exception::Base
3
+ def message_prefix
4
+ 'Cannot find network config at'
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module ::Bcome::Exception
2
+ class MissingParamsForRsync < ::Bcome::Exception::Base
3
+ def message_prefix
4
+ ''
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module ::Bcome::Exception
2
+ class MissingParamsForScp < ::Bcome::Exception::Base
3
+ def message_prefix
4
+ ''
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module ::Bcome::Exception
2
+ class MissingSubselectionKey < ::Bcome::Exception::Base
3
+ def message_prefix
4
+ 'You must set a subselection key when defining a subselection inventory'
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module Bcome::Exception
2
+ class MissingTypeOnView < ::Bcome::Exception::Base
3
+ def message_prefix
4
+ 'One of your views is missing a type field'
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module ::Bcome::Exception
2
+ class NoNodeFoundForBreadcrumb < ::Bcome::Exception::Base
3
+ def message_prefix
4
+ 'No node exists for breadcrumb'
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module Bcome::Exception
2
+ class NoNodeNamedByIdentifier < ::Bcome::Exception::Base
3
+ def message_prefix
4
+ 'Cannot find identifier within inventory'
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module ::Bcome::Exception
2
+ class NodeIdentifiersMustBeUnique < ::Bcome::Exception::Base
3
+ def message_prefix
4
+ 'Node identifiers cannot be ambiguous: '
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module Bcome::Exception
2
+ class OrchestrationScriptDoesNotExist < ::Bcome::Exception::Base
3
+ def message_prefix
4
+ 'Cannot find orchestration file at path: '
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module ::Bcome::Exception
2
+ class ProxyHostNodeDoesNotHavePublicIp < ::Bcome::Exception::Base
3
+ def message_prefix
4
+ 'Node missing public ip address, and so cannot be used as a proxy ssh server'
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module Bcome::Exception
2
+ class UnknownMethodForNamespace < ::Bcome::Exception::Base
3
+ def message_prefix
4
+ 'unknown method '
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,45 @@
1
+ module Bcome::Interactive
2
+ class Session
3
+ class << self
4
+ def run(node, session_type, init_data = {})
5
+ session_end_message = "\ninteractive session ended\n".informational
6
+ begin
7
+ session = ::Bcome::Interactive::Session.new(node, session_type_to_klass[session_type], init_data)
8
+ session.start
9
+ rescue ::Bcome::Exception::InteractiveSessionHalt => e
10
+ puts session_end_message
11
+ rescue ::Bcome::Exception::CouldNotInitiateSshConnection => e
12
+ puts 'Caught connection error #2'
13
+ puts e.message.error
14
+ rescue ::IRB::Abort
15
+ puts session_end_message
16
+ end
17
+ end
18
+
19
+ def session_type_to_klass
20
+ {
21
+ interactive_ssh: ::Bcome::Interactive::SessionItem::TransparentSsh,
22
+ capture_input: ::Bcome::Interactive::SessionItem::CaptureInput
23
+ }
24
+ end
25
+ end
26
+
27
+ attr_reader :responses, :node
28
+
29
+ def initialize(node, item_klass, init_data)
30
+ @item_klass = item_klass
31
+ @node = node
32
+ @responses = {}
33
+ @init_data = init_data
34
+ end
35
+
36
+ def start
37
+ print start_item.start_message if start_item.has_start_message?
38
+ start_item.do
39
+ end
40
+
41
+ def start_item
42
+ @start_item ||= @item_klass.new(self, @init_data)
43
+ end
44
+ end
45
+ end