hobo-inviqa 0.0.9.pre.rc1 → 0.0.9.pre.rc2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +8 -8
  2. data/Gemfile.lock +11 -1
  3. data/bin/hobo +7 -3
  4. data/features/hobo/basic.feature +10 -1
  5. data/features/hobo/subcommands.feature +1 -2
  6. data/features/step_definitions/env.rb +6 -0
  7. data/lib/hobo.rb +9 -8
  8. data/lib/hobo/cli.rb +4 -7
  9. data/lib/hobo/config/file.rb +2 -3
  10. data/lib/hobo/error_handlers/friendly.rb +1 -2
  11. data/lib/hobo/help_formatter.rb +0 -5
  12. data/lib/hobo/helper/file_locator.rb +0 -2
  13. data/lib/hobo/helper/http_download.rb +2 -3
  14. data/lib/hobo/helper/shell.rb +3 -3
  15. data/lib/hobo/helper/vm_command.rb +0 -7
  16. data/lib/hobo/lib/host_check/deps.rb +1 -1
  17. data/lib/hobo/lib/host_check/git.rb +2 -2
  18. data/lib/hobo/lib/host_check/hobo.rb +5 -2
  19. data/lib/hobo/lib/host_check/ruby.rb +2 -2
  20. data/lib/hobo/lib/host_check/vagrant.rb +1 -2
  21. data/lib/hobo/lib/s3/sync.rb +2 -3
  22. data/lib/hobo/lib/seed/replacer.rb +1 -2
  23. data/lib/hobo/lib/seed/seed.rb +7 -6
  24. data/lib/hobo/lib/vm/command.rb +1 -0
  25. data/lib/hobo/lib/vm/inspector.rb +2 -2
  26. data/lib/hobo/logging.rb +0 -2
  27. data/lib/hobo/patches/deepstruct.rb +0 -2
  28. data/lib/hobo/patches/rake.rb +0 -2
  29. data/lib/hobo/patches/slop.rb +0 -2
  30. data/lib/hobo/tasks/assets.rb +0 -2
  31. data/lib/hobo/tasks/deps.rb +2 -2
  32. data/lib/hobo/tasks/system/completions.rb +1 -1
  33. data/lib/hobo/tasks/vm.rb +1 -1
  34. data/lib/hobo/ui.rb +1 -3
  35. data/lib/hobo/util.rb +7 -2
  36. data/lib/hobo/version.rb +1 -1
  37. data/spec/hobo/cli_spec.rb +3 -15
  38. data/spec/hobo/helpers/vm_command_spec.rb +2 -23
  39. data/spec/hobo/lib/{s3sync_spec.rb → s3/sync_spec.rb} +1 -1
  40. data/test_files/vagrant_fail/vagrant +2 -0
  41. metadata +7 -4
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NDMyYjk4NWFmYzI3OWI5MDc4NDMwZTRiNzZmYWU0M2NlMjYyN2M3NA==
4
+ NmFkZDZkYmVlOTQ4MzE1MjRlYzdkNTdhN2U5NDI1ODBmZGI4YmIxOA==
5
5
  data.tar.gz: !binary |-
6
- ZDM5MmEyZDNiNzk0MGIyNTQ2NmVjYTIxYTNkYTg5ZDg3ZTUxMTllOA==
6
+ M2UwNWI1NDFiYWM3MjY3MGZhZjY3YTNhZmJhYTQ2OTI3N2IzMjJiYg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NTM5YzRkNGI2NzQ3YjVkOTExOWVhOTc3MWRkMzQ4OTg0OGY0YmJiMzkxYjkx
10
- ZWRlZTc4ZDljMGUxNzY2YWU1MDY0Y2RkYjY2NTRmOGVhMzk5NjNmNDZjODVm
11
- MTM4YTFhYmY2YmY4OWM4MjM5MTI2M2MxNzJhODAxNDg5ODM1N2Q=
9
+ NGQ1MzJmZmYwYmQ3NjIwMjZjOGFmZDMyNTFkZWYxYTY0YTM0YzgxZTE0YjE1
10
+ MWZkMzQ3NmRhYWNiYTg5NTljNGJlM2QwN2RmNWRkOTcyMGQzZmUyYWFlNzcw
11
+ M2JjYTZkMWZlOWZjNTI1MDM4YjIyZDA3MDViYTRkZDE3YzIxZDY=
12
12
  data.tar.gz: !binary |-
