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.
Files changed (49) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +18 -0
  3. data/README.md +3 -1
  4. data/lib/tty.rb +1 -1
  5. data/lib/tty/cli.rb +0 -1
  6. data/lib/tty/cmd.rb +0 -1
  7. data/lib/tty/commands/add.rb +0 -1
  8. data/lib/tty/commands/new.rb +5 -6
  9. data/lib/tty/gemspec.rb +0 -1
  10. data/lib/tty/licenses.rb +0 -1
  11. data/lib/tty/path_helpers.rb +0 -1
  12. data/lib/tty/plugins.rb +1 -1
  13. data/lib/tty/plugins/plugin.rb +1 -1
  14. data/lib/tty/templater.rb +0 -1
  15. data/lib/tty/version.rb +2 -2
  16. data/tty.gemspec +21 -18
  17. data/tty.manifest +7 -0
  18. metadata +63 -84
  19. data/.gitignore +0 -19
  20. data/.rspec +0 -4
  21. data/.travis.yml +0 -35
  22. data/.yardopts +0 -4
  23. data/CODE_OF_CONDUCT.md +0 -49
  24. data/Gemfile +0 -17
  25. data/Rakefile +0 -8
  26. data/appveyor.yml +0 -22
  27. data/images/tty.png +0 -0
  28. data/spec/fixtures/foo-0.0.1.gemspec +0 -17
  29. data/spec/integration/add_desc_args_spec.rb +0 -341
  30. data/spec/integration/add_force_spec.rb +0 -98
  31. data/spec/integration/add_namespaced_spec.rb +0 -291
  32. data/spec/integration/add_spec.rb +0 -535
  33. data/spec/integration/add_subcommand_spec.rb +0 -259
  34. data/spec/integration/new_author_spec.rb +0 -19
  35. data/spec/integration/new_license_spec.rb +0 -39
  36. data/spec/integration/new_namespaced_spec.rb +0 -228
  37. data/spec/integration/new_spec.rb +0 -354
  38. data/spec/integration/new_test_spec.rb +0 -21
  39. data/spec/integration/start_spec.rb +0 -21
  40. data/spec/spec_helper.rb +0 -73
  41. data/spec/unit/gemspec_spec.rb +0 -17
  42. data/spec/unit/plugins/activate_spec.rb +0 -13
  43. data/spec/unit/plugins/load_from_spec.rb +0 -28
  44. data/spec/unit/plugins/plugin/load_spec.rb +0 -32
  45. data/spec/unit/plugins/plugin/new_spec.rb +0 -13
  46. data/spec/unit/tty_spec.rb +0 -14
  47. data/tasks/console.rake +0 -11
  48. data/tasks/coverage.rake +0 -11
  49. data/tasks/spec.rake +0 -29
@@ -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
@@ -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
@@ -1,11 +0,0 @@
1
- # encoding: utf-8
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')
8
- ARGV.clear
9
- IRB.start
10
- end
11
- task c: %w[ console ]
@@ -1,11 +0,0 @@
1
- # encoding: utf-8
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
- # 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