tty-editor 0.5.1 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +22 -0
- data/README.md +155 -33
- data/lib/tty-editor.rb +1 -1
- data/lib/tty/editor.rb +171 -98
- data/lib/tty/editor/version.rb +1 -1
- metadata +20 -58
- data/Rakefile +0 -10
- data/bin/console +0 -14
- data/bin/setup +0 -8
- data/examples/basic.rb +0 -7
- data/examples/choices.rb +0 -9
- data/examples/empty.rb +0 -5
- data/examples/env.rb +0 -7
- data/examples/tempfile.rb +0 -7
- data/spec/spec_helper.rb +0 -56
- data/spec/unit/available_spec.rb +0 -52
- data/spec/unit/command_path_spec.rb +0 -25
- data/spec/unit/command_spec.rb +0 -55
- data/spec/unit/executables_spec.rb +0 -16
- data/spec/unit/open_spec.rb +0 -103
- data/spec/unit/tempfile_path_spec.rb +0 -18
- data/tasks/console.rake +0 -12
- data/tasks/coverage.rake +0 -11
- data/tasks/spec.rake +0 -29
- data/tty-editor.gemspec +0 -29
@@ -1,18 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
RSpec.describe TTY::Editor, '#tempfile_path' do
|
4
|
-
it 'creates temporary file path for content' do
|
5
|
-
tempfile = StringIO.new
|
6
|
-
def tempfile.path
|
7
|
-
'random-path'
|
8
|
-
end
|
9
|
-
|
10
|
-
allow(Tempfile).to receive(:new).and_return(tempfile)
|
11
|
-
editor = TTY::Editor.new(content: "Multiline\ncontent", command: :vim)
|
12
|
-
allow(editor).to receive(:system).and_return(true)
|
13
|
-
|
14
|
-
editor.open
|
15
|
-
|
16
|
-
expect(editor.command_path).to eql("vim random-path")
|
17
|
-
end
|
18
|
-
end
|
data/tasks/console.rake
DELETED
data/tasks/coverage.rake
DELETED
data/tasks/spec.rake
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
begin
|
4
|
-
require 'rspec/core/rake_task'
|
5
|
-
|
6
|
-
desc 'Run all specs'
|
7
|
-
RSpec::Core::RakeTask.new(:spec) do |task|
|
8
|
-
task.pattern = 'spec/{unit,integration}{,/*/**}/*_spec.rb'
|
9
|
-
end
|
10
|
-
|
11
|
-
namespace :spec do
|
12
|
-
desc 'Run unit specs'
|
13
|
-
RSpec::Core::RakeTask.new(:unit) do |task|
|
14
|
-
task.pattern = 'spec/unit{,/*/**}/*_spec.rb'
|
15
|
-
end
|
16
|
-
|
17
|
-
desc 'Run integration specs'
|
18
|
-
RSpec::Core::RakeTask.new(:integration) do |task|
|
19
|
-
task.pattern = 'spec/integration{,/*/**}/*_spec.rb'
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
rescue LoadError
|
24
|
-
%w[spec spec:unit spec:integration].each do |name|
|
25
|
-
task name do
|
26
|
-
$stderr.puts "In order to run #{name}, do `gem install rspec`"
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
data/tty-editor.gemspec
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
lib = File.expand_path('../lib', __FILE__)
|
2
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
-
require 'tty/editor/version'
|
4
|
-
|
5
|
-
Gem::Specification.new do |spec|
|
6
|
-
spec.name = "tty-editor"
|
7
|
-
spec.version = TTY::Editor::VERSION
|
8
|
-
spec.authors = ["Piotr Murach"]
|
9
|
-
spec.email = ["me@piotrmurach.com"]
|
10
|
-
|
11
|
-
spec.summary = %q{Opens a file or text in the user's preferred editor.}
|
12
|
-
spec.description = %q{Opens a file or text in the user's preferred editor.}
|
13
|
-
spec.homepage = "https://piotrmurach.github.io/tty"
|
14
|
-
spec.license = "MIT"
|
15
|
-
|
16
|
-
spec.files = Dir['{lib,spec,examples}/**/*.rb']
|
17
|
-
spec.files += Dir['{bin,tasks}/*', 'tty-editor.gemspec']
|
18
|
-
spec.files += Dir['README.md', 'CHANGELOG.md', 'LICENSE.txt', 'Rakefile']
|
19
|
-
spec.require_paths = ["lib"]
|
20
|
-
|
21
|
-
spec.required_ruby_version = '>= 2.0.0'
|
22
|
-
|
23
|
-
spec.add_dependency 'tty-prompt', '~> 0.19'
|
24
|
-
spec.add_dependency 'tty-which', '~> 0.4'
|
25
|
-
|
26
|
-
spec.add_development_dependency 'bundler', '>= 1.5.0'
|
27
|
-
spec.add_development_dependency 'rake'
|
28
|
-
spec.add_development_dependency 'rspec', '~> 3.0'
|
29
|
-
end
|