departure 2.0.0 → 2.0.1

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
  SHA1:
3
- metadata.gz: ef3cc8883b3b4dc294f1b94b7d93744e98812849
4
- data.tar.gz: 242eac0339dd6f9aedf020d321cd9e6cc0bc24fe
3
+ metadata.gz: 46a9c8a62c998a6bf3caf83ed058da349e5acd37
4
+ data.tar.gz: 589cbb49256f86b439f2efd1f8091a837826543e
5
5
  SHA512:
6
- metadata.gz: 515ab293664312a15f3482f1b0cc0156c325b59df452fa82a9a700adbff81197d1cfffcb4b1296a1afdad47f828a6aeffe0e5b831b61ff37dd89fab0127abdd4
7
- data.tar.gz: 35b2746785ba419acddf8e2629e564f9382e7107fd4e57dcd75750e7440f347b3d1e4ce4c96a22a330096bec2bb383ef039070244a522dfd27df87018f850dd1
6
+ metadata.gz: 750081ba7900c49b24771556c38ce074302ac3db19c713c697fa3631108a8674056d7a42dac53a6978a04f8fdddb7ceac8c4603d11ef8a5579128c8bb5caf206
7
+ data.tar.gz: d083c3d43c83161ddb1c243582d8b1910589b687b751b0209a52c27058be29b026f295cae1e3b1cb2c133b4ef20f8c9edfa32a27958e3ed028951c9cbc502e73
@@ -8,9 +8,22 @@ Please follow the format in [Keep a Changelog](http://keepachangelog.com/)
8
8
 
9
9
  ### Added
10
10
  ### Changed
11
+ ### Deprecated
11
12
  ### Removed
12
13
  ### Fixed
13
14
 
15
+ ## [2.0.1 - 2017-05-11]
16
+
17
+ ### Added
18
+
19
+ - Allow running on other than default MySQL port
20
+
21
+ ### Changed
22
+ ### Removed
23
+ ### Fixed
24
+
25
+ - Handle special characters in connection's password
26
+
14
27
  ## [2.0.0 - 2017-04-20]
15
28
 
16
29
  ### Added
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Departure [![Build Status](https://travis-ci.org/redbooth/departure.svg?branch=master)](https://travis-ci.org/redbooth/percona_migrator) [![Code Climate](https://codeclimate.com/github/redbooth/percona_migrator/badges/gpa.svg)](https://codeclimate.com/github/redbooth/percona_migrator)
1
+ # Departure [![Build Status](https://travis-ci.org/redbooth/departure.svg?branch=master)](https://travis-ci.org/redbooth/departure) [![Code Climate](https://codeclimate.com/github/redbooth/departure/badges/gpa.svg)](https://codeclimate.com/github/redbooth/departure)
2
2
 
3
3
  Departure is an **ActiveRecord connection adapter** that allows running
4
4
  **MySQL online and non-blocking DDL** through `ActiveRecord::Migration` without needing
@@ -62,7 +62,7 @@ You can also get it from [Percona's apt repository](https://www.percona.com/doc/
62
62
  Once installed, add this line to your application's Gemfile:
63
63
 
64
64
  ```ruby
65
- gem 'percona_migrator'
65
+ gem 'departure'
66
66
  ```
67
67
 
68
68
  And then execute:
@@ -71,7 +71,7 @@ And then execute:
71
71
 
72
72
  Or install it yourself as:
73
73
 
74
- $ gem install percona_migrator
74
+ $ gem install departure
75
75
 
76
76
  ## Usage
77
77
 
@@ -144,7 +144,7 @@ end
144
144
  ```
145
145
 
146
146
  It's strongly recommended to name it after this gems name, such as
147
- `config/initializers/percona_migrator.rb`
147
+ `config/initializers/departure.rb`
148
148
 
149
149
  ## How it works
150
150
 
@@ -155,15 +155,15 @@ it using the `PerconaAdapter` instead of the one you defined in your
155
155
 
156
156
  Then, when any migration DSL methods such as `add_column` or `create_table` are
157
157
  executed, they all go to the
158
- [PerconaAdapter](https://github.com/redbooth/percona_migrator/blob/master/lib/active_record/connection_adapters/percona_adapter.rb).
158
+ [PerconaAdapter](https://github.com/redbooth/departure/blob/master/lib/active_record/connection_adapters/percona_adapter.rb).
159
159
  There, the methods that require `ALTER TABLE` SQL statements, like `add_column`,
160
160
  are overriden to get executed with
161
- [PerconaMigrator::Runner](https://github.com/redbooth/percona_migrator/blob/master/lib/percona_migrator/runner.rb),
161
+ [PerconaMigrator::Runner](https://github.com/redbooth/departure/blob/master/lib/departure/runner.rb),
162
162
  which deals with the `pt-online-schema-change` binary. All the others, like
163
163
  `create_table`, are delegated to the ActiveRecord's built in Mysql2Adapter and
164
164
  so they follow the regular path.
165
165
 
166
- [PerconaMigrator::Runner](https://github.com/redbooth/percona_migrator/blob/master/lib/percona_migrator/runner.rb)
166
+ [PerconaMigrator::Runner](https://github.com/redbooth/departure/blob/master/lib/departure/runner.rb)
167
167
  spawns a new process that runs the `pt-online-schema-change` binary present in
168
168
  the system, with the apropriate arguments for the generated SQL.
169
169
 
@@ -186,7 +186,7 @@ git commits and tags, and push the `.gem` file to
186
186
  ## Contributing
187
187
 
188
188
  Bug reports and pull requests are welcome on GitHub at
189
- https://github.com/redbooth/percona_migrator. They need to be opened against
189
+ https://github.com/redbooth/departure. They need to be opened against
190
190
  `master` or `v3.2` only if the changes fix a bug in Rails 3.2 apps.
191
191
 
192
192
  Please note that this project is released with a Contributor Code of Conduct. By
@@ -1,4 +1,4 @@
1
- # Releasing Percona Migrator
1
+ # Releasing Departure
2
2
 
3
3
  All releases come from the master branch. All other branches won't be maintained
4
4
  and will receive bug fix releases only.
@@ -7,7 +7,7 @@ In order to give support to a new major Rails version, we'll branch off of
7
7
  master, name it following the Rails repo convention, such as `v4.2`, and
8
8
  we'll keep it open for bug fixes.
9
9
 
10
- 1. Update `lib/percona_migrator/version.rb` accordingly
10
+ 1. Update `lib/departure/version.rb` accordingly
11
11
  2. Review the `CHANGELOG.md` and add a new section following the format
12
12
  `[version] - YYYY-MM-DD`. We conform to the guidelines of
13
13
  http://keepachangelog.com/
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require "bundler/setup"
4
- require "percona_migrator"
4
+ require "departure"
5
5
 
6
6
  # You can add fixtures and/or initialization code here to make experimenting
7
7
  # with your gem easier. You can also use a different console, if you like.
@@ -7,7 +7,7 @@ require 'departure/version'
7
7
  Gem::Specification.new do |spec|
8
8
  spec.name = 'departure'
9
9
  spec.version = Departure::VERSION
10
- spec.authors = ['Ilya Zayats', 'Pau Pérez', 'Fran Casas', 'Jorge Morante', 'Adrian Serafin']
10
+ spec.authors = ['Ilya Zayats', 'Pau Pérez', 'Fran Casas', 'Jorge Morante', 'Enrico Stano', 'Adrian Serafin']
11
11
  spec.email = ['ilya.zayats@redbooth.com', 'pau.perez@redbooth.com', 'fran.casas@redbooth.com', 'jorge.morante@redbooth.com', 'adrian@softmad.pl']
12
12
 
13
13
  spec.summary = %q{pt-online-schema-change runner for ActiveRecord migrations}
@@ -2,6 +2,7 @@ module Departure
2
2
  # Holds the parameters of the DB connection and formats them to string
3
3
  class ConnectionDetails
4
4
 
5
+ DEFAULT_PORT = 3306
5
6
  # Constructor
6
7
  #
7
8
  # @param [Hash] connection parametes as used in #establish_conneciton
@@ -14,7 +15,7 @@ module Departure
14
15
  #
15
16
  # @return [String]
16
17
  def to_s
17
- @to_s ||= "-h #{host} -u #{user} #{password_argument}"
18
+ @to_s ||= "-h #{host} -P #{port} -u #{user} #{password_argument}"
18
19
  end
19
20
 
20
21
  # TODO: Doesn't the abstract adapter already handle this somehow?
@@ -33,7 +34,7 @@ module Departure
33
34
  # @return [String]
34
35
  def password_argument
35
36
  if password.present?
36
- "-p #{password}"
37
+ %Q[--password "#{password}" ]
37
38
  else
38
39
  ''
39
40
  end
@@ -66,5 +67,12 @@ module Departure
66
67
  def password
67
68
  ENV.fetch('PERCONA_DB_PASSWORD', connection_data[:password])
68
69
  end
70
+
71
+ # Returns the database's port.
72
+ #
73
+ # @return [String]
74
+ def port
75
+ connection_data.fetch(:port, DEFAULT_PORT)
76
+ end
69
77
  end
70
78
  end
@@ -1,3 +1,3 @@
1
1
  module Departure
2
- VERSION = '2.0.0'.freeze
2
+ VERSION = '2.0.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,18 +1,19 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: departure
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ilya Zayats
8
8
  - Pau Pérez
9
9
  - Fran Casas
10
10
  - Jorge Morante
11
+ - Enrico Stano
11
12
  - Adrian Serafin
12
13
  autorequire:
13
14
  bindir: bin
14
15
  cert_chain: []
15
- date: 2017-04-20 00:00:00.000000000 Z
16
+ date: 2017-05-11 00:00:00.000000000 Z
16
17
  dependencies:
17
18
  - !ruby/object:Gem::Dependency
18
19
  name: rails