superbot-cloud 0.1.11 → 0.1.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/Gemfile.lock +4 -4
- data/lib/superbot/cloud/version.rb +1 -1
- data/lib/superbot/cloud.rb +13 -7
- 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: c10739967cbc668d1244c50b38d0b8cc3dba4f8c6fdd22a8fdce31fdef52c453
|
4
|
+
data.tar.gz: b1f1d0af3db49ff0b73d8dbb8e2f3110b02d29942b87551c1b8354ac3c348ef0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd23e009917aec06984513d315510a0ec6459b1fa9153afa4c0def55c6b5b686a61fb1676ab25eb2ae01b2dc8d0dae7fcd0fe033f123a4b93b755157a547e501
|
7
|
+
data.tar.gz: 78347ed794edcf7321033dc1a6e125f1a89cd29d4083b1096df2e2133b6af7bb8a696468ffd7e5bfbb5eca711785218dcd912263dc589c9f688ccffee0fb5fc8
|
data/.gitignore
CHANGED
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.13)
|
5
5
|
marcel (= 0.3.3)
|
6
6
|
multipart-post (= 2.0.0)
|
7
7
|
|
@@ -60,13 +60,13 @@ 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.16)
|
64
64
|
clamp (= 1.2.1)
|
65
65
|
kommando (~> 0.1)
|
66
66
|
launchy (= 2.4.3)
|
67
67
|
sinatra (= 2.0.3)
|
68
68
|
sinatra-silent (= 0.0.1)
|
69
|
-
superbot-cloud (~> 0.1.
|
69
|
+
superbot-cloud (~> 0.1.11)
|
70
70
|
zaru (= 0.2.0)
|
71
71
|
tilt (2.0.8)
|
72
72
|
unicode-display_width (1.4.0)
|
@@ -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.16)
|
84
84
|
superbot-cloud!
|
85
85
|
|
86
86
|
BUNDLED WITH
|
data/lib/superbot/cloud.rb
CHANGED
@@ -5,21 +5,27 @@ module Superbot
|
|
5
5
|
LOGIN_URI = "http://#{Superbot::DOMAIN}/login/cloud"
|
6
6
|
CREDENTIALS_PATH = File.join(Dir.home, '.superbot')
|
7
7
|
private_constant :CREDENTIALS_PATH
|
8
|
-
CREDENTIALS_FILE_PATH = File.join(CREDENTIALS_PATH, '
|
8
|
+
CREDENTIALS_FILE_PATH = File.join(CREDENTIALS_PATH, 'cloud_credentials.json')
|
9
9
|
private_constant :CREDENTIALS_FILE_PATH
|
10
10
|
|
11
11
|
def self.credentials
|
12
|
-
|
12
|
+
all_credentials[Superbot::DOMAIN.to_sym]
|
13
|
+
end
|
13
14
|
|
14
|
-
|
15
|
+
def self.all_credentials
|
16
|
+
@all_credentials ||=
|
17
|
+
if File.exist?(CREDENTIALS_FILE_PATH)
|
18
|
+
JSON.parse(File.read(CREDENTIALS_FILE_PATH), symbolize_names: true)
|
19
|
+
else
|
20
|
+
{}
|
21
|
+
end
|
15
22
|
end
|
16
23
|
|
17
24
|
def self.save_credentials(data)
|
18
|
-
data.transform_keys!(&:to_sym)
|
19
|
-
@credentials = data
|
25
|
+
all_credentials[Superbot::DOMAIN.to_sym] = data.transform_keys!(&:to_sym)
|
20
26
|
FileUtils.mkdir_p CREDENTIALS_PATH
|
21
|
-
File.write CREDENTIALS_FILE_PATH,
|
22
|
-
puts "Logged in as
|
27
|
+
File.write CREDENTIALS_FILE_PATH, all_credentials.to_json
|
28
|
+
puts "Logged in as %<username>s (%<email>s)" % credentials.slice(:username, :email)
|
23
29
|
end
|
24
30
|
end
|
25
31
|
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.16"
|
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.13
|
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-19 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.16
|
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.16
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: bundler
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|