mirage 2.4.0 → 2.4.1

Sign up to get free protection for your applications and to get access to all the features.
data/HISTORY CHANGED
@@ -1,3 +1,4 @@
1
+ V2.4.1 - adding rdoc for configure method
1
2
  V2.4.0 - Adding ability to set defaults
2
3
  V2.3.0 - Enhanced commandline/programmatic api
3
4
  V2.2.3 - fix bug where mirage is already running a client calls exit.
data/README.md CHANGED
@@ -18,6 +18,23 @@ Installation
18
18
 
19
19
  What's New?
20
20
  -----------
21
+ ### 2.4.0
22
+ ---------
23
+ ##### 1: Configure your client with defaults for each of your responses
24
+ Remove the repetition of setting things like the content-type each to time you put a response on to Mirage
25
+
26
+ **Example Usage:** (See rdoc for full details)
27
+
28
+ client = Mirage::Client.new do |defaults|
29
+ defaults.content_type = "text/xml"
30
+ defaults.delay = 0.5
31
+ end
32
+
33
+ client.put("greeting", "hello") -> template put on to Mirage with a delay of 0.5 seconds and content-type text/xml configured
34
+
35
+
36
+
37
+
21
38
  ### 2.3.0
22
39
  ---------
23
40
  #### What do I get?
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.4.0
1
+ 2.4.1
@@ -10,16 +10,30 @@ module Mirage
10
10
  #
11
11
  # Client.new => a client that is configured to connect to Mirage on http://localhost:7001/mirage (the default settings for Mirage)
12
12
  # Client.new(URL) => a client that is configured to connect to an instance of Mirage running on the specified url.
13
+ #
14
+ # a block can be passed to configure the client with defaults: see configure
13
15
  def initialize url="http://localhost:7001/mirage", &block
14
16
  @url = url
15
- @defaults = Defaults.new
17
+ reset
16
18
  configure &block if block_given?
17
19
  end
18
20
 
21
+
22
+ # Configures default settings to be applied to all response templates put on to Mirage
23
+ #
24
+ # Example:
25
+ # Client.new.configure do
26
+ # defaults.method = :post
27
+ # defaults.status = 202
28
+ # defaults.default = true
29
+ # defaults.delay = 2
30
+ # defaults.content_type = "text/xml"
31
+ # end
19
32
  def configure &block
20
33
  yield @defaults
21
34
  end
22
35
 
36
+ # Remove any defaults applied to this client
23
37
  def reset
24
38
  @defaults = Defaults.new
25
39
  end
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "mirage"
8
- s.version = "2.4.0"
8
+ s.version = "2.4.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Leon Davis"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mirage
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.0
4
+ version: 2.4.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-09-11 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sinatra
16
- requirement: &13798800 !ruby/object:Gem::Requirement
16
+ requirement: &17771380 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *13798800
24
+ version_requirements: *17771380
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: eventmachine
27
- requirement: &13797620 !ruby/object:Gem::Requirement
27
+ requirement: &17770580 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - =
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 1.0.0.rc.4
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *13797620
35
+ version_requirements: *17770580
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: childprocess
38
- requirement: &13789700 !ruby/object:Gem::Requirement
38
+ requirement: &17769600 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *13789700
46
+ version_requirements: *17769600
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: waitforit
49
- requirement: &13788460 !ruby/object:Gem::Requirement
49
+ requirement: &17768660 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *13788460
57
+ version_requirements: *17768660
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: thor
60
- requirement: &13787080 !ruby/object:Gem::Requirement
60
+ requirement: &17767820 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *13787080
68
+ version_requirements: *17767820
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: thin
71
- requirement: &13786060 !ruby/object:Gem::Requirement
71
+ requirement: &17766980 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *13786060
79
+ version_requirements: *17766980
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: rake
82
- requirement: &13784820 !ruby/object:Gem::Requirement
82
+ requirement: &17765980 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: '0'
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *13784820
90
+ version_requirements: *17765980
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: cucumber
93
- requirement: &13783980 !ruby/object:Gem::Requirement
93
+ requirement: &17765040 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ! '>='
@@ -98,10 +98,10 @@ dependencies:
98
98
  version: '0'
99
99
  type: :development
100
100
  prerelease: false
101
- version_requirements: *13783980
101
+ version_requirements: *17765040
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: rspec
104
- requirement: &13732180 !ruby/object:Gem::Requirement
104
+ requirement: &17764080 !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
107
107
  - - ! '>='
@@ -109,10 +109,10 @@ dependencies:
109
109
  version: '0'
110
110
  type: :development
111
111
  prerelease: false
112
- version_requirements: *13732180
112
+ version_requirements: *17764080
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: jeweler
115
- requirement: &13729860 !ruby/object:Gem::Requirement
115
+ requirement: &17759740 !ruby/object:Gem::Requirement
116
116
  none: false
117
117
  requirements:
118
118
  - - ! '>='
@@ -120,10 +120,10 @@ dependencies:
120
120
  version: '0'
121
121
  type: :development
122
122
  prerelease: false
123
- version_requirements: *13729860
123
+ version_requirements: *17759740
124
124
  - !ruby/object:Gem::Dependency
125
125
  name: sinatra-contrib
126
- requirement: &13727620 !ruby/object:Gem::Requirement
126
+ requirement: &17759060 !ruby/object:Gem::Requirement
127
127
  none: false
128
128
  requirements:
129
129
  - - ! '>='
@@ -131,10 +131,10 @@ dependencies:
131
131
  version: '0'
132
132
  type: :development
133
133
  prerelease: false
134
- version_requirements: *13727620
134
+ version_requirements: *17759060
135
135
  - !ruby/object:Gem::Dependency
136
136
  name: mechanize
137
- requirement: &13725580 !ruby/object:Gem::Requirement
137
+ requirement: &17758100 !ruby/object:Gem::Requirement
138
138
  none: false
139
139
  requirements:
140
140
  - - ! '>='
@@ -142,10 +142,10 @@ dependencies:
142
142
  version: '0'
143
143
  type: :development
144
144
  prerelease: false
145
- version_requirements: *13725580
145
+ version_requirements: *17758100
146
146
  - !ruby/object:Gem::Dependency
147
147
  name: nokogiri
148
- requirement: &13680160 !ruby/object:Gem::Requirement
148
+ requirement: &17757280 !ruby/object:Gem::Requirement
149
149
  none: false
150
150
  requirements:
151
151
  - - ! '>='
@@ -153,10 +153,10 @@ dependencies:
153
153
  version: '0'
154
154
  type: :development
155
155
  prerelease: false
156
- version_requirements: *13680160
156
+ version_requirements: *17757280
157
157
  - !ruby/object:Gem::Dependency
158
158
  name: jruby-openssl
159
- requirement: &13678600 !ruby/object:Gem::Requirement
159
+ requirement: &17756480 !ruby/object:Gem::Requirement
160
160
  none: false
161
161
  requirements:
162
162
  - - ! '>='
@@ -164,7 +164,7 @@ dependencies:
164
164
  version: '0'
165
165
  type: :development
166
166
  prerelease: false
167
- version_requirements: *13678600
167
+ version_requirements: *17756480
168
168
  description: Mirage aids testing of your applications by hosting mock responses so
169
169
  that your applications do not have to talk to real endpoints. Its accessible via
170
170
  HTTP and has a RESTful interface.
@@ -249,7 +249,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
249
249
  version: '0'
250
250
  segments:
251
251
  - 0
252
- hash: 943352209253188731
252
+ hash: -2060049518291107890
253
253
  required_rubygems_version: !ruby/object:Gem::Requirement
254
254
  none: false
255
255
  requirements: