strelka 0.0.1.pre.295 → 0.0.1.pre.301

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,51 @@
1
+ # vim: set sta et ts=4 sw=4 ft=yaml:
2
+
3
+ ### This is an example configuration file for a Strelka application. It
4
+ ### includes options for creating the Mongrel2 settings database, along with
5
+ ### behavioral knobs for specific Strelka components.
6
+
7
+ # The location on disk where the sqlite database will be stored.
8
+ mongrel2:
9
+ configdb: amalgalite://mongrel2.sqlite
10
+
11
+ # Use the Basic authentication provider for
12
+ # any routes that require user validation.
13
+ auth:
14
+ provider: basic
15
+
16
+ # Configuration for the Basic auth provider.
17
+ basicauth:
18
+ realm: Examples
19
+ users:
20
+ ged: "dn44fsIrKF6KmBw0im4GIJktSpM="
21
+ jblack: "1pAnQNSVtpL1z88QwXV4sG8NMP8="
22
+ kmurgen: "MZj9+VhZ8C9+aJhmwp+kWBL76Vs="
23
+
24
+ # Use built in (in-process) session storage.
25
+ sessions:
26
+ type: default
27
+
28
+ # Configuration for the built in session provider.
29
+ defaultsession:
30
+ cookie_name: "session-demo"
31
+ cookie_options:
32
+ expires: +5m
33
+
34
+ # Inversion templating.
35
+ templates:
36
+ template_paths:
37
+ - templates
38
+ ignore_unknown_tags: true
39
+ on_render_error: ignore
40
+ debugging_comments: false
41
+ strip_tag_lines: false
42
+ stat_delay: 300
43
+
44
+ # Logging behaviors for classes that are extended with Loggability.
45
+ logging:
46
+ strelka: debug (color)
47
+ inversion: info (color)
48
+ configurability: debug (color)
49
+ mongrel2: debug (color)
50
+
51
+
@@ -297,7 +297,7 @@ class Strelka::Cookie
297
297
 
298
298
  ### Return the cookie as a String
299
299
  def to_s
300
- rval = "%s=%s" % [ self.name, make_valuestring(self.values) ]
300
+ rval = "%s=%s" % [ self.name, self.make_valuestring ]
301
301
 
302
302
  rval << make_field( "Version", self.version ) if self.version.nonzero?
303
303
  rval << make_field( "Domain", self.domain )
@@ -325,6 +325,15 @@ class Strelka::Cookie
325
325
  end
326
326
 
327
327
 
328
+ #########
329
+ protected
330
+ #########
331
+
332
+ ### Make a uri-escaped value string for the cookie's current +values+.
333
+ def make_valuestring
334
+ return self.values.collect {|val| URI.encode_www_form_component(val) }.join('&')
335
+ end
336
+
328
337
 
329
338
  #######
330
339
  private
@@ -358,12 +367,6 @@ class Strelka::Cookie
358
367
  end
359
368
 
360
369
 
361
- ### Make a uri-escaped value string for the given +values+
362
- def make_valuestring( values )
363
- return values.collect {|val| URI.encode_www_form_component(val) }.join('&')
364
- end
365
-
366
-
367
370
  ### Make an RFC2109-formatted date out of +date+.
368
371
  def make_cookiedate( date )
369
372
  return date.gmtime.strftime( COOKIE_DATE_FORMAT )
@@ -719,6 +719,12 @@ class Strelka::ParamValidator < ::FormValidator
719
719
  end
720
720
 
721
721
 
722
+ ### Match valid UUIDs.
723
+ def match_uuid( val )
724
+ return self.match_builtin_constraint( val, :uuid )
725
+ end
726
+
727
+
722
728
  ### Match valid URIs
723
729
  def match_uri( val )
724
730
  return self.match_builtin_constraint( val, :uri ) do |m|
@@ -905,6 +905,31 @@ describe Strelka::ParamValidator do
905
905
 
906
906
  end
907
907
 
908
+ describe ":uuid constraints" do
909
+
910
+ it "accepts valid UUIDs without regard to case" do
911
+ @validator.add( :uuid )
912
+ @validator.validate( 'uuid' => '21BEBFCD-d222-4c40-831e-26730dc9531f' )
913
+
914
+ @validator.should be_okay()
915
+ @validator.should_not have_errors()
916
+
917
+ @validator[:uuid].should == '21BEBFCD-d222-4c40-831e-26730dc9531f'
918
+ end
919
+
920
+ it "rejects invalid UUIDs" do
921
+ @validator.add( :uuid )
922
+ @validator.validate( 'uuid' => '21bebfcd-d222-4c40-g31e-26730dc9531f' )
923
+
924
+ @validator.should_not be_okay()
925
+ @validator.should have_errors()
926
+
927
+ @validator[:uuid].should be_nil()
928
+ end
929
+
930
+ end
931
+
932
+
908
933
  describe ":alphanumeric constraints" do
