groundskeeper-bitcore 0.24.0 → 0.27.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8278cfd933803e54d5a6bf014110aa91a0b00d21ce9083fa71fc8b75045682e2
4
- data.tar.gz: 7cbd2e2c351f82c7514acc9c64ffabf00a76f3a16b526c11474378bc7e4ea5c2
3
+ metadata.gz: c0967a99ec4c66f0d12ed331e6f17c6bb58ce247a9fee5e79e9acc286358f9f2
4
+ data.tar.gz: ee544a0854c46b47ded3509b1aed80ddeec5e27e406f904a71bf3bee80ff013d
5
5
  SHA512:
6
- metadata.gz: b7d85b6a917b0d63015285e6df73b4ebe05e51bb5444c9a846e6c4dcfee36e87e2e7a60058bdea5b1c3aaf5a4c0b75423098576a2575a8823ed5115797eef960
7
- data.tar.gz: 195c7b921fd5aae30ca88197571330261c8cee193483f14b3bfce45cdb73affb7a380d7af404e95fdf5c6271412c8399333524e7c1b53bf84fed5ffc5db9ffee
6
+ metadata.gz: 246b4b67a0d5ed7bfe3c3db8c7557642fe911e9281ca46986b395d58bb509bd35d58e737282b9208dc21626d7ea6f5b89b32a8ea7e40adeeda9c3c41523b4a18
7
+ data.tar.gz: e649b4b4880d2c3246be3551aebb656602292c136dc55016b39692bbb437b9d490932577e80df468a92844fcb2233e026b0358ed75e8dbde1bf8760f66cab68a
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
 
@@ -55,7 +55,7 @@ module Groundskeeper
55
55
  # rubocop:enable Metrics/MethodLength
56
56
 
57
57
  def credentials?
58
- ENV[BITBUCKET_USERNAME].present? && ENV[BITBUCKET_APP_PASSWORD].present?
58
+ !ENV.fetch(BITBUCKET_USERNAME, "").empty? && !ENV.fetch(BITBUCKET_APP_PASSWORD, "").empty?
59
59
  end
60
60
 
61
61
  private
@@ -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?
@@ -287,7 +292,8 @@ module Groundskeeper
287
292
  message = jira.add_version_to_remote_issues(
288
293
  next_jira_version_name, issue_ids
289
294
  )
290
- if message.blank?
295
+
296
+ if message.nil? || message.empty?
291
297
  console.say("# added version to Jira issues #{issue_ids}", :green)
292
298
  else
293
299
  announce_error(message)
@@ -306,9 +312,9 @@ module Groundskeeper
306
312
 
307
313
  def add_version_to_sentry
308
314
  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)
315
+ sentry.create_release(ENV.fetch(TAG, nil))
316
+ sentry.associate_commits(ENV.fetch(TAG, nil))
317
+ sentry.deploy(ENV.fetch(TAG, nil), self.class.stage)
312
318
  console.say("# added version to Sentry", :green)
313
319
  end
314
320
 
@@ -412,7 +418,7 @@ module Groundskeeper
412
418
  retry if tries < 3
413
419
  # :nocov:
414
420
  console.say(
415
- "something went wrong: expected version #{ENV[TAG]}, " \
421
+ "something went wrong: expected version #{ENV.fetch(TAG, nil)}, " \
416
422
  "found version #{deployed_version} instead",
417
423
  :red
418
424
  )
@@ -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
@@ -104,9 +104,9 @@ module Groundskeeper
104
104
  end
105
105
 
106
106
  def credentials?
107
- ENV[JIRA_USERNAME_KEY].present? &&
108
- ENV[JIRA_API_TOKEN_KEY].present? &&
109
- ENV[JIRA_SITE_KEY].present?
107
+ !ENV.fetch(JIRA_USERNAME_KEY, "").empty? &&
108
+ !ENV.fetch(JIRA_API_TOKEN_KEY, "").empty? &&
109
+ !ENV.fetch(JIRA_SITE_KEY, "").empty?
110
110
  end
111
111
 
112
112
  # Returns the list of Jira issues found in a set of commit messages.
@@ -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)
@@ -51,7 +51,7 @@ module Groundskeeper
51
51
  end
52
52
 
53
53
  def credentials?
54
- ENV[SENTRY_AUTH_TOKEN].present? && ENV[SENTRY_ORG].present?
54
+ !ENV.fetch(SENTRY_AUTH_TOKEN, "").empty? && !ENV.fetch(SENTRY_ORG, "").empty?
55
55
  end
56
56
  end
57
57
  end
@@ -25,15 +25,15 @@ 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?
34
- ENV[SLACK_WORKSPACE_KEY].present? &&
35
- ENV[SLACK_CHANNEL_KEY].present? &&
36
- ENV[SLACK_TOKEN_KEY].present?
34
+ !ENV.fetch(SLACK_WORKSPACE_KEY, "").empty? &&
35
+ !ENV.fetch(SLACK_CHANNEL_KEY, "").empty? &&
36
+ !ENV.fetch(SLACK_TOKEN_KEY, "").empty?
37
37
  end
38
38
  end
39
39
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Groundskeeper
4
- VERSION = "0.24.0"
4
+ VERSION = "0.27.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.27.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-12-06 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: