renuo-cli 3.1.0 → 3.1.1

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: 708171502068c3d1748c92b702a7e0af0c550607bf2b950a8ef082b225996a2d
4
- data.tar.gz: 550e4ec36dbfa189ea34bcb2e2e7295ad701ad587b05142d3839484175853194
3
+ metadata.gz: c63f2b385a0924947d1b2a9379a836576b8d28c22a56aab71a8b8c5b7e912a59
4
+ data.tar.gz: 9f518b1bf101f4a65b93db3a595f5afbc2e1d94389a454511e5c6a4db1bc69d0
5
5
  SHA512:
6
- metadata.gz: a6a524f253a75c50eedea23a7ac02070897e0c4e5d80256536e390f8b6206dfe78b9400e5ec34f9514b1d62f94a8194b3521ca0f9c097ac64cf4f441bed3bbf9
7
- data.tar.gz: '0991a1fe20fae345363b140e671b0ece06a44e3dc4c4d20b788db531d64eb2c24ee924407bd2a405fa6654cc888ea07d4fcc25f02da6a0a73eb956fa9e93917c'
6
+ metadata.gz: 920b11fcc5d8135ac1e443916a7453f3317bf9b834438eb7d2c4c0031917250ad525b657cb6cb45b01ca92e4bb287186e34ad44fc7275d47947de590db2b3aeb
7
+ data.tar.gz: b555c4b20295c9094a43635868ff090f0ca63f50804985a0e2744892d0e51d7e9a2973e6a8e7a5ea735569c6b93f7585537c9c9bfda10d215a58d98a115ae3e0
@@ -0,0 +1,18 @@
1
+ module CommandHelper
2
+ def run_command(command)
3
+ say "\n#{command.yellow}"
4
+ system command
5
+ end
6
+
7
+ def open_path(path)
8
+ system_command = case RbConfig::CONFIG['host_os']
9
+ when /mswin|mingw|cygwin/
10
+ 'start'
11
+ when /darwin/
12
+ 'open'
13
+ when /linux|bsd/
14
+ 'xdg-open'
15
+ end
16
+ run_command "#{system_command} #{path}"
17
+ end
18
+ end
@@ -1,5 +1,5 @@
1
1
  class CreateNewLogins
2
- include RunCommand
2
+ include CommandHelper
3
3
 
