hobo-inviqa 0.0.10.pre.rc8 → 0.0.10.pre.rc9

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.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NTUwNDlhNGYxNjkzZDg4MjdhNmJiNDVmYzFiZGE0ODI0MmEwNWU2Mw==
4
+ NTZmMTNkODk0NmUzMmUxMzc3MWVmMmQ2YTJiZjMzNzZmODIxYmI0OQ==
5
5
  data.tar.gz: !binary |-
6
- MTIzMzY1OTlmZTI5ODljOWNiMTgzZGFiZGE3ZGUyZWExNzA2OGMzYg==
6
+ YjcxZTYyNDUyY2NkOWZiN2NiNjUwYTYzMTYyN2QxZDc2YjUxNDAzOA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- OTkwODAwMTE2NDNlNzk0ZjM0NDkzYzkyOTMxYzI2MjJiMDVkM2M2NmRlOGFl
10
- NjkzN2VlODIxZTQ1NWUwYWE4MWNkNjkzYTg2Njc4ZDJiMWQ5MjU0MWJiOWM0
11
- M2Q0YTM4M2RjMzI5OWQ1Y2E0ZWFlMTMzYjRmMjYxMjJhM2FmZTA=
9
+ ODA0YTE0ZDhkNGJjNWE5YzJjZGQ5OGQwNWJmOGY5M2ZhMmIzZmQxY2Q1MWVl
10
+ OGMzYWJhOGM1ZDg0OTFiMzVmZDY2ZWIxZWM3MTVjMWUxYWRjNGFjMjBmODYy
11
+ YzQxMmViZmIxMjM3YTJkMGQwMWJjY2MxOWVkMjFlYzA4ZGYwNjk=
12
12
  data.tar.gz: !binary |-
13
- MDdhMTE2NjNmNmVlMmM0OTk0ZjJhM2YxY2ZjMGUwYjA5M2M2ZmIxNzJjMmIy
14
- N2UyMDJhNzg3NDIyMzY3NzU2NTBmMDdjMDI4ZmQzNDg5YzdhM2JhYzBlZjdj
15
- NGYyM2VkZGRlZWRjMGY1NzNkMzFkOGUzNjNiZGU1ZWU5MWY3MGI=
13
+ OGVmMDZkZDU2MWVhOWI3ZjQwZWQ5MTM1MWM2ZjkyNTcxMDgxYzJjMGIzMzFk
14
+ OGQ4OTVjZWMzOTdiMjAzODVmOGEwZDc5Y2MzYTZjYjVlMzhjMDFmYWU5NTg0
15
+ N2MwYzM3NTE2OTE0MTE4ODZjMTEyYWYwZDgyNGI5NDBkZWEyM2E=
data/Gemfile.lock CHANGED
@@ -1,13 +1,14 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- hobo-inviqa (0.0.10.pre.rc8)
4
+ hobo-inviqa (0.0.10.pre.rc9)
5
5
  aws-sdk (~> 1.34.0)
6
6
  bundler (~> 1.5.2)
7
7
  deepstruct (~> 0.0.5)
8
8
  highline (~> 1.6.20)
9
9
  net-ssh-simple (~> 1.6.3)
10
- os (~> 0.9.6)
10
+ nokogiri (= 1.6.1)
11
+ pry (~> 0.9.12)
11
12
  rake (~> 10.1.1)
12
13
  rake-hooks (~> 1.2.3)
13
14
  ruby-progressbar (~> 1.4.1)
@@ -23,10 +24,12 @@ GEM
23
24
  nokogiri (>= 1.4.4)
24
25
  uuidtools (~> 2.1)
25
26
  blockenspiel (0.4.5)
27
+ coderay (1.1.0)
26
28
  deepstruct (0.0.5)
27
29
  hashie (2.1.0)
28
30
  highline (1.6.21)
29
31
  json (1.8.1)
32
+ method_source (0.8.2)
30
33
  mini_portile (0.5.3)
31
34
  net-scp (1.1.2)
32
35
  net-ssh (>= 2.6.5)
@@ -36,9 +39,12 @@ GEM
36
39
  hashie (>= 1.1.0)
37
40
  net-scp (~> 1.1.0)
38
41
  net-ssh (~> 2.8.0)
39
- nokogiri (1.6.2.rc1)
40
- mini_portile (~> 0.5.2)
41
- os (0.9.6)
42
+ nokogiri (1.6.1)
43
+ mini_portile (~> 0.5.0)
44
+ pry (0.9.12.6)
45
+ coderay (~> 1.0)
46
+ method_source (~> 0.8)
47
+ slop (~> 3.4)
42
48
  rake (10.1.1)
43
49
  rake-hooks (1.2.3)
44
50
  rake
data/bin/hobo CHANGED
@@ -5,8 +5,6 @@ $:.push File.expand_path(File.join("..", "..", "lib"), __FILE__)
5
5
 
