guerrilla_mailX 0.0.9 → 0.1.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 +4 -4
- data/CODE_OF_CONDUCT.md +74 -0
- data/LICENSE.txt +21 -0
- data/README.md +83 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/guerrilla_mailX.gemspec +41 -0
- data/lib/guerrilla_mailX.rb +9 -0
- data/lib/{guerrillamailchecker → guerrilla_mailX}/api.rb +7 -7
- data/lib/{guerrillamailchecker → guerrilla_mailX}/errors.rb +1 -1
- data/lib/guerrilla_mailX/version.rb +3 -0
- metadata +23 -15
- data/guerrillamailchecker.gemspec +0 -26
- data/lib/guerrillamailchecker.rb +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 18cbc793a633922249fd91719649d1709ae1c5019bb2cf0d79ed4d2ad8c1d7f2
|
4
|
+
data.tar.gz: abe4dbb347c9552086f1ae574320c15f0912619c5be28a33f345375c52650dee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 75a3adb0a453e3c63620f72eeeeda442b9e5ae2adc39e9bcba6f0807a7904ed0cfe336731c53ba7e44fcd175f590d840107497a7146009466a66514306815436
|
7
|
+
data.tar.gz: 3cf86ed6bd71000fd1d9109878bc5cbc090500951e9b32264b127dfa22fa0db94669ec1b2855298a3bd3c3aee3605810ed9f6dd19f371dd0a630b59c6e173199
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at gupta.himanshu@thinkfuture.us. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [https://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: https://contributor-covenant.org
|
74
|
+
[version]: https://contributor-covenant.org/version/1/4/
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2020 himanshu-thinkfuture
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,83 @@
|
|
1
|
+
# GuerrillaMailX
|
2
|
+
|
3
|
+
guerrilla_mailX provides easy methods to call guerilla_mail API's and also you can easily verify subject and body of any mail received over the guerrila_mail.
|
4
|
+
|
5
|
+
It is very helpful in testing of mails.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'guerrilla_mailX'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle install
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install guerrilla_mailX
|
22
|
+
|
23
|
+
|
24
|
+
### Getting started
|
25
|
+
----
|
26
|
+
###### Get new random mail Id:
|
27
|
+
You can use Guerrilla.new to get random email id which will be active only for 1 hour.
|
28
|
+
This method returns an object with attributes: `sid_token`, `email`, `time timestamp`, `alias_id` and `valid_till`
|
29
|
+
|
30
|
+
> guerrilla_mail = Guerrilla.new
|
31
|
+
|
32
|
+
You can also set your custom email:
|
33
|
+
|
34
|
+
> guerrilla_mail = Guerrilla.new(custom_test)
|
35
|
+
|
36
|
+
|
37
|
+
###### To verify last received mail:
|
38
|
+
**_verify_last_mail_** can be used to verify body and subject of last mail received.
|
39
|
+
```sh
|
40
|
+
> guerrilla_mail.verify_last_mail(subject: "Welcome to guerrilla_mail")
|
41
|
+
```
|
42
|
+
While `subject:` is required argument and `body:` is optional. This method will return true for subject, if given string is present in last mail. Default wait time is 120 seconds, which you can change by argument `wait:`
|
43
|
+
|
44
|
+
If you want to verify particular mail by offset in a list you can use:
|
45
|
+
```sh
|
46
|
+
> guerrilla_mail.verify_mail(subject: "Welcome to guerrilla_mail", offset: 3)
|
47
|
+
```
|
48
|
+
This will test 3rd email from last recently received mail. You can also provide `email_id:` if you dont want to use offset. You will get email_id from **_get_email_list_** method. In this wait time is also 120 sec but you can change it by providing `wait:` argument. You can also provide `body:` argument that takes a string and check if it is present in a mail body. This method returns hash for subject and body, if present they are set to true else false.
|
49
|
+
|
50
|
+
##### Methods available
|
51
|
+
- **initialize**
|
52
|
+
- **set_email_user**
|
53
|
+
- **verify_last_mail**
|
54
|
+
- **verify_mail**
|
55
|
+
- **check_email**
|
56
|
+
- **get_email_list**
|
57
|
+
- **fetch_email**
|
58
|
+
- **forget_me**
|
59
|
+
- **del_email**
|
60
|
+
- **get_older_list**
|
61
|
+
|
62
|
+
All these method can take `sid_token:` argument and then work for that sid_token.
|
63
|
+
|
64
|
+
##### Class methods available
|
65
|
+
- **get_email_address**
|
66
|
+
- **forget_me**
|
67
|
+
- **del_email**
|
68
|
+
|
69
|
+
##### Reference
|
70
|
+
You can check Guerrilla Mail API and argument it takes from [Guerrilla Mail JSON API](https://docs.google.com/document/d/1Qw5KQP1j57BPTDmms5nspe-QAjNEsNg8cQHpAAycYNM)
|
71
|
+
|
72
|
+
## Contributing
|
73
|
+
|
74
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/himanshu-thinkfuture/guerrilla_mailX. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/himanshu-thinkfuture/guerrilla_mailX/blob/master/CODE_OF_CONDUCT.md).
|
75
|
+
|
76
|
+
|
77
|
+
## License
|
78
|
+
|
79
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
80
|
+
|
81
|
+
## Code of Conduct
|
82
|
+
|
83
|
+
Everyone interacting in the GuerrillaMailX project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/himanshu-thinkfuture/guerrilla_mailX/blob/master/CODE_OF_CONDUCT.md).
|
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "guerrilla_mailX"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
require "pry"
|
11
|
+
Pry.start
|
12
|
+
|
13
|
+
# require "irb"
|
14
|
+
# IRB.start(__FILE__)
|
data/bin/setup
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
require_relative 'lib/guerrilla_mailX/version'
|
2
|
+
|
3
|
+
Gem::Specification.new do |spec|
|
4
|
+
spec.name = 'guerrilla_mailX'
|
5
|
+
spec.version = GuerrillaMailX::VERSION
|
6
|
+
spec.date = '2020-05-20'
|
7
|
+
spec.authors = ["Himanshu Gupta"]
|
8
|
+
spec.email = ["gupta.himanshu@thinkfuture.us"]
|
9
|
+
|
10
|
+
spec.summary = "Ruby gem to get mail from guerrillamail.com and verify sent mails"
|
11
|
+
spec.description = "Ruby gem to get mail from guerrillamail.com. With this gem you can use guerrillamail
|
12
|
+
APIs and verify subject and body of received emails."
|
13
|
+
spec.homepage = 'https://github.com/himanshu-thinkfuture/guerrilla_mailX'
|
14
|
+
spec.license = "MIT"
|
15
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
|
16
|
+
|
17
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
# Specify which files should be added to the gem when it is released.
|
22
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
23
|
+
# spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
24
|
+
# `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
25
|
+
# end
|
26
|
+
spec.files = %w[guerrilla_mailX.gemspec CODE_OF_CONDUCT.md README.md LICENSE.txt] + Dir['lib/**/*.rb'] + Dir['bin/**/*']
|
27
|
+
spec.bindir = "exe"
|
28
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
29
|
+
spec.require_paths = ["lib"]
|
30
|
+
|
31
|
+
|
32
|
+
spec.add_development_dependency 'bundler'
|
33
|
+
spec.add_development_dependency 'rake', '>= 10.0'
|
34
|
+
spec.add_development_dependency 'pry'
|
35
|
+
|
36
|
+
spec.add_runtime_dependency 'rest-client', '>=2.1.0'
|
37
|
+
spec.add_runtime_dependency 'activesupport', '~> 5.0', '>= 5.0.0.1'
|
38
|
+
spec.add_runtime_dependency 'rainbow', '~> 2.1'
|
39
|
+
|
40
|
+
|
41
|
+
end
|
@@ -6,7 +6,7 @@ require 'date'
|
|
6
6
|
require 'rainbow'
|
7
7
|
require 'active_support'
|
8
8
|
require 'active_support/core_ext'
|
9
|
-
require '
|
9
|
+
require 'guerrilla_mailX/errors.rb'
|
10
10
|
|
11
11
|
|
12
12
|
class Guerrilla
|
@@ -56,7 +56,7 @@ class Guerrilla
|
|
56
56
|
def verify_last_mail sid_token: nil, wait: 120, body: nil, subject: nil
|
57
57
|
if !subject.present?
|
58
58
|
puts "\e[31mArgument Required\e[0m: No \e[33msubject\e[0m given"
|
59
|
-
raise
|
59
|
+
raise Error.new.message("subject")
|
60
60
|
return
|
61
61
|
end
|
62
62
|
|
@@ -93,7 +93,7 @@ class Guerrilla
|
|
93
93
|
def verify_mail sid_token: nil, email_id: nil, offset: nil, wait: 120, body: nil, subject: nil
|
94
94
|
if !subject.present?
|
95
95
|
puts "\e[31mArgument Required\e[0m: No \e[33msubject\e[0m given"
|
96
|
-
raise
|
96
|
+
raise Error.new.message("subject")
|
97
97
|
return
|
98
98
|
end
|
99
99
|
|
@@ -139,7 +139,7 @@ class Guerrilla
|
|
139
139
|
return result
|
140
140
|
end
|
141
141
|
|
142
|
-
def check_email(
|
142
|
+
def check_email(sid_token: nil, seq: 0)
|
143
143
|
if !sid_token.present?
|
144
144
|
sid_token = @sid_token
|
145
145
|
end
|
@@ -160,7 +160,7 @@ class Guerrilla
|
|
160
160
|
def fetch_email(sid_token: nil, mail_id: nil)
|
161
161
|
if !mail_id.present?
|
162
162
|
puts "\e[31mArgument Required\e[0m: No \e[33mmail_id\e[0m given"
|
163
|
-
raise
|
163
|
+
raise Error.new.message("mail_id")
|
164
164
|
return
|
165
165
|
end
|
166
166
|
if !sid_token.present?
|
@@ -181,7 +181,7 @@ class Guerrilla
|
|
181
181
|
def self.forget_me(sid_token: nil, email_addr: nil)
|
182
182
|
if !sid_token.present?
|
183
183
|
puts "\e[31mArgument Required\e[0m: No \e[33msid_token\e[0m given"
|
184
|
-
raise
|
184
|
+
raise Error.new.message("sid_token")
|
185
185
|
return
|
186
186
|
end
|
187
187
|
forget_sid_url = "https://api.guerrillamail.com/ajax.php?f=forget_me&sid_token=#{sid_token}&email_addr=#{email_addr}"
|
@@ -205,7 +205,7 @@ class Guerrilla
|
|
205
205
|
def self.del_email(sid_token: nil, email_ids: nil)
|
206
206
|
if !sid_token.present?
|
207
207
|
puts "\e[31mArgument Required\e[0m: No \e[33msid_token\e[0m given"
|
208
|
-
raise
|
208
|
+
raise Error.new.message("sid_token")
|
209
209
|
return
|
210
210
|
end
|
211
211
|
email_s = ""
|
metadata
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: guerrilla_mailX
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Himanshu Gupta
|
8
8
|
autorequire:
|
9
|
-
bindir:
|
9
|
+
bindir: exe
|
10
10
|
cert_chain: []
|
11
11
|
date: 2020-05-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
@@ -101,20 +101,29 @@ dependencies:
|
|
101
101
|
- !ruby/object:Gem::Version
|
102
102
|
version: '2.1'
|
103
103
|
description: "Ruby gem to get mail from guerrillamail.com. With this gem you can use
|
104
|
-
guerrillamail \n APIs and verify subject and body of
|
105
|
-
|
106
|
-
email:
|
104
|
+
guerrillamail \n APIs and verify subject and body of received
|
105
|
+
emails."
|
106
|
+
email:
|
107
|
+
- gupta.himanshu@thinkfuture.us
|
107
108
|
executables: []
|
108
109
|
extensions: []
|
109
110
|
extra_rdoc_files: []
|
110
111
|
files:
|
111
|
-
-
|
112
|
-
-
|
113
|
-
-
|
114
|
-
-
|
115
|
-
|
116
|
-
|
117
|
-
|
112
|
+
- CODE_OF_CONDUCT.md
|
113
|
+
- LICENSE.txt
|
114
|
+
- README.md
|
115
|
+
- bin/console
|
116
|
+
- bin/setup
|
117
|
+
- guerrilla_mailX.gemspec
|
118
|
+
- lib/guerrilla_mailX.rb
|
119
|
+
- lib/guerrilla_mailX/api.rb
|
120
|
+
- lib/guerrilla_mailX/errors.rb
|
121
|
+
- lib/guerrilla_mailX/version.rb
|
122
|
+
homepage: https://github.com/himanshu-thinkfuture/guerrilla_mailX
|
123
|
+
licenses:
|
124
|
+
- MIT
|
125
|
+
metadata:
|
126
|
+
homepage_uri: https://github.com/himanshu-thinkfuture/guerrilla_mailX
|
118
127
|
post_install_message:
|
119
128
|
rdoc_options: []
|
120
129
|
require_paths:
|
@@ -123,15 +132,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
123
132
|
requirements:
|
124
133
|
- - ">="
|
125
134
|
- !ruby/object:Gem::Version
|
126
|
-
version:
|
135
|
+
version: 2.3.0
|
127
136
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
128
137
|
requirements:
|
129
138
|
- - ">="
|
130
139
|
- !ruby/object:Gem::Version
|
131
140
|
version: '0'
|
132
141
|
requirements: []
|
133
|
-
|
134
|
-
rubygems_version: 2.7.9
|
142
|
+
rubygems_version: 3.0.8
|
135
143
|
signing_key:
|
136
144
|
specification_version: 4
|
137
145
|
summary: Ruby gem to get mail from guerrillamail.com and verify sent mails
|
@@ -1,26 +0,0 @@
|
|
1
|
-
Gem::Specification.new do |spec|
|
2
|
-
spec.name = 'guerrilla_mailX'
|
3
|
-
spec.version = '0.0.9'
|
4
|
-
spec.date = '2020-05-20'
|
5
|
-
spec.summary = "Ruby gem to get mail from guerrillamail.com and verify sent mails"
|
6
|
-
spec.description = "Ruby gem to get mail from guerrillamail.com. With this gem you can use guerrillamail
|
7
|
-
APIs and verify subject and body of email received."
|
8
|
-
spec.authors = ["Himanshu Gupta"]
|
9
|
-
spec.email = 'gupta.himanshu@thinkfuture.us'
|
10
|
-
spec.files = %w[guerrillamailchecker.gemspec] + Dir['lib/**/*.rb']
|
11
|
-
spec.homepage = 'https://github.com/himanshu-thinkfuture/guerrillamail-checker'
|
12
|
-
|
13
|
-
spec.require_paths = ['lib']
|
14
|
-
|
15
|
-
|
16
|
-
spec.add_development_dependency 'bundler'
|
17
|
-
spec.add_development_dependency 'rake', '>= 10.0'
|
18
|
-
# spec.add_development_dependency 'rspec', '>= 3.9.0'
|
19
|
-
spec.add_development_dependency 'pry'
|
20
|
-
|
21
|
-
spec.add_runtime_dependency 'rest-client', '>=2.1.0'
|
22
|
-
spec.add_runtime_dependency 'activesupport', '~> 5.0', '>= 5.0.0.1'
|
23
|
-
spec.add_runtime_dependency 'rainbow', '~> 2.1'
|
24
|
-
|
25
|
-
|
26
|
-
end
|