4
4
  @logins = [{ name: 'Sentry', sign_up_url: 'https://sentry.io/organizations/renuo/members/new/',
5
5
  steps: ['Click on add new Member'] },
@@ -20,8 +20,7 @@ class CreateNewLogins
20
20
  private
21
21
 
22
22
  def open_site(website)
23
- say website.blue
24
- system "open '#{website}'"
23
+ open_path(website)
25
24
  wait_to_continue
26
25
  end
27
26
 
@@ -1,17 +1,33 @@
1
+ require_relative 'command_helper'
2
+
1
3
  class NameDisplay
4
+ include CommandHelper
5
+
2
6
  def run(args, options)
3
- return display_name('') if options.delete
7
+ return open_path(SLIDES) if options.monitor
8
+ return display_name(nil) if options.delete
9
+ return say('empty argument') if args.empty?
4
10
 
5
- return say('invalid customer name') if args.empty?
11
+ return run_heroku_command(args.join(' ')) if options.override
6
12
 
7
13
  display_name(args.join(' '))
8
14
  end
9
15
 
16
+ private
17
+
18
+ HEROKU_APP_NAME = '-a renuo-dashboard-master'.freeze
19
+ HEROKU_CLI = 'heroku run'.freeze
20
+ RENUO_CLI = 'rails renuo:welcome'.freeze
21
+ SLIDES = 'https://docs.google.com/presentation/d/1mPhQjArZnlUWUa2ik5R9IlGmdCKCwc2_H8Qq-AWgV-A/edit'.freeze
22
+ WELCOME_MESSAGE = 'Welcome to Renuo'.freeze
23
+
10
24
  def display_name(name)
11
- puts "TODO: display #{name}"
25
+ text_message = [WELCOME_MESSAGE, name, '🥳🔥'].compact.join(' ')
26
+ run_heroku_command(text_message)
12
27
  end
13
28
 
14
- def delete_current
15
- display_name('')
29
+ def run_heroku_command(text_message)
30
+ rails_command = "\"#{RENUO_CLI}['#{text_message}']\""
31
+ run_command([HEROKU_CLI, rails_command, HEROKU_APP_NAME].join(' '))
16
32
  end
17
33
  end
@@ -1,4 +1,8 @@
1
+ require_relative 'command_helper'
2
+
1
3
  class ReleaseProject
4
+ include CommandHelper
5
+
2
6
  UPDATE_TYPES = %w[major minor patch custom].freeze
3
7
  TMP_FOLDER_NAME = "_RENUO_RELEASE_TEMP_#{rand(100_000_000)}".freeze
4
8
  MOVE_TO_TMP_FOLDER = "mkdir -p #{TMP_FOLDER_NAME} && cd #{TMP_FOLDER_NAME}".freeze
@@ -60,15 +64,7 @@ class ReleaseProject
60
64
 
61
65
  def open_comparison_page
62
66
  puts 'Opening browser to double-check what is going to be deployed…'
63
- system_command = case RbConfig::CONFIG['host_os']
64
- when /mswin|mingw|cygwin/
65
- 'start'
66
- when /darwin/
67
- 'open'
68
- when /linux|bsd/
69
- 'xdg-open'
70
- end
71
- system "#{system_command} https://github.com/#{@project_name}/compare/#{main_branch}...develop"
67
+ open_path "https://github.com/#{@project_name}/compare/#{main_branch}...develop"
72
68
  end
73
69
 
74
70
  def checkout_project
@@ -1,5 +1,5 @@
1
1
  class UpgradeLaptopExecution
2
- include RunCommand
2
+ include CommandHelper
3
3
 
4
4
  def initialize(upgrade_mac_os)
5
5
  @upgrade_mac_os = upgrade_mac_os
@@ -1,5 +1,5 @@
1
1
  class UpgradeMacOS
2
- include RunCommand
2
+ include CommandHelper
3
3
 
4
4
  def run
5
5
  find_software_upgrades
@@ -1,4 +1,4 @@
1
- require_relative 'upgrade_laptop/run_command'
1
+ require_relative 'command_helper'
2
2
  require_relative 'upgrade_laptop/upgrade_laptop_execution'
3
3
  require_relative 'upgrade_laptop/upgrade_mac_os'
4
4
 
@@ -1,6 +1,6 @@
1
1
  module Renuo
2
2
  module Cli
3
- VERSION = '3.1.0'.freeze
3
+ VERSION = '3.1.1'.freeze
4
4
  NAME = 'renuo-cli'.freeze
5
5
  end
6
6
  end
data/lib/renuo/cli.rb CHANGED
@@ -46,7 +46,10 @@ module Renuo
46
46
  c.description = 'Sets the name of a customer on the Renuo dashboard'
47
47
  c.example 'Display "Peter Muster" on the dashboard', 'renuo display-name "Peter Muster"'
48
48
  c.example 'Remove the current name from the dashboard', 'renuo display-name --delete'
49
+ c.example 'Override the current message on the dashboard', 'renuo display-name Happy friday 🍻 --override'
49
50
  c.option '--delete', 'Deletes the current name'
51
+ c.option '--override', 'Overrides the entire message'
52
+ c.option '--monitor', 'Open the Google slides'
50
53
  c.action do |args, options|
51
54
  NameDisplay.new.run(args, options)
52
55
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: renuo-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
4
+ version: 3.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Renuo AG
@@ -319,6 +319,7 @@ files:
319
319
  - bin/run
320
320
  - bin/setup
321
321
  - lib/renuo/cli.rb
322
+ - lib/renuo/cli/app/command_helper.rb
322
323
  - lib/renuo/cli/app/configure_semaphore.rb
323
324
  - lib/renuo/cli/app/configure_sentry.rb
324
325
  - lib/renuo/cli/app/create_aws_project.rb
@@ -351,7 +352,6 @@ files:
351
352
  - lib/renuo/cli/app/toggl/workspace.rb
352
353
  - lib/renuo/cli/app/toggl_redmine_comparator.rb
353
354
  - lib/renuo/cli/app/upgrade_laptop.rb
354
- - lib/renuo/cli/app/upgrade_laptop/run_command.rb
355
355
  - lib/renuo/cli/app/upgrade_laptop/upgrade_laptop_execution.rb
356
356
  - lib/renuo/cli/app/upgrade_laptop/upgrade_mac_os.rb
357
357
  - lib/renuo/cli/app/work.rb
@@ -1,6 +0,0 @@
1
- module RunCommand
2
- def run_command(command)
3
- say "\n#{command.yellow}"
4
- system command
5
- end
6
- end