Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

embed.svg doesn't respect img_dir #323

Open
vtbassmatt opened this issue Oct 25, 2020 · 1 comment
Open

embed.svg doesn't respect img_dir #323

vtbassmatt opened this issue Oct 25, 2020 · 1 comment
Labels

Comments

@vtbassmatt
Copy link
Contributor

vtbassmatt commented Oct 25, 2020

Using the "advanced" project layout, I have images in an img/ directory. This works great for svg but not for embed.svg. For a call like this:

  text(str: data.body, layout: :body, wrap: :word_char, markup: true) do |embed|
    embed.svg key: ':power:', file: 'battery-pack.svg'
  end

I get:

% rake with_proofs deck
Enabling proofing lines.
Loading SVG(s) <===========================================> 100% Time: 00:00:00
Loading SVG(s) <===========================================> 100% Time: 00:00:00
Loading SVG(s) <===========================================> 100% Time: 00:00:00
rake aborted!
File /Users/<username>/Projects/<projectdir>/battery-pack.svg does not exist!
/usr/local/lib/ruby/gems/2.7.0/gems/squib-0.15.3/lib/squib/args/input_file.rb:30:in `validate_file'
/usr/local/lib/ruby/gems/2.7.0/gems/squib-0.15.3/lib/squib/args/arg_loader.rb:87:in `block (2 levels) in validate'
/usr/local/lib/ruby/gems/2.7.0/gems/squib-0.15.3/lib/squib/args/arg_loader.rb:87:in `map'
/usr/local/lib/ruby/gems/2.7.0/gems/squib-0.15.3/lib/squib/args/arg_loader.rb:87:in `with_index'
/usr/local/lib/ruby/gems/2.7.0/gems/squib-0.15.3/lib/squib/args/arg_loader.rb:87:in `block in validate'
/usr/local/lib/ruby/gems/2.7.0/gems/squib-0.15.3/lib/squib/args/arg_loader.rb:81:in `each'
/usr/local/lib/ruby/gems/2.7.0/gems/squib-0.15.3/lib/squib/args/arg_loader.rb:81:in `validate'
/usr/local/lib/ruby/gems/2.7.0/gems/squib-0.15.3/lib/squib/args/arg_loader.rb:19:in `load!'
/usr/local/lib/ruby/gems/2.7.0/gems/squib-0.15.3/lib/squib/api/text_embed.rb:34:in `svg'
src/deck.rb:57:in `block (2 levels) in <top (required)>'
/usr/local/lib/ruby/gems/2.7.0/gems/squib-0.15.3/lib/squib/api/text.rb:18:in `text'
src/deck.rb:56:in `block in <top (required)>'
/usr/local/lib/ruby/gems/2.7.0/gems/squib-0.15.3/lib/squib/deck.rb:74:in `instance_eval'
/usr/local/lib/ruby/gems/2.7.0/gems/squib-0.15.3/lib/squib/deck.rb:74:in `initialize'
src/deck.rb:29:in `new'
src/deck.rb:29:in `<top (required)>'
/Users/<username>/Projects/<projectdir>/Rakefile:15:in `load'
/Users/<username>/Projects/<projectdir>/Rakefile:15:in `block in <top (required)>'
Tasks: TOP => deck

This is ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-darwin19].

Including the img/ before the filename, it renders correctly.

@andymeneely
Copy link
Owner

Interesting - I'll take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: 📋 Backlog
Development

No branches or pull requests

2 participants