ghost_writer 0.4.0 → 0.4.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: ad73ab6b70235e09d11abab7a269a1a73daa594e
4
- data.tar.gz: a66d4559b340bae3ed5ffb1b876711aa2790fa6b
3
+ metadata.gz: 876770396865698ba8324e5b1765edfeffaab4c1
4
+ data.tar.gz: 7c8b0d88212c2985f6969e3a3fcf286db6135d8f
5
5
  SHA512:
6
- metadata.gz: 883153e23aadffda4dc28be4aa9242d4c94d0c676683366eb953d26430879bb2b4834d1981f72e6f9abe551df2d0c5e4e95b7cf7569a4c22b8f388fc7c5b7e78
7
- data.tar.gz: c69d18ddb176d9e9dad7c9b2e46866a4b22fb4deb09588f9d0f95f0c529bf41ec7f3f98a2177544f44a1b9259a84aadf0b38f018ca24a83b4f7315504d79e9db
6
+ metadata.gz: 61966afe8996ef69ffbc49133455adcfae3bb63dbd1ae1ed955ef884cc0e93f912d28127554b279a9eea76be9d6ee2c7dc97e7bf419c6166fd6957ac66e09f36
7
+ data.tar.gz: ee9f5674274384cdcfaf14b6ef5cc4512cf83a2d572323546be75230e62f9ba2b1f951b436f6a98a48a878c9a8bcd25a31417eee080989db75cf4eb1ca6ed135
@@ -21,6 +21,7 @@ Gem::Specification.new do |gem|
21
21
  gem.add_dependency "activesupport", ">= 3.0.0"
22
22
  gem.add_dependency "rspec-rails", "~> 2.11"
23
23
  gem.add_dependency "trollop"
24
+ gem.add_dependency "multi_json"
24
25
 
25
26
  gem.add_development_dependency "rspec-rails", "~> 2.12"
26
27
  gem.add_development_dependency 'rake', ['>= 0']
@@ -1,3 +1,5 @@
1
+ require 'multi_json'
2
+
1
3
  module GhostWriter
2
4
  module Format
3
5
  module Rack
@@ -15,7 +17,7 @@ RUBY
15
17
  docs.each do |d|
16
18
  rack += <<RUBY
17
19
  when [#{d.request_method.inspect}, #{d.path_info.inspect}]
18
- if fuzzy_match(request.params, #{d.param_example.reject {|k, _| k == "format"}.inspect})
20
+ if fuzzy_match(request.params, #{parameter_arranging(d.param_example.reject {|k, _| k == "format"}).inspect})
19
21
  [200, {"Content-Type" => #{d.content_type.inspect}}, [(<<BODY)]]
20
22
  #{d.response_example}
21
23
  BODY
@@ -88,6 +90,10 @@ RUBY
88
90
  def extname
89
91
  "rb"
90
92
  end
93
+
94
+ def parameter_arranging(params)
95
+ MultiJson.load(MultiJson.dump(params))
96
+ end
91
97
  end
92
98
  end
93
99
  end
@@ -1,3 +1,3 @@
1
1
  module GhostWriter
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ghost_writer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - joker1007
@@ -14,104 +14,118 @@ dependencies:
14
14
  name: activesupport
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 3.0.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: 3.0.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rspec-rails
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '2.11'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '2.11'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: trollop
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: multi_json
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
53
67
  - !ruby/object:Gem::Version
54
68
  version: '0'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: rspec-rails
57
71
  requirement: !ruby/object:Gem::Requirement
58
72
  requirements:
59
- - - ~>
73
+ - - "~>"
60
74
  - !ruby/object:Gem::Version
61
75
  version: '2.12'
62
76
  type: :development
63
77
  prerelease: false
64
78
  version_requirements: !ruby/object:Gem::Requirement
65
79
  requirements:
66
- - - ~>
80
+ - - "~>"
67
81
  - !ruby/object:Gem::Version
68
82
  version: '2.12'
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: rake
71
85
  requirement: !ruby/object:Gem::Requirement
72
86
  requirements:
73
- - - '>='
87
+ - - ">="
74
88
  - !ruby/object:Gem::Version
75
89
  version: '0'
76
90
  type: :development
77
91
  prerelease: false
78
92
  version_requirements: !ruby/object:Gem::Requirement
79
93
  requirements:
80
- - - '>='
94
+ - - ">="
81
95
  - !ruby/object:Gem::Version
82
96
  version: '0'
83
97
  - !ruby/object:Gem::Dependency
84
98
  name: rails
85
99
  requirement: !ruby/object:Gem::Requirement
86
100
  requirements:
87
- - - '>='
101
+ - - ">="
88
102
  - !ruby/object:Gem::Version
89
103
  version: 3.2.9
90
- - - <
104
+ - - "<"
91
105
  - !ruby/object:Gem::Version
92
106
  version: '5'
93
107
  type: :development
94
108
  prerelease: false
95
109
  version_requirements: !ruby/object:Gem::Requirement
96
110
  requirements:
97
- - - '>='
111
+ - - ">="
98
112
  - !ruby/object:Gem::Version
99
113
  version: 3.2.9
100
- - - <
114
+ - - "<"
101
115
  - !ruby/object:Gem::Version
102
116
  version: '5'
103
117
  - !ruby/object:Gem::Dependency
104
118
  name: tapp
105
119
  requirement: !ruby/object:Gem::Requirement
106
120
  requirements:
107
- - - '>='
121
+ - - ">="
108
122
  - !ruby/object:Gem::Version
109
123
  version: '0'
110
124
  type: :development
111
125
  prerelease: false
112
126
  version_requirements: !ruby/object:Gem::Requirement
113
127
  requirements:
114
- - - '>='
128
+ - - ">="
115
129
  - !ruby/object:Gem::Version
116
130
  version: '0'
117
131
  description: Generate API examples from params and response of controller specs
@@ -122,8 +136,8 @@ executables:
122
136
  extensions: []
123
137
  extra_rdoc_files: []
124
138
  files:
125
- - .gitignore
126
- - .travis.yml
139
+ - ".gitignore"
140
+ - ".travis.yml"
127
141
  - Gemfile
128
142
  - LICENSE.txt
129
143
  - README.md
@@ -190,17 +204,17 @@ require_paths:
190
204
  - lib
191
205
  required_ruby_version: !ruby/object:Gem::Requirement
192
206
  requirements:
193
- - - '>='
207
+ - - ">="
194
208
  - !ruby/object:Gem::Version
195
209
  version: '0'
196
210
  required_rubygems_version: !ruby/object:Gem::Requirement
197
211
  requirements:
198
- - - '>='
212
+ - - ">="
199
213
  - !ruby/object:Gem::Version
200
214
  version: '0'
201
215
  requirements: []
202
216
  rubyforge_project:
203
- rubygems_version: 2.0.3
217
+ rubygems_version: 2.1.4
204
218
  signing_key:
205
219
  specification_version: 4
206
220
  summary: Generate API examples from params and response of controller specs