Class: Gleis::Management
- Inherits:
-
Object
- Object
- Gleis::Management
- Defined in:
- lib/gleis/management.rb
Overview
The class implements management and administrative methods around the Gleis platform
Class Method Summary collapse
Class Method Details
.apps ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/gleis/management.rb', line 4 def self.apps token = Token.check body = API.request('get', 'mgmt/apps', token) apps = body ['data'] if apps.any? puts "Apps list for your organisation:\n\n" printf("\t%-39s %-25s %s\n", 'APP NAME', 'CREATED ON', 'PLAN') printf("\t%-39s %-25s %s\n\n", '--------', '----------', '----') apps.each do |app| printf("\t%-39s %-25s %s\n", app['name'], Time.parse(app['created_at']).localtime.strftime('%c'), app['plan_name'].capitalize) end else puts 'No apps found.' end end |
.license ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/gleis/management.rb', line 21 def self.license puts " Gleis Command Line Interface for the Gleis Platform as a Service\n Copyright (C) 2018-\#{Time.new.year} towards GmbH\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program. If not, see <https://www.gnu.org/licenses/>.\n\n" end |