utopia 0.11.2 → 0.11.3

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.
@@ -150,7 +150,7 @@ module Utopia
150
150
  :locale => nil
151
151
  }
152
152
 
153
- def self.index(root, top, options = {})
153
+ def self.index(root, top = Path.new, options = {})
154
154
  options = DEFAULT_OPTIONS.merge(options)
155
155
  path = File.join(root, top.components)
156
156
  metadata = Links.metadata(path)
@@ -38,14 +38,19 @@ module Utopia
38
38
  @start_position = start_position
39
39
  @current_tag = current_tag
40
40
  @closing_tag = closing_tag
41
-
42
- @starting_line = @scanner.calculate_line_number(@start_pos)
43
- @ending_line = @scanner.calculate_line_number
41
+
42
+ @starting_line = Trenni::Parser.line_at_offset(@scanner.string, @start_position)
43
+ @ending_line = Trenni::Parser.line_at_offset(@scanner.string, @scanner.pos)
44
44
  end
45
45
 
46
+ attr :scanner
47
+ attr :start_position
48
+ attr :current_tag
49
+ attr :closing_tag
50
+
46
51
  def to_s
47
- "Unbalanced Tag #{@current_tag}. " \
48
- "Line #{@starting_line[0]}: #{@starting_line[4]} has been closed by #{@closing_tag} on line #{@ending_line[0]}: #{@ending_line[4]}"
52
+ "Unbalanced Tag Error. " \
53
+ "Line #{@starting_line[:line_number]}: #{@current_tag} has been closed by #{@closing_tag} on line #{@ending_line[:line_number]}!"
49
54
  end
50
55
  end
51
56
 
@@ -25,7 +25,7 @@ module Utopia
25
25
 
26
26
  include Comparable
27
27
 
28
- def initialize(components)
28
+ def initialize(components = [])
29
29
  # To ensure we don't do anything stupid we freeze the components
30
30
  @components = components.dup.freeze
31
31
  end
@@ -19,5 +19,5 @@
19
19
  # THE SOFTWARE.
20
20
 
21
21
  module Utopia
22
- VERSION = "0.11.2"
22
+ VERSION = "0.11.3"
23
23
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: utopia
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.2
4
+ version: 0.11.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-05 00:00:00.000000000 Z
12
+ date: 2013-02-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: trenni
@@ -176,18 +176,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
176
176
  - - ! '>='
177
177
  - !ruby/object:Gem::Version
178
178
  version: '0'
179
- segments:
180
- - 0
181
- hash: 312881169205834825
182
179
  required_rubygems_version: !ruby/object:Gem::Requirement
183
180
  none: false
184
181
  requirements:
185
182
  - - ! '>='
186
183
  - !ruby/object:Gem::Version
187
184
  version: '0'
188
- segments:
189
- - 0
190
- hash: 312881169205834825
191
185
  requirements: []
192
186
  rubyforge_project:
193
187
  rubygems_version: 1.8.24