bosh_common 1.2657.0 → 1.2669.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
  SHA1:
3
- metadata.gz: 5a3c39c9f9e9c33e3ea9f197cc133bd4f3bffaa7
4
- data.tar.gz: cf4d3cbe3dc7f0bd1ca2c1a2c4b764d99fd3e0ef
3
+ metadata.gz: ce51b12ff3c1446b5d40f082e653ffc44abf1ce9
4
+ data.tar.gz: 0d3da12c5fcd10cab6ade40ff8c2fd1db4a6c813
5
5
  SHA512:
6
- metadata.gz: bf6d0d9ff9e45d2232efcabe36deaba45bea13f01ed7991d13a2761020ea6fed3ec6227b1c12ffe7ab24c00de912ebd036645cff84f4f084bed2532888a2f33b
7
- data.tar.gz: c1acb99e04e37dab84b431836a34e4fb8431c094e50819fd5a9716a2c7376293c68a4417b4b6aa263c6070837c3dfd09ac938c448d706c889d624768de7381b2
6
+ metadata.gz: 4890f1bbf755437dd9726a8766fda584a8e2691da9b25ddf059edce6ca31077f717b39e86053ab2701be32e33d922252d7d975856c15068b8454453155334941
7
+ data.tar.gz: b4954e3b63b2db1ec10676b4b08f85833b8e724d1f45c198d7d9fe007b59204181d5995e4ef4876268ca1be9dc67021b59a4543742f1deae9df62a771470e18a
@@ -1,5 +1,5 @@
1
1
  module Bosh
2
2
  module Common
3
- VERSION = '1.2657.0'
3
+ VERSION = '1.2669.0'
4
4
  end
5
5
  end
@@ -1,22 +1,24 @@
1
1
  require 'common/version/semi_semantic_version'
2
2
 
3
- module Bosh::Common::Version
4
- class BoshVersion < SemiSemanticVersion
3
+ module Bosh::Common
4
+ module Version
5
+ class BoshVersion < SemiSemanticVersion
5
6
 
6
- def self.parse(version)
7
- raise ArgumentError, 'Invalid Version: nil' if version.nil?
8
- version = version.to_s
7
+ def self.parse(version)
8
+ raise ArgumentError, 'Invalid Version: nil' if version.nil?
9
+ version = version.to_s
9
10
 
10
- #discard anything after a space, including the space, to support compound bosh versions
11
- version = version.split(' ', 2)[0] if version =~ / /
11
+ #discard anything after a space, including the space, to support compound bosh versions
12
+ version = version.split(' ', 2)[0] if version =~ / /
12
13
 
13
- self.new(SemiSemantic::Version.parse(version))
14
- end
14
+ self.new(SemiSemantic::Version.parse(version))
15
+ end
15
16
 
16
- private
17
+ private
17
18
 
18
- def default_post_release_segment
19
- raise NotImplementedError, 'Bosh post-release versions unsupported'
19
+ def default_post_release_segment
20
+ raise NotImplementedError, 'Bosh post-release versions unsupported'
21
+ end
20
22
  end
21
23
  end
22
24
  end
@@ -1,35 +1,37 @@
1
1
  require 'common/version/semi_semantic_version'
2
2
 
3
- module Bosh::Common::Version
4
- class ReleaseVersion < SemiSemanticVersion
3
+ module Bosh::Common
4
+ module Version
5
+ class ReleaseVersion < SemiSemanticVersion
5
6
 
6
- DEFAULT_POST_RELEASE_SEGMENT = SemiSemantic::VersionSegment.parse('dev.1')
7
+ DEFAULT_POST_RELEASE_SEGMENT = SemiSemantic::VersionSegment.parse('dev.1')
7
8
 
8
- def self.parse(version)
9
- raise ArgumentError, 'Invalid Version: nil' if version.nil?
10
- version = version.to_s
9
+ def self.parse(version)
10
+ raise ArgumentError, 'Invalid Version: nil' if version.nil?
11
+ version = version.to_s
11
12
 
