gleis 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0d639f2b898275a629dcdebc16826219f423331985bb855e9dc9e891c03a9f8d
4
- data.tar.gz: 5d4c259f9f59e28d4e6095ab633e3226f61f2a79f6b437de90f72e1e585d1e52
3
+ metadata.gz: 36d72081ace4b3db129e059c2b84038eb15311ad69435baf4c7282347fc65fa3
4
+ data.tar.gz: 10b3055f4c9b8cf02702a54bb0f05b8ef995bc677aba9797ca82bffa24274792
5
5
  SHA512:
6
- metadata.gz: 33a7cd87d4f8827afb6654a3f334d4c343323dfcd55399f94cb3da9e62dfb5e96370c98e3c64b3973e7d60342489941194db4e4aa828c33ac1b7c4541ebc3a1d
7
- data.tar.gz: c35735c1175884712c086774421648a6aae5af3818b18d4e6c65892c37e703f5c3b2d6ef06a65a542c69613b3533fb5d1d90cb8f6f29e650ddbdc322577797cc
6
+ metadata.gz: 6c908bfca9308da3d7666434f6d2451d404adf5636fae5dcf2ad8bc1e5c0a4a5c494517821fc7db095f83fd37d63e6532a83451e74c8e468b6b055825b72aa87
7
+ data.tar.gz: e3604132f93cd919f242913e21c56d439793cc902b4708b5281ac622edf36c8c57ca680bfac1208828dc597aa0046459c6f390382939b29651bead35135998a0
data/CHANGELOG.md ADDED
@@ -0,0 +1,30 @@
1
+ # Changelog
2
+
3
+ All notable changes to the Gleis CLI will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## 0.2.0 - 2018-12-02
9
+
10
+ ### Added
11
+
12
+ - Exit nicely upon SIGINT trap
13
+ - New command to register for a free account
14
+
15
+ ## 0.1.1 - 2018-11-26
16
+
17
+ ### Added
18
+
19
+ - Add change log
20
+
21
+ ### Changed
22
+
23
+ - Re-structure gemspec
24
+ - Use more generic method names for app exec params
25
+
26
+ ## 0.1.0 - 2018-11-24
27
+
28
+ ### Added
29
+
30
+ - Initial release
data/exe/gleis CHANGED
@@ -4,4 +4,9 @@ require 'gleis/main'
4
4
 
5
5
  puts "\n### Gleis CLI Copyright (c) 2018 towards GmbH - v#{Gleis::VERSION} - https://gleis.cloud ###\n\n"
6
6
 
7
+ trap 'SIGINT' do
8
+ puts "\n\nExiting..."
9
+ exit 130
10
+ end
11
+
7
12
  Gleis::Main.start
@@ -17,6 +17,35 @@ module Gleis
17
17
  upload_ssh_public_key(ssh_key_filename, token) if SSH.generate_key(ssh_key_filename, username)
18
18
  end
19
19
 
20
+ def self.register(email)
21
+ abort('Invalid e-mail address.') unless email.match(URI::MailTo::EMAIL_REGEXP)
22
+ puts "In order to register for a free Gleis account please enter your details below.\n\n"
23
+ print "Email: #{email}\n"
24
+ print 'First name: '
25
+ firstname = $stdin.gets.chomp
26
+ print 'Last name: '
27
+ lastname = $stdin.gets.chomp
28
+ print 'Organisation or company name (optional): '
29
+ organisation = $stdin.gets.chomp
30
+ puts "\n"
31
+ abort('Please provide your firstname and lastname.') if firstname.empty? || lastname.empty?
32
+ return unless Utils.prompt_yes_no('Are your details above correct?')
33
+
34
+ req_body = { 'email': email,
35
+ 'firstname': firstname,
36
+ 'lastname': lastname,
37
+ 'organisation': organisation }
38
+ body = API.request('post', 'register', nil, req_body)
39
+ if body['success'] == 1
40
+ puts 'Successfully sent registration. We will manually review your request and send you a confirmation ' \
41
+ "e-mail within the next 24 hours.\n"
42
+ puts 'In the meantime please save and keep secure your Gleis password shown below in your password manager:'
43
+ puts "\n\n\t\t#{body['data']}\n\n"
44
+ else
45
+ puts "Failed to register: #{body['message']}"
46
+ end
47
+ end
48
+
20
49
  def self.whoami
21
50
  token = Token.check
22
51
  body = API.request('get', 'whoami', token)
@@ -12,6 +12,11 @@ module Gleis
12
12
  Authentication.logout
13
13
  end
14
14
 
15
+ desc 'register EMAIL', 'Register for a free Gleis account'
16
+ def register(email)
17
+ Authentication.register(email)
18
+ end
19
+
15
20
  desc 'whoami', 'Info on current login'
16
21
  def whoami
17
22
  Authentication.whoami
data/lib/gleis/main.rb CHANGED
@@ -9,6 +9,11 @@ module Gleis
9
9
  Authentication.login(username)
10
10
  end
11
11
 
12
+ desc 'register EMAIL', 'Register for a free Gleis account'
13
+ def register(email)
14
+ Authentication.register(email)
15
+ end
16
+
12
17
  desc 'addon COMMAND', 'Manage add-ons: add, list, remove'
13
18
  subcommand 'addon', CLI::Addon
14
19
 
data/lib/gleis/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Gleis
2
- VERSION = '0.1.1'
2
+ VERSION = '0.2.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gleis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marc Bigler
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-11-26 00:00:00.000000000 Z
11
+ date: 2018-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -131,6 +131,7 @@ executables:
131
131
  extensions: []
132
132
  extra_rdoc_files: []
133
133
  files:
134
+ - CHANGELOG.md
134
135
  - LICENSE
135
136
  - bin/console
136
137
  - bin/setup