inversion 0.8.0 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
data.tar.gz.sig CHANGED
Binary file
data/ChangeLog CHANGED
@@ -1,8 +1,103 @@
1
+ 2012-04-13 Mahlon E. Smith <mahlon@martini.nu>
2
+
3
+ * manual/src/tags.page:
4
+ Fix the include tag example in the manual.
5
+ [b5fcbae36ff2] [tip]
6
+
7
+ 2012-04-02 Michael Granger <ged@FaerieMUD.org>
8
+
9
+ * README.rdoc:
10
+ Update the README to Hoe 3 style.
11
+ [c13d2db3e0ce]
12
+
13
+ * lib/inversion/renderstate.rb:
14
+ Remove an old FIXME comment.
15
+ [21eecc7eafca]
16
+
17
+ 2012-04-01 Michael Granger <ged@FaerieMUD.org>
18
+
19
+ * .hgtags:
20
+ Added tag v0.8.0 for changeset 5d07557a543c
21
+ [57381a550306] [github/master]
22
+
23
+ * .hgsigs:
24
+ Added signature for changeset d461a2bf079d
25
+ [5d07557a543c] [v0.8.0]
26
+
27
+ * Manifest.txt, Rakefile:
28
+ Update the manifest.
29
+ [d461a2bf079d]
30
+
31
+ * History.rdoc, lib/inversion.rb:
32
+ Bump the minor version, update history.
33
+ [2b5542ae6bf6]
34
+
35
+ * lib/inversion.rb, lib/inversion/logging.rb, lib/inversion/mixins.rb,
36
+ lib/inversion/utils.rb, spec/inversion/logging_spec.rb,
37
+ spec/lib/helpers.rb:
38
+ Move logging code out into a separate file.
39
+ [0c88a54d2811]
40
+
41
+ * lib/inversion/mixins.rb, lib/inversion/template/tag.rb:
42
+ Add MethodUtilities mixin for declaring singleton attrs
43
+ [3d40570d7aaf]
44
+
45
+ 2012-03-30 Michael Granger <ged@FaerieMUD.org>
46
+
47
+ * README.rdoc, lib/inversion/renderstate.rb,
48
+ lib/inversion/template.rb, lib/inversion/template/fortag.rb:
49
+ Comment out a bunch of slow debugging, update copyright date.
50
+ [0422221385f6]
51
+
52
+ * lib/inversion/renderstate.rb:
53
+ Handle RenderState::Scope#merge a little more gracefully.
54
+
55
+ Instead of trying to merge locals and then rescuing if the merged
56
+ object doesn't respond to __locals__, implement #to_hash so they're
57
+ able to be merged directly with a Hash.
58
+ [a9d68f668e05]
59
+
60
+ 2012-03-29 Michael Granger <ged@FaerieMUD.org>
61
+
62
+ * .hgtags:
63
+ Added tag v0.7.0 for changeset 33027d3d78c5
64
+ [46549d0c2f86]
65
+
66
+ * .hgsigs:
67
+ Added signature for changeset a202a2c01b18
68
+ [33027d3d78c5] [v0.7.0]
69
+
70
+ * .rvm.gems:
71
+ Updated the rvm gemset.
72
+ [a202a2c01b18]
73
+
74
+ * History.rdoc, lib/inversion.rb:
75
+ Bump the minor version, update history.
76
+ [92c2961cf986]
77
+
78
+ * Rakefile, experiments/renderstate-scope.rb,
79
+ lib/inversion/renderstate.rb, lib/inversion/template/attrtag.rb,
80
+ spec/inversion/renderstate_spec.rb,
81
+ spec/inversion/template/attrtag_spec.rb:
82
+ Switch to a looser eval strategy for rendering tag bodies.
83
+
84
+ The previous method relied on a stack of attributes Hashes in the
85
+ RenderState; the new method in effect wraps a Binding with a
86
+ method_missing for translating identifiers that look like locals
87
+ back into template attributes. This not only allows for template
88
+ attributes to be used as arguments to the methods called on other
89
+ attributes, but avoids sharing the Binding of the RenderState with
90
+ the tags rendered inside it.
91
+
92
+ Backwards-compatibility is also maintained via a few aliases and
93
+ shim methods.
94
+ [5340e6ffaac3]
95
+
1
96
  2012-03-16 Michael Granger <ged@FaerieMUD.org>
2
97
 
3
98
  * .hgtags:
4
99
  Added tag v0.6.1 for changeset e839621aac29
5
- [63e1a917c7ad] [tip]
100
+ [63e1a917c7ad]
6
101
 
7
102
  * .hgsigs:
8
103
  Added signature for changeset 1947a577fae1
@@ -52,7 +147,7 @@
52
147
  * lib/inversion/template.rb, spec/inversion/template_spec.rb:
53
148
  Err, no. Lets try that again. 10,000 monkeys pounding away at
54
149
  keyboards are responsible. Or maybe just one.
55
- [7c42e6b20c11] [github/master]
150
+ [7c42e6b20c11]
56
151
 
57
152
  * lib/inversion/template.rb, manual/src/templates.page,
58
153
  spec/inversion/template_spec.rb:
data/History.rdoc CHANGED
@@ -1,3 +1,9 @@
1
+ == v0.9.0 [2012-04-24] Michael Granger <ged@FaerieMUD.org>
2
+
3
+ - Split the template path out from the config into a class instance variable.
4
+ - Documentation update.
5
+
6
+
1
7
  == v0.8.0 [2012-04-01] Michael Granger <ged@FaerieMUD.org>
2
8
 
3
9
  - Optimization fixes
data/README.rdoc CHANGED
@@ -1,6 +1,8 @@
1
1
  = inversion
2
2
 
3
- * http://deveiate.org/projects/Inversion
3
+ home :: http://deveiate.org/projects/Inversion
4
+ code :: http://repo.deveiate.org/Inversion
5
+ github :: http://github.com/ged/inversion.git
4
6
 
5
7
 
6
8
  == Description
data/lib/inversion.rb CHANGED
@@ -19,10 +19,10 @@ module Inversion
19
19
  warn ">>> Inversion requires Ruby 1.9.2 or later. <<<" if RUBY_VERSION < '1.9.2'
20
20
 
21
21
  # Library version constant
22
- VERSION = '0.8.0'
22
+ VERSION = '0.9.0'
23
23
 
24
24
  # Version-control revision constant
25
- REVISION = %q$Revision: 2b5542ae6bf6 $
25
+ REVISION = %q$Revision: b208fa9154b1 $
26
26
 
27
27
  require 'inversion/logging'
28
28
  extend Inversion::Logging
@@ -36,7 +36,6 @@ class Inversion::RenderState
36
36
  ### Return a copy of the receiving Scope merged with the given +values+,
37
37
  ### which can be either another Scope or a Hash.
38
38
  def +( values )
39
- # Have to do it this kludgy way because Scopes don't have #respond_to?
40
39
  return Scope.new( @locals.merge(values) )
41
40
  end
42
41
 
@@ -45,27 +45,39 @@ class Inversion::Template
45
45
  ### Default config values
46
46
  DEFAULT_CONFIG = {
47
47
  :ignore_unknown_tags => true,
48
+ :template_paths => [],
49
+
48
50
  :on_render_error => :comment,
49
51
  :debugging_comments => false,
50
52
  :comment_start => '<!-- ',
51
53
  :comment_end => ' -->',
52
- :template_paths => [],
53
54
  :escape_format => :html,
54
55
  :strip_tag_lines => true,
55
56
  :stat_delay => 0
56
- }
57
+ }.freeze
57
58
 
58
59
 
59
60
  ### Global config
60
61
  @config = DEFAULT_CONFIG.dup
61
62
  class << self; attr_accessor :config; end
62
63
 
64
+ # Global template search path
65
+ @template_paths = []
66
+ class << self; attr_accessor :template_paths; end
67
+
63
68
 
64
69
  ### Configure the templating system.
65
70
  def self::configure( config )
66
- return unless config
67
- Inversion.log.debug "Merging config %p with current config %p" % [ config, self.config ]
68
- self.config = self.config.merge( config )
71
+ if config
72
+ Inversion.log.debug "Merging config %p with current config %p" % [ config, self.config ]
73
+ merged_config = DEFAULT_CONFIG.merge( config )
74
+ self.template_paths = Array( merged_config.delete(:template_paths) )
75
+ self.config = merged_config
76
+ else
77
+ defaults = DEFAULT_CONFIG.dup
78
+ self.template_paths = defaults.delete( :template_paths )
79
+ self.config = defaults
80
+ end
69
81
  end
70
82
 
71
83
 
@@ -80,7 +92,7 @@ class Inversion::Template
80
92
 
81
93
  tmpl = nil
82
94
  path = Pathname( path )
