superbot-cloud 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -3
- data/lib/superbot/cloud/api.rb +1 -1
- data/lib/superbot/cloud/version.rb +1 -1
- data/lib/superbot/cloud/web_login.rb +3 -2
- data/lib/superbot/cloud.rb +2 -4
- data/superbot-cloud.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e4fd360d056c4207ce537a2d7d37d3e91c59f7464213ad6515900d5825b19ca7
|
4
|
+
data.tar.gz: ad63e9e5e4d215dcee6abdfe935136cfea4bd03916ac6e49e67da21e1ac8a829
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bda33a645834c145bcd38062139c8c195b5ff0e6a0fb6c3645ed7f8be7bb177f2aa38653b72c328136df31ad7f9da0bd060210dbf332457b9b9d743f3bcbfa11
|
7
|
+
data.tar.gz: ee1d8efa9d33c24e79b3641b98a89178cfbc1fe39923eb1b563b9a7ef42595e1e8d1f6e88c3a20862d1e524006aca6eb4f806cd84d1cd0e6e80defb3c449c7a1
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
superbot-cloud (0.1.
|
4
|
+
superbot-cloud (0.1.6)
|
5
5
|
marcel (= 0.3.3)
|
6
6
|
multipart-post (= 2.0.0)
|
7
7
|
|
@@ -60,7 +60,7 @@ GEM
|
|
60
60
|
rack-protection (= 2.0.3)
|
61
61
|
tilt (~> 2.0)
|
62
62
|
sinatra-silent (0.0.1)
|
63
|
-
superbot (0.1.
|
63
|
+
superbot (0.1.10)
|
64
64
|
clamp (= 1.2.1)
|
65
65
|
kommando (~> 0.1)
|
66
66
|
launchy (= 2.4.3)
|
@@ -80,7 +80,7 @@ DEPENDENCIES
|
|
80
80
|
rake (~> 10.0)
|
81
81
|
rspec (~> 3.0)
|
82
82
|
rubocop (~> 0.53)
|
83
|
-
superbot (~> 0.1.
|
83
|
+
superbot (~> 0.1.10)
|
84
84
|
superbot-cloud!
|
85
85
|
|
86
86
|
BUNDLED WITH
|
data/lib/superbot/cloud/api.rb
CHANGED
@@ -5,7 +5,7 @@ require 'net/http/post/multipart'
|
|
5
5
|
module Superbot
|
6
6
|
module Cloud
|
7
7
|
module Api
|
8
|
-
BASE_URI = "http
|
8
|
+
BASE_URI = "http://#{Superbot::DOMAIN}/api/v1"
|
9
9
|
ENDPOINT_MAP = {
|
10
10
|
login: { method: :post, endpoint: 'sessions' },
|
11
11
|
token: { method: :post, endpoint: 'token' },
|
@@ -15,8 +15,9 @@ module Superbot
|
|
15
15
|
set :silent_access_log, false
|
16
16
|
|
17
17
|
get "/login" do
|
18
|
-
credentials = request.params.slice('email', 'token')
|
19
|
-
|
18
|
+
credentials = request.params.slice('username', 'email', 'token')
|
19
|
+
Superbot::Cloud.save_credentials(credentials)
|
20
|
+
redirect "#{Superbot::Cloud::LOGIN_URI}/success?username=#{Superbot::Cloud.credentials[:username]}"
|
20
21
|
end
|
21
22
|
end
|
22
23
|
end
|
data/lib/superbot/cloud.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
module Superbot
|
4
4
|
module Cloud
|
5
|
-
LOGIN_URI =
|
5
|
+
LOGIN_URI = "http://#{Superbot::DOMAIN}/login/cloud"
|
6
6
|
CREDENTIALS_PATH = File.join(Dir.home, '.superbot')
|
7
7
|
private_constant :CREDENTIALS_PATH
|
8
8
|
CREDENTIALS_FILE_PATH = File.join(CREDENTIALS_PATH, 'cloud_token.json')
|
@@ -18,9 +18,7 @@ module Superbot
|
|
18
18
|
data.transform_keys!(&:to_sym)
|
19
19
|
FileUtils.mkdir_p CREDENTIALS_PATH
|
20
20
|
File.write CREDENTIALS_FILE_PATH, data.to_json
|
21
|
-
"Logged in as #{data[:email]}"
|
22
|
-
puts message
|
23
|
-
end
|
21
|
+
puts "Logged in as #{data[:username]} (#{data[:email]})"
|
24
22
|
end
|
25
23
|
end
|
26
24
|
end
|
data/superbot-cloud.gemspec
CHANGED
@@ -36,7 +36,7 @@ Gem::Specification.new do |spec|
|
|
36
36
|
spec.add_runtime_dependency "multipart-post", "2.0.0"
|
37
37
|
spec.add_runtime_dependency "marcel", "0.3.3"
|
38
38
|
|
39
|
-
spec.add_development_dependency "superbot", "~> 0.1.
|
39
|
+
spec.add_development_dependency "superbot", "~> 0.1.10"
|
40
40
|
spec.add_development_dependency "bundler", "~> 1.16"
|
41
41
|
spec.add_development_dependency "rake", "~> 10.0"
|
42
42
|
spec.add_development_dependency "rspec", "~> 3.0"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: superbot-cloud
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Superbots
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-11-
|
11
|
+
date: 2018-11-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multipart-post
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.1.
|
47
|
+
version: 0.1.10
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.1.
|
54
|
+
version: 0.1.10
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: bundler
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|