Class: DevFromCli

Inherits:
Object
  • Object
show all
Defined in:
lib/devfromcli.rb

Overview

This is the main class

Instance Method Summary collapse

Instance Method Details

#helpObject



51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/devfromcli.rb', line 51

def help
  puts ''
  puts "    devfromcli [version 0.1.0]\n    \n    Usage: devfromcli <command>\n    \n    Where <command> is either start or help\n    \n    devfromcli start    opens the interactive prompt\n    devfromcli help     displays this help\n\n    If you have any issue, discover a bug please open a ticket on github:\n    https://github.com/OPARA-PROSPER/DEV-from-CLI/issues/new\n  HELP_INFO\nend\n"

#introductionObject

This method outputs a welcome message and prompts for inputs depending on what they want to achieve for using the program

Returns:

  • oh_my_dev



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/devfromcli.rb', line 29

def introduction
  puts 'Welcome to DEV-from-CLI 🎉🎉'
  puts ''
  puts "    DEV-from-CLI is a command line tool that allows you interact with Dev.to platform\n  ABOUT_OH_MY_DEV\n\n  puts \"\\n[1] View the latest articles on DEV.to\\n[2] View articles using tags\\n[3] Create article draft\\n[4] Exist\"\n\n  print \"\\n> \"\n  user_initial_input = STDIN.gets.chomp\n  response_output if user_initial_input == '1'\n  create_post_draft if user_initial_input == '3'\n  puts \"\\nWow! did you make a mistake? Anyways, see you soon \u{1F62A}\" if user_initial_input == '4'\n\n  return unless user_initial_input == '2'\n\n  print \"\\nEnter special tag> \"\n  user_tag = STDIN.gets.chomp\n  response_output user_tag if user_tag\nend\n"