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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b1f457f50b0e6fbc28f6bce355c3f9cd8850daa3d7bef3d2f9f05f5e26f0160a
4
- data.tar.gz: c4ffbcc18b975275ccf6a41219c704919b0c2e33ac4eea3c209a70be5884ad98
3
+ metadata.gz: 4d2b4fa0ec740e40027521c988983f4117495f3365a1dd2aeb3b46ef2b3944ef
4
+ data.tar.gz: 33cb1a42cc22a9425a2b3a1991e5ff4fb5e5ec8075882c9b407446835a99d80c
5
5
  SHA512:
6
- metadata.gz: 3165a9f49debfcc8ad4246ae2960dd83a4b8d9500c2bf562999375e3e3d44011a8701df892316f974284736255bf31a95207d19edaa61408131bd8b990b44112
7
- data.tar.gz: 407a3906e0f3551a77c3d2f4987fb77b7b417b636dfd646c9a732c5f63618b6deb47f93b408d809915db3ae46e172434c18138bcd5b1b9ec92461d97e1fb522e
6
+ metadata.gz: d3e3bf160979f4ff65729ccd8fb94d9143c41b5ead74e44428d32c487d4e255ecf33239ad62d707b2049b4980f69460b80b8249874f46b1e61345854fce71287
7
+ data.tar.gz: 7f4688d76945f8de0c7810ddd086732982e2c0fbf1411d5ded380180945d18eb48f32a134d7dedd81c1002fd22be6300c163bf369c7e1ccf154506f74cc4352f
@@ -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 precedencee when auto detecting available editors.
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-2018 Piotr Murach. See LICENSE for further details.
138
+ Copyright (c) 2017 Piotr Murach. See LICENSE for further details.
data/Rakefile CHANGED
@@ -1,4 +1,4 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
3
  require "bundler/gem_tasks"
4
4
 
@@ -1,6 +1,6 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
- require 'tty-editor'
3
+ require_relative '../lib/tty-editor'
4
4
 
5
5
  path = File.join(File.expand_path(File.dirname(__FILE__)), '../README.md')
6
6
 
@@ -1,6 +1,6 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
- require 'tty-editor'
3
+ require_relative '../lib/tty-editor'
4
4
 
5
5
  path = File.join(File.expand_path(File.dirname(__FILE__)), '../README.md')
6
6
 
@@ -1,5 +1,5 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
- require 'tty-editor'
3
+ require_relative '../lib/tty-editor'
4
4
 
5
5
  TTY::Editor.open
@@ -1,6 +1,6 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
- require 'tty-editor'
3
+ require_relative '../lib/tty-editor'
4
4
 
5
5
  path = File.join(File.expand_path(File.dirname(__FILE__)), '../README.md')
6
6
 
@@ -1,7 +1,7 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
- require 'tty-editor'
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)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module TTY
4
4
  class Editor
5
- VERSION = '0.4.1'
5
+ VERSION = '0.5.0'
6
6
  end # Editor
7
7
  end # TTY
@@ -1,4 +1,6 @@
1
- if RUBY_VERSION > '1.9' and (ENV['COVERAGE'] || ENV['TRAVIS'])
1
+ # frozen_string_literal: true
2
+
3
+ if ENV['COVERAGE'] || ENV['TRAVIS']
2
4
  require 'simplecov'
3
5
  require 'coveralls'
4
6
 
@@ -1,4 +1,4 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
3
  RSpec.describe TTY::Editor, '#available' do
4
4
  before do
@@ -1,4 +1,4 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
3
  RSpec.describe TTY::Editor, '#command' do
4
4
  it 'escapes editor filename on Unix' do
@@ -1,4 +1,4 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
3
  RSpec.describe TTY::Editor, '#command' do
4
4
  it 'specifies desired editor' do
@@ -1,4 +1,4 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
3
  RSpec.describe TTY::Editor, '#executables' do
4
4
  it "returns default executables" do
@@ -1,4 +1,4 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
3
  require 'fileutils'
4
4
 
@@ -1,4 +1,4 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
3
  RSpec.describe TTY::Editor, '#tempfile_path' do
4
4
  it 'creates temporary file path for content' do
@@ -1,4 +1,4 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
3
  desc 'Load gem inside irb console'
4
4
  task :console do
@@ -8,3 +8,5 @@ task :console do
8
8
  ARGV.clear
9
9
  IRB.start
10
10
  end
11
+
12
+ task c: :console
@@ -1,4 +1,4 @@
1
- # encoding: utf-8
1
+ # froze_string_literal: true
2
2
 
3
3
  desc 'Measure code coverage'
4
4
  task :coverage do
@@ -1,4 +1,4 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
3
  begin
4
4
  require 'rspec/core/rake_task'
@@ -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.17.0'
24
- spec.add_dependency 'tty-which', '~> 0.3.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.1
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-08-29 00:00:00.000000000 Z
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.17.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.17.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.3.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.3.0
40
+ version: '0.4'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement