pea 1.3.0 → 1.3.1
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.
- checksums.yaml +7 -0
- data/lib/pea.rb +5 -2
- metadata +7 -9
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: 180a8b6a74d3040ec9e9a38b21b40f031dcd28e2
|
|
4
|
+
data.tar.gz: 4f20375c4842dc954efc58bf6c33ab62d542d0d4
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: d9a0ae460d354d88b2afaa1d106c9639896b3990042058b14d389f7e62127586f84256ba40b0877b861f0393b17c531d262574785addcacc185419a7c2fd80c3
|
|
7
|
+
data.tar.gz: ce841b72ca41eadee9e8ed8f0aa20f5f8da57838abed497dbea0bec37163896250beff6294026ddc90a34f921a46e0676494d3430917a6712d3fda9dd876f2fb
|
data/lib/pea.rb
CHANGED
|
@@ -2,7 +2,7 @@ class Pea
|
|
|
2
2
|
module Version
|
|
3
3
|
MAJOR = 1
|
|
4
4
|
MINOR = 3
|
|
5
|
-
PATCH =
|
|
5
|
+
PATCH = 1
|
|
6
6
|
|
|
7
7
|
FULL = [MAJOR, MINOR, PATCH].join('.')
|
|
8
8
|
|
|
@@ -46,6 +46,8 @@ class Pea
|
|
|
46
46
|
def render(hash)
|
|
47
47
|
@hash = hash
|
|
48
48
|
|
|
49
|
+
template = @contents
|
|
50
|
+
|
|
49
51
|
@hash.each do |key, value|
|
|
50
52
|
unless value.nil?
|
|
51
53
|
@contents = @contents.gsub(/\{#{Regexp.escape(key)}\}/, value)
|
|
@@ -53,7 +55,8 @@ class Pea
|
|
|
53
55
|
end
|
|
54
56
|
|
|
55
57
|
@rendered = @contents
|
|
58
|
+
@contents = template
|
|
56
59
|
|
|
57
|
-
@rendered
|
|
60
|
+
return @rendered
|
|
58
61
|
end
|
|
59
62
|
end
|
metadata
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: pea
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.3.
|
|
5
|
-
prerelease:
|
|
4
|
+
version: 1.3.1
|
|
6
5
|
platform: ruby
|
|
7
6
|
authors:
|
|
8
7
|
- Andy Hamilton
|
|
9
8
|
autorequire:
|
|
10
9
|
bindir: bin
|
|
11
10
|
cert_chain: []
|
|
12
|
-
date: 2013-
|
|
11
|
+
date: 2013-10-10 00:00:00.000000000 Z
|
|
13
12
|
dependencies: []
|
|
14
13
|
description: You can simply provide Pea with a file and a hash of values and pea will
|
|
15
14
|
return the contents of the file with the hash keys replaced with the values
|
|
@@ -21,26 +20,25 @@ files:
|
|
|
21
20
|
- lib/pea.rb
|
|
22
21
|
homepage: http://rubygems.org/gems/pea
|
|
23
22
|
licenses: []
|
|
23
|
+
metadata: {}
|
|
24
24
|
post_install_message:
|
|
25
25
|
rdoc_options: []
|
|
26
26
|
require_paths:
|
|
27
27
|
- lib
|
|
28
28
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
29
|
-
none: false
|
|
30
29
|
requirements:
|
|
31
|
-
- -
|
|
30
|
+
- - '>='
|
|
32
31
|
- !ruby/object:Gem::Version
|
|
33
32
|
version: '0'
|
|
34
33
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
35
|
-
none: false
|
|
36
34
|
requirements:
|
|
37
|
-
- -
|
|
35
|
+
- - '>='
|
|
38
36
|
- !ruby/object:Gem::Version
|
|
39
37
|
version: '0'
|
|
40
38
|
requirements: []
|
|
41
39
|
rubyforge_project:
|
|
42
|
-
rubygems_version:
|
|
40
|
+
rubygems_version: 2.0.3
|
|
43
41
|
signing_key:
|
|
44
|
-
specification_version:
|
|
42
|
+
specification_version: 4
|
|
45
43
|
summary: A very simple templating library!
|
|
46
44
|
test_files: []
|