strelka 0.0.1.pre.244 → 0.0.1.pre.252

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. data.tar.gz.sig +0 -0
  2. data/ChangeLog +57 -3
  3. data/Manifest.txt +3 -4
  4. data/Rakefile +1 -1
  5. data/bin/strelka +4 -7
  6. data/examples/.env +4 -0
  7. data/examples/Procfile +8 -0
  8. data/examples/apps/auth-demo +3 -5
  9. data/examples/apps/auth-demo2 +10 -9
  10. data/{data/strelka → examples}/apps/hello-world +1 -2
  11. data/examples/apps/sessions-demo +2 -2
  12. data/examples/config.yml +12 -1
  13. data/examples/gen-config.rb +5 -6
  14. data/examples/templates/auth-form.tmpl +4 -0
  15. data/examples/templates/auth-success.tmpl +3 -1
  16. data/lib/strelka.rb +15 -21
  17. data/lib/strelka/app.rb +53 -31
  18. data/lib/strelka/app/auth.rb +260 -132
  19. data/lib/strelka/app/sessions.rb +25 -31
  20. data/lib/strelka/authprovider/basic.rb +33 -9
  21. data/lib/strelka/authprovider/hostaccess.rb +1 -1
  22. data/lib/strelka/constants.rb +0 -11
  23. data/lib/strelka/cookie.rb +17 -1
  24. data/lib/strelka/httpresponse/negotiation.rb +1 -1
  25. data/lib/strelka/session/db.rb +49 -25
  26. data/lib/strelka/session/default.rb +39 -19
  27. data/spec/lib/helpers.rb +3 -24
  28. data/spec/strelka/app/auth_spec.rb +461 -177
  29. data/spec/strelka/app/sessions_spec.rb +7 -26
  30. data/spec/strelka/app_spec.rb +3 -3
  31. data/spec/strelka/authprovider/basic_spec.rb +4 -4
  32. data/spec/strelka/httprequest/session_spec.rb +1 -1
  33. data/spec/strelka/httpresponse/session_spec.rb +1 -1
  34. data/spec/strelka/session/db_spec.rb +6 -1
  35. data/spec/strelka/session/default_spec.rb +3 -3
  36. metadata +7 -8
  37. metadata.gz.sig +2 -2
  38. data/examples/apps/ws-echo +0 -17
  39. data/lib/strelka/logging.rb +0 -301
  40. data/spec/strelka/logging_spec.rb +0 -74
@@ -1,74 +0,0 @@
1
- # -*- ruby -*-
2
- # vim: set nosta noet ts=4 sw=4:
3
- # encoding: utf-8
4
-
5
- BEGIN {
6
- require 'pathname'
7
- basedir = Pathname.new( __FILE__ ).dirname.parent.parent
8
- $LOAD_PATH.unshift( basedir ) unless $LOAD_PATH.include?( basedir )
9
- }
10
-
11
- require 'rspec'
12
- require 'stringio'
13
-
14
- require 'spec/lib/helpers'
15
-
16
- require 'strelka'
17
- require 'strelka/logging'
18
-
19
-
20
- #####################################################################
21
- ### C O N T E X T S
22
- #####################################################################
23
-
24
- describe Strelka::Logging, "-extended module" do
25
-
26
- before( :each ) do
27
- @extended_module = Module.new do
28
- extend Strelka::Logging
29
- end
30
- end
31
-
32
- it "should have a default Logger" do
33
- @extended_module.logger.should be_a( Logger )
34
- @extended_module.default_logger.should equal( @extended_module.logger )
35
- end
36
-
37
- it "should know if its default logger is replaced" do
38
- @extended_module.should be_using_default_logger
39
- @extended_module.logger = Logger.new( $stderr )
40
- @extended_module.should_not be_using_default_logger
41
- end
42
-
43
- it "has the default logger instance after being reset" do
44
- @extended_module.reset_logger
45
- @extended_module.logger.should equal( @extended_module.default_logger )
46
- end
47
-
48
- it "has the default log formatter instance after being reset" do
49
- @extended_module.reset_logger
50
- @extended_module.logger.formatter.should equal( @extended_module.default_log_formatter )
51
- end
52
-
53
-
54
- context "with new defaults" do
55
-
56
- before( :each ) do
57
- @sink = StringIO.new
58
- @logger = Logger.new( @sink )
59
- @formatter = Strelka::Logging::ColorFormatter.new( @logger )
60
-
61
- @extended_module.default_logger = @logger
62
- @extended_module.default_log_formatter = @formatter
63
- end
64
-
65
- it "uses the new defaults when the logging subsystem is reset" do
66
- @extended_module.reset_logger
67
- @extended_module.logger.should equal( @logger )
68
- end
69
-
70
- end
71
-
72
-
73
- end
74
-