NeverBounce 0.1.1 → 0.1.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8492e9c134b40ff99656c55e7d180f7ea04e3642
4
- data.tar.gz: 176866a8866313cbdd51eea24c0e53541faac9c3
3
+ metadata.gz: 57427c26eb66a91d464cd020859972f70ec54d80
4
+ data.tar.gz: 3714505d7c65b576642e5215133be7f845096333
5
5
  SHA512:
6
- metadata.gz: 62ca86d3887e2d878755bc3eca7f45129b1bcd9f0b08bc4568e218d0c2f5f0c6be079a2bcc883a6415852e02914573e57aa1edca04c1a0ba9b951c7880891461
7
- data.tar.gz: d6bb824b93ec119e010164a8533b79989152b373187d8b9eeff1983ce4f19a0535da03c8ec85be8e70d84c179a770456c67ce9b90a7c3bb630eaa5e3a2bf384a
6
+ metadata.gz: 0021aa5387a14f5d3d9f7c908972118ac63ecf37cb61ac904caa20feda63bcefcd2bba455cf5012c31d1839ce58fa364717a47e54a46b68bb833f4420658e999
7
+ data.tar.gz: 37f82550311dee9e9fd0c078bbc9575e0cbcb5a2d212300d6b2afb41ed811d848209683fd095e27c1d993e1dc511df385b6f2f61a731b61298efa2d41e1b3656
@@ -0,0 +1,95 @@
1
+ # Created by .ignore support plugin (hsz.mobi)
2
+ ### Node template
3
+ # Logs
4
+ logs
5
+ *.log
6
+ npm-debug.log*
7
+
8
+ # Runtime data
9
+ pids
10
+ *.pid
11
+ *.seed
12
+
13
+ # Directory for instrumented libs generated by jscoverage/JSCover
14
+ lib-cov
15
+
16
+ # Coverage directory used by tools like istanbul
17
+ coverage
18
+
19
+ # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
20
+ .grunt
21
+
22
+ # node-waf configuration
23
+ .lock-wscript
24
+
25
+ # Compiled binary addons (http://nodejs.org/api/addons.html)
26
+ build/Release
27
+
28
+ # Dependency directory
29
+ # https://docs.npmjs.com/misc/faq#should-i-check-my-node-modules-folder-into-git
30
+ node_modules
31
+ ### SublimeText template
32
+ # cache files for sublime text
33
+ *.tmlanguage.cache
34
+ *.tmPreferences.cache
35
+ *.stTheme.cache
36
+
37
+ # workspace files are user-specific
38
+ *.sublime-workspace
39
+
40
+ # project files should be checked into the repository, unless a significant
41
+ # proportion of contributors will probably not be using SublimeText
42
+ # *.sublime-project
43
+
44
+ # sftp configuration file
45
+ sftp-config.json
46
+ ### JetBrains template
47
+ # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio
48
+
49
+ *.iml
50
+
51
+ ## Directory-based project format:
52
+ .idea/
53
+ # if you remove the above rule, at least ignore the following:
54
+
55
+ # User-specific stuff:
56
+ # .idea/workspace.xml
57
+ # .idea/tasks.xml
58
+ # .idea/dictionaries
59
+
60
+ # Sensitive or high-churn files:
61
+ # .idea/dataSources.ids
62
+ # .idea/dataSources.xml
63
+ # .idea/sqlDataSources.xml
64
+ # .idea/dynamic.xml
65
+ # .idea/uiDesigner.xml
66
+
67
+ # Gradle:
68
+ # .idea/gradle.xml
69
+ # .idea/libraries
70
+
71
+ # Mongo Explorer plugin:
72
+ # .idea/mongoSettings.xml
73
+
74
+ ## File-based project format:
75
+ *.ipr
76
+ *.iws
77
+
78
+ ## Plugin-specific files:
79
+
80
+ # IntelliJ
81
+ /out/
82
+
83
+ # mpeltonen/sbt-idea plugin
84
+ .idea_modules/
85
+
86
+ # JIRA plugin
87
+ atlassian-ide-plugin.xml
88
+
89
+ # Crashlytics plugin (for Android Studio and IntelliJ)
90
+ com_crashlytics_export_strings.xml
91
+ crashlytics.properties
92
+ crashlytics-build.properties
93
+
94
+ examples/
95
+ *.gem
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --require spec_helper
@@ -0,0 +1,7 @@
1
+ language: ruby
2
+
3
+ rvm:
4
+ - 1.9.3
5
+ - 2.0.0
6
+ - 2.1
7
+ - 2.2
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ # A sample Gemfile
2
+ source "https://rubygems.org"
3
+
4
+ gem "httparty"
5
+ gem "rspec"
6
+ gem "rake"
@@ -0,0 +1,21 @@
1
+ require './NeverBounce'
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = 'NeverBounce'
5
+ s.version = NeverBounce::VERSION
6
+ s.date = '2016-02-22'
7
+ s.summary = "The official NeverBounce API library for Ruby"
8
+ s.description = "The official NeverBounce API library for Ruby"
9
+ s.authors = ["Mike Mollick"]
10
+ s.email = ['mike@neverbounce.com']
11
+ s.homepage = 'https://neverbounce.com'
12
+ s.license = 'MIT'
13
+ s.files = `git ls-files`.split("\n")
14
+ s.test_files = `git ls-files -- spec/*`.split("\n")
15
+ s.required_ruby_version = '>= 1.9.3'
16
+
17
+ s.add_dependency('httparty', '~> 0.13.7')
18
+
19
+ s.add_development_dependency('rspec', '~> 3.4.0')
20
+ s.add_development_dependency('rake')
21
+ end
@@ -6,7 +6,7 @@ require './NeverBounce/Single'
6
6
 
7
7
  module NeverBounce
8
8
 
9
- VERSION = "0.1.1"
9
+ VERSION = "0.1.2"
10
10
 
11
11
  class API
12
12
  include HTTParty
@@ -0,0 +1,37 @@
1
+ NeverBounce API Ruby Wrapper
2
+ ---
3
+
4
+ This is the official NeverBounce API Ruby wrapper. It provides helpful methods to quickly implement our API in your Ruby applications.
5
+
6
+ Installation
7
+ ===
8
+
9
+ >TODO: Make into a gem
10
+
11
+ Usage
12
+ ===
13
+
14
+ To start using the wrapper sign up for an account [here](https://app.neverbounce.com/register) and get your api keys [here](https://app.neverbounce.com/settings/api).
15
+
16
+ To initialize the wrapper use the following snippet, substituting in your `api key` and `api secret key`...
17
+
18
+ ```
19
+ neverbounce = NeverBounce::API.new(API_KEY, API_SECRET_KEY)
20
+ ```
21
+
22
+ You can now access the verify method from this class. To validate a single email use the following...
23
+
24
+ ```
25
+ result = neverbounce.single.verify(EMAIL)
26
+ ```
27
+
28
+ The `result` will contain a VerificationResult class instance. It provides several helper methods documented below...
29
+
30
+ ```
31
+ result.getResultCode # Numeric result code; ex: 0, 1, 2, 3, 4
32
+ result.getResultTextCode # Textual result code; ex: valid, invalid, disposable, catchall, unknown
33
+ result.is(0) # Returns true if result is valid
34
+ result.is([0,3,4]) # Returns true if result is valid, catchall, or unknown
35
+ result.not(1) # Returns true if result is not invalid
36
+ result.not([1,2]) # Returns true if result is not invalid or disposable
37
+ ```
@@ -0,0 +1,9 @@
1
+ require 'rake'
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new(:spec) do |t|
5
+ t.pattern = Dir.glob('spec/**/*_spec.rb')
6
+ t.rspec_opts = '--format documentation'
7
+ end
8
+
9
+ task :default => :spec
@@ -0,0 +1,37 @@
1
+ require './NeverBounce/Single'
2
+ require 'spec_helper'
3
+
4
+
5
+
6
+ describe "VerifiedEmail" do
7
+ context "will create new instance from response" do
8
+ x = NeverBounce::VerifiedEmail.new({
9
+ 'success' => true,
10
+ 'result' => 0,
11
+ 'result_details' => 0,
12
+ 'execution_time' => 0.22115206718445
13
+ })
14
+
15
+ it "and getResultCode will return 0" do
16
+ expect(x.getResultCode).to eq 0
17
+ end
18
+
19
+ it "and getResultTextCode will return 'valid'" do
20
+ expect(x.getResultTextCode).to eq 'valid'
21
+ end
22
+
23
+ it "and is will return expected result" do
24
+ expect(x.is(0)).to eq true
25
+ expect(x.is([0])).to eq true
26
+ expect(x.is(1)).to eq false
27
+ expect(x.is([1,2,3])).to eq false
28
+ end
29
+
30
+ it "and not will return expected result" do
31
+ expect(x.not(0)).to eq false
32
+ expect(x.not([0])).to eq false
33
+ expect(x.not(1)).to eq true
34
+ expect(x.not([1,2,3])).to eq true
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,96 @@
1
+ # This file was generated by the `rspec --init` command. Conventionally, all
2
+ # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
3
+ # The generated `.rspec` file contains `--require spec_helper` which will cause
4
+ # this file to always be loaded, without a need to explicitly require it in any
5
+ # files.
6
+ #
7
+ # Given that it is always loaded, you are encouraged to keep this file as
8
+ # light-weight as possible. Requiring heavyweight dependencies from this file
9
+ # will add to the boot time of your test suite on EVERY test run, even for an
10
+ # individual file that may not need all of that loaded. Instead, consider making
11
+ # a separate helper file that requires the additional dependencies and performs
12
+ # the additional setup, and require it from the spec files that actually need
13
+ # it.
14
+ #
15
+ # The `.rspec` file also contains a few flags that are not defaults but that
16
+ # users commonly want.
17
+ #
18
+ # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
19
+ RSpec.configure do |config|
20
+ # rspec-expectations config goes here. You can use an alternate
21
+ # assertion/expectation library such as wrong or the stdlib/minitest
22
+ # assertions if you prefer.
23
+ config.expect_with :rspec do |expectations|
24
+ # This option will default to `true` in RSpec 4. It makes the `description`
25
+ # and `failure_message` of custom matchers include text for helper methods
26
+ # defined using `chain`, e.g.:
27
+ # be_bigger_than(2).and_smaller_than(4).description
28
+ # # => "be bigger than 2 and smaller than 4"
29
+ # ...rather than:
30
+ # # => "be bigger than 2"
31
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
32
+ end
33
+
34
+ # rspec-mocks config goes here. You can use an alternate test double
35
+ # library (such as bogus or mocha) by changing the `mock_with` option here.
36
+ config.mock_with :rspec do |mocks|
37
+ # Prevents you from mocking or stubbing a method that does not exist on
38
+ # a real object. This is generally recommended, and will default to
39
+ # `true` in RSpec 4.
40
+ mocks.verify_partial_doubles = true
41
+ end
42
+
43
+ # The settings below are suggested to provide a good initial experience
44
+ # with RSpec, but feel free to customize to your heart's content.
45
+ =begin
46
+ # These two settings work together to allow you to limit a spec run
47
+ # to individual examples or groups you care about by tagging them with
48
+ # `:focus` metadata. When nothing is tagged with `:focus`, all examples
49
+ # get run.
50
+ config.filter_run :focus
51
+ config.run_all_when_everything_filtered = true
52
+
53
+ # Allows RSpec to persist some state between runs in order to support
54
+ # the `--only-failures` and `--next-failure` CLI options. We recommend
55
+ # you configure your source control system to ignore this file.
56
+ config.example_status_persistence_file_path = "spec/examples.txt"
57
+
58
+ # Limits the available syntax to the non-monkey patched syntax that is
59
+ # recommended. For more details, see:
60
+ # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/
61
+ # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
62
+ # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode
63
+ config.disable_monkey_patching!
64
+
65
+ # This setting enables warnings. It's recommended, but in some cases may
66
+ # be too noisy due to issues in dependencies.
67
+ config.warnings = true
68
+
69
+ # Many RSpec users commonly either run the entire suite or an individual
70
+ # file, and it's useful to allow more verbose output when running an
71
+ # individual spec file.
72
+ if config.files_to_run.one?
73
+ # Use the documentation formatter for detailed output,
74
+ # unless a formatter has already been configured
75
+ # (e.g. via a command-line flag).
76
+ config.default_formatter = 'doc'
77
+ end
78
+
79
+ # Print the 10 slowest examples and example groups at the
80
+ # end of the spec run, to help surface which specs are running
81
+ # particularly slow.
82
+ config.profile_examples = 10
83
+
84
+ # Run specs in random order to surface order dependencies. If you find an
85
+ # order dependency and want to debug it, you can fix the order by providing
86
+ # the seed, which is printed after each run.
87
+ # --seed 1234
88
+ config.order = :random
89
+
90
+ # Seed global randomization in this process using the `--seed` CLI option.
91
+ # Setting this allows you to use `--seed` to deterministically reproduce
92
+ # test failures related to randomization by passing the same `--seed` value
93
+ # as the one that triggered the failure.
94
+ Kernel.srand config.seed
95
+ =end
96
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: NeverBounce
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Mollick
@@ -59,9 +59,18 @@ executables: []
59
59
  extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
- - ./NeverBounce.rb
63
- - ./NeverBounce/Errors.rb
64
- - ./NeverBounce/Single.rb
62
+ - .gitignore
63
+ - .rspec
64
+ - .travis.yml
65
+ - Gemfile
66
+ - NeverBounce.gemspec
67
+ - NeverBounce.rb
68
+ - NeverBounce/Errors.rb
69
+ - NeverBounce/Single.rb
70
+ - README.md
71
+ - Rakefile
72
+ - spec/VerifiedEmail_spec.rb
73
+ - spec/spec_helper.rb
65
74
  homepage: https://neverbounce.com
66
75
  licenses:
67
76
  - MIT
@@ -86,4 +95,6 @@ rubygems_version: 2.0.14
86
95
  signing_key:
87
96
  specification_version: 4
88
97
  summary: The official NeverBounce API library for Ruby
89
- test_files: []
98
+ test_files:
99
+ - spec/VerifiedEmail_spec.rb
100
+ - spec/spec_helper.rb