departure 4.0.0 → 4.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 +4 -4
- data/CHANGELOG.md +12 -0
- data/RELEASING.md +1 -1
- data/lib/departure/option.rb +20 -8
- data/lib/departure/user_options.rb +1 -1
- data/lib/departure/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 89a3f4d1cb84878f4a556da1439057a2dc8a402e
|
4
|
+
data.tar.gz: c6b8f26150c220f793ef021b7dc1d7ceb0a7ebe7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 66727be4d155815b20da61075f06ddf5e94665e165a3cc9f5ebada94f96e63ac8940efc555a812a127fa013533feb2f3bc0e9342aa5ca0ca699ff8044f000efb
|
7
|
+
data.tar.gz: 89ae513dd2268fddea60c3e11325fcdc309ae02283b74d07a719b77ecf8df968d041d7d92af8d6a35f36d8b341e826a2ce6c42ac9154dec5606cf0da18462daa
|
data/CHANGELOG.md
CHANGED
@@ -12,6 +12,18 @@ Please follow the format in [Keep a Changelog](http://keepachangelog.com/)
|
|
12
12
|
### Removed
|
13
13
|
### Fixed
|
14
14
|
|
15
|
+
## [4.0.1] - 2017-08-01
|
16
|
+
|
17
|
+
### Added
|
18
|
+
|
19
|
+
- Support for all pt-osc command-line options, including short forms and array
|
20
|
+
arguments
|
21
|
+
|
22
|
+
### Changed
|
23
|
+
### Deprecated
|
24
|
+
### Removed
|
25
|
+
### Fixed
|
26
|
+
|
15
27
|
## [4.0.0] - 2017-06-12
|
16
28
|
|
17
29
|
### Added
|
data/RELEASING.md
CHANGED
@@ -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/
|
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/
|
data/lib/departure/option.rb
CHANGED
@@ -3,15 +3,11 @@ module Departure
|
|
3
3
|
attr_reader :name, :value
|
4
4
|
|
5
5
|
# Builds an instance by parsing its name and value out of the given string.
|
6
|
-
# Note the string must conform to "--<arg>=<value>" format.
|
7
6
|
#
|
8
7
|
# @param string [String]
|
9
8
|
# @return [Option]
|
10
9
|
def self.from_string(string)
|
11
|
-
|
12
|
-
name = pair[0][2..-1]
|
13
|
-
value = pair[1]
|
14
|
-
|
10
|
+
name, value = string.split(/\s|=/, 2)
|
15
11
|
new(name, value)
|
16
12
|
end
|
17
13
|
|
@@ -20,7 +16,7 @@ module Departure
|
|
20
16
|
# @param name [String]
|
21
17
|
# @param optional value [String]
|
22
18
|
def initialize(name, value = nil)
|
23
|
-
@name = name
|
19
|
+
@name = normalize_option(name)
|
24
20
|
@value = value
|
25
21
|
end
|
26
22
|
|
@@ -40,21 +36,37 @@ module Departure
|
|
40
36
|
name.hash
|
41
37
|
end
|
42
38
|
|
43
|
-
# Returns the option as string following the "--<name>=<value>" format
|
39
|
+
# Returns the option as string following the "--<name>=<value>" format or
|
40
|
+
# the short "-n=value" format
|
44
41
|
#
|
45
42
|
# @return [String]
|
46
43
|
def to_s
|
47
|
-
"
|
44
|
+
"#{name}#{value_as_string}"
|
48
45
|
end
|
49
46
|
|
50
47
|
private
|
51
48
|
|
49
|
+
# Returns the option name in "long" format, e.g., "--name"
|
50
|
+
#
|
51
|
+
# @return [String]
|
52
|
+
def normalize_option(name)
|
53
|
+
if name.start_with?('-')
|
54
|
+
name
|
55
|
+
elsif name.length == 1
|
56
|
+
"-#{name}"
|
57
|
+
else
|
58
|
+
"--#{name}"
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
52
62
|
# Returns the value fragment of the option string if any value is specified
|
53
63
|
#
|
54
64
|
# @return [String]
|
55
65
|
def value_as_string
|
56
66
|
if value.nil?
|
57
67
|
''
|
68
|
+
elsif value.include?("=")
|
69
|
+
" #{value}"
|
58
70
|
else
|
59
71
|
"=#{value}"
|
60
72
|
end
|
data/lib/departure/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: departure
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ilya Zayats
|
@@ -13,7 +13,7 @@ authors:
|
|
13
13
|
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
|
-
date: 2017-
|
16
|
+
date: 2017-08-01 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: rails
|
@@ -211,7 +211,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
211
211
|
version: '0'
|
212
212
|
requirements: []
|
213
213
|
rubyforge_project:
|
214
|
-
rubygems_version: 2.
|
214
|
+
rubygems_version: 2.4.5.2
|
215
215
|
signing_key:
|
216
216
|
specification_version: 4
|
217
217
|
summary: pt-online-schema-change runner for ActiveRecord migrations
|