slack-ruby3 0.1.1

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: e42b291a6e5c450b7288c1c57d137a45c8cad3ac0c8fbf4d3ff303c5ec5fab55
4
+ data.tar.gz: 0fa5958ac45cf2019a0d1f9277f2b890c3ee6c6a04e65a257445b0f7b0c4a610
5
+ SHA512:
6
+ metadata.gz: 4de9eca7ba08eb18d3a9583438c0dfc78f61e89307739bb656d6c64bae2ef6b22ffbe8e75df954a76e57dc327c862c60559031126b314e639e02f43ed77cc708
7
+ data.tar.gz: 8130d8373f74424f4c9c3d29a3e2b54cc6da11cd5ab2fdd1aef17998925f650d3a6eac7a1544f7aef75a6d876ab351a76ebca45243ef665f8a5b78bd9986cb6d
@@ -0,0 +1,38 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+ # See https://help.github.com/articles/ignoring-files for more about ignoring files.
10
+ #
11
+ # If you find yourself ignoring temporary files generated by your text editor
12
+ # or operating system, you probably want to add a global ignore instead:
13
+ # git config --global core.excludesfile '~/.gitignore_global'
14
+
15
+ # Ignore bundler config.
16
+ /.bundle
17
+ # Ignore all logfiles and tempfiles.
18
+ /log/*
19
+ /tmp/*
20
+ !/log/.keep
21
+ !/tmp/.keep
22
+ /elsoul.key
23
+ # Ignore pidfiles, but keep the directory.
24
+ /tmp/pids/*
25
+ !/tmp/pids/
26
+ !/tmp/pids/.keep
27
+ .env
28
+ .envrc
29
+ /public/assets
30
+ .byebug_history
31
+
32
+ # Ignore master key for decrypting credentials and more.
33
+ /config/master.key
34
+ /config/keyfile.json
35
+ .DS_Store
36
+
37
+ # rspec failure tracking
38
+ .rspec_status
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
@@ -0,0 +1,197 @@
1
+ AllCops:
2
+ EnabledByDefault: true
3
+
4
+ Style/AndOr:
5
+ Enabled: false
6
+
7
+ Style/ClassAndModuleChildren:
8
+ Enabled: false
9
+
10
+ Style/AsciiComments:
11
+ Enabled: false
12
+
13
+ Style/SymbolArray:
14
+ Enabled: false
15
+
16
+ Style/WordArray:
17
+ Enabled: false
18
+
19
+ Style/MixinGrouping:
20
+ Enabled: false
21
+
22
+ Style/RescueStandardError:
23
+ Enabled: false
24
+
25
+ Style/MethodCallWithArgsParentheses:
26
+ Enabled: false
27
+
28
+ Style/DocumentationMethod:
29
+ Enabled: false
30
+
31
+ Style/CollectionMethods:
32
+ PreferredMethods:
33
+ detect: "detect"
34
+ find: "detect"
35
+ inject: "inject"
36
+ reduce: "inject"
37
+
38
+ Style/Documentation:
39
+ Enabled: false
40
+
41
+ Style/DoubleNegation:
42
+ Enabled: false
43
+
44
+ Lint/ConstantResolution:
45
+ Enabled: false
46
+
47
+ Layout/DotPosition:
48
+ EnforcedStyle: trailing
49
+
50
+
51
+ Layout/EmptyLineAfterGuardClause:
52
+ Enabled: false
53
+
54
+ Style/EmptyElse:
55
+ EnforcedStyle: empty
56
+
57
+ Layout/ExtraSpacing:
58
+ Exclude:
59
+ - "db/migrate/*.rb"
60
+ - "*.gemspec"
61
+
62
+ Style/FormatString:
63
+ EnforcedStyle: percent
64
+
65
+ Style/MissingElse:
66
+ Enabled: false
67
+
68
+ Style/StringHashKeys:
69
+ Exclude:
70
+ - "spec/queries/*.rb"
71
+ - "*.gemspec"
72
+
73
+ Style/GuardClause:
74
+ MinBodyLength: 5
75
+
76
+ Style/HashSyntax:
77
+ EnforcedStyle: ruby19
78
+ Exclude:
79
+ - "**/*.rake"
80
+ - "Rakefile"
81
+
82
+ Style/IfUnlessModifier:
83
+ Enabled: false
84
+
85
+ Style/PreferredHashMethods:
86
+ EnforcedStyle: short
87
+
88
+ Style/Lambda:
89
+ Enabled: false
90
+
91
+ Style/NumericLiterals:
92
+ MinDigits: 7
93
+
94
+ Style/PerlBackrefs:
95
+ AutoCorrect: false
96
+
97
+ Style/RedundantSelf:
98
+ Enabled: false
99
+
100
+ Style/FrozenStringLiteralComment:
101
+ Enabled: false
102
+
103
+ Style/RedundantReturn:
104
+ AllowMultipleReturnValues: true
105
+
106
+ Style/Semicolon:
107
+ Exclude:
108
+ - "spec/**/*"
109
+
110
+ Style/SignalException:
111
+ EnforcedStyle: only_raise
112
+
113
+ Style/MethodDefParentheses:
114
+ Enabled: false
115
+
116
+ Style/StringLiterals:
117
+ EnforcedStyle: double_quotes
118
+
119
+ Style/StringLiteralsInInterpolation:
120
+ Enabled: false
121
+
122
+ Style/SingleLineBlockParams:
123
+ Enabled: false
124
+
125
+ Lint/UnderscorePrefixedVariableName:
126
+ Enabled: false
127
+
128
+ Lint/UnusedMethodArgument:
129
+ Enabled: false
130
+
131
+
132
+ Metrics/AbcSize:
133
+ Enabled: false
134
+
135
+ Metrics/CyclomaticComplexity:
136
+ Max: 10
137
+
138
+ Metrics/PerceivedComplexity:
139
+ Enabled: false
140
+
141
+ Metrics/BlockLength:
142
+ Enabled: false
143
+
144
+ Layout/LineLength:
145
+ Enabled: false
146
+
147
+
148
+ Metrics/MethodLength:
149
+ Enabled: false
150
+
151
+ Metrics/ClassLength:
152
+ Enabled: false
153
+
154
+ Naming/HeredocDelimiterNaming:
155
+ Enabled: false
156
+
157
+ Naming/AccessorMethodName:
158
+ Enabled: false
159
+
160
+ Metrics/ModuleLength:
161
+ Enabled: false
162
+
163
+ Lint/UnusedBlockArgument:
164
+ Enabled: false
165
+
166
+ Lint/RescueException:
167
+ Enabled: false
168
+
169
+ Naming/RescuedExceptionsVariableName:
170
+ Enabled: false
171
+
172
+ Bundler/GemComment:
173
+ Enabled: false
174
+
175
+ Style/SafeNavigation:
176
+ Enabled: false
177
+
178
+ Lint/NumberConversion:
179
+ Enabled: false
180
+ Style/ConstantVisibility:
181
+ Enabled: false
182
+ Style/MutableConstant:
183
+ Enabled: false
184
+ Style/Copyright:
185
+ Enabled: false
186
+ Style/MultilineTernaryOperator:
187
+ Enabled: false
188
+ Layout/MultilineAssignmentLayout:
189
+ Enabled: false
190
+ Style/Send:
191
+ Enabled: false
192
+ Style/MixinUsage:
193
+ Enabled: false
194
+ Style/GlobalStdStream:
195
+ Enabled: false
196
+ Lint/ConstantDefinitionInBlock:
197
+ Enabled: false
data/Gemfile ADDED
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in slack-ruby3.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
9
+ gem "dotenv", "2.7.6"
10
+ gem "rspec", "~> 3.0"
@@ -0,0 +1,36 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ slack-ruby3 (0.1.0)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ diff-lcs (1.4.4)
10
+ dotenv (2.7.6)
11
+ rake (13.0.3)
12
+ rspec (3.10.0)
13
+ rspec-core (~> 3.10.0)
14
+ rspec-expectations (~> 3.10.0)
15
+ rspec-mocks (~> 3.10.0)
16
+ rspec-core (3.10.1)
17
+ rspec-support (~> 3.10.0)
18
+ rspec-expectations (3.10.1)
19
+ diff-lcs (>= 1.2.0, < 2.0)
20
+ rspec-support (~> 3.10.0)
21
+ rspec-mocks (3.10.1)
22
+ diff-lcs (>= 1.2.0, < 2.0)
23
+ rspec-support (~> 3.10.0)
24
+ rspec-support (3.10.1)
25
+
26
+ PLATFORMS
27
+ x86_64-darwin-20
28
+
29
+ DEPENDENCIES
30
+ dotenv (= 2.7.6)
31
+ rake (~> 13.0)
32
+ rspec (~> 3.0)
33
+ slack-ruby3!
34
+
35
+ BUNDLED WITH
36
+ 2.2.4
@@ -0,0 +1,35 @@
1
+ # Slack::Ruby3
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/slack/ruby3`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'slack-ruby3'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle install
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install slack-ruby3
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ 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`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/slack-ruby3.
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ task default: :spec
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "bundler/setup"
5
+ require "slack/ruby3"
6
+
7
+ # You can add fixtures and/or initialization code here to make experimenting
8
+ # with your gem easier. You can also use a different console, if you like.
9
+
10
+ # (If you use this, don't forget to add pry to your Gemfile!)
11
+ # require "pry"
12
+ # Pry.start
13
+
14
+ require "irb"
15
+ IRB.start(__FILE__)
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require "slack/ruby3"
3
+
4
+ puts Slack::Ruby3.push webhook_url: ARGV[0], message: ARGV[1]
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "ruby3/version"
4
+ require "dotenv/load"
5
+ require "net/http"
6
+ require "json"
7
+ module Slack
8
+ module Ruby3
9
+ class Error < StandardError; end
10
+ def self.push webhook_url: "", message: "hoi!"
11
+ uri = URI.parse(webhook_url)
12
+ http = Net::HTTP.new(uri.host, uri.port)
13
+ http.use_ssl = true
14
+ http.verify_mode = OpenSSL::SSL::VERIFY_NONE
15
+ req = Net::HTTP::Post.new(uri.path, initheader = { "Content-Type" => "application/json" })
16
+ req.body = { text: message }.to_json
17
+ status_code = http.request(req).code
18
+ return "Sent Message: #{message}" if status_code.to_i == 200
19
+ "Error Code: #{status_code}\nSomething wrong."
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Slack
4
+ module Ruby3
5
+ VERSION = "0.1.1"
6
+ end
7
+ end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/slack/ruby3/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "slack-ruby3"
7
+ spec.version = Slack::Ruby3::VERSION
8
+ spec.authors = ["POPPIN-FUMI", "KishiTheMechanic"]
9
+ spec.email = ["fumitake.kawasaki@el-soul.com", "shota.kishi@el-soul.com"]
10
+
11
+ spec.summary = "Slack Notification Compatible with Ruby version 3.0.0"
12
+ spec.description = "Slack Notification Compatible with Ruby version 3.0.0"
13
+ spec.homepage = "https://github.com/elsoul/slack-ruby3"
14
+ spec.license = "Apache-2.0"
15
+ spec.required_ruby_version = Gem::Requirement.new(">= 3.0.0")
16
+
17
+ spec.metadata["homepage_uri"] = spec.homepage
18
+ spec.metadata["source_code_uri"] = "https://github.com/elsoul/slack-ruby3"
19
+ spec.metadata["changelog_uri"] = "https://github.com/elsoul/slack-ruby3"
20
+ # Specify which files should be added to the gem when it is released.
21
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
22
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
23
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
24
+ end
25
+ spec.bindir = "exe"
26
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
27
+ spec.require_paths = ["lib"]
28
+
29
+ # Uncomment to register a new dependency of your gem
30
+ # spec.add_dependency "example-gem", "~> 1.0"
31
+
32
+ # For more information and examples about making a new gem, checkout our
33
+ # guide at: https://bundler.io/guides/creating_gem.html
34
+ end
metadata ADDED
@@ -0,0 +1,62 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: slack-ruby3
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ platform: ruby
6
+ authors:
7
+ - POPPIN-FUMI
8
+ - KishiTheMechanic
9
+ autorequire:
10
+ bindir: exe
11
+ cert_chain: []
12
+ date: 2021-01-08 00:00:00.000000000 Z
13
+ dependencies: []
14
+ description: Slack Notification Compatible with Ruby version 3.0.0
15
+ email:
16
+ - fumitake.kawasaki@el-soul.com
17
+ - shota.kishi@el-soul.com
18
+ executables:
19
+ - slack_ruby3
20
+ extensions: []
21
+ extra_rdoc_files: []
22
+ files:
23
+ - ".gitignore"
24
+ - ".rspec"
25
+ - ".rubocop.yml"
26
+ - Gemfile
27
+ - Gemfile.lock
28
+ - README.md
29
+ - Rakefile
30
+ - bin/console
31
+ - bin/setup
32
+ - exe/slack_ruby3
33
+ - lib/slack/ruby3.rb
34
+ - lib/slack/ruby3/version.rb
35
+ - slack-ruby3.gemspec
36
+ homepage: https://github.com/elsoul/slack-ruby3
37
+ licenses:
38
+ - Apache-2.0
39
+ metadata:
40
+ homepage_uri: https://github.com/elsoul/slack-ruby3
41
+ source_code_uri: https://github.com/elsoul/slack-ruby3
42
+ changelog_uri: https://github.com/elsoul/slack-ruby3
43
+ post_install_message:
44
+ rdoc_options: []
45
+ require_paths:
46
+ - lib
47
+ required_ruby_version: !ruby/object:Gem::Requirement
48
+ requirements:
49
+ - - ">="
50
+ - !ruby/object:Gem::Version
51
+ version: 3.0.0
52
+ required_rubygems_version: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: '0'
57
+ requirements: []
58
+ rubygems_version: 3.2.3
59
+ signing_key:
60
+ specification_version: 4
61
+ summary: Slack Notification Compatible with Ruby version 3.0.0
62
+ test_files: []