6
6
  # Hack to override Gemfile to that of hobo (otherwise it'll use project specific one!)
7
7
  ENV['BUNDLE_GEMFILE'] = File.expand_path('../../Gemfile', __FILE__)
8
-
9
- # Ensure hobo gems are used
10
8
  require 'hobo/patches/rubygems'
11
9
  require 'bundler'
12
10
  Bundler.setup(:default)
@@ -14,17 +12,19 @@ Bundler.setup(:default)
14
12
  # Suppress Net/SSH/Simple warning on windows
15
13
  $SUPPRESS_32BIT_WARNING=1
16
14
 
17
- require 'hobo'
18
-
19
15
  $HOBO_ARGV = ARGV
20
16
 
21
- error_handler = Hobo::ErrorHandlers::Friendly.new
17
+ require 'hobo'
22
18
 
19
+ # Default main classes
20
+ error_handler = Hobo::ErrorHandlers::Friendly.new
23
21
  Hobo.ui = Hobo::Ui.new
24
22
  Hobo.logger = Logger.new(STDOUT)
25
23
  Hobo.logger.level = Logger::WARN
26
24
 
27
- # Options parsed here will be hidden from the main app
25
+ # Low level / early arg parsing
26
+ # Anything that can alter ui / logger / cli should be here
27
+ # Early termination args should also go here
28
28
  slop = Slop.parse! do
29
29
  on '--debug', 'Enable debugging' do
30
30
  require 'teerb'
@@ -55,7 +55,7 @@ opts = slop.to_hash
55
55
  Hobo.ui.interactive = !(opts[:'non-interactive'] == true)
56
56
 
57
57
  begin
58
- Hobo::Lib::HostCheck.check(:filter => /not_using_system_ruby/)
58
+ Hobo::Lib::HostCheck.check(:filter => /not_using_system_ruby/, :raise => true)
59
59
  Hobo.cli = Hobo::Cli.new(slop: slop)
60
60
  Hobo.cli.start
61
61
  rescue Exception => error
data/hobo.gemspec CHANGED
@@ -28,8 +28,9 @@ Gem::Specification.new do |spec|
28
28
  spec.add_dependency "aws-sdk", "~> 1.34.0"
29
29
  spec.add_dependency "ruby-progressbar", "~> 1.4.1"
30
30
  spec.add_dependency "teerb", "~> 0.0.1"
31
- spec.add_dependency "os", "~> 0.9.6"
32
31
  spec.add_dependency "net-ssh-simple", "~> 1.6.3"
32
+ spec.add_dependency "pry", "~> 0.9.12"
33
+ spec.add_dependency "nokogiri", "= 1.6.1"
33
34
 
34
35
  if ENV['HOBO_ENV'] == 'dev'
35
36
  spec.add_development_dependency "aruba", "~> 0.5.4"
@@ -1,6 +1,19 @@
1
1
  module Hobo
2
2
  class << self
3
3
  attr_accessor :asset_applicators
4
+
5
+ # Utility method to access (with initialization) the asset applicator registry.
6
+ # This allows you to register new asset applicator methods on a per-project basis.
7
+ # For example:
8
+ #
9
+ # Hobo.asset_applicators.register /.*\.zip/ do |file|
10
+ # Dir.chdir File.dirname(file) do
11
+ # shell "unzip", file
12
+ # end
13
+ # end
14
+ #
15
+ # @see Hobo::AssetApplicatorRegistry
16
+ # @return [Hobo::AssetApplicatorRegistry] Applicator registry cotnainer
4
17
  def asset_applicators
5
18
  @asset_applicators ||= AssetApplicatorRegistry.new
6
19
  end
@@ -8,9 +21,13 @@ module Hobo
8
21
 
9
22
  private
10
23
 
24
+ # Thin wrapper over a hash to provide a means to "register" asset applicators
11
25
  class AssetApplicatorRegistry < Hash
26
+ # Register a new asset applicator
27
+ # @param [Regexp] Pattern to match against asset filename.
28
+ # @yield The block to be executed when an asset matches the pattern.
12
29
  def register pattern, &block
13
30
  self[pattern] = block
14
31
  end
15
32
  end
16
- end
33
+ end
data/lib/hobo/cli.rb CHANGED
@@ -4,14 +4,23 @@ module Hobo
4
4
  attr_accessor :cli
5
5
  end
6
6
 
7
+ # Utility error to shortcut exit routine within actions
7
8
  class Halt < Error
8
9
  end
9
10
 
11
+ # Main application class
10
12
  class Cli
11
13
  include Hobo::Logging
12
14
 
13
15
  attr_accessor :slop, :help_formatter
14
16
 