12
- #convert old-style dev version suffix to new dev post-release segment
13
- matches = /\A(?<release>.*)(\.(?<dev>[0-9]+)-dev)\z/.match(version)
14
- unless matches.nil?
15
- version = matches[:release] + "+dev." + matches[:dev]
16
- end
13
+ #convert old-style dev version suffix to new dev post-release segment
14
+ matches = /\A(?<release>.*)(\.(?<dev>[0-9]+)-dev)\z/.match(version)
15
+ unless matches.nil?
16
+ version = matches[:release] + "+dev." + matches[:dev]
17
+ end
17
18
 
18
- self.new(SemiSemantic::Version.parse(version))
19
- end
19
+ self.new(SemiSemantic::Version.parse(version))
20
+ end
20
21
 
21
- def to_old_format
22
- matches = /\A(?<release>.*)(\+dev\.(?<dev>[0-9]+))\z/.match(to_s)
23
- if matches.nil?
24
- return nil
22
+ def to_old_format
23
+ matches = /\A(?<release>.*)(\+dev\.(?<dev>[0-9]+))\z/.match(to_s)
24
+ if matches.nil?
25
+ return nil
26
+ end
27
+ matches[:release] + '.' + matches[:dev] + "-dev"
25
28
  end
26
- matches[:release] + '.' + matches[:dev] + "-dev"
27
- end
28
29
 
29
- private
30
+ private
30
31
 
31
- def default_post_release_segment
32
- DEFAULT_POST_RELEASE_SEGMENT
32
+ def default_post_release_segment
33
+ DEFAULT_POST_RELEASE_SEGMENT
34
+ end
33
35
  end
34
36
  end
35
37
  end
@@ -1,33 +1,35 @@
1
1
  require 'semi_semantic/version'
2
2
  require 'common/version/release_version'
3
+ require 'common/version/version_list'
3
4
 
4
- module Bosh::Common::Version
5
- class ReleaseVersionList < VersionList
5
+ module Bosh::Common
6
+ module Version
7
+ class ReleaseVersionList < VersionList
6
8
 
7
- # @param [Array<#version>] Collection of version strings
8
- # @param [class] Version type to parse as (ex: SemiSemantic::Version, ReleaseVersion, StemcellVersion, BoshVersion)
9
- def self.parse(versions)
10
- self.new(VersionList.parse(versions, ReleaseVersion))
11
- end
9
+ # @param [Array<#version>] Collection of version strings
10
+ def self.parse(versions)
11
+ self.new(VersionList.parse(versions, ReleaseVersion).versions)
12
+ end
12
13
 
13
- # @param [#version] ReleaseVersion from which to rebase the post-release segment
14
- def rebase(version)
15
- raise TypeError, "Failed to Rebase - Invalid Version Type: #{version.class}" unless version.is_a?(ReleaseVersion)
14
+ # @param [#version] ReleaseVersion from which to rebase the post-release segment
15
+ def rebase(version)
16
+ raise TypeError, "Failed to Rebase - Invalid Version Type: #{version.class}" unless version.is_a?(ReleaseVersion)
16
17
 
17
- # Can only rebase versions with a post-release segment
18
- if version.version.post_release.nil?
19
- raise ArgumentError, "Failed to Rebase - Invalid Version: #{version.inspect}"
20
- end
18
+ # Can only rebase versions with a post-release segment
19
+ if version.version.post_release.nil?
20
+ raise ArgumentError, "Failed to Rebase - Invalid Version: #{version.inspect}"
21
+ end
21
22
 
22
- latest = latest_with_pre_release(version)
23
- if latest
24
- if latest.version.post_release.nil?
25
- latest.default_post_release
23
+ latest = latest_with_pre_release(version)
24
+ if latest
25
+ if latest.version.post_release.nil?
26
+ latest.default_post_release
27
+ else
28
+ latest.increment_post_release
29
+ end
26
30
  else
27
- latest.increment_post_release
31
+ version.default_post_release
28
32
  end
29
- else
30
- version.default_post_release
31
33
  end
32
34
  end
33
35
  end
@@ -1,62 +1,59 @@
1
1
  require 'semi_semantic/version'
2
- require 'common/version/version_list'
3
2
 
4
- module Bosh::Common::Version
5
- class UnavailableMethodError < StandardError; end
3
+ module Bosh::Common
4
+ module Version
5
+ class UnavailableMethodError < StandardError; end
6
6
 
7
- class SemiSemanticVersion
8
- include Comparable
7
+ class SemiSemanticVersion
8
+ include Comparable
9
9
 
