erb-process 0.1.0 → 0.2.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.
@@ -1,6 +1,7 @@
1
1
  require "erb"
2
2
  require "yaml"
3
3
  require "erbprocess/version"
4
+ require 'socket'
4
5
 
5
6
  module ERBProcess
6
7
 
@@ -25,6 +26,10 @@ module ERBProcess
25
26
  t = ERB.new(content)
26
27
  return t.result(binding)
27
28
  end
29
+
30
+ def ERBProcess.gethostname
31
+ return Socket.gethostname.first
32
+ end
28
33
 
29
34
  end
30
35
 
@@ -1,3 +1,3 @@
1
1
  module ERBProcess
2
- VERSION = '0.1.0'
2
+ VERSION = '0.2.0'
3
3
  end
@@ -1,2 +1,3 @@
1
1
  host: <%= config["hostname"]%>
2
- bar: <%= config['foo']%>
2
+ bar: <%= config['foo']%>
3
+ this_host: <%= ERBProcess.gethostname%>
@@ -4,11 +4,11 @@ require "lib/erb-process.rb"
4
4
 
5
5
  class TestERBProcess < Test::Unit::TestCase
6
6
  def testVersion
7
- assert_equal '0.1.0', ERBProcess::VERSION
7
+ assert_equal '0.2.0', ERBProcess::VERSION
8
8
  end
9
9
 
10
10
  def testTemplate
11
- result = "host: http://qa.epals.com\nbar: http://qa.foo.com"
11
+ result = "host: http://qa.epals.com\nbar: http://qa.foo.com\nthis_host: "<<ERBProcess.gethostname
12
12
  assert_equal result, ERBProcess.process("test/config.yml", "test/example_config.erb", "QA")
13
13
  end
14
14
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: erb-process
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 1
8
+ - 2
9
9
  - 0
10
- version: 0.1.0
10
+ version: 0.2.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Patrick O'Leary