mina-skype 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/.rspec +3 -0
- data/.travis.yml +5 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +67 -0
- data/README.md +35 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/mina/skype/defaults.rb +11 -0
- data/lib/mina/skype/tasks.rb +79 -0
- data/lib/mina/skype/version.rb +5 -0
- data/lib/mina/skype.rb +10 -0
- data/mina-skype.gemspec +30 -0
- metadata +141 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 5befde3fab6365a133d3c0ae69333b34810db3b7
|
4
|
+
data.tar.gz: 3bb4a7ff42cf406f376fb1cfec928ec89d4d5bbb
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: e79ab789f3603911aaf18cb14e9d1953a93c59d90847a65f9f75ffd352194251fa9e2d74e901edcf54459f31fa65d5102ff861745f7703c5e57ad81482b92101
|
7
|
+
data.tar.gz: 539459308503134c89d4a266c77188cdbf50d768c2c1d0c4f1f85961579c4f72dfc1004a3bd355c3c1631def80ddcbd9311cb948cf6b28d46f24dc9a5ebccaa1
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,67 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
mina-skype (0.1.0)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
activesupport (5.2.0)
|
10
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
11
|
+
i18n (>= 0.7, < 2)
|
12
|
+
minitest (~> 5.1)
|
13
|
+
tzinfo (~> 1.1)
|
14
|
+
concurrent-ruby (1.0.5)
|
15
|
+
diff-lcs (1.3)
|
16
|
+
ethon (0.11.0)
|
17
|
+
ffi (>= 1.3.0)
|
18
|
+
faraday (0.9.2)
|
19
|
+
multipart-post (>= 1.2, < 3)
|
20
|
+
ffi (1.9.25)
|
21
|
+
i18n (1.0.1)
|
22
|
+
concurrent-ruby (~> 1.0)
|
23
|
+
mina (1.2.3)
|
24
|
+
open4 (~> 1.3.4)
|
25
|
+
rake
|
26
|
+
minitest (5.11.3)
|
27
|
+
multipart-post (2.0.0)
|
28
|
+
open4 (1.3.4)
|
29
|
+
rake (10.5.0)
|
30
|
+
rspec (3.7.0)
|
31
|
+
rspec-core (~> 3.7.0)
|
32
|
+
rspec-expectations (~> 3.7.0)
|
33
|
+
rspec-mocks (~> 3.7.0)
|
34
|
+
rspec-core (3.7.1)
|
35
|
+
rspec-support (~> 3.7.0)
|
36
|
+
rspec-expectations (3.7.0)
|
37
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
38
|
+
rspec-support (~> 3.7.0)
|
39
|
+
rspec-mocks (3.7.0)
|
40
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
41
|
+
rspec-support (~> 3.7.0)
|
42
|
+
rspec-support (3.7.1)
|
43
|
+
skype_bot (0.0.7)
|
44
|
+
activesupport
|
45
|
+
faraday (~> 0.9.2)
|
46
|
+
thor
|
47
|
+
typhoeus (~> 1.0)
|
48
|
+
thor (0.20.0)
|
49
|
+
thread_safe (0.3.6)
|
50
|
+
typhoeus (1.3.0)
|
51
|
+
ethon (>= 0.9.0)
|
52
|
+
tzinfo (1.2.5)
|
53
|
+
thread_safe (~> 0.1)
|
54
|
+
|
55
|
+
PLATFORMS
|
56
|
+
ruby
|
57
|
+
|
58
|
+
DEPENDENCIES
|
59
|
+
bundler (~> 1.16)
|
60
|
+
mina
|
61
|
+
mina-skype!
|
62
|
+
rake (~> 10.0)
|
63
|
+
rspec (~> 3.0)
|
64
|
+
skype_bot
|
65
|
+
|
66
|
+
BUNDLED WITH
|
67
|
+
1.16.1
|
data/README.md
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
# Mina::Skype
|
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/mina/skype`. 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 'mina-skype'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install mina-skype
|
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 tags, 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]/mina-skype.
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "mina/skype"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
# Required
|
2
|
+
set_default :skype_app_id, -> { ENV['SKYPE_APP_ID'] }
|
3
|
+
set_default :skype_app_secret, -> { ENV['SKYPE_APP_SECRET'] }
|
4
|
+
set_default :skype_conversation_id, -> { ENV['SKYPE_CONVERSATION_ID'] }
|
5
|
+
|
6
|
+
# Optional
|
7
|
+
set_default :skype_application, -> { ENV['SKYPE_APPLICATION'] || application }
|
8
|
+
|
9
|
+
# Git
|
10
|
+
set_default :deployer, -> { ENV['GIT_AUTHOR_NAME'] || %x[git config user.name].chomp }
|
11
|
+
set_default :deployed_revision, -> { ENV['GIT_COMMIT'] || %x[git rev-parse #{branch}].strip }
|
@@ -0,0 +1,79 @@
|
|
1
|
+
require 'mina/hooks'
|
2
|
+
require 'skype_bot'
|
3
|
+
|
4
|
+
# Before and after hooks for mina deploy
|
5
|
+
before_mina :deploy, :'skype:starting'
|
6
|
+
after_mina :deploy, :'skype:finished'
|
7
|
+
|
8
|
+
|
9
|
+
# Skype tasks
|
10
|
+
namespace :skype do
|
11
|
+
|
12
|
+
task :starting do
|
13
|
+
if ready_to_run
|
14
|
+
announcement = "#{announced_deployer} is deploying #{announced_application_name} to #{announced_stage}"
|
15
|
+
|
16
|
+
post_skype_message(announcement)
|
17
|
+
set(:start_time, Time.now)
|
18
|
+
else
|
19
|
+
print_error_message
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
task :finished do
|
24
|
+
if ready_to_run
|
25
|
+
end_time = Time.now
|
26
|
+
start_time = fetch(:start_time)
|
27
|
+
elapsed = end_time.to_i - start_time.to_i
|
28
|
+
|
29
|
+
announcement = "#{announced_deployer} successfully deployed #{announced_application_name} in #{elapsed} seconds."
|
30
|
+
|
31
|
+
post_skype_message(announcement)
|
32
|
+
else
|
33
|
+
print_error_message
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def ready_to_run
|
38
|
+
skype_app_id and skype_app_secret and skype_conversation_id
|
39
|
+
end
|
40
|
+
|
41
|
+
def print_error_message
|
42
|
+
print_local_status "Unable to create Skype Announcement, no Skype details provided."
|
43
|
+
end
|
44
|
+
|
45
|
+
def announced_stage
|
46
|
+
ENV['to'] || rails_env || 'production'
|
47
|
+
end
|
48
|
+
|
49
|
+
def announced_deployer
|
50
|
+
deployer
|
51
|
+
end
|
52
|
+
|
53
|
+
def short_revision
|
54
|
+
deployed_revision[0..7] if deployed_revision
|
55
|
+
end
|
56
|
+
|
57
|
+
def announced_application_name
|
58
|
+
"".tap do |output|
|
59
|
+
output << skype_application if skype_application
|
60
|
+
output << " #{branch}" if branch
|
61
|
+
output << " (#{short_revision})" if short_revision
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
def config_skype
|
66
|
+
SkypeBot::Config.app_id = skype_app_id
|
67
|
+
SkypeBot::Config.app_secret = skype_app_secret
|
68
|
+
|
69
|
+
@event = {'service_url' => 'https://smba.trafficmanager.net/apis',
|
70
|
+
'conversation_id' => skype_conversation_id}
|
71
|
+
@skype_is_configured = true
|
72
|
+
end
|
73
|
+
|
74
|
+
def post_skype_message(message)
|
75
|
+
config_skype unless @skype_is_configured
|
76
|
+
|
77
|
+
SkypeBot.message @event, message
|
78
|
+
end
|
79
|
+
end
|
data/lib/mina/skype.rb
ADDED
data/mina-skype.gemspec
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "mina/skype/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "mina-skype"
|
8
|
+
spec.version = Mina::Skype::VERSION
|
9
|
+
spec.authors = ["Star Chow"]
|
10
|
+
spec.email = ["puma.puma07@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{mina-skype is a small gem for sending mina deploy notifications to Skype.}
|
13
|
+
spec.description = %q{mina-skype is a small gem for sending mina deploy notifications to Skype.}
|
14
|
+
spec.homepage = "https://github.com/starchow/mina-skype"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
17
|
+
f.match(%r{^(test|spec|features)/})
|
18
|
+
end
|
19
|
+
spec.bindir = "exe"
|
20
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
21
|
+
spec.require_paths = ["lib"]
|
22
|
+
|
23
|
+
spec.add_development_dependency "bundler", "~> 1.16"
|
24
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
25
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
26
|
+
|
27
|
+
spec.add_dependency "mina"
|
28
|
+
spec.add_dependency "mina-hooks"
|
29
|
+
spec.add_dependency "skype_bot"
|
30
|
+
end
|
metadata
ADDED
@@ -0,0 +1,141 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: mina-skype
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Star Chow
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-06-29 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.16'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.16'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: mina
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: mina-hooks
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: skype_bot
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
description: mina-skype is a small gem for sending mina deploy notifications to Skype.
|
98
|
+
email:
|
99
|
+
- puma.puma07@gmail.com
|
100
|
+
executables: []
|
101
|
+
extensions: []
|
102
|
+
extra_rdoc_files: []
|
103
|
+
files:
|
104
|
+
- ".gitignore"
|
105
|
+
- ".rspec"
|
106
|
+
- ".travis.yml"
|
107
|
+
- Gemfile
|
108
|
+
- Gemfile.lock
|
109
|
+
- README.md
|
110
|
+
- Rakefile
|
111
|
+
- bin/console
|
112
|
+
- bin/setup
|
113
|
+
- lib/mina/skype.rb
|
114
|
+
- lib/mina/skype/defaults.rb
|
115
|
+
- lib/mina/skype/tasks.rb
|
116
|
+
- lib/mina/skype/version.rb
|
117
|
+
- mina-skype.gemspec
|
118
|
+
homepage: https://github.com/starchow/mina-skype
|
119
|
+
licenses: []
|
120
|
+
metadata: {}
|
121
|
+
post_install_message:
|
122
|
+
rdoc_options: []
|
123
|
+
require_paths:
|
124
|
+
- lib
|
125
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
126
|
+
requirements:
|
127
|
+
- - ">="
|
128
|
+
- !ruby/object:Gem::Version
|
129
|
+
version: '0'
|
130
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
131
|
+
requirements:
|
132
|
+
- - ">="
|
133
|
+
- !ruby/object:Gem::Version
|
134
|
+
version: '0'
|
135
|
+
requirements: []
|
136
|
+
rubyforge_project:
|
137
|
+
rubygems_version: 2.4.5.1
|
138
|
+
signing_key:
|
139
|
+
specification_version: 4
|
140
|
+
summary: mina-skype is a small gem for sending mina deploy notifications to Skype.
|
141
|
+
test_files: []
|