17
+ # @param [Hash] Initialization accepts several options in a hash:
18
+ # - :slop - Slop instance
19
+ # - :help - Help formatter instance
20
+ # - :host_check - Host check invocation class
21
+ #
22
+ # :help and :host_check are only used by tests.
23
+ # :slop is used to ensure low-level args parsed in bin/hobo are propagated to the application
15
24
  def initialize opts = {}
16
25
  @opts = opts
17
26
  @slop = opts[:slop] || Slop.new
@@ -20,6 +29,8 @@ module Hobo
20
29
  @host_check = opts[:host_check] || Hobo::Lib::HostCheck
21
30
  end
22
31
 
32
+ # entry point for application
33
+ # @param [Array] Arguments from ARGV. Defaults to ARGV
23
34
  def start args = ARGV
24
35
  load_user_config
25
36
  load_builtin_tasks
@@ -58,6 +69,9 @@ module Hobo
58
69
  return 0
59
70
  end
60
71
 
72
+ # Displat help and exit
73
+ # @param [Hash] Options to apss to help formatter.
74
+ # Options are mostly used for filtering
61
75
  def show_help(opts = {})
62
76
  Hobo.ui.info @help_formatter.help(@help_opts.merge(opts))
63
77
  halt
@@ -123,6 +137,13 @@ module Hobo
123
137
  raise Halt.new
124
138
  end
125
139
 
140
+ # Takes a nested hash of commands and creates nested Slop instances populated with metadata.
141
+ #
142
+ # @param [Hash] A nested hash of namespaces & commands.
143
+ # @param [Slop] A slop instance on which to define tasks.
144
+ # @param [Array] Stack of string names of parental namespaces.
145
+ # @param [Hash] Hash of "namespace:command" => Slop instances.
146
+ # @return [Hash] Hash of "namespace:command" => Slop instances.
126
147
  def define_tasks structured_list, scope, stack = [], map = {}
127
148
  structured_list.each do |k, v|
128
149
  name = (stack + [k]).join(':')
@@ -189,7 +210,6 @@ module Hobo
189
210
  end
190
211
 
191
212
  run do |opts, args|
192
- puts "RUN!"
193
213
  Dir.chdir Hobo.project_path if Hobo.in_project?
194
214
  raise ::Hobo::ProjectOnlyError.new if opts.project_only && !Hobo.in_project?
195
215
  task.opts = opts.to_hash.merge({:_unparsed => hobo.slop.unparsed})
@@ -205,6 +225,7 @@ module Hobo
205
225
  end
206
226
 
207
227
  # Expand flat task list in to hierarchy (non-recursive)
228
+ # @param [Array] List of strings with entries of the form "namespace1:namespace2:task"
208
229
  def structure_tasks list
209
230
  out = {}
210
231
  list.each do |name|
@@ -2,6 +2,12 @@ desc "Internal hobo debugging tools"
2
2
  hidden true
3
3
  namespace 'self' do
4
4
 
5
+ desc "REPL"
6
+ task :repl do
7
+ require 'pry'
8
+ binding.pry
9
+ end
10
+
5
11
  desc "Tasks for debugging hobo"
6
12
  namespace 'debug' do
7
13
  desc "Display project paths"
data/lib/hobo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Hobo
2
- VERSION = '0.0.10-rc8'
2
+ VERSION = '0.0.10-rc9'
3
3
  end
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.10.pre.rc8
4
+ version: 0.0.10.pre.rc9
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-04-07 00:00:00.000000000 Z
11
+ date: 2014-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: slop
@@ -151,33 +151,47 @@ dependencies:
151
151
  - !ruby/object:Gem::Version
152
152
  version: 0.0.1
153
153
  - !ruby/object:Gem::Dependency
154
- name: os
154
+ name: net-ssh-simple
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
157
  - - ~>
158
158
  - !ruby/object:Gem::Version
159
- version: 0.9.6
159
+ version: 1.6.3
160
160
  type: :runtime
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - ~>
165
165
  - !ruby/object:Gem::Version
166
- version: 0.9.6
166
+ version: 1.6.3
167
167
  - !ruby/object:Gem::Dependency
168
- name: net-ssh-simple
168
+ name: pry
169
169
  requirement: !ruby/object:Gem::Requirement
170
170
  requirements:
171
171
  - - ~>
172
172
  - !ruby/object:Gem::Version
173
- version: 1.6.3
173
+ version: 0.9.12
174
174
  type: :runtime
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
178
  - - ~>
179
179
  - !ruby/object:Gem::Version
180
- version: 1.6.3
180
+ version: 0.9.12
181
+ - !ruby/object:Gem::Dependency
182
+ name: nokogiri
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - '='
186
+ - !ruby/object:Gem::Version
187
+ version: 1.6.1
188
+ type: :runtime
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - '='
193
+ - !ruby/object:Gem::Version
194
+ version: 1.6.1
181
195
  description: Inviqan toolbelt
182
196
  email:
183
197
  - msimons@inviqa.com