grape-dsl 2.2.1 → 2.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/TODO +1 -0
- data/VERSION +1 -1
- data/lib/grape-dsl/doc.rb +24 -22
- data/lib/grape-dsl/dsl.rb +8 -2
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4dc18b0dd29b0369d3c564db0447d1efc158ebc5
|
4
|
+
data.tar.gz: 4b1d89dd10ea8c441f6a0384cecb4d13149f2313
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dc1f89349bde5ca96e2b5b50ff8219ee663007be8d3d2172955ac24a795623b1635d733a049882250aee65afdacbfb5a4da6abac4b157b1c2734c4c2c7b65748
|
7
|
+
data.tar.gz: d0064cc0334ab78b34e772a37f39abdb0057a33f4753e039e89c31a99561fd48fc64ebcca9c8eca38a3c9f40db35412782c476bfd164ef126c1f63595ab78b07
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.3.0
|
data/lib/grape-dsl/doc.rb
CHANGED
@@ -83,38 +83,40 @@ module GrapeDSL
|
|
83
83
|
|
84
84
|
end
|
85
85
|
|
86
|
-
content_type ||=
|
87
|
-
|
86
|
+
content_type ||= 'TXT'
|
87
|
+
content_type = content_type.keys if content_type.class <= ::Hash
|
88
88
|
|
89
|
-
|
90
|
-
begin
|
89
|
+
[*content_type].each do |one_content_type|
|
91
90
|
|
92
|
-
|
91
|
+
case one_content_type.to_s.downcase
|
93
92
|
|
94
|
-
|
93
|
+
when 'json'
|
94
|
+
begin
|
95
95
|
|
96
|
-
|
96
|
+
tmp_array.push [wrapper_begin,one_content_type.to_s,wrapper_end].join
|
97
97
|
|
98
|
-
|
99
|
-
"{" => "{\n",
|
100
|
-
"}" => "\n}",
|
101
|
-
"," => ",\n"
|
102
|
-
}.each do |from,to|
|
103
|
-
formatted_string.gsub!(from,to)
|
104
|
-
end
|
98
|
+
require 'json'
|
105
99
|
|
106
|
-
|
100
|
+
formatted_string= params.to_json
|
107
101
|
|
108
|
-
|
109
|
-
|
110
|
-
|
102
|
+
{
|
103
|
+
'{' => "{\n",
|
104
|
+
'}' => "\n}",
|
105
|
+
',' => ",\n"
|
106
|
+
}.each do |from,to|
|
107
|
+
formatted_string.gsub!(from,to)
|
108
|
+
end
|
111
109
|
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
110
|
+
formatted_string.gsub!(/^"/," \"")
|
111
|
+
tmp_array.push formatted_string
|
112
|
+
tmp_array.push wrapper_close
|
113
|
+
|
114
|
+
end
|
116
115
|
|
116
|
+
when "txt"
|
117
|
+
tmp_array.push(params.inspect)
|
117
118
|
|
119
|
+
end
|
118
120
|
|
119
121
|
end
|
120
122
|
|
data/lib/grape-dsl/dsl.rb
CHANGED
@@ -12,7 +12,13 @@ module GrapeDSL
|
|
12
12
|
|
13
13
|
@last_description ||= {}
|
14
14
|
unless @last_description[:description].class == Hashie::Mash
|
15
|
-
|
15
|
+
|
16
|
+
@last_description[:description]= Hashie::Mash.new(
|
17
|
+
opts.merge(
|
18
|
+
desc: @last_description[:desc],
|
19
|
+
content_type: self.content_types
|
20
|
+
)
|
21
|
+
)
|
16
22
|
end
|
17
23
|
return @last_description[:description]
|
18
24
|
|
@@ -62,7 +68,7 @@ module GrapeDSL
|
|
62
68
|
end
|
63
69
|
|
64
70
|
alias :cw_routes :console_write_out_routes
|
65
|
-
|
71
|
+
alias :puts_routes :console_write_out_routes
|
66
72
|
|
67
73
|
end
|
68
74
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grape-dsl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Luzsi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-07-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mpatch
|
@@ -51,6 +51,7 @@ files:
|
|
51
51
|
- LICENSE
|
52
52
|
- README.md
|
53
53
|
- Rakefile
|
54
|
+
- TODO
|
54
55
|
- VERSION
|
55
56
|
- files.rb
|
56
57
|
- grape-dsl.gemspec
|