wadl 0.3.1.pre1 → 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: 3d354b61e4f78949b820f81bafd9cf67a151c609
4
- data.tar.gz: 703da45e4134f0b86d6207229af2f1f54dceb6e6
3
+ metadata.gz: f58dc8816878169475848021e03ee729eff81c69
4
+ data.tar.gz: cecdcad605786fbc540f1d83900fd12ad8c3aa8d
5
5
  SHA512:
6
- metadata.gz: 3b2bb97cfad57a442ba3471ebc76f612c0d9b54f95881dc7f51968c2905582f969b36721abd7c036430a5de89661e119e20167c674bc98981b9cc0fa60d2f4bc
7
- data.tar.gz: d0539b0d84a7e6a9b2ef7ed34a04ad37c9a6b8c0f85a1f0e97710e64b58f2a5a986ab84a7465f3ef0e6ebe183c22ae4c77d9c6aa411da13add36e639591bdcbe
6
+ metadata.gz: 150215dfa3826822b38bd76feef2292132d511bd27f60f848bc0199184cf03db0a8200a7a3c446a343763fc520889ce8d941c6c2f8b432ad584f76ecca9f21e5
7
+ data.tar.gz: 2380f2b7918c52a1e239d159a052b2968821f6b08ddce1cee7d9b0b72fb86e406760d3e1afe77cf346b1ab0546955d95eed3e0f1d2c6bc038b75c6f377459e97
data/README CHANGED
@@ -61,7 +61,7 @@ Travis CI:: https://travis-ci.org/blackwinter/wadl
61
61
  == LICENSE AND COPYRIGHT
62
62
 
63
63
  Copyright (C) 2006-2008 Leonard Richardson
64
- Copyright (C) 2010-2015 Jens Wille
64
+ Copyright (C) 2010-2016 Jens Wille
65
65
 
66
66
  wadl is free software: you can redistribute it and/or modify it under
67
67
  the terms of the GNU Affero General Public License as published by the
data/Rakefile CHANGED
@@ -15,7 +15,7 @@ begin
15
15
  homepage: :blackwinter,
16
16
  dependencies: {
17
17
  'cyclops' => '~> 0.2',
18
- 'mime-types' => '~> 2.6',
18
+ 'mime-types' => '~> 3.0',
19
19
  'safe_yaml' => '~> 1.0'
20
20
  },
21
21
 
@@ -4,7 +4,7 @@
4
4
  # A component of wadl, the super cheap Ruby WADL client. #
5
5
  # #
6
6
  # Copyright (C) 2006-2008 Leonard Richardson #
7
- # Copyright (C) 2010-2014 Jens Wille #
7
+ # Copyright (C) 2010-2016 Jens Wille #
8
8
  # #
9
9
  # Authors: #
10
10
  # Leonard Richardson <leonardr@segfault.org> (Original author) #
@@ -195,12 +195,12 @@ module WADL
195
195
 
196
196
  private
197
197
 
198
- def _deep_copy_hash(h)
199
- h.inject({}) { |h, (k, v)| h[k] = v && v.dup; h }
198
+ def _deep_copy_hash(o)
199
+ o.inject({}) { |h, (k, v)| h[k] = v && v.dup; h }
200
200
  end
201
201
 
202
- def _deep_copy_array(a)
203
- a.inject([]) { |a, e| a << (e && e.dup) }
202
+ def _deep_copy_array(o)
203
+ o.inject([]) { |a, e| a << (e && e.dup) }
204
204
  end
205
205
 
206
206
  end
@@ -4,7 +4,7 @@
4
4
  # A component of wadl, the super cheap Ruby WADL client. #
5
5
  # #
6
6
  # Copyright (C) 2006-2008 Leonard Richardson #
7
- # Copyright (C) 2010-2014 Jens Wille #
7
+ # Copyright (C) 2010-2016 Jens Wille #
8
8
  # #
9
9
  # Authors: #
10
10
  # Leonard Richardson <leonardr@segfault.org> (Original author) #
@@ -112,11 +112,11 @@ module WADL
112
112
  auto_dereference = args.shift
113
113
  auto_dereference = true if auto_dereference.nil?
114
114
 
115
- match = #{collection_name}.find { |match|
116
- block[match] || (
115
+ match = #{collection_name}.find { |_match|
116
+ block[_match] || (
117
117
  #{klass}.may_be_reference? &&
118
118
  auto_dereference &&
119
- block[match.dereference]
119
+ block[_match.dereference]
120
120
  )
121
121
  }
122
122
 
@@ -337,10 +337,10 @@ module WADL
337
337
  if default
338
338
  memo = []
339
339
 
