Class: Serverspec::Type::JenkinsPlugin
- Inherits:
-
JenkinsBase
- Object
- Base
- ApiBase
- JenkinsBase
- Serverspec::Type::JenkinsPlugin
- Defined in:
- lib/serverspec_extra_types/types/jenkins_plugin.rb
Instance Method Summary collapse
- #exist? ⇒ Boolean
- #has_version?(version) ⇒ Boolean
-
#initialize(name = nil, options = {}) ⇒ JenkinsPlugin
constructor
A new instance of JenkinsPlugin.
- #inspection ⇒ Object
- #installed? ⇒ Boolean
- #length ⇒ Object
- #url ⇒ Object
Methods inherited from ApiBase
Constructor Details
#initialize(name = nil, options = {}) ⇒ JenkinsPlugin
Returns a new instance of JenkinsPlugin.
11 12 13 |
# File 'lib/serverspec_extra_types/types/jenkins_plugin.rb', line 11 def initialize(name = nil, = {}) super(name, ) end |
Instance Method Details
#exist? ⇒ Boolean
23 24 25 |
# File 'lib/serverspec_extra_types/types/jenkins_plugin.rb', line 23 def exist? inspection != nil end |
#has_version?(version) ⇒ Boolean
31 32 33 |
# File 'lib/serverspec_extra_types/types/jenkins_plugin.rb', line 31 def has_version?(version) inspection['version'].to_s == version.to_s end |
#inspection ⇒ Object
15 16 17 |
# File 'lib/serverspec_extra_types/types/jenkins_plugin.rb', line 15 def inspection @inspection ||= ::MultiJson.load(get_inspection.stdout)['plugins'].find { |plugin| plugin['shortName'] == @name } end |
#installed? ⇒ Boolean
19 20 21 |
# File 'lib/serverspec_extra_types/types/jenkins_plugin.rb', line 19 def installed? inspection != nil end |
#length ⇒ Object
35 36 37 38 39 40 41 42 43 |
# File 'lib/serverspec_extra_types/types/jenkins_plugin.rb', line 35 def length if inspection.is_a? String inspection.length elsif inspection.is_a? Array inspection.length else 1 end end |
#url ⇒ Object
27 28 29 |
# File 'lib/serverspec_extra_types/types/jenkins_plugin.rb', line 27 def url "#{@url_base}/pluginManager/api/json?depth=1" end |