debstep 0.0.4 → 0.0.5

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 (2) hide show
  1. data/lib/debstep/script_keeper.rb +11 -3
  2. metadata +1 -1
@@ -6,15 +6,23 @@ module Debstep
6
6
 
7
7
  def initialize(init="#!/usr/bin/env bash", &block)
8
8
  @script = init + "\n"
9
- instance_eval(&block)
9
+ instance_eval(&block) if block_given?
10
10
  end
11
11
 
12
12
  def file(path)
13
- @script += File.open(path, 'r').read.strip + "\n"
13
+ append(File.open(path, 'r').read.strip)
14
+ end
15
+
16
+ def raw(value)
17
+ append(value)
14
18
  end
15
19
 
16
20
  def template(path)
17
- @script += ERB.new(File.open(path, 'r').read.strip).result + "\n"
21
+ append(ERB.new(File.open(path, 'r').read.strip).result)
22
+ end
23
+
24
+ def append(value)
25
+ @script += value + "\n"
18
26
  end
19
27
 
20
28
  alias :run :file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: debstep
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: