Skip to content

Instantly share code, notes, and snippets.

@ophentis
Created November 15, 2017 22:25
Show Gist options
  • Save ophentis/de41f064f5fcac17c665ae9184bd5902 to your computer and use it in GitHub Desktop.
Save ophentis/de41f064f5fcac17c665ae9184bd5902 to your computer and use it in GitHub Desktop.
MuranoCLI plugin to dump out concatenated scripts.
# Save a file in ~/.murano/plugins/scriptdump.rb
#
command '_s dump' do |c|
c.syntax = %{mr _s dump}
c.summary = %{dump combined script}
c.description = %{dump combined script}
c.action do |args, options|
sid = $cfg['application.id']
sol = MrMurano::SolutionBase.new(sid)
puts sol.get("/route/#{sid}/script")
end
end
command '_s off' do |c|
c.syntax = %{_s off}
c.summary = %{turn off require}
c.description = %{turn off require}
c.action do |args, options|
sid = $cfg['application.id']
sol = MrMurano::SolutionBase.new(sid)
puts sol.put("/route/#{sid}", {
:script=>"require = nil\npackage = nil"
})
end
end
command '_s on' do |c|
c.syntax = %{_s on}
c.summary = %{turn on require}
c.description = %{turn on require}
c.action do |args, options|
sid = $cfg['application.id']
sol = MrMurano::SolutionBase.new(sid)
puts sol.put("/route/#{sid}", {
:script=>""
})
end
end
# vim: set ai et sw=2 ts=2 :
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment