Module: IcentrisJira
- Defined in:
- lib/IcentrisJira.rb,
lib/IcentrisJira/version.rb
Constant Summary collapse
- VERSION =
"0.0.9"
Class Method Summary collapse
Class Method Details
.examples ⇒ Object
38 39 40 |
# File 'lib/IcentrisJira.rb', line 38 def self.examples puts "There is only 1 method in this gem.\n\n. Methodname: getJSON\nUsage: \n\tIcentrisJira::getJSON jira_rest_api_url, username, password\n\n jira_rest_api_url will be different for different purposes.\n\n For example - To Authenticate - url = 'https://jira2.icentris.com/jira/rest/api/2/user?username=' + username \n\n So the call will look like - \njira_response = IcentrisJira::getJSON('https://jira2.icentris.com/jira/rest/api/2/user?username=' + username, username, password)" end |
.getJSON(url, username, password) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/IcentrisJira.rb', line 26 def self.getJSON(url, username, password) uri = URI.parse(url) http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Get.new(uri.request_uri) request.basic_auth username, password request["Content-Type"] = "application/json" jira_response = http.request(request) return jira_response.body end |
.ScreenScrape(url) ⇒ Object
42 43 44 45 46 47 48 49 |
# File 'lib/IcentrisJira.rb', line 42 def self.ScreenScrape(url) uri = URI.parse(url) http = Net::HTTP.new(uri.host, uri.port) request = Net::HTTP::Get.new(uri.request_uri) request["Content-Type"] = "application/json" response = http.request(request) return response.body end |