firespring_dev_commands 2.0.1 → 2.0.2.pre.alpha.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4b0857c9b284d51ba3ce800ff218d0377cc704a7af501bfd1fdab7289f3a21fd
4
- data.tar.gz: 9656cb58cf70b518fac2d2deef2c717d58f573d094deaaadc077ad617bb9c652
3
+ metadata.gz: 6224c1ab85f20e8d68a1404044e94ee2496107b475d10bd12352ea633bc790f6
4
+ data.tar.gz: 39e4b7bfe83bf377b98c24dd62e19e2e636917a9486548b57c8983c33956e3d2
5
5
  SHA512:
6
- metadata.gz: c1544d3cbece1edcc17b346813d1594d109a324cc63056efe5c199186ac45ae6d3da83b0bb94d157fc54fc5d6bd95896ee477ebf9642bfe995e0c84ee0ec0c95
7
- data.tar.gz: 7a2cb860e2e30b6a9d4ad935507120ca192a60f63e8182c579e3b9b185a6377593535b8839e6819e2316e7c2ebfa04be8bcf79f5675ea4b92d35a82cdb82a600
6
+ metadata.gz: 5a29005dddecf7f55eb5b7fb44cbee47c605260893212c00498e121a156d3d9e8de2eafa74f0f9b1c551422838467da4a75b36bda043278dd0b255507d66da1f
7
+ data.tar.gz: 14ffd29f8ffdb83e6a5f221e0f3ba979e48dfb841413c5c10019e97cf7e9c97b039bb7d120f0ccc020f69e679ed29be6eaf27ca10daa51cbc27caaecf3748138
@@ -0,0 +1,32 @@
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
@@ -0,0 +1,23 @@
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
@@ -6,6 +6,6 @@ module Dev
6
6
  # Use 'v.v.v.pre.alpha.v' for pre-release vesions
7
7
  # Use 'v.v.v.beta.v for beta versions
8
8
  # Use semantic versioning for any releases (https://semver.org/)
9
- VERSION = '2.0.1'.freeze
9
+ VERSION = '2.0.2.pre.alpha.1'.freeze
10
10
  end
11
11
  end
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.1
4
+ version: 2.0.2.pre.alpha.1
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-13 00:00:00.000000000 Z
11
+ date: 2023-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -234,6 +234,20 @@ 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
237
251
  description: Ruby library for creating/maintaining your development environment
238
252
  email: opensource@firespring.com
239
253
  executables: []
@@ -283,6 +297,8 @@ files:
283
297
  - lib/firespring_dev_commands/ruby.rb
284
298
  - lib/firespring_dev_commands/ruby/audit.rb
285
299
  - lib/firespring_dev_commands/second.rb
300
+ - lib/firespring_dev_commands/slack.rb
301
+ - lib/firespring_dev_commands/slack/global.rb
286
302
  - lib/firespring_dev_commands/tar.rb
287
303
  - lib/firespring_dev_commands/tar/pax_header.rb
288
304
  - lib/firespring_dev_commands/tar/type_flag.rb
@@ -313,9 +329,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
313
329
  version: '3.2'
314
330
  required_rubygems_version: !ruby/object:Gem::Requirement
315
331
  requirements:
316
- - - ">="
332
+ - - ">"
317
333
  - !ruby/object:Gem::Version
318
- version: '0'
334
+ version: 1.3.1
319
335
  requirements: []
320
336
  rubygems_version: 3.4.10
321
337
  signing_key: