service_mock 0.3 → 0.3.1

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: d7fdc7bccb713c57d4015364a05509acc4fbd6c0
4
- data.tar.gz: b2b8020335b3102cba37d8efd6b8c21baa4b8949
3
+ metadata.gz: 90733fe9c3ec0b40a2f3f9bd1d8789d0483c1351
4
+ data.tar.gz: 7531bbf3050b25383e3b4b589086573f8efd6f27
5
5
  SHA512:
6
- metadata.gz: 092ba99d6dd44fd75c64291bd163ea4a1a56b60bbba67e24ecec98b63470d12e79458ac57634bb596247488334bd9cdbfcefa07530261e9d5e396f1027f22513
7
- data.tar.gz: 56b6032dc77a3ec75c6c7bf32c764b465911f1fd1bae10906b935d03b71c525839a0af154ce449ea7cdaee238299141ccb6fc03a4cc5a3519f409ec337afb824
6
+ metadata.gz: f0a76416dfd0be652fe73606e7869a2d2787a442a623dd3c0f0d4b0f50127b0b59506da9c8342ece2a166425b68f735e55159806b23c3ee80eafa257ce60c516
7
+ data.tar.gz: 02634355c9f0cfce0dd2060eac90516ea7b12342f39c4a2b6adaea308099285e6babbef46f45c2f3dd02d245deca7ba6d1222c733ed12b455755276d2e5ff7cb
data/ChangeLog CHANGED
@@ -1,3 +1,8 @@
1
+ === Release 0.3.1 / 2016-06-27
2
+ * Added remove_newlines method to String as a helper for rendering subtemplates
3
+ * Added escape_double_quotes method to String as a helper for rendering subtemplates
4
+ * Added empty Hash as default parameter for stub_with_erb
5
+
1
6
  === Release 0.3 / 2016-06-27
2
7
  * Removed the config directory from the gem thereby reducing the size
3
8
  * Added documentation
data/lib/service_mock.rb CHANGED
@@ -1,3 +1,4 @@
1
+ require 'service_mock/core_ext/string'
1
2
  require 'service_mock/version'
2
3
  require 'service_mock/command_line_options'
3
4
  require 'service_mock/server'
@@ -0,0 +1,10 @@
1
+
2
+ class String
3
+ def remove_newlines
4
+ self.gsub("\n", "")
5
+ end
6
+
7
+ def escape_double_quotes
8
+ self.gsub('"', "\\\"")
9
+ end
10
+ end
@@ -121,7 +121,7 @@ module ServiceMock
121
121
  # Create a stub using the erb template provided. The +Hash+ second
122
122
  # parameter contains the values to be inserted into the +ERB+.
123
123
  #
124
- def stub_with_erb(filename, hsh)
124
+ def stub_with_erb(filename, hsh={})
125
125
  yield self if block_given?
126
126
  template = File.open(filename, 'rb') {|file| file.read}
127
127
  erb_content = ERB.new(template).result(data_binding(hsh))
@@ -1,3 +1,3 @@
1
1
  module ServiceMock
2
- VERSION = "0.3"
2
+ VERSION = "0.3.1"
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.3'
4
+ version: 0.3.1
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-06-27 00:00:00.000000000 Z
11
+ date: 2016-06-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: childprocess
@@ -87,6 +87,7 @@ files:
87
87
  - bin/setup
88
88
  - lib/service_mock.rb
89
89
  - lib/service_mock/command_line_options.rb
90
+ - lib/service_mock/core_ext/string.rb
90
91
  - lib/service_mock/rake/base_task.rb
91
92
  - lib/service_mock/rake/rake_tasks.rb
92
93
  - lib/service_mock/rake/start_server_task.rb