13
- Zjc0ZDRlZjVkMWZkZjllMzliYmFhYWUxZTg2YTliOWIzZmJiZTU0ZTA2Nzdh
14
- MzdiNTVmNGMyMmEzYmZiNjE5YmE3MDIzMDdhODIyZjNkMTBmODBiOGEwYTQy
15
- ZmE2YjYxM2FhNDZhMzE2OWZlOWViN2VkYjgzM2I4N2Y1ODUxYWY=
13
+ ZmUzMjhmNDNmMTg0YmM4Y2NkNmIxOTI4MTk1YmYyMzhiMTE1NzU2MmY3YWU3
14
+ NTdmODk4N2UwNzViODAxNDBkMzZhYjRjOTZkMmE2NTBlMDMwYjUzMTUyMDhm
15
+ MmVkNDdkMjAxNjU2MjJmZDQ4NmFmOGViZDQzY2JkOTE3OTViOGE=
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- hobo-inviqa (0.0.9.pre.rc1)
4
+ hobo-inviqa (0.0.9.pre.rc2)
5
5
  aws-sdk (~> 1.34.0)
6
6
  bundler (~> 1.5.2)
7
7
  deepstruct (~> 0.0.5)
@@ -46,9 +46,12 @@ GEM
46
46
  diff-lcs (1.2.5)
47
47
  fakefs (0.5.0)
48
48
  ffi (1.9.3)
49
+ ffi (1.9.3-x86-mingw32)
49
50
  formatador (0.2.4)
50
51
  gherkin (2.12.2)
51
52
  multi_json (~> 1.3)
53
+ gherkin (2.12.2-x86-mingw32)
54
+ multi_json (~> 1.3)
52
55
  guard (2.2.5)
53
56
  formatador (>= 0.2.4)
54
57
  listen (~> 2.1)
@@ -90,6 +93,11 @@ GEM
90
93
  coderay (~> 1.0)
91
94
  method_source (~> 0.8)
92
95
  slop (~> 3.4)
96
+ pry (0.9.12.6-x86-mingw32)
97
+ coderay (~> 1.0)
98
+ method_source (~> 0.8)
99
+ slop (~> 3.4)
100
+ win32console (~> 1.3)
93
101
  rake (10.1.1)
94
102
  rake-hooks (1.2.3)
95
103
  rake
@@ -112,9 +120,11 @@ GEM
112
120
  thor (0.18.1)
113
121
  timers (1.1.0)
114
122
  uuidtools (2.1.4)
123
+ win32console (1.3.2-x86-mingw32)
115
124
 
116
125
  PLATFORMS
117
126
  ruby
127
+ x86-mingw32
118
128
 
119
129
  DEPENDENCIES
120
130
  aruba (~> 0.5.4)
data/bin/hobo CHANGED
@@ -3,10 +3,10 @@
3
3
  # Hack to allow testing with Aruba (for now)
4
4
  $:.push File.expand_path(File.join("..", "..", "lib"), __FILE__)
5
5
 
6
+ # Suppress Net/SSH/Simple warning on windows
7
+ #$SUPPRESS_32BIT_WARNING=1
8
+
6
9
  require 'hobo'
7
- require 'slop'
8
- require 'teerb'
9
- require 'tmpdir'
10
10
 
11
11
  $HOBO_ARGV = ARGV
12
12
 
@@ -19,6 +19,8 @@ Hobo.logger.level = Logger::WARN
19
19
  # Options parsed here will be hidden from the main app
20
20
  slop = Slop.parse! do
21
21
  on '--debug', 'Enable debugging' do
22
+ require 'teerb'
23
+ require 'tmpdir'
22
24
  error_handler = Hobo::ErrorHandlers::Debug.new
23
25
  debug_log = File.open(File.join(Dir.tmpdir, 'hobo_debug.log'), 'w+')
24
26
  Hobo.logger = Logger.new(TeeRb::IODelegate.new(STDOUT, debug_log))
@@ -33,6 +35,8 @@ slop = Slop.parse! do
33
35
  level = self.to_hash[:'log-level'].upcase
34
36
  Hobo.logger.level = Logger.const_get(level) if [ 'DEBUG', 'INFO' ].include? level
35
37
  end
38
+
39
+ on '--non-interactive', 'Run non-interactively. Defaults will be automatically used where possible.'
36
40
  end
37
41
 
38
42
  Hobo.logger.formatter = proc do |severity, datetime, progname, msg|
@@ -31,4 +31,13 @@ Feature: Basics
31
31
 
32
32
  Scenario: --non-interactive should cause default options to be used
33
33
  When I run `hobo test non-interactive --non-interactive`