10
- DEFAULT_POST_RELEASE_SEGMENT = SemiSemantic::VersionSegment.parse('build.1')
10
+ DEFAULT_POST_RELEASE_SEGMENT = SemiSemantic::VersionSegment.parse('build.1')
11
11
 
12
- attr_reader :version
12
+ attr_reader :version
13
13
 
14
- def self.parse(version)
15
- raise ArgumentError, 'Invalid Version: nil' if version.nil?
16
- version = version.to_s
14
+ def self.parse(version)
15
+ raise ArgumentError, 'Invalid Version: nil' if version.nil?
16
+ version = version.to_s
17
17
 
18
- self.new(SemiSemantic::Version.parse(version))
19
- end
18
+ self.new(SemiSemantic::Version.parse(version))
19
+ end
20
20
 
21
- def self.parse_list(versions)
22
- VersionList.parse(versions, self)
23
- end
21
+ def self.parse_and_compare(a, b)
22
+ self.parse(a) <=> self.parse(b)
23
+ end
24
24
 
25
- def self.parse_and_compare(a, b)
26
- self.parse(a) <=> self.parse(b)
27
- end
28
-
29
- def initialize(version)
30
- raise ArgumentError, "Invalid Version Type: #{version.class}" unless version.is_a?(SemiSemantic::Version)
31
- @version = version
32
- @version.freeze
33
- end
25
+ def initialize(version)
26
+ raise ArgumentError, "Invalid Version Type: #{version.class}" unless version.is_a?(SemiSemantic::Version)
27
+ @version = version
28
+ @version.freeze
29
+ end
34
30
 
35
- def default_post_release
36
- self.class.new(SemiSemantic::Version.new(@version.release, @version.pre_release, default_post_release_segment))
37
- end
31
+ def default_post_release
32
+ self.class.new(SemiSemantic::Version.new(@version.release, @version.pre_release, default_post_release_segment))
33
+ end
38
34
 
39
- def increment_post_release
40
- raise UnavailableMethodError, 'Failed to increment: post-release is nil' if @version.post_release.nil?
41
- self.class.new(SemiSemantic::Version.new(@version.release, @version.pre_release, @version.post_release.increment))
42
- end
35
+ def increment_post_release
36
+ raise UnavailableMethodError, 'Failed to increment: post-release is nil' if @version.post_release.nil?
37
+ self.class.new(SemiSemantic::Version.new(@version.release, @version.pre_release, @version.post_release.increment))
38
+ end
43
39
 
44
- def increment_release
45
- self.class.new(SemiSemantic::Version.new(@version.release.increment))
46
- end
40
+ def increment_release
41
+ self.class.new(SemiSemantic::Version.new(@version.release.increment))
42
+ end
47
43
 
48
- def <=>(other)
49
- @version <=> other.version
50
- end
44
+ def <=>(other)
45
+ @version <=> other.version
46
+ end
51
47
 
52
- def to_s
53
- @version.to_s
54
- end
48
+ def to_s
49
+ @version.to_s
50
+ end
55
51
 
56
- private
52
+ private
57
53
 
58
- def default_post_release_segment
59
- DEFAULT_POST_RELEASE_SEGMENT
54
+ def default_post_release_segment
55
+ DEFAULT_POST_RELEASE_SEGMENT
56
+ end
60
57
  end
61
58
  end
62
59
  end
@@ -1,22 +1,24 @@
1
1
  require 'common/version/semi_semantic_version'
2
2
 
3
- module Bosh::Common::Version
4
- class StemcellVersion < SemiSemanticVersion
3
+ module Bosh::Common
4
+ module Version
5
+ class StemcellVersion < SemiSemanticVersion
5
6
 
6
- def self.parse(version)
7
- raise ArgumentError, 'Invalid Version: nil' if version.nil?
8
- version = version.to_s
7
+ def self.parse(version)
8
+ raise ArgumentError, 'Invalid Version: nil' if version.nil?
9
+ version = version.to_s
9
10
 
10
- #replace underscores with periods to maintain reverse compatibility with stemcell versions
11
- version = version.gsub('_', '.')
11
+ #replace underscores with periods to maintain reverse compatibility with stemcell versions
12
+ version = version.gsub('_', '.')
12
13
 
