strelka-fancyerrors 0.0.1.pre.11 → 0.0.1.pre.12

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.
data.tar.gz.sig CHANGED
Binary file
@@ -2,6 +2,8 @@
2
2
  # vim: set nosta noet ts=4 sw=4:
3
3
  # encoding: utf-8
4
4
 
5
+ require 'loggability'
6
+ require 'configurability'
5
7
  require 'inversion'
6
8
 
7
9
  require 'strelka' unless defined?( Strelka )
@@ -11,15 +13,21 @@ require 'strelka/app' unless defined?( Strelka::App )
11
13
  # Fancy/useful error output for Strelka appliation development. This plugin
12
14
  # uses the Strelka default :errors and :templating plugins.
13
15
  module Strelka::App::FancyErrors
14
- extend Configurability,
16
+ extend Loggability,
17
+ Configurability,
18
+ Strelka::MethodUtilities,
15
19
  Strelka::Plugin
16
20
 
17
21
 
22
+ # Loggability API -- log to Strelka's logger
23
+ log_to :strelka
24
+
25
+
18
26
  # Library version constant
19
27
  VERSION = '0.0.1'
20
28
 
21
29
  # Version-control revision constant
22
- REVISION = %q$Revision: 53d55407cba6 $
30
+ REVISION = %q$Revision: fc2da6ad009a $
23
31
 
24
32
 
25
33
  # Configurability API -- set the config section that affects this plugin
@@ -42,17 +50,39 @@ module Strelka::App::FancyErrors
42
50
  end
43
51
 
44
52
 
53
+ # Configurability configuration defaults
54
+ CONFIG_DEFAULTS = {
55
+ templates_dir: DEFAULT_DATADIR + 'templates',
56
+ }
57
+
58
+
59
+ ##
60
+ # The path to the error templates
61
+ singleton_attr_accessor :templates_dir
62
+ self.templates_dir = CONFIG_DEFAULTS[:templates_dir]
63
+
64
+
65
+ ### Configurability API -- Configure the plugin
66
+ def self::configure( config=nil )
67
+ if config
68
+ self.log.debug "Configuring fancy error templates: %p" % [ config ]
69
+ self.templates_dir = Pathname( config[:templates_dir] ) if config[:templates_dir]
70
+ end
71
+ end
72
+
73
+
45
74
  # Class-level functionality
46
75
  module ClassMethods
76
+ extend Loggability
77
+ log_to :strelka
47
78
 
48
79
  ### Extension callback -- overridden to also install dependencies.
49
80
  def self::extended( obj )
50
81
  super
51
- Strelka.log.debug "Setting up fancy error responses."
82
+ self.log.debug "Setting up fancy error responses."
52
83
 
53
84
  # Add the plugin's template directory to Inversion's template path
54
- templatedir = DEFAULT_DATADIR + 'templates'
55
- Inversion::Template.template_paths.push( templatedir )
85
+ Inversion::Template.template_paths.push( Strelka::App::FancyErrors.templates_dir )
56
86
 
57
87
  # Load the plugins this one depends on if they aren't already
58
88
  obj.plugins :errors, :templating
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: strelka-fancyerrors
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.pre.11
4
+ version: 0.0.1.pre.12
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-05-04 00:00:00.000000000 Z
39
+ date: 2012-05-11 00:00:00.000000000 Z
40
40
  dependencies:
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: strelka
metadata.gz.sig CHANGED
Binary file