34
- Then the output should contain "Used defaults"
34
+ Then the output should contain "Used defaults"
35
+
36
+ Scenario: --all should list all tasks
37
+ When I run `hobo --all`
38
+ Then the output should contain "hobo-debug"
39
+
40
+ Scenario: --skip-host-checks should skip host checks
41
+ Given "test_files/vagrant_fail/" is appended to the PATH environment variable
42
+ When I run `hobo --skip-host-checks`
43
+ Then the output should not contain "Hobo has detected a problem"
@@ -12,5 +12,4 @@ Feature: Subcommands
12
12
  Scenario: Subcommand should execute
13
13
  When I run `hobo test non-interactive` interactively
14
14
  And I type "Testing"
15
- Then the output should contain "Subcommand test"
16
- And the output should contain "Testing"
15
+ Then the output should contain "Testing"
@@ -0,0 +1,6 @@
1
+ require 'fileutils'
2
+
3
+ Given(/^"(.*?)" is appended to the (.*) environment variable$/) do |value, env|
4
+ set_env(env, (ENV[env] || "") + ":" + value)
5
+ puts ENV[env]
6
+ end
data/lib/hobo.rb CHANGED
@@ -1,11 +1,13 @@
1
1
  # External deps
2
+ require 'slop'
2
3
  require 'rake'
3
4
  require 'rake/hooks'
4
5
  require 'tempfile'
5
6
  require 'shellwords'
6
7
  require 'deepstruct'
7
- require 'os'
8
- require 'bundler'
8
+ require 'logger'
9
+ require 'highline'
10
+ require 'fileutils'
9
11
 
10
12
  # DSL enhancements
11
13
  require 'hobo/metadata'
@@ -26,14 +28,8 @@ require 'hobo/error_handlers/exit_code_map'
26
28
  require 'hobo/error_handlers/debug'
27
29
  require 'hobo/error_handlers/friendly'
28
30
  require 'hobo/config/file'
29
- require 'hobo/logging'
30
31
  require 'hobo/config'
31
32
 
32
- # Asset applicators
33
- require 'hobo/asset_applicator'
34
- require 'hobo/asset_applicators/sqldump'
35
- require 'hobo/asset_applicators/files'
36
-
37
33
  # Asset sync
38
34
  require 'hobo/lib/s3/sync'
39
35
  require 'hobo/lib/s3/local/file'
@@ -50,6 +46,11 @@ require 'hobo/helper/vm_command'
50
46
  require 'hobo/lib/vm/inspector'
51
47
  require 'hobo/lib/vm/command'
52
48
 
49
+ # Asset applicators
50
+ require 'hobo/asset_applicator'
51
+ require 'hobo/asset_applicators/sqldump'
52
+ require 'hobo/asset_applicators/files'
53
+
53
54
  # Libs
54
55
  require 'hobo/lib/seed/project'
55
56
  require 'hobo/lib/seed/replacer'
data/lib/hobo/cli.rb CHANGED
@@ -1,6 +1,3 @@
1
- require 'slop'
2
- require 'deepstruct'
3
-
4
1
  module Hobo
5
2
 
6
3
  class << self
@@ -20,6 +17,7 @@ module Hobo
20
17
  @slop = opts[:slop] || Slop.new
21
18
  @help_formatter = opts[:help] || Hobo::HelpFormatter.new(@slop)
22
19
  @help_opts = {}
20
+ @host_check = opts[:host_check] || Hobo::Lib::HostCheck
23
21
  end
24
22
 
25
23
  def start args = ARGV
@@ -104,16 +102,15 @@ module Hobo
104
102
  end
105
103
 
106
104
  def perform_host_checks
