hobo-inviqa 0.0.3 → 0.0.4
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/Gemfile.lock +1 -1
- data/bin/hobo +10 -1
- data/features/hobo/basic.feature +4 -0
- data/lib/hobo/cli.rb +1 -2
- data/lib/hobo/lib/seed/project.rb +1 -1
- data/lib/hobo/paths.rb +10 -7
- data/lib/hobo/ui.rb +5 -0
- data/lib/hobo/version.rb +1 -1
- metadata +4 -4
data/Gemfile.lock
CHANGED
data/bin/hobo
CHANGED
@@ -9,11 +9,20 @@ require 'slop'
|
|
9
9
|
error_handler = Hobo::ErrorHandlers::Friendly.new
|
10
10
|
Hobo.ui = Hobo::Ui.new
|
11
11
|
|
12
|
+
# win32console unfortunately has issues with Open3
|
13
|
+
# Simply disabling color for now; --ansi can be explicitly passed if required
|
14
|
+
# We also take the opportunity to disable ansi for pipes
|
15
|
+
Hobo.ui.use_color false if Gem.win_platform? || !STDOUT.tty?
|
16
|
+
|
12
17
|
# Options parsed here will be hidden from the main app
|
13
18
|
slop = Slop.parse! do
|
14
|
-
on '--debug' do
|
19
|
+
on '--debug', 'Enable debugging' do
|
15
20
|
error_handler = Hobo::ErrorHandlers::Debug.new
|
16
21
|
end
|
22
|
+
|
23
|
+
on '--ansi', 'Enable / disable ansi output' do |*args|
|
24
|
+
Hobo.ui.use_color self.to_hash[:ansi]
|
25
|
+
end
|
17
26
|
end
|
18
27
|
|
19
28
|
begin
|
data/features/hobo/basic.feature
CHANGED
@@ -25,6 +25,10 @@ Feature: Basics
|
|
25
25
|
When I run `hobo jibberjabber --debug`
|
26
26
|
Then the output should contain "Hobo::InvalidCommandOrOpt"
|
27
27
|
|
28
|
+
Scenario: --no-ansi should disable ansi output
|
29
|
+
When I run `hobo --no-ansi`
|
30
|
+
Then the output should not contain "33m"
|
31
|
+
|
28
32
|
Scenario: --non-interactive should cause default options to be used
|
29
33
|
When I run `hobo test non-interactive --non-interactive`
|
30
34
|
Then the output should contain "Used defaults"
|
data/lib/hobo/cli.rb
CHANGED
@@ -65,10 +65,9 @@ module Hobo
|
|
65
65
|
end
|
66
66
|
|
67
67
|
def define_global_opts slop
|
68
|
-
slop.on '--debug', 'Enable debugging'
|
69
68
|
slop.on '-a', '--all', 'Show hidden commands'
|
70
69
|
slop.on '-h', '--help', 'Display help'
|
71
|
-
slop.on '--non-interactive', 'Run non-interactively. Defaults will be
|
70
|
+
slop.on '--non-interactive', 'Run non-interactively. Defaults will be automatically used where possible.'
|
72
71
|
|
73
72
|
slop.on '-v', '--version', 'Print version information' do
|
74
73
|
Hobo.ui.info "Hobo version #{Hobo::VERSION}"
|
@@ -30,7 +30,7 @@ module Hobo
|
|
30
30
|
Dir.chdir path do
|
31
31
|
Hobo::Helper.shell 'git', 'init'
|
32
32
|
Hobo::Helper.shell 'git', 'remote', 'add', 'origin', git_url
|
33
|
-
Hobo::Helper.shell 'git', 'add', '
|
33
|
+
Hobo::Helper.shell 'git', 'add', '--all'
|
34
34
|
Hobo::Helper.shell 'git', 'commit', '-m', "'Initial hobo project'"
|
35
35
|
Hobo::Helper.shell 'git', 'checkout', '-b', 'develop'
|
36
36
|
end
|
data/lib/hobo/paths.rb
CHANGED
@@ -12,17 +12,20 @@ module Hobo
|
|
12
12
|
|
13
13
|
def project_path
|
14
14
|
return @project_path unless @project_path.nil?
|
15
|
-
dir = Dir.pwd
|
16
|
-
|
15
|
+
dir = Dir.pwd.split('/').reverse
|
16
|
+
min_length = Gem.win_platform? ? 1 : 0
|
17
|
+
|
18
|
+
while dir.length > min_length
|
19
|
+
test_dir = dir.reverse.join('/')
|
17
20
|
match = [
|
18
|
-
File.exists?(File.join(
|
19
|
-
File.exists?(File.join(
|
20
|
-
File.exists?(File.join(
|
21
|
+
File.exists?(File.join(test_dir, 'Hobofile')),
|
22
|
+
File.exists?(File.join(test_dir, 'tools', 'hobo')),
|
23
|
+
File.exists?(File.join(test_dir, 'tools', 'vagrant', 'Vagrantfile'))
|
21
24
|
] - [false]
|
22
25
|
|
23
|
-
return @project_path =
|
26
|
+
return @project_path = test_dir if match.length > 0
|
24
27
|
|
25
|
-
dir
|
28
|
+
dir.pop
|
26
29
|
end
|
27
30
|
return @project_path = nil
|
28
31
|
end
|
data/lib/hobo/ui.rb
CHANGED
@@ -34,6 +34,11 @@ module Hobo
|
|
34
34
|
HighLine.color_scheme
|
35
35
|
end
|
36
36
|
|
37
|
+
def use_color opt = nil
|
38
|
+
HighLine.use_color = opt unless opt.nil?
|
39
|
+
HighLine.use_color?
|
40
|
+
end
|
41
|
+
|
37
42
|
def ask question, opts = {}
|
38
43
|
unless Hobo.ui.interactive
|
39
44
|
raise Hobo::NonInteractive.new(question) if opts[:default].nil?
|
data/lib/hobo/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hobo-inviqa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-02-
|
12
|
+
date: 2014-02-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: slop
|
@@ -281,7 +281,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
281
281
|
version: '0'
|
282
282
|
segments:
|
283
283
|
- 0
|
284
|
-
hash:
|
284
|
+
hash: 3320212073893158574
|
285
285
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
286
286
|
none: false
|
287
287
|
requirements:
|
@@ -290,7 +290,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
290
290
|
version: '0'
|
291
291
|
segments:
|
292
292
|
- 0
|
293
|
-
hash:
|
293
|
+
hash: 3320212073893158574
|
294
294
|
requirements: []
|
295
295
|
rubyforge_project:
|
296
296
|
rubygems_version: 1.8.23
|