tty-editor 0.4.1 → 0.5.0
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 +6 -0
- data/README.md +16 -2
- data/Rakefile +1 -1
- data/examples/basic.rb +2 -2
- data/examples/choices.rb +2 -2
- data/examples/empty.rb +2 -2
- data/examples/env.rb +2 -2
- data/examples/tempfile.rb +3 -3
- data/lib/tty/editor/version.rb +1 -1
- data/spec/spec_helper.rb +3 -1
- data/spec/unit/available_spec.rb +1 -1
- data/spec/unit/command_path_spec.rb +1 -1
- data/spec/unit/command_spec.rb +1 -1
- data/spec/unit/executables_spec.rb +1 -1
- data/spec/unit/open_spec.rb +1 -1
- data/spec/unit/tempfile_path_spec.rb +1 -1
- data/tasks/console.rake +3 -1
- data/tasks/coverage.rake +1 -1
- data/tasks/spec.rake +1 -1
- data/tty-editor.gemspec +2 -2
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4d2b4fa0ec740e40027521c988983f4117495f3365a1dd2aeb3b46ef2b3944ef
|
4
|
+
data.tar.gz: 33cb1a42cc22a9425a2b3a1991e5ff4fb5e5ec8075882c9b407446835a99d80c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d3e3bf160979f4ff65729ccd8fb94d9143c41b5ead74e44428d32c487d4e255ecf33239ad62d707b2049b4980f69460b80b8249874f46b1e61345854fce71287
|
7
|
+
data.tar.gz: 7f4688d76945f8de0c7810ddd086732982e2c0fbf1411d5ded380180945d18eb48f32a134d7dedd81c1002fd22be6300c163bf369c7e1ccf154506f74cc4352f
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# Change log
|
2
2
|
|
3
|
+
## [v0.5.0] - 2018-12-18
|
4
|
+
|
5
|
+
### Changed
|
6
|
+
* Change to update and relax tty-prompt & tty-which constraints
|
7
|
+
|
3
8
|
## [v0.4.1] - 2018-08-29
|
4
9
|
|
5
10
|
### Changed
|
@@ -52,6 +57,7 @@
|
|
52
57
|
|
53
58
|
* Initial implementation and release
|
54
59
|
|
60
|
+
[v0.5.0]: https://github.com/piotrmurach/tty-editor/compare/v0.4.1...v0.5.0
|
55
61
|
[v0.4.1]: https://github.com/piotrmurach/tty-editor/compare/v0.4.0...v0.4.1
|
56
62
|
[v0.4.0]: https://github.com/piotrmurach/tty-editor/compare/v0.3.0...v0.4.0
|
57
63
|
[v0.3.0]: https://github.com/piotrmurach/tty-editor/compare/v0.2.1...v0.3.0
|
data/README.md
CHANGED
@@ -59,7 +59,7 @@ You can also set your preferred editor command:
|
|
59
59
|
TTY::Editor.open('hello.rb', command: :vim)
|
60
60
|
```
|
61
61
|
|
62
|
-
Also, the `VISUAL` or `EDITOR` shell environment variables take
|
62
|
+
Also, the `VISUAL` or `EDITOR` shell environment variables take precedence when auto detecting available editors.
|
63
63
|
|
64
64
|
## Interface
|
65
65
|
|
@@ -71,6 +71,12 @@ If you wish to open editor with no file or content do:
|
|
71
71
|
TTY::Editor.open
|
72
72
|
```
|
73
73
|
|
74
|
+
To open a file at a path pass it as a first argument:
|
75
|
+
|
76
|
+
```ruby
|
77
|
+
TTY::Editor.open('../README.md')
|
78
|
+
```
|
79
|
+
|
74
80
|
When editor successfully opens file or content then `true` is returned.
|
75
81
|
|
76
82
|
If the editor cannot be opened, a `TTY::Editor::CommandInvocation` error is raised.
|
@@ -105,6 +111,14 @@ You can force to always use a specific editor by passing `:command` option:
|
|
105
111
|
TTY::Editor.open('hello.rb', command: :vim)
|
106
112
|
```
|
107
113
|
|
114
|
+
To specify more than one command, and hence give a user a choice do:
|
115
|
+
|
116
|
+
```ruby
|
117
|
+
TTY::Editor.open('hello.rb') do |editor|
|
118
|
+
editor.command :vim, :emacs
|
119
|
+
end
|
120
|
+
```
|
121
|
+
|
108
122
|
## Development
|
109
123
|
|
110
124
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
@@ -121,4 +135,4 @@ The gem is available as open source under the terms of the [MIT License](http://
|
|
121
135
|
|
122
136
|
## Copyright
|
123
137
|
|
124
|
-
Copyright (c) 2017
|
138
|
+
Copyright (c) 2017 Piotr Murach. See LICENSE for further details.
|
data/Rakefile
CHANGED
data/examples/basic.rb
CHANGED
data/examples/choices.rb
CHANGED
data/examples/empty.rb
CHANGED
data/examples/env.rb
CHANGED
data/examples/tempfile.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
require_relative '../lib/tty-editor'
|
4
4
|
|
5
5
|
content = "Human madness is oftentimes a cunning and most feline thing.\n When you think it fled, it may have but become transfigured into some still subtler form."
|
6
6
|
|
7
|
-
TTY::Editor.open(content)
|
7
|
+
TTY::Editor.open(content: content)
|
data/lib/tty/editor/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
data/spec/unit/available_spec.rb
CHANGED
data/spec/unit/command_spec.rb
CHANGED
data/spec/unit/open_spec.rb
CHANGED
data/tasks/console.rake
CHANGED
data/tasks/coverage.rake
CHANGED
data/tasks/spec.rake
CHANGED
data/tty-editor.gemspec
CHANGED
@@ -20,8 +20,8 @@ Gem::Specification.new do |spec|
|
|
20
20
|
|
21
21
|
spec.required_ruby_version = '>= 2.0.0'
|
22
22
|
|
23
|
-
spec.add_dependency 'tty-prompt', '~> 0.
|
24
|
-
spec.add_dependency 'tty-which', '~> 0.
|
23
|
+
spec.add_dependency 'tty-prompt', '~> 0.18'
|
24
|
+
spec.add_dependency 'tty-which', '~> 0.4'
|
25
25
|
|
26
26
|
spec.add_development_dependency 'bundler', '>= 1.5.0', '< 2.0'
|
27
27
|
spec.add_development_dependency 'rake', '~> 10.0'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tty-editor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Murach
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-12-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tty-prompt
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: '0.18'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: '0.18'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: tty-which
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
33
|
+
version: '0.4'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
40
|
+
version: '0.4'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|