dpl 2.0.3.beta.4 → 2.0.3.beta.5

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.
Files changed (85) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +15 -3
  3. data/Gemfile.lock +444 -211
  4. data/Rakefile +36 -34
  5. data/bin/dpl +3 -1
  6. data/dpl.gemspec +25 -0
  7. data/lib/dpl/cli.rb +19 -14
  8. data/lib/dpl/ctx/bash.rb +18 -12
  9. data/lib/dpl/ctx/test.rb +21 -15
  10. data/lib/dpl/ctx.rb +2 -0
  11. data/lib/dpl/helper/assets.rb +4 -2
  12. data/lib/dpl/helper/cmd.rb +20 -18
  13. data/lib/dpl/helper/config_file.rb +5 -3
  14. data/lib/dpl/helper/cookbook_site_streaming_uploader.rb +249 -0
  15. data/lib/dpl/helper/env.rb +26 -22
  16. data/lib/dpl/helper/github.rb +2 -0
  17. data/lib/dpl/helper/interpolate.rb +8 -4
  18. data/lib/dpl/helper/memoize.rb +4 -1
  19. data/lib/dpl/helper/squiggle.rb +3 -1
  20. data/lib/dpl/helper/transliterate.rb +3 -1
  21. data/lib/dpl/helper/wrap.rb +3 -1
  22. data/lib/dpl/helper/zip.rb +3 -1
  23. data/lib/dpl/provider/dsl.rb +18 -4
  24. data/lib/dpl/provider/examples.rb +6 -2
  25. data/lib/dpl/provider/status.rb +26 -24
  26. data/lib/dpl/providers/anynines.rb +22 -20
  27. data/lib/dpl/providers/azure_web_apps.rb +21 -19
  28. data/lib/dpl/providers/bintray.rb +44 -37
  29. data/lib/dpl/providers/bluemixcloudfoundry.rb +38 -36
  30. data/lib/dpl/providers/boxfuse.rb +12 -10
  31. data/lib/dpl/providers/cargo.rb +7 -5
  32. data/lib/dpl/providers/chef_supermarket.rb +82 -80
  33. data/lib/dpl/providers/cloud66.rb +17 -15
  34. data/lib/dpl/providers/cloudfiles.rb +8 -6
  35. data/lib/dpl/providers/cloudformation.rb +191 -187
  36. data/lib/dpl/providers/cloudfoundry.rb +32 -30
  37. data/lib/dpl/providers/codedeploy.rb +35 -33
  38. data/lib/dpl/providers/convox.rb +32 -25
  39. data/lib/dpl/providers/datica.rb +30 -28
  40. data/lib/dpl/providers/ecr.rb +66 -64
  41. data/lib/dpl/providers/elasticbeanstalk.rb +14 -12
  42. data/lib/dpl/providers/engineyard.rb +60 -58
  43. data/lib/dpl/providers/firebase.rb +6 -4
  44. data/lib/dpl/providers/flynn.rb +8 -6
  45. data/lib/dpl/providers/gae.rb +28 -25
  46. data/lib/dpl/providers/gcs.rb +59 -57
  47. data/lib/dpl/providers/git_push.rb +199 -195
  48. data/lib/dpl/providers/gleis.rb +19 -17
  49. data/lib/dpl/providers/hackage.rb +15 -13
  50. data/lib/dpl/providers/hephy.rb +18 -16
  51. data/lib/dpl/providers/heroku/api.rb +72 -70
  52. data/lib/dpl/providers/heroku/git.rb +15 -13
  53. data/lib/dpl/providers/heroku.rb +40 -38
  54. data/lib/dpl/providers/lambda.rb +134 -134
  55. data/lib/dpl/providers/launchpad.rb +45 -43
  56. data/lib/dpl/providers/netlify.rb +7 -5
  57. data/lib/dpl/providers/npm.rb +61 -58
  58. data/lib/dpl/providers/nuget.rb +8 -6
  59. data/lib/dpl/providers/openshift.rb +8 -6
  60. data/lib/dpl/providers/opsworks.rb +23 -21
  61. data/lib/dpl/providers/pages/api.rb +14 -14
  62. data/lib/dpl/providers/pages/git.rb +53 -47
  63. data/lib/dpl/providers/pages.rb +3 -1
  64. data/lib/dpl/providers/puppetforge.rb +6 -4
  65. data/lib/dpl/providers/pypi.rb +55 -54
  66. data/lib/dpl/providers/releases.rb +30 -23
  67. data/lib/dpl/providers/rubygems.rb +35 -31
  68. data/lib/dpl/providers/s3.rb +148 -142
  69. data/lib/dpl/providers/scalingo.rb +18 -16
  70. data/lib/dpl/providers/script.rb +4 -2
  71. data/lib/dpl/providers/snap.rb +12 -9
  72. data/lib/dpl/providers/surge.rb +7 -5
  73. data/lib/dpl/providers/testfairy.rb +47 -43
  74. data/lib/dpl/providers/transifex.rb +20 -18
  75. data/lib/dpl/providers.rb +3 -1
  76. data/lib/dpl/string_ext.rb +3 -1
  77. data/lib/dpl/support/aws_sdk_patch.rb +4 -1
  78. data/lib/dpl/support/gems.rb +7 -3
  79. data/lib/dpl/support/gstore_patch.rb +3 -1
  80. data/lib/dpl/support/version.rb +13 -12
  81. data/lib/dpl/version.rb +3 -1
  82. data/lib/dpl.rb +2 -0
  83. data/status.json +237 -0
  84. metadata +32 -15
  85. /data/lib/dpl/providers/{packagecloud.rb → packagecloud.rb_} +0 -0
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Dpl
2
4
  module Providers
3
5
  class Scalingo < Provider
@@ -5,38 +7,38 @@ module Dpl
5
7
 
6
8
  status :alpha
7
9
 
8
- description sq(<<-str)
10
+ description sq(<<-STR)
9
11
  tbd
10
- str
12
+ STR
11
13
 
12
14
  env :scalingo
13
15
 
14
- required :api_token, [:username, :password]
16
+ required :api_token, %i[username password]
15
17
 
16
18
  opt '--app APP', default: :repo_name
17
19
  opt '--api_token TOKEN', 'Scalingo API token', alias: :api_key, deprecated: :api_key
18
20
  opt '--username NAME', 'Scalingo username'
19
21
  opt '--password PASS', 'Scalingo password', secret: true
20
- opt '--region REGION', 'Scalingo region', default: 'agora-fr1', enum: %w(agora-fr1 osc-fr1)
22
+ opt '--region REGION', 'Scalingo region', default: 'agora-fr1', enum: %w[agora-fr1 osc-fr1]
21
23
  opt '--remote REMOTE', 'Git remote name', default: 'scalingo-dpl'
22
24
  opt '--branch BRANCH', 'Git branch', default: 'master'
23
25
  opt '--timeout SEC', 'Timeout for Scalingo CLI commands', default: 60, type: :integer
24
26
 
25
27
  needs :git, :ssh_key
26
28
 
27
- cmds login_key: 'timeout %{timeout} ./scalingo login --api-token %{api_token} > /dev/null',
29
+ cmds login_key: 'timeout %{timeout} ./scalingo login --api-token %{api_token} > /dev/null',
28
30
  login_creds: 'echo -e \"%{username}\n%{password}\" | timeout %{timeout} ./scalingo login > /dev/null',
29
- add_key: 'timeout %{timeout} ./scalingo keys-add dpl_tmp_key %{key}',
30
- remove_key: 'timeout %{timeout} ./scalingo keys-remove dpl_tmp_key',
31
- git_setup: './scalingo --app %{app} git-setup --remote %{remote}',
32
- push: 'git push %{remote} HEAD:%{branch} -f'
31
+ add_key: 'timeout %{timeout} ./scalingo keys-add dpl_tmp_key %{key}',
32
+ remove_key: 'timeout %{timeout} ./scalingo keys-remove dpl_tmp_key',
33
+ git_setup: './scalingo --app %{app} git-setup --remote %{remote}',
34
+ push: 'git push %{remote} HEAD:%{branch} -f'
33
35
 
34
- errs install: 'Failed to install the Scalingo CLI.',
35
- login: 'Failed to authenticate with the Scalingo API.',
36
- add_key: 'Failed to add the ssh key.',
36
+ errs install: 'Failed to install the Scalingo CLI.',
37
+ login: 'Failed to authenticate with the Scalingo API.',
38
+ add_key: 'Failed to add the ssh key.',
37
39
  remove_key: 'Failed to remove the ssh key.',
38
- git_setup: 'Failed to add the git remote.',
39
- push: 'Failed to push the app.'
40
+ git_setup: 'Failed to add the git remote.',
41
+ push: 'Failed to push the app.'
40
42
 
41
43
  def install
42
44
  script :install
@@ -47,8 +49,8 @@ module Dpl
47
49
  shell api_token ? :login_key : :login_creds, assert: err(:login)
48
50
  end
49
51
 
50
- def add_key(key, type = nil)
51
- shell :add_key, key: key
52
+ def add_key(key, _type = nil)
53
+ shell :add_key, key:
52
54
  end
53
55
 
54
56
  def setup
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Dpl
2
4
  module Providers
3
5
  class Script < Provider
@@ -7,7 +9,7 @@ module Dpl
7
9
 
8
10
  summary 'Minimal provider that executes a custom command'
9
11
 
10
- description sq(<<-str)
12
+ description sq(<<-STR)
11
13
  This deployment provider executes a single, custom command. This is
12
14
  usually a script that is contained in your repository, but it can be
13
15
  any command executable in the build environment.
@@ -18,7 +20,7 @@ module Dpl
18
20
 
19
21
  Deployment will be marked a failure if the script exits with nonzero
20
22
  status.
21
- str
23
+ STR
22
24
 
23
25
  opt '-s', '--script SCRIPT', 'The script to execute', required: true
24
26
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Dpl
2
4
  module Providers
3
5
  class Snap < Provider
@@ -5,9 +7,9 @@ module Dpl
5
7
 
6
8
  status :stable
7
9
 
8
- description sq(<<-str)
10
+ description sq(<<-STR)
9
11
  tbd
10
- str
12
+ STR
11
13
 
12
14
  env :snap
13
15
 
@@ -18,18 +20,19 @@ module Dpl
18
20
  apt 'snapd', 'snap'
19
21
 
20
22
  cmds apt_get_update: 'sudo apt-get update -qq',
21
- update_snapd: 'sudo apt-get install snapd',
22
- install: 'sudo snap install snapcraft --classic',
23
- login: 'echo "%{token}" | snapcraft login --with -',
24
- deploy: 'snapcraft push %{snap_path} --release=%{channel}'
23
+ update_snapd: 'sudo apt-get install snapd',
24
+ install: 'sudo snap install snapcraft --classic',
25
+ login: 'echo "%{token}" | snapcraft login --with -',
26
+ deploy: 'snapcraft push %{snap_path} --release=%{channel}'
25
27
 
26
- msgs login: 'Attemping to login ...',
27
- no_snaps: 'No snap found matching %{snap}',
28
+ msgs login: 'Attemping to login ...',
29
+ no_snaps: 'No snap found matching %{snap}',
28
30
  multiple_snaps: 'Multiple snaps found matching %{snap}: %{snap_paths}',
29
- deploy: 'Pushing snap %{snap_path}'
31
+ deploy: 'Pushing snap %{snap_path}'
30
32
 
31
33
  def install
32
34
  return if which 'snapcraft'
35
+
33
36
  shell :apt_get_update
34
37
  shell :update_snapd
35
38
  shell :install
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'open-uri'
2
4
 
3
5
  module Dpl
@@ -7,9 +9,9 @@ module Dpl
7
9
 
8
10
  status :stable
9
11
 
10
- description sq(<<-str)
12
+ description sq(<<-STR)
11
13
  tbd
12
- str
14
+ STR
13
15
 
14
16
  node_js '>= 8.8.1'
15
17
 
@@ -25,7 +27,7 @@ module Dpl
25
27
  cmds deploy: 'surge %{project} %{domain}'
26
28
 
27
29
  msgs invalid_project: '%{project} is not a directory',
28
- missing_domain: 'Please set the domain in .travis.yml or in a CNAME file in the project directory'
30
+ missing_domain: 'Please set the domain in .travis.yml or in a CNAME file in the project directory'
29
31
 
30
32
  def login
31
33
  ENV['SURGE_LOGIN'] ||= opts[:login]
@@ -33,8 +35,8 @@ module Dpl
33
35
  end
34
36
 
35
37
  def validate
36
- error :invalid_project if invalid_project?
37
- error :missing_domain if missing_domain?
38
+ error :invalid_project if invalid_project?
39
+ error :missing_domain if missing_domain?
38
40
  end
39
41
 
40
42
  def deploy
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'dpl/version'
2
4
  require 'net/http'
3
5
  require 'securerandom'
@@ -11,9 +13,9 @@ module Dpl
11
13
 
12
14
  full_name 'TestFairy'
13
15
 
14
- description sq(<<-str)
16
+ description sq(<<-STR)
15
17
  tbd
16
- str
18
+ STR
17
19
 
18
20
  gem 'json'
19
21
  gem 'multipart-post', '~> 2.0.0', require: 'net/http/post/multipart'
@@ -29,10 +31,10 @@ module Dpl
29
31
  opt '--advanced_options OPTS', 'Comma_separated list of advanced options', example: 'option1,option2'
30
32
 
31
33
  URL = 'https://upload.testfairy.com/api/upload'
32
- UA = "Travis CI dpl version=#{Dpl::VERSION}"
34
+ UA = "Travis CI dpl version=#{Dpl::VERSION}".freeze
33
35
 
34
36
  msgs deploy: 'Uploading to TestFairy: %s',
35
- done: 'Done. Check your build at %s'
37
+ done: 'Done. Check your build at %s'
36
38
 
37
39
  def deploy
38
40
  info :deploy, pretty_print(params)
@@ -43,55 +45,57 @@ module Dpl
43
45
 
44
46
  private
45
47
 
46
- def params
47
- @params ||= compact(
48
- 'api_key': api_key,
49
- 'apk_file': file(app_file),
50
- 'symbols_file': file(symbols_file),
51
- 'testers-groups': testers_groups,
52
- 'notify': bool(notify),
53
- 'auto-update': bool(auto_update),
54
- 'advanced-options': advanced_options,
55
- 'changelog': changelog
56
- )
57
- end
48
+ def params
49
+ @params ||= compact(
50
+ 'api_key': api_key,
51
+ 'apk_file': file(app_file),
52
+ 'symbols_file': file(symbols_file),
53
+ 'testers-groups': testers_groups,
54
+ 'notify': bool(notify),
55
+ 'auto-update': bool(auto_update),
56
+ 'advanced-options': advanced_options,
57
+ 'changelog': changelog
58
+ )
59
+ end
58
60
 
59
- def changelog
60
- git_log "--pretty=oneline --abbrev-commit #{commits}" if commits
61
- end
61
+ def changelog
62
+ git_log "--pretty=oneline --abbrev-commit #{commits}" if commits
63
+ end
62
64
 
63
- def commits
64
- ENV['TRAVIS_COMMIT_RANGE']
65
- end
65
+ def commits
66
+ ENV['TRAVIS_COMMIT_RANGE']
67
+ end
66
68
 
67
- def request
68
- Net::HTTP::Post::Multipart.new(uri.path, params, 'User-Agent' => UA)
69
- end
69
+ def request
70
+ Net::HTTP::Post::Multipart.new(uri.path, params, 'User-Agent' => UA)
71
+ end
70
72
 
71
- def http
72
- Net::HTTP.start(uri.host, uri.port, :use_ssl => true)
73
- end
73
+ def http
74
+ Net::HTTP.start(uri.host, uri.port, use_ssl: true)
75
+ end
74
76
 
75
- def uri
76
- @uri ||= URI.parse(URL)
77
- end
77
+ def uri
78
+ @uri ||= URI.parse(URL)
79
+ end
78
80
 
79
- def file(path)
80
- UploadIO.new(path, '', File.basename(path)) if path
81
- end
81
+ def file(path)
82
+ UploadIO.new(path, '', File.basename(path)) if path
83
+ end
82
84
 
83
- def bool(obj)
84
- obj ? 'on' : 'off' unless obj.nil?
85
+ def bool(obj)
86
+ unless obj.nil?
87
+ obj ? 'on' : 'off'
85
88
  end
89
+ end
86
90
 
87
- def pretty_print(params)
88
- params = params.map do |key, value|
89
- value = obfuscate(value) if key == :api_key
90
- value = value.path if value.respond_to?(:path)
91
- [key, value]
92
- end
93
- JSON.pretty_generate(params.to_h)
91
+ def pretty_print(params)
92
+ params = params.map do |key, value|
93
+ value = obfuscate(value) if key == :api_key
94
+ value = value.path if value.respond_to?(:path)
95
+ [key, value]
94
96
  end
97
+ JSON.pretty_generate(params.to_h)
98
+ end
95
99
  end
96
100
  end
97
101
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Dpl
2
4
  module Providers
3
5
  class Transifex < Provider
@@ -5,13 +7,13 @@ module Dpl
5
7
 
6
8
  status :alpha
7
9
 
8
- description sq(<<-str)
10
+ description sq(<<-STR)
9
11
  tbd
10
- str
12
+ STR
11
13
 
12
14
  python '>= 2.7', '!= 3.0', '!= 3.1', '!= 3.2', '!= 3.3', '< 3.8'
13
15
 
14
- required :api_token, [:username, :password]
16
+ required :api_token, %i[username password]
15
17
 
16
18
  env :transifex
17
19
 
@@ -22,17 +24,17 @@ module Dpl
22
24
  opt '--cli_version VER', 'CLI version to install', default: '>=0.11'
23
25
 
24
26
  cmds status: 'tx status',
25
- push: 'tx push --source --no-interactive'
27
+ push: 'tx push --source --no-interactive'
26
28
 
27
29
  msgs login: 'Writing ~/.transifexrc (user: %{username}, password: %{password})'
28
30
  errs push: 'Failure pushing to Transifex'
29
31
 
30
- RC = sq(<<-rc)
32
+ RC = sq(<<-RC)
31
33
  [%{url}]
32
34
  hostname = %{url}
33
35
  username = %{username}
34
36
  password = %{password}
35
- rc
37
+ RC
36
38
 
37
39
  def install
38
40
  pip_install 'transifex-client', 'tx', cli_version
@@ -50,21 +52,21 @@ module Dpl
50
52
 
51
53
  private
52
54
 
53
- def write_rc
54
- write_file '~/.transifexrc', interpolate(RC, opts, secure: true)
55
- end
55
+ def write_rc
56
+ write_file '~/.transifexrc', interpolate(RC, opts, secure: true)
57
+ end
56
58
 
57
- def username
58
- super || 'api'
59
- end
59
+ def username
60
+ super || 'api'
61
+ end
60
62
 
61
- def password
62
- super || api_token
63
- end
63
+ def password
64
+ super || api_token
65
+ end
64
66
 
65
- def url
66
- hostname.start_with?('https://') ? hostname : "https://#{hostname}"
67
- end
67
+ def url
68
+ hostname.start_with?('https://') ? hostname : "https://#{hostname}"
69
+ end
68
70
  end
69
71
  end
70
72
  end
data/lib/dpl/providers.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'dpl/providers/anynines'
2
4
  require 'dpl/providers/azure_web_apps'
3
5
  require 'dpl/providers/bintray'
@@ -31,7 +33,7 @@ require 'dpl/providers/npm'
31
33
  require 'dpl/providers/nuget'
32
34
  require 'dpl/providers/openshift'
33
35
  require 'dpl/providers/opsworks'
34
- require 'dpl/providers/packagecloud'
36
+ # require 'dpl/providers/packagecloud'
35
37
  require 'dpl/providers/pages'
36
38
  require 'dpl/providers/puppetforge'
37
39
  require 'dpl/providers/pypi'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class String
2
4
  def whitelist
3
5
  @is_whitelisted = true
@@ -18,4 +20,4 @@ class String
18
20
  def blacklisted?
19
21
  @is_whitelisted.nil? ? false : !@is_whitelisted
20
22
  end
21
- end
23
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Silences "Struct::Tms is deprecated" warnings on Ruby 2.6.2 that would
2
4
  # otherwise spam hundereds of warnings, on apparently every single const
3
5
  # eager loaded (or something). The constant Tms is not used anywhere in
@@ -10,11 +12,12 @@ Aws::EagerLoader.class_eval do
10
12
  @loaded << klass_or_module
11
13
  klass_or_module.constants.each do |const_name|
12
14
  next if const_name == :Tms
