Class: CiHelper::RedmineProcedure
- Inherits:
-
Object
- Object
- CiHelper::RedmineProcedure
- Includes:
- Redmine
- Defined in:
- lib/ci_helper/redmine_procedure.rb
Overview
This class responsible for traversing the page in the redmine and find the issue form, re-get the page
Instance Attribute Summary collapse
-
#account ⇒ Object
readonly
Returns the value of attribute account.
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#issue_no ⇒ Object
Returns the value of attribute issue_no.
-
#issue_page ⇒ Object
readonly
Returns the value of attribute issue_page.
-
#password ⇒ Object
readonly
Returns the value of attribute password.
Instance Method Summary collapse
- #form ⇒ Object
- #get_issue_page ⇒ Object
-
#initialize(account, password) ⇒ RedmineProcedure
constructor
A new instance of RedmineProcedure.
- #login ⇒ Object
- #refresh_issue_page ⇒ Object
- #set_issue_form ⇒ Object
Methods included from Redmine
#issue, #issue_form=, #issue_setting, #submit
Constructor Details
#initialize(account, password) ⇒ RedmineProcedure
Returns a new instance of RedmineProcedure.
11 12 13 14 15 |
# File 'lib/ci_helper/redmine_procedure.rb', line 11 def initialize(account, password) @account = account @password = password @client = Mechanize.new end |
Instance Attribute Details
#account ⇒ Object (readonly)
Returns the value of attribute account.
8 9 10 |
# File 'lib/ci_helper/redmine_procedure.rb', line 8 def account @account end |
#client ⇒ Object (readonly)
Returns the value of attribute client.
8 9 10 |
# File 'lib/ci_helper/redmine_procedure.rb', line 8 def client @client end |
#issue_no ⇒ Object
Returns the value of attribute issue_no.
8 9 10 |
# File 'lib/ci_helper/redmine_procedure.rb', line 8 def issue_no @issue_no end |
#issue_page ⇒ Object (readonly)
Returns the value of attribute issue_page.
8 9 10 |
# File 'lib/ci_helper/redmine_procedure.rb', line 8 def issue_page @issue_page end |
#password ⇒ Object (readonly)
Returns the value of attribute password.
8 9 10 |
# File 'lib/ci_helper/redmine_procedure.rb', line 8 def password @password end |
Instance Method Details
#form ⇒ Object
33 34 35 |
# File 'lib/ci_helper/redmine_procedure.rb', line 33 def form issue_page.form_with(action: "/issues/#{issue_no}") end |
#get_issue_page ⇒ Object
50 51 52 |
# File 'lib/ci_helper/redmine_procedure.rb', line 50 def get_issue_page client.get("#{CiHelper::REDMINE_DOMAIN}#{issue_no}") end |
#login ⇒ Object
37 38 39 40 41 42 43 44 |
# File 'lib/ci_helper/redmine_procedure.rb', line 37 def login login_page = get_issue_page @issue_page = login_page.form_with(action: '/login') do |f| f.field_with(name: 'username').value = account f.field_with(name: 'password').value = password end. end |
#refresh_issue_page ⇒ Object
46 47 48 |
# File 'lib/ci_helper/redmine_procedure.rb', line 46 def refresh_issue_page @issue_page = get_issue_page end |
#set_issue_form ⇒ Object
29 30 31 |
# File 'lib/ci_helper/redmine_procedure.rb', line 29 def set_issue_form self.issue_form = form end |