lucy_dockerunner 0.1.5 → 0.1.6

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: 4446f3dd1ecb3193d0868bd3247ffa451352bddee1cf81e5d8e9bf9aad3936cb
4
- data.tar.gz: cc912d91c7691de292b7ea115a0fcada45871057d3a10e69132a088cdad5c294
3
+ metadata.gz: ed51fadc53b795aa23350c7ce49b87d25234cee22ed9a65d310815077f5b8972
4
+ data.tar.gz: ca61bacb4fc54f6432ddb5bca8167343881410ac2ae4eb7198c824dd91c5d20d
5
5
  SHA512:
6
- metadata.gz: 1e48250f0baca9e750660853c344d4cf99abf7e6290d12aebb2ea07955e1964076af66417bdb391cf719d7f337c989c23bc9879bf0c722ee88dc370306e7a41c
7
- data.tar.gz: fd287ccf462d6017fc054ccf2e7075a6f17ccf871c24c4a29d60126adc8ab8394bd13462a0773dfb917584ad76649853354679b4705148365f92e7a97d22eb86
6
+ metadata.gz: 8a4f5083d80a651b373d23cac7edead9f248defe9a2590c8653ed3f9bfc63094ed8dc8ba6d12f6bf1c107bd816442398bcf18b88164fe96657377cbdf03a9e6e
7
+ data.tar.gz: c9be619deded43389003507a4c2893cb602be2fd35511c2c6873c00ca36a6d9f20c4d24ec05b630f1104d3544b653f3805d3a7d36b0f54c96469cc5b922fedd3
data/.rubocop.yml CHANGED
@@ -1,5 +1,7 @@
1
1
  AllCops:
2
2
  TargetRubyVersion: 2.6
3
+ SuggestExtensions: false
4
+ NewCops: enable
3
5
 
4
6
  Style/StringLiterals:
5
7
  Enabled: true
@@ -10,4 +12,9 @@ Style/StringLiteralsInInterpolation:
10
12
  EnforcedStyle: double_quotes
11
13
 
12
14
  Layout/LineLength:
13
- Max: 120
15
+ Max: 180
16
+
17
+ Metrics/BlockLength:
18
+ Exclude:
19
+ - 'spec/**/*'
20
+ - 'lib/tasks/**/*'
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lucy_dockerunner (0.1.5)
4
+ lucy_dockerunner (0.1.6)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LucyDockerunner
4
- VERSION = "0.1.5"
4
+ VERSION = "0.1.6"
5
5
  end
@@ -1,9 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Rake::LucydHooks from https://github.com/guillermo/rake-hooks, authors Guillermo Iguaran, Joel Moss
3
+ # from https://github.com/guillermo/rake-hooks, authors Guillermo Iguaran, Joel Moss
4
4
  module Rake
5
+ # module Rake::Hooks
5
6
  module LucydHooks
6
- def before(*task_names, &new_task)
7
+ def bef(*task_names, &new_task)
7
8
  task_names.each do |task_name|
8
9
  old_task = Rake.application.instance_variable_get("@tasks").delete(task_name.to_s)
9
10
  next unless old_task
@@ -15,29 +16,8 @@ module Rake
15
16
  end
16
17
  end
17
18
  end
18
-
19
- def after(*task_names, &new_task)
20
- options = task_names.last.is_a?(Hash) ? task_names.pop : {}
21
- ignore_exceptions = options.delete(:ignore_exceptions) || false
22
-
23
- task_names.each do |task_name|
24
- old_task = Rake.application.instance_variable_get("@tasks").delete(task_name.to_s)
25
- next unless old_task
26
-
27
- desc old_task.full_comment if old_task.respond_to?(:full_comment)
28
- task task_name => old_task.prerequisites do
29
- begin
30
- old_task.invoke
31
- rescue StandardError
32
- raise unless ignore_exceptions
33
- end
34
-
35
- new_task.call
36
- end
37
- end
38
- end
39
19
  end
40
- end
41
20
 
42
- Rake::DSL.include Rake::LucydHooks if defined?(Rake::DSL)
43
- include Rake::LucydHooks unless self.class.included_modules.include?(Rake::LucydHooks)
21
+ Rake::DSL.include Rake::LucydHooks if defined?(Rake::DSL)
22
+ include Rake::LucydHooks unless self.class.included_modules.include?(Rake::LucydHooks)
23
+ end
@@ -187,8 +187,10 @@ end
187
187
 
188
188
  tasks_names.each do |task|
189
189
  before_action = "#{namesp}:#{task}"
190
- before before_action do
191
- dockerfile_checker ? abort("Dockerfile not found.\nYou must have a Dockerfile file.") : nil
192
- compose_checker ? (abort "Compose file not found.\nFor development, you must have a #{dev_compose_file} file.") : nil
190
+ bef before_action do
191
+ docker_abort_error = "Dockerfile not found.\nYou must have a Dockerfile file."
192
+ compose_abort_error = "Compose file not found.\nFor development, you must have a #{dev_compose_file} file."
193
+ dockerfile_checker ? abort(docker_abort_error) : puts("Dockerfile found.")
194
+ compose_checker ? abort(compose_abort_error) : puts("Compose file found.")
193
195
  end
194
196
  end
@@ -9,7 +9,7 @@ def task_helper
9
9
  end
10
10
 
