Class: LgPodPlugin::Command::Init
- Inherits:
-
LgPodPlugin::Command
- Object
- CLAide::Command
- LgPodPlugin::Command
- LgPodPlugin::Command::Init
- Defined in:
- lib/command/init.rb
Instance Attribute Summary collapse
-
#host ⇒ Object
Returns the value of attribute host.
-
#password ⇒ Object
Returns the value of attribute password.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
-
#initialize(argv) ⇒ Init
constructor
A new instance of Init.
- #run ⇒ Object
Methods inherited from LgPodPlugin::Command
Constructor Details
#initialize(argv) ⇒ Init
Returns a new instance of Init.
18 19 20 21 22 23 |
# File 'lib/command/init.rb', line 18 def initialize(argv) self.host = argv.option('host') self.username = argv.option('username') self.password = argv.option('password') super end |
Instance Attribute Details
#host ⇒ Object
Returns the value of attribute host.
12 13 14 |
# File 'lib/command/init.rb', line 12 def host @host end |
#password ⇒ Object
Returns the value of attribute password.
11 12 13 |
# File 'lib/command/init.rb', line 11 def password @password end |
#username ⇒ Object
Returns the value of attribute username.
10 11 12 |
# File 'lib/command/init.rb', line 10 def username @username end |
Instance Method Details
#run ⇒ Object
25 26 27 28 29 30 |
# File 'lib/command/init.rb', line 25 def run raise unless self.host raise unless self.username raise unless self.password GitLabAPI.request_gitlab_access_token(self.host, self.username, self.password) end |