turbot 0.1.36 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +8 -0
- data/.rspec +3 -0
- data/.travis.yml +15 -0
- data/Gemfile +4 -0
- data/LICENSE +22 -0
- data/README.md +44 -25
- data/Rakefile +16 -0
- data/appveyor.yml +35 -0
- data/bin/turbot +2 -16
- data/data/schema.json +134 -0
- data/{templates → data/templates}/LICENSE.txt +0 -0
- data/{templates → data/templates}/manifest.json +0 -0
- data/{templates → data/templates}/python/scraper.py +0 -0
- data/{templates → data/templates}/ruby/scraper.rb +0 -0
- data/dist/deb.rake +32 -0
- data/dist/gem.rake +16 -0
- data/dist/manifest.rake +9 -0
- data/dist/pkg.rake +60 -0
- data/dist/resources/deb/control +10 -0
- data/dist/resources/deb/postinst +45 -0
- data/dist/resources/deb/turbot +25 -0
- data/dist/resources/deb/turbot-release-key.txt +30 -0
- data/dist/resources/pkg/Distribution.erb +15 -0
- data/dist/resources/pkg/PackageInfo.erb +6 -0
- data/dist/resources/pkg/postinstall +45 -0
- data/dist/resources/pkg/turbot +24 -0
- data/dist/resources/tgz/turbot +24 -0
- data/dist/rpm.rake +35 -0
- data/dist/tgz.rake +26 -0
- data/dist/zip.rake +40 -0
- data/lib/turbot/cli.rb +10 -27
- data/lib/turbot/command/auth.rb +72 -34
- data/lib/turbot/command/base.rb +21 -60
- data/lib/turbot/command/bots.rb +245 -300
- data/lib/turbot/command/help.rb +57 -110
- data/lib/turbot/command/version.rb +6 -10
- data/lib/turbot/command.rb +53 -196
- data/lib/turbot/handlers/base_handler.rb +21 -0
- data/lib/turbot/handlers/dump_handler.rb +10 -0
- data/lib/turbot/handlers/preview_handler.rb +30 -0
- data/lib/turbot/handlers/validation_handler.rb +17 -0
- data/lib/turbot/helpers/api_helper.rb +41 -0
- data/lib/turbot/helpers/netrc_helper.rb +66 -0
- data/lib/turbot/helpers/shell_helper.rb +36 -0
- data/lib/turbot/helpers.rb +14 -482
- data/lib/turbot/version.rb +1 -1
- data/lib/turbot.rb +17 -15
- data/spec/fixtures/bad_permissions +0 -0
- data/spec/fixtures/empty +0 -0
- data/spec/fixtures/netrc +6 -0
- data/spec/spec_helper.rb +17 -219
- data/spec/support/bot_helper.rb +100 -0
- data/spec/support/command_helper.rb +20 -0
- data/spec/support/custom_matchers.rb +5 -0
- data/spec/support/fixture_helper.rb +9 -0
- data/spec/support/netrc_helper.rb +21 -0
- data/spec/turbot/command/auth_spec.rb +202 -20
- data/spec/turbot/command/base_spec.rb +22 -58
- data/spec/turbot/command/bots_spec.rb +558 -89
- data/spec/turbot/command/help_spec.rb +32 -75
- data/spec/turbot/command/version_spec.rb +11 -10
- data/spec/turbot/command_spec.rb +60 -85
- data/turbot.gemspec +31 -0
- metadata +86 -178
- data/data/cacert.pem +0 -3988
- data/lib/turbot/auth.rb +0 -315
- data/lib/turbot/client/cisaurus.rb +0 -25
- data/lib/turbot/client/pgbackups.rb +0 -113
- data/lib/turbot/client/rendezvous.rb +0 -111
- data/lib/turbot/client/ssl_endpoint.rb +0 -25
- data/lib/turbot/client/turbot_postgresql.rb +0 -148
- data/lib/turbot/client.rb +0 -757
- data/lib/turbot/command/ssl.rb +0 -43
- data/lib/turbot/deprecated/help.rb +0 -38
- data/lib/turbot/deprecated.rb +0 -5
- data/lib/turbot/distribution.rb +0 -9
- data/lib/turbot/errors.rb +0 -28
- data/lib/turbot/excon.rb +0 -11
- data/lib/turbot/helpers/log_displayer.rb +0 -70
- data/lib/turbot/helpers/pg_dump_restore.rb +0 -115
- data/lib/turbot/helpers/turbot_postgresql.rb +0 -213
- data/lib/turbot/plugin.rb +0 -165
- data/lib/turbot/updater.rb +0 -171
- data/lib/vendor/turbot/okjson.rb +0 -598
- data/spec/helper/legacy_help.rb +0 -16
- data/spec/helper/pg_dump_restore_spec.rb +0 -67
- data/spec/spec.opts +0 -1
- data/spec/support/display_message_matcher.rb +0 -49
- data/spec/support/dummy_api.rb +0 -120
- data/spec/support/openssl_mock_helper.rb +0 -8
- data/spec/support/organizations_mock_helper.rb +0 -11
- data/spec/turbot/auth_spec.rb +0 -214
- data/spec/turbot/client/pgbackups_spec.rb +0 -43
- data/spec/turbot/client/rendezvous_spec.rb +0 -62
- data/spec/turbot/client/ssl_endpoint_spec.rb +0 -48
- data/spec/turbot/client/turbot_postgresql_spec.rb +0 -71
- data/spec/turbot/client_spec.rb +0 -548
- data/spec/turbot/helpers/turbot_postgresql_spec.rb +0 -181
- data/spec/turbot/helpers_spec.rb +0 -48
- data/spec/turbot/plugin_spec.rb +0 -172
- data/spec/turbot/updater_spec.rb +0 -44
@@ -1,66 +1,30 @@
|
|
1
|
-
require
|
2
|
-
require "turbot/command/base"
|
1
|
+
require 'spec_helper'
|
3
2
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
@client = mock('turbot client', :host => 'turbot.com')
|
10
|
-
end
|
11
|
-
|
12
|
-
describe "confirming" do
|
13
|
-
it "confirms the bot via --confirm" do
|
14
|
-
Turbot::Command.stub(:current_options).and_return(:confirm => "example")
|
15
|
-
@base.stub(:bot).and_return("example")
|
16
|
-
@base.confirm_command.should be_true
|
17
|
-
end
|
18
|
-
|
19
|
-
it "does not confirms the bot via --confirm on a mismatch" do
|
20
|
-
Turbot::Command.stub(:current_options).and_return(:confirm => "badapp")
|
21
|
-
@base.stub(:bot).and_return("example")
|
22
|
-
lambda { @base.confirm_command}.should raise_error CommandFailed
|
23
|
-
end
|
24
|
-
|
25
|
-
it "confirms the bot interactively via ask" do
|
26
|
-
@base.stub(:bot).and_return("example")
|
27
|
-
@base.stub(:ask).and_return("example")
|
28
|
-
Turbot::Command.stub(:current_options).and_return({})
|
29
|
-
@base.confirm_command.should be_true
|
30
|
-
end
|
3
|
+
describe Turbot::Command::Base do
|
4
|
+
before do
|
5
|
+
allow(subject).to receive(:display)
|
6
|
+
@client = double('turbot client', :host => 'turbot.com')
|
7
|
+
end
|
31
8
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
capture_stderr do
|
37
|
-
lambda { @base.confirm_command }.should raise_error(SystemExit)
|
38
|
-
end.should == <<-STDERR
|
39
|
-
! Confirmation did not match example. Aborted.
|
40
|
-
STDERR
|
41
|
-
end
|
9
|
+
context 'detecting the bot' do
|
10
|
+
it 'attempts to find the bot via the --bot option' do
|
11
|
+
allow(subject).to receive(:options).and_return(:bot => 'example')
|
12
|
+
expect(subject.bot).to eq('example')
|
42
13
|
end
|
43
14
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
ENV['TURBOT_BOT'] = "myenvapp"
|
52
|
-
@base.bot.should == "myenvapp"
|
53
|
-
@base.stub!(:options).and_return([])
|
54
|
-
@base.bot.should == "myenvapp"
|
55
|
-
ENV.delete('TURBOT_BOT')
|
56
|
-
end
|
15
|
+
it 'attempts to find the bot via TURBOT_BOT when not explicitly specified' do
|
16
|
+
ENV['TURBOT_BOT'] = 'myenvapp'
|
17
|
+
expect(subject.bot).to eq('myenvapp')
|
18
|
+
allow(subject).to receive(:options).and_return([])
|
19
|
+
expect(subject.bot).to eq('myenvapp')
|
20
|
+
ENV.delete('TURBOT_BOT')
|
21
|
+
end
|
57
22
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
end
|
23
|
+
it 'overrides TURBOT_BOT when explicitly specified' do
|
24
|
+
ENV['TURBOT_BOT'] = 'myenvapp'
|
25
|
+
allow(subject).to receive(:options).and_return(:bot => 'example')
|
26
|
+
expect(subject.bot).to eq('example')
|
27
|
+
ENV.delete('TURBOT_BOT')
|
64
28
|
end
|
65
29
|
end
|
66
30
|
end
|