Class: Dude::Gitlab
Constant Summary
Constants included from Settings
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(options = {}) ⇒ Gitlab
constructor
A new instance of Gitlab.
- #my_issues ⇒ Object
Methods included from Settings
Constructor Details
#initialize(options = {}) ⇒ Gitlab
Returns a new instance of Gitlab.
9 10 11 12 13 14 15 |
# File 'lib/dude/gitlab.rb', line 9 def initialize( = {}) = ::Gitlab.configure do |config| config.endpoint = settings['GITLAB_ENDPOINT'] config.private_token = settings['GITLAB_TOKEN'] end end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
7 8 9 |
# File 'lib/dude/gitlab.rb', line 7 def end |
Instance Method Details
#call ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/dude/gitlab.rb', line 17 def call ::Gitlab.issue(project_id, [:issue_id]).title rescue StandardError puts "Issue ##{options[:issue_id]} not found " \ "in project #{options[:project_title]}\n" \ "Please, check the entered issue_id and project" end |
#my_issues ⇒ Object
25 26 27 |
# File 'lib/dude/gitlab.rb', line 25 def my_issues ::Gitlab.issues(project_id).select.map {|a| [a.iid, a.title, a.labels]} end |