Comments (4)
Hi @scottbarrow, thanks for your reporting. I have just tested in my local environment (Ruby 2.6.5, and 2.7.1 on Rails 6.0). It works quite well.
Could you give me some more information, such as your Ruby version, your Rails version, the environment you are running on (mac, linux?). If it's possible, could you try with a simple view, or empty view?
from ruby_jard.
Ahhhhh. I can now re-produce the bug now. So, if you put something like <%= jard %>
, Jard won't stop at the file, while it works well with <% jard %>
. It's an interesting bug, happens with byebug
as well. I'll go dive deep to see what happens.
In the mean time, you could use <% jard %>
instead.
from ruby_jard.
A debug story: as mentioned above, jard doesn't work with <%= jard %>
, while still working with <% jard %>
. Internally, ERB compiles the view template into a series of Ruby print statements, then evaluate all the statement with an input binding. This is a test file to point the differences between two approaches:
require 'erb'
str1 = <<-CODE
<h1>
<% jard %>
<% a = 1 %>
</h1>
CODE
puts ERB::Compiler.new(0).compile(str1).first.to_s
puts "==================="
str2 = <<-CODE
<h2>
<%= jard %>
<% a = 1 %>
</h2>
CODE
puts ERB::Compiler.new(0).compile(str2).first.to_s
Results:
#coding:UTF-8
print " <h1>\n ".freeze
; jard ; print "\n ".freeze
; a = 1 ; print "\n </h1>\n".freeze
===================
#coding:UTF-8
print " <h2>\n ".freeze
; print(( jard ).to_s); print "\n ".freeze
; a = 1 ; print "\n </h2>\n".freeze
So, in the second script, jard is called as an an argument of print
method call. Unfortunately, this case is not handled in latest version. This bug is fixed in #37.
from ruby_jard.
Awesome thanks
from ruby_jard.
Related Issues (20)
- dRB compatibility? HOT 2
- Error with Ruby 3.2, need pry > 0.14
- [BUG] Error on app startup -1 out of range HOT 3
- [BUG] Internal error from jard - undefined method `shift` for nil HOT 1
- [BUG] HOT 2
- [BUG] Source output incorrect HOT 2
- Supporting "disable-pry" kind of functionality HOT 2
- Support for JRuby HOT 2
- Breakpoint in initializer throws error "undefined method `to_hash' for nil:NilClass" HOT 1
- Pager isn't working HOT 8
- [BUG] Control command is empty HOT 3
- Anyone able to use this on Rails with Passenger? HOT 2
- [BUG] Not compatible with Rails CurrentAttributes - attributes come back as nil HOT 3
- [BUG] Can not step into subsequent calls on the same line of code (only the call which is evaluated first by Ruby)
- [BUG] Debugging console freezes when executing a Rails' association on a model instance HOT 1
- Support Ruby 2.4
- Error uninitialized constant #<Class:0x00007f96b6e8aa68>::Analyzable
- [BUG] empty space below the prompt when running in Rails project on WSL/Ubuntu HOT 2
- [BUG] ~/.jardrc does not seem to work with Rails Console HOT 1
- Keyword to output the underlying SQL query of Active Record relation to the console
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ruby_jard.