Skip to content

Instantly share code, notes, and snippets.

@stefhen
Last active December 17, 2015 21:19
Show Gist options
  • Save stefhen/5674094 to your computer and use it in GitHub Desktop.
Save stefhen/5674094 to your computer and use it in GitHub Desktop.
Generate RightScale metadata.rb input code
#!/usr/bin/env ruby
require 'highline/import'
attr = ask "attribute: "
desc = ask "description: "
recipes = ask "recipes: "
type = ask ("type: ") { |q| q.default = "string" }
disp = ask ("display_name: ") { |q| q.default = attr }
required = ask ("required: ") { |q| q.default = "required" }
puts <<-EOF
\n
attribute "#{attr}",
:description => "#{desc}",
:recipes => ["#{recipes}"],
:type => "#{type}",
:display => "#{disp}",
:required => "#{required}"
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment