Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

update the ruby plugin to use the new extracted support libraries und…

…er the Jenkins:: namespace.
  • Loading branch information...
commit e6502a1ada4e3af1d25ff8f9f978e39193566600 1 parent 2115d85
@cowboyd authored
View
4 src/main/java/ruby/RubyPlugin.java
@@ -119,7 +119,9 @@ public RubyPlugin() {
this.ruby.getLoadPaths().add(this.getClass().getResource("jenkins-plugins/lib").getPath());
this.ruby.getLoadPaths().add(this.getClass().getResource(".").getPath());
this.extensions = new ArrayList<ExtensionComponent>();
- this.ruby.runScriptlet("require 'jenkins/plugin'");
+ this.ruby.runScriptlet("require 'rubygems'");
+ this.ruby.runScriptlet("require 'bundled-gems.jar'");
+ this.ruby.runScriptlet("require 'jenkins/plugins'");
Object pluginClass = this.ruby.runScriptlet("Jenkins::Plugin");
this.plugin = this.ruby.callMethod(pluginClass, "new", this);
2  src/main/resources/ruby/jenkins-plugins
@@ -1 +1 @@
-Subproject commit f5ad8a0309940e46a997785df34674bc3cc689a5
+Subproject commit 1425f97194972f12f6b30f7345920c2a2bb85458
View
7 src/main/resources/ruby/plugin/models/fog_cloud.rb
@@ -1,13 +1,10 @@
-require 'hudson/plugin/cloud'
-class FogCloud < Hudson::Plugin::Cloud
+class FogCloud < Jenkins::Slaves::Cloud
attr_reader :name, :aws_access_id, :aws_secret_key
- def self.display_name
- "Fog"
- end
+ display_name "Fog"
def initialize
puts "FogCloud#initialize: #{self.inspect}"
View
9 src/main/resources/ruby/plugin/models/noop_wrapper.rb
@@ -1,11 +1,8 @@
-require 'hudson/plugin/build_wrapper'
-class NoopWrapper < Hudson::Plugin::BuildWrapper
+class NoopWrapper < Jenkins::Tasks::BuildWrapper
- def self.display_name
- "The Amazing Noop Wrapper"
- end
+ display_name "The Amazing Noop Wrapper"
def setup(*args)
puts "Hello from the NoopWrapper: (#{args.inspect})"
@@ -16,4 +13,4 @@ def teardown(build, listener)
puts "Hello from the NoopWrapper.teardown: (#{build.inspect}, #{listener.inspect})"
return true
end
-end
+end
View
10 src/main/resources/ruby/support/hudson/plugin/models.rb
@@ -1,21 +1,17 @@
-require 'hudson/plugin/descriptor'
-load 'plugin/models/fog_cloud.rb'
-load 'plugin/models/noop_wrapper.rb'
-load 'plugin/models/test_root_action.rb'
-Hudson::Plugin::Descriptor.new("fog_cloud", FogCloud, self, Java::HudsonSlaves::Cloud.java_class).tap do |d|
+Jenkins::Model::Descriptor.new("fog_cloud", FogCloud, self, Java::hudson.slaves.Cloud.java_class).tap do |d|
@java.addExtension(d)
descriptors[FogCloud] = d
end
-Hudson::Plugin::Descriptor.new("noop_wrapper", NoopWrapper, self, Java::HudsonTasks::BuildWrapper.java_class).tap do |d|
+Jenkins::Model::Descriptor.new("noop_wrapper", NoopWrapper, self, Java::hudson.tasks.BuildWrapper.java_class).tap do |d|
@java.addExtension(d)
descriptors[NoopWrapper] = d
end
-Hudson::Plugin::Descriptor.new("test_root_action", TestRootAction, self, Java::HudsonModel::RootAction.java_class).tap do |d|
+Jenkins::Model::Descriptor.new("test_root_action", TestRootAction, self, Java::hudson.model.RootAction.java_class).tap do |d|
@java.addExtension(d)
descriptors[TestRootAction] = d
end
Please sign in to comment.
Something went wrong with that request. Please try again.