strelka 0.2.1 → 0.3.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7cdd135d0300da315861725d0229e676aab747c5
4
- data.tar.gz: 72341e3dee02a2e7579ee284a80735bcf5f724d8
3
+ metadata.gz: 395204eaca2231acafa0f31e6dd55ec96b51199e
4
+ data.tar.gz: 3c36c895a536b326353896d69d63e0d177d10224
5
5
  SHA512:
6
- metadata.gz: 036494b96215b6ea74644e9d95ec691e23d8a580360283b8b2a42eadcbd7e9ce80565283c460f51d5e6b3c9c275ba92d49a88c1a1547c7c5fc92d54720ae46de
7
- data.tar.gz: 89f11b69277c934c2eac8b615045381c2e0270192c46f70c4417af734fad05561f5d6416e3ebbc815b52c38eab154851f05e88e8f58945f3a8a30fe349c6d906
6
+ metadata.gz: fc57d68e1dcbf2ddd207aa60099d8296d217161b7eda72868f4f366ee5340b33f02e03c1c33e9c1b1df0c997591defa10b472f63078e20819ffa715aab0c3cb1
7
+ data.tar.gz: 64890a20a0effca5816512184a9750f9636809b67192b5697e38ee7b441dcb78e98d313386c954a64b3c5429b1314cfb4039549d996c3137a8dc4bdd1c195b88
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -1,3 +1,8 @@
1
+ == v0.3.0 [2013-03-11] Michael Granger <ged@FaerieMUD.org>
2
+
3
+ - Swap PluginFactory for Pluggability
4
+
5
+
1
6
  == v0.2.1 [2013-03-01] Michael Granger <ged@FaerieMUD.org>
2
7
 
3
8
  - Update dependencies
data/Rakefile CHANGED
@@ -24,10 +24,10 @@ hoespec = Hoe.spec 'strelka' do
24
24
  self.dependency 'configurability', '~> 2.0'
25
25
  self.dependency 'foreman', '~> 0.61'
26
26
  self.dependency 'highline', '~> 1.6'
27
- self.dependency 'inversion', '~> 0.11'
27
+ self.dependency 'inversion', '~> 0.12'
28
28
  self.dependency 'loggability', '~> 0.5'
29
29
  self.dependency 'mongrel2', '~> 0.36'
30
- self.dependency 'pluginfactory', '~> 1.0'
30
+ self.dependency 'pluggability', '~> 0.0'
31
31
  self.dependency 'sysexits', '~> 1.1'
32
32
  self.dependency 'trollop', '~> 2.0'
33
33
  self.dependency 'uuidtools', '~> 2.1'
@@ -24,10 +24,10 @@ module Strelka
24
24
  log_as :strelka
25
25
 
26
26
  # Library version constant
27
- VERSION = '0.2.1'
27
+ VERSION = '0.3.0'
28
28
 
29
29
  # Version-control revision constant
30
- REVISION = %q$Revision: c973cb926a4d $
30
+ REVISION = %q$Revision: 01ab7adefccf $
31
31
 
32
32
  require 'strelka/constants'
33
33
  require 'strelka/exceptions'
@@ -207,7 +207,7 @@ require 'strelka/authprovider'
207
207
  # plugins :auth, :errors, :templating
208
208
  #
209
209
  # layout 'examples/layout.tmpl'
210
- # templates \
210
+ # templates \
211
211
  # form: 'examples/auth-form.tmpl',
212
212
  # success: 'examples/auth-success.tmpl'
213
213
  #
@@ -26,6 +26,10 @@ require 'strelka/paramvalidator'
26
26
  # param :id, /\d+/, "The user's numeric ID"
27
27
  # param :mode, /^\s*(?<prefix>[A-Z]{2})-(?<sku>\p{Print}+)/
28
28
  #
29
+ # # ...
30
+ #
31
+ # end # class UserManager
32
+ #
29
33
  # The first item is the parameter _key_, which corresponds to the field 'name' attribute for
30
34
  # a form, or the key for JSON or YAML data.
31
35
  #
@@ -53,19 +57,17 @@ require 'strelka/paramvalidator'
53
57
  #
54
58
  # The inclusion of this plugin also allows you to use parameters in your routes:
55
59
  #
56
- # # :username gets validated and merged into query args; URI parameters
57
- # # clobber query params
58
- # get '/info/:username' do |req|
59
- # req.params.add( :id, /[XRT]\d{4}-\d{8}/ )
60
- # req.params.okay?
61
- # req.params[:username]
62
- # req.params.values_at( :id, :username )
63
- # req.params.username
64
- #
65
- # req.params.error_messages
66
- # end
60
+ # # :username gets validated and merged into query args; URI parameters
61
+ # # clobber query params
62
+ # get '/info/:username' do |req|
63
+ # req.params.add( :id, /[XRT]\d{4}-\d{8}/ )
64
+ # req.params.okay?
65
+ # req.params[:username]
66
+ # req.params.values_at( :id, :username )
67
+ # req.params.username
67
68
  #
68
- # end # class UserManager
69
+ # req.params.error_messages
70
+ # end
69
71
  #
70
72
  # [:FIXME:] Add more docs.
71
73
  module Strelka::App::Parameters
@@ -100,12 +102,6 @@ module Strelka::App::Parameters
100
102
  end
101
103
 
102
104
 
103
- ### Add a 'builtin' constraint type with the specified +name+.
104
- def add_param_type( name, &block )
105
-
106
- end
107
-
108
-
109
105
  ### Get/set the untainting flag. If set, all parameters which match their constraints
110
106
  ### will also be untainted.
111
107
  def untaint_all_constraints( newval=nil )
@@ -51,7 +51,7 @@ require 'strelka/app' unless defined?( Strelka::App )
51
51
  # [ ] Means of tailoring responses for requests for which the response
52
52
  # isn't clearly specified in the RFC (DELETE /resource)
53
53
  # [ ] Sequel plugin for adding links to serialized representations
54
- #
54
+ #
55
55
  # == Caveats / Known Problems
56
56
  #
57
57
  # * Dataset methods declared using the 'subset' declaration don't allow the
@@ -491,7 +491,7 @@ module Strelka::App::RestResources
491
491
 
492
492
  route = "%s/%s" % [ route_prefix, methname ]
493
493
  params = []
494
-
494
+
495
495
  # Add a route placeholder for each parameter of the dataset method
496
496
  meth.parameters.each do |type, param|
497
497
  self.log.debug " adding parameter placeholder to the route for %s parameter %p" %
@@ -619,7 +619,7 @@ module Strelka::App::RestResources
619
619
  #######
620
620
 
621
621
  ### Add parameter validations for the given +columns+ of the specified resource object +rsrcobj+
622
- ### to the specified +req+uest.
622
+ ### to the specified +req+uest.
623
623
  def add_resource_params( req, rsrcobj, *columns )
624
624
  columns = rsrcobj.allowed_columns || rsrcobj.columns if columns.empty?
625
625
 
@@ -2,7 +2,7 @@
2
2
  # vim: set nosta noet ts=4 sw=4:
3
3
  # encoding: utf-8
4
4
 
5
- require 'pluginfactory'
5
+ require 'pluggability'
6
6
 
7
7
  require 'strelka' unless defined?( Strelka )
8
8
  require 'strelka/mixins'
@@ -29,9 +29,9 @@ require 'strelka/mixins'
29
29
  #
30
30
  class Strelka::AuthProvider
31
31
  extend Loggability,
32
+ Pluggability,
32
33
  Strelka::Delegation
33
- include PluginFactory,
34
- Strelka::Constants,
34
+ include Strelka::Constants,
35
35
  Strelka::AbstractClass,
36
36
  Strelka::ResponseHelpers
37
37
 
@@ -39,11 +39,8 @@ class Strelka::AuthProvider
39
39
  log_to :strelka
40
40
 
41
41
 
42
- ### PluginFactory API -- return the Array of directories to search for concrete
43
- ### AuthProvider classes.
44
- def self::derivative_dirs
45
- return ['strelka/authprovider']
46
- end
42
+ # Pluggability API -- Specify the list of prefixes to try when loading plugins
43
+ plugin_prefixes 'strelka/authprovider'
47
44
 
48
45
 
49
46
  #################################################################
@@ -4,7 +4,7 @@ require 'strelka/constants'
4
4
  require 'strelka/httprequest' unless defined?( Strelka::HTTPRequest )
5
5
 
6
6
 
7
- # The mixin that adds methods to Strelka::HTTPRequest for
7
+ # The mixin that adds methods to Strelka::HTTPRequest for
8
8
  # authentication/authorization.
9
9
  module Strelka::HTTPRequest::Auth
10
10
  include Strelka::Constants
@@ -111,7 +111,7 @@ class Strelka::HTTPResponse < Mongrel2::HTTPResponse
111
111
 
112
112
  ### Add a charset to the content-type header in +headers+ if possible.
113
113
  def add_content_type_charset( headers )
114
- return unless headers.content_type &&
114
+ return unless headers.content_type &&
115
115
  headers.content_type.start_with?( 'text' )
116
116
 
117
117
  charset = self.find_header_charset
@@ -914,7 +914,7 @@ class Strelka::ParamValidator
914
914
  end
915
915
 
916
916
 
917
- ### Return an Array of error messages, one for each field present in the parameters in the last
917
+ ### Return an Array of error messages, one for each field present in the parameters in the last
918
918
  ### validation that didn't have a constraint associated with it.
919
919
  def unknown_param_errors
920
920
  self.log.debug "Fetching unknown param errors for %p." % [ self.unknown ]
@@ -3,7 +3,7 @@
3
3
  # encoding: utf-8
4
4
 
5
5
  require 'loggability'
6
- require 'pluginfactory'
6
+ require 'pluggability'
7
7
 
8
8
  require 'strelka' unless defined?( Strelka )
9
9
  require 'strelka/app' unless defined?( Strelka::App )
@@ -24,18 +24,15 @@ require 'strelka/mixins'
24
24
  # <tt>strelka/router/{something}.rb</tt>, and be sure to override the
25
25
  # #add_route and #route_request methods.
26
26
  class Strelka::Router
27
- extend Loggability
28
- include PluginFactory,
29
- Strelka::AbstractClass
27
+ extend Loggability,
28
+ Pluggability
29
+ include Strelka::AbstractClass
30
30
 
31
31
  # Loggability API -- set up logging under the 'strelka' log host
32
32
  log_to :strelka
33
33
 
34
-
35
- ### PluginFactory API -- return the Array of directories to search for plugins.
36
- def self::derivative_dirs
37
- return ['strelka/router']
38
- end
34
+ # Pluggability API -- Specify the list of prefixes to try when loading plugins
35
+ plugin_prefixes 'strelka/router'
39
36
 
40
37
 
41
38
  ### Create a new router that will route requests according to the specified
@@ -64,7 +61,7 @@ class Strelka::Router
64
61
  # {RFC 2616}[http://tools.ietf.org/html/rfc2616#section-9] as a Symbol (e.g.,
65
62
  # +:GET+, +:DELETE+). The +path_array+ will be the route path split up by
66
63
  # path separator. The +routing_info+ is a Hash that contains the action
67
- # that will be run when the route matches, routing options, and any other
64
+ # that will be run when the route matches, routing options, and any other
68
65
  # routing information associated with the route.
69
66
  pure_virtual :add_route
70
67
 
@@ -2,7 +2,7 @@
2
2
  # vim: set nosta noet ts=4 sw=4:
3
3
 
4
4
  require 'digest/sha1'
5
- require 'pluginfactory'
5
+ require 'pluggability'
6
6
  require 'loggability'
7
7
 
8
8
  require 'strelka' unless defined?( Strelka )
@@ -43,19 +43,16 @@ require 'strelka/mixins'
43
43
  #
44
44
  #
45
45
  class Strelka::Session
46
- extend Loggability
47
- include PluginFactory,
48
- Strelka::AbstractClass
46
+ extend Loggability,
47
+ Pluggability
48
+ include Strelka::AbstractClass
49
+
49
50
 
50
51
  # Loggability API -- set up logging under the 'strelka' log host
51
52
  log_to :strelka
52
53
 
53
-
54
- ### PluginFactory API -- return the Array of directories to search for concrete
55
- ### Session classes.
56
- def self::derivative_dirs
57
- return ['strelka/session']
58
- end
54
+ # Pluggability API -- Specify the list of prefixes to try when loading plugins
55
+ plugin_prefixes 'strelka/session'
59
56
 
60
57
 
61
58
  ### Configure the session class with the given +options+, which should be a
@@ -363,7 +363,7 @@ describe Strelka::App::Auth do
363
363
  @app.no_auth_for( '' ) {|req| req.verb == :GET }
364
364
  @app.require_perms_for %r{.*}, :it_assets_webapp
365
365
  @app.require_perms_for( %r{.*}, :@sysadmin ) {|req, m| req.verb != :GET }
366
-
366
+
367
367
  app = @app.new
368
368
 
369
369
  req = @request_factory.get( '/api/v1' )
@@ -309,7 +309,7 @@ describe Strelka::App::RestResources do
309
309
  body.first.should be_a( Hash )
310
310
  body.first['port'].should > 1024
311
311
  end
312
-
312
+
313
313
  it "has a GET route for methods declared in a named dataset module" do
314
314
  req = @request_factory.get( '/api/v1/servers/by_name/Step',
315
315
  :accept => 'application/json' )
@@ -32,7 +32,7 @@ describe Strelka::AuthProvider do
32
32
 
33
33
 
34
34
  it "looks for plugins under strelka/authprovider" do
35
- described_class.derivative_dirs.should include( 'strelka/authprovider' )
35
+ described_class.plugin_prefixes.should include( 'strelka/authprovider' )
36
36
  end
37
37
 
38
38
 
@@ -33,7 +33,7 @@ describe Strelka::Router do
33
33
 
34
34
 
35
35
  it "looks for plugins under strelka/router" do
36
- Strelka::Router.derivative_dirs.should include( 'strelka/router' )
36
+ Strelka::Router.plugin_prefixes.should include( 'strelka/router' )
37
37
  end
38
38
 
39
39
 
@@ -32,7 +32,7 @@ describe Strelka::Session do
32
32
 
33
33
 
34
34
  it "looks for plugins under strelka/session" do
35
- described_class.derivative_dirs.should include( 'strelka/session' )
35
+ described_class.plugin_prefixes.should include( 'strelka/session' )
36
36
  end
37
37
 
38
38
 
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.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Granger
@@ -30,7 +30,7 @@ cert_chain:
30
30
  6mKCwjpegytE0oifXfF8k75A9105cBnNiMZOe1tXiqYc/exCgWvbggurzDOcRkZu
31
31
  /YSusaiDXHKU2O3Akc3htA==
32
32
  -----END CERTIFICATE-----
33
- date: 2013-03-01 00:00:00.000000000 Z
33
+ date: 2013-03-12 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: configurability
@@ -80,14 +80,14 @@ dependencies:
80
80
  requirements:
81
81
  - - ~>
82
82
  - !ruby/object:Gem::Version
83
- version: '0.11'
83
+ version: '0.12'
84
84
  type: :runtime
85
85
  prerelease: false
86
86
  version_requirements: !ruby/object:Gem::Requirement
87
87
  requirements:
88
88
  - - ~>
89
89
  - !ruby/object:Gem::Version
90
- version: '0.11'
90
+ version: '0.12'
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: loggability
93
93
  requirement: !ruby/object:Gem::Requirement
@@ -117,19 +117,19 @@ dependencies:
117
117
  - !ruby/object:Gem::Version
118
118
  version: '0.36'
119
119
  - !ruby/object:Gem::Dependency
120
- name: pluginfactory
120
+ name: pluggability
121
121
  requirement: !ruby/object:Gem::Requirement
122
122
  requirements:
123
123
  - - ~>
124
124
  - !ruby/object:Gem::Version
125
- version: '1.0'
125
+ version: '0.0'
126
126
  type: :runtime
127
127
  prerelease: false
128
128
  version_requirements: !ruby/object:Gem::Requirement
129
129
  requirements:
130
130
  - - ~>
131
131
  - !ruby/object:Gem::Version
132
- version: '1.0'
132
+ version: '0.0'
133
133
  - !ruby/object:Gem::Dependency
134
134
  name: sysexits
135
135
  requirement: !ruby/object:Gem::Requirement
metadata.gz.sig CHANGED
Binary file