{: rooto:"YARD::CodeObjects::RootObject:@childrenIC:&YARD::CodeObjects::CodeObjectList[o:$YARD::CodeObjects::ModuleObject;IC;[o:&YARD::CodeObjects::ConstantObject: @files[[I"K/Users/thiagofelix/workspace/danger-jenkins/lib/jenkins/gem_version.rb:ETi:@current_file_has_commentsF: @name: VERSION:@source_type: ruby:@visibility: public: @tags[:@docstrings{:@docstringIC:YARD::Docstring" ; T:@ref_tags[;[: @allI"; T:@unresolved_reference0: @object@ :@namespace@: @pathI"Jenkins::VERSION; F:@signatureI"VERSION = '0.0.1'.freeze; T: @sourceI"VERSION = '0.0.1'.freeze; T: @valueI"'0.0.1'.freeze; T: @dynamicT: @owner@:@class_mixinsIC;[;"@:@instance_mixinsIC;[;"@:@attributesIC:SymbolHash{: classIC;&{:@symbolize_valueT: instanceIC;&{;(T;(T: @aliases{: @groups[; [[@ i; F;: Jenkins;;;;;[;{;IC;" ; T;[;[;I"; T;0;@;@;I" Jenkins; Fo; ;IC;[o:#YARD::CodeObjects::ClassObject;IC;[o; ; [[I"F/Users/thiagofelix/workspace/danger-jenkins/lib/jenkins/plugin.rb; Ti ; F;:JENKINS_ICON;;;;;[;{;IC;" ; T;[;[;I"; T;0;@,;@*;I"(Danger::DangerJenkins::JENKINS_ICON; F;I"bJENKINS_ICON = 'https://wiki.jenkins-ci.org/download/attachments/2916393/headshot.png'.freeze; T;I"bJENKINS_ICON = 'https://wiki.jenkins-ci.org/download/attachments/2916393/headshot.png'.freeze; T; I"S'https://wiki.jenkins-ci.org/download/attachments/2916393/headshot.png'.freeze; T;!To:$YARD::CodeObjects::MethodObject:@module_functionF: @scope;);;;I""Danger::DangerJenkins#user_id; F:@parameters[; [[@/i%; T;: user_id;;;[;{;IC;"/User to authenticate with Jenkins REST API ; T;[;[o:YARD::Tags::Tag :@tag_nameI" return; F: @textI" String; T;0: @types0;@:;I"AUser to authenticate with Jenkins REST API @return String; T;0;@::@hash_flagF:@line_rangeo: Range: exclF: begini":endi$;@*;I"def user_id @user_id end; T;I"def user_id; T;!To;/;0F;1;);;;I"#Danger::DangerJenkins#user_id=; F;2[[I" value; T0; [[@/i%; T;: user_id=;;;[;{;IC;"/User to authenticate with Jenkins REST API ; T;[;[o;4 ;5I" return; F;6I" String; T;0;70;@K;@G;0;@K;8F;9@H;@*;I"/def user_id=(value) @user_id = value end; T;I"def user_id=(value); T;!To;/;0F;1;);;;I"$Danger::DangerJenkins#api_token; F;2[; [[@/i*; T;:api_token;;;[;{;IC;"4API token to authenticate with Jenkins REST API ; T;[;[o;4 ;5I" return; F;6I" String; T;0;70;@\;I"FAPI token to authenticate with Jenkins REST API @return String; T;0;@\;8F;9o;:;;F;\n" artifacts.each do |artifact| content << "* #{artifact_link(artifact)}\n" end markdown content end; T;I"def print_artifacts; T;!T;BTo;/;0F;1;);;;I"/Danger::DangerJenkins#print_console_output; F;2[; [[@/id; T;:print_console_output;;;[;{;IC;"8Adds a collapsable console output to danger comment ; T;[;[o;4 ;5I" return; F;6I"; T;0;7[I" void; T;@;I"IAdds a collapsable console output to danger comment @return [void] ; T;0;@;8F;9o;:;;F;' content << 'Details' content << "
#{console_html}
" content << '' markdown content end; T;I"def print_console_output; T;!T;BTo;/;0F;1;);: private;I"#Danger::DangerJenkins#jenkins?; F;2[; [[@/io; F;: jenkins?;;;[;{;IC;" ; T;[;[o;4 ;5I" return; F;6I"; T;0;7[I" Boolean; T;@;I"; T;0;@;@*;I"Udef jenkins? !@env.ci_source.nil? && @env.ci_source.is_a?(Danger::Jenkins) end; T;I"def jenkins?; T;!T;BTo;/;0F;1;);;H;I"(Danger::DangerJenkins#artifact_link; F;2[[I" artifact; T0; [[@/is; F;:artifact_link;;;[;{;IC;" ; T;[;[;I"; T;0;@;@*;I"def artifact_link(artifact) href = "#{@build_url}/artifact/#{artifact.relativePath}" "#{artifact.relativePath}" end; T;I" def artifact_link(artifact); T;!T;BTo;/;0F;1;);;H;I"(Danger::DangerJenkins#fetch_console; F;2[[I" type; TI" :text; T; [[@/ix; F;:fetch_console;;;[;{;IC;" ; T;[;[;I"; T;0;@;@*;I"def fetch_console(type = :text) case type when :text then fetch("#{@build_url}/logText/progressiveText") when :html then fetch("#{@build_url}/logText/progressiveHtml") end end; T;I"$def fetch_console(type = :text); T;!T;BTo;/;0F;1;);;H;I".Danger::DangerJenkins#fetch_current_build; F;2[; [[@/i|; F;:fetch_current_build;;;[;{;IC;" ; T;[;[;I"; T;0;@;@*;I"}def fetch_current_build url = "#{@build_url}/api/json" body = fetch(url) JSON.parse(body, object_class: OpenStruct) end; T;I"def fetch_current_build; T;!T;BTo;/;0F;1;);;H;I" Danger::DangerJenkins#fetch; F;2[[I"url; T0[I" limit; TI"10; T; [[@/i; F;: fetch;;;[;{;IC;" ; T;[;[;I"; T;0;@$;@*;I"def fetch(url, limit = 10) res = request(url) case res when Net::HTTPSuccess then res.body when Net::HTTPRedirection then fetch(res['location'], limit - 1) else res.value end end; T;I"def fetch(url, limit = 10); T;!T;BTo;/;0F;1;);;H;I""Danger::DangerJenkins#request; F;2[[I"url; T0; [[@/i; F;: request;;;[;{;IC;" ; T;[;[;I"; T;0;@6;@*;I"def request(url) uri = URI.parse(url) http = Net::HTTP.new(uri.host, uri.port) req = Net::HTTP::Get.new(uri.request_uri) req.basic_auth(@user_id, @api_token) http.request(req) end; T;I"def request(url); T;!T;BT;"@*;#IC;[;"@*;$IC;[;"@*;%IC;&{;'IC;&{;(T;)IC;&{;3IC;&{: read@:: write@K;(T;?IC;&{;O@\;P@m;(T;(T;(T;*{;+[; [[@/i; T;:DangerJenkins;;;;;[;{;IC;"AGet access to Jenkins information right into your Dangerfile ; T;[;[ o;4 ;5I" example; F;6I"Fjenkins.user_id = YOUR_USER_ID jenkins.api_token = YOUR_API_TOKEN; T;I"4Configure credentials to access the Jenkins API; T;70;@*o;4 ;5I" example; F;6I"jenkins.print_artifacts; T;I"+Print list of artifacts in the PR page; T;70;@*o;4 ;5I" example; F;6I"!jenkins.print_console_output; T;I"(Print console output in the PR page; T;70;@*o;4 ;5I" example; F;6I"7message "The spent #{jenkins.build.duration} time"; T;I"'Get access to the build properties; T;70;@*o;4 ;5I" example; F;6I"@markdown "### Console output: \n\n #{jenkins.console_text}"; T;I"9Customize how you want to present the console output; T;70;@*o;4 ;5I"see; F;60;I"thiagofelix/danger-jenkins; T;70;@*o;4 ;5I" tags; F;6I" jenkins; T;0;70;@*;I"Get access to Jenkins information right into your Dangerfile @example Configure credentials to access the Jenkins API jenkins.user_id = YOUR_USER_ID jenkins.api_token = YOUR_API_TOKEN @example Print list of artifacts in the PR page jenkins.print_artifacts @example Print console output in the PR page jenkins.print_console_output @example Get access to the build properties message "The spent #{jenkins.build.duration} time" @example Customize how you want to present the console output markdown "### Console output: \n\n #{jenkins.console_text}" @see thiagofelix/danger-jenkins @tags jenkins ; T;0;@*;8F;9o;:;;F;