endoflife_date 1.0.0 → 1.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 +4 -4
- data/Gemfile.lock +98 -25
- data/README.md +6 -6
- data/bin/byebug +1 -12
- data/bin/coderay +1 -12
- data/bin/htmldiff +1 -12
- data/bin/ldiff +1 -12
- data/bin/pry +1 -12
- data/bin/racc +1 -12
- data/bin/rake +1 -12
- data/bin/rspec +1 -12
- data/bin/rubocop +1 -12
- data/bin/ruby-parse +1 -12
- data/bin/ruby-rewrite +1 -12
- data/docs/Cycle.md +3 -3
- data/docs/DefaultApi.md +7 -7
- data/endoflife_date.gemspec +3 -3
- data/lib/endoflife_date/api/default_api.rb +15 -15
- data/lib/endoflife_date/api_client.rb +17 -14
- data/lib/endoflife_date/api_error.rb +2 -2
- data/lib/endoflife_date/api_model_base.rb +88 -0
- data/lib/endoflife_date/configuration.rb +12 -2
- data/lib/endoflife_date/models/cycle.rb +21 -88
- data/lib/endoflife_date/models/cycle_cycle.rb +5 -6
- data/lib/endoflife_date/models/cycle_discontinued.rb +5 -6
- data/lib/endoflife_date/models/cycle_eol.rb +5 -6
- data/lib/endoflife_date/models/cycle_lts.rb +5 -6
- data/lib/endoflife_date/models/cycle_support.rb +5 -6
- data/lib/endoflife_date/version.rb +3 -3
- data/lib/endoflife_date.rb +3 -2
- data/spec/api/default_api_spec.rb +6 -6
- data/spec/models/cycle_cycle_spec.rb +2 -2
- data/spec/models/cycle_discontinued_spec.rb +2 -2
- data/spec/models/cycle_eol_spec.rb +2 -2
- data/spec/models/cycle_lts_spec.rb +2 -2
- data/spec/models/cycle_spec.rb +3 -3
- data/spec/models/cycle_support_spec.rb +2 -2
- data/spec/spec_helper.rb +2 -2
- metadata +9 -12
- data/bin/bundle +0 -109
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#endoflife.date
|
|
3
3
|
|
|
4
|
-
#
|
|
4
|
+
#The endoflife.date v0 API is currently deprecated, please [use the endoflife.date v1 API](https://endoflife.date/docs/api/v1/).
|
|
5
5
|
|
|
6
6
|
The version of the OpenAPI document: 0.0.1
|
|
7
7
|
Contact: blah+oapicf@cliffano.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
Generator version: 7.
|
|
9
|
+
Generator version: 7.24.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module EndOfLifeDateApiClient
|
|
17
|
-
# Whether this release cycle has long-term-support (LTS)
|
|
17
|
+
# Whether this release cycle has long-term-support (LTS), or the date it entered LTS status.
|
|
18
18
|
module CycleLts
|
|
19
19
|
class << self
|
|
20
20
|
# List of class defined in anyOf (OpenAPI v3)
|
|
@@ -38,8 +38,7 @@ module EndOfLifeDateApiClient
|
|
|
38
38
|
openapi_any_of.each do |klass|
|
|
39
39
|
begin
|
|
40
40
|
next if klass == :AnyType # "nullable: true"
|
|
41
|
-
|
|
42
|
-
return typed_data if typed_data
|
|
41
|
+
return find_and_cast_into_type(klass, data)
|
|
43
42
|
rescue # rescue all errors so we keep iterating even if the current item lookup raises
|
|
44
43
|
end
|
|
45
44
|
end
|
|
@@ -65,7 +64,7 @@ module EndOfLifeDateApiClient
|
|
|
65
64
|
when 'Time'
|
|
66
65
|
return Time.parse(data)
|
|
67
66
|
when 'Date'
|
|
68
|
-
return Date.
|
|
67
|
+
return Date.iso8601(data)
|
|
69
68
|
when 'String'
|
|
70
69
|
return data if data.instance_of?(String)
|
|
71
70
|
when 'Object' # "type: object"
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#endoflife.date
|
|
3
3
|
|
|
4
|
-
#
|
|
4
|
+
#The endoflife.date v0 API is currently deprecated, please [use the endoflife.date v1 API](https://endoflife.date/docs/api/v1/).
|
|
5
5
|
|
|
6
6
|
The version of the OpenAPI document: 0.0.1
|
|
7
7
|
Contact: blah+oapicf@cliffano.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
Generator version: 7.
|
|
9
|
+
Generator version: 7.24.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module EndOfLifeDateApiClient
|
|
17
|
-
# Whether this release cycle has active support
|
|
17
|
+
# Whether this release cycle has active support.
|
|
18
18
|
module CycleSupport
|
|
19
19
|
class << self
|
|
20
20
|
# List of class defined in anyOf (OpenAPI v3)
|
|
@@ -38,8 +38,7 @@ module EndOfLifeDateApiClient
|
|
|
38
38
|
openapi_any_of.each do |klass|
|
|
39
39
|
begin
|
|
40
40
|
next if klass == :AnyType # "nullable: true"
|
|
41
|
-
|
|
42
|
-
return typed_data if typed_data
|
|
41
|
+
return find_and_cast_into_type(klass, data)
|
|
43
42
|
rescue # rescue all errors so we keep iterating even if the current item lookup raises
|
|
44
43
|
end
|
|
45
44
|
end
|
|
@@ -65,7 +64,7 @@ module EndOfLifeDateApiClient
|
|
|
65
64
|
when 'Time'
|
|
66
65
|
return Time.parse(data)
|
|
67
66
|
when 'Date'
|
|
68
|
-
return Date.
|
|
67
|
+
return Date.iso8601(data)
|
|
69
68
|
when 'String'
|
|
70
69
|
return data if data.instance_of?(String)
|
|
71
70
|
when 'Object' # "type: object"
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#endoflife.date
|
|
3
3
|
|
|
4
|
-
#
|
|
4
|
+
#The endoflife.date v0 API is currently deprecated, please [use the endoflife.date v1 API](https://endoflife.date/docs/api/v1/).
|
|
5
5
|
|
|
6
6
|
The version of the OpenAPI document: 0.0.1
|
|
7
7
|
Contact: blah+oapicf@cliffano.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
Generator version: 7.
|
|
9
|
+
Generator version: 7.24.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
13
13
|
module EndOfLifeDateApiClient
|
|
14
|
-
VERSION = '1.
|
|
14
|
+
VERSION = '1.2.0'
|
|
15
15
|
end
|
data/lib/endoflife_date.rb
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#endoflife.date
|
|
3
3
|
|
|
4
|
-
#
|
|
4
|
+
#The endoflife.date v0 API is currently deprecated, please [use the endoflife.date v1 API](https://endoflife.date/docs/api/v1/).
|
|
5
5
|
|
|
6
6
|
The version of the OpenAPI document: 0.0.1
|
|
7
7
|
Contact: blah+oapicf@cliffano.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
Generator version: 7.
|
|
9
|
+
Generator version: 7.24.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
13
13
|
# Common files
|
|
14
14
|
require 'endoflife_date/api_client'
|
|
15
15
|
require 'endoflife_date/api_error'
|
|
16
|
+
require 'endoflife_date/api_model_base'
|
|
16
17
|
require 'endoflife_date/version'
|
|
17
18
|
require 'endoflife_date/configuration'
|
|
18
19
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#endoflife.date
|
|
3
3
|
|
|
4
|
-
#
|
|
4
|
+
#The endoflife.date v0 API is currently deprecated, please [use the endoflife.date v1 API](https://endoflife.date/docs/api/v1/).
|
|
5
5
|
|
|
6
6
|
The version of the OpenAPI document: 0.0.1
|
|
7
7
|
Contact: blah+oapicf@cliffano.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
Generator version: 7.
|
|
9
|
+
Generator version: 7.24.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -45,9 +45,9 @@ describe 'DefaultApi' do
|
|
|
45
45
|
|
|
46
46
|
# unit tests for get_api_product_cycle_json
|
|
47
47
|
# Single cycle details
|
|
48
|
-
# Gets details of a single cycle
|
|
49
|
-
# @param product Product URL as per the canonical URL on the endofife.date website
|
|
50
|
-
# @param cycle Release Cycle for which the details must be fetched
|
|
48
|
+
# Gets details of a single cycle.
|
|
49
|
+
# @param product Product URL as per the canonical URL on the endofife.date website.
|
|
50
|
+
# @param cycle Release Cycle for which the details must be fetched. Any slash character in the cycle name will be replaced with dashes. For example FreeBSD's releng/14.0 becomes releng-14.0.
|
|
51
51
|
# @param [Hash] opts the optional parameters
|
|
52
52
|
# @return [Cycle]
|
|
53
53
|
describe 'get_api_product_cycle_json test' do
|
|
@@ -59,7 +59,7 @@ describe 'DefaultApi' do
|
|
|
59
59
|
# unit tests for get_api_product_json
|
|
60
60
|
# Get All Details
|
|
61
61
|
# Get EoL dates of all cycles of a given product.
|
|
62
|
-
# @param product Product URL as per the canonical URL on the endofife.date website
|
|
62
|
+
# @param product Product URL as per the canonical URL on the endofife.date website.
|
|
63
63
|
# @param [Hash] opts the optional parameters
|
|
64
64
|
# @return [Array<Cycle>]
|
|
65
65
|
describe 'get_api_product_json test' do
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#endoflife.date
|
|
3
3
|
|
|
4
|
-
#
|
|
4
|
+
#The endoflife.date v0 API is currently deprecated, please [use the endoflife.date v1 API](https://endoflife.date/docs/api/v1/).
|
|
5
5
|
|
|
6
6
|
The version of the OpenAPI document: 0.0.1
|
|
7
7
|
Contact: blah+oapicf@cliffano.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
Generator version: 7.
|
|
9
|
+
Generator version: 7.24.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#endoflife.date
|
|
3
3
|
|
|
4
|
-
#
|
|
4
|
+
#The endoflife.date v0 API is currently deprecated, please [use the endoflife.date v1 API](https://endoflife.date/docs/api/v1/).
|
|
5
5
|
|
|
6
6
|
The version of the OpenAPI document: 0.0.1
|
|
7
7
|
Contact: blah+oapicf@cliffano.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
Generator version: 7.
|
|
9
|
+
Generator version: 7.24.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#endoflife.date
|
|
3
3
|
|
|
4
|
-
#
|
|
4
|
+
#The endoflife.date v0 API is currently deprecated, please [use the endoflife.date v1 API](https://endoflife.date/docs/api/v1/).
|
|
5
5
|
|
|
6
6
|
The version of the OpenAPI document: 0.0.1
|
|
7
7
|
Contact: blah+oapicf@cliffano.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
Generator version: 7.
|
|
9
|
+
Generator version: 7.24.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#endoflife.date
|
|
3
3
|
|
|
4
|
-
#
|
|
4
|
+
#The endoflife.date v0 API is currently deprecated, please [use the endoflife.date v1 API](https://endoflife.date/docs/api/v1/).
|
|
5
5
|
|
|
6
6
|
The version of the OpenAPI document: 0.0.1
|
|
7
7
|
Contact: blah+oapicf@cliffano.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
Generator version: 7.
|
|
9
|
+
Generator version: 7.24.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
data/spec/models/cycle_spec.rb
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#endoflife.date
|
|
3
3
|
|
|
4
|
-
#
|
|
4
|
+
#The endoflife.date v0 API is currently deprecated, please [use the endoflife.date v1 API](https://endoflife.date/docs/api/v1/).
|
|
5
5
|
|
|
6
6
|
The version of the OpenAPI document: 0.0.1
|
|
7
7
|
Contact: blah+oapicf@cliffano.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
Generator version: 7.
|
|
9
|
+
Generator version: 7.24.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -18,7 +18,7 @@ require 'date'
|
|
|
18
18
|
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
19
|
# Please update as you see appropriate
|
|
20
20
|
describe EndOfLifeDateApiClient::Cycle do
|
|
21
|
-
let(:instance) { EndOfLifeDateApiClient::Cycle.new }
|
|
21
|
+
#let(:instance) { EndOfLifeDateApiClient::Cycle.new }
|
|
22
22
|
|
|
23
23
|
describe 'test an instance of Cycle' do
|
|
24
24
|
it 'should create an instance of Cycle' do
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#endoflife.date
|
|
3
3
|
|
|
4
|
-
#
|
|
4
|
+
#The endoflife.date v0 API is currently deprecated, please [use the endoflife.date v1 API](https://endoflife.date/docs/api/v1/).
|
|
5
5
|
|
|
6
6
|
The version of the OpenAPI document: 0.0.1
|
|
7
7
|
Contact: blah+oapicf@cliffano.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
Generator version: 7.
|
|
9
|
+
Generator version: 7.24.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
data/spec/spec_helper.rb
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#endoflife.date
|
|
3
3
|
|
|
4
|
-
#
|
|
4
|
+
#The endoflife.date v0 API is currently deprecated, please [use the endoflife.date v1 API](https://endoflife.date/docs/api/v1/).
|
|
5
5
|
|
|
6
6
|
The version of the OpenAPI document: 0.0.1
|
|
7
7
|
Contact: blah+oapicf@cliffano.com
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
|
-
Generator version: 7.
|
|
9
|
+
Generator version: 7.24.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: endoflife_date
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- OpenAPI Clients Factory
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: typhoeus
|
|
@@ -50,8 +49,8 @@ dependencies:
|
|
|
50
49
|
- - ">="
|
|
51
50
|
- !ruby/object:Gem::Version
|
|
52
51
|
version: 3.6.0
|
|
53
|
-
description:
|
|
54
|
-
|
|
52
|
+
description: The endoflife.date v0 API is currently deprecated, please [use the endoflife.date
|
|
53
|
+
v1 API](https://endoflife.date/docs/api/v1/).
|
|
55
54
|
email:
|
|
56
55
|
- blah+oapicf@cliffano.com
|
|
57
56
|
executables: []
|
|
@@ -62,7 +61,6 @@ files:
|
|
|
62
61
|
- Gemfile.lock
|
|
63
62
|
- README.md
|
|
64
63
|
- Rakefile
|
|
65
|
-
- bin/bundle
|
|
66
64
|
- bin/byebug
|
|
67
65
|
- bin/coderay
|
|
68
66
|
- bin/htmldiff
|
|
@@ -87,6 +85,7 @@ files:
|
|
|
87
85
|
- lib/endoflife_date/api/default_api.rb
|
|
88
86
|
- lib/endoflife_date/api_client.rb
|
|
89
87
|
- lib/endoflife_date/api_error.rb
|
|
88
|
+
- lib/endoflife_date/api_model_base.rb
|
|
90
89
|
- lib/endoflife_date/configuration.rb
|
|
91
90
|
- lib/endoflife_date/models/cycle.rb
|
|
92
91
|
- lib/endoflife_date/models/cycle_cycle.rb
|
|
@@ -107,7 +106,6 @@ homepage: https://github.com/oapicf/endoflife.date-api-clients
|
|
|
107
106
|
licenses:
|
|
108
107
|
- MIT
|
|
109
108
|
metadata: {}
|
|
110
|
-
post_install_message:
|
|
111
109
|
rdoc_options: []
|
|
112
110
|
require_paths:
|
|
113
111
|
- lib
|
|
@@ -122,16 +120,15 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
122
120
|
- !ruby/object:Gem::Version
|
|
123
121
|
version: '0'
|
|
124
122
|
requirements: []
|
|
125
|
-
rubygems_version: 3.
|
|
126
|
-
signing_key:
|
|
123
|
+
rubygems_version: 3.6.7
|
|
127
124
|
specification_version: 4
|
|
128
125
|
summary: endoflife.date Ruby Gem
|
|
129
126
|
test_files:
|
|
130
127
|
- spec/api/default_api_spec.rb
|
|
128
|
+
- spec/models/cycle_cycle_spec.rb
|
|
131
129
|
- spec/models/cycle_discontinued_spec.rb
|
|
132
|
-
- spec/models/
|
|
130
|
+
- spec/models/cycle_eol_spec.rb
|
|
133
131
|
- spec/models/cycle_lts_spec.rb
|
|
134
132
|
- spec/models/cycle_spec.rb
|
|
135
|
-
- spec/models/
|
|
136
|
-
- spec/models/cycle_cycle_spec.rb
|
|
133
|
+
- spec/models/cycle_support_spec.rb
|
|
137
134
|
- spec/spec_helper.rb
|
data/bin/bundle
DELETED
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env ruby2.7
|
|
2
|
-
# frozen_string_literal: true
|
|
3
|
-
|
|
4
|
-
#
|
|
5
|
-
# This file was generated by Bundler.
|
|
6
|
-
#
|
|
7
|
-
# The application 'bundle' is installed as part of a gem, and
|
|
8
|
-
# this file is here to facilitate running it.
|
|
9
|
-
#
|
|
10
|
-
|
|
11
|
-
require "rubygems"
|
|
12
|
-
|
|
13
|
-
m = Module.new do
|
|
14
|
-
module_function
|
|
15
|
-
|
|
16
|
-
def invoked_as_script?
|
|
17
|
-
File.expand_path($0) == File.expand_path(__FILE__)
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
def env_var_version
|
|
21
|
-
ENV["BUNDLER_VERSION"]
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
def cli_arg_version
|
|
25
|
-
return unless invoked_as_script? # don't want to hijack other binstubs
|
|
26
|
-
return unless "update".start_with?(ARGV.first || " ") # must be running `bundle update`
|
|
27
|
-
bundler_version = nil
|
|
28
|
-
update_index = nil
|
|
29
|
-
ARGV.each_with_index do |a, i|
|
|
30
|
-
if update_index && update_index.succ == i && a =~ Gem::Version::ANCHORED_VERSION_PATTERN
|
|
31
|
-
bundler_version = a
|
|
32
|
-
end
|
|
33
|
-
next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/
|
|
34
|
-
bundler_version = $1
|
|
35
|
-
update_index = i
|
|
36
|
-
end
|
|
37
|
-
bundler_version
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
def gemfile
|
|
41
|
-
gemfile = ENV["BUNDLE_GEMFILE"]
|
|
42
|
-
return gemfile if gemfile && !gemfile.empty?
|
|
43
|
-
|
|
44
|
-
File.expand_path("../Gemfile", __dir__)
|
|
45
|
-
end
|
|
46
|
-
|
|
47
|
-
def lockfile
|
|
48
|
-
lockfile =
|
|
49
|
-
case File.basename(gemfile)
|
|
50
|
-
when "gems.rb" then gemfile.sub(/\.rb$/, ".locked")
|
|
51
|
-
else "#{gemfile}.lock"
|
|
52
|
-
end
|
|
53
|
-
File.expand_path(lockfile)
|
|
54
|
-
end
|
|
55
|
-
|
|
56
|
-
def lockfile_version
|
|
57
|
-
return unless File.file?(lockfile)
|
|
58
|
-
lockfile_contents = File.read(lockfile)
|
|
59
|
-
return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/
|
|
60
|
-
Regexp.last_match(1)
|
|
61
|
-
end
|
|
62
|
-
|
|
63
|
-
def bundler_requirement
|
|
64
|
-
@bundler_requirement ||=
|
|
65
|
-
env_var_version ||
|
|
66
|
-
cli_arg_version ||
|
|
67
|
-
bundler_requirement_for(lockfile_version)
|
|
68
|
-
end
|
|
69
|
-
|
|
70
|
-
def bundler_requirement_for(version)
|
|
71
|
-
return "#{Gem::Requirement.default}.a" unless version
|
|
72
|
-
|
|
73
|
-
bundler_gem_version = Gem::Version.new(version)
|
|
74
|
-
|
|
75
|
-
bundler_gem_version.approximate_recommendation
|
|
76
|
-
end
|
|
77
|
-
|
|
78
|
-
def load_bundler!
|
|
79
|
-
ENV["BUNDLE_GEMFILE"] ||= gemfile
|
|
80
|
-
|
|
81
|
-
activate_bundler
|
|
82
|
-
end
|
|
83
|
-
|
|
84
|
-
def activate_bundler
|
|
85
|
-
gem_error = activation_error_handling do
|
|
86
|
-
gem "bundler", bundler_requirement
|
|
87
|
-
end
|
|
88
|
-
return if gem_error.nil?
|
|
89
|
-
require_error = activation_error_handling do
|
|
90
|
-
require "bundler/version"
|
|
91
|
-
end
|
|
92
|
-
return if require_error.nil? && Gem::Requirement.new(bundler_requirement).satisfied_by?(Gem::Version.new(Bundler::VERSION))
|
|
93
|
-
warn "Activating bundler (#{bundler_requirement}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_requirement}'`"
|
|
94
|
-
exit 42
|
|
95
|
-
end
|
|
96
|
-
|
|
97
|
-
def activation_error_handling
|
|
98
|
-
yield
|
|
99
|
-
nil
|
|
100
|
-
rescue StandardError, LoadError => e
|
|
101
|
-
e
|
|
102
|
-
end
|
|
103
|
-
end
|
|
104
|
-
|
|
105
|
-
m.load_bundler!
|
|
106
|
-
|
|
107
|
-
if m.invoked_as_script?
|
|
108
|
-
load Gem.bin_path("bundler", "bundle")
|
|
109
|
-
end
|