909
934
 
910
935
  it "accepts alphanumeric characters for fields with alphanumeric constraints" do
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.295
4
+ version: 0.0.1.pre.301
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-08-17 00:00:00.000000000 Z
39
+ date: 2012-09-05 00:00:00.000000000 Z
40
40
  dependencies:
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: configurability
@@ -326,34 +326,44 @@ dependencies:
326
326
  - - ~>
327
327
  - !ruby/object:Gem::Version
328
328
  version: '3.0'
329
- description: ! 'Strelka is a framework for creating and deploying Mongrel2 web applications
329
+ description: ! 'Strelka is a framework for creating and deploying
330
330
 
331
- in Ruby, and for managing a Mongrel2 cluster.
331
+ "Mongrel2":http://mongrel2.org/ web applications in Ruby.
332
332
 
333
333
 
334
- It''s named after the Russian dog who was one of the first space travelers
334
+ It''s named after a lesser known "Russian
335
335
 
336
- to orbit the Earth and return alive.'
336
+ cosmonaut":http://en.wikipedia.org/wiki/Strelka_(dog)#Belka_and_Strelka who was
337
+
338
+ one of the first canine space travelers to orbit the Earth and return alive.
339
+
340
+ Her name means "little arrow".'
337
341
  email:
338
342
  - ged@FaerieMUD.org
339
343
  executables:
340
344
  - strelka
341
345
  extensions: []
342
346
  extra_rdoc_files:
347
+ - Deploying.rdoc
343
348
  - History.rdoc
344
349
  - IDEAS.rdoc
345
350
  - MILESTONES.rdoc
346
351
  - Manifest.txt
352
+ - Plugins.rdoc
347
353
  - README.rdoc
354
+ - Tutorial.rdoc
348
355
  files:
349
356
  - .gemtest
350
357
  - ChangeLog
358
+ - Deploying.rdoc
351
359
  - History.rdoc
352
360
  - IDEAS.rdoc
353
361
  - MILESTONES.rdoc
354
362
  - Manifest.txt
363
+ - Plugins.rdoc
355
364
  - README.rdoc
356
365
  - Rakefile
366
+ - Tutorial.rdoc
357
367
  - bin/strelka
358
368
  - contrib/hoetemplate/History.rdoc.erb
359
369
  - contrib/hoetemplate/Manifest.txt.erb
@@ -374,6 +384,7 @@ files:
374
384
  - examples/gen-config.rb
375
385
  - examples/static/examples.css
376
386
  - examples/static/examples.html
387
+ - examples/strelka.conf.example
377
388
  - examples/templates/auth-form.tmpl
378
389
  - examples/templates/auth-success.tmpl
379
390
  - examples/templates/layout.tmpl
@@ -493,6 +504,6 @@ rubyforge_project: strelka
493
504
  rubygems_version: 1.8.24
494
505
  signing_key:
495
506
  specification_version: 3
496
- summary: Strelka is a framework for creating and deploying Mongrel2 web applications
497
- in Ruby, and for managing a Mongrel2 cluster
507
+ summary: Strelka is a framework for creating and deploying "Mongrel2":http://mongrel2.org/
508
+ web applications in Ruby
498
509
  test_files: []
metadata.gz.sig CHANGED
@@ -1,3 +1 @@
1
- Gv�#�SBH��&�C6]�_,J ��6g8pJȶ0���ޡ�
2
- ��;��@K�Y�/�x�~�x��ڬ�c��Kꦇ ��ʬUɅ�m�Y$}A� �T����_H�e�z�#h�u�
3
- ����x>�-
1
+ yn���yZ̳x^<�s1�r��G��ON��������ޥ�{�C\׬6�¦�G��`�I��]@�Lg�B�v��~�f��E�� ����HX�O2;Yfi�e� �ٸ͔W<K+��P*$P2yd�����*gU��c��0b* �����?;Ϋ U�0}*�g=���`�<�Ȥu��\�Y��F�Q��ߔ"W7�iW���<�����D�$�4�$Es�� h�P�"�d���G�9S"l��2�S�ҙE��