Module: Aws::Cfn::Dsl::Output
- Included in:
- Base
- Defined in:
- lib/aws/cfn/dsl/mixins/output.rb
Class Method Summary collapse
Instance Method Summary collapse
- #close_output ⇒ Object
- #open_output(subdir, name) ⇒ Object
- #write(*s) ⇒ Object
- #writeln(s = '') ⇒ Object
Class Method Details
.included(includer) ⇒ Object
46 47 48 |
# File 'lib/aws/cfn/dsl/mixins/output.rb', line 46 def self.included(includer) end |
Instance Method Details
#close_output ⇒ Object
39 40 41 42 43 44 |
# File 'lib/aws/cfn/dsl/mixins/output.rb', line 39 def close_output() if @config[:directory] and @output.size > 0 fp = @output.shift fp.close end end |
#open_output(subdir, name) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/aws/cfn/dsl/mixins/output.rb', line 25 def open_output(subdir,name) if @config[:directory] file = rb_file(subdir, name) if i_am_maintainer(file) @output.unshift File.open(file, 'w') true else false end else true end end |
#write(*s) ⇒ Object
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/aws/cfn/dsl/mixins/output.rb', line 6 def write(*s) if s.is_a?(Array) s = s.join('') end if @output.size > 0 @output[0].write s else print s end end |
#writeln(s = '') ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/aws/cfn/dsl/mixins/output.rb', line 17 def writeln(s='') if @output.size > 0 @output[0].puts s else puts s end end |