340
- paths.map { |level, path|
341
- if path
342
- memo.slice!(level..-1)
343
- memo[level] = path
340
+ paths.map { |_level, _path|
341
+ if _path
342
+ memo.slice!(_level..-1)
343
+ memo[_level] = _path
344
344
 
345
345
  nil # ignore
346
346
  else
@@ -352,12 +352,12 @@ module WADL
352
352
  end
353
353
  end
354
354
 
355
- def to_s(indent = 0, collection = false)
355
+ def to_s(indent = 0, is_collection = false)
356
356
  klass = self.class
357
357
 
358
358
  a = ' '
359
359
  i = a * indent
360
- s = "#{collection ? a * (indent - 1) + '- ' : i}#{klass.name}\n"
360
+ s = "#{is_collection ? a * (indent - 1) + '- ' : i}#{klass.name}\n"
361
361
 
362
362
  if klass.may_be_reference? and href = attributes['href']
363
363
  s << "#{i}= href=#{href}\n"
@@ -4,7 +4,7 @@
4
4
  # A component of wadl, the super cheap Ruby WADL client. #
5
5
  # #
6
6
  # Copyright (C) 2006-2008 Leonard Richardson #
7
- # Copyright (C) 2010-2014 Jens Wille #
7
+ # Copyright (C) 2010-2016 Jens Wille #
8
8
  # #
9
9
  # Authors: #
10
10
  # Leonard Richardson <leonardr@segfault.org> (Original author) #
@@ -26,7 +26,7 @@
26
26
  ###############################################################################
27
27
  #++
28
28
 
29
- require 'uri'
29
+ require 'erb'
30
30
 
31
31
  module WADL
32
32
 
@@ -101,10 +101,10 @@ module WADL
101
101
  # If the param lists acceptable values in option tags, make sure that
102
102
  # all values are found in those tags.
103
103
  if options && !options.empty?
104
- values.each { |value|
105
- unless find_option(value)
104
+ values.each { |_value|
105
+ unless find_option(_value)
106
106
  acceptable = options.map { |o| o.value }.join('", "')
107
- raise ArgumentError, %Q{"#{value}" is not among the acceptable parameter values ("#{acceptable}")}
107
+ raise ArgumentError, %Q{"#{_value}" is not among the acceptable parameter values ("#{acceptable}")}
108
108
  end
109
109
  }
110
110
  end
@@ -112,23 +112,29 @@ module WADL
112
112
  if style == 'query' || parent.is_a?(RequestFormat) || (
113
113
  parent.respond_to?(:is_form_representation?) && parent.is_form_representation?
114
114
  )
115
- values.map { |v| "#{URI.escape(name)}=#{URI.escape(v.to_s)}" }.join('&')
115
+ values.map { |v| "#{uri_escape(name)}=#{uri_escape(v.to_s)}" }.join('&')
116
116
  elsif style == 'matrix'
117
117
  if type == 'xsd:boolean'
118
118
  values.map { |v| ";#{name}" if v =~ BOOLEAN_RE }.compact.join
119
119
  else
120
- values.map { |v| ";#{URI.escape(name)}=#{URI.escape(v.to_s)}" if v }.compact.join
120
+ values.map { |v| ";#{uri_escape(name)}=#{uri_escape(v.to_s)}" if v }.compact.join
121
121
  end
122
122
  elsif style == 'header'
123
123
  values.join(',')
124
124
  else
125
125
  # All other cases: plain text representation.
126
- values.map { |v| URI.escape(v.to_s) }.join(',')
126
+ values.map { |v| uri_escape(v.to_s) }.join(',')
127
127
  end
128
128
  end
129
129
 
130
130
  alias_method :%, :format
131
131
 
132
+ private
133
+
134
+ def uri_escape(v)
135
+ ERB::Util.url_encode(v)
136
+ end
137
+
132
138
  end
133
139
 
134
140
  end
@@ -4,7 +4,7 @@
4
4
  # A component of wadl, the super cheap Ruby WADL client. #
5
5
  # #
6
6
  # Copyright (C) 2006-2008 Leonard Richardson #
7
- # Copyright (C) 2010-2014 Jens Wille #
7
+ # Copyright (C) 2010-2016 Jens Wille #
8
8
  # #
9
9
  # Authors: #
10
10
  # Leonard Richardson <leonardr@segfault.org> (Original author) #
@@ -63,7 +63,7 @@ module WADL
63
63
  raise ArgumentError, "Your proposed representation is missing a value for #{param.name}" if param.required?
64
64
  end
65
65
 
66
- p_values.each { |v| representation << "#{CGI::escape(name)}=#{CGI::escape(v.to_s)}" } if p_values
66
+ p_values.each { |v| representation << "#{CGI.escape(name)}=#{CGI.escape(v.to_s)}" } if p_values
67
67
  }
68
68
 
69
69
  representation.join('&')
@@ -10,7 +10,7 @@ module WADL
10
10
 
11
11
  # Returns array representation.
12
12
  def to_a
13
- [MAJOR, MINOR, TINY] << 'pre1'
13
+ [MAJOR, MINOR, TINY]
14
14
  end
15
15
 
16
16
  # Short-cut for version string.
metadata CHANGED
@@ -1,36 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wadl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1.pre1
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leonard Richardson
8
8
  - Jens Wille
9
9
  autorequire:
10
10
  bindir: bin
11
- cert_chain:
12
- - |
13
- -----BEGIN CERTIFICATE-----
14
- MIIDMDCCAhigAwIBAgIBADANBgkqhkiG9w0BAQUFADA+MQswCQYDVQQDDAJ3dzEb
15
- MBkGCgmSJomT8ixkARkWC2JsYWNrd2ludGVyMRIwEAYKCZImiZPyLGQBGRYCZGUw
16
- HhcNMTMwMTMxMDkyMjIyWhcNMTQwMTMxMDkyMjIyWjA+MQswCQYDVQQDDAJ3dzEb
17
- MBkGCgmSJomT8ixkARkWC2JsYWNrd2ludGVyMRIwEAYKCZImiZPyLGQBGRYCZGUw
18
- ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDVXmfa6rbTwKOvtuGoROc1
19
- I4qZjgLX0BA4WecYB97PjwLJmJ1hRvf9JulVCJYYmt5ZEPPXbgi9xLbcp6ofGmnC
20
- i68/kbhcz20/fRUtIJ2phU3ypQTEd2pFddpL7SR2FxLkzvvg5E6nslGn7o2erDpO
21
- 8sm610A3xsgT/eNIr9QA7k4pHh18X1KvZKmmQR4/AjVyKmKawzauKUoHHepjvjVs
22
- s0pVoM7UmOmrS4SafQ3OwUo37f19CVdN2/FW7z3e5+iYhKxdIFdhniX9iDWtA3Jn
23
- 7oUOtiolhCRK4P/c30UjTCDkRkOldsWciFUasROJ5VAV2SVv7FtGHoQLDZ/++tRr
24
- AgMBAAGjOTA3MAkGA1UdEwQCMAAwHQYDVR0OBBYEFIAPWU4BEoYUe82hY/0EkoGd
25
- Oo/WMAsGA1UdDwQEAwIEsDANBgkqhkiG9w0BAQUFAAOCAQEAf2YnB0mj42of22dA
26
- MimgJCAEgB3H5aHbZ6B5WVnFvrC2UUnhP+/kLj/6UgOfqcasy4Xh62NVGuNrf7rF
27
- 7NMN87XwexGuU2GCpIMUd6VCTA7zMP2OWuXEcba7jT5OtiI55buO0J4CRtyeX1XF
28
- qwlGgx4ItcGhMTlDFXj3IkpeVtjD8O7yWE21bHf9lLURmqK/r9KjoxrrVi7+cESJ
29
- H19TDW3R9p594jCl1ykPs3dz/0Bk+r1HTd35Yw+yBbyprSJb4S7OcRRHCryuo09l
30
- NBGyZvOBuqUp0xostWSk0dfxyn/YQ7eqvQRGBhK1VGa7Tg/KYqnemDE57+VOXrua
31
- 59wzaA==
32
- -----END CERTIFICATE-----
33
- date: 2015-12-21 00:00:00.000000000 Z
11
+ cert_chain: []
12
+ date: 2016-04-08 00:00:00.000000000 Z
34
13
  dependencies:
35
14
  - !ruby/object:Gem::Dependency
36
15
  name: cyclops
@@ -52,14 +31,14 @@ dependencies:
52
31
  requirements:
53
32
  - - "~>"
54
33
  - !ruby/object:Gem::Version
55
- version: '2.6'
34
+ version: '3.0'
56
35
  type: :runtime
57
36
  prerelease: false
58
37
  version_requirements: !ruby/object:Gem::Requirement
59
38
  requirements:
60
39
  - - "~>"
61
40
  - !ruby/object:Gem::Version
62
- version: '2.6'
41
+ version: '3.0'
63
42
  - !ruby/object:Gem::Dependency
64
43
  name: safe_yaml
65
44
  requirement: !ruby/object:Gem::Requirement
@@ -184,7 +163,7 @@ metadata: {}
184
163
  post_install_message:
185
164
  rdoc_options:
186
165
  - "--title"
187
- - wadl Application documentation (v0.3.1.pre1)
166
+ - wadl Application documentation (v0.3.1)
188
167
  - "--charset"
189
168
  - UTF-8
190
169
  - "--line-numbers"
@@ -200,12 +179,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
200
179
  version: 1.9.3
201
180
  required_rubygems_version: !ruby/object:Gem::Requirement
202
181
  requirements:
203
- - - ">"
182
+ - - ">="
204
183
  - !ruby/object:Gem::Version
205
- version: 1.3.1
184
+ version: '0'
206
185
  requirements: []
207
186
  rubyforge_project:
208
- rubygems_version: 2.5.1
187
+ rubygems_version: 2.6.2
209
188
  signing_key:
210
189
  specification_version: 4
211
190
  summary: Super cheap Ruby WADL client.