13
- self.new(SemiSemantic::Version.parse(version))
14
- end
14
+ self.new(SemiSemantic::Version.parse(version))
15
+ end
15
16
 
16
- private
17
+ private
17
18
 
18
- def default_post_release_segment
19
- raise NotImplementedError, 'Stemcell post-release versions unsupported'
19
+ def default_post_release_segment
20
+ raise NotImplementedError, 'Stemcell post-release versions unsupported'
21
+ end
20
22
  end
21
23
  end
22
24
  end
@@ -0,0 +1,15 @@
1
+ require 'semi_semantic/version'
2
+ require 'common/version/stemcell_version'
3
+ require 'common/version/version_list'
4
+
5
+ module Bosh::Common
6
+ module Version
7
+ class StemcellVersionList < VersionList
8
+
9
+ # @param [Array<#version>] Collection of version strings
10
+ def self.parse(versions)
11
+ self.new(VersionList.parse(versions, StemcellVersion).versions)
12
+ end
13
+ end
14
+ end
15
+ end
@@ -1,45 +1,56 @@
1
1
  require 'semi_semantic/version'
2
2
 
3
- module Bosh::Common::Version
4
- class VersionList
5
- include Enumerable
6
-
7
- attr_reader :versions
8
-
9
- alias :latest :max
10
-
11
- # @param [Array<#version>] Collection of version strings
12
- # @param [class] Version type to parse as (ex: SemiSemanticVersion, ReleaseVersion, StemcellVersion, BoshVersion)
13
- def self.parse(versions, version_type)
14
- raise TypeError, "Failed to Parse - Invalid Version Type: '#{version_type.inspect}'" unless version_type <= SemiSemanticVersion
15
- self.new(versions.map { |v| version_type.parse(v) })
16
- end
17
-
18
- # @param [Array<#version>] Collection of SemiSemanticVersion objects
19
- def initialize(versions)
20
- @versions = versions
21
- end
22
-
23
- # Gets the latest version with the same release and pre-release version as the specified version
24
- # @param [#version] SemiSemanticVersion object
25
- def latest_with_pre_release(version)
26
- raise TypeError, "Invalid Version Type: #{version.class}" unless version.kind_of?(SemiSemanticVersion)
27
- @versions.select { |v|
28
- v.version.release == version.version.release && v.version.pre_release == version.version.pre_release
29
- }.max
30
- end
31
-
32
- # Gets the latest version with the same release version as the specified version
33
- # @param [#version] SemiSemanticVersion object
34
- def latest_with_release(version)
35
- raise TypeError, "Invalid Version Type: #{version.class}" unless version.kind_of?(SemiSemanticVersion)
36
- @versions.select { |v|
37
- v.version.release == version.version.release
38
- }.max
39
- end
40
-
41
- def each(&block)
42
- @versions.each(&block)
3
+ module Bosh::Common
4
+ module Version
5
+ class VersionList
6
+ include Enumerable
7
+
8
+ attr_reader :versions
9
+
10
+ alias :latest :max
11
+
12
+ # @param [Array<#version>] Collection of version strings
13
+ # @param [class] Version type to parse as (ex: SemiSemanticVersion, ReleaseVersion, StemcellVersion, BoshVersion)
14
+ def self.parse(versions, version_type)
15
+ raise TypeError, "Failed to Parse - Invalid Version Type: '#{version_type.inspect}'" unless version_type <= SemiSemanticVersion
16
+ self.new(versions.map { |v| version_type.parse(v) })
17
+ end
18
+
19
+ # @param [Array<#version>] Collection of SemiSemanticVersion objects
20
+ def initialize(versions)
21
+ raise TypeError, "Invalid Version Array: '#{versions.inspect}'" unless versions.kind_of?(Array)
22
+ @versions = versions
23
+ end
24
+
25
+ # Gets the latest version with the same release and pre-release version as the specified version
26
+ # @param [#version] SemiSemanticVersion object
27
+ def latest_with_pre_release(version)
28
+ raise TypeError, "Invalid Version Type: #{version.class}" unless version.kind_of?(SemiSemanticVersion)
29
+ @versions.select { |v|
30
+ v.version.release == version.version.release && v.version.pre_release == version.version.pre_release
31
+ }.max
32
+ end
33
+
34
+ # Gets the latest version with the same release version as the specified version
35
+ # @param [#version] SemiSemanticVersion object
36
+ def latest_with_release(version)
37
+ raise TypeError, "Invalid Version Type: #{version.class}" unless version.kind_of?(SemiSemanticVersion)
38
+ @versions.select { |v|
39
+ v.version.release == version.version.release
40
+ }.max
41
+ end
42
+
43
+ def each(&block)
44
+ @versions.each(&block)
45
+ end
46
+
47
+ def ==(other)
48
+ @versions == other.versions
49
+ end
50
+
51
+ def to_s
52
+ @versions.map{ |v| v.to_s }.to_s
53
+ end
43
54
  end
