bake 0.15.2 → 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 47bcbd5bbd0350ae6032bbf639684489b8a28ce5e41956a8a4f2f979c7ac4f3b
4
- data.tar.gz: afe8e3084738e450520d2bc82c2ae122be8503b14014f0ad6ed94f72ee70f88f
3
+ metadata.gz: 10135085caa64994c79251726699d674223c0e4441d937cc548f56893b8ba331
4
+ data.tar.gz: ca1a86f96716c5a7e1827b49b3eefd06164295f0ab5621b007d5bd727bbba76a
5
5
  SHA512:
6
- metadata.gz: 5ed9a70c290a1757433b1d8db2cb78103d7790192b2149a4ce89948c66123d9ae35726b3f05665968c71434ab879c15eafd29eb3e77559b4b444a768a586d64b
7
- data.tar.gz: fbf2ad74fa227ce1c5be308f0f7c35f8198cae0414f8ca3092eb813de129a31c7c613297af50a65a7676af0d66cefd483249b032bcc6086cf71589301e063694
6
+ metadata.gz: d3db37001328e050c50adb89d6d2cd7e0cdef54f3b54ae2225d676b05e7ff735be19ba2056912e571ce5185f7a7336e334809b66c5312da1e0dbd798b4d87b3a
7
+ data.tar.gz: feb7ea189a4841a2b08ab43aa4a683ada9b19bb5fe8a189ba888b945bc8e1c85501e564030b883cf28eb24d9348e1fdbbf93a605ea1111245f29e4bb5469109d
checksums.yaml.gz.sig ADDED
Binary file
@@ -54,7 +54,7 @@ module Bake
54
54
  break
55
55
  end
56
56
 
57
- name = name.to_sym
57
+ name = normalize(name)
58
58
 
59
59
  # Extract the trailing arguments:
60
60
  @options[name] = extract_arguments(name, arguments)
@@ -82,6 +82,10 @@ module Bake
82
82
 
83
83
  private
84
84
 
85
+ def normalize(name)
86
+ name.tr('-', '_').to_sym
87
+ end
88
+
85
89
  def delimiter_index(arguments)
86
90
  arguments.index{|argument| argument =~ /\A(--|;\z)/}
87
91
  end
data/lib/bake/base.rb CHANGED
@@ -95,5 +95,9 @@ module Bake
95
95
  def recipe_for(name)
96
96
  Recipe.new(self, name)
97
97
  end
98
+
99
+ def to_s
100
+ "\#<#{self.class}>"
101
+ end
98
102
  end
99
103
  end
@@ -32,16 +32,37 @@ module Bake
32
32
  class Call < Samovar::Command
33
33
  self.description = "Execute one or more commands."
34
34
 
35
+ OUTPUT = {
36
+ json: ->(value){require 'json'; $stdout.puts(JSON.pretty_generate(value))},
37
+ pp: ->(value){require 'pp'; PP.pp(value, $stdout)},
38
+ raw: ->(value){$stdout.puts(value)},
39
+ yaml: ->(value){require 'yaml'; $stdout.puts(YAML.dump(value))},
40
+ }
41
+
42
+ options do
43
+ option "-o/--output <format>", "Output the result of the last task in the given format: #{OUTPUT.keys.join(", ")}.", type: Symbol
44
+ end
45
+
35
46
  def bakefile
36
47
  @parent.bakefile
37
48
  end
38
49
 
39
50
  many :commands, "The commands & arguments to invoke.", default: ["default"], stop: false
40
51
 
52
+ def format(output, value)
53
+ if formatter = OUTPUT[output]
54
+ formatter.call(value)
55
+ end
56
+ end
57
+
41
58
  def call
42
59
  context = @parent.context
43
60
 
44
- context.call(*@commands)
61
+ last_result = context.call(*@commands)
62
+
63
+ if output = @options[:output]
64
+ format(output, last_result)
65
+ end
45
66
  end
46
67
  end
47
68
  end
@@ -35,6 +35,10 @@ module Bake
35
35
  options do
36
36
  option '-h/--help', 'Show help.'
37
37
  option '-b/--bakefile <path>', 'Override the path to the bakefile to use.'
38
+
39
+ option '-g/--gem <name>', 'Load the specified gem, e.g. "bake ~> 1.0".' do |value|
40
+ gem(*value.split(/\s+/))
41
+ end
38
42
  end
39
43
 
40
44
  nested :command, {
data/lib/bake/context.rb CHANGED
@@ -170,7 +170,7 @@ module Bake
170
170
  end
171
171
  end
172
172
 
173
- # @parameter path [Array<String>] the path for the scope.
173
+ # @parameter path [Array(String)] the path for the scope.
174
174
  def base_for(path)
175
175
  base = nil
176
176
 
data/lib/bake/loaders.rb CHANGED
@@ -97,7 +97,7 @@ module Bake
97
97
 
98
98
  # Enumerate all loaded gems and add them.
99
99
  def append_from_gems
100
- Gem.loaded_specs.each do |name, spec|
100
+ ::Gem.loaded_specs.each do |name, spec|
101
101
  Console.logger.debug(self) {"Checking gem #{name}: #{spec.full_gem_path}..."}
102
102
 
103
103
  if path = spec.full_gem_path and File.directory?(path)
data/lib/bake/version.rb CHANGED
@@ -21,5 +21,5 @@
21
21
  # THE SOFTWARE.
22
22
 
23
23
  module Bake
24
- VERSION = "0.15.2"
24
+ VERSION = "0.17.0"
25
25
  end
data.tar.gz.sig ADDED
@@ -0,0 +1,2 @@
1
+ �h��Y�|
2
+ �E��b���0g[.�|���v�k����O �i�R�໣S[�j�8N�U#e!�e��Fi��gR��>�꫺xډ�q$��}z����T/�yR�[o"�|n+r��.;�G��e��E7���-@C�CJl�)׏h��$~�f�q I��I[e �Y�/�I��GLa�<�-�H�������fy�F�Ґ$Ҫ��4�5��h G�j����W݄��w�FA�b �o�F,4%#L���z�:�7�,� �M��D�ka�4<g4K��#Z�Z���o�S"S�2v���.^�)�%��M�w��s#�\�Wu��[��N���q )A�z�fo�6�i��u�����S �f����Y)E�,�N�^�5�H��G
metadata CHANGED
@@ -1,14 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bake
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.2
4
+ version: 0.17.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
+ - Olle Jonsson
8
9
  autorequire:
9
10
  bindir: bin
10
- cert_chain: []
11
- date: 2021-06-04 00:00:00.000000000 Z
11
+ cert_chain:
12
+ - |
13
+ -----BEGIN CERTIFICATE-----
14
+ MIIEhDCCAuygAwIBAgIBATANBgkqhkiG9w0BAQsFADA3MTUwMwYDVQQDDCxzYW11
15
+ ZWwud2lsbGlhbXMvREM9b3Jpb250cmFuc2Zlci9EQz1jby9EQz1uejAeFw0yMTA4
16
+ MTYwNjMzNDRaFw0yMjA4MTYwNjMzNDRaMDcxNTAzBgNVBAMMLHNhbXVlbC53aWxs
17
+ aWFtcy9EQz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R4J7ozmGLh4o4uJp7w
33
+ x9KCFaR8Lvn/r0oJWJOqb/DMAYI83YeN2Dlt3jpwrsmsONrtC5S3gOUle5afSGos
34
+ bYt5ocnEpKSomR9ZtnCGljds/aeO1Xgpn2r9HHcjwnH346iNrnHmMlC7BtHUFPDg
35
+ Ts92S47PTOXzwPBDsrFiq3VLbRjHSwf8rpqybQBH9MfzxGGxTaETQYOd6b4e4Ag6
36
+ y92abGna0bmIEb4+Tx9rQ10Uijh1POzvr/VTH4bbIPy9FbKrRsIQ24qDbNJRtOpE
37
+ RAOsIl+HOBTb252nx1kIRN5hqQx272AJCbCjKx8egcUQKffFVVCI0nye09v5CK+a
38
+ HiLJ8VOFx6w=
39
+ -----END CERTIFICATE-----
40
+ date: 2022-05-21 00:00:00.000000000 Z
12
41
  dependencies:
13
42
  - !ruby/object:Gem::Dependency
14
43
  name: samovar
@@ -122,7 +151,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
122
151
  - !ruby/object:Gem::Version
123
152
  version: '0'
124
153
  requirements: []
125
- rubygems_version: 3.1.2
154
+ rubygems_version: 3.1.6
126
155
  signing_key:
127
156
  specification_version: 4
128
157
  summary: A replacement for rake with a simpler syntax.
metadata.gz.sig ADDED
Binary file