jenkins-plugin-runtime 0.1.6 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,5 @@
1
1
  require 'java'
2
+ require 'tmpdir'
2
3
 
3
4
  require 'jenkins/war'
4
5
  for path in Dir[File.join(ENV['HOME'], '.jenkins', 'wars', Jenkins::War::VERSION, "**/*.jar")]
@@ -9,3 +10,36 @@ $:.unshift Pathname(__FILE__).dirname.join('../lib')
9
10
 
10
11
  require 'jenkins/plugin/runtime'
11
12
  require 'jenkins/plugin/proxies/proxy_helper'
13
+
14
+ module SpecHelper
15
+ # Java does not support opening directory as a File: File.open(".")
16
+ # So Dir.mktmpdir {} does not work on JRuby because it tries to delete directory
17
+ # with FileUtils.remove_entry_secure which opens a directory as a File.
18
+ def mktmpdir(*a, &b)
19
+ dir = nil
20
+ begin
21
+ dir = Dir.mktmpdir(*a)
22
+ yield dir
23
+ ensure
24
+ # [SECURITY WARNING]
25
+ # We use remove_entry instead of remove_entry_secure.
26
+ # This allows local user to delete arbitrary file and create setuid binary.
27
+ # JRuby should rewrite FileUtils.rm_r in Java.
28
+ #
29
+ # For details of this vulnerability:
30
+ # http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2005-0448
31
+ # http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2004-0452
32
+ FileUtils.remove_entry(dir, true) if dir
33
+ end
34
+ end
35
+ module_function :mktmpdir
36
+
37
+ def create_file(path, content = nil)
38
+ if content.nil? and block_given?
39
+ content = yield
40
+ end
41
+ File.open(path, "wb") do |f|
42
+ f << content
43
+ end
44
+ end
45
+ end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: jenkins-plugin-runtime
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.6
5
+ version: 0.1.7
6
6
  platform: ruby
7
7
  authors:
8
8
  - Charles Lowell
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-09-19 00:00:00 -05:00
13
+ date: 2011-10-01 00:00:00 -05:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -83,6 +83,7 @@ files:
83
83
  - Gemfile
84
84
  - Rakefile
85
85
  - jenkins-plugin-runtime.gemspec
86
+ - lib/jenkins/filepath.rb
86
87
  - lib/jenkins/launcher.rb
87
88
  - lib/jenkins/model.rb
88
89
  - lib/jenkins/model/action.rb
@@ -93,16 +94,23 @@ files:
93
94
  - lib/jenkins/model/root_action.rb
94
95
  - lib/jenkins/plugin.rb
95
96
  - lib/jenkins/plugin/proxies.rb
97
+ - lib/jenkins/plugin/proxies/action.rb
98
+ - lib/jenkins/plugin/proxies/build_step.rb
96
99
  - lib/jenkins/plugin/proxies/build_wrapper.rb
97
100
  - lib/jenkins/plugin/proxies/builder.rb
101
+ - lib/jenkins/plugin/proxies/publisher.rb
102
+ - lib/jenkins/plugin/proxies/root_action.rb
98
103
  - lib/jenkins/plugin/proxy.rb
99
104
  - lib/jenkins/plugin/runtime.rb
100
105
  - lib/jenkins/plugin/runtime/version.rb
101
106
  - lib/jenkins/plugin/specification.rb
102
107
  - lib/jenkins/rack.rb
103
108
  - lib/jenkins/slaves/cloud.rb
109
+ - lib/jenkins/tasks/build_step.rb
104
110
  - lib/jenkins/tasks/build_wrapper.rb
105
111
  - lib/jenkins/tasks/builder.rb
112
+ - lib/jenkins/tasks/publisher.rb
113
+ - spec/jenkins/filepath_spec.rb
106
114
  - spec/jenkins/launcher_spec.rb
107
115
  - spec/jenkins/model/action_spec.rb
108
116
  - spec/jenkins/model/build_spec.rb
@@ -113,6 +121,8 @@ files:
113
121
  - spec/jenkins/plugin/proxies/build_wrapper_spec.rb
114
122
  - spec/jenkins/plugin/proxies/builder_spec.rb
115
123
  - spec/jenkins/plugin/proxies/proxy_helper.rb
124
+ - spec/jenkins/plugin/proxies/publisher_spec.rb
125
+ - spec/jenkins/plugin/proxies/root_action_spec.rb
116
126
  - spec/jenkins/plugin/proxies_spec.rb
117
127
  - spec/jenkins/plugin/proxy_spec.rb
118
128
  - spec/jenkins/plugin/specification_spec.rb
@@ -151,6 +161,7 @@ signing_key:
151
161
  specification_version: 3
152
162
  summary: Runtime support libraries for Jenkins Ruby plugins
153
163
  test_files:
164
+ - spec/jenkins/filepath_spec.rb
154
165
  - spec/jenkins/launcher_spec.rb
155
166
  - spec/jenkins/model/action_spec.rb
156
167
  - spec/jenkins/model/build_spec.rb
@@ -161,6 +172,8 @@ test_files:
161
172
  - spec/jenkins/plugin/proxies/build_wrapper_spec.rb
162
173
  - spec/jenkins/plugin/proxies/builder_spec.rb
163
174
  - spec/jenkins/plugin/proxies/proxy_helper.rb
175
+ - spec/jenkins/plugin/proxies/publisher_spec.rb
176
+ - spec/jenkins/plugin/proxies/root_action_spec.rb
164
177
  - spec/jenkins/plugin/proxies_spec.rb
165
178
  - spec/jenkins/plugin/proxy_spec.rb
166
179
  - spec/jenkins/plugin/specification_spec.rb