fastlane-craft 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: eaf37c0135c1fadec7264f39735452608aab95d6
4
+ data.tar.gz: 3e6cc007f41f5c1516970d6087dc55b886257d25
5
+ SHA512:
6
+ metadata.gz: 90a001e7fcb2541f24830a19aea5f9af87dadb16d1e370e311ec1f8b87f094eac86ab017c76fbaffd0ff982a6bfff0dd41142d8e5a11d824ea2ca1218df3d01b
7
+ data.tar.gz: b9ce6a5d4d646c1a246547784bf99b6457fcb17caf5721ce6b5866255b8c486c8648bf90cf21c02c54fd61037d8b2fd7f9aa50e806530b5eee1b7dcf29aa1472
@@ -0,0 +1,5 @@
1
+ require 'fastlane-craft/version'
2
+ require 'fastlane-craft/telegram'
3
+
4
+ module FastlaneCraft
5
+ end
@@ -0,0 +1,10 @@
1
+ require 'net/https'
2
+ require 'uri'
3
+
4
+ class TelegramNotifier
5
+ def self.notify(bot_api_token:,chat_id:, message:)
6
+ uri = URI.parse("https://api.telegram.org/bot#{bot_api_token}/sendMessage")
7
+ params = {text: message, chat_id: chat_id}
8
+ Net::HTTP.post_form(uri, params)
9
+ end
10
+ end
@@ -0,0 +1,72 @@
1
+ require 'telegram-notifier.rb'
2
+
3
+ module Fastlane
4
+ module Actions
5
+ class TelegramAction < Action
6
+ def self.run(params)
7
+ TelegramNotifier.notify(
8
+ bot_api_token: params[:bot_api_token],
9
+ chat_id: params[:chat_id],
10
+ message: params[:message]
11
+ )
12
+ end
13
+
14
+ #####################################################
15
+ # @!group Documentation
16
+ #####################################################
17
+
18
+ def self.description
19
+ "Send a success/error message to your Telegram group"
20
+ end
21
+
22
+ def self.details
23
+ "Send a success/error message to your Telegram group"
24
+ end
25
+
26
+ def self.available_options
27
+ [
28
+ FastlaneCore::ConfigItem.new(key: :bot_api_token,
29
+ env_name: "FL_TELEGRAM_BOT_API_TOKEN",
30
+ description: "API Token for telegram bot",
31
+ verify_block: proc do |value|
32
+ UI.user_error!("No bot API token for TelegramAction given, pass using `bot_api_token: 'token'`") unless (value and not value.empty?)
33
+ end),
34
+ FastlaneCore::ConfigItem.new(key: :message,
35
+ env_name: "FL_TELEGRAM_MESSAGE",
36
+ description: "The message that should be displayed on Telegram",
37
+ optional: true),
38
+ FastlaneCore::ConfigItem.new(key: :chat_id,
39
+ env_name: "FL_TELEGRAM_CHAT_ID",
40
+ description: "telegram chat id",
41
+ verify_block: proc do |value|
42
+ UI.user_error!("No chat id for TelegramAction given, pass using `chat_id: 'chat id'`") unless (value and not value.empty?)
43
+ end),
44
+ ]
45
+ end
46
+
47
+ def self.example_code
48
+ [
49
+ 'telegram(message: "App successfully released!")',
50
+ 'telegram(
51
+ bot_api_token: "bot api token here",
52
+ chat_id: "telegram chat id here",
53
+ message: "message here"
54
+ )'
55
+ ]
56
+ end
57
+
58
+ def self.authors
59
+ ["sroik", "elfenlaid"]
60
+ end
61
+
62
+ def self.is_supported?(platform)
63
+ true
64
+ end
65
+
66
+ def self.category
67
+ :notifications
68
+ end
69
+
70
+ end
71
+ end
72
+ end
@@ -0,0 +1,3 @@
1
+ module FastlaneCraft
2
+ VERSION = "0.1.2"
3
+ end
metadata ADDED
@@ -0,0 +1,90 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: fastlane-craft
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.2
5
+ platform: ruby
6
+ authors:
7
+ - sroik
8
+ - elfenlaid
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2017-02-20 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: bundler
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - ">="
19
+ - !ruby/object:Gem::Version
20
+ version: '0'
21
+ type: :development
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ version: '0'
28
+ - !ruby/object:Gem::Dependency
29
+ name: rake
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: '0'
35
+ type: :development
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ version: '0'
42
+ - !ruby/object:Gem::Dependency
43
+ name: webmock
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ">="
47
+ - !ruby/object:Gem::Version
48
+ version: '0'
49
+ type: :development
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ description: fastlane craft
57
+ email: vasili.kazhanouski@gmail.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - lib/fastlane-craft.rb
63
+ - lib/fastlane-craft/telegram-notifier.rb
64
+ - lib/fastlane-craft/telegram.rb
65
+ - lib/fastlane-craft/version.rb
66
+ homepage: https://github.com/dt34m/fastlane-craft.git
67
+ licenses:
68
+ - MIT
69
+ metadata: {}
70
+ post_install_message:
71
+ rdoc_options: []
72
+ require_paths:
73
+ - lib
74
+ required_ruby_version: !ruby/object:Gem::Requirement
75
+ requirements:
76
+ - - ">="
77
+ - !ruby/object:Gem::Version
78
+ version: '0'
79
+ required_rubygems_version: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ">="
82
+ - !ruby/object:Gem::Version
83
+ version: '0'
84
+ requirements: []
85
+ rubyforge_project:
86
+ rubygems_version: 2.6.8
87
+ signing_key:
88
+ specification_version: 4
89
+ summary: fastlane craft summary
90
+ test_files: []