Skip to content

Instantly share code, notes, and snippets.

@wam
Created March 16, 2017 04:58
Show Gist options
  • Select an option

  • Save wam/a86c51eaad03689a14fcd0d58e6cca0c to your computer and use it in GitHub Desktop.

Select an option

Save wam/a86c51eaad03689a14fcd0d58e6cca0c to your computer and use it in GitHub Desktop.

Revisions

  1. wam created this gist Mar 16, 2017.
    21 changes: 21 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    # pass 1

    /<img src="<%= ENV\["IMAGE_URL"\] %>([^"]+)" ([^>]+)>/

    image_tag("/static/images$1", $2)

    # => image_tag("/static/images/icons/app-ui-logo-white.png", id="topbar-logo" alt="Freedom logo")

    # pass 2

    /(\w+)="([^"]+)"/

    $1: $2,

    # => image_tag("/static/images/icons/app-ui-logo-white.png", id: "topbar-logo", alt: "Freedom logo",)

    # pass 3

    /,\)/

    )