notifyou 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +9 -0
- data/CODE_OF_CONDUCT.md +13 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +51 -0
- data/Rakefile +2 -0
- data/bin/console +14 -0
- data/bin/setup +7 -0
- data/lib/notifyou/version.rb +3 -0
- data/lib/notifyou.rb +7 -6
- data/notifyou.gemspec +24 -0
- metadata +35 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d02a494f70fe9a9a1e8ae58edb69df4e8b9bb53
|
4
|
+
data.tar.gz: daa1c9b9986fb0213772a80f02807efc787a6936
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e94356e8e8a527958159eb7391e65b9097b2b9133e3436e34edacd1e95a7bffcbf95cd7a8617ab7f35b0f15084dda71ab9f25980ebfd94053174ace2ed52cbe0
|
7
|
+
data.tar.gz: 902c33583b71f854b8fceeea76f5773199b165bc578abeddd9bffbff571fc37cf5bbfd0c96ef9a20124fac0a4f39daf3a75ee421a36d536711b56bec5b709a57
|
data/.gitignore
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
# Contributor Code of Conduct
|
2
|
+
|
3
|
+
As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
|
4
|
+
|
5
|
+
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, age, or religion.
|
6
|
+
|
7
|
+
Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
|
8
|
+
|
9
|
+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
|
10
|
+
|
11
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
|
12
|
+
|
13
|
+
This Code of Conduct is adapted from the [Contributor Covenant](http:contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 hienvd
|
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,51 @@
|
|
1
|
+
# Notifyou
|
2
|
+
|
3
|
+
*Notifyou* means Notify to YOU
|
4
|
+
|
5
|
+
### What is this repository for? ###
|
6
|
+
|
7
|
+
A simple gem for posting message to Slack
|
8
|
+
|
9
|
+
Another logger. Quickly and directly monitor what is causing error for your app!
|
10
|
+
|
11
|
+
## Installation
|
12
|
+
|
13
|
+
Add this line to your application's Gemfile:
|
14
|
+
|
15
|
+
```ruby
|
16
|
+
gem 'notifyou'
|
17
|
+
```
|
18
|
+
|
19
|
+
And then execute:
|
20
|
+
|
21
|
+
$ bundle
|
22
|
+
|
23
|
+
Or install it yourself as:
|
24
|
+
|
25
|
+
$ gem install notifyou
|
26
|
+
|
27
|
+
## Usage
|
28
|
+
|
29
|
+
Suppose you already had Slack [Incoming Webhooks](https://api.slack.com/incoming-webhooks) integration for your team.
|
30
|
+
|
31
|
+
Copy your Incoming Webhook elsewhere, your url will be in format `url = https://hooks.slack.com/services/xxx/yyy/zzzz`
|
32
|
+
|
33
|
+
* require 'notifyou'
|
34
|
+
* * Create an instance of Notifyou: `bot = Notifyou.new(url)`
|
35
|
+
* * Send message: `bot.notify("This is another text", "#general")`
|
36
|
+
*
|
37
|
+
* The last command will send a message to channel #general.
|
38
|
+
*
|
39
|
+
* Replace the parameters to post whatever you like. You can also send direct message by replace '#' with '@'.
|
40
|
+
|
41
|
+
## Development
|
42
|
+
|
43
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
44
|
+
|
45
|
+
## Contributing
|
46
|
+
|
47
|
+
1. Fork it ( https://github.com/[my-github-username]/notifyou/fork )
|
48
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
49
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
50
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
51
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "notifyou"
|
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
|
data/bin/setup
ADDED
data/lib/notifyou.rb
CHANGED
@@ -1,26 +1,27 @@
|
|
1
|
+
require "notifyou/version"
|
1
2
|
require 'json'
|
2
3
|
#
|
3
4
|
# @author hienvd
|
4
5
|
# @date 20151006
|
5
|
-
#
|
6
|
-
class Notifyou
|
6
|
+
#
|
7
|
+
class Notifyou
|
7
8
|
#specify a slack webhook url
|
8
9
|
def initialize url
|
9
10
|
@slack_url = url
|
10
11
|
end
|
11
|
-
|
12
|
+
|
12
13
|
# Notify a message to a channel/user
|
13
14
|
def notify msg, channel
|
14
15
|
if @slack_url == ''
|
15
16
|
puts "No slack webhook url specified"
|
16
17
|
return
|
17
18
|
end
|
18
|
-
|
19
|
-
hash = {:text => msg, :channel => channel}
|
19
|
+
|
20
|
+
hash = {:text => msg, :channel => channel}
|
20
21
|
json = JSON.generate(hash)
|
21
22
|
payload = "payload=#{json}"
|
22
23
|
|
23
24
|
`curl -X POST --data-urlencode '#{payload}' #{@slack_url}`
|
24
|
-
|
25
25
|
end
|
26
26
|
end
|
27
|
+
|
data/notifyou.gemspec
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'notifyou/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "notifyou"
|
8
|
+
spec.version = Notifyou::VERSION
|
9
|
+
spec.authors = ["Hien Vuong"]
|
10
|
+
spec.email = ["duchienvuong@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{Just a simple gem, post message to Slack.}
|
13
|
+
spec.description = %q{A simple gem for posting any message to Slack}
|
14
|
+
spec.homepage = "https://github.com/hienvd/notifyou"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
|
+
spec.bindir = "exe"
|
19
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
|
+
spec.require_paths = ["lib"]
|
21
|
+
|
22
|
+
spec.add_development_dependency "bundler", "~> 1.8"
|
23
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
24
|
+
end
|
metadata
CHANGED
@@ -1,36 +1,61 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: notifyou
|
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
|
+
- Hien Vuong
|
8
8
|
autorequire:
|
9
|
-
bindir:
|
9
|
+
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-10-
|
11
|
+
date: 2015-10-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '1.8'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
27
|
-
|
28
|
-
|
26
|
+
version: '1.8'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
description: A simple gem for posting any message to Slack
|
42
|
+
email:
|
43
|
+
- duchienvuong@gmail.com
|
29
44
|
executables: []
|
30
45
|
extensions: []
|
31
46
|
extra_rdoc_files: []
|
32
47
|
files:
|
48
|
+
- ".gitignore"
|
49
|
+
- CODE_OF_CONDUCT.md
|
50
|
+
- Gemfile
|
51
|
+
- LICENSE.txt
|
52
|
+
- README.md
|
53
|
+
- Rakefile
|
54
|
+
- bin/console
|
55
|
+
- bin/setup
|
33
56
|
- lib/notifyou.rb
|
57
|
+
- lib/notifyou/version.rb
|
58
|
+
- notifyou.gemspec
|
34
59
|
homepage: https://github.com/hienvd/notifyou
|
35
60
|
licenses:
|
36
61
|
- MIT
|
@@ -54,5 +79,5 @@ rubyforge_project:
|
|
54
79
|
rubygems_version: 2.2.2
|
55
80
|
signing_key:
|
56
81
|
specification_version: 4
|
57
|
-
summary: Just a simple gem, post message to Slack
|
82
|
+
summary: Just a simple gem, post message to Slack.
|
58
83
|
test_files: []
|