tty-prompt 0.10.0 → 0.10.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 +7 -0
- data/lib/tty/prompt/converters.rb +4 -4
- data/lib/tty/prompt/version.rb +1 -1
- data/spec/unit/converters/convert_file_spec.rb +2 -2
- data/spec/unit/question/required_spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e0dae59e66025830ef0a5c219e863d20a3fb9819
|
4
|
+
data.tar.gz: 4577e97283604bc010de09be994612d123a0581a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 679adea2e8b4fbd15f7612081fd5f6a2d0253f92aefb162b9d69b7d9be626cfadd67855363b54db68dde55a2cbecbb481e7e5bf30acb7cf1d78d3a7e8ca99af8
|
7
|
+
data.tar.gz: 5bec8d5cae28cb7099f21d0a979bdf441a7440f52b5f0eea9b6430610d902bb7aa5b380fb994119c45cdf3492c1e0bad24c3d557d2a210029845b585d2213760
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# Change log
|
2
2
|
|
3
|
+
## [v0.10.1] - 2017-02-06
|
4
|
+
|
5
|
+
### Fixed
|
6
|
+
* Fix File namespacing
|
7
|
+
|
3
8
|
## [v0.10.0] - 2017-01-01
|
4
9
|
|
5
10
|
### Added
|
@@ -132,6 +137,8 @@
|
|
132
137
|
|
133
138
|
* Initial implementation and release
|
134
139
|
|
140
|
+
[v0.10.1]: https://github.com/piotrmurach/tty-prompt/compare/v0.10.0...v0.10.1
|
141
|
+
[v0.10.0]: https://github.com/piotrmurach/tty-prompt/compare/v0.9.0...v0.10.0
|
135
142
|
[v0.9.0]: https://github.com/piotrmurach/tty-prompt/compare/v0.8.0...v0.9.0
|
136
143
|
[v0.8.0]: https://github.com/piotrmurach/tty-prompt/compare/v0.7.1...v0.8.0
|
137
144
|
[v0.7.1]: https://github.com/piotrmurach/tty-prompt/compare/v0.7.0...v0.7.1
|
@@ -66,13 +66,13 @@ module TTY
|
|
66
66
|
end
|
67
67
|
|
68
68
|
converter(:file) do |input|
|
69
|
-
directory = File.expand_path(File.dirname($0))
|
70
|
-
File.open(File.join(directory, input))
|
69
|
+
directory = ::File.expand_path(::File.dirname($0))
|
70
|
+
::File.open(::File.join(directory, input))
|
71
71
|
end
|
72
72
|
|
73
73
|
converter(:path) do |input|
|
74
|
-
directory = File.expand_path(File.dirname($0))
|
75
|
-
Pathname.new(File.join(directory, input))
|
74
|
+
directory = ::File.expand_path(::File.dirname($0))
|
75
|
+
Pathname.new(::File.join(directory, input))
|
76
76
|
end
|
77
77
|
|
78
78
|
converter(:char) do |input|
|
data/lib/tty/prompt/version.rb
CHANGED
@@ -7,8 +7,8 @@ RSpec.describe TTY::Prompt::Question, 'convert file' do
|
|
7
7
|
prompt.input << "test.txt"
|
8
8
|
prompt.input.rewind
|
9
9
|
|
10
|
-
allow(File).to receive(:open).with(/test\.txt/).and_return(file)
|
11
|
-
expect(File).to receive(:open).with(/test\.txt/)
|
10
|
+
allow(::File).to receive(:open).with(/test\.txt/).and_return(file)
|
11
|
+
expect(::File).to receive(:open).with(/test\.txt/)
|
12
12
|
|
13
13
|
answer = prompt.ask("Which file to open?", convert: :file)
|
14
14
|
|
@@ -44,7 +44,7 @@ RSpec.describe TTY::Prompt::Question, '#required' do
|
|
44
44
|
prompt.input.rewind
|
45
45
|
answer = prompt.ask('File name?') do |q|
|
46
46
|
q.required(true)
|
47
|
-
q.validate { |v|
|
47
|
+
q.validate { |v| !::File.exist?(v) }
|
48
48
|
q.messages[:required?] = 'File name must not be empty!'
|
49
49
|
q.messages[:valid?] = 'File already exists!'
|
50
50
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tty-prompt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Murach
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-02-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: necromancer
|