slack_messaging 1.2.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +107 -0
- data/Guardfile +5 -0
- data/{LICENSE.txt → LICENSE} +1 -1
- data/README.md +31 -19
- data/Rakefile +1 -2
- data/bin/slack-messaging +6 -1
- data/lib/slack_messaging.rb +9 -7
- data/lib/slack_messaging/config.rb +17 -38
- data/lib/slack_messaging/default_paths.rb +13 -0
- data/lib/slack_messaging/notify_slack.rb +10 -11
- data/lib/slack_messaging/random_message.rb +5 -29
- data/lib/slack_messaging/slack.rb +22 -0
- data/lib/slack_messaging/version.rb +1 -1
- data/spec/slack_messaging/config_spec.rb +42 -33
- data/spec/slack_messaging/notify_slack_spec.rb +38 -29
- data/spec/slack_messaging/random_message_spec.rb +41 -24
- data/spec/spec_helper.rb +5 -5
- metadata +86 -57
- data/.codeclimate.yml +0 -37
- data/.github/ISSUE_TEMPLATE/bug_report.md +0 -38
- data/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
- data/.gitignore +0 -18
- data/.octopolo.yml +0 -4
- data/.rspec +0 -2
- data/.ruby-gemset +0 -1
- data/.ruby-version +0 -1
- data/.soyuz.yml +0 -12
- data/.travis.yml +0 -23
- data/CHANGELOG.markdown +0 -11
- data/CODE_OF_CONDUCT.md +0 -76
- data/CONTRIBUTING.md +0 -11
- data/lib/slack_messaging/commands/slack.rb +0 -7
- data/lib/slack_messaging/output.rb +0 -13
- data/lib/slack_messaging/scripts/slack.rb +0 -29
- data/slack_messaging.gemspec +0 -32
data/.codeclimate.yml
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
version: "2"
|
2
|
-
checks:
|
3
|
-
argument-count:
|
4
|
-
config:
|
5
|
-
threshold: 4
|
6
|
-
complex-logic:
|
7
|
-
config:
|
8
|
-
threshold: 4
|
9
|
-
file-lines:
|
10
|
-
config:
|
11
|
-
threshold: 250
|
12
|
-
method-complexity:
|
13
|
-
config:
|
14
|
-
threshold: 8
|
15
|
-
method-count:
|
16
|
-
config:
|
17
|
-
threshold: 20
|
18
|
-
method-lines:
|
19
|
-
config:
|
20
|
-
threshold: 25
|
21
|
-
nested-control-flow:
|
22
|
-
config:
|
23
|
-
threshold: 4
|
24
|
-
return-statements:
|
25
|
-
config:
|
26
|
-
threshold: 4
|
27
|
-
similar-code:
|
28
|
-
config:
|
29
|
-
threshold: # language-specific defaults. an override will affect all languages.
|
30
|
-
identical-code:
|
31
|
-
config:
|
32
|
-
threshold: # language-specific defaults. an override will affect all languages.
|
33
|
-
exclude_patterns:
|
34
|
-
- "**/spec/"
|
35
|
-
- "**/test/"
|
36
|
-
- "**/vendor/"
|
37
|
-
- "**/*.js"
|
@@ -1,38 +0,0 @@
|
|
1
|
-
---
|
2
|
-
name: Bug report
|
3
|
-
about: Create a report to help us improve
|
4
|
-
title: ''
|
5
|
-
labels: ''
|
6
|
-
assignees: ''
|
7
|
-
|
8
|
-
---
|
9
|
-
|
10
|
-
**Describe the bug**
|
11
|
-
A clear and concise description of what the bug is.
|
12
|
-
|
13
|
-
**To Reproduce**
|
14
|
-
Steps to reproduce the behavior:
|
15
|
-
1. Go to '...'
|
16
|
-
2. Click on '....'
|
17
|
-
3. Scroll down to '....'
|
18
|
-
4. See error
|
19
|
-
|
20
|
-
**Expected behavior**
|
21
|
-
A clear and concise description of what you expected to happen.
|
22
|
-
|
23
|
-
**Screenshots**
|
24
|
-
If applicable, add screenshots to help explain your problem.
|
25
|
-
|
26
|
-
**Desktop (please complete the following information):**
|
27
|
-
- OS: [e.g. iOS]
|
28
|
-
- Browser [e.g. chrome, safari]
|
29
|
-
- Version [e.g. 22]
|
30
|
-
|
31
|
-
**Smartphone (please complete the following information):**
|
32
|
-
- Device: [e.g. iPhone6]
|
33
|
-
- OS: [e.g. iOS8.1]
|
34
|
-
- Browser [e.g. stock browser, safari]
|
35
|
-
- Version [e.g. 22]
|
36
|
-
|
37
|
-
**Additional context**
|
38
|
-
Add any other context about the problem here.
|
@@ -1,20 +0,0 @@
|
|
1
|
-
---
|
2
|
-
name: Feature request
|
3
|
-
about: Suggest an idea for this project
|
4
|
-
title: ''
|
5
|
-
labels: ''
|
6
|
-
assignees: ''
|
7
|
-
|
8
|
-
---
|
9
|
-
|
10
|
-
**Is your feature request related to a problem? Please describe.**
|
11
|
-
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
12
|
-
|
13
|
-
**Describe the solution you'd like**
|
14
|
-
A clear and concise description of what you want to happen.
|
15
|
-
|
16
|
-
**Describe alternatives you've considered**
|
17
|
-
A clear and concise description of any alternative solutions or features you've considered.
|
18
|
-
|
19
|
-
**Additional context**
|
20
|
-
Add any other context or screenshots about the feature request here.
|
data/.gitignore
DELETED
data/.octopolo.yml
DELETED
data/.rspec
DELETED
data/.ruby-gemset
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
slack_messaging
|
data/.ruby-version
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
ruby-2.2.5
|
data/.soyuz.yml
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
defaults:
|
2
|
-
deploy_cmd: gem push *.gem
|
3
|
-
before_deploy_cmds:
|
4
|
-
- sed -i "" -e "s/\".*/\"$(git tag| sed s/v// | sort -n -t. -k1,1 -k2,2 -k3,3 | tail -1)\"/" lib/sport_ngin_aws_auditor/version.rb
|
5
|
-
- git add lib/slack_messaging/version.rb
|
6
|
-
- git commit -m "Version Bump" && git push
|
7
|
-
- gem build slack_messaging.gemspec
|
8
|
-
after_deploy_cmds:
|
9
|
-
- rm *.gem
|
10
|
-
environments:
|
11
|
-
-
|
12
|
-
rubygems: {}
|
data/.travis.yml
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
sudo: false
|
2
|
-
language: ruby
|
3
|
-
rvm:
|
4
|
-
- 2.2
|
5
|
-
cache: bundler
|
6
|
-
|
7
|
-
branches:
|
8
|
-
only:
|
9
|
-
- master
|
10
|
-
|
11
|
-
env:
|
12
|
-
global:
|
13
|
-
- CC_TEST_REPORTER_ID=9abbba4824d3bcfbdb673e4c3f55dbf671333685a36c0a6e228bc1b0416c961d
|
14
|
-
|
15
|
-
before_script:
|
16
|
-
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
17
|
-
- chmod +x ./cc-test-reporter
|
18
|
-
- ./cc-test-reporter before-build
|
19
|
-
|
20
|
-
script: bundle exec rspec
|
21
|
-
|
22
|
-
after_script:
|
23
|
-
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
|
data/CHANGELOG.markdown
DELETED
data/CODE_OF_CONDUCT.md
DELETED
@@ -1,76 +0,0 @@
|
|
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, sex characteristics, gender identity and expression,
|
9
|
-
level of experience, education, socio-economic status, nationality, personal
|
10
|
-
appearance, race, religion, or sexual identity and 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 emma.sax4@gmail.com. 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://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
72
|
-
|
73
|
-
[homepage]: https://www.contributor-covenant.org
|
74
|
-
|
75
|
-
For answers to common questions about this code of conduct, see
|
76
|
-
https://www.contributor-covenant.org/faq
|
data/CONTRIBUTING.md
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
# Contributing
|
2
|
-
|
3
|
-
1. Fork it (https://github.com/emma-sax4/slack_messaging/fork)
|
4
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
5
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
6
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
7
|
-
5. Continue making awesome changes!
|
8
|
-
6. To see how it works, follow the [Usage section in the README.md](https://github.com/emma-sax4/slack_messaging#usage)
|
9
|
-
7. When you're satisfied, make a pull request to this repository
|
10
|
-
8. If I don't comment or start looking at the pull request in a couple of days, feel free to send me [an email](mailto:emma.sax4@gmail.com)
|
11
|
-
9. I approve your pull request and merge!
|
@@ -1,29 +0,0 @@
|
|
1
|
-
require 'highline/import'
|
2
|
-
require_relative "../notify_slack"
|
3
|
-
require_relative "../random_message"
|
4
|
-
|
5
|
-
module SlackMessaging
|
6
|
-
module Scripts
|
7
|
-
class Slack
|
8
|
-
class << self
|
9
|
-
attr_accessor :options
|
10
|
-
end
|
11
|
-
|
12
|
-
def self.execute(args, options=nil)
|
13
|
-
if args.empty?
|
14
|
-
message = RandomMessage.new # generate a new random message
|
15
|
-
print_message(message.get_text)
|
16
|
-
else
|
17
|
-
args.each do |message|
|
18
|
-
print_message(message)
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
def self.print_message(message)
|
24
|
-
slack_job = NotifySlack.new(message)
|
25
|
-
slack_job.perform
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
data/slack_messaging.gemspec
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require 'slack_messaging/version'
|
5
|
-
|
6
|
-
Gem::Specification.new do |spec|
|
7
|
-
spec.name = "slack_messaging"
|
8
|
-
spec.version = SlackMessaging::VERSION
|
9
|
-
spec.authors = ["Emma Sax"]
|
10
|
-
spec.email = ["emma.sax4@gmail.com"]
|
11
|
-
spec.summary = %q{Sending Personalized Slack Messages}
|
12
|
-
spec.description = %q{Sending Personalized Slack Messages}
|
13
|
-
spec.homepage = "https://github.com/emma-sax4/slack_messaging"
|
14
|
-
spec.license = "MIT"
|
15
|
-
|
16
|
-
spec.files = `git ls-files -z`.split("\x0")
|
17
|
-
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
-
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
-
spec.require_paths = ["lib"]
|
20
|
-
|
21
|
-
spec.add_dependency 'hashie', '~> 3.3'
|
22
|
-
spec.add_dependency 'gli', '~> 2.10'
|
23
|
-
spec.add_dependency 'highline', '~> 1.6'
|
24
|
-
spec.add_dependency 'slack-notifier', '~> 1.5.1'
|
25
|
-
spec.add_dependency 'rack', '~> 1.6.12'
|
26
|
-
spec.add_dependency 'activesupport', '~> 4.1.11'
|
27
|
-
|
28
|
-
spec.add_development_dependency "bundler", "~> 1.7"
|
29
|
-
spec.add_development_dependency "rake", "~> 12.3.3"
|
30
|
-
spec.add_development_dependency "rspec", "~> 3.4.0"
|
31
|
-
spec.add_development_dependency 'simplecov'
|
32
|
-
end
|