engineyard-recipes 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/ChangeLog.md CHANGED
@@ -8,3 +8,8 @@ Initial set of commands:
8
8
  * `recipe` - generate a scaffold for a new recipe
9
9
  * `definition` - generate a scaffold for a helper definition
10
10
 
11
+ Patches:
12
+
13
+ ### v0.1.1
14
+
15
+ * `clone` - When cloning a recipe folder, don't insert require_recipe if the folder doesn't have a recipe folder
@@ -16,6 +16,7 @@ Feature: Clone recipe from git repositories
16
16
  """
17
17
  exist cookbooks
18
18
  create cookbooks/blank/README.rdoc
19
+ create cookbooks/blank/recipes/default.rb
19
20
  append cookbooks/main/recipes/default.rb
20
21
  """
21
22
 
@@ -29,9 +30,22 @@ Feature: Clone recipe from git repositories
29
30
  """
30
31
  exist cookbooks
31
32
  create cookbooks/myrecipe/README.rdoc
33
+ create cookbooks/myrecipe/recipes/default.rb
32
34
  append cookbooks/main/recipes/default.rb
33
35
  """
34
36
 
37
+ Scenario: Clone recipe repo, do not auto-require if no recipe
38
+ Given I am have a local recipe "library" at "/tmp/ey-recipes/library"
39
+ When I run local executable "ey-recipes" with arguments "clone /tmp/ey-recipes/library"
40
+ Then file "cookbooks/library/libraries/mylib.rb" is created
41
+ And file "cookbooks/main/recipes/default.rb" does not contain "require_recipe 'library'"
42
+ And I should see exactly
43
+ """
44
+ exist cookbooks
45
+ create cookbooks/library/README.rdoc
46
+ create cookbooks/library/libraries/mylib.rb
47
+ """
48
+
35
49
  @wip
36
50
  Scenario: Clone a recipe from engineyard/ey-cloud-recipes repository
37
51
  Given I am have a local recipe "blank" at "/tmp/ey-recipes/blank"
