expansions 0.3.27 → 0.4.27

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 357ee7dfd98f18535c07ec4741266ece30fad115
4
- data.tar.gz: ca7c9cccf7c80ae6a751e4fdcff9370ce8b23333
3
+ metadata.gz: c31c96a824786fe149f6ba77e3110dd6f827764c
4
+ data.tar.gz: 96972e66f591c73890eed6139ce1c662a68fa32a
5
5
  SHA512:
6
- metadata.gz: 0d3c61a0ab74bc6b6cbdbd0e66f761ceaefd412a27a495ee000b365860205dad102e0cf012dabff1d72b2918742df88253da3aa460151bac4267984bd2b4d5df
7
- data.tar.gz: 94782cafbe72d9478651eaefce186c8749bd84da6d82ea0db5f4f10442c2463ab40d7fb4077b8a7c6423bf205aba285452c9d11096664d8c5072724578a02a8e
6
+ metadata.gz: 7b1b8ea1fa2ca46dd2468d4191b26576debba6160d6290468cbc1b504360dcf3a83aa94dc9e81a6c2db131f0acd0664e6116262800d48728990a0b69f797a351
7
+ data.tar.gz: ee31480cd882aa87f7de0bc39e1e7de787d62d5a356f7186f2c50cf6019db9c41dece2d0cd625b021be73b936780aaa35398a72bdd4e7ce415bfcaddbb0771a9
data/expansions.gemspec CHANGED
@@ -24,7 +24,7 @@ Gem::Specification.new do |s|
24
24
  s.add_development_dependency "guard-rspec", "~> 4.2.9"
25
25
  s.add_development_dependency "fakes-rspec", "~> 2.0.0"
26
26
  s.add_development_dependency "rb-notifu", "~> 0.0.4"
27
- s.add_runtime_dependency 'configatron', '3.2.0'
27
+ s.add_runtime_dependency 'configatron', '4.1.0'
28
28
  s.add_runtime_dependency "mustache", "~> 0.99.5"
29
29
  s.add_runtime_dependency "arrayfu", "~> 1.0.0"
30
30
  end
@@ -1,3 +1,3 @@
1
1
  module Expansions
2
- VERSION = "0.3.27"
2
+ VERSION = "0.4.27"
3
3
  end
@@ -3,17 +3,67 @@ require 'configatron'
3
3
 
4
4
  module Expansions
5
5
  describe MustacheTemplateFile do
6
- before (:each) do
7
- @original_template = <<-original
8
- This is the first line {{ item }}
9
- This is the second line {{ item }}
10
- original
11
- end
12
6
  context "when processing" do
13
- let(:item){"yo"}
7
+ before (:each) do
8
+ @original_template = <<-original
9
+ This is the first line {{ hello }}
10
+ This is the second line {{ hello }}
11
+ original
12
+ end
13
+
14
+ let(:sut){MustacheTemplateFile}
15
+
16
+ configure :hello => 'world'
17
+
18
+ before (:each) do
19
+ @filesystem = RelativeFileSystem.new
20
+ @output = RelativeFileSystem.file_name("out.rb")
21
+ @file_name = RelativeFileSystem.file_name("blah.rb")
22
+
23
+ @filesystem.write_file("blah.rb",@original_template)
24
+
25
+ File.stub(:read_all_text).with(@file_name).and_return(@original_template)
26
+ end
27
+
28
+ after(:each) do
29
+ @filesystem.teardown
30
+ end
31
+
32
+ before (:each) do
33
+ sut.process(:input => @file_name,:output => @output)
34
+ end
35
+
36
+ it "should expand everything" do
37
+ @expected = <<-template
38
+ This is the first line world
39
+ This is the second line world
40
+ template
41
+
42
+ IO.read(@output).should == @expected
43
+ end
44
+
45
+ end
46
+
47
+ context "when processing with nested parameters" do
48
+ before (:each) do
49
+ @original_template = <<-original
50
+ This is the first line {{{my.github.username}}}
51
+ original
52
+
53
+ details = {
54
+ my:
55
+ {
56
+ username: 'jp',
57
+ github:
58
+ {
59
+ username: 'jp'
60
+ }
61
+ }
62
+ }
63
+ configure(details)
64
+ end
14
65
  let(:sut){MustacheTemplateFile}
15
66
 
16
- configatron.configure_from_hash :hello => "world"
17
67
 
18
68
  before (:each) do
19
69
  @filesystem = RelativeFileSystem.new
@@ -22,7 +72,6 @@ This is the second line {{ item }}
22
72
 
23
73
  @filesystem.write_file("blah.rb",@original_template)
24
74
 
25
- configatron.stub(:to_hash).and_return(:item => item)
26
75
  File.stub(:read_all_text).with(@file_name).and_return(@original_template)
27
76
  end
28
77
 
@@ -36,11 +85,10 @@ This is the second line {{ item }}
36
85
 
37
86
  it "should expand everything" do
38
87
  @expected = <<-template
39
- This is the first line #{item}
40
- This is the second line #{item}
41
- template
88
+ This is the first line jp
89
+ template
42
90
 
43
- IO.read(@output).should == @expected
91
+ IO.read(@output).should == @expected
44
92
  end
45
93
 
46
94
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: expansions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.27
4
+ version: 0.4.27
5
5
  platform: ruby
6
6
  authors:
7
7
  - Develop With Passion®
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - '='
74
74
  - !ruby/object:Gem::Version
75
- version: 3.2.0
75
+ version: 4.1.0
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - '='
81
81
  - !ruby/object:Gem::Version
82
- version: 3.2.0
82
+ version: 4.1.0
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: mustache
85
85
  requirement: !ruby/object:Gem::Requirement