107
- Hobo::Lib::HostCheck.check(
108
- :filter => /vagrant.*|.*present|latest_hobo_version/,
109
- :raise => true
105
+ @host_check.check(
106
+ :filter => /vagrant.*|.*present|latest_hobo_version/,
107
+ :raise => true
110
108
  )
111
109
  end
112
110
 
113
111
  def define_global_opts slop
114
112
  slop.on '-a', '--all', 'Show hidden commands'
115
113
  slop.on '-h', '--help', 'Display help'
116
- slop.on '--non-interactive', 'Run non-interactively. Defaults will be automatically used where possible.'
117
114
  slop.on '--skip-host-checks', 'Skip host checks'
118
115
 
119
116
  slop.on '-v', '--version', 'Print version information' do
@@ -1,10 +1,8 @@
1
- require 'yaml'
2
- require 'deepstruct'
3
-
4
1
  module Hobo
5
2
  module Config
6
3
  class File
7
4
  def self.save(file, config)
5
+ require 'yaml'
8
6
  config = config.unwrap if config.public_methods.include? :unwrap
9
7
  dir = ::File.dirname file
10
8
  FileUtils.mkdir_p dir unless ::File.exists? dir
@@ -14,6 +12,7 @@ module Hobo
14
12
  end
15
13
 
16
14
  def self.load(file)
15
+ require 'yaml'
17
16
  config = ::File.exists?(file) ? YAML.load_file(file) : {}
18
17
  raise "Invalid hobo configuration (#{file})" unless config
19
18
  return DeepStruct.wrap(config)
@@ -1,11 +1,10 @@
1
- require 'tmpdir' # Needed for Dir.tmpdir
2
-
3
1
  module Hobo
4
2
  module ErrorHandlers
5
3
  class Friendly
6
4
  include Hobo::ErrorHandlers::ExitCodeMap
7
5
 
8
6
  def handle error
7
+ require 'tmpdir'
9
8
  log_file = File.join(Dir.tmpdir, 'hobo_error.log')
10
9
 
11
10
  # Not possible to match Interrupt class unless we use class name as string for some reason!
@@ -1,8 +1,3 @@
1
- require 'slop'
2
- require 'highline'
3
- require 'hobo/ui'
4
- require 'hobo/patches/slop'
5
-
6
1
  module Hobo
7
2
  class HelpFormatter
8
3
  attr_accessor :command_map
@@ -1,5 +1,3 @@
1
- require 'open3'
2
-
3
1
  module Hobo
4
2
  module Helper
5
3
  def locate(pattern, opts = {}, &block)
@@ -1,9 +1,8 @@
1
- require 'net/http'
2
- require 'uri'
3
-
4
1
  module Hobo
5
2
  module Helper
6
3
  def http_download url, target_file, opts = {}
4
+ require 'net/http'
5
+ require 'uri'
7
6
  opts = { :progress => Hobo.method(:progress) }.merge(opts)
8
7
  uri = URI.parse(url)
9
8
  size = 0
@@ -1,6 +1,3 @@
1
- require 'open3'
2
- require 'tempfile'
3
-
4
1
  module Hobo
5
2
  module Helper
6
3
 
@@ -20,6 +17,9 @@ module Hobo
20
17
  end
21
18
 
22
19
  def shell *args, &block
20
+ require 'open3'
21
+ require 'tempfile'
22
+
23
23
  def chunk_line_iterator stream
24
24
  begin
25
25
  until (chunk = stream.readpartial(1024)).nil? do
@@ -1,6 +1,3 @@
1
- require 'tempfile'
2
- require 'net/ssh/simple'
3
-
4
1
  module Hobo
5
2
  module Helper
6
3
 
@@ -27,10 +24,6 @@ module Hobo
27
24
  def vm_command command = nil, opts = {}
28
25
  ::Hobo::Lib::Vm::Command.new command, opts
29
26
  end
30
-
31
- private
32
-
33
-
34
27
  end
35
28
  end
36
29
 
@@ -4,7 +4,7 @@ module Hobo
4
4
  def ssh_present opts
5
5
  advice = "The SSH command could not be located on your system.\n\n"
6
6
 
7
- if OS.windows?
7
+ if Hobo.windows?
8
8
  advice += "To make SSH available you must re-install git using the installer from http://git-scm.com/downloads ensuring you select the 'Use git and unix tools everywhere' option."
9
9
  else
10
10
  advice += "Please install openssh using your package manager."
@@ -3,7 +3,7 @@ module Hobo
3
3
  module HostCheck
4
4
  def git_present opts
5
5
  advice = "The Git command could not be detected on your system.\n\n"
6
- if OS.windows?
6
+ if Hobo.windows?
7
7
  advice += "Please install it from http://git-scm.com/downloads ensuring you select the 'Use git and unix tools everywhere' option."
8
8
  else
9
9
  advice += "Please install it using your package manager."
@@ -46,7 +46,7 @@ EOF
46
46
  end
47
47
 
48
48
  def git_autocrlf_disabled opts
49
- return unless OS.windows?
49
+ return unless Hobo.windows?
50
50
 
51
51
  advice = <<-EOF
52
52
  You're using git with the core.autocrlf option enabled.
@@ -1,10 +1,11 @@
1
- require 'net/http'
2
- require 'semantic'
1
+
2
+
3
3
 
4
4
  module Hobo
5
5
  module Lib
6
6
  module HostCheck
7
7
  def latest_hobo_version opts
8
+ require 'semantic'
8
9
 
9
10
  installed = ::Semantic::Version.new Hobo::VERSION
10
11
 
@@ -25,6 +26,8 @@ module Hobo
25
26
  private
26
27
 
27
28
  def get_latest_hobo_version
29
+ require 'semantic'
30
+ require 'net/http'
28
31
  one_day = 3600 * 24
29
32
  file = File.join(Hobo.config_path, 'latest')
30
33
  if !File.exists? file or File.mtime(file) < Time.now - one_day
@@ -2,7 +2,7 @@ module Hobo
2
2
  module Lib
3
3
  module HostCheck
4
4
  def not_using_system_ruby opts
5
- return if OS.windows?
5
+ return if Hobo.windows?
6
6
  advice = <<-EOF
7
7
  You're using a system ruby install which can cause issues with installing Gems and running some older projects.
8
8
 
@@ -21,7 +21,7 @@ EOF
21
21
  end
22
22
 
23
23
  def system_paths_for_ruby opts
24
- return if OS.windows?
24
+ return if Hobo.windows?
25
25
 
26
26
  advice = <<-EOF
27
27
  The ordering of your system paths may cause a problem with Gems.
@@ -1,9 +1,8 @@
1
- require 'semantic'
2
-
3
1
  module Hobo
4
2
  module Lib
5
3
  module HostCheck
6
4
  def vagrant_version opts
5
+ require 'semantic'
7
6
  begin
8
7
  version = shell "vagrant --version", :capture => true
9
8
  version.gsub!(/^Vagrant /, '')
@@ -1,6 +1,3 @@
1
- require 'aws-sdk'
2
- require 'fileutils'
3
-
4
1
  module Hobo
5
2
  module Lib
6
3
  module S3
@@ -8,6 +5,8 @@ module Hobo
8
5
  include Hobo::Logging
9
6
 
10
7
  def initialize opts = {}
8
+ require 'aws-sdk'
9
+
11
10
  @opts = {
12
11
  :access_key_id => nil,
13
12
  :secret_access_key => nil,
@@ -1,5 +1,3 @@
1
- require 'find'
2
-
3
1
  module Hobo
4
2
  module Lib
5
3
  module Seed
@@ -20,6 +18,7 @@ module Hobo
20
18
  private
21
19
 
22
20
  def search_replace(path, tokens, &block)
21
+ require 'find'
23
22
  files = []
24
23
  excludes = Regexp.new(EXCLUDES.join("|"))
25
24
  Find.find(path) do |candidate|
@@ -1,5 +1,3 @@
1
- require 'tempfile'
2
-
3
1
  module Hobo
4
2
  module Lib
5
3
  module Seed
@@ -23,10 +21,11 @@ module Hobo
23
21
  Hobo::Helper.shell "git clone . #{tmp_path}"
24
22
  end
25
23
 
26
- Hobo.ui.success "Exporting seed submodules"
27
-
28
24
  Dir.chdir tmp_path do
29
- Hobo::Helper.shell "git submodule update --init"
25
+ Hobo.ui.success "Cloning submodules"
26
+ Hobo::Helper.shell "git submodule update --init", :realtime => true, :indent => 2
27
+
28
+ Hobo.ui.success "Exporting seed"
30
29
  Hobo::Helper.shell "git archive master | tar -x -C #{path.shellescape}"
31
30
 
32
31
  # Export submodules
@@ -36,6 +35,7 @@ module Hobo
36
35
  matches = line.match /^\s*[a-z0-9]+ (.+) \(.*\)/
37
36
  next unless matches
38
37
  submodule_path = matches[1]
38
+ Hobo.ui.success "Exporting '#{submodule_path}' seed submodule"
39
39
  Hobo::Helper.shell "cd #{tmp_path}/#{submodule_path.shellescape} && git archive HEAD | tar -x -C #{path}/#{submodule_path.shellescape}"
40
40
  end
41
41
  end
@@ -49,7 +49,8 @@ module Hobo
49
49
  if File.exists? File.join(@seed_path, 'HEAD')
50
50
  Dir.chdir @seed_path do
51
51
  logger.info "Updating seed in #{@seed_path}"
52
- Hobo::Helper.shell 'git', 'fetch', '--all'
52
+ # Need to be specific here as GH for windows adds an invalid "upstream" remote to all repos
53
+ Hobo::Helper.shell 'git', 'fetch', 'origin'
53
54
  end
54
55
  else
55
56
  logger.info "Cloning seed from #{@url} to #{@seed_path}"
@@ -37,6 +37,7 @@ module Hobo
37
37
  # TODO Migrate all vm_shell functionality this direction
38
38
  def run
39
39
  return if @command.nil?
40
+ require 'net/ssh/simple'
40
41
  opts = @@vm_inspector.ssh_config.merge(@opts)
41
42
 
42
43
  Net::SSH::Simple.sync do
@@ -16,10 +16,10 @@ module Hobo
16
16
 
17
17
  locator_file = File.basename(tmp.path)
18
18
 
19
- pattern = OS.windows? ? 'vboxsf' : Hobo.project_path.shellescape
19
+ pattern = Hobo.windows? ? 'vboxsf' : Hobo.project_path.shellescape
20
20
 
21
21
  sed = 's/.* on \(.*\) type.*/\1\/%%/g'.gsub('%%', locator_file)
22
- locator_results = VmCommand.new(
22
+ locator_results = Command.new(
23
23
  "mount | grep #{pattern} | sed -e\"#{sed}\" | xargs md5sum",
24
24
  :capture => true,
25
25
  :pwd => '/'
data/lib/hobo/logging.rb CHANGED
@@ -1,5 +1,3 @@
1
- require 'logger'
2
-
3
1
  module Hobo
4
2
  class << self
5
3
  attr_accessor :logger
@@ -1,5 +1,3 @@
1
- require 'deepstruct'
2
-
3
1
  # Copied from the DeepStruct gem
4
2
  # Modified to return Null on unknown key
5
3
  module DeepStruct
@@ -1,5 +1,3 @@
1
- require 'rake'
2
-
3
1
  module Rake
4
2
  class Task
5
3
  attr_accessor :opts
@@ -1,5 +1,3 @@
1
- require 'slop'
2
-
3
1
  class Slop
4
2
  attr_accessor :long_desc, :arg_list, :hidden, :desc, :unparsed
5
3
 
@@ -1,5 +1,3 @@
1
- require 'hobo/lib/s3/sync'
2
-
3
1
  desc "Project asset commands"
4
2
  project_only
5
3
  namespace :assets do
@@ -1,11 +1,10 @@
1
- require 'bundler'
2
-
3
1
  desc "Dependency related tasks"
4
2
  hidden true
5
3
  namespace :deps do
6
4
 
7
5
  desc "Install Gem dependencies"
8
6
  task :gems do
7
+ require 'bundler'
9
8
  locate "*Gemfile" do
10
9
  Hobo.ui.title "Installing Gem dependencies"
11
10
  Bundler.with_clean_env do
@@ -66,6 +65,7 @@ namespace :deps do
66
65
 
67
66
  desc "Install chef dependencies"
68
67
  task :chef => [ "deps:gems" ] do
68
+ require 'bundler'
69
69
  locate "*Cheffile" do
70
70
  Hobo.ui.title "Installing chef dependencies via librarian"
71
71
  Bundler.with_clean_env do
@@ -18,7 +18,7 @@ function __hobo_completion -d "Create hobo completions"
18
18
  set -l hobo_cache_file "$cache_dir/$hashed_pwd"
19
19
 
20
20
  if not test -f "$hobo_cache_file"
21
- hobo system completions fish > "$hobo_cache_file"
21
+ hobo system completions fish --skip-host-checks > "$hobo_cache_file"
22
22
  end
23
23
 
24
24
  cat "$hobo_cache_file"
data/lib/hobo/tasks/vm.rb CHANGED
@@ -11,7 +11,7 @@ namespace :vm do
11
11
  opts = { :realtime => true, :indent => 2 }
12
12
  color = Hobo.ui.supports_color? ? '--color' : '--no-color'
13
13
 
14
- if OS.windows?
14
+ if Hobo.windows?
15
15
  opts[:env] = { 'VAGRANT_HOME' => windows_short(dir) } if ENV['HOME'].match(/\s+/) && !ENV['VAGRANT_HOME']
16
16
  end
17
17
 
data/lib/hobo/ui.rb CHANGED
@@ -1,5 +1,3 @@
1
- require 'highline'
2
-
3
1
  module Hobo
4
2
  class << self
5
3
  attr_accessor :ui
@@ -38,7 +36,7 @@ module Hobo
38
36
  end
39
37
 
40
38
  def supports_color?
41
- return @output_io.tty? unless OS.windows?
39
+ return @output_io.tty? unless Hobo.windows?
42
40
  return (ENV['ANSICON'] || ENV['TERM'] == 'xterm') && @output_io.tty? # ANSICON or MinTTY && output is TTY
43
41
  end
44
42
 
data/lib/hobo/util.rb CHANGED
@@ -1,5 +1,3 @@
1
- require 'ruby-progressbar'
2
-
3
1
  module Hobo
4
2
  class << self
5
3
 
@@ -14,6 +12,8 @@ module Hobo
14
12
  end
15
13
 
16
14
  def progress file, increment, total, type, opts = {}
15
+ require 'ruby-progressbar'
16
+
17
17
  opts = {
18
18
  :title => File.basename(file),
19
19
  :total => total,
@@ -48,5 +48,10 @@ module Hobo
48
48
  :secret_access_key => maybe(Hobo.user_config.aws.secret_access_key) || ENV['AWS_SECRET_ACCESS_KEY']
49
49
  }
50
50
  end
51
+
52
+ def windows?
53
+ require 'rbconfig'
54
+ !!(RbConfig::CONFIG['host_os'] =~ /mswin|msys|mingw|cygwin|bccwin|wince|emc/)
55
+ end
51
56
  end
52
57
  end
data/lib/hobo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Hobo
2
- VERSION = '0.0.9-rc1'
2
+ VERSION = '0.0.9-rc2'
3
3
  end
@@ -16,7 +16,8 @@ describe Hobo::Cli do
16
16
 
17
17
  Hobo.ui = double(Hobo::Ui).as_null_object
18
18
  help = double(Hobo::HelpFormatter).as_null_object
19
- cli = Hobo::Cli.new help: help
19
+ host_check = double(Hobo::Lib::HostCheck).as_null_object
20
+ cli = Hobo::Cli.new help: help, host_check: host_check
20
21
 
21
22
  hobofile = File.read(File.join(File.dirname(__FILE__), '../../Hobofile'))
22
23
 
@@ -24,8 +25,6 @@ describe Hobo::Cli do
24
25
  FakeFS.activate!
25
26
 
26
27
  File.write('Hobofile', hobofile)
27
-
28
- double(Hobo::Lib::HostCheck).as_null_object
29
28
  end
30
29
 
31
30
  after do
@@ -102,11 +101,6 @@ describe Hobo::Cli do
102
101
  map["test:metadata"].hidden.should be true
103
102
  end
104
103
 
105
- it "should set non-interactive mode in ui if --non-interactive" do
106
- Hobo.ui.should_receive('interactive=').with(false)
107
- cli.start(test_args(['--non-interactive']))
108
- end
109
-
110
104
  it "should show help if no args or opts passed" do
111
105
  help.should_receive(:help)
112
106
  cli.start(test_args([]))
@@ -153,13 +147,7 @@ describe Hobo::Cli do
153
147
  end
154
148
 
155
149
  it "should propagate unparsed arguments in :_unparsed opt" do
156
- Hobo.ui.should_receive(:info).with("ls --help")
157
- cli.slop.unparsed = "ls --help"
158
- cli.start test_args(["test", "unparsed", "--skip-host-checks"])
159
- end
160
-
161
- it "should propagate unparsed arguments in :_unparsed opt" do
162
- Hobo.ui.should_receive(:info).with("ls --help")
150
+ Hobo.ui.should_receive(:info).with("'ls' '--help'")
163
151
  cli.start ["test", "unparsed", "--", "ls", "--help"]
164
152
  end
165
153
 
@@ -15,7 +15,7 @@ describe Hobo::Helper do
15
15
 
16
16
  Hobo.ui = Hobo::Ui.new
17
17
 
18
- vmi_double = double(Hobo::Helper::VmInspector).as_null_object
18
+ vmi_double = double(Hobo::Lib::Vm::Inspector).as_null_object
19
19
  vmi_double.should_receive(:ssh_config).and_return({
20
20
  :ssh_host => 'fakehost',
21
21
  :ssh_user => 'fakeuser',
@@ -23,7 +23,7 @@ describe Hobo::Helper do
23
23
  :ssh_identity => 'fakeidentity'
24
24
  })
25
25
 
26
- Hobo::Helper::VmCommand.class_eval do
26
+ Hobo::Lib::Vm::Command.class_eval do
27
27
  class_variable_set '@@vm_inspector', vmi_double
28
28
  end
29
29
  end
@@ -33,18 +33,6 @@ describe Hobo::Helper do
33
33
  vm_command("my_command", :pwd => '/').to_s.should match /-c my_command/
34
34
  end
35
35
 
36
- <<<<<<< HEAD
37
- it "should default to using a psuedo tty" do
38
- vm_command("my_command", :pwd => '/').to_s.should match /\s-t\s/
39
- end
40
-
41
- it "should default to vagrant user" do
42
- vm_command("my_command", :pwd => '/').to_s.should match /vagrant@/
43
- end
44
-
45
- it "should default to project host name" do
46
- vm_command("my_command", :pwd => '/').to_s.should match /@test_hostname/
47
- =======
48
36
  it "should default to not using a psuedo tty" do
49
37
  vm_command("my_command", :pwd => '/').to_s.should_not match /\s-t\s/
50
38
  end
@@ -55,7 +43,6 @@ describe Hobo::Helper do
55
43
 
56
44
  it "should default to ssh_config host name" do
57
45
  vm_command("my_command", :pwd => '/').to_s.should match /@fakehost/
58
- >>>>>>> 0.0.6-bugfixes
59
46
  end
60
47
 
61
48
  it "should not wrap piped commands with echo by default" do
@@ -76,19 +63,11 @@ describe Hobo::Helper do
76
63
 
77
64
  it "should not pass user / pass if project config mysql credentials not set" do
78
65
  Hobo.project_config = DeepStruct.wrap({})
79
- <<<<<<< HEAD
80
- vm_mysql(:pwd => '/').to_s.should match /-c mysql'$/
81
- end
82
-
83
- it "should allow specifying the database in options" do
84
- vm_mysql(:pwd => '/', :db => "test_db").to_s.should match /-c mysql.*test_db'$/
85
- =======
86
66
  vm_mysql(:pwd => '/').to_s.should match /-c mysql'/
87
67
  end
88
68
 
89
69
  it "should allow specifying the database in options" do
90
70
  vm_mysql(:pwd => '/', :db => "test_db").to_s.should match /-c mysql.*test_db'/
91
- >>>>>>> 0.0.6-bugfixes
92
71
  end
93
72
 
94
73
  it "should enable auto echo of piped commands" do
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe Hobo::Lib::S3Sync do
3
+ describe Hobo::Lib::S3::Sync do
4
4
  before do
5
5
  AWS.stub!
6
6
  end
@@ -0,0 +1,2 @@
1
+ #!/bin/bash
2
+ exit 1
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hobo-inviqa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9.pre.rc1
4
+ version: 0.0.9.pre.rc2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Simons
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-31 00:00:00.000000000 Z
11
+ date: 2014-04-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: slop
@@ -297,6 +297,7 @@ files:
297
297
  - features/hobo/help.feature
298
298
  - features/hobo/subcommands.feature
299
299
  - features/seed/plant.feature
300
+ - features/step_definitions/env.rb
300
301
  - features/step_definitions/seed.rb
301
302
  - features/support/env.rb
302
303
  - hobo.gemspec
@@ -362,7 +363,7 @@ files:
362
363
  - spec/hobo/helpers/file_locator_spec.rb
363
364
  - spec/hobo/helpers/shell_spec.rb
364
365
  - spec/hobo/helpers/vm_command_spec.rb
365
- - spec/hobo/lib/s3sync_spec.rb
366
+ - spec/hobo/lib/s3/sync_spec.rb
366
367
  - spec/hobo/lib/seed/project_spec.rb
367
368
  - spec/hobo/lib/seed/replacer_spec.rb
368
369
  - spec/hobo/lib/seed/seed_spec.rb
@@ -374,6 +375,7 @@ files:
374
375
  - spec/hobo/ui_spec.rb
375
376
  - spec/hobo/util_spec.rb
376
377
  - spec/spec_helper.rb
378
+ - test_files/vagrant_fail/vagrant
377
379
  homepage: ''
378
380
  licenses: []
379
381
  metadata: {}
@@ -403,6 +405,7 @@ test_files:
403
405
  - features/hobo/help.feature
404
406
  - features/hobo/subcommands.feature
405
407
  - features/seed/plant.feature
408
+ - features/step_definitions/env.rb
406
409
  - features/step_definitions/seed.rb
407
410
  - features/support/env.rb
408
411
  - spec/hobo/asset_applicator_spec.rb
@@ -415,7 +418,7 @@ test_files:
415
418
  - spec/hobo/helpers/file_locator_spec.rb
416
419
  - spec/hobo/helpers/shell_spec.rb
417
420
  - spec/hobo/helpers/vm_command_spec.rb
418
- - spec/hobo/lib/s3sync_spec.rb
421
+ - spec/hobo/lib/s3/sync_spec.rb
419
422
  - spec/hobo/lib/seed/project_spec.rb
420
423
  - spec/hobo/lib/seed/replacer_spec.rb
421
424
  - spec/hobo/lib/seed/seed_spec.rb