lono 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,2 +1,2 @@
1
- source :rubygems
1
+ source "https://rubygems.org"
2
2
  gemspec
data/README.md CHANGED
@@ -84,6 +84,7 @@ You can convert UserData scripts in existing Cloud Formation Templates to a star
84
84
  <pre>
85
85
  $ lono bashify cloud_formation_template.json
86
86
  $ lono bash cloud_formation_template.json # shorthand
87
+ $ lono b https://s3.amazonaws.com/cloudformation-templates-us-east-1/LAMP_Single_Instance.template # shorthand and url
87
88
  </pre>
88
89
 
89
90
  This is useful if you want to take an existing [Cloud Formation Template example](http://aws.amazon.com/cloudformation/aws-cloudformation-templates/) and quicklly change the UserData section into a bash script. The bashify command will generate a snippet that is meant to be copied and pasted into a bash script and used with user_data helper method. The bash script should work right off the bat as lono will transform the generated Cloud Formation object references to json objects, there's no need to manually change what is generated to the helper methods, though you can if you prefer the look of the helper methods.
@@ -1,3 +1,5 @@
1
+ require 'open-uri'
2
+
1
3
  module Lono
2
4
  class Bashify
3
5
  def initialize(options={})
@@ -18,16 +20,8 @@ module Lono
18
20
  paths.select {|p| p =~ /UserData/ && p =~ /Fn::Join/ }
19
21
  end
20
22
 
21
- def find_user_data
22
- raw = IO.read(@path)
23
- json = JSON.load(raw)
24
-
25
- user_data = json['Resources']['server']['Properties']['UserData']['Fn::Base64']['Fn::Join']
26
- @delimiter, @data = user_data
27
- end
28
-
29
23
  def run
30
- raw = IO.read(@path)
24
+ raw = open(@path).read
31
25
  json = JSON.load(raw)
32
26
  paths = user_data_paths(json)
33
27
  paths.each do |path|
@@ -1,3 +1,3 @@
1
1
  module Lono
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lono
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: