neverbounce-cli 1.0.0
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 +7 -0
- data/.codeclimate.yml +8 -0
- data/.gitignore +21 -0
- data/.rspec +4 -0
- data/.rubocop.yml +1161 -0
- data/.travis.yml +27 -0
- data/.yardopts +2 -0
- data/Gemfile +19 -0
- data/Gemfile.lock +60 -0
- data/LICENSE +9 -0
- data/README.md +138 -0
- data/exe/nb-account-info +5 -0
- data/exe/nb-jobs-create +5 -0
- data/exe/nb-jobs-delete +5 -0
- data/exe/nb-jobs-download +5 -0
- data/exe/nb-jobs-parse +5 -0
- data/exe/nb-jobs-results +5 -0
- data/exe/nb-jobs-search +5 -0
- data/exe/nb-jobs-start +5 -0
- data/exe/nb-jobs-status +5 -0
- data/exe/nb-single-check +5 -0
- data/lib/never_bounce/cli/feature/basic_initialize.rb +20 -0
- data/lib/never_bounce/cli/feature/eigencache.rb +47 -0
- data/lib/never_bounce/cli/feature/envars/examples_mapper.rb +38 -0
- data/lib/never_bounce/cli/feature/envars/item.rb +41 -0
- data/lib/never_bounce/cli/feature/envars.rb +82 -0
- data/lib/never_bounce/cli/feature/igetset.rb +41 -0
- data/lib/never_bounce/cli/feature/require_attr.rb +25 -0
- data/lib/never_bounce/cli/script/account_info.rb +85 -0
- data/lib/never_bounce/cli/script/base.rb +101 -0
- data/lib/never_bounce/cli/script/error.rb +16 -0
- data/lib/never_bounce/cli/script/feature/requires_job_id.rb +28 -0
- data/lib/never_bounce/cli/script/feature/uses_pagination.rb +45 -0
- data/lib/never_bounce/cli/script/jobs_create/supplied_input_parser.rb +48 -0
- data/lib/never_bounce/cli/script/jobs_create.rb +157 -0
- data/lib/never_bounce/cli/script/jobs_delete.rb +55 -0
- data/lib/never_bounce/cli/script/jobs_download.rb +44 -0
- data/lib/never_bounce/cli/script/jobs_parse.rb +73 -0
- data/lib/never_bounce/cli/script/jobs_results.rb +105 -0
- data/lib/never_bounce/cli/script/jobs_search.rb +135 -0
- data/lib/never_bounce/cli/script/jobs_start.rb +73 -0
- data/lib/never_bounce/cli/script/jobs_status.rb +96 -0
- data/lib/never_bounce/cli/script/manifest.rb +22 -0
- data/lib/never_bounce/cli/script/meaningful.rb +233 -0
- data/lib/never_bounce/cli/script/request_maker.rb +169 -0
- data/lib/never_bounce/cli/script/single_check.rb +146 -0
- data/lib/never_bounce/cli/script/table.rb +43 -0
- data/lib/never_bounce/cli/user_config/file_content.rb +66 -0
- data/lib/never_bounce/cli/user_config.rb +51 -0
- data/lib/never_bounce/cli/version.rb +4 -0
- data/lib/neverbounce-cli.rb +3 -0
- data/neverbounce-cli.gemspec +24 -0
- data/spec/lib/never_bounce/cli/feature/basic_initialize_spec.rb +26 -0
- data/spec/lib/never_bounce/cli/feature/eigencache_spec.rb +28 -0
- data/spec/lib/never_bounce/cli/feature/envars/examples_mapper_spec.rb +26 -0
- data/spec/lib/never_bounce/cli/feature/envars/item_spec.rb +9 -0
- data/spec/lib/never_bounce/cli/feature/envars_spec.rb +55 -0
- data/spec/lib/never_bounce/cli/feature/igetset_spec.rb +45 -0
- data/spec/lib/never_bounce/cli/feature/require_attr_spec.rb +25 -0
- data/spec/lib/never_bounce/cli/script/account_info_spec.rb +65 -0
- data/spec/lib/never_bounce/cli/script/base_spec.rb +56 -0
- data/spec/lib/never_bounce/cli/script/feature/requires_job_id_spec.rb +17 -0
- data/spec/lib/never_bounce/cli/script/feature/uses_pagination_spec.rb +21 -0
- data/spec/lib/never_bounce/cli/script/jobs_create/supplied_input_parser_spec.rb +35 -0
- data/spec/lib/never_bounce/cli/script/jobs_create_spec.rb +118 -0
- data/spec/lib/never_bounce/cli/script/jobs_delete_spec.rb +33 -0
- data/spec/lib/never_bounce/cli/script/jobs_download_spec.rb +37 -0
- data/spec/lib/never_bounce/cli/script/jobs_parse_spec.rb +45 -0
- data/spec/lib/never_bounce/cli/script/jobs_results_spec.rb +40 -0
- data/spec/lib/never_bounce/cli/script/jobs_search_spec.rb +59 -0
- data/spec/lib/never_bounce/cli/script/jobs_start_spec.rb +45 -0
- data/spec/lib/never_bounce/cli/script/jobs_status_spec.rb +37 -0
- data/spec/lib/never_bounce/cli/script/manifest_spec.rb +6 -0
- data/spec/lib/never_bounce/cli/script/meaningful_spec.rb +93 -0
- data/spec/lib/never_bounce/cli/script/request_maker_spec.rb +67 -0
- data/spec/lib/never_bounce/cli/script/single_check_spec.rb +94 -0
- data/spec/lib/never_bounce/cli/script/spec_helper.rb +59 -0
- data/spec/lib/never_bounce/cli/script/table_spec.rb +6 -0
- data/spec/lib/never_bounce/cli/user_config/file_content_spec.rb +43 -0
- data/spec/lib/never_bounce/cli/user_config_spec.rb +12 -0
- data/spec/lib/never_bounce/cli_spec.rb +6 -0
- data/spec/spec_helper.rb +51 -0
- metadata +193 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
|
|
2
|
+
module NeverBounce; module CLI; module Script
|
|
3
|
+
describe RequestMaker do
|
|
4
|
+
include_dir_context __dir__
|
|
5
|
+
|
|
6
|
+
it_behaves_like "instantiatable"
|
|
7
|
+
|
|
8
|
+
describe "envars" do
|
|
9
|
+
it "generally works" do
|
|
10
|
+
envars = described_class.envars
|
|
11
|
+
expect(envars.map(&:name)).to eq ["API_KEY", "API_URL", "CURL", "RAW"]
|
|
12
|
+
expect(envars.map(&:mandatory?)).to eq [true, false, false, false]
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
describe "CURL=y" do
|
|
17
|
+
it "generally works" do
|
|
18
|
+
r = goodo(
|
|
19
|
+
argv: ["CURL=y"],
|
|
20
|
+
request: API::Request::JobsParse.new(api_key: "api_key", job_id: "job_id"),
|
|
21
|
+
)
|
|
22
|
+
expect { r.main }.not_to raise_error
|
|
23
|
+
lines = r.stdout.tap(&:rewind).to_a
|
|
24
|
+
expect(lines[0]).to start_with "curl --request POST --url https://api.neverbounce.com/v4/jobs/parse"
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
describe "RAW=y" do
|
|
29
|
+
it "generally works" do
|
|
30
|
+
r = goodo(
|
|
31
|
+
argv: ["RAW=y"],
|
|
32
|
+
server_raw: "raw123",
|
|
33
|
+
)
|
|
34
|
+
expect { r.main }.not_to raise_error
|
|
35
|
+
lines = r.stdout.tap(&:rewind).to_a
|
|
36
|
+
expect(lines).to eq ["raw123\n"]
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
describe "#api_key" do
|
|
41
|
+
it "generally works" do
|
|
42
|
+
r = newo(env: {}, user_config: Struct.new(:api_key).new)
|
|
43
|
+
expect { r.api_key }.to raise_error(UsageError, "API key not given, use `API_KEY=`")
|
|
44
|
+
r = newo(env: {"API_KEY" => "api_key"})
|
|
45
|
+
expect(r.api_key).to eq "api_key"
|
|
46
|
+
r = newo(env: {}, user_config: Class.new { def api_key; "api_key2"; end }.new)
|
|
47
|
+
expect(r.api_key).to eq "api_key2"
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
describe "#api_url" do
|
|
52
|
+
it "generally works" do
|
|
53
|
+
r = newo(env: {}, user_config: Struct.new(:api_url).new)
|
|
54
|
+
expect(r.api_url).to be nil
|
|
55
|
+
r = newo(env: {"API_URL" => "api_url"})
|
|
56
|
+
expect(r.api_url).to eq "api_url"
|
|
57
|
+
r = newo(env: {}, user_config: Class.new { def api_url; "api_url2"; end }.new)
|
|
58
|
+
expect(r.api_url).to eq "api_url2"
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end; end; end
|
|
63
|
+
|
|
64
|
+
#
|
|
65
|
+
# Implementation notes:
|
|
66
|
+
#
|
|
67
|
+
# * We check envars in order of declaration for ease of whole-set testing.
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
|
|
2
|
+
module NeverBounce; module CLI; module Script
|
|
3
|
+
describe SingleCheck do
|
|
4
|
+
include_dir_context __dir__
|
|
5
|
+
|
|
6
|
+
def margv(*args)
|
|
7
|
+
["API_KEY=abc", "EMAIL=alice@isp.com"] + args
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
it_behaves_like "instantiatable"
|
|
11
|
+
it_behaves_like "a script supporting `--help`", signatures: [/nb-single-check/, /ADDRESS_INFO/, /EMAIL/, /CREDITS_INFO/, /TIMEOUT/]
|
|
12
|
+
|
|
13
|
+
describe "mode attributes" do
|
|
14
|
+
describe "#address_info" do
|
|
15
|
+
let(:m) { :address_info }
|
|
16
|
+
it "generally works" do
|
|
17
|
+
expect(newo(env: {}).send(m)).to be nil
|
|
18
|
+
expect(newo(env: {"ADDRESS_INFO" => "y"}).send(m)).to be true
|
|
19
|
+
expect(newo(env: {"ADDRESS_INFO" => "n"}).send(m)).to be false
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
describe "#credits_info" do
|
|
24
|
+
let(:m) { :credits_info }
|
|
25
|
+
it "generally works" do
|
|
26
|
+
expect(newo(env: {}).send(m)).to be nil
|
|
27
|
+
expect(newo(env: {"CREDITS_INFO" => "y"}).send(m)).to be true
|
|
28
|
+
expect(newo(env: {"CREDITS_INFO" => "n"}).send(m)).to be false
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
describe "#timeout" do
|
|
33
|
+
let(:m) { :timeout }
|
|
34
|
+
it "generally works" do
|
|
35
|
+
expect(newo(env: {}).send(m)).to be nil
|
|
36
|
+
expect { newo(env: {"TIMEOUT" => "abc"}).send(m) }.to raise_error(UsageError, "invalid value for Integer(): \"abc\"")
|
|
37
|
+
expect(newo(env: {"TIMEOUT" => "12"}).send(m)).to be 12
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
describe "#request_curl" do
|
|
43
|
+
it "generally works" do
|
|
44
|
+
r = goodo(argv: margv("ADDRESS_INFO=y", "CREDITS_INFO=y", "TIMEOUT=12"))
|
|
45
|
+
expect(r.request_curl).to eq ["--request", "GET", "--url", "https://api.neverbounce.com/v4/single/check", "--header", "Content-Type: application/json", "--data-binary", "{\"email\":\"alice@isp.com\",\"key\":\"abc\",\"address_info\":true,\"credits_info\":true,\"timeout\":12}"]
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
describe "output" do
|
|
50
|
+
context "when monthly subscription" do
|
|
51
|
+
it "generally works" do
|
|
52
|
+
r = goodo(argv: margv).tap do |_|
|
|
53
|
+
_.session.server_content_type = "application/json"
|
|
54
|
+
_.session.server_raw = '{"address_info":{"addr":"support","alias":"","domain":"neverbounce","fqdn":"neverbounce.com","host":"neverbounce.com","normalized_email":"support@neverbounce.com","original_email":"support@neverbounce.com","subdomain":"","tld":"com"},"credits_info":{"free_credits_remaining":999,"free_credits_used":1,"monthly_api_usage":0},"execution_time":678,"flags":["has_dns","has_dns_mx","role_account","smtp_connectable"],"result":"valid","status":"success","suggested_correction":""}'
|
|
55
|
+
end
|
|
56
|
+
expect { r.main }.not_to raise_error
|
|
57
|
+
lines = r.stdout.tap(&:rewind).to_a
|
|
58
|
+
expect(lines).to be_any { |s| s =~ /Response:/ }
|
|
59
|
+
expect(lines).to be_any { |s| s =~ cell("Result") }
|
|
60
|
+
expect(lines).to be_any { |s| s =~ cell("ExecTime") }
|
|
61
|
+
expect(lines).to be_any { |s| s =~ /AddressInfo:/ }
|
|
62
|
+
expect(lines).to be_any { |s| s =~ cell("Addr") }
|
|
63
|
+
expect(lines).to be_any { |s| s =~ cell("TLD") }
|
|
64
|
+
expect(lines).to be_any { |s| s =~ /CreditsInfo:/ }
|
|
65
|
+
expect(lines).to be_any { |s| s =~ cell("FreeRmn") }
|
|
66
|
+
expect(lines).to be_any { |s| s =~ cell("FreeUsed") }
|
|
67
|
+
expect(lines).to be_any { |s| s =~ cell("MonthlyUsage") }
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
context "when paid subscription" do
|
|
72
|
+
it "generally works" do
|
|
73
|
+
r = goodo(argv: margv).tap do |_|
|
|
74
|
+
_.session.server_content_type = "application/json"
|
|
75
|
+
_.session.server_raw = '{"status":"success","result":"valid","flags":["contains_alias","smtp_connectable","has_dns","has_dns_mx"],"suggested_correction":"","address_info":{"original_email":"fortunadze+1@gmail.com","normalized_email":"fortunadze@gmail.com","addr":"fortunadze","alias":"1","host":"gmail.com","fqdn":"gmail.com","domain":"gmail","subdomain":"","tld":"com"},"credits_info":{"paid_credits_used":0,"free_credits_used":1,"paid_credits_remaining":1000000,"free_credits_remaining":941},"execution_time":189}'
|
|
76
|
+
end
|
|
77
|
+
expect { r.main }.not_to raise_error
|
|
78
|
+
lines = r.stdout.tap(&:rewind).to_a
|
|
79
|
+
expect(lines).to be_any { |s| s =~ /Response:/ }
|
|
80
|
+
expect(lines).to be_any { |s| s =~ cell("Result") }
|
|
81
|
+
expect(lines).to be_any { |s| s =~ cell("ExecTime") }
|
|
82
|
+
expect(lines).to be_any { |s| s =~ /AddressInfo:/ }
|
|
83
|
+
expect(lines).to be_any { |s| s =~ cell("Addr") }
|
|
84
|
+
expect(lines).to be_any { |s| s =~ cell("TLD") }
|
|
85
|
+
expect(lines).to be_any { |s| s =~ /CreditsInfo:/ }
|
|
86
|
+
expect(lines).to be_any { |s| s =~ cell("FreeRmn") }
|
|
87
|
+
expect(lines).to be_any { |s| s =~ cell("FreeUsed") }
|
|
88
|
+
expect(lines).to be_any { |s| s =~ cell("PaidRmn") }
|
|
89
|
+
expect(lines).to be_any { |s| s =~ cell("PaidUsed") }
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
end; end; end
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
|
|
2
|
+
shared_context __dir__ do
|
|
3
|
+
# Build a regexp to match a text cell value.
|
|
4
|
+
def cell(value)
|
|
5
|
+
Regexp.compile '\|\s*?' + value.to_s + '\s*?\|'
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
# Create a "good" script object which is about to do some real processing.
|
|
9
|
+
def goodo(attrs = {})
|
|
10
|
+
# This thing is much over the top for a regular "new object", hence a unique name `goodo`.
|
|
11
|
+
# Stuff empty `argv` for convenience. It'll be overridden by `merge` if needed.
|
|
12
|
+
# Otherwise it'll fetch args given to `rspec`, which has no point.
|
|
13
|
+
described_class.new({
|
|
14
|
+
argv: [],
|
|
15
|
+
env: {}, # We don't want RSpec invocation environment to interfere.
|
|
16
|
+
stderr: (stderr = StringIO.new),
|
|
17
|
+
stdout: (stdout = StringIO.new),
|
|
18
|
+
}.merge(attrs)).tap do |_|
|
|
19
|
+
# IMPORTANT: We *MUST* call `handle_help_and_options` to read ENV settings from `argv`.
|
|
20
|
+
# We add expectation here since we have to call that thing anyway.
|
|
21
|
+
# It's mostly due to screwed `OptionParser` logic.
|
|
22
|
+
#expect(_.handle_help_and_options).to be_nil
|
|
23
|
+
res = _.handle_help_and_options
|
|
24
|
+
if not res.nil?
|
|
25
|
+
# Print all messages and errors from the script.
|
|
26
|
+
puts stdout.tap(&:rewind).to_a
|
|
27
|
+
STDERR.puts stderr.tap(&:rewind).to_a
|
|
28
|
+
expect(res).to be nil # Make it fail now.
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Usage:
|
|
34
|
+
#
|
|
35
|
+
# it_behaves_like "..."
|
|
36
|
+
# it_behaves_like "...", klass: the_klass
|
|
37
|
+
# it_behaves_like "...", signatures: [/nb-jobs-delete/, /ID/]
|
|
38
|
+
shared_examples "a script supporting `--help`" do |klass: described_class, signatures: nil|
|
|
39
|
+
it "generally works" do
|
|
40
|
+
# Validate arguments.
|
|
41
|
+
expect(signatures).to be_a Array
|
|
42
|
+
|
|
43
|
+
r = klass.new(
|
|
44
|
+
argv: ["--help"],
|
|
45
|
+
stdout: StringIO.new,
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
out = nil
|
|
49
|
+
expect { out = r.main }.not_to raise_error
|
|
50
|
+
expect(out).to be 0
|
|
51
|
+
|
|
52
|
+
lines = r.stdout.tap(&:rewind).to_a
|
|
53
|
+
expect(lines).to be_any { |s| s =~ /USAGE/ }
|
|
54
|
+
signatures.each do |re|
|
|
55
|
+
expect(lines).to be_any { |s| s =~ re }
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
|
|
2
|
+
describe NeverBounce::CLI::UserConfig::FileContent do
|
|
3
|
+
include_dir_context __dir__
|
|
4
|
+
|
|
5
|
+
describe "#[]" do
|
|
6
|
+
it "generally works" do
|
|
7
|
+
r = newo(body_hash: {"a" => 1})
|
|
8
|
+
expect(r["a"]).to eq 1
|
|
9
|
+
expect(r[:a]).to eq 1
|
|
10
|
+
expect(r[:b]).to be nil
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
describe "#body_hash" do
|
|
15
|
+
it "generally works" do
|
|
16
|
+
r = newo(body: "")
|
|
17
|
+
expect(r.body_hash).to eq({})
|
|
18
|
+
|
|
19
|
+
r = newo(body: ":")
|
|
20
|
+
expect { r.body_hash }.to raise_error YAML::SyntaxError
|
|
21
|
+
|
|
22
|
+
r = newo(body: "a: 1\nb: 2")
|
|
23
|
+
expect(r.body_hash).to eq({"a" => 1, "b" => 2})
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
describe "#filename" do
|
|
28
|
+
it "generally works" do
|
|
29
|
+
r = newo(env: {"HOME" => "/home/joe"})
|
|
30
|
+
expect(r.filename).to eq "/home/joe/.neverbounce.yml"
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
describe "#has_key?" do
|
|
35
|
+
it "generally works" do
|
|
36
|
+
r = newo(body_hash: {"a" => 1})
|
|
37
|
+
expect(r.has_key? :a).to be true
|
|
38
|
+
expect(r.has_key? "a").to be true
|
|
39
|
+
expect(r.has_key? :b).to be false
|
|
40
|
+
expect(r.has_key? "b").to be false
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
|
|
2
|
+
module NeverBounce::CLI
|
|
3
|
+
describe UserConfig do
|
|
4
|
+
include_dir_context __dir__
|
|
5
|
+
|
|
6
|
+
it "generally works" do
|
|
7
|
+
r = newo(fc: described_class::FileContent.new(body:"---\napi_key: abc\napi_url: def"))
|
|
8
|
+
expect(r.api_key).to eq "abc"
|
|
9
|
+
expect(r.api_url).to eq "def"
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
data/spec/spec_helper.rb
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
|
|
2
|
+
# Optionally include developer-local spec helper.
|
|
3
|
+
File.readable?(fn = File.join(__dir__, "spec_local.rb")) and require fn
|
|
4
|
+
|
|
5
|
+
# Start SimpleCov if it's enabled in Gemlocal.
|
|
6
|
+
begin
|
|
7
|
+
require "simplecov"
|
|
8
|
+
puts "NOTE: SimpleCov starting"
|
|
9
|
+
SimpleCov.start
|
|
10
|
+
rescue LoadError
|
|
11
|
+
# This is mostly a normal case, don't print anything.
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# Self.
|
|
15
|
+
require "neverbounce-cli"
|
|
16
|
+
|
|
17
|
+
# Require all `spec_helper.rb` throughout the tree for shared contexts.
|
|
18
|
+
Dir[File.join(__dir__, "**/spec_helper.rb")].each { |fn| require fn }
|
|
19
|
+
|
|
20
|
+
RSpec.configure do |conf|
|
|
21
|
+
conf.extend Module.new {
|
|
22
|
+
# Include hierarchical contexts from <tt>spec/</tt> up to <tt>__dir__</tt>.
|
|
23
|
+
#
|
|
24
|
+
# describe Something do
|
|
25
|
+
# include_dir_context __dir__
|
|
26
|
+
# ...
|
|
27
|
+
def include_dir_context(dir)
|
|
28
|
+
d, steps = dir, []
|
|
29
|
+
while d.size >= __dir__.size
|
|
30
|
+
steps << d
|
|
31
|
+
d = File.join(File.split(d)[0..-2])
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
steps.reverse.each do |d|
|
|
35
|
+
begin; include_context d; rescue ArgumentError; end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
} # conf.extend
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Absolutely common shared context.
|
|
42
|
+
shared_context __dir__ do
|
|
43
|
+
shared_examples "instantiatable" do
|
|
44
|
+
it { expect(described_class.new).to be_a described_class }
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# General-purpose "create new object".
|
|
48
|
+
def newo(attrs = {})
|
|
49
|
+
described_class.new(attrs)
|
|
50
|
+
end
|
|
51
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: neverbounce-cli
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- NeverBounce
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: exe
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2017-09-19 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: neverbounce-api
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - "~>"
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: 1.0.0
|
|
20
|
+
type: :runtime
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - "~>"
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: 1.0.0
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: terminal-table
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - "~>"
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: 1.8.0
|
|
34
|
+
type: :runtime
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - "~>"
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: 1.8.0
|
|
41
|
+
description:
|
|
42
|
+
email:
|
|
43
|
+
- support@neverbounce.com
|
|
44
|
+
executables:
|
|
45
|
+
- nb-account-info
|
|
46
|
+
- nb-jobs-create
|
|
47
|
+
- nb-jobs-delete
|
|
48
|
+
- nb-jobs-download
|
|
49
|
+
- nb-jobs-parse
|
|
50
|
+
- nb-jobs-results
|
|
51
|
+
- nb-jobs-search
|
|
52
|
+
- nb-jobs-start
|
|
53
|
+
- nb-jobs-status
|
|
54
|
+
- nb-single-check
|
|
55
|
+
extensions: []
|
|
56
|
+
extra_rdoc_files: []
|
|
57
|
+
files:
|
|
58
|
+
- ".codeclimate.yml"
|
|
59
|
+
- ".gitignore"
|
|
60
|
+
- ".rspec"
|
|
61
|
+
- ".rubocop.yml"
|
|
62
|
+
- ".travis.yml"
|
|
63
|
+
- ".yardopts"
|
|
64
|
+
- Gemfile
|
|
65
|
+
- Gemfile.lock
|
|
66
|
+
- LICENSE
|
|
67
|
+
- README.md
|
|
68
|
+
- exe/nb-account-info
|
|
69
|
+
- exe/nb-jobs-create
|
|
70
|
+
- exe/nb-jobs-delete
|
|
71
|
+
- exe/nb-jobs-download
|
|
72
|
+
- exe/nb-jobs-parse
|
|
73
|
+
- exe/nb-jobs-results
|
|
74
|
+
- exe/nb-jobs-search
|
|
75
|
+
- exe/nb-jobs-start
|
|
76
|
+
- exe/nb-jobs-status
|
|
77
|
+
- exe/nb-single-check
|
|
78
|
+
- lib/never_bounce/cli/feature/basic_initialize.rb
|
|
79
|
+
- lib/never_bounce/cli/feature/eigencache.rb
|
|
80
|
+
- lib/never_bounce/cli/feature/envars.rb
|
|
81
|
+
- lib/never_bounce/cli/feature/envars/examples_mapper.rb
|
|
82
|
+
- lib/never_bounce/cli/feature/envars/item.rb
|
|
83
|
+
- lib/never_bounce/cli/feature/igetset.rb
|
|
84
|
+
- lib/never_bounce/cli/feature/require_attr.rb
|
|
85
|
+
- lib/never_bounce/cli/script/account_info.rb
|
|
86
|
+
- lib/never_bounce/cli/script/base.rb
|
|
87
|
+
- lib/never_bounce/cli/script/error.rb
|
|
88
|
+
- lib/never_bounce/cli/script/feature/requires_job_id.rb
|
|
89
|
+
- lib/never_bounce/cli/script/feature/uses_pagination.rb
|
|
90
|
+
- lib/never_bounce/cli/script/jobs_create.rb
|
|
91
|
+
- lib/never_bounce/cli/script/jobs_create/supplied_input_parser.rb
|
|
92
|
+
- lib/never_bounce/cli/script/jobs_delete.rb
|
|
93
|
+
- lib/never_bounce/cli/script/jobs_download.rb
|
|
94
|
+
- lib/never_bounce/cli/script/jobs_parse.rb
|
|
95
|
+
- lib/never_bounce/cli/script/jobs_results.rb
|
|
96
|
+
- lib/never_bounce/cli/script/jobs_search.rb
|
|
97
|
+
- lib/never_bounce/cli/script/jobs_start.rb
|
|
98
|
+
- lib/never_bounce/cli/script/jobs_status.rb
|
|
99
|
+
- lib/never_bounce/cli/script/manifest.rb
|
|
100
|
+
- lib/never_bounce/cli/script/meaningful.rb
|
|
101
|
+
- lib/never_bounce/cli/script/request_maker.rb
|
|
102
|
+
- lib/never_bounce/cli/script/single_check.rb
|
|
103
|
+
- lib/never_bounce/cli/script/table.rb
|
|
104
|
+
- lib/never_bounce/cli/user_config.rb
|
|
105
|
+
- lib/never_bounce/cli/user_config/file_content.rb
|
|
106
|
+
- lib/never_bounce/cli/version.rb
|
|
107
|
+
- lib/neverbounce-cli.rb
|
|
108
|
+
- neverbounce-cli.gemspec
|
|
109
|
+
- spec/lib/never_bounce/cli/feature/basic_initialize_spec.rb
|
|
110
|
+
- spec/lib/never_bounce/cli/feature/eigencache_spec.rb
|
|
111
|
+
- spec/lib/never_bounce/cli/feature/envars/examples_mapper_spec.rb
|
|
112
|
+
- spec/lib/never_bounce/cli/feature/envars/item_spec.rb
|
|
113
|
+
- spec/lib/never_bounce/cli/feature/envars_spec.rb
|
|
114
|
+
- spec/lib/never_bounce/cli/feature/igetset_spec.rb
|
|
115
|
+
- spec/lib/never_bounce/cli/feature/require_attr_spec.rb
|
|
116
|
+
- spec/lib/never_bounce/cli/script/account_info_spec.rb
|
|
117
|
+
- spec/lib/never_bounce/cli/script/base_spec.rb
|
|
118
|
+
- spec/lib/never_bounce/cli/script/feature/requires_job_id_spec.rb
|
|
119
|
+
- spec/lib/never_bounce/cli/script/feature/uses_pagination_spec.rb
|
|
120
|
+
- spec/lib/never_bounce/cli/script/jobs_create/supplied_input_parser_spec.rb
|
|
121
|
+
- spec/lib/never_bounce/cli/script/jobs_create_spec.rb
|
|
122
|
+
- spec/lib/never_bounce/cli/script/jobs_delete_spec.rb
|
|
123
|
+
- spec/lib/never_bounce/cli/script/jobs_download_spec.rb
|
|
124
|
+
- spec/lib/never_bounce/cli/script/jobs_parse_spec.rb
|
|
125
|
+
- spec/lib/never_bounce/cli/script/jobs_results_spec.rb
|
|
126
|
+
- spec/lib/never_bounce/cli/script/jobs_search_spec.rb
|
|
127
|
+
- spec/lib/never_bounce/cli/script/jobs_start_spec.rb
|
|
128
|
+
- spec/lib/never_bounce/cli/script/jobs_status_spec.rb
|
|
129
|
+
- spec/lib/never_bounce/cli/script/manifest_spec.rb
|
|
130
|
+
- spec/lib/never_bounce/cli/script/meaningful_spec.rb
|
|
131
|
+
- spec/lib/never_bounce/cli/script/request_maker_spec.rb
|
|
132
|
+
- spec/lib/never_bounce/cli/script/single_check_spec.rb
|
|
133
|
+
- spec/lib/never_bounce/cli/script/spec_helper.rb
|
|
134
|
+
- spec/lib/never_bounce/cli/script/table_spec.rb
|
|
135
|
+
- spec/lib/never_bounce/cli/user_config/file_content_spec.rb
|
|
136
|
+
- spec/lib/never_bounce/cli/user_config_spec.rb
|
|
137
|
+
- spec/lib/never_bounce/cli_spec.rb
|
|
138
|
+
- spec/spec_helper.rb
|
|
139
|
+
homepage: https://neverbounce.com
|
|
140
|
+
licenses:
|
|
141
|
+
- MIT
|
|
142
|
+
metadata: {}
|
|
143
|
+
post_install_message:
|
|
144
|
+
rdoc_options: []
|
|
145
|
+
require_paths:
|
|
146
|
+
- lib
|
|
147
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
148
|
+
requirements:
|
|
149
|
+
- - ">="
|
|
150
|
+
- !ruby/object:Gem::Version
|
|
151
|
+
version: 2.0.0
|
|
152
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
153
|
+
requirements:
|
|
154
|
+
- - ">="
|
|
155
|
+
- !ruby/object:Gem::Version
|
|
156
|
+
version: '0'
|
|
157
|
+
requirements: []
|
|
158
|
+
rubyforge_project:
|
|
159
|
+
rubygems_version: 2.6.10
|
|
160
|
+
signing_key:
|
|
161
|
+
specification_version: 4
|
|
162
|
+
summary: The official NeverBounce CLI written in Ruby
|
|
163
|
+
test_files:
|
|
164
|
+
- spec/lib/never_bounce/cli/feature/basic_initialize_spec.rb
|
|
165
|
+
- spec/lib/never_bounce/cli/feature/eigencache_spec.rb
|
|
166
|
+
- spec/lib/never_bounce/cli/feature/envars/examples_mapper_spec.rb
|
|
167
|
+
- spec/lib/never_bounce/cli/feature/envars/item_spec.rb
|
|
168
|
+
- spec/lib/never_bounce/cli/feature/envars_spec.rb
|
|
169
|
+
- spec/lib/never_bounce/cli/feature/igetset_spec.rb
|
|
170
|
+
- spec/lib/never_bounce/cli/feature/require_attr_spec.rb
|
|
171
|
+
- spec/lib/never_bounce/cli/script/account_info_spec.rb
|
|
172
|
+
- spec/lib/never_bounce/cli/script/base_spec.rb
|
|
173
|
+
- spec/lib/never_bounce/cli/script/feature/requires_job_id_spec.rb
|
|
174
|
+
- spec/lib/never_bounce/cli/script/feature/uses_pagination_spec.rb
|
|
175
|
+
- spec/lib/never_bounce/cli/script/jobs_create/supplied_input_parser_spec.rb
|
|
176
|
+
- spec/lib/never_bounce/cli/script/jobs_create_spec.rb
|
|
177
|
+
- spec/lib/never_bounce/cli/script/jobs_delete_spec.rb
|
|
178
|
+
- spec/lib/never_bounce/cli/script/jobs_download_spec.rb
|
|
179
|
+
- spec/lib/never_bounce/cli/script/jobs_parse_spec.rb
|
|
180
|
+
- spec/lib/never_bounce/cli/script/jobs_results_spec.rb
|
|
181
|
+
- spec/lib/never_bounce/cli/script/jobs_search_spec.rb
|
|
182
|
+
- spec/lib/never_bounce/cli/script/jobs_start_spec.rb
|
|
183
|
+
- spec/lib/never_bounce/cli/script/jobs_status_spec.rb
|
|
184
|
+
- spec/lib/never_bounce/cli/script/manifest_spec.rb
|
|
185
|
+
- spec/lib/never_bounce/cli/script/meaningful_spec.rb
|
|
186
|
+
- spec/lib/never_bounce/cli/script/request_maker_spec.rb
|
|
187
|
+
- spec/lib/never_bounce/cli/script/single_check_spec.rb
|
|
188
|
+
- spec/lib/never_bounce/cli/script/spec_helper.rb
|
|
189
|
+
- spec/lib/never_bounce/cli/script/table_spec.rb
|
|
190
|
+
- spec/lib/never_bounce/cli/user_config/file_content_spec.rb
|
|
191
|
+
- spec/lib/never_bounce/cli/user_config_spec.rb
|
|
192
|
+
- spec/lib/never_bounce/cli_spec.rb
|
|
193
|
+
- spec/spec_helper.rb
|