chef-flavor-flay 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 72a4968a59440447aba15bd5968661d3c803c6f7
4
- data.tar.gz: 593a0bb8a01c0e24f7b8ff91bc844dbdcaa65eb2
3
+ metadata.gz: 9f079d980eef92521cd03d0c927afa918d856f6f
4
+ data.tar.gz: 8f012e3247d68a05ee0e697ef020f6c18a57ea4c
5
5
  SHA512:
6
- metadata.gz: 278387eb05fa6dbb09e661374b7691876ea5bdf79ba89ca3fcad15ab4c9a92eccf9a8802c4ee742b0bdd7177f992d23810f62a5a5de3ced0a66cd5eeb36b31fe
7
- data.tar.gz: 21b49512d6eaa44f0de31a1ee453f02425ed0889bebf396a48756a138c7af1520bfed2432da629140aabd94186f2d87f38538e651ce114debb7c5299a52dbc3c
6
+ metadata.gz: 06f2f667988e80583a76c0442eb65538fa87521a46e75c768617bd35e812f06d08aeaa20014e791c57be5ece079cd90d9bd519ac8f303eee97f817b46d4c1e25
7
+ data.tar.gz: 79f9aa69916bab25d696ca20df4b6362e9681851220e878fee571f0e7b085d25e00e4b4145d9b4cede1f06bc46a367c78354982a9d1b08dd94d9aa0c13fc44ac
data/exe/flay CHANGED
@@ -1,13 +1,14 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- ARGS = "-C sweeper.io -m developers@sweeper.io -I mit".freeze
3
+ require "open3"
4
4
 
5
- def cookbook(name)
6
- `chef generate cookbook #{name} #{ARGS}`
7
- end
5
+ ARGS = "-C sweeper.io -m developers@sweeper.io -I mit".freeze
8
6
 
9
- def recipe(name)
10
- `chef generate recipe #{name} #{ARGS}`
7
+ def run_generator(type, name)
8
+ command = "chef generate #{type} #{name} #{ARGS}"
9
+ output, err, status = Open3.capture3(command)
10
+ puts output
11
+ puts err if status != 0
11
12
  end
12
13
 
13
14
  def usage
@@ -22,8 +23,8 @@ usage if ARGV.size != 2
22
23
  usage if type.nil? || name.nil?
23
24
 
24
25
  case type
25
- when "cookbook" then cookbook(name)
26
- when "recipe" then recipe(name)
26
+ when "cookbook" then run_generator("cookbook", name)
27
+ when "recipe" then run_generator("recipe", name)
27
28
  else
28
29
  usage
29
30
  end
data/flay.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  # coding: utf-8
2
2
  Gem::Specification.new do |spec|
3
3
  spec.name = "chef-flavor-flay"
4
- spec.version = "0.2.0"
4
+ spec.version = "0.2.1"
5
5
  spec.authors = ["pseudomuto"]
6
6
  spec.email = ["developers@sweeper.io"]
7
7
 
@@ -3,7 +3,7 @@ module ChefGen
3
3
  class Flay
4
4
  NAME = "flay".freeze
5
5
  DESC = "Generate a new cookbook with **better** defaults".freeze
6
- VERSION = "0.2.0".freeze
6
+ VERSION = "0.2.1".freeze
7
7
 
8
8
  attr_reader :temp_path
9
9
 
@@ -2,4 +2,4 @@
2
2
  # Cookbook Name:: <%= cookbook_name %>
3
3
  # Recipe:: <%= recipe_name %>
4
4
  #
5
- <%= license_description('#') %>
5
+ <%= license_description("#").rstrip %>
@@ -2,7 +2,7 @@
2
2
  # Cookbook Name:: <%= cookbook_name %>
3
3
  # Spec:: <%= recipe_name %>
4
4
  #
5
- <%= license_description("#") %>
5
+ <%= license_description("#").rstrip %>
6
6
 
7
7
  describe "<%= cookbook_name %>::<%= recipe_name %>" do
8
8
  cached(:chef_run) do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-flavor-flay
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - pseudomuto