slackvite 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/slackvite.rb +4 -0
- data/lib/slackvite/invite.rb +29 -0
- data/lib/slackvite/version.rb +3 -0
- metadata +102 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: d8bb637eae8b2b606d51d8cc0324a34e7779dc73
|
4
|
+
data.tar.gz: e4cbae9001ace1f0d60f55ffd4b20f977055628d
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 2546b2a60c3934fac34796861320075f9cc3252ea37f54ff8f74b68e7b6d95989b15cf0fbef83a05435ac9ebe0222ff022b0041fa8619ff00217725235d48189
|
7
|
+
data.tar.gz: 1e1acbf5bc7b5b3ce016f413a097d6a735d55d870045c8c23eed50ee960e5b856f747a33c2cdaa8b18d577a9196f8b39f40eab51a1cb30e2307cf17253a9f2cc
|
data/lib/slackvite.rb
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
require "http"
|
2
|
+
|
3
|
+
module Slackvite
|
4
|
+
class Invite
|
5
|
+
|
6
|
+
attr_accessor :token
|
7
|
+
attr_accessor :subdomain
|
8
|
+
attr_accessor :email
|
9
|
+
|
10
|
+
def initialize(token, subdomain)
|
11
|
+
@token = token
|
12
|
+
@subdomain = subdomain
|
13
|
+
end
|
14
|
+
|
15
|
+
def sendTo(email)
|
16
|
+
@email = email
|
17
|
+
puts "Sending invite to #{email}."
|
18
|
+
url = "https://#{@subdomain}.slack.com/api/users.admin.invite"
|
19
|
+
options = { :form => { email: @email, token: @token, set_active: true } }
|
20
|
+
response = HTTP.auth("Bearer #{@token}").post(url, options)
|
21
|
+
if response.code == 200
|
22
|
+
puts "Success!"
|
23
|
+
else
|
24
|
+
puts "Something went wrong."
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
end
|
metadata
ADDED
@@ -0,0 +1,102 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: slackvite
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Matthew Rosendin
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-06-17 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.3'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.3'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 11.1.2
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 11.1.2
|
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.2'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.2'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: http
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '2.0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '2.0'
|
69
|
+
description:
|
70
|
+
email: matt@roseware.io
|
71
|
+
executables: []
|
72
|
+
extensions: []
|
73
|
+
extra_rdoc_files: []
|
74
|
+
files:
|
75
|
+
- lib/slackvite.rb
|
76
|
+
- lib/slackvite/invite.rb
|
77
|
+
- lib/slackvite/version.rb
|
78
|
+
homepage: http://github.com/rosendin/slackvite
|
79
|
+
licenses:
|
80
|
+
- MIT
|
81
|
+
metadata: {}
|
82
|
+
post_install_message:
|
83
|
+
rdoc_options: []
|
84
|
+
require_paths:
|
85
|
+
- lib
|
86
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - ">="
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: '0'
|
91
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - ">="
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '0'
|
96
|
+
requirements: []
|
97
|
+
rubyforge_project:
|
98
|
+
rubygems_version: 2.5.1
|
99
|
+
signing_key:
|
100
|
+
specification_version: 4
|
101
|
+
summary: Make it easy to invite users to your Slack community team
|
102
|
+
test_files: []
|