83
- template_paths = Array( self.config[:template_paths] ) + [ Dir.pwd ]
95
+ template_paths = self.template_paths + [ Dir.pwd ]
84
96
 
85
97
  # Unrestricted template location.
86
98
  if path.absolute?
@@ -195,7 +195,7 @@ describe Inversion::Template do
195
195
  context "without template paths set" do
196
196
 
197
197
  before( :each ) do
198
- Inversion::Template.config[:template_paths].clear
198
+ Inversion::Template.template_paths.clear
199
199
  end
200
200
 
201
201
  it "instances can be loaded from an absolute path" do
@@ -215,11 +215,11 @@ describe Inversion::Template do
215
215
  context "with template paths set" do
216
216
 
217
217
  before( :each ) do
218
- Inversion::Template.config[:template_paths] = [ '/tmp', '/fun' ]
218
+ Inversion::Template.template_paths = [ '/tmp', '/fun' ]
219
219
  end
220
220
 
221
221
  after( :each ) do
222
- Inversion::Template.config[:template_paths].clear
222
+ Inversion::Template.template_paths.clear
223
223
  end
224
224
 
225
225
  it "instances can be loaded from an absolute path" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inversion
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.9.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -37,11 +37,11 @@ cert_chain:
37
37
  YUhDS0xaZFNLai9SSHVUT3QrZ2JsUmV4OEZBaDhOZUEKY21saFhlNDZwWk5K
38
38
  Z1dLYnhaYWg4NWpJang5NWhSOHZPSStOQU01aUg5a09xSzEzRHJ4YWNUS1Bo
39
39
  cWo1UGp3RgotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==
40
- date: 2012-04-01 00:00:00.000000000 Z
40
+ date: 2012-04-24 00:00:00.000000000 Z
41
41
  dependencies:
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: hoe-mercurial
44
- requirement: &70337034178000 !ruby/object:Gem::Requirement
44
+ requirement: &70266679150500 !ruby/object:Gem::Requirement
45
45
  none: false
46
46
  requirements:
47
47
  - - ~>
@@ -49,10 +49,10 @@ dependencies:
49
49
  version: 1.4.0
50
50
  type: :development
51
51
  prerelease: false
52
- version_requirements: *70337034178000
52
+ version_requirements: *70266679150500
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: hoe-manualgen
55
- requirement: &70337034177180 !ruby/object:Gem::Requirement
55
+ requirement: &70266679150000 !ruby/object:Gem::Requirement
56
56
  none: false
57
57
  requirements:
58
58
  - - ~>
@@ -60,21 +60,21 @@ dependencies:
60
60
  version: 0.3.0
61
61
  type: :development
62
62
  prerelease: false
63
- version_requirements: *70337034177180
63
+ version_requirements: *70266679150000
64
64
  - !ruby/object:Gem::Dependency
65
65
  name: hoe-highline
66
- requirement: &70337034192680 !ruby/object:Gem::Requirement
66
+ requirement: &70266679149420 !ruby/object:Gem::Requirement
67
67
  none: false
68
68
  requirements:
69
69
  - - ~>
70
70
  - !ruby/object:Gem::Version
71
- version: 0.0.1
71
+ version: 0.1.0
72
72
  type: :development
73
73
  prerelease: false
74
- version_requirements: *70337034192680
74
+ version_requirements: *70266679149420
75
75
  - !ruby/object:Gem::Dependency
76
76
  name: rdoc
77
- requirement: &70337034191900 !ruby/object:Gem::Requirement
77
+ requirement: &70266679148880 !ruby/object:Gem::Requirement
78
78
  none: false
79
79
  requirements:
80
80
  - - ~>
@@ -82,10 +82,10 @@ dependencies:
82
82
  version: '3.10'
83
83
  type: :development
84
84
  prerelease: false
85
- version_requirements: *70337034191900
85
+ version_requirements: *70266679148880
86
86
  - !ruby/object:Gem::Dependency
87
87
  name: rspec
88
- requirement: &70337034191120 !ruby/object:Gem::Requirement
88
+ requirement: &70266679148440 !ruby/object:Gem::Requirement
89
89
  none: false
90
90
  requirements:
91
91
  - - ~>
@@ -93,10 +93,10 @@ dependencies:
93
93
  version: '2.8'
94
94
  type: :development
95
95
  prerelease: false
96
- version_requirements: *70337034191120
96
+ version_requirements: *70266679148440
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: tilt
99
- requirement: &70337034190160 !ruby/object:Gem::Requirement
99
+ requirement: &70266679147840 !ruby/object:Gem::Requirement
100
100
  none: false
101
101
  requirements:
102
102
  - - ~>
@@ -104,10 +104,10 @@ dependencies:
104
104
  version: '1.3'
105
105
  type: :development
106
106
  prerelease: false
107
- version_requirements: *70337034190160
107
+ version_requirements: *70266679147840
108
108
  - !ruby/object:Gem::Dependency
109
109
  name: sinatra
110
- requirement: &70337034189500 !ruby/object:Gem::Requirement
110
+ requirement: &70266679147360 !ruby/object:Gem::Requirement
111
111
  none: false
112
112
  requirements:
113
113
  - - ~>
@@ -115,10 +115,10 @@ dependencies:
115
115
  version: '1.2'
116
116
  type: :development
117
117
  prerelease: false
118
- version_requirements: *70337034189500
118
+ version_requirements: *70266679147360
119
119
  - !ruby/object:Gem::Dependency
120
120
  name: rack-test
121
- requirement: &70337034188740 !ruby/object:Gem::Requirement
121
+ requirement: &70266679146920 !ruby/object:Gem::Requirement
122
122
  none: false
123
123
  requirements:
124
124
  - - ~>
@@ -126,10 +126,10 @@ dependencies:
126
126
  version: '0.6'
127
127
  type: :development
128
128
  prerelease: false
129
- version_requirements: *70337034188740
129
+ version_requirements: *70266679146920
130
130
  - !ruby/object:Gem::Dependency
131
131
  name: simplecov
132
- requirement: &70337034188120 !ruby/object:Gem::Requirement
132
+ requirement: &70266679146420 !ruby/object:Gem::Requirement
133
133
  none: false
134
134
  requirements:
135
135
  - - ~>
@@ -137,10 +137,10 @@ dependencies:
137
137
  version: '0.4'
138
138
  type: :development
139
139
  prerelease: false
140
- version_requirements: *70337034188120
140
+ version_requirements: *70266679146420
141
141
  - !ruby/object:Gem::Dependency
142
142
  name: trollop
143
- requirement: &70337034187480 !ruby/object:Gem::Requirement
143
+ requirement: &70266679145640 !ruby/object:Gem::Requirement
144
144
  none: false
145
145
  requirements:
146
146
  - - ~>
@@ -148,10 +148,10 @@ dependencies:
148
148
  version: '1.16'
149
149
  type: :development
150
150
  prerelease: false
151
- version_requirements: *70337034187480
151
+ version_requirements: *70266679145640
152
152
  - !ruby/object:Gem::Dependency
153
153
  name: highline
154
- requirement: &70337034186680 !ruby/object:Gem::Requirement
154
+ requirement: &70266679160900 !ruby/object:Gem::Requirement
155
155
  none: false
156
156
  requirements:
157
157
  - - ~>
@@ -159,10 +159,10 @@ dependencies:
159
159
  version: '1.6'
160
160
  type: :development
161
161
  prerelease: false
162
- version_requirements: *70337034186680
162
+ version_requirements: *70266679160900
163
163
  - !ruby/object:Gem::Dependency
164
164
  name: sysexits
165
- requirement: &70337034186080 !ruby/object:Gem::Requirement
165
+ requirement: &70266679159920 !ruby/object:Gem::Requirement
166
166
  none: false
167
167
  requirements:
168
168
  - - ~>
@@ -170,10 +170,10 @@ dependencies:
170
170
  version: '1.0'
171
171
  type: :development
172
172
  prerelease: false
173
- version_requirements: *70337034186080
173
+ version_requirements: *70266679159920
174
174
  - !ruby/object:Gem::Dependency
175
175
  name: hoe
176
- requirement: &70337034185360 !ruby/object:Gem::Requirement
176
+ requirement: &70266679159060 !ruby/object:Gem::Requirement
177
177
  none: false
178
178
  requirements:
179
179
  - - ~>
@@ -181,7 +181,7 @@ dependencies:
181
181
  version: '3.0'
182
182
  type: :development
183
183
  prerelease: false
184
- version_requirements: *70337034185360
184
+ version_requirements: *70266679159060
185
185
  description: ! 'Inversion is a templating system for Ruby. It uses the "Inversion
186
186
  of Control"
187
187
 
metadata.gz.sig CHANGED
Binary file