Add getConfigPage to Descriptor

I added this for enabling config view like in the playground.
This commit is contained in:
Hiroshi Nakamura 2011-09-21 00:43:02 +09:00
parent aa0cae317b
commit 737e4c04db
1 changed files with 20 additions and 0 deletions

View File

@ -18,6 +18,22 @@ module Jenkins
@java_type
end
# TODO: We removed @name from Descriptor (see playground) so we need to use another name.
# Just use class name which is in CamelCase.
def getConfigPage
"/#{name_to_path}/config".tap { |path|
puts "getConfigPage -> #{path}"
}
end
# TODO: We removed @name from Descriptor (see playground) so we need to use another name.
# Just use class name which is in CamelCase.
def getGlobalConfigPage
"/#{name_to_path}/global".tap { |path|
puts "getGlobalConfigPage -> #{path}"
}
end
def newInstance(request, form)
properties = JSON.parse(form.toString(2))
properties.delete("kind")
@ -34,6 +50,10 @@ module Jenkins
rescue ArgumentError
@impl.new
end
def name_to_path
@impl.name.split('::').join('/')
end
end
end