15
+
13
16
  path = klass_or_module.autoload?(const_name)
14
17
  begin
15
18
  require(path) if path
16
19
  const = klass_or_module.const_get(const_name)
17
- self.load(const) if Module === const && !@loaded.include?(const)
20
+ self.load(const) if const.is_a?(Module) && !@loaded.include?(const)
18
21
  rescue LoadError
19
22
  end
20
23
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'ripper'
2
4
 
3
5
  module Dpl
@@ -10,6 +12,7 @@ module Dpl
10
12
  def all
11
13
  Dir[glob].sort.inject([]) do |gems, path|
12
14
  next gems if except.any? { |str| path.include?(str) }
15
+
13
16
  gems + Parse.new(File.read(path)).gems
14
17
  end
15
18
  end
@@ -24,6 +27,7 @@ module Dpl
24
27
 
25
28
  class Parse < Struct.new(:code)
26
29
  def gems
30
+ return [] unless sexp
27
31
  walk(*sexp).flatten.each_slice(3).to_a
28
32
  end
29
33
 
@@ -54,9 +58,9 @@ module Dpl
54
58
  walk(*nodes[0])
55
59
  when :string_content
56
60
  nodes[0][1]
57
- # when :void_stmt
58
- # else
59
- # raise key.to_s
61
+ # when :void_stmt
62
+ # else
63
+ # raise key.to_s
60
64
  end
61
65
  end
62
66
 
@@ -1,6 +1,8 @@
1
+ # frozen_string_literal: true
2
+
1
3
  GStore::Client.class_eval do
2
4
  def sign(str)
3
5
  digest = OpenSSL::Digest.new('sha1') # use undeprecated constant
4
- b64_hmac = Base64.encode64(OpenSSL::HMAC.digest(digest, @secret_key, str)).gsub("\n","")
6
+ Base64.encode64(OpenSSL::HMAC.digest(digest, @secret_key, str)).gsub("\n", '')
5
7
  end
6
8
  end
@@ -1,12 +1,13 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  class Version
3
4
  InvalidVersion = Class.new(ArgumentError)
4
5
  InvalidRequire = Class.new(ArgumentError)
5
6
 
6
7
  MSGS = {
7
8
  version: 'Unable to parse version: %p',
8
- require: 'Unable to parse requirement: %p',
9
- }
9
+ require: 'Unable to parse requirement: %p'
10
+ }.freeze
10
11
 
11
12
  VERSION = /^(\d+)(?:\.(\d+))?(?:\.(\d+))?$/
12
13
  REQUIRE = /^(~>|>|>=|=|!=|<=|<) (\d+(?:\.\d+)?(?:\.\d+)?)$/
@@ -18,7 +19,7 @@ class Version
18
19
  end
19
20
 
20
21
  def satisfies?(str)
21
- send *parse(str) || raise(InvalidRequire, MSGS[:require] % str)
22
+ send(*parse(str) || raise(InvalidRequire, MSGS[:require] % str))
22
23
  end
23
24
 
24
25
  def size
@@ -69,15 +70,15 @@ class Version
69
70
 
70
71
  private
71
72
 
72
- attr_reader :nums
73
+ attr_reader :nums
73
74
 
74
- def split(str)
75
- str =~ VERSION && [$1, $2, $3].compact.map(&:to_i)
76
- end
75
+ def split(str)
76
+ str =~ VERSION && [::Regexp.last_match(1), ::Regexp.last_match(2), ::Regexp.last_match(3)].compact.map(&:to_i)
77
+ end
77
78
 
78
- def parse(str)
79
- op, version = str =~ REQUIRE && [$1, $2]
80
- op = '==' if op == '='
81
- [op, Version.new(version)] if op
82
- end
79
+ def parse(str)
80
+ op, version = str =~ REQUIRE && [::Regexp.last_match(1), ::Regexp.last_match(2)]
81
+ op = '==' if op == '='
82
+ [op, Version.new(version)] if op
83
+ end
83
84
  end
data/lib/dpl/version.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Dpl
2
- VERSION = '2.0.3.beta.4'
4
+ VERSION = '2.0.3.beta.5'
3
5
  end
data/lib/dpl.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'dpl/cli'
2
4
  require 'dpl/ctx'
3
5
  require 'dpl/provider'