mysql_in_docker 0.0.0 → 0.0.3

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: 5ac0312b549e92f648616d877774298b1e77f3c57bfd6ba70b5629b2265ae583
4
- data.tar.gz: 49d06429bb62a25712fc9cf67febd09b668266551948da54b2e400c0025b3542
3
+ metadata.gz: a200afe8fada88ec37ac643a3da2348e01874c3e12cf0282c7a36afba2b9ddbb
4
+ data.tar.gz: ad522ee1ff382b246a4ec58d18ea911d0d33438eec8ab3609769080e96c3102d
5
5
  SHA512:
6
- metadata.gz: 66411132d72aee2a6d7527125037ebbfc8d218b308c1597ad00a24c202c465d510e7738a8b5f89be6d0197446ca1bf7fe1cd134f0c7751326655e05a0079b57e
7
- data.tar.gz: b2c6ee8fedc5b7f2bd013bf5ed52ca34520ba7132d9f1cb7e7b1cc3102252282a014d39a3cce08ee3efe63e31543fc590aebd89aa04f53eb93cd90471dc45c4e
6
+ metadata.gz: f12bfd6a2b0a5adbe862101b18698d2bf27399d17aca87ca7c56feb7fbe891211a47ba826e7684b4c7a1efe973fcb1421a012b57252593b5703f36b43c0ab472
7
+ data.tar.gz: 18fb8a92f1e97f84adef7fb0180a4421cd4d08ee62598816701e221975ef2bea14c81a5aef104f9a69bb40db706590d82cea44f6076c821f8b494081cec80357
data/.bundle/config CHANGED
@@ -1,4 +1,6 @@
1
1
  ---
2
2
  BUNDLE_PATH: "vendor/bundle"
3
- BUNDLE_JOBS: "4"
4
3
  BUNDLE_BIN: "vendor/bundle/bin"
4
+ BUNDLE_JOBS: "4"
5
+ BUNDLE_CLEAN: "true"
6
+ BUNDLE_DISABLE_SHARED_GEMS: "true"
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- mysql_in_docker (0.0.0)
4
+ mysql_in_docker (0.0.3)
5
5
  thor
6
6
 
7
7
  GEM
@@ -39,6 +39,7 @@ GEM
39
39
  unicode-display_width (2.1.0)
40
40
 
41
41
  PLATFORMS
42
+ arm64-darwin-21
42
43
  x86_64-linux
43
44
 
44
45
  DEPENDENCIES
data/lib/commands.rb CHANGED
@@ -34,8 +34,8 @@ module MysqlInDocker
34
34
  end
35
35
  end
36
36
 
37
- desc "rm ID", "Remove mysql container and volume."
38
- def rm(id)
37
+ desc "remove ID", "Remove mysql container and volume."
38
+ def remove(id)
39
39
  stop id
40
40
 
41
41
  status = docker_command "volume rm #{get_container_name(id)}"
@@ -61,6 +61,15 @@ module MysqlInDocker
61
61
  "mysql_in_docker_#{id}"
62
62
  end
63
63
 
64
+ def get_image_name(version)
65
+ is_arm = RUBY_PLATFORM.start_with? "arm"
66
+ image = is_arm ? "mysql/mysql-server" : "mysql"
67
+
68
+ return "#{image}:8.0" if is_arm && version == "8"
69
+
70
+ "#{image}:#{version}"
71
+ end
72
+
64
73
  def up_command(id, version, port, mysql_root_password) # rubocop:disable Metrics/MethodLength
65
74
  [
66
75
  "run",
@@ -72,7 +81,7 @@ module MysqlInDocker
72
81
  "--volume",
73
82
  "#{get_container_name(id)}:/var/lib/mysql",
74
83
  "-d",
75
- "mysql:#{version}"
84
+ get_image_name(version)
76
85
  ].join(" ")
77
86
  end
78
87
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MysqlInDocker
4
- VERSION = "0.0.0"
4
+ VERSION = "0.0.3"
5
5
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative "mysql_in_docker/version"
4
- require "./lib/commands"
4
+ require_relative "./commands"
5
5
 
6
6
  module MysqlInDocker
7
7
  class Error < StandardError; end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mysql_in_docker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sijia Wang
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-12-23 00:00:00.000000000 Z
11
+ date: 2022-05-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -72,7 +72,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
72
72
  - !ruby/object:Gem::Version
73
73
  version: '0'
74
74
  requirements: []
75
- rubygems_version: 3.2.32
75
+ rubygems_version: 3.3.7
76
76
  signing_key:
77
77
  specification_version: 4
78
78
  summary: Easly use mysql with docker.