11
11
  def compose_command
12
- @compose_comand ||= task_helper.compose_command
12
+ @compose_command ||= task_helper.compose_command
13
13
  end
14
14
 
15
15
  namespace :compose_assets do
@@ -8,7 +8,7 @@ def task_helper
8
8
  end
9
9
 
10
10
  def compose_command
11
- @compose_comand ||= task_helper.compose_command
11
+ @compose_command ||= task_helper.compose_command
12
12
  end
13
13
 
14
14
  namespace :compose_db do
@@ -8,7 +8,7 @@ def task_helper
8
8
  end
9
9
 
10
10
  def compose_command
11
- @compose_comand ||= task_helper.compose_command
11
+ @compose_command ||= task_helper.compose_command
12
12
  end
13
13
 
14
14
  namespace :compose_logs do
@@ -38,7 +38,8 @@ namespace :compose_prod do
38
38
  end
39
39
 
40
40
  task :install do
41
- puts "Installing Blockchain and Database Containers \nWARNING: This will delete all your data, and you are running this in production"
41
+ puts "Installing Blockchain and Database Containers \n
42
+ WARNING: This will delete all your data, and you are running this in production"
42
43
  # ask in terminal if you want to continue
43
44
  choice = ask("Are you sure you want to continue? (y/n)")
44
45
  if choice == "y"
@@ -241,8 +242,10 @@ end
241
242
 
242
243
  tasks_names.each do |task|
243
244
  before_action = "#{namesp}:#{task}"
244
- before before_action do
245
- dockerfile_checker ? abort("Dockerfile not found.\nYou must have a Dockerfile file.") : nil
246
- compose_checker ? (abort "Compose file not found.\nFor development, you must have a #{compose_file} file.") : nil
245
+ bef before_action do
246
+ docker_abort_error = "Dockerfile not found.\nYou must have a Dockerfile file."
247
+ compose_abort_error = "Compose file not found.\nYou must have a docker-compose.prod.yml file."
248
+ dockerfile_checker ? abort(docker_abort_error) : puts("Dockerfile found")
249
+ compose_checker ? abort(compose_abort_error) : puts("Compose Production file found")
247
250
  end
248
251
  end
@@ -8,7 +8,7 @@ def task_helper
8
8
  end
9
9
 
10
10
  def compose_command
11
- @compose_comand ||= task_helper.compose_command
11
+ @compose_command ||= task_helper.compose_command
12
12
  end
13
13
 
14
14
  namespace :compose_test do
@@ -4,9 +4,10 @@ require "English"
4
4
  require_relative "taskhelper"
5
5
 
6
6
  module TaskHelpers
7
+ # ComposeTaskhelper
7
8
  class ComposeTaskhelper < TaskHelpers::Taskhelper
8
9
  def compose_command
9
- @compose_comand ||= compose_command_finder
10
+ @compose_command ||= compose_command_finder
10
11
  end
11
12
 
12
13
  private
@@ -17,9 +18,9 @@ module TaskHelpers
17
18
  system "#{command} --version > /dev/null 2>&1"
18
19
  return command if $CHILD_STATUS.success?
19
20
 
20
- command = false unless $CHILD_STATUS.success?
21
+ command = false
22
+ raise ComposeError if command == false
21
23
  end
22
- raise ComposeError unless command == false
23
24
  end
24
25
  end
25
26
  end
@@ -1,7 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TaskHelpers
4
+ # Taskhelper
4
5
  class Taskhelper
6
+ # Compose Error
5
7
  class ComposeError < StandardError
6
8
  def initialize(message = "Docker Compose is not installed")
7
9
  super
@@ -10,15 +12,16 @@ module TaskHelpers
10
12
 
11
13
  private
12
14
 
13
- def dev_error(e)
15
+ def dev_error(error)
14
16
  return unless env_acceptable?
15
17
 
16
- puts "#{e.class}: #{e.message}"
17
- puts e.backtrace
18
+ puts "#{error.class}: #{error.message}"
19
+ puts error.backtrace
18
20
  end
19
21
 
20
22
  def env_acceptable?
21
- Rails.env.development? || Rails.env.test?
23
+ # Rails.env.development? || Rails.env.test?
24
+ true
22
25
  end
23
26
  end
24
27
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lucy_dockerunner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - JesusGautamah
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-02-13 00:00:00.000000000 Z
11
+ date: 2023-02-16 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |-
14
14
  This gem is a tool to run docker containers with rake commands, good for CI/CD and Rails projects.
@@ -51,6 +51,7 @@ metadata:
51
51
  homepage_uri: https://github.com/JesusGautamah/lucy_dockerunner
52
52
  source_code_uri: https://github.com/JesusGautamah/lucy_dockerunner
53
53
  changelog_uri: https://github.com/JesusGautamah/lucy_dockerunner/blob/master/CHANGELOG.md
54
+ rubygems_mfa_required: 'true'
54
55
  post_install_message:
55
56
  rdoc_options: []
56
57
  require_paths:
@@ -66,7 +67,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
66
67
  - !ruby/object:Gem::Version
67
68
  version: '0'
68
69
  requirements: []
69
- rubygems_version: 3.3.26
70
+ rubygems_version: 3.4.1
70
71
  signing_key:
71
72
  specification_version: 4
72
73
  summary: This gem is a tool to run docker containers with rake commands, good for