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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ad8d57f93658bd49900d502cbd355763cce9837908caaad4ff30a652a472a57b
4
- data.tar.gz: 191a490401c08be59898d5a5a6ca2ad489bd934c6084fd62954db3e4bb6d5714
3
+ metadata.gz: e4fd360d056c4207ce537a2d7d37d3e91c59f7464213ad6515900d5825b19ca7
4
+ data.tar.gz: ad63e9e5e4d215dcee6abdfe935136cfea4bd03916ac6e49e67da21e1ac8a829
5
5
  SHA512:
6
- metadata.gz: 7e8428292eb1719005dc3074fa98c5f53eb0b6a3ce7d6364b2baa16f583fd56bf5566e317d67583a42c8f0fb757162c70c4be0a9db6c1df747140e4e595b3da3
7
- data.tar.gz: 01e65c840d5fd722b6579316c3330ddb2b8bb9408e4204bd919cdc29469db2dbd2fe444fbfc6d0dbc61cf3cbecc2f054dc9f3901f8fe50d3ed74c48fb4f326cf
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.5)
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.8)
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.8)
83
+ superbot (~> 0.1.10)
84
84
  superbot-cloud!
85
85
 
86
86
  BUNDLED WITH
@@ -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://www.superbot.cloud/api/v1"
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' },
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Superbot
4
4
  module Cloud
5
- VERSION = "0.1.5"
5
+ VERSION = "0.1.6"
6
6
  end
7
7
  end
@@ -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
- request.params['error'] || Superbot::Cloud.save_credentials(credentials)
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
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Superbot
4
4
  module Cloud
5
- LOGIN_URI = 'http://www.superbot.cloud/login/cloud'
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]}".tap do |message|
22
- puts message
23
- end
21
+ puts "Logged in as #{data[:username]} (#{data[:email]})"
24
22
  end
25
23
  end
26
24
  end
@@ -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.8"
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.5
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-07 00:00:00.000000000 Z
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.8
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.8
54
+ version: 0.1.10
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: bundler
57
57
  requirement: !ruby/object:Gem::Requirement