nofakemail 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile ADDED
@@ -0,0 +1,23 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "nofakemail/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "nofakemail"
7
+ s.version = Nofakemail::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ["Nils Berenbold"]
10
+ s.email = ["nils.berenbold@gmail.com"]
11
+ s.homepage = ""
12
+ s.summary = %q{Lorem ipsum generator}
13
+ s.description = %q{Simply generates lorem ipsum text.}
14
+
15
+ s.add_development_dependency "rspec"
16
+
17
+ #s.rubyforge_project = "lorem"
18
+
19
+ s.files = `git ls-files`.split("\n")
20
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
21
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
22
+ s.require_paths = ["lib"]
23
+ end
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2012 Nils Berenbold
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Nofakemail
2
2
 
3
- TODO: Write a gem description
3
+ Nofakemail a simple gem to check if a given E-Mail-Address is linked to a Trash-Mail Provider
4
4
 
5
5
  ## Installation
6
6
 
@@ -18,12 +18,12 @@ Or install it yourself as:
18
18
 
19
19
  ## Usage
20
20
 
21
- TODO: Write usage instructions here
21
+ Simple use anywhere in your Application
22
22
 
23
- ## Contributing
23
+ Nofakemail.is_trashmail "test@trash-mail.com"
24
+ #=> true
24
25
 
25
- 1. Fork it
26
- 2. Create your feature branch (`git checkout -b my-new-feature`)
27
- 3. Commit your changes (`git commit -am 'Added some feature'`)
28
- 4. Push to the branch (`git push origin my-new-feature`)
29
- 5. Create new Pull Request
26
+ or to check several E-Mail-Addresses
27
+
28
+ Nofakemail.are_trashmails ["as@trash-mail.com", "qw@trash-mail.com", "asd@googlemail.com"]
29
+ #=> {"as@trash-mail.com"=>true, "qw@trash-mail.com"=>true, "asd@googlemail.com"=>false}
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env rake
2
+ require "bundler/gem_tasks"
@@ -0,0 +1,3 @@
1
+ module Nofakemail
2
+ VERSION = "0.0.2"
3
+ end
data/lib/nofakemail.rb ADDED
@@ -0,0 +1,23 @@
1
+ require "nofakemail/version"
2
+ require "open-uri"
3
+
4
+ module Nofakemail
5
+ class << self
6
+ def is_trashmail input_email
7
+ body = open("http://nofakemail.net/webservice/isTrashmail/json?email=#{input_email}").read rescue ""
8
+ json_body = ActiveSupport::JSON.decode body
9
+ json_body["valid"]
10
+ end
11
+
12
+ def are_trashmails email_array
13
+ email_array.each_with_index do |email,key|
14
+ email_array[key] = "email[]=#{email}"
15
+ end
16
+
17
+ body = open("http://nofakemail.net/webservice/isTrashmail/json?#{email_array.join("&")}").read rescue ""
18
+ json_body = ActiveSupport::JSON.decode body
19
+
20
+ json_body["emails"]
21
+ end
22
+ end
23
+ end
Binary file
@@ -0,0 +1,17 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require File.expand_path('../lib/nofakemail/version', __FILE__)
3
+
4
+ Gem::Specification.new do |gem|
5
+ gem.authors = ["Nils Berenbold"]
6
+ gem.email = ["nils.berenbold@gmail.com"]
7
+ gem.description = "a Gem which checks if an E-Mail-Address is a Trash-Mail"
8
+ gem.summary = ""
9
+ gem.homepage = ""
10
+
11
+ gem.files = `git ls-files`.split($\)
12
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
13
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
14
+ gem.name = "nofakemail"
15
+ gem.require_paths = ["lib"]
16
+ gem.version = Nofakemail::VERSION
17
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nofakemail
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -19,7 +19,14 @@ extensions: []
19
19
  extra_rdoc_files: []
20
20
  files:
21
21
  - .gitignore
22
+ - Gemfile
23
+ - LICENSE
22
24
  - README.md
25
+ - Rakefile
26
+ - lib/nofakemail.rb
27
+ - lib/nofakemail/version.rb
28
+ - nofakemail-0.0.1.gem
29
+ - nofakemail.gemspec
23
30
  homepage: ''
24
31
  licenses: []
25
32
  post_install_message: