Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/calavera/hudson-erb-plugin
DSL to write Hudson's views with Ruby and ERB
https://github.com/calavera/hudson-erb-plugin
Last synced: about 2 months ago
JSON representation
DSL to write Hudson's views with Ruby and ERB
- Host: GitHub
- URL: https://github.com/calavera/hudson-erb-plugin
- Owner: calavera
- License: other
- Created: 2010-12-07T20:14:18.000Z (about 14 years ago)
- Default Branch: master
- Last Pushed: 2010-12-13T20:40:13.000Z (about 14 years ago)
- Last Synced: 2024-04-14T09:16:00.365Z (9 months ago)
- Language: Ruby
- Homepage: http://calavera.github.com/hudson-erb-plugin
- Size: 2.34 MB
- Stars: 6
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.textile
- License: LICENSE
Awesome Lists containing this project
README
h2. Hudson ERB plugin
Actually this is a Maven plugin to use to develop Hudson's plugins and allows to write views with Ruby and ERB templates.
When we build a Hudson's plugin with Maven it generates the jelly files that Hudson needs from our ERB templates.
_WARNING_: Right now it just includes a subset of the form views.
h3. Configuration
Add this to the pom file:
...
org.mirah.hudson
hudson-erb-plugin
erb-compile
h3. Usage
Add your ERB templates in the same place that you added your jelly files
with the same name but with extension @jelly.erb@, for instance if we have a
configuration form in @src/main/resources/hudson/plugin/foo/config.jelly@ we
have to replace it with
@src/main/resources/hudson/plugin/foo/config.jelly.erb@.h3. Example
We can replace this code:
with this one:
<% view do %>
<% entry 'Verbose', :description => 'Show Mirah AST generation' do %>
<%= checkbox 'verbose' %>
<% end %><% entry 'Script', :description => 'Mirah script' do %>
<%= textarea 'command' %>
<% end %>
<% end %>We can see this same example working in the "Mirah Interpreter plugin":https://github.com/calavera/mirah.hpi/blob/master/src/main/resources/hudson/plugins/mirah/MirahInterpreter/config.jelly.erb
h3. Extensions
In some cases perhaps we want to extend the dsl with our custom tags. We just need to create a file called @ext.rb@ under the directory
@src/main/resources/hudson_erb@ into our plugin and add the custom code to the module @Hudson::View@:
module Hudson
module View
def foo
''
end
end
endThen we can use that method in our views as we used any other:
<% entry 'Foo', :description => 'My foo input' do %>
<%= foo %>
<% end %>