https://www.puppet.com/community logo
Join Slack
Powered by
# voxpupuli
  • v

    VoxBot

    07/07/2023, 2:54 PM
    because the snippets are invalid Ruby and any parser will reject it
  • v

    VoxBot

    07/07/2023, 2:54 PM
    you have a lexer, so you have tokens
  • v

    VoxBot

    07/07/2023, 2:54 PM
    that already gives you something
  • y

    Yury Bushmelev

    07/07/2023, 2:54 PM
    [:code, "- @mailhost_cfg_prepend.sort_by{ |k,v| k}.each do |key,value| "],
  • y

    Yury Bushmelev

    07/07/2023, 2:55 PM
    so snippets like this should be rewritten manually then it seems
  • v

    VoxBot

    07/07/2023, 2:57 PM
    no, check rewrite_code(code)
  • v

    VoxBot

    07/07/2023, 2:57 PM
    https://gist.github.com/ekohl/28443e6ba178c931bb69285e976568eb#file-erb2epp-rb-L8-L35 applies a lexer and goes through that
  • y

    Yury Bushmelev

    07/07/2023, 2:59 PM
    ah, I see.. just added some
    pp
    statements and it’s much easier now 🙂
  • v

    VoxBot

    07/07/2023, 2:59 PM
    and if you read the TODOs there those are exactly the items I talked about
  • y

    Yury Bushmelev

    07/07/2023, 3:26 PM
    I’ve added the vars collection to dump them in a header.. I guess it’s impossible to get a variable type though..
  • y

    Yury Bushmelev

    07/07/2023, 3:26 PM
    well.. and
    print
    now should be replaced with some array.append() to dump things in proper order
  • v

    VoxBot

    07/07/2023, 3:28 PM
    no, I doubt you can do better than Any but that's good enough
  • v

    VoxBot

    07/07/2023, 3:29 PM
    and you probably need to define a set
  • y

    Yury Bushmelev

    07/07/2023, 3:39 PM
    do we have any repo to put this script into?
  • y

    Yury Bushmelev

    07/07/2023, 3:40 PM
    any voxpupuli weird strange scripts? 🙂
  • v

    VoxBot

    07/07/2023, 3:41 PM
    I can create a erb2epp repo for myself and then later transfer it if needed
  • y

    Yury Bushmelev

    07/07/2023, 3:41 PM
    yeah, let’s do.. I’ll do a PR
  • y

    Yury Bushmelev

    07/07/2023, 3:42 PM
    I converted it to a class to simplify variables collection
  • y

    Yury Bushmelev

    07/07/2023, 3:42 PM
    ruby do not like global vars it seems 🙂
  • y

    Yury Bushmelev

    07/07/2023, 4:02 PM
    [:code, "- if @listen_ip.is_a?(Array) then "]
    <-
    then
    ??!
  • y

    Yury Bushmelev

    07/07/2023, 4:03 PM
    luckily it’s easy to drop
  • v

    VoxBot

    07/07/2023, 5:21 PM
    bastelfreak, I am out :P
  • y

    Yury Bushmelev

    07/07/2023, 5:36 PM
    well.. the most useful part of erb2epp now is variables collection.. really nice to copy & paste it as a
    epp()
    2nd parameter
  • y

    Yury Bushmelev

    07/07/2023, 5:37 PM
    do not need to eyeball carefully
  • v

    VoxBot

    07/07/2023, 6:17 PM
    cool!
  • p

    Pat Riehecky

    07/07/2023, 6:28 PM
    @ewoud Sorry for throwing augeas weirdness just before the weekend :)
  • v

    VoxBot

    07/07/2023, 6:29 PM
    well, I broke it so it was just fixing my own things
  • v

    VoxBot

    07/07/2023, 6:30 PM
    and I wrote a patch, so I think I can now reward myself with a beer
  • p

    Pat Riehecky

    07/07/2023, 6:30 PM
    Friday is still a sad day for something that messy
  • v

    VoxBot

    07/07/2023, 6:30 PM
    I filled in a quarter evaluation, that was way worse than augeas weirdness tbh
1...547548549...648Latest