tty 0.8.1 → 0.9.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 +5 -5
- data/CHANGELOG.md +18 -0
- data/README.md +3 -1
- data/lib/tty.rb +1 -1
- data/lib/tty/cli.rb +0 -1
- data/lib/tty/cmd.rb +0 -1
- data/lib/tty/commands/add.rb +0 -1
- data/lib/tty/commands/new.rb +5 -6
- data/lib/tty/gemspec.rb +0 -1
- data/lib/tty/licenses.rb +0 -1
- data/lib/tty/path_helpers.rb +0 -1
- data/lib/tty/plugins.rb +1 -1
- data/lib/tty/plugins/plugin.rb +1 -1
- data/lib/tty/templater.rb +0 -1
- data/lib/tty/version.rb +2 -2
- data/tty.gemspec +21 -18
- data/tty.manifest +7 -0
- metadata +63 -84
- data/.gitignore +0 -19
- data/.rspec +0 -4
- data/.travis.yml +0 -35
- data/.yardopts +0 -4
- data/CODE_OF_CONDUCT.md +0 -49
- data/Gemfile +0 -17
- data/Rakefile +0 -8
- data/appveyor.yml +0 -22
- data/images/tty.png +0 -0
- data/spec/fixtures/foo-0.0.1.gemspec +0 -17
- data/spec/integration/add_desc_args_spec.rb +0 -341
- data/spec/integration/add_force_spec.rb +0 -98
- data/spec/integration/add_namespaced_spec.rb +0 -291
- data/spec/integration/add_spec.rb +0 -535
- data/spec/integration/add_subcommand_spec.rb +0 -259
- data/spec/integration/new_author_spec.rb +0 -19
- data/spec/integration/new_license_spec.rb +0 -39
- data/spec/integration/new_namespaced_spec.rb +0 -228
- data/spec/integration/new_spec.rb +0 -354
- data/spec/integration/new_test_spec.rb +0 -21
- data/spec/integration/start_spec.rb +0 -21
- data/spec/spec_helper.rb +0 -73
- data/spec/unit/gemspec_spec.rb +0 -17
- data/spec/unit/plugins/activate_spec.rb +0 -13
- data/spec/unit/plugins/load_from_spec.rb +0 -28
- data/spec/unit/plugins/plugin/load_spec.rb +0 -32
- data/spec/unit/plugins/plugin/new_spec.rb +0 -13
- data/spec/unit/tty_spec.rb +0 -14
- data/tasks/console.rake +0 -11
- data/tasks/coverage.rake +0 -11
- data/tasks/spec.rake +0 -29
data/spec/unit/gemspec_spec.rb
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
require 'tty/gemspec'
|
4
|
-
|
5
|
-
RSpec.describe TTY::Gemspec, '#read' do
|
6
|
-
it "reads gemspec's content" do
|
7
|
-
gemspec_path = fixtures_path('foo-0.0.1.gemspec')
|
8
|
-
gemspec = TTY::Gemspec.new
|
9
|
-
gemspec.read(gemspec_path)
|
10
|
-
|
11
|
-
expect(gemspec.content).to eq(::File.binread(gemspec_path))
|
12
|
-
expect(gemspec.var_name).to eq('spec')
|
13
|
-
|
14
|
-
expect(gemspec.pre_var_indent).to eq(2)
|
15
|
-
expect(gemspec.post_var_indent).to eq(15)
|
16
|
-
end
|
17
|
-
end
|
@@ -1,13 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
RSpec.describe TTY::Plugins, '#activate' do
|
4
|
-
it "activates all plugins" do
|
5
|
-
plugin = double(:plugin, :enabled? => false, :load! => true)
|
6
|
-
plugins = TTY::Plugins.new
|
7
|
-
allow(plugins).to receive(:plugins).and_return([plugin, plugin])
|
8
|
-
|
9
|
-
plugins.activate
|
10
|
-
|
11
|
-
expect(plugin).to have_received(:load!).twice
|
12
|
-
end
|
13
|
-
end
|
@@ -1,28 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
RSpec.describe TTY::Plugins, '#load_from' do
|
4
|
-
it "loads gems with a specific pattern" do
|
5
|
-
plugins = TTY::Plugins.new
|
6
|
-
gemspec_path = fixtures_path('foo-0.0.1.gemspec')
|
7
|
-
plugins.load_from(gemspec_path, /^tty-(.*)/)
|
8
|
-
|
9
|
-
expect(plugins.to_a.map(&:name)).to eq([
|
10
|
-
'tty-command',
|
11
|
-
'tty-prompt',
|
12
|
-
'tty-spinner'
|
13
|
-
])
|
14
|
-
end
|
15
|
-
|
16
|
-
it "allows for complex pattern" do
|
17
|
-
plugins = TTY::Plugins.new
|
18
|
-
gemspec_path = fixtures_path('foo-0.0.1.gemspec')
|
19
|
-
plugins.load_from(gemspec_path, /^tty-(.*)|pastel/)
|
20
|
-
|
21
|
-
expect(plugins.to_a.map(&:name)).to eq([
|
22
|
-
'pastel',
|
23
|
-
'tty-command',
|
24
|
-
'tty-prompt',
|
25
|
-
'tty-spinner'
|
26
|
-
])
|
27
|
-
end
|
28
|
-
end
|
@@ -1,32 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
RSpec.describe TTY::Plugin, '#load!' do
|
4
|
-
let(:gem) { Gem::Specification.new('tty-console', '3.1.3')}
|
5
|
-
|
6
|
-
it "loads a gem" do
|
7
|
-
plugin = TTY::Plugin.new('tty-console', gem)
|
8
|
-
allow(plugin).to receive(:require).with('tty-console').and_return(true)
|
9
|
-
|
10
|
-
plugin.load!
|
11
|
-
|
12
|
-
expect(plugin).to have_received(:require).once
|
13
|
-
end
|
14
|
-
|
15
|
-
it 'fails to load the gem' do
|
16
|
-
plugin = TTY::Plugin.new('tty-console', gem)
|
17
|
-
allow(plugin).to receive(:require) { raise LoadError }
|
18
|
-
|
19
|
-
expect {
|
20
|
-
plugin.load!
|
21
|
-
}.to output(/Unable to load plugin tty-console./).to_stdout
|
22
|
-
end
|
23
|
-
|
24
|
-
it 'fails to require the gem' do
|
25
|
-
plugin = TTY::Plugin.new('tty-console', gem)
|
26
|
-
allow(plugin).to receive(:require) { raise StandardError }
|
27
|
-
|
28
|
-
expect {
|
29
|
-
plugin.load!
|
30
|
-
}.to output(/require 'tty-console' failed with StandardError\n/).to_stdout
|
31
|
-
end
|
32
|
-
end
|
@@ -1,13 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
RSpec.describe TTY::Plugin, '#new' do
|
4
|
-
let(:gem) { Gem::Specification.new('tty-console', '3.1.3')}
|
5
|
-
|
6
|
-
subject(:plugin) { described_class.new('tty-console', gem) }
|
7
|
-
|
8
|
-
it { expect(plugin.name).to eq('tty-console') }
|
9
|
-
|
10
|
-
it { expect(plugin.gem).to eq(gem) }
|
11
|
-
|
12
|
-
it { expect(plugin.enabled?).to eq(false) }
|
13
|
-
end
|
data/spec/unit/tty_spec.rb
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
RSpec.describe TTY do
|
4
|
-
let(:object) { described_class }
|
5
|
-
|
6
|
-
it { expect(object.plugins).to be_instance_of(TTY::Plugins) }
|
7
|
-
|
8
|
-
context 'when module' do
|
9
|
-
it 'decorates class' do
|
10
|
-
klass = Class.new { include TTY }
|
11
|
-
expect(klass).to respond_to(:plugins)
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end # TTY
|
data/tasks/console.rake
DELETED
data/tasks/coverage.rake
DELETED
data/tasks/spec.rake
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
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/{,/*/**}/*_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
|