theo-rails 0.4.2 → 0.4.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.
- checksums.yaml +4 -4
- data/lib/theo-rails/theo.rb +15 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 779505977e5af5380369d5e341216d3a89b32ebb08c92a622e1204d837fb8c6f
|
4
|
+
data.tar.gz: e9d63d6efb0014f5af7a552c35dfc31b6e769f22c3a13c815da3b4d47d05f744
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ae0efd45f92b7966957f637ee3b31409e7f1093bc52005be75c9cf1787e37af1bd1307967aed05b02a6407b73b21ec3b5d81f9335a3767fe81099bfb6cc7b50
|
7
|
+
data.tar.gz: 239d3f58793e9f638b457e5cb2740ffd19566619a1213b99af7c14a9f1393ab63105c0920a8e828b6ebd11c77edc0485aa25aa587d66c16af08b1975c59a2c1b
|
data/lib/theo-rails/theo.rb
CHANGED
@@ -114,6 +114,21 @@ module Theo
|
|
114
114
|
is_capitalized && Object.const_defined?("#{component}Component")
|
115
115
|
end
|
116
116
|
|
117
|
+
def translate_location(spot, backtrace_location, source)
|
118
|
+
result = ActionView::Template::Handlers::ERB.new.translate_location(spot, backtrace_location, source)
|
119
|
+
|
120
|
+
return unless result.nil?
|
121
|
+
|
122
|
+
# TODO: More precise location handling, see ERB::Util for inspiration
|
123
|
+
lineno_delta = ActionView::Base.annotate_rendered_view_with_filenames ? 1 : 0
|
124
|
+
spot[:first_lineno] -= lineno_delta
|
125
|
+
spot[:last_lineno] -= lineno_delta
|
126
|
+
spot[:first_column] = 0
|
127
|
+
spot[:last_column] = 0
|
128
|
+
spot[:script_lines] = source.lines
|
129
|
+
spot
|
130
|
+
end
|
131
|
+
|
117
132
|
def call(template, source = nil)
|
118
133
|
theo = process(source)
|
119
134
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: theo-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jarek Lipski
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-10-
|
11
|
+
date: 2024-10-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|