jamie 0.1.0.alpha11 → 0.1.0.alpha12

Sign up to get free protection for your applications and to get access to all the features.
@@ -702,8 +702,6 @@ module Jamie
702
702
 
703
703
  if instance.jr.setup_cmd
704
704
  ssh(ssh_args, instance.jr.setup_cmd)
705
- else
706
- super
707
705
  end
708
706
  end
709
707
 
@@ -713,8 +711,6 @@ module Jamie
713
711
  if instance.jr.run_cmd
714
712
  ssh(ssh_args, instance.jr.sync_cmd)
715
713
  ssh(ssh_args, instance.jr.run_cmd)
716
- else
717
- super
718
714
  end
719
715
  end
720
716
 
@@ -71,6 +71,7 @@ module Jamie
71
71
  empty_directory "test/integration/standard" if init_test_dir?
72
72
  append_to_gitignore(".jamie/")
73
73
  append_to_gitignore(".jamie.local.yml")
74
+ add_plugins
74
75
  end
75
76
 
76
77
  private
@@ -146,8 +147,8 @@ module Jamie
146
147
  def default_yaml
147
148
  url_base = "https://opscode-vm.s3.amazonaws.com/vagrant/boxes"
148
149
  platforms = [
149
- { :n => 'ubuntu', :vers => %w(10.04 12.04), :rl => "recipe[apt]" },
150
- { :n => 'centos', :vers => %w(5.8 6.3), :rl => "recipe[yum::epel]" }
150
+ { :n => 'ubuntu', :vers => %w(12.04 10.04), :rl => "recipe[apt]" },
151
+ { :n => 'centos', :vers => %w(6.3 5.8), :rl => "recipe[yum::epel]" }
151
152
  ]
152
153
  platforms = platforms.map do |p|
153
154
  p[:vers].map do |v|
@@ -197,6 +198,35 @@ module Jamie
197
198
  end
198
199
  end
199
200
 
201
+ def add_plugins
202
+ prompt_add = "Add a Driver plugin to your Gemfile? (y/n)>"
203
+ prompt_name = "Enter gem name, `list', or `skip'>"
204
+
205
+ if yes?(prompt_add, :green)
206
+ list_plugins while (plugin = ask(prompt_name, :green)) == "list"
207
+ return if plugin == "skip"
208
+ append_to_file("Gemfile", %{gem '#{plugin}', :group => :integration\n})
209
+ say "You must run `bundle install' to fetch any new gems.", :red
210
+ end
211
+ end
212
+
213
+ def list_plugins
214
+ specs = fetch_gem_specs.map { |t| t.first }.map { |t| t[0, 2] }.
215
+ sort { |x,y| x[0] <=> y[0] }
216
+ specs = specs[0, 49].push(["...", "..."]) if specs.size > 49
217
+ specs = specs.unshift(["Gem Name", "Latest Stable Release"])
218
+ print_table(specs, :indent => 4)
219
+ end
220
+
221
+ def fetch_gem_specs
222
+ require 'rubygems/spec_fetcher'
223
+ req = Gem::Requirement.default
224
+ dep = Gem::Deprecate.skip_during { Gem::Dependency.new(/jamie-/i, req) }
225
+ fetcher = Gem::SpecFetcher.fetcher
226
+
227
+ specs = fetcher.find_matching(dep, false, false, false)
228
+ end
229
+
200
230
  # A rather insane and questionable class to quickly consume a metadata.rb
201
231
  # file and return the cookbook name and version attributes.
202
232
  #
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Jamie
4
4
 
5
- VERSION = "0.1.0.alpha11"
5
+ VERSION = "0.1.0.alpha12"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jamie
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.alpha11
4
+ version: 0.1.0.alpha12
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -194,7 +194,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
194
194
  version: '0'
195
195
  segments:
196
196
  - 0
197
- hash: -3673077121589560001
197
+ hash: 1095190417658987214
198
198
  required_rubygems_version: !ruby/object:Gem::Requirement
199
199
  none: false
200
200
  requirements: