groundskeeper-bitcore 0.24.0 → 0.26.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: 8278cfd933803e54d5a6bf014110aa91a0b00d21ce9083fa71fc8b75045682e2
4
- data.tar.gz: 7cbd2e2c351f82c7514acc9c64ffabf00a76f3a16b526c11474378bc7e4ea5c2
3
+ metadata.gz: 487deba234c2f61bd24c532e024f46ab91bf615ef629dd7bebe98e0af2c8e1ca
4
+ data.tar.gz: 051c6767dc1c7e3d55b53b7fb47ae049fb0aa55e6bf72f32949bc4a69befb583
5
5
  SHA512:
6
- metadata.gz: b7d85b6a917b0d63015285e6df73b4ebe05e51bb5444c9a846e6c4dcfee36e87e2e7a60058bdea5b1c3aaf5a4c0b75423098576a2575a8823ed5115797eef960
7
- data.tar.gz: 195c7b921fd5aae30ca88197571330261c8cee193483f14b3bfce45cdb73affb7a380d7af404e95fdf5c6271412c8399333524e7c1b53bf84fed5ffc5db9ffee
6
+ metadata.gz: 80f39b0dbeb4e1dcb1c83ad1ce380ab5338c14dc4283317f353e7b93ac83fb2328b160f86f53f4812d649e13f49e7fc13c9c014cb11fb0be92e1ae823ef533d3
7
+ data.tar.gz: dd611aebef24842096a6a8e365bc4bc379c29cbefdff40ceeb8214553a5ca447b0f58f43a5d7aaf9afc19b51cbd4933f4d45f4f7d3600950d294c0cb19fb955f
data/.rubocop.yml CHANGED
@@ -1,4 +1,6 @@
1
- require: rubocop-performance
1
+ require:
2
+ - rubocop-minitest
3
+ - rubocop-performance
2
4
 
3
5
  inherit_mode:
4
6
  merge:
@@ -8,6 +10,7 @@ AllCops:
8
10
  Exclude:
9
11
  - bin/**/*
10
12
  TargetRubyVersion: 3.0
13
+ NewCops: enable
11
14
 
12
15
  Metrics/AbcSize:
13
16
  Exclude:
@@ -42,3 +45,9 @@ Style/StringLiterals:
42
45
 
43
46
  Style/IfUnlessModifier:
44
47
  Enabled: false
48
+
49
+ Style/OpenStructUse:
50
+ Enabled: false
51
+
52
+ Gemspec/DevelopmentDependencies:
53
+ EnforcedStyle: "gemspec"
data/Rakefile CHANGED
@@ -10,8 +10,11 @@ Rake::TestTask.new(:test) do |t|
10
10
  t.test_files = FileList["test/**/*_test.rb"]
11
11
  end
12
12
 
13
+ task :rubocop do
14
+ RuboCop::RakeTask.new
15
+ end
16
+
13
17
  task :default do
14
18
  Rake::Task["test"].invoke
15
- RuboCop::RakeTask.new
16
19
  Rake::Task["rubocop"].invoke
17
20
  end
data/config/deploy.rb CHANGED
@@ -5,9 +5,9 @@ require "mina/git"
5
5
  require "mina/rvm" # for rvm support. (https://rvm.io)
6
6
  require "mina/whenever"
7
7
 
8
- require_relative "./git_config"
9
- require_relative "./predeploy"
10
- require_relative "./tasks"
8
+ require_relative "git_config"
9
+ require_relative "predeploy"
10
+ require_relative "tasks"
11
11
 
12
12
  def load_project
13
13
  invoke :before_run unless fetch(:project)
@@ -24,6 +24,7 @@ set :shared_dirs, fetch(:shared_dirs, []).push(
24
24
  "tmp/cache",
25
25
  "tmp/sockets",
26
26
  "bundle",
27
+ "node_modules",
27
28
  "public/packs",
28
29
  "public/system",
29
30
  "storage"
@@ -47,11 +48,6 @@ task :environment do
47
48
  # invoke :'rvm:use', 'ruby-1.9.3-p125@default'
48
49
  end
49
50
 
50
- # Put any custom commands you need to run at setup
51
- # All paths in `shared_dirs` and `shared_paths` will be created on their own.
52
- task :setup do
53
- end
54
-
55
51
  task :staging do
56
52
  set :stage, :staging
57
53
  set :rails_env, "staging"
@@ -74,10 +70,10 @@ task predeploy: :remote_environment do
74
70
  run :remote do
75
71
  invoke :setup
76
72
  end
77
- invoke :'deploy_configure:create_configs'
78
- invoke :'deploy_prepare:create_vhost'
79
- invoke :'deploy_prepare:configure_pg'
80
- invoke :'deploy_prepare:set_owner'
73
+ invoke :"deploy_configure:create_configs"
74
+ invoke :"deploy_prepare:create_vhost"
75
+ invoke :"deploy_prepare:configure_pg"
76
+ invoke :"deploy_prepare:set_owner"
81
77
  end
82
78
 
83
79
  desc "Deploys the current version to the server."
@@ -89,13 +85,14 @@ task deploy: :remote_environment do
89
85
  invoke :rvm_use
90
86
  invoke :checkout_release
91
87
  invoke :link_shared_dirs
92
- invoke :'bundle:install'
93
- invoke :'rails:db_migrate'
94
- invoke :'rails:assets_precompile'
95
- invoke :'deploy:cleanup'
88
+ invoke :"bundle:install"
89
+ invoke :"rails:db_migrate"
90
+ invoke :rails, "yarn:install"
91
+ invoke :rails, "assets:precompile"
92
+ invoke :"deploy:cleanup"
96
93
 
97
94
  on :launch do
98
- invoke(:'whenever:update') if ENV["whenever"]
95
+ invoke(:"whenever:update") if ENV["whenever"]
99
96
  invoke :restart
100
97
  end
101
98
  end
data/config/git_config.rb CHANGED
@@ -38,7 +38,7 @@ task :before_run do
38
38
  tags = project.tags
39
39
  raise "There must be a tagged release prior to deploying." if tags.count.zero?
40
40
 
41
- tag = ENV["tag"]
41
+ tag = ENV.fetch("tag", nil)
42
42
  unless tags.include? tag
43
43
  raise "Tag \"#{tag}\" not found. Available tags:\n #{tags.join("\n")}"
44
44
  end
data/config/predeploy.rb CHANGED
@@ -44,7 +44,7 @@ def active_storage_dir
44
44
  "#{fetch :deploy_to}/shared/storage"
45
45
  end
46
46
 
47
- FORCE_OVERWRITE = ENV["force_overwrite"]
47
+ FORCE_OVERWRITE = ENV.fetch("force_overwrite", nil)
48
48
 
49
49
  # rubocop:disable Metrics/BlockLength
50
50
  namespace :deploy_configure do
@@ -62,7 +62,7 @@ namespace :deploy_configure do
62
62
  end
63
63
 
64
64
  if File.exist? "./config/secrets.yml"
65
- invoke :'deploy_configure:copy_secrets'
65
+ invoke :"deploy_configure:copy_secrets"
66
66
  end
67
67
 
68
68
  comment "Writing staging secrets to #{secrets_config_file}"
data/config/tasks.rb CHANGED
@@ -27,7 +27,7 @@ task :link_shared_dirs do
27
27
  )
28
28
 
29
29
  comment "Shared directories: #{(fetch :shared_dirs).join("\n")}"
30
- invoke :'deploy:link_shared_paths'
30
+ invoke :"deploy:link_shared_paths"
31
31
  end
32
32
 
33
33
  desc "Open the newly deployed server in the browser (for macOS)."
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
  spec.metadata["allowed_push_host"] = "https://rubygems.org"
21
21
  else
22
22
  raise "RubyGems 2.0 or newer is required to protect against " \
23
- "public gem pushes."
23
+ "public gem pushes."
24
24
  end
25
25
 
26
26
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
@@ -40,6 +40,8 @@ Gem::Specification.new do |spec|
40
40
  spec.add_development_dependency "byebug", "~> 11.1"
41
41
  spec.add_development_dependency "minitest", "~> 5.0"
42
42
  spec.add_development_dependency "rubocop", "~> 1.23"
43
+ spec.add_development_dependency "rubocop-minitest"
43
44
  spec.add_development_dependency "rubocop-performance", "~> 1.12"
44
45
  spec.add_development_dependency "simplecov", "~> 0.14"
46
+ spec.metadata["rubygems_mfa_required"] = "true"
45
47
  end
@@ -12,7 +12,7 @@ module Groundskeeper
12
12
  COMMAND = "curl"
13
13
  BITBUCKET_USERNAME = "BITBUCKET_USERNAME"
14
14
  BITBUCKET_APP_PASSWORD = "BITBUCKET_APP_PASSWORD"
15
- URL = "https://api.bitbucket.org/2.0/repositories/"\
15
+ URL = "https://api.bitbucket.org/2.0/repositories/" \
16
16
  "isgmh-radd/%<repository>s/pullrequests"
17
17
  CREATE_PR = <<~REQUEST.split.join(" ")
18
18
  #{URL} -u %<username>s:%<password>s
@@ -36,8 +36,8 @@ module Groundskeeper
36
36
  # rubocop:disable Metrics/MethodLength
37
37
  def create_pr(repository:, branch_name:)
38
38
  response = bitbucket.execute(format(CREATE_PR,
39
- username: ENV[BITBUCKET_USERNAME],
40
- password: ENV[BITBUCKET_APP_PASSWORD],
39
+ username: ENV.fetch(BITBUCKET_USERNAME, nil),
40
+ password: ENV.fetch(BITBUCKET_APP_PASSWORD, nil),
41
41
  repository: repository,
42
42
  branch_name: branch_name))
43
43
 
@@ -24,7 +24,7 @@ module Groundskeeper
24
24
 
25
25
  # rubocop:disable Performance/RedundantMatch,Performance/RegexpMatch
26
26
  def update_file(version, changes)
27
- unless document.match(/(#{TITLE_EXPRESSION})/)
27
+ unless document.match(/(#{TITLE_EXPRESSION})/o)
28
28
  document.prepend_file("#{TITLE_EXPRESSION}\n\n")
29
29
  end
30
30
 
@@ -2,7 +2,6 @@
2
2
 
3
3
  require "rake"
4
4
  require "mina"
5
- require "pp"
6
5
  require "open3"
7
6
 
8
7
  class VersionError < StandardError; end
@@ -195,27 +194,33 @@ module Groundskeeper
195
194
 
196
195
  def pull_project_details
197
196
  @pull_project_details ||= begin
198
- announce_step("Updating ~/.project_details from "\
197
+ announce_step("Updating ~/.project_details from " \
199
198
  "#{git.remote_url('.project_details')}")
200
199
  git.pull(".project_details")
201
200
  end
202
201
  end
203
202
 
203
+ # rubocop:disable Metrics/MethodLength
204
204
  def check_groundskeeper_version
205
205
  @check_groundskeeper_version ||= begin
206
206
  console.say("Groundskeeper version #{Groundskeeper::VERSION}\n\n",
207
207
  :bold)
208
208
  latest_version = rubygems.latest_groundskeeper_version
209
209
 
210
- return true unless SemanticVersion.new(latest_version) > VERSION
211
-
212
- return false unless install_latest_groundskeeper?
213
-
214
- console.run("gem install groundskeeper-bitcore")
210
+ # rubocop:disable Style/InverseMethods
211
+ if !(SemanticVersion.new(latest_version) > VERSION)
212
+ true
213
+ elsif !install_latest_groundskeeper?
214
+ false
215
+ else
216
+ console.run("gem install groundskeeper-bitcore")
215
217
 
216
- true
218
+ true
219
+ end
220
+ # rubocop:enable Style/InverseMethods
217
221
  end
218
222
  end
223
+ # rubocop:enable Metrics/MethodLength
219
224
 
220
225
  # :nocov:
221
226
  def install_latest_groundskeeper?
@@ -306,9 +311,9 @@ module Groundskeeper
306
311
 
307
312
  def add_version_to_sentry
308
313
  announce_step "Add release to Sentry and mark deployed"
309
- sentry.create_release(ENV[TAG])
310
- sentry.associate_commits(ENV[TAG])
311
- sentry.deploy(ENV[TAG], self.class.stage)
314
+ sentry.create_release(ENV.fetch(TAG, nil))
315
+ sentry.associate_commits(ENV.fetch(TAG, nil))
316
+ sentry.deploy(ENV.fetch(TAG, nil), self.class.stage)
312
317
  console.say("# added version to Sentry", :green)
313
318
  end
314
319
 
@@ -412,7 +417,7 @@ module Groundskeeper
412
417
  retry if tries < 3
413
418
  # :nocov:
414
419
  console.say(
415
- "something went wrong: expected version #{ENV[TAG]}, " \
420
+ "something went wrong: expected version #{ENV.fetch(TAG, nil)}, " \
416
421
  "found version #{deployed_version} instead",
417
422
  :red
418
423
  )
@@ -51,7 +51,7 @@ module Groundskeeper
51
51
  end
52
52
 
53
53
  def write_file(content)
54
- File.open(path, "wb") { |file| file.write(content) }
54
+ File.binwrite(path, content)
55
55
  end
56
56
 
57
57
  def read
@@ -29,9 +29,9 @@ module Groundskeeper
29
29
 
30
30
  def initialize
31
31
  @client = JIRA::Client.new(
32
- username: ENV[JIRA_USERNAME_KEY],
33
- password: ENV[JIRA_API_TOKEN_KEY],
34
- site: ENV[JIRA_SITE_KEY],
32
+ username: ENV.fetch(JIRA_USERNAME_KEY, nil),
33
+ password: ENV.fetch(JIRA_API_TOKEN_KEY, nil),
34
+ site: ENV.fetch(JIRA_SITE_KEY, nil),
35
35
  context_path: "",
36
36
  auth_type: :basic,
37
37
  read_timeout: 120
@@ -47,7 +47,7 @@ module Groundskeeper
47
47
  git
48
48
  .raw_changes_since_latest_tag
49
49
  .map { |c| c.gsub(COMMIT_HASH, "") }
50
- .reject { |c| c.match(/#{format(RELEASE_MESSAGE, "")}/) }
50
+ .reject { |c| c.match(/#{format(RELEASE_MESSAGE, '')}/) }
51
51
  end
52
52
 
53
53
  def bumped_semantic_version(type)
@@ -25,9 +25,9 @@ module Groundskeeper
25
25
  def send_message(message)
26
26
  slack.execute(format(SEND_MESSAGE,
27
27
  message: message,
28
- workspace: ENV[SLACK_WORKSPACE_KEY],
29
- channel: ENV[SLACK_CHANNEL_KEY],
30
- token: ENV[SLACK_TOKEN_KEY]))
28
+ workspace: ENV.fetch(SLACK_WORKSPACE_KEY, nil),
29
+ channel: ENV.fetch(SLACK_CHANNEL_KEY, nil),
30
+ token: ENV.fetch(SLACK_TOKEN_KEY, nil)))
31
31
  end
32
32
 
33
33
  def credentials?
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Groundskeeper
4
- VERSION = "0.24.0"
4
+ VERSION = "0.26.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: groundskeeper-bitcore
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.24.0
4
+ version: 0.26.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - RADD
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-31 00:00:00.000000000 Z
11
+ date: 2023-09-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jira-ruby
@@ -122,6 +122,20 @@ dependencies:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
124
  version: '1.23'
125
+ - !ruby/object:Gem::Dependency
126
+ name: rubocop-minitest
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
125
139
  - !ruby/object:Gem::Dependency
126
140
  name: rubocop-performance
127
141
  requirement: !ruby/object:Gem::Requirement
@@ -207,6 +221,7 @@ licenses:
207
221
  - MIT
208
222
  metadata:
209
223
  allowed_push_host: https://rubygems.org
224
+ rubygems_mfa_required: 'true'
210
225
  post_install_message:
211
226
  rdoc_options: []
212
227
  require_paths: