strelka 0.0.1.pre.284 → 0.0.1.pre.290

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog CHANGED
@@ -1,3 +1,30 @@
1
+ 2012-08-03 Mahlon E. Smith <mahlon@martini.nu>
2
+
3
+ * lib/strelka/paramvalidator.rb:
4
+ Add a paramvalidator built-in for matching UUIDs.
5
+ [3e38478b3f4d] [tip]
6
+
7
+ 2012-07-27 Michael Granger <ged@FaerieMUD.org>
8
+
9
+ * .rvm.gems, Rakefile:
10
+ Bumping mongrel2 dependency
11
+ [c098284fe5df]
12
+
13
+ * bin/strelka:
14
+ Load apps before loading configs so app dependencies contribute to
15
+ config defaults
16
+ [40f1a13a41d7]
17
+
18
+ * lib/strelka/mixins.rb:
19
+ Fix documentation for Strelka::MethodUtilities
20
+ [d4a1f8b96550]
21
+
22
+ 2012-07-18 Michael Granger <ged@FaerieMUD.org>
23
+
24
+ * lib/strelka/app/restresources.rb:
25
+ Fix type on error message
26
+ [67379f896726]
27
+
1
28
  2012-07-17 Michael Granger <ged@FaerieMUD.org>
2
29
 
3
30
  * bin/strelka, lib/strelka/app/restresources.rb,
@@ -6,7 +33,7 @@
6
33
  spec/strelka/app/restresources_spec.rb,
7
34
  spec/strelka/paramvalidator_spec.rb:
8
35
  Clean up some :restresources behavior
9
- [153e65a22805] [tip]
36
+ [153e65a22805]
10
37
 
11
38
  2012-07-16 Michael Granger <ged@FaerieMUD.org>
12
39
 
data/Rakefile CHANGED
@@ -28,7 +28,7 @@ hoespec = Hoe.spec 'strelka' do
28
28
  self.dependency 'highline', '~> 1.6'
29
29
  self.dependency 'inversion', '~> 0.11'
30
30
  self.dependency 'loggability', '~> 0.4'
31
- self.dependency 'mongrel2', '~> 0.29'
31
+ self.dependency 'mongrel2', '~> 0.30'
32
32
  self.dependency 'pluginfactory', '~> 1.0'
33
33
  self.dependency 'sysexits', '~> 1.0'
34
34
  self.dependency 'trollop', '~> 1.16'
data/bin/strelka CHANGED
@@ -295,8 +295,8 @@ class Strelka::CLICommand
295
295
  ]
296
296
  fork do
297
297
  self.log.debug " in the child."
298
- Strelka.load_config( self.options.config ) if self.options.config
299
298
  apps = Strelka::App.load( path )
299
+ Strelka.load_config( self.options.config ) if self.options.config
300
300
  self.log.debug " loaded: %p" % [ apps ]
301
301
  apps.first.run
302
302
  end
@@ -480,7 +480,7 @@ module Strelka::App::RestResources
480
480
  self.log.debug "Adding dataset method read handler: %s" % [ path ]
481
481
 
482
482
  config = rsrcobj.db_schema[ param ] or
483
- raise ArgumentError, "no such column %p for %p" % [ col, rsrcobj ]
483
+ raise ArgumentError, "no such column %p for %p" % [ param, rsrcobj ]
484
484
  param( param, config[:type] )
485
485
 
486
486
  self.add_route( :GET, path, options ) do |req|
@@ -181,13 +181,13 @@ class Strelka::HTTPRequest < Mongrel2::HTTPRequest
181
181
 
182
182
  ### Return a Hash of request form data.
183
183
  def parse_form_data
184
- unless self.headers.content_type
184
+ unless self.content_type
185
185
  finish_with( HTTP::BAD_REQUEST, "Malformed request (no content type?)" )
186
186
  end
187
187
 
188
188
  self.body.rewind
189
189
 
190
- case self.headers.content_type.split( ';' ).first
190
+ case self.content_type.split( ';' ).first
191
191
  when 'application/x-www-form-urlencoded'
192
192
  return merge_query_args( URI.decode_www_form(self.body.read) )
193
193
  when 'application/json', 'text/javascript'
@@ -195,16 +195,17 @@ class Strelka::HTTPRequest < Mongrel2::HTTPRequest
195
195
  when 'text/x-yaml', 'application/x-yaml'
196
196
  return YAML.load( self.body )
197
197
  when 'multipart/form-data'
198
- boundary = self.headers.content_type[ /\bboundary=(\S+)/, 1 ] or
198
+ boundary = self.content_type[ /\bboundary=(\S+)/, 1 ] or
199
199
  raise Strelka::ParseError, "no boundary found for form data: %p" %
200
- [ self.headers.content_type ]
200
+ [ self.content_type ]
201
201
  boundary = dequote( boundary )
202
202
 
203
203
  parser = Strelka::MultipartParser.new( self.body, boundary )
204
204
  return parser.parse
205
205
  else
206
- raise Strelka::Error, "don't know how to handle %p form data" %
207
- [ self.headers.content_type ]
206
+ self.log.debug "don't know how to handle %p form data" %
207
+ [ self.content_type ]
208
+ return {}
208
209
  end
209
210
  end
210
211
 
@@ -224,7 +224,7 @@ module Strelka
224
224
  # A collection of methods for declaring other methods.
225
225
  #
226
226
  # class MyClass
227
- # include Strelka::MethodUtilities
227
+ # extend Strelka::MethodUtilities
228
228
  #
229
229
  # singleton_attr_accessor :types
230
230
  # singleton_method_alias :kinds, :types
@@ -123,6 +123,7 @@ class Strelka::ParamValidator < ::FormValidator
123
123
  :email => /^(?<email>#{RFC822_EMAIL_ADDRESS})$/,
124
124
  :hostname => /^(?<hostname>#{RFC1738_HOSTNAME})$/,
125
125
  :uri => /^(?<uri>#{URI::URI_REF})$/,
126
+ :uuid => /^(?<uuid>[[:xdigit:]]{8}(?:-[[:xdigit:]]{4}){3}-[[:xdigit:]]{12})$/i
126
127
  }
127
128
 
128
129
  # Pattern to use to strip binding operators from parameter patterns so they
@@ -2,12 +2,12 @@
2
2
  Content-Disposition: fProgram Files\Documents\testfile.rtf"
3
3
  Content-Type: application/rtf
4
4
 
5
- {\rtfcpg10000\cocoartf824\cocoasubrtf420
6
- {\fonttbl\f0\fswiss\fcharset77 Helvetica;}
7
- {\colortbl;\red255\green255\blue255;}
8
- \margl1440\margr1440\vieww9000\viewh8400\viewkind0
9
- \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural
10
-
5
+ {\rtfcpg10000\cocoartf824\cocoasubrtf420
6
+ {\fonttbl\f0\fswiss\fcharset77 Helvetica;}
7
+ {\colortbl;\red255\green255\blue255;}
8
+ \margl1440\margr1440\vieww9000\viewh8400\viewkind0
9
+ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural
10
+
11
11
  \f0\fs24 \cf0 This is a test of the ThingFish upload handler. This is only a test. If this were real, you'd hear people screaming outside in anguish, and emergency sirens blaring.}
12
12
  --sillyboundary
13
13
  Content-Disposition: form-data; name="thingfish-upload"; filename=""
@@ -34,7 +34,7 @@ Content-Disposition: form-data; name="thingfish-metadata-namespace"
34
34
 
35
35
  testing
36
36
  --sillyboundary
37
- Content-Di form-data; name="thingfish-metadata-rating"
37
+ Content-Disposition: form-data; name="thingfish-metadata-rating"
38
38
 
39
39
  5
40
40
  --sillyboundary--
@@ -23,7 +23,7 @@ require 'strelka/cookie'
23
23
  describe Strelka::HTTPRequest do
24
24
 
25
25
  before( :all ) do
26
- setup_logging( :fatal )
26
+ setup_logging()
27
27
  @request_factory = Mongrel2::RequestFactory.new( route: '/directory' )
28
28
  end
29
29
 
@@ -237,14 +237,17 @@ describe Strelka::HTTPRequest do
237
237
 
238
238
  before( :each ) do
239
239
  @req = @request_factory.post( '/directory/path', '',
240
- 'Content-type' => 'multipart/form-data' )
240
+ 'Content-type' => 'multipart/form-data; boundary=--a_boundary' )
241
241
  end
242
242
 
243
- it "returns nil for an empty body" do
244
- pending "multipart/form-data support" do
245
- @req.body = ''
246
- @req.params.should be_nil()
247
- end
243
+ it "returns a hash for form parameters" do
244
+ @req.body = "----a_boundary\r\n" +
245
+ %{Content-Disposition: form-data; name="title"\r\n} +
246
+ %{\r\n} +
247
+ %{An Impossible Task\r\n} +
248
+ %{----a_boundary--\r\n}
249
+
250
+ @req.params.should == {'title' => 'An Impossible Task'}
248
251
  end
249
252
 
250
253
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: strelka
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.pre.284
4
+ version: 0.0.1.pre.290
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -36,7 +36,7 @@ cert_chain:
36
36
  YUhDS0xaZFNLai9SSHVUT3QrZ2JsUmV4OEZBaDhOZUEKY21saFhlNDZwWk5K
37
37
  Z1dLYnhaYWg4NWpJang5NWhSOHZPSStOQU01aUg5a09xSzEzRHJ4YWNUS1Bo
38
38
  cWo1UGp3RgotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==
39
- date: 2012-07-18 00:00:00.000000000 Z
39
+ date: 2012-08-08 00:00:00.000000000 Z
40
40
  dependencies:
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: configurability
@@ -141,7 +141,7 @@ dependencies:
141
141
  requirements:
142
142
  - - ~>
143
143
  - !ruby/object:Gem::Version
144
- version: '0.29'
144
+ version: '0.30'
145
145
  type: :runtime
146
146
  prerelease: false
147
147
  version_requirements: !ruby/object:Gem::Requirement
@@ -149,7 +149,7 @@ dependencies:
149
149
  requirements:
150
150
  - - ~>
151
151
  - !ruby/object:Gem::Version
152
- version: '0.29'
152
+ version: '0.30'
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: pluginfactory
155
155
  requirement: !ruby/object:Gem::Requirement
metadata.gz.sig CHANGED
@@ -1,4 +1 @@
1
- ������)!/���t��o�@yaH�ۤ�ad��k�� ����
2
- �t�
3
- hDM��Eڙ���r~�X�d9�)4�LC��cP�J��=�.���%��:t�]l����8]�RDx8T�b�Vܥ���L�D����Aԫ1��.NM38�Z����(*:��I�e|Q��|���+���/
4
- �������Y �/{�5�>��Z�~��>��X�8��6KY���=�0��suD7�K�2��:0e�fI4��Yz3B
1
+ ��L�5i:��ռ݃ �'��l���As�1�,ҳ� &M��d4��;2�] SbZϮ���`���-��j���� x��o"諈Ž'�H`Ǯz��~A��a� �5�&L.�^3< c��߀�]5`k댩�H���p���U'����.4X�'�u����A��]�#�\��J�&���q�&�ׯ�(?}�2��K��F>G�p V��B������L� ��u�J�)r������l��weO�� ?