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

No error checking in haml:erb2haml task #193

Open
dirschn opened this issue Sep 23, 2024 · 0 comments
Open

No error checking in haml:erb2haml task #193

dirschn opened this issue Sep 23, 2024 · 0 comments

Comments

@dirschn
Copy link

dirschn commented Sep 23, 2024

I ran the haml:erb2haml task after running gem install html2haml, and apparently html2haml didn't install properly. The task reported that it couldn't find it for each file, yet at the end it acted as though the task completed successfully and asked whether I wanted to delete the original files. I said yes, because this was an unimportant brand new project, and after the task was done all of my views were erased because none of the ones it said were generated actually were generated.

It seems like there could be some checking in the script to at least verify the expected files exist before reporting a success? I'd be happy to take a crack at it, but I'm a little surprised no one else has reported this yet.

rails haml:erb2haml 
--------------------------------------------------------------------------------
Generating HAML for app/views/default/pages/homepage.html.erb...
/home/nick/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.5.11/lib/bundler/rubygems_integration.rb:265:in `block in replace_bin_path': can't find executable html2haml for gem html2haml. html2haml is not currently included in the bundle, perhaps you meant to add it to your Gemfile? (Gem::Exception)
        from /home/nick/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.5.11/lib/bundler/rubygems_integration.rb:293:in `block in replace_bin_path'
        from /home/nick/.rbenv/versions/3.2.2/bin/html2haml:25:in `<main>'
Generating HAML for app/views/default/pages/show.html.erb...
/home/nick/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.5.11/lib/bundler/rubygems_integration.rb:265:in `block in replace_bin_path': can't find executable html2haml for gem html2haml. html2haml is not currently included in the bundle, perhaps you meant to add it to your Gemfile? (Gem::Exception)
        from /home/nick/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.5.11/lib/bundler/rubygems_integration.rb:293:in `block in replace_bin_path'
        from /home/nick/.rbenv/versions/3.2.2/bin/html2haml:25:in `<main>'
Generating HAML for app/views/default/shared/_navigation.html.erb...
/home/nick/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.5.11/lib/bundler/rubygems_integration.rb:265:in `block in replace_bin_path': can't find executable html2haml for gem html2haml. html2haml is not currently included in the bundle, perhaps you meant to add it to your Gemfile? (Gem::Exception)
        from /home/nick/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.5.11/lib/bundler/rubygems_integration.rb:293:in `block in replace_bin_path'
        from /home/nick/.rbenv/versions/3.2.2/bin/html2haml:25:in `<main>'
Generating HAML for app/views/layouts/application.html.erb...
/home/nick/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.5.11/lib/bundler/rubygems_integration.rb:265:in `block in replace_bin_path': can't find executable html2haml for gem html2haml. html2haml is not currently included in the bundle, perhaps you meant to add it to your Gemfile? (Gem::Exception)
        from /home/nick/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.5.11/lib/bundler/rubygems_integration.rb:293:in `block in replace_bin_path'
        from /home/nick/.rbenv/versions/3.2.2/bin/html2haml:25:in `<main>'
Generating HAML for app/views/layouts/default/application.html.erb...
/home/nick/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.5.11/lib/bundler/rubygems_integration.rb:265:in `block in replace_bin_path': can't find executable html2haml for gem html2haml. html2haml is not currently included in the bundle, perhaps you meant to add it to your Gemfile? (Gem::Exception)
        from /home/nick/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.5.11/lib/bundler/rubygems_integration.rb:293:in `block in replace_bin_path'
        from /home/nick/.rbenv/versions/3.2.2/bin/html2haml:25:in `<main>'
Generating HAML for app/views/layouts/mailer.html.erb...
/home/nick/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.5.11/lib/bundler/rubygems_integration.rb:265:in `block in replace_bin_path': can't find executable html2haml for gem html2haml. html2haml is not currently included in the bundle, perhaps you meant to add it to your Gemfile? (Gem::Exception)
        from /home/nick/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.5.11/lib/bundler/rubygems_integration.rb:293:in `block in replace_bin_path'
        from /home/nick/.rbenv/versions/3.2.2/bin/html2haml:25:in `<main>'
Generating HAML for app/views/layouts/mailer.text.erb...
/home/nick/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.5.11/lib/bundler/rubygems_integration.rb:265:in `block in replace_bin_path': can't find executable html2haml for gem html2haml. html2haml is not currently included in the bundle, perhaps you meant to add it to your Gemfile? (Gem::Exception)
        from /home/nick/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.5.11/lib/bundler/rubygems_integration.rb:293:in `block in replace_bin_path'
        from /home/nick/.rbenv/versions/3.2.2/bin/html2haml:25:in `<main>'
--------------------------------------------------------------------------------
HAML generated for the following files:
        app/views/default/pages/homepage.html.erb
        app/views/default/pages/show.html.erb
        app/views/default/shared/_navigation.html.erb
        app/views/layouts/application.html.erb
        app/views/layouts/default/application.html.erb
        app/views/layouts/mailer.html.erb
        app/views/layouts/mailer.text.erb
--------------------------------------------------------------------------------
Would you like to delete the original .erb files? (This is not recommended unless you are under version control.) (y/n)
y
Deleting original .erb files.
--------------------------------------------------------------------------------
Task complete!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant