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.
@@ -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
@@ -1,12 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- desc 'Load gem inside irb console'
4
- task :console do
5
- require 'irb'
6
- require 'irb/completion'
7
- require File.join(__FILE__, '../../lib/tty-editor')
8
- ARGV.clear
9
- IRB.start
10
- end
11
-
12
- task c: :console
@@ -1,11 +0,0 @@
1
- # froze_string_literal: true
2
-
3
- desc 'Measure code coverage'
4
- task :coverage do
5
- begin
6
- original, ENV['COVERAGE'] = ENV['COVERAGE'], 'true'
7
- Rake::Task['spec'].invoke
8
- ensure
9
- ENV['COVERAGE'] = original
10
- end
11
- end
@@ -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
@@ -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