dtk-client 0.7.5 → 0.7.6

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 (48) hide show
  1. checksums.yaml +4 -4
  2. data/bin/dtk +12 -1
  3. data/dtk-client.gemspec +1 -1
  4. data/lib/command_helpers/git_repo/merge.rb +139 -0
  5. data/lib/command_helpers/git_repo.rb +29 -51
  6. data/lib/command_helpers/service_importer.rb +1 -1
  7. data/lib/commands/common/thor/assembly_workspace.rb +55 -42
  8. data/lib/commands/common/thor/pull_from_remote.rb +11 -3
  9. data/lib/commands/common/thor/puppet_forge.rb +1 -1
  10. data/lib/commands/thor/component_module.rb +3 -1
  11. data/lib/commands/thor/developer.rb +25 -4
  12. data/lib/commands/thor/node.rb +5 -2
  13. data/lib/commands/thor/node_group.rb +1 -1
  14. data/lib/commands/thor/service.rb +39 -23
  15. data/lib/commands/thor/workspace.rb +48 -11
  16. data/lib/domain/git_adapter.rb +8 -0
  17. data/lib/dtk-client/version.rb +1 -1
  18. data/lib/execute/cli_pure/cli_rerouter.rb +3 -0
  19. data/lib/parser/adapters/thor.rb +1 -1
  20. data/lib/shell/context.rb +1 -1
  21. data/lib/{commands/common/thor/task_status → task_status}/refresh_mode.rb +0 -0
  22. data/lib/{commands/common/thor/task_status → task_status}/snapshot_mode.rb +0 -0
  23. data/lib/task_status/stream_mode/element/format.rb +86 -0
  24. data/lib/task_status/stream_mode/element/hierarchical_task/result/action.rb +76 -0
  25. data/lib/task_status/stream_mode/element/hierarchical_task/result/components.rb +9 -0
  26. data/lib/task_status/stream_mode/element/hierarchical_task/result/node_level.rb +9 -0
  27. data/lib/task_status/stream_mode/element/hierarchical_task/result.rb +55 -0
  28. data/lib/task_status/stream_mode/element/hierarchical_task/steps/action.rb +37 -0
  29. data/lib/task_status/stream_mode/element/hierarchical_task/steps/components.rb +36 -0
  30. data/lib/task_status/stream_mode/element/hierarchical_task/steps/node_level.rb +25 -0
  31. data/lib/task_status/stream_mode/element/hierarchical_task/steps.rb +17 -0
  32. data/lib/task_status/stream_mode/element/hierarchical_task.rb +83 -0
  33. data/lib/{commands/common/thor/task_status → task_status}/stream_mode/element/no_results.rb +0 -0
  34. data/lib/task_status/stream_mode/element/render.rb +42 -0
  35. data/lib/task_status/stream_mode/element/stage/render.rb +59 -0
  36. data/lib/task_status/stream_mode/element/stage.rb +67 -0
  37. data/lib/task_status/stream_mode/element/task_end.rb +19 -0
  38. data/lib/task_status/stream_mode/element/task_start.rb +21 -0
  39. data/lib/task_status/stream_mode/element.rb +85 -0
  40. data/lib/{commands/common/thor/task_status → task_status}/stream_mode.rb +5 -5
  41. data/lib/{commands/common/thor/task_status.rb → task_status.rb} +15 -12
  42. data/lib/util/os_util.rb +8 -0
  43. metadata +26 -14
  44. data/lib/commands/common/thor/task_status/stream_mode/element/render.rb +0 -88
  45. data/lib/commands/common/thor/task_status/stream_mode/element/stage.rb +0 -13
  46. data/lib/commands/common/thor/task_status/stream_mode/element/task_end.rb +0 -10
  47. data/lib/commands/common/thor/task_status/stream_mode/element/task_start.rb +0 -10
  48. data/lib/commands/common/thor/task_status/stream_mode/element.rb +0 -90
@@ -0,0 +1,37 @@
1
+ module DTK::Client; class TaskStatus::StreamMode::Element::HierarchicalTask
2
+ class Steps
3
+ class Action < self
4
+ def initialize(element, hash)
5
+ super
6
+ @action = hash['action'] || {}
7
+ end
8
+
9
+ def render_steps(steps)
10
+ steps.each { |step| step.render }
11
+ end
12
+
13
+ def render
14
+ if action_term = action_term?
15
+ render_line "ACTION: #{action_term}"
16
+ end
17
+ end
18
+
19
+ private
20
+
21
+ def action_term?
22
+ ret = ''
23
+ if node_term = node_term?
24
+ ret << "#{node_term}/"
25
+ end
26
+ if component_name = @action['component_name']
27
+ ret << component_name
28
+ end
29
+ if method_name = @action['method_name']
30
+ ret << ".#{method_name}"
31
+ end
32
+ ret.nil? ? nil : ret
33
+ end
34
+ end
35
+ end
36
+ end; end
37
+
@@ -0,0 +1,36 @@
1
+ module DTK::Client; class TaskStatus::StreamMode::Element::HierarchicalTask
2
+ class Steps
3
+ class Components < self
4
+ def initialize(element, hash)
5
+ super
6
+ @component_names = (hash['components'] || []).map { |cmp| cmp['name'] }.compact
7
+ end
8
+
9
+ attr_reader :component_names
10
+
11
+ def render_steps(steps)
12
+ step = steps.first
13
+ if steps.size == 1 and step.component_names.size == 1
14
+ render_line "COMPONENT: #{step.component_term(step.component_names.first)}"
15
+ else
16
+ render_line 'COMPONENTS:'
17
+ steps.each do |step|
18
+ step.component_names.each do |component_name|
19
+ render_line step.component_term(component_name), :tabs => 1
20
+ end
21
+ end
22
+ end
23
+ end
24
+
25
+ def component_term(component_name)
26
+ ret = ''
27
+ if node_term = node_term?
28
+ ret << "#{node_term}/"
29
+ end
30
+ ret << component_name
31
+ ret
32
+ end
33
+ end
34
+ end
35
+
36
+ end; end
@@ -0,0 +1,25 @@
1
+ module DTK::Client; class TaskStatus::StreamMode::Element::HierarchicalTask
2
+ class Steps
3
+ class NodeLevel < self
4
+ def render_steps(steps)
5
+ render_line node_operation_line(steps)
6
+ steps.each { |step| step.render }
7
+ end
8
+
9
+ def render
10
+ render_line node_term?, :tabs => 1
11
+ end
12
+
13
+ private
14
+
15
+ def node_operation_line(steps)
16
+ operation_term = @type
17
+ if steps.size > 1 and not operation_term =~ /s$/
18
+ operation_term += 's'
19
+ end
20
+ "OPERATION: #{operation_term}"
21
+ end
22
+
23
+ end
24
+ end
25
+ end; end
@@ -0,0 +1,17 @@
1
+ module DTK::Client; class TaskStatus::StreamMode::Element
2
+ class HierarchicalTask
3
+ class Steps < self
4
+ require File.expand_path('steps/action', File.dirname(__FILE__))
5
+ require File.expand_path('steps/components', File.dirname(__FILE__))
6
+ require File.expand_path('steps/node_level', File.dirname(__FILE__))
7
+
8
+ private
9
+
10
+ def self.render(element, stage_subtasks)
11
+ steps = base_subtasks(element, stage_subtasks, :stop_at_node_group => true)
12
+ return if steps.empty?
13
+ steps.first.render_steps(steps)
14
+ end
15
+ end
16
+ end
17
+ end; end
@@ -0,0 +1,83 @@
1
+ module DTK::Client; class TaskStatus::StreamMode::Element
2
+ class HierarchicalTask
3
+ require File.expand_path('hierarchical_task/result', File.dirname(__FILE__))
4
+ require File.expand_path('hierarchical_task/steps', File.dirname(__FILE__))
5
+
6
+ def initialize(element, hash)
7
+ @type = self.class.type(hash)
8
+ @element = element
9
+ @node_name = (hash['node'] || {})['name']
10
+ @is_node_group = self.class.has_node_group?(hash)
11
+ end
12
+
13
+ def self.render_results(element, stage_subtasks)
14
+ stage_subtasks && Results.render(element, stage_subtasks)
15
+ end
16
+
17
+ def self.render_steps(element, stage_subtasks)
18
+ stage_subtasks && Steps.render(element, stage_subtasks)
19
+ end
20
+
21
+ private
22
+
23
+
24
+ def self.base_subtasks(element, stage_subtasks, opts = {})
25
+ stage_subtasks.inject([]) do |a, subtask_hash|
26
+ if opts[:stop_at_node_group] and has_node_group?(subtask_hash)
27
+ a + [create(element, subtask_hash)]
28
+ elsif (subtask_hash['subtasks'] || []).empty?
29
+ a + [create(element, subtask_hash)]
30
+ else
31
+ a + base_subtasks(element, subtask_hash['subtasks'], opts)
32
+ end
33
+ end
34
+ end
35
+
36
+ def self.create(element, hash)
37
+ stage_type_class(hash).new(element, hash)
38
+ end
39
+
40
+ def self.type(hash)
41
+ hash['executable_action_type']
42
+ end
43
+
44
+ def self.stage_type_class(hash)
45
+ case type(hash)
46
+ when 'ComponentAction'
47
+ self::Action
48
+ when 'ConfigNode'
49
+ self::Components
50
+ else # they will be node level
51
+ self::NodeLevel
52
+ end
53
+ end
54
+
55
+ def self.has_node_group?(subtask_hash)
56
+ subtask_hash['node'] and subtask_hash['node']['type'] == 'group'
57
+ end
58
+
59
+ def render_line(*args)
60
+ @element.render_line(*args)
61
+ end
62
+
63
+ def render_empty_line
64
+ @element.render_empty_line
65
+ end
66
+
67
+ def render_node_term(opts = {})
68
+ if @node_name
69
+ if @is_node_group
70
+ render_line("NODE-GROUP: #{@node_name}", opts)
71
+ else
72
+ render_line("NODE: #{@node_name}", opts)
73
+ end
74
+ end
75
+ end
76
+
77
+ def node_term?
78
+ if @node_name
79
+ @is_node_group ? "node-group:#{@node_name}" : @node_name
80
+ end
81
+ end
82
+ end
83
+ end; end
@@ -0,0 +1,42 @@
1
+ class DTK::Client::TaskStatus::StreamMode::Element
2
+ module RenderMixin
3
+ def render_line(msg, params = {})
4
+ if msg
5
+ print_to_console(@formatter.format(msg, params))
6
+ render_empty_line
7
+ end
8
+ end
9
+
10
+ def render_start_time(started_at)
11
+ render_line(@formatter.start_time_msg?(started_at))
12
+ end
13
+
14
+ def formatted_duration?
15
+ @formatter.formatted_duration?(field?(:duration))
16
+ end
17
+
18
+ def render_duration_line
19
+ render_line(@formatter.duration_msg?(field?(:duration)))
20
+ end
21
+
22
+ def render_border
23
+ print_to_console(@formatter.border)
24
+ render_empty_line
25
+ end
26
+
27
+ def render_empty_line
28
+ render_empty_lines(1)
29
+ end
30
+
31
+ def render_empty_lines(num_empty_lines = 1)
32
+ print_to_console("\n" * num_empty_lines)
33
+ end
34
+
35
+ private
36
+
37
+ def print_to_console(string)
38
+ #TODO: stub
39
+ STDOUT << string
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,59 @@
1
+ class DTK::Client::TaskStatus::StreamMode::Element::Stage
2
+ module Render
3
+ module Mixin
4
+ def render
5
+ render_start unless @just_render and @just_render != :start
6
+ render_end unless @just_render and @just_render != :end
7
+ end
8
+
9
+ private
10
+
11
+ def render_start
12
+ if @ignore_stage_level_info
13
+ render_stage_steps field?(:subtasks)
14
+ render_start_time field?(:started_at)
15
+ else
16
+ render_border
17
+ render_line line__stage_heading?
18
+ render_start_time field?(:started_at)
19
+ render_stage_steps field?(:subtasks)
20
+ end
21
+ end
22
+
23
+ def render_end
24
+ render_line line__status
25
+ render_duration_line
26
+ render_stage_results field?(:subtasks)
27
+ unless @ignore_stage_level_info
28
+ render_border
29
+ render_empty_line
30
+ end
31
+ end
32
+
33
+ def line__stage_heading?
34
+ stage_num = field?(:position)
35
+ stage_name = stage_name?
36
+
37
+ unless stage_num.nil? and stage_name.nil?
38
+ msg = 'STAGE'
39
+ if stage_num = field?(:position)
40
+ msg << " #{stage_num.to_s}"
41
+ end
42
+
43
+ if stage_name = stage_name?
44
+ msg << ": #{stage_name}"
45
+ end
46
+ msg
47
+ end
48
+ end
49
+
50
+ def line__status
51
+ "STATUS: #{field?(:status) || 'UNKNOWN'}"
52
+ end
53
+
54
+ def stage_name?
55
+ field?(:display_name)
56
+ end
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,67 @@
1
+ module DTK::Client; class TaskStatus::StreamMode
2
+ class Element
3
+ class Stage < self
4
+ require File.expand_path('stage/render', File.dirname(__FILE__))
5
+ include Render::Mixin
6
+
7
+ def initialize(response_element, opts = {})
8
+ super
9
+ @just_render = opts[:just_render]
10
+ end
11
+
12
+ # opts has
13
+ # :wait - amount to wait if get no results (required)
14
+ def self.get_and_render_stages(task_status_handle, opts = {})
15
+ unless wait = opts[:wait]
16
+ raise DtkError::Client, "opts[:wait] must be set"
17
+ end
18
+
19
+ cursor = Cursor.new
20
+ until cursor.task_end? do
21
+ elements = get_single_stage(task_status_handle, cursor.stage, {:wait_for => cursor.wait_for}.merge(opts))
22
+ if no_results_yet?(elements)
23
+ sleep wait
24
+ next
25
+ end
26
+ render_elements(elements)
27
+ cursor.advance!(task_end?(elements))
28
+ end
29
+ end
30
+
31
+ class Cursor
32
+ def initialize
33
+ @stage = 1
34
+ @wait_for = :start
35
+ @task_end = false
36
+ end
37
+ attr_reader :stage, :wait_for
38
+ def task_end?
39
+ @task_end
40
+ end
41
+ def advance!(task_end)
42
+ unless @task_end = task_end
43
+ if @wait_for == :start
44
+ @wait_for = :end
45
+ else
46
+ @stage += 1
47
+ @wait_for = :start
48
+ end
49
+ end
50
+ end
51
+ end
52
+
53
+ def self.get_single_stage(task_status_handle, stage_num, opts = {})
54
+ get_stages(task_status_handle, stage_num, stage_num, opts)
55
+ end
56
+
57
+ def self.get_stages(task_status_handle, start_stage_num, end_stage_num, opts = {})
58
+ opts_get = {
59
+ :start_index => start_stage_num,
60
+ :end_index => end_stage_num
61
+ }.merge(opts)
62
+ get_task_status_elements(task_status_handle, :stage, opts_get)
63
+ end
64
+
65
+ end
66
+ end
67
+ end; end
@@ -0,0 +1,19 @@
1
+ module DTK::Client; class TaskStatus::StreamMode
2
+ class Element
3
+ class TaskEnd < self
4
+ def task_end?()
5
+ true
6
+ end
7
+
8
+ def render
9
+ return if @ignore_stage_level_info
10
+ msg = "end: '#{field?(:display_name) || 'Workflow'}'"
11
+ if duration = formatted_duration?
12
+ msg << " (total duration: #{duration})"
13
+ end
14
+ render_line msg, :bracket => true
15
+ end
16
+ end
17
+ end
18
+ end; end
19
+
@@ -0,0 +1,21 @@
1
+ module DTK::Client; class TaskStatus::StreamMode
2
+ class Element
3
+ class TaskStart < self
4
+ def self.get(task_status_handle, opts = {})
5
+ opts_get = {
6
+ :start_index => 0,
7
+ :end_index => 0
8
+ }.merge(opts)
9
+ get_task_status_elements(task_status_handle, :task_start, opts_get)
10
+ end
11
+
12
+ def render
13
+ return if @ignore_stage_level_info
14
+ msg = "start '#{field?(:display_name) || 'Workflow'}'"
15
+ render_line msg, :bracket => true, :started_at => field?(:started_at)
16
+ render_empty_lines 2
17
+ end
18
+ end
19
+ end
20
+ end; end
21
+
@@ -0,0 +1,85 @@
1
+ module DTK::Client; class TaskStatus::StreamMode
2
+ class Element
3
+ require File.expand_path('element/format', File.dirname(__FILE__))
4
+ require File.expand_path('element/render', File.dirname(__FILE__))
5
+ require File.expand_path('element/hierarchical_task', File.dirname(__FILE__))
6
+ require File.expand_path('element/task_start', File.dirname(__FILE__))
7
+ require File.expand_path('element/task_end', File.dirname(__FILE__))
8
+ require File.expand_path('element/stage', File.dirname(__FILE__))
9
+ require File.expand_path('element/no_results', File.dirname(__FILE__))
10
+ include RenderMixin
11
+
12
+ def initialize(response_element, opts = {})
13
+ @response_element = response_element
14
+ @formatter = Format.new(response_element['type'])
15
+ @ignore_stage_level_info = opts[:ignore_stage_level_info]
16
+ end
17
+
18
+ def self.get_and_render_task_start(task_status_handle, opts = {})
19
+ render_elements(TaskStart.get(task_status_handle, opts))
20
+ end
21
+
22
+ def self.get_and_render_stages(task_status_handle, opts = {})
23
+ Stage.get_and_render_stages(task_status_handle, opts)
24
+ end
25
+
26
+ private
27
+
28
+ # opts will have
29
+ # :start_index
30
+ # :end_index
31
+ # opts can have
32
+ # :ignore_stage_level_info - Boolean
33
+ def self.get_task_status_elements(task_status_handle, element_type, opts = {})
34
+ response = task_status_handle.post_call(opts.merge(:form => :stream_form))
35
+ create_elements(response, opts)
36
+ end
37
+
38
+ # opts can have
39
+ # :ignore_stage_level_info - Boolean
40
+ def self.create_elements(response, opts = {})
41
+ response_elements = response.data
42
+ unless response_elements.kind_of?(Array)
43
+ raise DtkError::Client.new("Unexpected that response.data no at array")
44
+ end
45
+ response_elements.map { |el| create(el, opts) }
46
+ end
47
+ def self.create(response_element, opts)
48
+ type = response_element['type']
49
+ case type && type.to_sym
50
+ when :task_start then TaskStart.new(response_element, opts)
51
+ when :task_end then TaskEnd.new(response_element, opts)
52
+ when :stage then Stage.new(response_element, opts)
53
+ when :stage_start then Stage.new(response_element, {:just_render => :start}.merge(opts))
54
+ when :stage_end then Stage.new(response_element, {:just_render => :end}.merge(opts))
55
+ when :no_results then NoResults.new(response_element, opts)
56
+ else raise DtkError::Client.new("Unexpected element type '#{type}'")
57
+ end
58
+ end
59
+
60
+ def self.task_end?(elements)
61
+ elements.empty? or elements.last.kind_of?(TaskEnd)
62
+ end
63
+
64
+ def self.no_results_yet?(elements)
65
+ elements.find{|el|el.kind_of?(NoResults)}
66
+ end
67
+
68
+ def self.render_elements(elements)
69
+ elements.each{ |el| el.render }
70
+ end
71
+
72
+ def render_stage_steps(subtasks)
73
+ HierarchicalTask.render_steps(self, subtasks)
74
+ end
75
+
76
+ def render_stage_results(subtasks)
77
+ HierarchicalTask.render_results(self, subtasks)
78
+ end
79
+
80
+ def field?(field)
81
+ @response_element[field.to_s]
82
+ end
83
+ end
84
+ end; end
85
+
@@ -2,11 +2,11 @@ require 'hirb'
2
2
  module DTK::Client
3
3
  class TaskStatus
4
4
  class StreamMode < self
5
- require File.expand_path('stream_mode/element',File.dirname(__FILE__))
5
+ require File.expand_path('stream_mode/element', File.dirname(__FILE__))
6
6
 
7
- def get_and_render()
8
- Element.get_and_render_task_start(self)
9
- Element.get_and_render_stages(self,:wait => WaitWhenNoResults)
7
+ def get_and_render(opts = {})
8
+ Element.get_and_render_task_start(self, opts)
9
+ Element.get_and_render_stages(self, {:wait => WaitWhenNoResults}.merge(opts))
10
10
  Response::Ok.new()
11
11
  end
12
12
 
@@ -22,7 +22,7 @@ module DTK::Client
22
22
  # start_index: START_INDEX
23
23
  # end_index: END_INDEX
24
24
  # convention is start_position = 0 and end_position = 0 means top level task with start time
25
- def post_body(opts={})
25
+ def post_body(opts = {})
26
26
  ret = super(opts)
27
27
  ret.merge(:start_index => opts[:start_index], :end_index => opts[:end_index])
28
28
  end
@@ -1,26 +1,26 @@
1
1
  module DTK::Client
2
2
  module TaskStatusMixin
3
- def task_status_aux(mode, object_id, object_type, opts={})
3
+ def task_status_aux(mode, object_id, object_type, opts = {})
4
4
  case mode
5
5
  when :refresh
6
- TaskStatus::RefreshMode.new(self,mode,object_id,object_type).task_status(opts)
6
+ TaskStatus::RefreshMode.new(self, mode, object_id, object_type).task_status(opts)
7
7
  when :snapshot
8
- TaskStatus::SnapshotMode.new(self,mode,object_id,object_type).task_status(opts)
8
+ TaskStatus::SnapshotMode.new(self, mode, object_id, object_type).task_status(opts)
9
9
  when :stream
10
10
  assembly_or_workspace_id = object_id
11
11
  task_status_stream(assembly_or_workspace_id)
12
12
  else
13
- legal_modes = [:refresh,:snapshot,:stream]
13
+ legal_modes = [:refresh, :snapshot, :stream]
14
14
  raise DtkError::Usage.new("Illegal mode '#{mode}'; legal modes are: #{legal_modes.join(', ')}")
15
15
  end
16
16
  end
17
17
 
18
- def task_status_stream(assembly_or_workspace_id)
19
- TaskStatus::StreamMode.new(self,:stream,assembly_or_workspace_id,:assembly).get_and_render()
18
+ def task_status_stream(assembly_or_workspace_id, opts = {})
19
+ TaskStatus::StreamMode.new(self, :stream, assembly_or_workspace_id, :assembly).get_and_render(opts)
20
20
  end
21
21
 
22
22
  def list_task_info_aux(object_type, object_id)
23
- response = TaskStatus.new(self,object_id,object_type).post_call(:form => :list)
23
+ response = TaskStatus.new(self, object_id, object_type).post_call(:form => :list)
24
24
  unless response.ok?
25
25
  DtkError.raise_error(response)
26
26
  end
@@ -31,11 +31,11 @@ module DTK::Client
31
31
 
32
32
  dtk_require_common_commands('thor/base_command_helper')
33
33
  class TaskStatus < BaseCommandHelper
34
- require File.expand_path('task_status/snapshot_mode',File.dirname(__FILE__))
35
- require File.expand_path('task_status/refresh_mode',File.dirname(__FILE__))
36
- require File.expand_path('task_status/stream_mode',File.dirname(__FILE__))
34
+ require File.expand_path('task_status/snapshot_mode', File.dirname(__FILE__))
35
+ require File.expand_path('task_status/refresh_mode', File.dirname(__FILE__))
36
+ require File.expand_path('task_status/stream_mode', File.dirname(__FILE__))
37
37
 
38
- def initialize(command,mode,object_id,object_type)
38
+ def initialize(command, mode, object_id, object_type)
39
39
  super(command)
40
40
  @mode = mode
41
41
  @object_id = object_id
@@ -43,14 +43,17 @@ module DTK::Client
43
43
  end
44
44
 
45
45
  private
46
- def post_body(opts={})
46
+
47
+ def post_body(opts = {})
47
48
  id_field = "#{@object_type}_id".to_sym
48
49
  PostBody.new(
49
50
  id_field => @object_id,
50
51
  :form? => opts[:form],
52
+ :wait_for? => opts[:wait_for],
51
53
  :summarize_node_groups? => opts[:summarize]
52
54
  )
53
55
  end
56
+
54
57
  def post_call(opts={})
55
58
  response = post rest_url("#{@object_type}/task_status"), post_body(opts)
56
59
  unless response.ok?
data/lib/util/os_util.rb CHANGED
@@ -241,6 +241,14 @@ module DTK
241
241
  puts colorize(message, color)
242
242
  end
243
243
 
244
+ def print_warning(message)
245
+ print(message, :yellow)
246
+ end
247
+
248
+ def print_deprecate_message(message)
249
+ print_warning(message)
250
+ end
251
+
244
252
  # Public block, method will suspend STDOUT, STDERR in body of it
245
253
  #
246
254
  # Example