44
55
  end
45
56
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bosh_common
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2657.0
4
+ version: 1.2669.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - VMware
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-24 00:00:00.000000000 Z
11
+ date: 2014-07-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: semi_semantic
@@ -26,7 +26,7 @@ dependencies:
26
26
  version: 1.1.0
27
27
  description: |-
28
28
  BOSH common
29
- a6c527
29
+ bf0b96
30
30
  email: support@cloudfoundry.com
31
31
  executables: []
32
32
  extensions: []
@@ -39,10 +39,6 @@ files:
39
39
  - lib/common/exec.rb
40
40
  - lib/common/exec/error.rb
41
41
  - lib/common/exec/result.rb
42
- - lib/common/properties.rb
43
- - lib/common/properties/errors.rb
44
- - lib/common/properties/property_helper.rb
45
- - lib/common/properties/template_evaluation_context.rb
46
42
  - lib/common/retryable.rb
47
43
  - lib/common/ssl.rb
48
44
  - lib/common/thread_formatter.rb
@@ -53,6 +49,7 @@ files:
53
49
  - lib/common/version/release_version_list.rb
54
50
  - lib/common/version/semi_semantic_version.rb
55
51
  - lib/common/version/stemcell_version.rb
52
+ - lib/common/version/stemcell_version_list.rb
56
53
  - lib/common/version/version_list.rb
57
54
  homepage: https://github.com/cloudfoundry/bosh
58
55
  licenses:
@@ -1,6 +0,0 @@
1
- # Copyright (c) 2009-2012 VMware, Inc.
2
-
3
- require "ostruct"
4
- require "common/properties/errors"
5
- require "common/properties/property_helper"
6
- require "common/properties/template_evaluation_context"
@@ -1,16 +0,0 @@
1
- # Copyright (c) 2009-2012 VMware, Inc.
2
-
3
- module Bosh::Common
4
-
5
- class TemplateEvaluationFailed < StandardError; end
6
-
7
- class UnknownProperty < StandardError
8
- attr_reader :name
9
-
10
- def initialize(name)
11
- @name = name
12
- super("Can't find property `#{name}'")
13
- end
14
- end
15
-
16
- end
@@ -1,41 +0,0 @@
1
- module Bosh::Common
2
- module PropertyHelper
3
- # Copies property with a given name from src to dst.
4
- # @param [Hash] dst Property destination
5
- # @param [Hash] src Property source
6
- # @param [String] name Property name (dot-separated)
7
- # @param [Object] default Default value (if property is not in src)
8
- def copy_property(dst, src, name, default = nil)
9
- keys = name.split(".")
10
- src_ref = src
11
- dst_ref = dst
12
-
13
- keys.each do |key|
14
- src_ref = src_ref[key]
15
- break if src_ref.nil? # no property with this name is src
16
- end
17
-
18
- keys[0..-2].each do |key|
19
- dst_ref[key] ||= {}
20
- dst_ref = dst_ref[key]
21
- end
22
-
23
- dst_ref[keys[-1]] ||= {}
24
- dst_ref[keys[-1]] = src_ref.nil? ? default : src_ref
25
- end
26
-
27
- # @param [Hash] collection Property collection
28
- # @param [String] name Dot-separated property name
29
- def lookup_property(collection, name)
30
- keys = name.split(".")
31
- ref = collection
32
-
33
- keys.each do |key|
34
- ref = ref[key]
35
- return nil if ref.nil?
36
- end
37
-
38
- ref
39
- end
40
- end
41
- end
@@ -1,140 +0,0 @@
1
- # Copyright (c) 2009-2012 VMware, Inc.
2
-
3
- module Bosh::Common
4
- # Helper class to evaluate templates. Used by Director, CLI and Agent.
5
- class TemplateEvaluationContext
6
- include PropertyHelper
7
-
8
- # @return [String] Template name
9
- attr_reader :name
10
-
11
- # @return [Integer] Template instance index
12
- attr_reader :index
13
-
14
- # @return [Hash] Template properties
15
- attr_reader :properties
16
-
17
- # @return [Hash] Raw template properties (no openstruct)
18
- attr_reader :raw_properties
19
-
20
- # @return [Hash] Template spec
21
- attr_reader :spec
22
-
23
- # @param [Hash] spec Template spec
24
- def initialize(spec)
25
- unless spec.is_a?(Hash)
26
- raise TemplateEvaluationFailed,
27
- "Invalid spec provided for template evaluation context, " +
28
- "Hash expected, #{spec.class} given"
29
- end
30
-
31
- if spec["job"].is_a?(Hash)
32
- @name = spec["job"]["name"]
33
- else
34
- @name = nil
35
- end
36
-
37
- @index = spec["index"]
38
- @spec = openstruct(spec)
39
- @raw_properties = spec["properties"] || {}
40
- @properties = openstruct(@raw_properties)
41
- end
42
-
43
- # @return [Binding] Template binding
44
- def get_binding
45
- binding.taint
46
- end
47
-
48
- # Property lookup helper
49
- #
50
- # @overload p(name, default_value)
51
- # Returns property value or default value if property not set
52
- # @param [String] name Property name
53
- # @param [Object] default_value Default value
54
- # @return [Object] Property value
55
- #
56
- # @overload p(names, default_value)
57
- # Returns first property from the list that is set or default value if
58
- # none of them are set
59
- # @param [Array<String>] names Property names
60
- # @param [Object] default_value Default value
61
- # @return [Object] Property value
62
- #
63
- # @overload p(names)
64
- # Looks up first property from the list that is set, raises an error
65
- # if none of them are set.
66
- # @param [Array<String>] names Property names
67
- # @return [Object] Property value
68
- # @raise [Bosh::Common::UnknownProperty]
69
- #
70
- # @overload p(name)
71
- # Looks up property and raises an error if it's not set
72
- # @param [String] name Property name
73
- # @return [Object] Property value
74
- # @raise [Bosh::Common::UnknownProperty]
75
- def p(*args)
76
- names = Array(args[0])
77
-
78
- names.each do |name|
79
- result = lookup_property(@raw_properties, name)
80
- return result unless result.nil?
81
- end
82
-
83
- return args[1] if args.length == 2
84
- raise UnknownProperty.new(names)
85
- end
86
-
87
- # Run a block of code if all given properties are defined
88
- # @param [Array<String>] names Property names
89
- # @yield [Object] property values
90
- def if_p(*names)
91
- values = names.map do |name|
92
- value = lookup_property(@raw_properties, name)
93
- return ActiveElseBlock.new(self) if value.nil?
94
- value
95
- end
96
-
97
- yield *values
98
- InactiveElseBlock.new
99
- end
100
-
101
- # @return [Object] Object representation where all hashes are unrolled
102
- # into OpenStruct objects. This exists mostly for backward
103
- # compatibility, as it doesn't provide good error reporting.
104
- def openstruct(object)
105
- case object
106
- when Hash
107
- mapped = object.inject({}) { |h, (k,v)| h[k] = openstruct(v); h }
108
- OpenStruct.new(mapped)
109
- when Array
110
- object.map { |item| openstruct(item) }
111
- else
112
- object
113
- end
114
- end
115
-
116
- private
117
- class ActiveElseBlock
118
- def initialize(template_context)
119
- @context = template_context
120
- end
121
-
122
- def else
123
- yield
124
- end
125
-
126
- def else_if_p(*names, &block)
127
- @context.if_p(*names, &block)
128
- end
129
- end
130
-
131
- class InactiveElseBlock
132
- def else
133
- end
134
-
135
- def else_if_p(*names)
136
- InactiveElseBlock.new
137
- end
138
- end
139
- end
140
- end