batali 0.1.22 → 0.2.0

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,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dbea03b20a8f3a778cf33c5419052e6287d03fa6
4
- data.tar.gz: 31cb700a57303625a7b153d7cd337d697ddbcaff
3
+ metadata.gz: 848af492e8e0f263b8d8577dd3830ce985a2de5f
4
+ data.tar.gz: f3484364c7e5e2f9f83f1f93dd99b70a0490dfd3
5
5
  SHA512:
6
- metadata.gz: 8cb20016cc7b46f91cc629020b50e5661c16ad0c81ebdb56beeb64d9bbef012973937e9bb8844197278a819b75a52072cc38db4f96f831bea0a12b79bbbc1ded
7
- data.tar.gz: 78b4188b71cbeaaccf38a244ecc2c31ec134485aca8974bbf527d15f747c15a96da8a02a31adaba58fd07a427f53207edc0eb1b15432ed4beffaf6f1c9230ecf
6
+ metadata.gz: 22ee3396473217e237facd53e3e0e07357fd6afc5595bb814c944484015aea4ec6724b28cf23b92832628fc3c8d77459f5fffaf365c504b065ab14359149bb1f
7
+ data.tar.gz: 4d3eae0ae14d20cca5cdbbc1574401146c236a8e04d4b5862e5ff72248d71119d08b062ead31c64dfbb722d245b034179c2f2281c749c727d209ed58777c496b
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # v0.2.0
2
+ * Add proxy support (#18)
3
+ * Transition to "beta" state
4
+
1
5
  # v0.1.22
2
6
  * Add support for `metadata` keyword in Batali file
3
7
  * Extract install path from merged config instead of only namespaced opts
data/README.md CHANGED
@@ -1,9 +1,13 @@
1
1
  # Batali
2
2
 
3
- Batali is a light weight cookbook resolver. It is currently
4
- in an alpha state and should not be used with anything you
5
- care about or love. There is a high chance it will burn it
6
- all to the ground, and laugh.
3
+ Batali is a light weight cookbook resolver. It is now in
4
+ a beta state, moving quickly towards a proper stable release.
5
+
6
+ ## What is Batali?
7
+
8
+ Batali is a cookbook resolver. It's built to be light weight
9
+ but feature rich. Batali helps to manage your cookbooks and
10
+ stay out of your way.
7
11
 
8
12
  ## Usage
9
13
 
@@ -27,6 +31,10 @@ by default.
27
31
 
28
32
  _IT WILL DESTROY YOUR COOKBOOKS DIRECTORY BY DEFAULT_
29
33
 
34
+ You can make it not destroy your cookbooks directory by providing
35
+ a different path. A better idea is to not use the cookbooks directory.
36
+ Just ignore that sucker and let Batali do its thing.
37
+
30
38
  ## Commands
31
39
 
32
40
  * `batali resolve` - Resolve dependencies and produce `batali.manifest`
data/batali.gemspec CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
13
13
  s.add_runtime_dependency 'attribute_struct', '~> 0.2.14'
14
14
  s.add_runtime_dependency 'grimoire', '~> 0.2.0'
15
15
  s.add_runtime_dependency 'bogo', '~> 0.1.18'
16
- s.add_runtime_dependency 'bogo-cli', '~> 0.1.8'
16
+ s.add_runtime_dependency 'bogo-cli', '~> 0.1.12'
17
17
  s.add_runtime_dependency 'bogo-config', '~> 0.1.10'
18
18
  s.add_runtime_dependency 'bogo-ui', '~> 0.1.6'
19
19
  s.add_runtime_dependency 'git'
@@ -22,7 +22,7 @@ module Batali
22
22
  def batali_file
23
23
  memoize(:batali_file) do
24
24
  # TODO: Add directory traverse searching
25
- path = opts.fetch(:file, File.join(Dir.pwd, 'Batali'))
25
+ path = config.fetch(:file, File.join(Dir.pwd, 'Batali'))
26
26
  ui.verbose "Loading Batali file from: #{path}"
27
27
  BFile.new(path)
28
28
  end
@@ -33,7 +33,7 @@ module Batali
33
33
  memoize(:manifest) do
34
34
  path = File.join(
35
35
  File.dirname(
36
- opts.fetch(:file, File.join(Dir.pwd, 'batali.manifest'))
36
+ config.fetch(:file, File.join(Dir.pwd, 'batali.manifest'))
37
37
  ), 'batali.manifest'
38
38
  )
39
39
  ui.verbose "Loading manifest file from: #{path}"
@@ -44,7 +44,7 @@ module Batali
44
44
  # @return [String] path to local cache
45
45
  def cache_directory(*args)
46
46
  memoize(['cache_directory', *args].join('_')) do
47
- directory = opts.fetch(:cache_directory, '/tmp/batali-cache')
47
+ directory = config.fetch(:cache_directory, '/tmp/batali-cache')
48
48
  ui.debug "Cache directory to persist cookbooks: #{directory}"
49
49
  unless(args.empty?)
50
50
  directory = File.join(directory, *args.map(&:to_s))
@@ -59,7 +59,7 @@ module Batali
59
59
  # @param action [String] action to be performed
60
60
  # @yield block to execute
61
61
  def dry_run(action)
62
- if(opts[:dry_run])
62
+ if(config[:dry_run])
63
63
  ui.warn "Dry run disabled: #{action}"
64
64
  else
65
65
  yield
data/lib/batali/monkey.rb CHANGED
@@ -16,3 +16,25 @@ module Batali
16
16
  end
17
17
  end
18
18
  end
19
+
20
+ require 'resolv'
21
+ require 'http'
22
+ require 'http/request'
23
+
24
+ class HTTP::Request
25
+
26
+ def proxy
27
+ if(_proxy_point = ENV["#{uri.scheme}_proxy"])
28
+ _proxy = URI.parse(_proxy_point)
29
+ Hash.new.tap do |opts|
30
+ opts[:proxy_address] = _proxy.host
31
+ opts[:proxy_port] = _proxy.port
32
+ opts[:proxy_username] = _proxy.user if _proxy.user
33
+ opts[:proxy_password] = _proxy.password if _proxy.password
34
+ end
35
+ else
36
+ @proxy
37
+ end
38
+ end
39
+
40
+ end
@@ -18,7 +18,7 @@ module Batali
18
18
  # @param unit [Unit] unit to score
19
19
  # @param idx [Integer] current index location
20
20
  # @return [Numeric, NilClass]
21
- def score_for(unit, idx)
21
+ def score_for(unit, idx=0)
22
22
  multiplier = 1
23
23
  manifest_unit = manifest.cookbook.detect do |m_unit|
24
24
  m_unit.name == unit.name
@@ -1,4 +1,4 @@
1
1
  module Batali
2
2
  # Current version
3
- VERSION = Gem::Version.new('0.1.22')
3
+ VERSION = Gem::Version.new('0.2.0')
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: batali
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.22
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Roberts
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-30 00:00:00.000000000 Z
11
+ date: 2015-04-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: attribute_struct
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 0.1.8
61
+ version: 0.1.12
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 0.1.8
68
+ version: 0.1.12
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: bogo-config
71
71
  requirement: !ruby/object:Gem::Requirement