Giter Site home page Giter Site logo

puppet4ify's Introduction

puppet4ify

Scripts to convert (ERB) files into a format that Puppet 4 accepts.

Usage

puppet4ify_erb.py

Show help:

$ ./puppet4ify_erb.py -h

Show changes that would be made, using a test file:

$ ./puppet4ify_erb.py -d --noop test.erb

Create a new file with the corrected content:

$ ./puppet4ify_erb.py -o outfile.erb infile.erb

Change content of real file in-place:

$ ./puppet4ify_erb.py infile.erb

TODO

  • Handle array variables / iterators

Bugs

The puppet4ify_erb.py script converts variables into instance variables also where is shouldn't. This affects iteration first and foremost:

<% @locales.each do |locale| -%>
<%= @locale %>
<% end -%>

This will not work, because @locale is set to undef here. the correct syntax is

<% @locales.each do |locale| -%>
<%= locale %>
<% end -%>

Trying to catch these in a generic way would be difficult, so please check the diffs (-d --noop) carefully and make the fixes that are necessary afterwards.

puppet4ify's People

Contributors

mattock avatar

Watchers

James Cloos avatar Mikko Vilpponen avatar  avatar Kibahop avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.