@@ -104,6 +104,14 @@ Then /^file "([^"]*)" contains "([^"]*)"$/ do |file, text|
104
104
  end
105
105
  end
106
106
 
107
+ Then /^file "([^"]*)" does not contain "([^"]*)"$/ do |file, text|
108
+ in_project_folder do
109
+ actual_output = File.read(file)
110
+ actual_output.should_not contain(text)
111
+ end
112
+ end
113
+
114
+
107
115
 
108
116
  Then /gem file "(.*)" and generated file "(.*)" should be the same/ do |gem_file, project_file|
109
117
  File.exists?(gem_file).should be_true
@@ -10,9 +10,11 @@ Before do
10
10
  @home_path = File.expand_path(File.join(@tmp_root, "home"))
11
11
  @lib_path = File.expand_path(File.dirname(__FILE__) + "/../../lib")
12
12
  @fixtures_path = File.expand_path(File.dirname(__FILE__) + "/../../fixtures")
13
- @tmp_recipes_path = "/tmp/ey-recipes"
14
13
  FileUtils.rm_rf @tmp_root
15
14
  FileUtils.mkdir_p @home_path
15
+ @tmp_recipes_path = "/tmp/ey-recipes"
16
+ FileUtils.rm_rf @tmp_recipes_path
17
+ FileUtils.mkdir_p @tmp_recipes_path
16
18
  ENV['HOME'] = @home_path
17
19
  fixture_bin_path = File.expand_path('../../../fixtures/bin', __FILE__)
18
20
  ENV['PATH'] = fixture_bin_path + ":" + path
File without changes
@@ -18,10 +18,10 @@ module Engineyard::Recipes
18
18
  def auto_require_package
19
19
  file = "cookbooks/main/recipes/default.rb"
20
20
  file_path = File.join(destination_root, "cookbooks/main/recipes/default.rb")
21
- unless File.exists?(file_path)
21
+ if !File.exists?(file_path)
22
22
  puts "Skipping auto-require of package recipe: #{file} is missing"
23
- else
24
- require_recipe = "require_recipe '#{recipe_name}'"
23
+ elsif File.directory?(File.join(self.class.source_root, "cookbooks", recipe_name, "recipes"))
24
+ require_recipe = "\nrequire_recipe '#{recipe_name}'\n"
25
25
  append_to_file file, require_recipe
26
26
  end
27
27
  end
@@ -21,7 +21,7 @@ module Engineyard::Recipes
21
21
  unless File.exists?(file_path)
22
22
  puts "Skipping auto-require of package recipe: #{file} is missing"
23
23
  else
24
- require_recipe = "require_recipe '#{recipe_name}'"
24
+ require_recipe = "\nrequire_recipe '#{recipe_name}'\n"
25
25
  append_to_file file, require_recipe
26
26
  end
27
27
  end
@@ -1 +1 @@
1
- <%= recipe_name %>_version('1.0.0')
1
+ <%= recipe_name %>_version('1.0.0')
@@ -2,4 +2,4 @@
2
2
  # Cookbook Name:: <%= recipe_name %>
3
3
  # Recipe:: default
4
4
  #
5
- require_recipe '<%= recipe_name %>::install'
5
+ require_recipe '<%= recipe_name %>::install'
@@ -1,5 +1,5 @@
1
1
  module Engineyard
2
2
  module Recipes
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: engineyard-recipes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-11-15 00:00:00.000000000Z
12
+ date: 2011-11-16 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor
16
- requirement: &70096827738600 !ruby/object:Gem::Requirement
16
+ requirement: &70281584606040 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 0.14.6
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70096827738600
24
+ version_requirements: *70281584606040
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: engineyard
27
- requirement: &70096827735860 !ruby/object:Gem::Requirement
27
+ requirement: &70281584605520 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 1.4.6
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70096827735860
35
+ version_requirements: *70281584605520
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rake
38
- requirement: &70096827733600 !ruby/object:Gem::Requirement
38
+ requirement: &70281584604980 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 0.9.2
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70096827733600
46
+ version_requirements: *70281584604980
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: cucumber
49
- requirement: &70096827730720 !ruby/object:Gem::Requirement
49
+ requirement: &70281584604440 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 1.1.2
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70096827730720
57
+ version_requirements: *70281584604440
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: rspec
60
- requirement: &70096827722540 !ruby/object:Gem::Requirement
60
+ requirement: &70281584603860 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: 2.7.0
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *70096827722540
68
+ version_requirements: *70281584603860
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: launchy
71
- requirement: &70096827719420 !ruby/object:Gem::Requirement
71
+ requirement: &70281584603300 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,7 +76,7 @@ dependencies:
76
76
  version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *70096827719420
79
+ version_requirements: *70281584603300
80
80
  description: Tools to generate, upload, test and apply chef recipes for Engine Yard
81
81
  Cloud.
82
82
  email:
@@ -107,6 +107,7 @@ files:
107
107
  - fixtures/projects/rails/Gemfile
108
108
  - fixtures/projects/rails/Rakefile
109
109
  - fixtures/recipes/blank/README.rdoc
110
+ - fixtures/recipes/blank/recipes/default.rb
110
111
  - lib/engineyard-recipes.rb
111
112
  - lib/engineyard-recipes/cli.rb
112
113
  - lib/engineyard-recipes/fetch_uri.rb
@@ -140,7 +141,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
140
141
  version: '0'
141
142
  segments:
142
143
  - 0
143
- hash: 1147243042889159238
144
+ hash: -1913390095989605023
144
145
  required_rubygems_version: !ruby/object:Gem::Requirement
145
146
  none: false
146
147
  requirements:
@@ -149,7 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
149
150
  version: '0'
150
151
  segments:
151
152
  - 0
152
- hash: 1147243042889159238
153
+ hash: -1913390095989605023
153
154
  requirements: []
154
155
  rubyforge_project: engineyard-recipes
155
156
  rubygems_version: 1.8.6