firespring_dev_commands 2.0.2.pre.alpha.1 → 2.0.3
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 95e943deecbe27ecee82dfd49d1818cebcc03d45a2b2d9a02625b9f237417843
|
4
|
+
data.tar.gz: a4b7c1bccbf51e3b2bd8a9435350a7b3be529675f28bca4b4ba3e97cf16d45aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 70cbba686f2088eac99f29ca712c9c84feab9a2df94d1a8fa461f6f68fcf3f157a948c984fba2dbf9c87545415a041abe44ebff404f112c2ca06e2ed15e98b60
|
7
|
+
data.tar.gz: af865ecfb842b03ac78169719294f17eebfceb2eeba10172fde1fd1ddf47d56093347bff03dba266817a595211fee987816a30b4ebf64da81b425a5166944d59
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: firespring_dev_commands
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Firespring
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-07-
|
11
|
+
date: 2023-07-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -234,20 +234,6 @@ dependencies:
|
|
234
234
|
- - "~>"
|
235
235
|
- !ruby/object:Gem::Version
|
236
236
|
version: 13.0.6
|
237
|
-
- !ruby/object:Gem::Dependency
|
238
|
-
name: slack-ruby-client
|
239
|
-
requirement: !ruby/object:Gem::Requirement
|
240
|
-
requirements:
|
241
|
-
- - "~>"
|
242
|
-
- !ruby/object:Gem::Version
|
243
|
-
version: 2.1.0
|
244
|
-
type: :runtime
|
245
|
-
prerelease: false
|
246
|
-
version_requirements: !ruby/object:Gem::Requirement
|
247
|
-
requirements:
|
248
|
-
- - "~>"
|
249
|
-
- !ruby/object:Gem::Version
|
250
|
-
version: 2.1.0
|
251
237
|
description: Ruby library for creating/maintaining your development environment
|
252
238
|
email: opensource@firespring.com
|
253
239
|
executables: []
|
@@ -297,8 +283,6 @@ files:
|
|
297
283
|
- lib/firespring_dev_commands/ruby.rb
|
298
284
|
- lib/firespring_dev_commands/ruby/audit.rb
|
299
285
|
- lib/firespring_dev_commands/second.rb
|
300
|
-
- lib/firespring_dev_commands/slack.rb
|
301
|
-
- lib/firespring_dev_commands/slack/global.rb
|
302
286
|
- lib/firespring_dev_commands/tar.rb
|
303
287
|
- lib/firespring_dev_commands/tar/pax_header.rb
|
304
288
|
- lib/firespring_dev_commands/tar/type_flag.rb
|
@@ -326,12 +310,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
326
310
|
requirements:
|
327
311
|
- - ">="
|
328
312
|
- !ruby/object:Gem::Version
|
329
|
-
version: '3.
|
313
|
+
version: '3.1'
|
330
314
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
331
315
|
requirements:
|
332
|
-
- - "
|
316
|
+
- - ">="
|
333
317
|
- !ruby/object:Gem::Version
|
334
|
-
version:
|
318
|
+
version: '0'
|
335
319
|
requirements: []
|
336
320
|
rubygems_version: 3.4.10
|
337
321
|
signing_key:
|
@@ -1,32 +0,0 @@
|
|
1
|
-
# Load any existing slack auth if we haven't set one in the environment
|
2
|
-
require 'dotenv'
|
3
|
-
|
4
|
-
module Dev
|
5
|
-
class Slack
|
6
|
-
class Global
|
7
|
-
# The filename where we store the local auth information
|
8
|
-
CONFIG_FILE = "#{Dir.home}/.env.slack".freeze
|
9
|
-
|
10
|
-
SLACK_API_TOKEN = 'SLACK_API_TOKEN'.freeze
|
11
|
-
|
12
|
-
def configure
|
13
|
-
# Always load the env slack auth
|
14
|
-
Dotenv.load(CONFIG_FILE) if File.exist?(CONFIG_FILE)
|
15
|
-
|
16
|
-
::Slack.configure do |c|
|
17
|
-
c.token = ENV.fetch('SLACK_API_TOKEN', nil)
|
18
|
-
c.logger = LOG if ENV['ENABLE_SLACK_DEBUG'].to_s.strip == 'true'
|
19
|
-
end
|
20
|
-
end
|
21
|
-
new.configure
|
22
|
-
|
23
|
-
# Write the new slack auth value to the env file
|
24
|
-
def write!(api_token)
|
25
|
-
override = Dev::Env.new(CONFIG_FILE)
|
26
|
-
override.set(SLACK_API_TOKEN, api_token)
|
27
|
-
override.write
|
28
|
-
configure
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
@@ -1,23 +0,0 @@
|
|
1
|
-
require 'slack'
|
2
|
-
|
3
|
-
module Dev
|
4
|
-
class Slack
|
5
|
-
attr_accessor :client
|
6
|
-
|
7
|
-
def initialize
|
8
|
-
@client = ::Slack::Web::Client.new
|
9
|
-
@client.auth_test
|
10
|
-
end
|
11
|
-
|
12
|
-
def post(channel:, text:)
|
13
|
-
client.chat_postMessage(channel:, text:)
|
14
|
-
end
|
15
|
-
|
16
|
-
def upload_text(channel:, text:, title: 'Text File', filename: 'file.txt')
|
17
|
-
raise 'text should be a string' unless text.is_a?(String)
|
18
|
-
|
19
|
-
file = Faraday::UploadIO.new(StringIO.new(text), 'text/plain')
|
20
|
-
client.files_upload(channels: channel, title:, file:, filename:, filetype: 'text')
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|