service_mock 0.5.2 → 0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c01943433a45f68b91e1439611ec86965ab1efb0
4
- data.tar.gz: 698fa62a5d83078d19aa2d5d215a21f4a691af27
3
+ metadata.gz: b891d952ac8245a9333fba17e4600dbf404a46dc
4
+ data.tar.gz: 9912ed6df33f2f6a743fd2f56120d1fc23bf5b5f
5
5
  SHA512:
6
- metadata.gz: 6b937cb89456d8d5c73b0d42d13614fcec311739c1c10ec292d526a27b51cfa9e7e3ec332ec0672f337659313bcf17d701572a32cd7b2885fe0e0655c02a840a
7
- data.tar.gz: 1ffe3e9cf59ffd17c95ba02d66b1ba4cc34821ec2d1c3208021b0654ed6171e78ebbd6a8a7af51827ab3ff8cb8f7488b318b4e2be649b51d9711efb268b149b2
6
+ metadata.gz: dd9407b2f66e52be507e5f07538da001dc35869c5ef6e9049afc3e98c22a35a8881cfe6a01cb27888f2f63c16f56c07d4a0a9c4b084a9244c60a147f7bcafc90
7
+ data.tar.gz: 228ff0302d8406083c42bcf0b6da97750bffe469ccd6cd5983d0019e67532492f5bf30a11572f80e863427d665176f93ff82ade81fbc2d2f3ee060d1eabe3104
data/ChangeLog CHANGED
@@ -1,3 +1,6 @@
1
+ === Release 0.6
2
+ * Added value_with_default method to be used in templates
3
+
1
4
  === Release 0.5.2
2
5
  * Fixed defect with merging data where key doesn't exist
3
6
 
data/lib/service_mock.rb CHANGED
@@ -2,7 +2,7 @@ require 'service_mock/core_ext/string'
2
2
  require 'service_mock/version'
3
3
  require 'service_mock/command_line_options'
4
4
  require 'service_mock/server'
5
- require 'service_mock/render_subtemplate'
5
+ require 'service_mock/erb_methods'
6
6
  require 'service_mock/stub_creator'
7
7
  require 'service_mock/rake/rake_tasks'
8
8
 
@@ -1,7 +1,7 @@
1
1
  require 'erb'
2
2
 
3
3
  module ServiceMock
4
- module RenderSubTemplate
4
+ module ErbMethods
5
5
 
6
6
  def render(path)
7
7
  content = File.read(File.expand_path(path))
@@ -9,5 +9,10 @@ module ServiceMock
9
9
  template.result(binding)
10
10
  end
11
11
 
12
+ def value_with_default(value, default)
13
+ return value if value
14
+ default
15
+ end
16
+
12
17
  end
13
18
  end
@@ -2,7 +2,7 @@ require 'childprocess'
2
2
  require 'net/http'
3
3
  require 'erb'
4
4
  require 'ostruct'
5
- require 'service_mock/render_subtemplate'
5
+ require 'service_mock/erb_methods'
6
6
 
7
7
  #
8
8
  # All interaction with the WireMock services is via calls to an instance of
@@ -160,7 +160,7 @@ module ServiceMock
160
160
  private
161
161
 
162
162
  def data_binding(hsh)
163
- OpenStruct.include ::ServiceMock::RenderSubTemplate
163
+ OpenStruct.include ::ServiceMock::ErbMethods
164
164
  OpenStruct.new(hsh).instance_eval { binding }
165
165
  end
166
166
 
@@ -1,3 +1,3 @@
1
1
  module ServiceMock
2
- VERSION = "0.5.2"
2
+ VERSION = "0.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: service_mock
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: '0.6'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeffrey S. Morgan
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-08-17 00:00:00.000000000 Z
11
+ date: 2017-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: childprocess
@@ -88,11 +88,11 @@ files:
88
88
  - lib/service_mock.rb
89
89
  - lib/service_mock/command_line_options.rb
90
90
  - lib/service_mock/core_ext/string.rb
91
+ - lib/service_mock/erb_methods.rb
91
92
  - lib/service_mock/rake/base_task.rb
92
93
  - lib/service_mock/rake/rake_tasks.rb
93
94
  - lib/service_mock/rake/start_server_task.rb
94
95
  - lib/service_mock/rake/stop_server_task.rb
95
- - lib/service_mock/render_subtemplate.rb
96
96
  - lib/service_mock/server.rb
97
97
  - lib/service_mock/stub_creator.rb
98
98
  - lib/service_mock/version.rb
@@ -116,7 +116,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
116
116
  version: '0'
117
117
  requirements: []
118
118
  rubyforge_project:
119
- rubygems_version: 2.5.1
119
+ rubygems_version: 2.5.2
120
120
  signing_key:
121
121
  specification_version: 4
122
122
  summary: Simple wrapper over WireMock