./jruby-maven-plugins-1.1.5.ds1.orig/0000755000000000000000000000000013031007567014106 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/parent-mojo/0000755000000000000000000000000012674201751016344 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/parent-mojo/pom.xml0000644000000000000000000001224312674201751017663 0ustar 4.0.0 de.saumya.mojo jruby-maven-plugins 1.1.5 parent-mojo pom Mojo Parent shared dependencies and plugins for the mojos org.apache.maven.plugin-tools maven-plugin-annotations 3.4 provided org.apache.maven maven-plugin-api ${maven.version} org.apache.maven maven-core ${maven.version} org.apache.maven maven-artifact ${maven.version} ${basedir}/src/main/resources ${basedir}/src/main/ruby **/*.rb maven-source-plugin 2.4 jar maven-plugin-plugin 3.4 process-sources helpmojo org.eclipse.m2e lifecycle-mapping 1.0.0 org.apache.maven.plugins maven-plugin-plugin [3.4,) helpmojo descriptor integration-test false install maven-invoker-plugin 1.5 src/it ${project.build.directory}/it setup.bsh verify.bsh true integration-test install run */pom.xml *-no-pom/pom.xml integration-test-no-pom run *-no-pom/pom.xml ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/0000755000000000000000000000000012674201751015335 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-common/0000755000000000000000000000000012674201751020047 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-common/src/0000755000000000000000000000000012674201751020636 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-common/src/main/0000755000000000000000000000000012674201751021562 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-common/src/main/java/0000755000000000000000000000000012674201751022503 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-common/src/main/java/de/0000755000000000000000000000000012674201751023073 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-common/src/main/java/de/saumya/0000755000000000000000000000000012674201751024372 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-common/src/main/java/de/saumya/mojo/0000755000000000000000000000000012674201751025336 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-common/src/main/java/de/saumya/mojo/jruby9/0000755000000000000000000000000012674201751026562 5ustar ././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-common/src/main/java/de/saumya/mojo/jruby9/JarDependencies.java./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-common/src/main/java/de/saumya/mojo/jruby9/JarDep0000644000000000000000000000472312674201751027660 0ustar package de.saumya.mojo.jruby9; import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.io.PrintWriter; import java.util.Collection; import java.util.LinkedList; import java.util.List; import org.apache.maven.artifact.Artifact; import org.codehaus.plexus.util.FileUtils; public class JarDependencies { public static interface Filter { boolean addIt(Artifact a); } static final Filter ALL_FILTER = new Filter() { @Override public boolean addIt(Artifact a) { return true; } }; private final List artifacts = new LinkedList(); private final File jarsLockFile; private final File target; public JarDependencies(String target, String jarsLockFilename) { this(new File(target), jarsLockFilename); } public JarDependencies(File target, String jarsLockFilename) { this.jarsLockFile = new File(target, jarsLockFilename); this.target = new File(target, "jars"); } public String lockFilePath() { return jarsLockFile.getAbsolutePath(); } public void add(Artifact a) { if (a.getType().equals("jar")) { artifacts.add(a); } } public void addAll(Collection artifacts) { addAll(artifacts, ALL_FILTER); } public void addAll(Collection artifacts, Filter filter) { for(Artifact a: artifacts) { if (filter.addIt(a)) { add(a); } } } public void generateJarsLock() throws IOException { jarsLockFile.getParentFile().mkdirs(); try(PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(jarsLockFile)))) { for(Artifact a: artifacts) { out.print(a); out.println(":"); } } } public void copyJars() throws IOException { for(Artifact a: artifacts) { if (!a.getScope().equals("system")) { File targetFile = new File(target, a.getGroupId().replace('.', '/') + "/" + a.getArtifactId() + "/" + a.getVersion() + "/" + a.getArtifactId() + "-" + a.getVersion() + "." + a.getType()); FileUtils.copyFile(a.getFile(), targetFile); } } } }././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-common/src/main/java/de/saumya/mojo/jruby9/AbstractJRuby9Mojo.java./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-common/src/main/java/de/saumya/mojo/jruby9/Abstra0000644000000000000000000000037112674201751027722 0ustar package de.saumya.mojo.jruby9; import de.saumya.mojo.gem.AbstractGemMojo; public abstract class AbstractJRuby9Mojo extends AbstractGemMojo { @Override protected String getDefaultJRubyVersion() { return Versions.JRUBY; } }././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-common/src/main/java/de/saumya/mojo/jruby9/ArchiveType.java./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-common/src/main/java/de/saumya/mojo/jruby9/Archiv0000644000000000000000000000012612674201751027720 0ustar package de.saumya.mojo.jruby9; public enum ArchiveType { archive, runnable, jetty } ././@LongLink0000644000000000000000000000017000000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-common/src/main/java/de/saumya/mojo/jruby9/AbstractGenerateMojo.java./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-common/src/main/java/de/saumya/mojo/jruby9/Abstra0000644000000000000000000000540112674201751027721 0ustar package de.saumya.mojo.jruby9; import java.io.File; import java.io.IOException; import org.apache.maven.artifact.Artifact; import org.apache.maven.model.Resource; import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.plugin.MojoExecutionException; import de.saumya.mojo.jruby9.JarDependencies.Filter; import de.saumya.mojo.ruby.script.ScriptException; /** * setup the jars in jruby way: * *
  • copy the jars into a local repo inside the jar under the 'jars' directory
  • *
  • create 'Jars.lock' which jruby uses to load the jars
  • * *
    * * setup the gems * *
  • copy the 'gems' directory to the resources
  • *
  • copy the 'specifications' directory to the resources
  • *
  • copy the 'bin' directory to the resources
  • * * * @author christian * */ public abstract class AbstractGenerateMojo extends AbstractJRuby9Mojo { protected void executeWithGems(boolean pluginDependenciesOnly) throws MojoExecutionException, ScriptException, IOException { JarDependencies jars = new JarDependencies(project.getBuild().getOutputDirectory(), "Jars.lock"); jars.addAll(plugin.getArtifacts(), new Filter(){ @Override public boolean addIt(Artifact a) { return a.getScope().equals("runtime") && !project.getArtifactMap().containsKey(a.getGroupId() +":" + a.getArtifactId()); } }); if (!pluginDependenciesOnly) { jars.addAll(project.getArtifacts()); } jars.generateJarsLock(); jars.copyJars(); File pluginGemHome = gemHome( gemsBasePath(), plugin.getArtifactId() ); addResource(project.getResources(), createGemsResource(pluginGemHome.getAbsolutePath())); addResource(project.getResources(), createGemsResource(gemsBasePath())); } // TODO pull upstream protected Resource createGemsResource(String gemHome) { Resource resource = new Resource(); resource.setDirectory(gemHome); resource.addInclude("bin/*"); resource.addInclude("specifications/*"); resource.addInclude("gems/**"); resource.addExclude("gems/*/test/**"); resource.addExclude("gems/*/tests/**"); resource.addExclude("gems/*/spec/**"); resource.addExclude("gems/*/specs/**"); resource.addExclude("gems/*/features/**"); resource.addExclude("gems/**/*.java"); return resource; } // TODO pull upstream protected String gemsBasePath() { String base = this.gemsConfig.getGemHome() != null ? this.gemsConfig.getGemHome().getAbsolutePath() : (project.getBuild().getDirectory() + "/rubygems"); return base; } } ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-common/src/main/java/de/saumya/mojo/jruby9/JRubyDirectory.java./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-common/src/main/java/de/saumya/mojo/jruby9/JRubyD0000644000000000000000000000512412674201751027646 0ustar package de.saumya.mojo.jruby9; import java.io.File; import java.io.IOException; import java.nio.file.FileVisitResult; import java.nio.file.Path; import java.nio.file.SimpleFileVisitor; import java.nio.file.attribute.BasicFileAttributes; import java.util.HashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; import org.apache.commons.io.FileUtils; class JRubyDirectory extends SimpleFileVisitor { Map> dirs = new HashMap>(); private Path root; JRubyDirectory(Path root) { this.root = root; } @Override public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { String name = dir.getParent().toFile().getName(); if ("jars".equals(name) || "META-INF".equals(name)) { return FileVisitResult.SKIP_SUBTREE; } add(dir); return FileVisitResult.CONTINUE; } @Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { String name = file.toFile().getName(); if(name.endsWith(".class") || name.equals(".jrubydir") || (file.getParent().equals(root) && ("gems".equals(name) || "specifications".equals(name) || "jars".equals(name) || "jar-bootstrap.rb".equals(name)))) { return FileVisitResult.CONTINUE; } add(file); return FileVisitResult.CONTINUE; } private void add(Path file) { String name = file.toFile().getName(); List dir = dirs.get(file.getParent()); if (dir == null) { dir = new LinkedList(); dirs.put(file.getParent(), dir); } dir.add(name); } @Override public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException { File jrubyDir = dir.resolve(".jrubydir").toFile(); List names = dirs.remove(dir); if (names != null) { StringBuilder content = new StringBuilder(".\n"); if (!dir.equals(root)) content.append("..\n"); for(String name: names) { content.append(name).append("\n"); } if (jrubyDir.exists()) { String old = FileUtils.readFileToString(jrubyDir); if (content.equals(old)) { return FileVisitResult.CONTINUE; } } FileUtils.write(jrubyDir, content); } return FileVisitResult.CONTINUE; } }././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-common/src/main/java/de/saumya/mojo/jruby9/AbstractProcessMojo.java./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-common/src/main/java/de/saumya/mojo/jruby9/Abstra0000644000000000000000000000171012674201751027720 0ustar package de.saumya.mojo.jruby9; import java.io.File; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugins.annotations.Parameter; /** * generates ".jrubydir" files for all resource and gems to allow jruby * to perform directory globs inside the jar. * * @author christian * */ public abstract class AbstractProcessMojo extends AbstractMojo { @Parameter( defaultValue = "${project.build.outputDirectory}", readonly = true ) private File outputDirectory; @Override public void execute() throws MojoExecutionException { Path root = outputDirectory.toPath(); try { Files.walkFileTree(root, new JRubyDirectory(root)); } catch (IOException e) { throw new MojoExecutionException("could not generate .jrubydir files", e); } } }././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-common/src/main/java/de/saumya/mojo/jruby9/ArtifactHelper.java./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-common/src/main/java/de/saumya/mojo/jruby9/Artifa0000644000000000000000000000736512674201751027726 0ustar package de.saumya.mojo.jruby9; import java.io.File; import java.io.IOException; import java.util.List; import java.util.Set; import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.artifact.resolver.ArtifactResolutionRequest; import org.apache.maven.artifact.resolver.ArtifactResolutionResult; import org.apache.maven.artifact.resolver.filter.ArtifactFilter; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.repository.RepositorySystem; import org.codehaus.plexus.archiver.ArchiverException; import org.codehaus.plexus.archiver.UnArchiver; import org.codehaus.plexus.util.FileUtils; public class ArtifactHelper { private final UnArchiver archiver; private final RepositorySystem system; private final ArtifactRepository localRepo; private final List remoteRepos; public ArtifactHelper(UnArchiver archiver, RepositorySystem system, ArtifactRepository localRepo, List remoteRepos) { this.system = system; this.localRepo = localRepo; this.remoteRepos = remoteRepos; this.archiver = archiver; } public Set resolve(String groupId, String artifactId, String version) throws MojoExecutionException { return resolve(groupId, artifactId, version, null); } public Set resolve(String groupId, String artifactId, String version, final String exclusion) throws MojoExecutionException { ArtifactResolutionRequest request = new ArtifactResolutionRequest() .setResolveTransitively(true) .setResolveRoot(true) .setArtifact(system.createArtifact(groupId, artifactId, version, "jar")) .setLocalRepository(this.localRepo) .setRemoteRepositories(remoteRepos).setCollectionFilter(new ArtifactFilter() { @Override public boolean include(Artifact artifact) { if (exclusion != null && (artifact.getGroupId() + ":" + artifact.getArtifactId()).equals(exclusion)) { return false; } return artifact.getScope() == null || artifact.getScope().equals("compile") || artifact.getScope().equals("runtime"); } }); ArtifactResolutionResult result = system.resolve(request); // TODO error handling return result.getArtifacts(); } public void copy(File output, String groupId, String artifactId, String version) throws MojoExecutionException { copy(output, groupId, artifactId, version, null); } public void copy(File output, String groupId, String artifactId, String version, String exclusion) throws MojoExecutionException { output.mkdirs(); for(Artifact artifact: resolve(groupId, artifactId, version, exclusion)) { try { FileUtils.copyFile(artifact.getFile(), new File(output, artifact.getFile().getName())); } catch (IOException e) { throw new MojoExecutionException("could not copy: " + artifact, e); } } } public void unzip(File output, String groupId, String artifactId, String version) throws MojoExecutionException { output.mkdirs(); archiver.setDestDirectory(output); for(Artifact artifact: resolve(groupId, artifactId, version)) { archiver.setSourceFile(artifact.getFile()); try { archiver.extract(); } catch (ArchiverException e) { throw new MojoExecutionException("could not unzip: " + artifact, e); } } } }././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-common/src/main/java/de/saumya/mojo/jruby9/Versions.java./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-common/src/main/java/de/saumya/mojo/jruby9/Versio0000644000000000000000000000046712674201751027763 0ustar package de.saumya.mojo.jruby9; public final class Versions { private Versions(){} public final static String JRUBY = "9.0.0.0"; public final static String JRUBY_MAINS = "0.4.0"; public final static String JRUBY_RACK = "1.1.18"; public final static String JETTY = "8.1.14.v20131031"; } ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-common/pom.xml0000644000000000000000000000132312674201751021363 0ustar 4.0.0 jruby9 de.saumya.mojo 0.2.3-SNAPSHOT jruby9-common jar JRuby9 Common org.apache.maven.plugin-tools maven-plugin-annotations provided ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-war-maven-plugin/0000755000000000000000000000000012674201751021750 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-war-maven-plugin/src/0000755000000000000000000000000012674201751022537 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-war-maven-plugin/src/main/0000755000000000000000000000000012674201751023463 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-war-maven-plugin/src/main/java/0000755000000000000000000000000012674201751024404 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-war-maven-plugin/src/main/java/de/0000755000000000000000000000000012674201751024774 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-war-maven-plugin/src/main/java/de/saumya/0000755000000000000000000000000012674201751026273 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-war-maven-plugin/src/main/java/de/saumya/mojo/0000755000000000000000000000000012674201751027237 5ustar ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-war-maven-plugin/src/main/java/de/saumya/mojo/jruby9/./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-war-maven-plugin/src/main/java/de/saumya/mojo/jru0000755000000000000000000000000012674201751027760 5ustar ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-war-maven-plugin/src/main/java/de/saumya/mojo/jruby9/war/./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-war-maven-plugin/src/main/java/de/saumya/mojo/jru0000755000000000000000000000000012674201751027760 5ustar ././@LongLink0000644000000000000000000000017500000000000011606 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-war-maven-plugin/src/main/java/de/saumya/mojo/jruby9/war/ProcessMojo.java./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-war-maven-plugin/src/main/java/de/saumya/mojo/jru0000644000000000000000000000103212674201751027756 0ustar package de.saumya.mojo.jruby9.war; import org.apache.maven.plugins.annotations.LifecyclePhase; import org.apache.maven.plugins.annotations.Mojo; import de.saumya.mojo.jruby9.AbstractProcessMojo; /** * * generates ".jrubydir" files for all resource and gems to allow jruby * to perform directory globs inside the jar. * * @author christian */ @Mojo( name = "process", defaultPhase = LifecyclePhase.PROCESS_RESOURCES, requiresProject = true, threadSafe = true ) public class ProcessMojo extends AbstractProcessMojo { }././@LongLink0000644000000000000000000000017100000000000011602 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-war-maven-plugin/src/main/java/de/saumya/mojo/jruby9/war/WarMojo.java./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-war-maven-plugin/src/main/java/de/saumya/mojo/jru0000644000000000000000000002121412674201751027762 0ustar package de.saumya.mojo.jruby9.war; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.util.Arrays; import org.apache.maven.archiver.MavenArchiveConfiguration; import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.model.Resource; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.plugins.annotations.Component; import org.apache.maven.plugins.annotations.LifecyclePhase; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.plugins.annotations.ResolutionScope; import org.apache.maven.repository.RepositorySystem; import org.apache.maven.shared.utils.io.IOUtil; import org.codehaus.plexus.archiver.UnArchiver; import de.saumya.mojo.jruby9.ArtifactHelper; import de.saumya.mojo.jruby9.ArchiveType; import de.saumya.mojo.jruby9.Versions; /** * packs a ruby application into war. it can add a launcher to it * so it can be executed like runnable jar or it can add an embedded * jetty to startup a webserver directly from the war. * *
  • adds jruby-complete.jar to WEB-INF/lib
  • *
  • adds jruby-rack.jar to WEB-INF/lib
  • *
  • shaded jruby-mains.jar (for the RUNNABLE case)
  • *
  • shaded jetty.jar + its dependencies (for the JETTY case)
  • *
  • all declared gems and transitive gems and jars are under WEB-INF/classes
  • *
  • all declared jars and transitive jars are under WEB-INF/classes
  • *
  • all declared resource are under WEB-INF/classes
  • *
  • adds the default resources to WEB-INF/classes
  • * * the main class (for RUNNABLE) needs to extract the jruby-complete.jar into a temp directory and * the launcher will set up the GEM_HOME, GEM_PATH and JARS_HOME pointing into the jar (classloader) * and takes arguments for executing jruby. any bin stubs from the gem are available via '-S' or any * script relative to jar's root can be found as the current directory is inside the jar. * *
    * * embedded JETTY does not take any arguments and will just start up jetty * *
    * * the jruby rack application uses the ClassPathLayout which is designed for this kind of packing * the ruby application. * *
    * * default for typical rack application * *
  • config.ru
  • *
  • lib/**
  • *
  • app/**
  • *
  • config/**
  • *
  • public/**
  • * * @author christian */ @Mojo( name = "war", defaultPhase = LifecyclePhase.PACKAGE, requiresProject = true, threadSafe = true, requiresDependencyResolution = ResolutionScope.RUNTIME ) public class WarMojo extends org.apache.maven.plugin.war.WarMojo { @Parameter( defaultValue = "archive", property = "jruby.archive.type", required = true ) private ArchiveType type; @Parameter( required = false ) private String mainClass; @Parameter( required = false, defaultValue = "false" ) private boolean defaultResource; @Parameter( defaultValue = Versions.JRUBY, property = "jruby.version", required = true ) private String jrubyVersion; @Parameter( defaultValue = Versions.JRUBY_MAINS, property = "jruby.mains.version", required = true ) private String jrubyMainsVersion; @Parameter( defaultValue = Versions.JRUBY_RACK, property = "jruby.rack.version", required = true ) private String jrubyRackVersion; @Parameter( defaultValue = Versions.JETTY, property = "jetty.version", required = true ) private String jettyVersion; @Parameter( readonly = true, required = true, defaultValue="${localRepository}" ) protected ArtifactRepository localRepository; @Component RepositorySystem system; @Component( hint = "zip" ) UnArchiver unzip; @Override public void execute() throws MojoExecutionException, MojoFailureException { ArtifactHelper helper = new ArtifactHelper(unzip, system, localRepository, getProject().getRemoteArtifactRepositories()); File jrubyWar = new File(getProject().getBuild().getDirectory(), "jrubyWar"); File jrubyWarLib = new File(jrubyWar, "lib"); File webXml = new File(jrubyWar, "web.xml"); File initRb = new File(jrubyWar, "init.rb"); File jrubyWarClasses = new File(jrubyWar, "classes"); switch(type) { case jetty: helper.unzip(jrubyWarClasses, "org.eclipse.jetty", "jetty-server", jettyVersion); helper.unzip(jrubyWarClasses, "org.eclipse.jetty", "jetty-webapp", jettyVersion); if (mainClass == null ) mainClass = "org.jruby.mains.JettyRunMain"; case runnable: helper.unzip(jrubyWarClasses, "org.jruby.mains", "jruby-mains", jrubyMainsVersion); if (mainClass == null ) mainClass = "org.jruby.mains.WarMain"; MavenArchiveConfiguration archive = getArchive(); archive.getManifest().setMainClass(mainClass); createAndAddWebResource(jrubyWarClasses, ""); createAndAddWebResource(new File(getProject().getBuild().getOutputDirectory(), "bin"), "bin"); case archive: default: } helper.copy(jrubyWarLib, "org.jruby", "jruby-complete", jrubyVersion); helper.copy(jrubyWarLib, "org.jruby.rack", "jruby-rack", jrubyRackVersion, "org.jruby:jruby-complete"); //exclude jruby-complete // we bundle jar dependencies the ruby way getProject().getArtifacts().clear(); createAndAddWebResource(jrubyWarLib, "WEB-INF/lib"); copyPluginResource(initRb); Resource resource = new Resource(); resource.setDirectory(initRb.getParent()); resource.addInclude(initRb.getName()); resource.setTargetPath("META-INF"); addWebResource(resource); if (defaultResource) { addCommonRackApplicationResources(); } if (getWebXml() == null) { findWebXmlOrUseBuiltin(webXml); } super.execute(); } private void addCommonRackApplicationResources() { Resource resource = new Resource(); resource.setDirectory(getProject().getBasedir().getAbsolutePath()); resource.addInclude("config.ru"); getProject().addResource(resource); createAndAddResource(new File(getProject().getBasedir(), "lib")); createAndAddResource(new File(getProject().getBasedir(), "app")); createAndAddResource(new File(getProject().getBasedir(), "public")); createAndAddResource(new File(getProject().getBasedir(), "config")); } private void findWebXmlOrUseBuiltin(File webXml) throws MojoExecutionException { // TODO search web.xml copyPluginResource(webXml); if (getLog().isInfoEnabled()) { getLog().info("using builtin web.xml: " + webXml.toString().replace(getProject().getBasedir().getAbsolutePath() + File.separatorChar, "")); } setWebXml(webXml); } private void copyPluginResource(File file) throws MojoExecutionException { String name = file.getName(); try { IOUtil.copy(getClass().getClassLoader().getResourceAsStream(name), new FileOutputStream(file)); } catch (IOException e) { throw new MojoExecutionException("could not copy from plugin: " + name, e); } } private void createAndAddResource(File source){ getProject().addResource(createResource(source.getAbsolutePath(), null)); } private void createAndAddWebResource(File source, String target){ addWebResource(createResource(source.getAbsolutePath(), target)); } private void addWebResource(Resource resource) { Resource[] webResources = getWebResources(); if (webResources == null) { webResources = new Resource[1]; } else { webResources = Arrays.copyOf(webResources, webResources.length + 1); } webResources[webResources.length - 1] = resource; setWebResources(webResources); } protected Resource createResource(String source, String target) { Resource resource = new Resource(); resource.setDirectory(source); resource.addExclude("jetty*.css"); resource.addExclude("plugin.properties"); resource.addExclude("about.html"); resource.addExclude("about_files/**"); resource.addExclude("META-INF/ECLIPSE*"); resource.addExclude("META-INF/eclipse*"); resource.addExclude("META-INF/maven/**"); resource.addExclude("WEB-INF/**"); resource.addExclude("**/web.xml"); if (target != null) resource.setTargetPath(target); return resource; } } ././@LongLink0000644000000000000000000000017600000000000011607 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-war-maven-plugin/src/main/java/de/saumya/mojo/jruby9/war/GenerateMojo.java./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-war-maven-plugin/src/main/java/de/saumya/mojo/jru0000644000000000000000000000170512674201751027765 0ustar package de.saumya.mojo.jruby9.war; import java.io.IOException; import org.apache.maven.plugins.annotations.LifecyclePhase; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.ResolutionScope; import org.apache.maven.plugin.MojoExecutionException; import de.saumya.mojo.ruby.script.ScriptException; import de.saumya.mojo.jruby9.AbstractGenerateMojo; /** * add the gems and jars to resources. @see AbstractGenerateMojo * * @author christian * */ @Mojo( name = "generate", defaultPhase = LifecyclePhase.GENERATE_RESOURCES, requiresProject = true, threadSafe = true, requiresDependencyResolution = ResolutionScope.RUNTIME ) public class GenerateMojo extends AbstractGenerateMojo { @Override protected void executeWithGems() throws MojoExecutionException, ScriptException, IOException { // war files do pack all dependencies the ruby way executeWithGems(false); } } ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-war-maven-plugin/src/main/resources/0000755000000000000000000000000012674201751025475 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-war-maven-plugin/src/main/resources/init.rb0000644000000000000000000000071112674201751026764 0ustar # partially copied monkey_patch.rb from jruby-mains project # bundler includes Bundler::SharedHelpers into its runtime # adding the included method allows to monkey patch the runtime # the moment it is used. i.e. no need to activate the bundler gem module Bundler module Patch def clean_load_path # nothing to be done for JRuby end end module SharedHelpers def included(bundler) bundler.send :include, Patch end end end ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-war-maven-plugin/src/main/resources/web.xml0000644000000000000000000000100612674201751026771 0ustar jruby.rack.layout_class JRuby::Rack::ClassPathLayout RackFilter org.jruby.rack.RackFilter RackFilter /* org.jruby.rack.RackServletContextListener ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-war-maven-plugin/src/it/0000755000000000000000000000000012674201751023153 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-war-maven-plugin/src/it/jrubyWarExample/0000755000000000000000000000000012674201751026274 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-war-maven-plugin/src/it/jrubyWarExample/pom.xml0000644000000000000000000001234312674201751027614 0ustar 4.0.0 de.saumya.mojo.jruby9 test testing mavengems mavengem:https://rubygems.org mavengems mavengem:https://rubygems.org org.slf4j slf4j-api 1.7.6 rubygems leafy-rack 0.4.0 gem rubygems minitest 5.7.0 gem 9.0.3.0 de.saumya.mojo mavengem-wagon 0.1.0 ${basedir} test.rb spec/** maven-jar-plugin 2.4 default-jar omit de.saumya.mojo jruby9-war-maven-plugin @project.version@ ${j.version} runnable jruby-war generate process war rubygems rspec 3.3.0 gem org.slf4j slf4j-simple 1.7.6 org.codehaus.mojo exec-maven-plugin 1.2 java ${project.build.directory} path blabla ${basedir} ${basedir} ${basedir} simple verify exec -jar ${project.build.finalName}.war -rjars/setup -e p JRUBY_VERSION p $CLASSPATH.size expected = 10 raise "expected #{expected} classpath entries but got #{$CLASSPATH.size}: #{$CLASSPATH.inspect}" if $CLASSPATH.size != expected raise "expected jruby version ${j.version} but was #{JRUBY_VERSION}" if JRUBY_VERSION != "${j.version}" rspec verify exec -jar ${project.build.finalName}.war -S rspec test file verify exec -jar ${project.build.finalName}.war test.rb ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-war-maven-plugin/src/it/jrubyWarExample/spec/0000755000000000000000000000000012674201751027226 5ustar ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-war-maven-plugin/src/it/jrubyWarExample/spec/one_spec.rb./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-war-maven-plugin/src/it/jrubyWarExample/spec/one_0000644000000000000000000000062712674201751030076 0ustar require 'jar-dependencies' describe 'something' do it 'runs inside the right environment' do expect(Dir.pwd).to eq 'uri:classloader://WEB-INF/classes/' expect(__FILE__).to eq 'uri:classloader:/WEB-INF/classes/spec/one_spec.rb' expect(Jars.home).to eq 'uri:classloader://WEB-INF/classes/jars' expect(Gem.dir).to eq 'uri:classloader://META-INF/jruby.home/lib/ruby/gems/shared' end end ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-war-maven-plugin/src/it/jrubyWarExample/test.rb0000644000000000000000000000142112674201751027576 0ustar gem 'minitest' require 'minitest/autorun' require 'jars/setup' describe 'something' do it 'uses the right minitest version' do Gem.loaded_specs['minitest'].version.to_s.must_equal '5.7.0' end it 'runs from the jar' do __FILE__.must_equal 'test.rb' Dir.pwd.must_equal 'uri:classloader://WEB-INF/classes/' end it 'can use logger' do old = java.lang.System.err bytes = StringIO.new java.lang.System.err = java.io.PrintStream.new( bytes.to_outputstream ) begin # TODO capture java stderr and ensure there is no warning org.slf4j.LoggerFactory.get_logger('me').info 'hello' java.lang.System.err.flush bytes.string.strip.must_equal '[main] INFO me - hello' ensure java.lang.System.err = old end end end ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-war-maven-plugin/src/it/jrubyWarExample/invoker.properties./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-war-maven-plugin/src/it/jrubyWarExample/invoker.p0000644000000000000000000000006312674201751030131 0ustar invoker.goals = verify invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-war-maven-plugin/src/it/jettyExample/0000755000000000000000000000000012674201751025626 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-war-maven-plugin/src/it/jettyExample/config.ru0000644000000000000000000000020312674201751027436 0ustar $LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__))) require 'app/hellowarld' map '/' do run Sinatra::Application end ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-war-maven-plugin/src/it/jettyExample/pom.xml0000644000000000000000000000463412674201751027152 0ustar 4.0.0 de.saumya.mojo.jruby9 jetty testing mavengems mavengem:https://rubygems.org mavengems mavengem:https://rubygems.org org.slf4j slf4j-simple 1.7.6 rubygems leafy-complete 0.4.0 gem rubygems sinatra 1.4.5 gem de.saumya.mojo mavengem-wagon 0.1.0 ${basedir} config.ru app/** maven-jar-plugin 2.6 default-jar omit de.saumya.mojo jruby9-war-maven-plugin @project.version@ jetty jruby-war generate process war ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-war-maven-plugin/src/it/jettyExample/invoker.properties./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-war-maven-plugin/src/it/jettyExample/invoker.prop0000644000000000000000000000006312674201751030204 0ustar invoker.goals = verify invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-war-maven-plugin/src/it/jettyExample/app/0000755000000000000000000000000012674201751026406 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-war-maven-plugin/src/it/jettyExample/app/views/0000755000000000000000000000000012674201751027543 5ustar ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-war-maven-plugin/src/it/jettyExample/app/views/person.erb./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-war-maven-plugin/src/it/jettyExample/app/views/pe0000644000000000000000000000250012674201751030067 0ustar <%= @person.firstname %> <%= @person.surname %>

    person

    Firstname
    Surname
    ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-war-maven-plugin/src/it/jettyExample/app/hellowarld.rb./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-war-maven-plugin/src/it/jettyExample/app/hellowar0000644000000000000000000000277512674201751030161 0ustar require 'sinatra' require 'json' require 'ostruct' require 'leafy/metrics' require 'leafy/health' require 'leafy/instrumented/instrumented' require 'leafy/instrumented/collected_instrumented' require 'leafy/rack/admin' require 'leafy/rack/instrumented' data = OpenStruct.new data.surname = 'meier' data.firstname = 'christian' configure do metrics = Leafy::Metrics::Registry.new health = Leafy::Health::Registry.new use( Leafy::Rack::Admin, metrics, health ) use( Leafy::Rack::Metrics, metrics ) use( Leafy::Rack::Health, health ) use( Leafy::Rack::Ping ) use( Leafy::Rack::ThreadDump ) use( Leafy::Rack::Instrumented, Leafy::Instrumented::Instrumented.new( metrics, 'webapp' ) ) use( Leafy::Rack::Instrumented, Leafy::Instrumented::CollectedInstrumented.new( metrics, 'collected' ) ) metrics.register_gauge('app.data_length' ) do data.surname.length + data.firstname.length end health.register( 'app.health' ) do if data.surname.length + data.firstname.length < 4 "stored names are too short" end end set :histogram, metrics.register_histogram( 'app.name_length' ) end get '/app' do p @person = data erb :person end get '/person' do p @person = data content_type 'application/json' { :surname => data.surname, :firstname => data.firstname }.to_json end patch '/person' do payload = JSON.parse request.body.read data.send :"#{payload.keys.first}=", payload.values.first settings.histogram.update( data.surname.length + data.firstname.length ) status 205 end ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-war-maven-plugin/README.md0000644000000000000000000000777712674201751023251 0ustar # jruby jar maven plugin it packs a ruby application as runnable jar, i.e. all the ruby code and the gems and jars (which ruby loads via require) are packed inside the jar. the jar will include jruby-complete and jruby-mains to execute the ruby application via, i.e. java -jar my.jar -S rake there is more compact configuration using an maven extensions: [../jruby9-jar-extension](jruby9-jar-extension) ## general command line switches to see the java/jruby command the plugin is executing use (for example with the verify goal) ```mvn verify -Djruby.verbose``` to quickly pick another jruby version use ```mvn verify -Djruby.version=1.7.20``` or to display some help ```mvn jruby9-jar:help -Ddetail``` ```mvn jruby9-jar:help -Ddetail -Dgoal=jar``` ## jruby jar it installs all the declared gems and jars from the dependencies section as well the plugin dependencies. the complete pom for the samples below is in [src/it/jrubyJarExample/pom.xml](src/it/jrubyJarExample/pom.xml) and more details on how it can be executed. the gem-artifacts are coming from the torquebox rubygems proxy rubygems-releases http://rubygems-proxy.torquebox.org/releases to use these gems within the depenencies of the plugin you need rubygems-releases http://rubygems-proxy.torquebox.org/releases the jar and gem artifacts for the JRuby application can be declared in the main dependencies section org.slf4j slf4j-api 1.7.6 rubygems leafy-rack 0.4.0 gem rubygems minitest 5.7.0 gem these artifacts ALL have the default scope which gets packed into the jar. adding ruby resources to your jar ${basedir} test.rb spec/** the plugin declarations. first we want to omit the regular jar packing maven-jar-plugin 2.4 default-jar omit the tell the jruby-jar mojo to pack the jar de.saumya.mojo jruby9-jar-maven-plugin @project.version@ ${j.version} jruby-jar generate process jar now the plugin does also pack those gem declared inside the plugin sections rubygems rspec 3.3.0 gem the main dependencies section does use leafy-rack and for its logging you need a slf4j logger. org.slf4j slf4j-simple 1.7.6 ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-war-maven-plugin/pom.xml0000644000000000000000000000265212674201751023272 0ustar 4.0.0 jruby9 de.saumya.mojo 0.2.3-SNAPSHOT jruby9-war-maven-plugin maven-plugin JRuby9 War Maven Mojo org.apache.maven maven-core true org.codehaus.plexus plexus-archiver de.saumya.mojo jruby9-common org.apache.maven.plugins maven-war-plugin org.apache.maven.plugin-tools maven-plugin-annotations provided maven-invoker-plugin ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/0000755000000000000000000000000012674201751017134 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-protocol/0000755000000000000000000000000012674201751022572 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-protocol/src/0000755000000000000000000000000012674201751023361 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-protocol/src/test/0000755000000000000000000000000012674201751024340 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-protocol/src/test/java/0000755000000000000000000000000012674201751025261 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-protocol/src/test/java/de/0000755000000000000000000000000012674201751025651 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-protocol/src/test/java/de/saumya/0000755000000000000000000000000012674201751027150 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-protocol/src/test/java/de/saumya/mojo/0000755000000000000000000000000012674201751030114 5ustar ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-protocol/src/test/java/de/saumya/mojo/mavengem/./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-protocol/src/test/java/de/saumya/mojo/0000755000000000000000000000000012674201751030114 5ustar ././@LongLink0000644000000000000000000000017600000000000011607 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-protocol/src/test/java/de/saumya/mojo/mavengem/HandlerTest.java./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-protocol/src/test/java/de/saumya/mojo/0000644000000000000000000000776712674201751030137 0ustar package de.saumya.mojo.mavengem; import org.junit.Before; import org.junit.Test; import java.io.File; import java.io.FileNotFoundException; import java.io.InputStream; import java.util.Map; import java.net.URL; import static org.junit.Assert.assertThat; import static org.hamcrest.CoreMatchers.containsString; import static org.hamcrest.CoreMatchers.endsWith; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.startsWith; public class HandlerTest { private boolean result; private File cacheDir; @Before public void setup() throws Exception { cacheDir = new File(System.getProperty("basedir"), "target/cache4test"); result = Handler.registerMavenGemProtocol(new RubygemsFactory(cacheDir)); } @Test public void registerProtocol() throws Exception { assertThat(result, is(true)); assertThat(Handler.registerMavenGemProtocol(null), is(false)); assertThat(Handler.registerMavenGemProtocol(), is(false)); } @Test public void virtusPomWithAuthentication() throws Exception { // this test goes online to rubygems.org File cached = new File(cacheDir, "http___rubygems_org/quick/Marshal.4.8/v/virtus-1.0.5.gemspec.rz"); cached.delete(); URL url = new URL("mavengem:http://me:andthecorner@rubygems.org/maven/releases/rubygems/virtus/1.0.5/virtus-1.0.5.pom"); try (InputStream in = url.openStream()) { // just read the file byte[] data = new byte[in.available()]; in.read(data, 0, in.available()); } // the cached dir does not expose the credentials assertThat(cached.getPath(), cached.exists(), is(true)); } @Test public void ping() throws Exception { URL url = new URL("mavengem:https://rubygems.org/something/maven/releases/ping"); byte[] data = new byte[4]; url.openStream().read(data, 0, 4); String result = new String(data); assertThat(result, is("pong")); } @Test public void railsMavenMetadata() throws Exception { // this test goes online to rubygems.org File cached = new File(cacheDir, "https___rubygems_org/api/v1/dependencies/rails.ruby"); cached.delete(); URL url = new URL("mavengem:https://rubygems.org/maven/releases/rubygems/rails/maven-metadata.xml"); try (InputStream in = url.openStream()) { byte[] data = new byte[in.available()]; in.read(data, 0, in.available()); String result = new String(data); assertThat(result, startsWith("")); assertThat(result, containsString("4.2.5")); assertThat(result, endsWith("\n")); } assertThat(cached.getPath(), cached.isFile(), is(true)); } @Test public void railsPom() throws Exception { // this test goes online to rubygems.org File cached = new File(cacheDir, "https___rubygems_org/quick/Marshal.4.8/r/rails-4.2.5.gemspec.rz"); cached.delete(); URL url = new URL("mavengem:https://rubygems.org/maven/releases/rubygems/rails/4.2.5/rails-4.2.5.pom"); try (InputStream in = url.openStream()) { byte[] data = new byte[in.available()]; in.read(data, 0, in.available()); String result = new String(data); assertThat(result, startsWith("")); assertThat(result, containsString("4.2.5")); assertThat(result, containsString("Full-stack web application framework.")); assertThat(result, containsString("gem")); assertThat(result, endsWith("\n")); } assertThat(cached.getPath(), cached.isFile(), is(true)); } @Test(expected = FileNotFoundException.class) public void fileNotFoundOnWrongBaseURL() throws Exception { // this test goes online to rubygems.org URL url = new URL("mavengem:https://rubygems.org/something/not/right/here/maven/releases/rubygems/rails/maven-metadata.xml"); url.openStream(); } @Test(expected = FileNotFoundException.class) public void fileNotFoundOnDirectory() throws Exception { // this test goes online to rubygems.org URL url = new URL("mavengem:https://rubygems.org/maven/releases/rubygems/rails"); url.openStream(); } } ././@LongLink0000644000000000000000000000021400000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-protocol/src/test/java/de/saumya/mojo/mavengem/MavenGemURLConnectionTest.java./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-protocol/src/test/java/de/saumya/mojo/0000644000000000000000000001466112674201751030126 0ustar package de.saumya.mojo.mavengem; import org.junit.Before; import org.junit.Test; import java.io.File; import java.io.FileNotFoundException; import java.io.InputStream; import java.util.Map; import java.util.HashMap; import java.net.URL; import java.net.URLConnection; import static org.junit.Assert.assertThat; import static org.hamcrest.CoreMatchers.containsString; import static org.hamcrest.CoreMatchers.endsWith; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.startsWith; public class MavenGemURLConnectionTest { private File cacheDir; private RubygemsFactory factory; @Before public void setup() throws Exception { cacheDir = new File(System.getProperty("basedir"), "target/cache4test"); factory = new RubygemsFactory(cacheDir); } @Test public void virtusPomWithAuthentication() throws Exception { // this test goes online to rubygems.org File cached = new File(cacheDir, "http___rubygems_org/quick/Marshal.4.8/v/virtus-1.0.5.gemspec.rz"); // with the /maven/releases prefix URLConnection url = new MavenGemURLConnection(factory, new URL("http://me:andthecorner@rubygems.org"), "/maven/releases/rubygems/virtus/1.0.5/virtus-1.0.5.pom"); // the cached dir does not expose the credentials assertCached(url, cached); // without the /maven/releases prefix url = new MavenGemURLConnection(factory, new URL("http://me:andthecorner@rubygems.org"), "/rubygems/virtus/1.0.5/virtus-1.0.5.pom"); // the cached dir does not expose the credentials assertCached(url, cached); } @Test public void virtusPomWithMirror() throws Exception { // this test goes online to rubygems.org File cached = new File(cacheDir, "http___rubygems_org/quick/Marshal.4.8/v/virtus-1.0.5.gemspec.rz"); RubygemsFactory factory = new RubygemsFactory(cacheDir, new URL("http://me:andthecorner@rubygems.org")); // with the /maven/releases prefix URLConnection url = new MavenGemURLConnection(factory, new URL("http://example.com"), "/maven/releases/rubygems/virtus/1.0.5/virtus-1.0.5.pom"); // the cached dir does not expose the credentials assertCached(url, cached); // without the /maven/releases prefix url = new MavenGemURLConnection(factory, new URL("http://example.com"), "/rubygems/virtus/1.0.5/virtus-1.0.5.pom"); // the cached dir does not expose the credentials assertCached(url, cached); } @Test public void virtusPomWithMirrors() throws Exception { // this test goes online to rubygems.org File cached = new File(cacheDir, "http___rubygems_org/quick/Marshal.4.8/v/virtus-1.0.5.gemspec.rz"); Map mirrors = new HashMap(); mirrors.put(new URL("http://example.com"), new URL("http://me:andthecorner@rubygems.org")); mirrors.put(new URL("http://hans:glueck@example.org"), new URL("http://rubygems.org")); RubygemsFactory factory = new RubygemsFactory(cacheDir, mirrors); // with the /maven/releases prefix URLConnection url = new MavenGemURLConnection(factory, new URL("http://example.com"), "/maven/releases/rubygems/virtus/1.0.5/virtus-1.0.5.pom"); // the cached dir does not expose the credentials assertCached(url, cached); // without the /maven/releases prefix url = new MavenGemURLConnection(factory, new URL("http://example.org"), "/rubygems/virtus/1.0.5/virtus-1.0.5.pom"); assertCached(url, cached); // go direct here cached = new File(cacheDir, "https___rubygems_org/quick/Marshal.4.8/v/virtus-1.0.5.gemspec.rz"); url = new MavenGemURLConnection(factory, new URL("https://rubygems.org"), "/rubygems/virtus/1.0.5/virtus-1.0.5.pom"); assertCached(url, cached); } private void assertCached(URLConnection url, File cached) throws Exception { cached.delete(); try (InputStream in = url.getInputStream()) { // just read the file byte[] data = new byte[in.available()]; in.read(data, 0, in.available()); } // the cached dir does not expose the credentials assertThat(cached.getPath(), cached.exists(), is(true)); } @Test public void ping() throws Exception { URLConnection url = new MavenGemURLConnection(new URL("https://rubygems.org/something"), "/maven/releases/ping"); byte[] data = new byte[4]; url.getInputStream().read(data, 0, 4); String result = new String(data); assertThat(result, is("pong")); } @Test public void railsMavenMetadata() throws Exception { // this test goes online to rubygems.org File cached = new File(cacheDir, "https___rubygems_org/api/v1/dependencies/rails.ruby"); cached.delete(); URLConnection url = new MavenGemURLConnection(factory, new URL("https://rubygems.org"), "/maven/releases/rubygems/rails/maven-metadata.xml"); String result = download(url); assertThat(result, startsWith("")); assertThat(result, containsString("4.2.5")); assertThat(result, endsWith("\n")); assertThat(cached.getPath(), cached.isFile(), is(true)); } String download(URLConnection url) throws Exception { try (InputStream in = url.getInputStream()) { byte[] data = new byte[in.available()]; in.read(data, 0, in.available()); return new String(data); } } @Test public void railsPom() throws Exception { // this test goes online to rubygems.org File cached = new File(cacheDir, "https___rubygems_org/quick/Marshal.4.8/r/rails-4.2.5.gemspec.rz"); cached.delete(); URLConnection url = new MavenGemURLConnection(factory, new URL("https://rubygems.org"), "/rubygems/rails/4.2.5/rails-4.2.5.pom"); String result = download(url); assertThat(result, startsWith("")); assertThat(result, containsString("4.2.5")); assertThat(result, containsString("Full-stack web application framework.")); assertThat(result, containsString("gem")); assertThat(result, endsWith("\n")); assertThat(cached.getPath(), cached.isFile(), is(true)); } @Test(expected = FileNotFoundException.class) public void fileNotFoundOnWrongBaseURL() throws Exception { // this test goes online to rubygems.org URLConnection url = new MavenGemURLConnection(factory, new URL("https://rubygems.org/something/not/right/here"), "/maven/releases/rubygems/rails/maven-metadata.xml"); url.getInputStream(); } @Test(expected = FileNotFoundException.class) public void fileNotFoundOnDirectory() throws Exception { // this test goes online to rubygems.org URLConnection url = new MavenGemURLConnection(factory, new URL("https://rubygems.org"), "/maven/releases/rubygems/rails"); url.getInputStream(); } } ././@LongLink0000644000000000000000000000020600000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-protocol/src/test/java/de/saumya/mojo/mavengem/RubygemsFactoryTest.java./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-protocol/src/test/java/de/saumya/mojo/0000644000000000000000000001066612674201751030127 0ustar package de.saumya.mojo.mavengem; import org.junit.Before; import org.junit.Test; import java.io.File; import java.io.FileNotFoundException; import java.io.InputStream; import java.util.Map; import java.util.HashMap; import java.net.URL; import java.net.URLConnection; import static org.junit.Assert.assertThat; import static org.hamcrest.CoreMatchers.containsString; import static org.hamcrest.CoreMatchers.endsWith; import static org.hamcrest.CoreMatchers.nullValue; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.startsWith; public class RubygemsFactoryTest { @Test public void defaultsOnDefaultFactory() throws Exception { RubygemsFactory.factory = null; System.getProperties().remove("mavengem.cachedir"); System.getProperties().remove("mavengem.mirror"); RubygemsFactory factory = RubygemsFactory.defaultFactory(); assertThat(factory.mirrors, nullValue()); assertThat(factory.catchAllMirror, is(RubygemsFactory.NO_MIRROR)); assertThat(factory.cacheDir.getName(), is(".mavengem")); } @Test public void defaultFactory() throws Exception { System.setProperty("mavengem.cachedir", "some/thing"); System.setProperty("mavengem.mirror", "https://example.org"); RubygemsFactory.factory = null; RubygemsFactory factory = RubygemsFactory.defaultFactory(); assertThat(factory.mirrors, nullValue()); assertThat(factory.catchAllMirror, is(new URL("https://example.org"))); assertThat(factory.cacheDir, is(new File("some/thing"))); } @Test public void defaultsOnInstance() throws Exception { RubygemsFactory factory = new RubygemsFactory(); assertThat(factory.mirrors, nullValue()); assertThat(factory.catchAllMirror, is(RubygemsFactory.NO_MIRROR)); assertThat(factory.cacheDir.getName(), is(".mavengem")); } @Test public void cachedir() throws Exception { RubygemsFactory factory = new RubygemsFactory(new File("some/thing")); assertThat(factory.mirrors, nullValue()); assertThat(factory.catchAllMirror, is(RubygemsFactory.NO_MIRROR)); assertThat(factory.cacheDir, is(new File("some/thing"))); } @Test public void mirror() throws Exception { RubygemsFactory factory = new RubygemsFactory(new URL("https://example.org")); assertThat(factory.mirrors, nullValue()); assertThat(factory.catchAllMirror, is(new URL("https://example.org"))); assertThat(factory.cacheDir.getName(), is(".mavengem")); } @Test public void mirrors() throws Exception { Map mirrors = new HashMap(); RubygemsFactory factory = new RubygemsFactory(mirrors); assertThat(factory.mirrors, is(mirrors)); assertThat(factory.catchAllMirror, is(RubygemsFactory.NO_MIRROR)); assertThat(factory.cacheDir.getName(), is(".mavengem")); } @Test public void cachedirAndMirror() throws Exception { RubygemsFactory factory = new RubygemsFactory(new File("some/thing"), new URL("https://example.org")); assertThat(factory.mirrors, nullValue()); assertThat(factory.catchAllMirror, is(new URL("https://example.org"))); assertThat(factory.cacheDir, is(new File("some/thing"))); } @Test public void cachedirAndMirrors() throws Exception { Map mirrors = new HashMap(); RubygemsFactory factory = new RubygemsFactory(new File("some/thing"), mirrors); assertThat(factory.mirrors, is(mirrors)); assertThat(factory.catchAllMirror, is(RubygemsFactory.NO_MIRROR)); assertThat(factory.cacheDir, is(new File("some/thing"))); } @Test(expected = IllegalArgumentException.class) public void cachedirAndMirrorsPrecondition() throws Exception { Map mirrors = new HashMap(); RubygemsFactory factory = new RubygemsFactory(null, mirrors); } @Test(expected = IllegalArgumentException.class) public void cachedirPrecondition() throws Exception { RubygemsFactory factory = new RubygemsFactory((File)null); } @Test(expected = IllegalArgumentException.class) public void mirrorPrecondition() throws Exception { RubygemsFactory factory = new RubygemsFactory((URL)null); } @Test(expected = IllegalArgumentException.class) public void cachedirAndMirrorPreconditionFile() throws Exception { RubygemsFactory factory = new RubygemsFactory((File)null, new URL("https://example.com")); } @Test(expected = IllegalArgumentException.class) public void cachedirAndMirrorPreconditionURL() throws Exception { RubygemsFactory factory = new RubygemsFactory(new File("some/thing"), (URL)null); } } ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-protocol/src/main/0000755000000000000000000000000012674201751024305 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-protocol/src/main/java/0000755000000000000000000000000012674201751025226 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-protocol/src/main/java/de/0000755000000000000000000000000012674201751025616 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-protocol/src/main/java/de/saumya/0000755000000000000000000000000012674201751027115 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-protocol/src/main/java/de/saumya/mojo/0000755000000000000000000000000012674201751030061 5ustar ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-protocol/src/main/java/de/saumya/mojo/mavengem/./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-protocol/src/main/java/de/saumya/mojo/0000755000000000000000000000000012674201751030061 5ustar ././@LongLink0000644000000000000000000000017300000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-protocol/src/main/java/de/saumya/mojo/mavengem/Rubygems.java./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-protocol/src/main/java/de/saumya/mojo/0000644000000000000000000000347112674201751030070 0ustar package de.saumya.mojo.mavengem; import java.io.File; import java.io.FileNotFoundException; import java.io.InputStream; import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; import java.util.HashMap; import java.util.Map; import org.jruby.embed.IsolatedScriptingContainer; import org.jruby.embed.ScriptingContainer; import org.sonatype.nexus.ruby.DefaultRubygemsGateway; import org.sonatype.nexus.ruby.RubygemsGateway; import org.sonatype.nexus.ruby.FileType; import org.sonatype.nexus.ruby.GemArtifactFile; import org.sonatype.nexus.ruby.IOUtil; import org.sonatype.nexus.ruby.RubygemsFile; import org.sonatype.nexus.ruby.cuba.RubygemsFileSystem; import org.sonatype.nexus.ruby.layout.CachingProxyStorage; import org.sonatype.nexus.ruby.layout.ProxiedRubygemsFileSystem; import org.sonatype.nexus.ruby.layout.ProxyStorage; public class Rubygems { private static RubygemsGateway gateway = new DefaultRubygemsGateway(new IsolatedScriptingContainer()); private static Map facades = new HashMap(); private final ProxyStorage storage; private final RubygemsFileSystem files; Rubygems(URL url, File baseCacheDir) { // we do not want to expose credentials inside the directory name File cachedir = new File(baseCacheDir, url.toString().replaceFirst("://[^:]+:[^:]+@", "://").replaceAll("[/:.]", "_")); this.storage = new CachingProxyStorage(cachedir, url); this.files = new ProxiedRubygemsFileSystem(gateway, storage); } public InputStream getInputStream(RubygemsFile file) throws IOException { return this.storage.getInputStream(file); } public RubygemsFile get(String path) { return this.files.get(path); } public long getModified(RubygemsFile file) { return this.storage.getModified(file); } } ././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-protocol/src/main/java/de/saumya/mojo/mavengem/RubygemsFactory.java./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-protocol/src/main/java/de/saumya/mojo/0000644000000000000000000001035612674201751030070 0ustar package de.saumya.mojo.mavengem; import java.io.File; import java.io.FileNotFoundException; import java.io.InputStream; import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; import java.util.HashMap; import java.util.Map; import org.jruby.embed.IsolatedScriptingContainer; import org.jruby.embed.ScriptingContainer; import org.sonatype.nexus.ruby.DefaultRubygemsGateway; import org.sonatype.nexus.ruby.RubygemsGateway; import org.sonatype.nexus.ruby.FileType; import org.sonatype.nexus.ruby.GemArtifactFile; import org.sonatype.nexus.ruby.IOUtil; import org.sonatype.nexus.ruby.RubygemsFile; import org.sonatype.nexus.ruby.cuba.RubygemsFileSystem; import org.sonatype.nexus.ruby.layout.CachingProxyStorage; import org.sonatype.nexus.ruby.layout.ProxiedRubygemsFileSystem; import org.sonatype.nexus.ruby.layout.ProxyStorage; public class RubygemsFactory { private static RubygemsGateway gateway = new DefaultRubygemsGateway(new IsolatedScriptingContainer()); private static Map facades = new HashMap(); static URL NO_MIRROR; static { try { NO_MIRROR = new URL("http://example.com/no_mirror"); } catch (MalformedURLException e) { throw new RuntimeException( "can not happen", e); } } public static File DEFAULT_CACHEDIR = new File(System.getProperty("user.home"), ".mavengem"); public static final String MAVENGEM_MIRROR = "mavengem.mirror"; public static final String MAVENGEM_CACHEDIR = "mavengem.cachedir"; // keep package access for testing final File cacheDir; final Map mirrors; final URL catchAllMirror; static RubygemsFactory factory; public static synchronized RubygemsFactory defaultFactory() throws MalformedURLException { if (factory == null) { factory = new RubygemsFactory(null, null, null, false); } return factory; } public RubygemsFactory() throws MalformedURLException { this(DEFAULT_CACHEDIR, NO_MIRROR, null); } public RubygemsFactory(URL mirror) throws MalformedURLException { this(DEFAULT_CACHEDIR, mirror, null); } public RubygemsFactory(Map mirrors) throws MalformedURLException { this(DEFAULT_CACHEDIR, NO_MIRROR, mirrors); } public RubygemsFactory(File cacheDir) throws MalformedURLException { this(cacheDir, NO_MIRROR, null); } public RubygemsFactory(File cacheDir, URL mirror) throws MalformedURLException { this(cacheDir, mirror, null); } public RubygemsFactory(File cacheDir, Map mirrors) throws MalformedURLException { this(cacheDir, NO_MIRROR, mirrors); } private RubygemsFactory(File cacheDir, URL mirror, Map mirrors) throws MalformedURLException { this(cacheDir, mirror, mirrors, true); } private RubygemsFactory(File cacheDir, URL mirror, Map mirrors, boolean check) throws MalformedURLException { if (check) { if (cacheDir == null) { throw new IllegalArgumentException("cache directory can not be null"); } if (mirror == null) { throw new IllegalArgumentException("mirror can not be null"); } } if (mirror != null) { this.catchAllMirror = mirror; } else { if (System.getProperty(MAVENGEM_MIRROR) != null) { this.catchAllMirror = new URL(System.getProperty(MAVENGEM_MIRROR)); } else { this.catchAllMirror = NO_MIRROR; } } this.mirrors = mirrors == null ? null : new HashMap(mirrors); if (cacheDir != null) { this.cacheDir = cacheDir; } else if (System.getProperty(MAVENGEM_CACHEDIR) != null) { this.cacheDir = new File(System.getProperty(MAVENGEM_CACHEDIR)); } else { this.cacheDir = DEFAULT_CACHEDIR; } } public Rubygems getOrCreate(URL url) throws MalformedURLException { if (this.catchAllMirror != NO_MIRROR) { url = this.catchAllMirror; } else if (this.mirrors != null && this.mirrors.containsKey(url)) { url = mirrors.get(url); } // FIXME the cachedir when coming from the facades map // can be different as map get shared between factories synchronized(facades) { Rubygems result = facades.get(url); if (result == null) { result = new Rubygems(url, this.cacheDir); facades.put(url, result); } return result; } } } ././@LongLink0000644000000000000000000000021000000000000011574 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-protocol/src/main/java/de/saumya/mojo/mavengem/MavenGemURLConnection.java./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-protocol/src/main/java/de/saumya/mojo/0000644000000000000000000001027112674201751030064 0ustar package de.saumya.mojo.mavengem; import java.io.ByteArrayInputStream; import java.io.FileNotFoundException; import java.io.InputStream; import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; import java.net.URLConnection; import java.nio.file.NoSuchFileException; import org.sonatype.nexus.ruby.FileType; import org.sonatype.nexus.ruby.GemArtifactFile; import org.sonatype.nexus.ruby.IOUtil; import org.sonatype.nexus.ruby.RubygemsFile; import org.sonatype.nexus.ruby.cuba.RubygemsFileSystem; import org.sonatype.nexus.ruby.layout.Storage; public class MavenGemURLConnection extends URLConnection { public static final String MAVEN_RELEASES = "/maven/releases"; public static final String PING = MAVEN_RELEASES + "/ping"; private InputStream in; private long timestamp = -1; // package private for testing final URL baseurl; final String path; final RubygemsFactory factory; public static MavenGemURLConnection create(String uri) throws MalformedURLException { return create(null, uri); } public static MavenGemURLConnection create(RubygemsFactory factory, String uri) throws MalformedURLException { int index = uri.indexOf(MAVEN_RELEASES); String path = uri.substring(index); String baseurl = uri.substring(0, index); return new MavenGemURLConnection(factory, new URL(baseurl), path); } public MavenGemURLConnection(URL baseurl, String path) throws MalformedURLException { this(null, baseurl, path); } public MavenGemURLConnection(RubygemsFactory factory, URL baseurl, String path) throws MalformedURLException { super(baseurl); this.factory = factory == null ? RubygemsFactory.defaultFactory() : factory; this.baseurl = baseurl; this.path = path.startsWith(MAVEN_RELEASES) ? path : MAVEN_RELEASES + path; } @Override synchronized public InputStream getInputStream() throws IOException { if (in == null) { connect(); } return in; } synchronized public long getModified() throws IOException { if (timestamp == -1) { connect(); } return timestamp; } private int counter = 12; // seconds @Override synchronized public void connect() throws IOException { connect(factory.getOrCreate(baseurl)); } private void connect(Rubygems facade) throws IOException { RubygemsFile file = facade.get(path); switch( file.state() ) { case FORBIDDEN: throw new IOException("forbidden: " + file + " on " + baseurl); case NOT_EXISTS: if (path.equals(PING)) { in = new ByteArrayInputStream("pong".getBytes()); break; } throw new FileNotFoundException(file.toString() + " on " + baseurl); case NO_PAYLOAD: switch( file.type() ) { case GEM_ARTIFACT: // we can pass in null as dependenciesData since we have already the gem in = new URL(baseurl + "/gems/" + ((GemArtifactFile) file ).gem( null ).filename() + ".gem" ).openStream(); case GEM: // TODO timestamp in = new URL(baseurl + "/" + file.remotePath()).openStream(); default: throw new FileNotFoundException("view - not implemented. " + file + " on " + baseurl + " on " + baseurl); } case ERROR: if (file.getException() instanceof NoSuchFileException) { throw new FileNotFoundException(file.toString() + " on " + baseurl); } throw new IOException(file.toString() + " on " + baseurl, file.getException()); case TEMP_UNAVAILABLE: try { Thread.currentThread().sleep(1000); } catch(InterruptedException ignore) { } if (--counter > 0) { connect(facade); } break; case PAYLOAD: in = facade.getInputStream(file); timestamp = facade.getModified(file); break; case NEW_INSTANCE: default: throw new RuntimeException("BUG: should never reach here. " + file + " on " + baseurl); } } } ././@LongLink0000644000000000000000000000017200000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-protocol/src/main/java/de/saumya/mojo/mavengem/Handler.java./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-protocol/src/main/java/de/saumya/mojo/0000644000000000000000000000460112674201751030064 0ustar package de.saumya.mojo.mavengem; import java.io.ByteArrayInputStream; import java.io.File; import java.io.InputStream; import java.io.IOException; import java.util.Map; import java.net.MalformedURLException; import java.net.URL; import java.net.URLConnection; import java.net.URLStreamHandler; public class Handler extends URLStreamHandler { public static String KEY = "java.protocol.handler.pkgs"; public static String PKG = "de.saumya.mojo"; public static String PING_URL = "mavengem:https://rubygems.org" + MavenGemURLConnection.PING; private static RubygemsFactory factory; public synchronized static boolean isMavenGemProtocolRegistered() { return System.getProperties().contains(KEY); } public synchronized static boolean registerMavenGemProtocol() throws MalformedURLException { return registerMavenGemProtocol(RubygemsFactory.defaultFactory()); } public synchronized static boolean registerMavenGemProtocol(RubygemsFactory rubygemsFactory) { if (ping()) { // we can register the protocol only once return false; } factory = rubygemsFactory; if (System.getProperties().contains(KEY)) { String current = System.getProperty(KEY); if (!current.contains(PKG)) { System.setProperty(KEY, current + "|" + PKG); } } else { System.setProperty(KEY, PKG); } return ping(); } private static boolean ping() { try { // this url works offline as /maven/releases/ping is // not a remote resource. but using the protocol here // will register this instance Handler and other // classloaders will be able to use the mavengem-protocol as well // this does not go online see MavenGemURLConnection URL url = new URL(PING_URL); try (InputStream in = url.openStream()) { byte[] data = new byte[in.available()]; in.read(data, 0, data.length); return "pong".equals(new String(data)); } } catch(IOException e) { return false; } } private String uri; @Override protected void parseURL(URL u, String spec, int start, int end) { uri = spec.substring(start, end); super.parseURL(u, spec, start, end); } @Override protected URLConnection openConnection(URL url) throws IOException { return MavenGemURLConnection.create(factory, uri); } } ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-protocol/README.md0000644000000000000000000000444512674201751024060 0ustar # mavengem protocol convert a rubygems repository into a maven repository. ## usage via protocol handler ``` de.saumya.mojo.mavengem.Handler.registerMavenGemProtocol() URL url = new URL("mavengem:https://rubygems.org/maven/releases/rubygems/rails/maven-metadata.xml"); ``` here https://rubygems.org is a rubgems repository the path "/maven/releases/rubygems/rails/maven-metadata.xml" does not exist there but the mavengem protocol adds it on the fly using metadata from the rubygems repository. for configuration pass in a ```RubygemsFactory``` ``` RubygemsFactory factory = ... Handler.registerMavenGemProtocol(factory) ``` more details belowsee below for the configuration options. the protocol handler can be registered only once. ## use the MavenGemURLConnection directly ``` URLConnection con = new de.saumya.mojo.mavengem.MavenGemURLConnection(new URL("https://rubygems.org"), "/maven/releases/rubygems/rails/maven-metadata.xml") ``` it is also possible to leave the basepath ``` MavenGemURLConnection(new URL("https://rubygems.org", "/rubygems/rails/maven-metadata.xml") ``` for configuration again via a ```RubygemsFactory``` ``` RubygemsFactory factory = ... MavenGemURLConnection(factory, new URL("https://rubygems.org"), "/rubygems/rails/maven-metadata.xml") ``` ## configuration when not using a explicit ```RubygemsFactory``` a default factory is used. ### configure the default RubygemsFactory this is done via system properties. the default cache directory is **$HOME/.mavengem**. to change this to something else use the system property **mavengem.cachedir**. to change the mirror setting use the system property **mavengem.mirror**. setting this means that **ALL** request go through this mirror whether it is a request to rubygems.org or to any other rubygems repository. to have more control over the mirrors, i.e. one mirror per domain, you need to use an explicit ```RubygemsFactory``` to configure it. ### configure RubygemsFactory whenever you use an instance of ```RubygemsFactory``` no system properties are used to configure it, only the constructor arguments. here you can set the cache directory and the "catch-all-mirror" as with the default ```RubygemsFactory``` via the system properties. and you also can pass in a ```Map``` which can map a given rubygems repository url to mirror. ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-protocol/pom.xml0000644000000000000000000000160312674201751024107 0ustar 4.0.0 mavengem de.saumya.mojo 0.2.0-SNAPSHOT mavengem-protocol jar Protocol Handler for mavengem: org.sonatype.nexus.plugins nexus-ruby-tools 2.11.4-01 junit junit 4.12 test ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/pom.xml0000644000000000000000000000306412674201751020454 0ustar 4.0.0 org.sonatype.oss oss-parent 9 de.saumya.mojo mavengem 0.2.0-SNAPSHOT pom Mavengem protocol and mavengem wagon mavengem-protocol mavengem-wagon maven-invoker-plugin 2.0.0 ${project.build.directory}/it true integration-test install run maven-compiler-plugin 3.3 1.7 1.7 ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-wagon/0000755000000000000000000000000012674201751022044 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-wagon/src/0000755000000000000000000000000012674201751022633 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-wagon/src/main/0000755000000000000000000000000012674201751023557 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-wagon/src/main/java/0000755000000000000000000000000012674201751024500 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-wagon/src/main/java/de/0000755000000000000000000000000012674201751025070 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-wagon/src/main/java/de/saumya/0000755000000000000000000000000012674201751026367 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-wagon/src/main/java/de/saumya/mojo/0000755000000000000000000000000012674201751027333 5ustar ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-wagon/src/main/java/de/saumya/mojo/mavengem/./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-wagon/src/main/java/de/saumya/mojo/mav0000755000000000000000000000000012674201751030037 5ustar ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-wagon/src/main/java/de/saumya/mojo/mavengem/wagon/./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-wagon/src/main/java/de/saumya/mojo/mav0000755000000000000000000000000012674201751030037 5ustar ././@LongLink0000644000000000000000000000020300000000000011576 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-wagon/src/main/java/de/saumya/mojo/mavengem/wagon/MavenGemWagon.java./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-wagon/src/main/java/de/saumya/mojo/mav0000644000000000000000000001302512674201751030042 0ustar package de.saumya.mojo.mavengem.wagon; import java.io.File; import java.io.FileNotFoundException; import java.io.InputStream; import java.io.OutputStream; import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; import java.net.URLConnection; import java.net.InetSocketAddress; import java.net.Proxy; import java.net.Proxy.Type; import java.net.SocketAddress; import java.util.Map; import java.util.HashMap; import java.util.Properties; import java.util.regex.Matcher; import java.util.regex.Pattern; import org.apache.maven.wagon.StreamWagon; import org.apache.maven.wagon.Wagon; import org.apache.maven.wagon.InputData; import org.apache.maven.wagon.OutputData; import org.apache.maven.wagon.authentication.AuthenticationException; import org.apache.maven.wagon.ConnectionException; import org.apache.maven.wagon.TransferFailedException; import org.apache.maven.wagon.resource.Resource; import org.apache.maven.wagon.ResourceDoesNotExistException; import org.apache.maven.wagon.authorization.AuthorizationException; import org.apache.maven.wagon.proxy.ProxyInfo; import de.saumya.mojo.mavengem.RubygemsFactory; import de.saumya.mojo.mavengem.MavenGemURLConnection; public class MavenGemWagon extends StreamWagon { public static final String MAVEN_GEM_PREFIX = "mavengem:"; private Proxy proxy = Proxy.NO_PROXY; private RubygemsFactory _factory_; // configurable via the settings.xml private File cachedir; private String mirror; private void warn(String msg) { System.err.println("WARNING: " + msg); } @Override public void fillInputData(InputData inputData) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException { Resource resource = inputData.getResource(); try { if (proxy != Proxy.NO_PROXY) { warn("proxy support is not implemented - ignoring proxy settings"); } URLConnection urlConnection = newConnection(resource.getName()); InputStream is = urlConnection.getInputStream(); inputData.setInputStream(is); resource.setLastModified(urlConnection.getLastModified()); resource.setContentLength(urlConnection.getContentLength()); } catch(MalformedURLException e) { throw new TransferFailedException("Invalid repository URL: " + e.getMessage(), e); } catch(FileNotFoundException e) { throw new ResourceDoesNotExistException("Unable to locate resource in repository", e); } catch(IOException e) { throw new TransferFailedException("Error transferring file: " + e.getMessage(), e); } } private RubygemsFactory rubygemsFactory() throws MalformedURLException { if (_factory_ == null) { // use the default if not set if (cachedir == null) { cachedir = RubygemsFactory.DEFAULT_CACHEDIR; } if (mirror != null) { _factory_ = new RubygemsFactory(cachedir, withAuthentication(mirror)); } else { _factory_ = new RubygemsFactory(cachedir); } } return _factory_; } public URLConnection newConnection(String resourceName) throws MalformedURLException { return new MavenGemURLConnection(rubygemsFactory(), getRepositoryURL(), "/" + resourceName); } @Override public boolean resourceExists(String resourceName) throws TransferFailedException, AuthorizationException { try { newConnection(resourceName).connect(); return true; } catch (FileNotFoundException e) { return false; } catch(MalformedURLException e) { throw new TransferFailedException("Invalid repository URL: " + e.getMessage(), e); } catch (IOException e) { throw new TransferFailedException("Error transferring file: " + e.getMessage(), e); } } @Override public void fillOutputData(OutputData outputData) throws TransferFailedException { throw new RuntimeException("only download is provided"); } @Override public void closeConnection() throws ConnectionException { } private URL withAuthentication(String url) throws MalformedURLException { if (authenticationInfo != null && authenticationInfo.getUserName() != null) { String credentials = authenticationInfo.getUserName() + ":" + authenticationInfo.getPassword(); url = url.replaceFirst("^(https?://)(.*)$", "$1" + credentials + "@$2"); } return new URL(url); } private URL getRepositoryURL() throws MalformedURLException { String url = getRepository().getUrl().substring(MAVEN_GEM_PREFIX.length()); return withAuthentication(url); } private Proxy getProxy(ProxyInfo proxyInfo) { return new Proxy(getProxyType(proxyInfo), getSocketAddress(proxyInfo)); } private Type getProxyType(ProxyInfo proxyInfo) { if (ProxyInfo.PROXY_SOCKS4.equals(proxyInfo.getType()) || ProxyInfo.PROXY_SOCKS5.equals(proxyInfo.getType())) { return Type.SOCKS; } else { return Type.HTTP; } } private SocketAddress getSocketAddress(ProxyInfo proxyInfo) { return InetSocketAddress.createUnresolved(proxyInfo.getHost(), proxyInfo.getPort()); } @Override protected void openConnectionInternal() throws ConnectionException, AuthenticationException { try { final ProxyInfo proxyInfo = getProxyInfo(getRepositoryURL().getProtocol(), getRepository().getHost()); if (proxyInfo != null) { this.proxy = getProxy( proxyInfo ); } } catch (MalformedURLException e) { throw new ConnectionException("cannot create repository url", e); } } } ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-wagon/src/main/resources/0000755000000000000000000000000012674201751025571 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-wagon/src/main/resources/META-INF/0000755000000000000000000000000012674201751026731 5ustar ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-wagon/src/main/resources/META-INF/plexus/./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-wagon/src/main/resources/META-INF/plex0000755000000000000000000000000012674201751027622 5ustar ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-wagon/src/main/resources/META-INF/plexus/components.xml./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-wagon/src/main/resources/META-INF/plex0000644000000000000000000000051412674201751027624 0ustar org.apache.maven.wagon.Wagon mavengem de.saumya.mojo.mavengem.wagon.MavenGemWagon per-lookup ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-wagon/src/it/0000755000000000000000000000000012674201751023247 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-wagon/src/it/mirror/0000755000000000000000000000000012674201751024561 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-wagon/src/it/mirror/pom.xml0000644000000000000000000000234512674201751026102 0ustar 4.0.0 mirror de.saumya.mojo.test 0.1.0 rubygems jar-dependencies 0.2.6 gem mavengems-with-mirror mavengem:http://rubygems.org central http://central true true de.saumya.mojo mavengem-wagon @project.version@ ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-wagon/src/it/mirror/postbuild.groovy0000644000000000000000000000150512674201751030036 0ustar import java.io.* import org.codehaus.plexus.util.FileUtils String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); [ "Downloaded: mavengem:http://rubygems.org/rubygems/jar-dependencies/0.2.6/jar-dependencies-0.2.6.pom", "Downloaded: mavengem:http://rubygems.org/rubygems/jar-dependencies/0.2.6/jar-dependencies-0.2.6.gem" ].each { if ( !log.contains( it ) ) throw new RuntimeException( "log file does not contain '" + it + "'" ); } [ 'target/cachedir/https___rubygems_org/api/v1/dependencies/jar-dependencies.ruby', 'target/cachedir/https___rubygems_org//gems/j/jar-dependencies-0.2.6.gem', 'target/cachedir/https___rubygems_org//quick/Marshal.4.8/j/jar-dependencies-0.2.6.gemspec.rz' ].each { if ( !new File(basedir, it).exists() ) throw new RuntimeException( "expected file missing: '" + it + "'" ); } true ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-wagon/src/it/mirror/prebuild.groovy0000644000000000000000000000007612674201751027641 0ustar new File("${localRepositoryPath}/rubygems").deleteDir() true ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-wagon/src/it/no_mirror/0000755000000000000000000000000012674201751025255 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-wagon/src/it/no_mirror/pom.xml0000644000000000000000000000235412674201751026576 0ustar 4.0.0 no-mirror de.saumya.mojo.test 0.1.0 rubygems jar-dependencies 0.2.6 gem mavengems-without-mirror mavengem:https://rubygems.org central http://central true true de.saumya.mojo mavengem-wagon @project.version@ ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-wagon/src/it/no_mirror/postbuild.groovy./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-wagon/src/it/no_mirror/postbuild.groov0000644000000000000000000000150712674201751030343 0ustar import java.io.* import org.codehaus.plexus.util.FileUtils String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); [ "Downloaded: mavengem:https://rubygems.org/rubygems/jar-dependencies/0.2.6/jar-dependencies-0.2.6.pom", "Downloaded: mavengem:https://rubygems.org/rubygems/jar-dependencies/0.2.6/jar-dependencies-0.2.6.gem" ].each { if ( !log.contains( it ) ) throw new RuntimeException( "log file does not contain '" + it + "'" ); } [ 'target/cachedir/https___rubygems_org/api/v1/dependencies/jar-dependencies.ruby', 'target/cachedir/https___rubygems_org//gems/j/jar-dependencies-0.2.6.gem', 'target/cachedir/https___rubygems_org//quick/Marshal.4.8/j/jar-dependencies-0.2.6.gemspec.rz' ].each { if ( !new File(basedir, it).exists() ) throw new RuntimeException( "expected file missing: '" + it + "'" ); } true ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-wagon/src/it/no_mirror/prebuild.groovy0000644000000000000000000000007612674201751030335 0ustar new File("${localRepositoryPath}/rubygems").deleteDir() true ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-wagon/src/it/settings.xml0000644000000000000000000000204612674201751025633 0ustar mavengems-without-mirror my_login my_password ${user.dir}/target/cachedir mavengems-with-mirror my_login my_password ${user.dir}/target/cachedir https://rubygems.org it-repo true local.central @localRepositoryUrl@ true true ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-wagon/README.md0000644000000000000000000000421512674201751023325 0ustar # mavengem wagon extend maven to use mavengem-protocol for configuring a rubygems repository. this allows to use gem-artifacts as dependencies. ## usage pom.xml setup ``` ... mavengems mavengem:http://rubygems.org de.saumya.mojo mavengem-wagon 0.1.0 ``` the same with POM using ruby-DSL ``` repository :id => :mavengems, :url => 'mavengem:http://rubygems.org' extension 'de.saumya.mojo:mavengem-wagon:0.1.0' ``` the wagon extension allos the use of the **mavengem:** protocol in the repository url. ## configuration the configuration happens inside settings.xml (default location is $HOME/.m2/settings.xml) and uses the **id** from the repository to allow further configurations. ### cache directory for the mavengem protocol ``` mavengems ${user.home}/.cachedir ``` ### username/password authentication PENDING wating for a new release for the underlying nexus-ruby-tools library to get this feature working ``` mavengems my_login my_password ``` ### mirror use a mirror for the configured server ``` mavengems https://rubygems.org ``` the usename and password in a configuration with mirror will be used for the mirror: ``` mavengems my_login my_password https://rubygems.org ``` ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/mavengem/mavengem-wagon/pom.xml0000644000000000000000000000221712674201751023363 0ustar 4.0.0 mavengem de.saumya.mojo 0.2.0-SNAPSHOT mavengem-wagon Mavengem Protocol Wagon de.saumya.mojo mavengem-protocol ${project.version} org.apache.maven.wagon wagon-provider-api 2.10 maven-invoker-plugin ${project.build.directory}/localrepo src/it/settings.xml ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/README.md0000644000000000000000000000312712674201751016617 0ustar # jruby maven plugins and extensions the plugins and extensions are modeled after [jruby-gradle](http://jruby-gradle.github.io/) and uses the old jruby maven plugins under the hood but it needs jruby-1.7.19 or newer (including jruby-9.0.0.0 serie). even though the plugin depends on the old jruby-maven-plugins it has a different version. ## general command line switches to see the java/jruby command the plugin is executing use (for example with the verify goal) ```mvn verify -Djruby.verbose``` to quickly pick another jruby version use ```mvn verify -Djruby.version=1.7.20``` ## jruby9-exec-maven-plugin it install the gems and jars from ALL scopes and the plugin sections and can execute ruby. execution can be * inline ruby: ```-e 'puts JRUBY_VERSION'``` * via command installed via a gem: ```-S rake -T``` * a ruby script: ```my.rb``` see more at [jruby9-exec-maven-plugin](jruby9-exec-maven-plugin) ## jruby9-jar-maven-plugin it packs all gems and jars from the compile/runtime as well the declared resources into runnable jar. execution will with packed jar * inline ruby: ```java -jar my.jar -e 'puts JRUBY_VERSION'``` * via command installed via a gem: ```java -jar my.jar -S rake -T``` * a ruby script: ```java -jar my.jar my.rb``` see more at [jruby9-jar-maven-plugin](jruby9-jar-maven-plugin) ## jruby9-jar-extension it produces the same jar as with jruby9-jar-plugin but the configuration is more compact using a maven extension. see more at [jruby9-jar-extension](jruby9-jar-extension) # meta-fu create an issue if something feels not right [issues/new](issues/new) otherwise enjoy :) ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/pom.xml0000644000000000000000000000663112674201751016660 0ustar 4.0.0 org.sonatype.oss oss-parent 9 de.saumya.mojo jruby9 0.2.3-SNAPSHOT pom JRuby9 Next Generation Maven Mojo mavengem jruby9-common jruby9-exec-maven-plugin jruby9-jar-maven-plugin jruby9-war-maven-plugin jruby9-extensions ${project.groupId} gem-maven-plugin 1.1.3 org.apache.maven maven-core 3.3.3 org.codehaus.plexus plexus-archiver 3.0.1 org.apache.maven.plugins maven-war-plugin 2.6 org.apache.maven.plugins maven-jar-plugin 2.6 de.saumya.mojo jruby9-common ${project.version} org.apache.maven.plugin-tools maven-plugin-annotations 3.4 maven-invoker-plugin 2.0.0 ${project.build.directory}/it true integration-test install run maven-compiler-plugin 3.3 1.7 1.7 maven-plugin-plugin 3.4 default-descriptor process-classes generated-helpmojo helpmojo ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/0000755000000000000000000000000012674201751021733 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/0000755000000000000000000000000012674201751022522 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/main/0000755000000000000000000000000012674201751023446 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/main/java/0000755000000000000000000000000012674201751024367 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/main/java/de/0000755000000000000000000000000012674201751024757 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/main/java/de/saumya/0000755000000000000000000000000012674201751026256 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/main/java/de/saumya/mojo/0000755000000000000000000000000012674201751027222 5ustar ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/main/java/de/saumya/mojo/jruby9/./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/main/java/de/saumya/mojo/jru0000755000000000000000000000000012674201751027743 5ustar ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/main/java/de/saumya/mojo/jruby9/jar/./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/main/java/de/saumya/mojo/jru0000755000000000000000000000000012674201751027743 5ustar ././@LongLink0000644000000000000000000000017500000000000011606 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/main/java/de/saumya/mojo/jruby9/jar/ProcessMojo.java./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/main/java/de/saumya/mojo/jru0000644000000000000000000000102712674201751027745 0ustar package de.saumya.mojo.jruby9.jar; import org.apache.maven.plugins.annotations.LifecyclePhase; import org.apache.maven.plugins.annotations.Mojo; import de.saumya.mojo.jruby9.AbstractProcessMojo; /** * generates ".jrubydir" files for all resource and gems to allow jruby * to perform directory globs inside the jar. * * @author christian * */ @Mojo( name = "process", defaultPhase = LifecyclePhase.PROCESS_RESOURCES, requiresProject = true, threadSafe = true ) public class ProcessMojo extends AbstractProcessMojo { }././@LongLink0000644000000000000000000000017100000000000011602 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/main/java/de/saumya/mojo/jruby9/jar/JarMojo.java./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/main/java/de/saumya/mojo/jru0000644000000000000000000000772712674201751027762 0ustar package de.saumya.mojo.jruby9.jar; import java.io.File; import java.lang.reflect.Field; import org.apache.maven.archiver.MavenArchiveConfiguration; import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugins.annotations.Component; import org.apache.maven.plugins.annotations.LifecyclePhase; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.plugins.annotations.ResolutionScope; import org.apache.maven.repository.RepositorySystem; import org.codehaus.plexus.archiver.UnArchiver; import de.saumya.mojo.jruby9.ArtifactHelper; import de.saumya.mojo.jruby9.ArchiveType; import de.saumya.mojo.jruby9.Versions; /** * packs a ruby application into runnable jar. * *
  • shaded jruby-complete.jar
  • *
  • shaded jruby-mains.jar
  • *
  • all declared gems and transitive gems and jars
  • *
  • all declared jars and transitive jars
  • *
  • all declared resource
  • * * the main class sets up the GEM_HOME, GEM_PATH and JARS_HOME and takes arguments * for executing jruby. any bin stubs from the gem are available via '-S' or any * script relative to jar's root can be found as the current directory is inside the jar. * *
    * * if there is a 'jar-bootstrap.rb' in the root of the jar, then the default main class will * execute this script and pass all the arguments to bootstrap script. * * @author christian */ @Mojo( name = "jar", defaultPhase = LifecyclePhase.PACKAGE, requiresProject = true, threadSafe = true, requiresDependencyResolution = ResolutionScope.RUNTIME ) public class JarMojo extends org.apache.maven.plugin.jar.JarMojo { @Parameter( defaultValue = "runnable", property = "jruby.archive.type", required = true ) private ArchiveType type; @Parameter( defaultValue = "org.jruby.mains.JarMain", required = false ) private String mainClass; @Parameter( defaultValue = Versions.JRUBY, property = "jruby.version", required = true ) private String jrubyVersion; @Parameter( defaultValue = Versions.JRUBY_MAINS, property = "jruby.mains.version", required = true ) private String jrubyMainsVersion; @Parameter( readonly = true, defaultValue="${localRepository}" ) protected ArtifactRepository localRepository; @Component RepositorySystem system; @Component( hint = "zip" ) UnArchiver unzip; @Override public void execute() throws MojoExecutionException { switch(type) { case runnable: if (mainClass == null) { throw new MojoExecutionException( "runnable archive need mainClass configured" ); } MavenArchiveConfiguration archive = getArchive(); archive.getManifest().setMainClass(mainClass); ArtifactHelper helper = new ArtifactHelper(unzip, system, localRepository, getProject().getRemoteArtifactRepositories()); File output = new File( getProject().getBuild().getOutputDirectory()); helper.unzip(output, "org.jruby", "jruby-complete", jrubyVersion); helper.unzip(output, "org.jruby.mains", "jruby-mains", jrubyMainsVersion); case archive: break; default: throw new MojoExecutionException("can not pack archive " + type + " with jruby-jar-plugin"); } super.execute(); } private MavenArchiveConfiguration getArchive() throws MojoExecutionException { try { Field archiveField = getClass().getSuperclass().getSuperclass().getDeclaredField("archive"); archiveField.setAccessible(true); return (MavenArchiveConfiguration) archiveField.get(this); } catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) { throw new MojoExecutionException("can not use reflection", e); } } } ././@LongLink0000644000000000000000000000017600000000000011607 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/main/java/de/saumya/mojo/jruby9/jar/GenerateMojo.java./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/main/java/de/saumya/mojo/jru0000644000000000000000000000414312674201751027747 0ustar package de.saumya.mojo.jruby9.jar; import java.io.File; import java.io.IOException; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugins.annotations.LifecyclePhase; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.plugins.annotations.ResolutionScope; import org.codehaus.plexus.util.FileUtils; import de.saumya.mojo.jruby9.ArchiveType; import de.saumya.mojo.jruby9.AbstractGenerateMojo; import de.saumya.mojo.ruby.script.ScriptException; /** * add the gems and jars to resources. @see AbstractGenerateMojo * *
    * * also copies the bootstrap script to the resources if set. * * @author christian */ @Mojo( name = "generate", defaultPhase = LifecyclePhase.GENERATE_RESOURCES, requiresProject = true, threadSafe = true, requiresDependencyResolution = ResolutionScope.RUNTIME ) public class GenerateMojo extends AbstractGenerateMojo { @Parameter( defaultValue = "runnable", property = "jruby.archive.type", required = true ) private ArchiveType type; @Parameter( required = false ) private Boolean pluginDependenciesOnly; /** * if set this file will be copied as 'jar-bootstrap.rb' to the resources. */ @Parameter( property = "jruby.jar.bootstrap" ) protected File bootstrap; @Override protected void executeWithGems() throws MojoExecutionException, ScriptException, IOException { final boolean pluginDependenciesOnly; switch(type) { case archive: if (this.pluginDependenciesOnly == null) { pluginDependenciesOnly = true; } else { pluginDependenciesOnly = this.pluginDependenciesOnly; } break; default: pluginDependenciesOnly = false; } executeWithGems(pluginDependenciesOnly); if (bootstrap != null) { FileUtils.copyFile(bootstrap, new File(project.getBuild().getOutputDirectory(), "jar-bootstrap.rb")); } } } ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/it/0000755000000000000000000000000012674201751023136 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/it/jrubyJarRunnable/0000755000000000000000000000000012674201751026415 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/it/jrubyJarRunnable/pom.xml0000644000000000000000000001235012674201751027733 0ustar 4.0.0 de.saumya.mojo.jruby9 test testing mavengems mavengem:https://rubygems.org mavengems mavengem:https://rubygems.org org.slf4j slf4j-api 1.7.6 rubygems leafy-rack 0.4.0 gem rubygems minitest 5.7.0 gem 1.7.21 de.saumya.mojo mavengem-wagon 0.1.0 ${basedir} test.rb spec/** maven-jar-plugin 2.4 default-jar omit de.saumya.mojo jruby9-jar-maven-plugin @project.version@ ${j.version} jruby-jar generate process jar rubygems rspec 3.3.0 gem org.slf4j slf4j-simple 1.7.6 org.codehaus.mojo exec-maven-plugin 1.2 java ${project.build.directory} path blabla ${basedir} ${basedir} ${basedir} simple verify exec -jar ${project.build.finalName}.jar -rjars/setup -e p JRUBY_VERSION p $CLASSPATH.size expected = 10 raise "expected #{expected} classpath entries but got #{$CLASSPATH.size}: #{$CLASSPATH.inspect}" if $CLASSPATH.size != expected raise "expected jruby version ${j.version} but was #{JRUBY_VERSION}" if JRUBY_VERSION != "${j.version}" rspec verify exec -jar ${project.build.finalName}.jar -S rspec test file verify exec -jar ${project.build.finalName}.jar test.rb ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/it/jrubyJarRunnable/spec/0000755000000000000000000000000012674201751027347 5ustar ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/it/jrubyJarRunnable/spec/one_spec.rb./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/it/jrubyJarRunnable/spec/one0000644000000000000000000000054712674201751030061 0ustar require 'jar-dependencies' describe 'something' do it 'runs inside the right environment' do expect(Dir.pwd).to eq 'uri:classloader://' expect(__FILE__).to eq 'uri:classloader:/spec/one_spec.rb' expect(Jars.home).to eq 'uri:classloader://jars' expect(Gem.dir).to eq 'uri:classloader://META-INF/jruby.home/lib/ruby/gems/shared' end end ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/it/jrubyJarRunnable/test.rb0000644000000000000000000000140112674201751027715 0ustar gem 'minitest' require 'minitest/autorun' require 'jars/setup' describe 'something' do it 'uses the right minitest version' do Gem.loaded_specs['minitest'].version.to_s.must_equal '5.7.0' end it 'runs from the jar' do __FILE__.must_equal 'test.rb' Dir.pwd.must_equal 'uri:classloader://' end it 'can use logger' do old = java.lang.System.err bytes = StringIO.new java.lang.System.err = java.io.PrintStream.new( bytes.to_outputstream ) begin # TODO capture java stderr and ensure there is no warning org.slf4j.LoggerFactory.get_logger('me').info 'hello' java.lang.System.err.flush bytes.string.strip.must_equal '[main] INFO me - hello' ensure java.lang.System.err = old end end end ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/it/jrubyJarRunnable/invoker.properties./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/it/jrubyJarRunnable/invoker.0000644000000000000000000000006312674201751030072 0ustar invoker.goals = verify invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/it/jrubyJarArchive/0000755000000000000000000000000012674201751026230 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/it/jrubyJarArchive/pom.xml0000644000000000000000000000110012674201751027535 0ustar 4.0.0 de.saumya.mojo.jruby9 archive-test aggregate achive tests testing pom archive test-runnable test-jar ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/it/jrubyJarArchive/invoker.properties./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/it/jrubyJarArchive/invoker.p0000644000000000000000000000006312674201751030065 0ustar invoker.goals = verify invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/it/jrubyJarArchive/test-jar/0000755000000000000000000000000012674201751027761 5ustar ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/it/jrubyJarArchive/test-jar/src/./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/it/jrubyJarArchive/test-jar/0000755000000000000000000000000012674201751027761 5ustar ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/it/jrubyJarArchive/test-jar/src/test/./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/it/jrubyJarArchive/test-jar/0000755000000000000000000000000012674201751027761 5ustar ././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/it/jrubyJarArchive/test-jar/src/test/java/./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/it/jrubyJarArchive/test-jar/0000755000000000000000000000000012674201751027761 5ustar ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/it/jrubyJarArchive/test-jar/src/test/java/de/./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/it/jrubyJarArchive/test-jar/0000755000000000000000000000000012674201751027761 5ustar ././@LongLink0000644000000000000000000000017500000000000011606 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/it/jrubyJarArchive/test-jar/src/test/java/de/saumya/./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/it/jrubyJarArchive/test-jar/0000755000000000000000000000000012674201751027761 5ustar ././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/it/jrubyJarArchive/test-jar/src/test/java/de/saumya/mojo/./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/it/jrubyJarArchive/test-jar/0000755000000000000000000000000012674201751027761 5ustar ././@LongLink0000644000000000000000000000021100000000000011575 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/it/jrubyJarArchive/test-jar/src/test/java/de/saumya/mojo/jruby9/./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/it/jrubyJarArchive/test-jar/0000755000000000000000000000000012674201751027761 5ustar ././@LongLink0000644000000000000000000000023400000000000011602 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/it/jrubyJarArchive/test-jar/src/test/java/de/saumya/mojo/jruby9/JRuby9TestCase.java./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/it/jrubyJarArchive/test-jar/0000644000000000000000000000203612674201751027764 0ustar package de.saumya.mojo.jruby9; import org.jruby.embed.LocalContextScope; import org.jruby.embed.IsolatedScriptingContainer; import org.junit.Test; import java.io.StringWriter; import static org.junit.Assert.*; public class JRuby9TestCase { private final IsolatedScriptingContainer container = new IsolatedScriptingContainer(LocalContextScope.SINGLETHREAD); { // TODO jar-dependencies should search classloader container.setCurrentDirectory("uri:classloader:/"); } @Test public void testClasspath() { assertEquals( "10", container.parse( "require 'jars/setup';$CLASSPATH.size").run().toString() ); } @Test public void testScript() { assertEquals( "true", container.parse( "load 'test.rb';Minitest.run" ).run().toString()); } @Test public void testWithRSpec() { assertEquals("0", container.parse( "require 'rspec';RSpec::Core::Runner.run([ENV_JAVA['basedir'].gsub('\\\\', '/') + '/spec/one_spec.rb'], $stderr, $stdout) " ).run().toString()); } } ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/it/jrubyJarArchive/test-jar/pom.xml./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/it/jrubyJarArchive/test-jar/0000644000000000000000000000375712674201751027777 0ustar 4.0.0 de.saumya.mojo.jruby9 test testing mavengems mavengem:https://rubygems.org mavengems mavengem:https://rubygems.org de.saumya.mojo.jruby9 archive testing org.jruby jruby-complete ${j.version} jar junit junit 4.11 test rubygems rspec 3.3.0 gem 1.7.22 de.saumya.mojo mavengem-wagon 0.1.0 de.saumya.mojo gem-maven-plugin 1.1.3 initialize ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/it/jrubyJarArchive/test-jar/spec/./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/it/jrubyJarArchive/test-jar/0000755000000000000000000000000012674201751027761 5ustar ././@LongLink0000644000000000000000000000016500000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/it/jrubyJarArchive/test-jar/spec/one_spec.rb./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/it/jrubyJarArchive/test-jar/0000644000000000000000000000052412674201751027764 0ustar require 'jar-dependencies' describe 'something' do it 'runs inside the right environment' do expect(Dir.pwd).to eq 'uri:classloader:/' expect(__FILE__).to eq (ENV_JAVA['basedir'].gsub('\\', '/') + '/spec/one_spec.rb') expect(Jars.home).to eq 'uri:classloader:/jars' expect(Gem.dir).to eq 'uri:classloader:/' end end ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/it/jrubyJarArchive/test-runnable/./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/it/jrubyJarArchive/test-runn0000755000000000000000000000000012674201751030110 5ustar ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/it/jrubyJarArchive/test-runnable/pom.xml./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/it/jrubyJarArchive/test-runn0000644000000000000000000001231712674201751030116 0ustar 4.0.0 de.saumya.mojo.jruby9 test-runnable testing mavengems mavengem:https://rubygems.org mavengems mavengem:https://rubygems.org rubygems jar-dependencies 0.2.4 gem rubygems rspec 3.3.0 gem de.saumya.mojo.jruby9 archive testing org.jruby jruby-complete 1.7.22 de.saumya.mojo mavengem-wagon 0.1.0 ${basedir} spec/** maven-jar-plugin 2.4 default-jar omit de.saumya.mojo jruby9-jar-maven-plugin @project.version@ ${j.version} jruby-jar generate process jar org.codehaus.mojo exec-maven-plugin 1.2 java ${project.build.directory} path blabla ${basedir} ${basedir} ${basedir} simple verify exec -jar ${project.build.finalName}.jar -rjars/setup -e p JRUBY_VERSION p $CLASSPATH.size expected = 11 raise "expected #{expected} classpath entries but got #{$CLASSPATH.size}: #{$CLASSPATH.inspect}" if $CLASSPATH.size != expected raise "expected jruby version ${j.version} but was #{JRUBY_VERSION}" if JRUBY_VERSION != "${j.version}" rspec verify exec -jar ${project.build.finalName}.jar -S rspec test file verify exec -jar ${project.build.finalName}.jar -e #TODO newer jrubies have this fixed https://github.com/jruby/jruby/issues/3443 Gem::Specification.dirs = Gem::Specification.dirs + JRuby.runtime.jruby_class_loader.get_resources('specifications').collect{ |u| p u.to_s }; load 'test.rb' ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/it/jrubyJarArchive/test-runnable/spec/./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/it/jrubyJarArchive/test-runn0000755000000000000000000000000012674201751030110 5ustar ././@LongLink0000644000000000000000000000017200000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/it/jrubyJarArchive/test-runnable/spec/one_spec.rb./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/it/jrubyJarArchive/test-runn0000644000000000000000000000056512674201751030120 0ustar require 'jar-dependencies' describe 'something' do it 'runs inside the right environment' do expect(Dir.pwd).to eq 'uri:classloader://' expect(__FILE__).to eq 'uri:classloader:/spec/one_spec.rb' expect(Jars.home.sub('//', '/')).to eq 'uri:classloader:/jars' expect(Gem.dir).to eq 'uri:classloader://META-INF/jruby.home/lib/ruby/gems/shared' end end ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/it/jrubyJarArchive/archive/0000755000000000000000000000000012674201751027651 5ustar ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/it/jrubyJarArchive/archive/pom.xml./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/it/jrubyJarArchive/archive/p0000644000000000000000000000556412674201751030045 0ustar 4.0.0 de.saumya.mojo.jruby9 archive testing mavengems mavengem:https://rubygems.org org.jruby jruby-complete ${j.version} 1.7.21 de.saumya.mojo mavengem-wagon 0.1.0 ${basedir} test.rb spec/** maven-jar-plugin 2.4 default-jar omit de.saumya.mojo jruby9-jar-maven-plugin @project.version@ archive ${j.version} jruby-jar generate process jar org.slf4j slf4j-api 1.7.6 rubygems leafy-rack 0.4.0 gem rubygems minitest 5.7.0 gem org.slf4j slf4j-simple 1.7.6 ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/it/jrubyJarArchive/archive/test.rb./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/src/it/jrubyJarArchive/archive/t0000644000000000000000000000141612674201751030041 0ustar gem 'minitest' require 'minitest/spec' require 'jars/setup' describe 'something' do it 'uses the right minitest version' do Gem.loaded_specs['minitest'].version.to_s.must_equal '5.7.0' end it 'runs from the jar' do __FILE__.must_equal 'uri:classloader:/test.rb' Dir.pwd.must_equal 'uri:classloader:/' end it 'can use logger' do old = java.lang.System.err bytes = StringIO.new java.lang.System.err = java.io.PrintStream.new( bytes.to_outputstream ) begin # TODO capture java stderr and ensure there is no warning org.slf4j.LoggerFactory.get_logger('me').info 'hello' java.lang.System.err.flush bytes.string.strip.must_equal '[main] INFO me - hello' ensure java.lang.System.err = old end end end ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/README.md0000644000000000000000000000777712674201751023234 0ustar # jruby jar maven plugin it packs a ruby application as runnable jar, i.e. all the ruby code and the gems and jars (which ruby loads via require) are packed inside the jar. the jar will include jruby-complete and jruby-mains to execute the ruby application via, i.e. java -jar my.jar -S rake there is more compact configuration using an maven extensions: [../jruby9-jar-extension](jruby9-jar-extension) ## general command line switches to see the java/jruby command the plugin is executing use (for example with the verify goal) ```mvn verify -Djruby.verbose``` to quickly pick another jruby version use ```mvn verify -Djruby.version=1.7.20``` or to display some help ```mvn jruby9-jar:help -Ddetail``` ```mvn jruby9-jar:help -Ddetail -Dgoal=jar``` ## jruby jar it installs all the declared gems and jars from the dependencies section as well the plugin dependencies. the complete pom for the samples below is in [src/it/jrubyJarExample/pom.xml](src/it/jrubyJarExample/pom.xml) and more details on how it can be executed. the gem-artifacts are coming from the torquebox rubygems proxy rubygems-releases http://rubygems-proxy.torquebox.org/releases to use these gems within the depenencies of the plugin you need rubygems-releases http://rubygems-proxy.torquebox.org/releases the jar and gem artifacts for the JRuby application can be declared in the main dependencies section org.slf4j slf4j-api 1.7.6 rubygems leafy-rack 0.4.0 gem rubygems minitest 5.7.0 gem these artifacts ALL have the default scope which gets packed into the jar. adding ruby resources to your jar ${basedir} test.rb spec/** the plugin declarations. first we want to omit the regular jar packing maven-jar-plugin 2.4 default-jar omit the tell the jruby-jar mojo to pack the jar de.saumya.mojo jruby9-jar-maven-plugin @project.version@ ${j.version} jruby-jar generate process jar now the plugin does also pack those gem declared inside the plugin sections rubygems rspec 3.3.0 gem the main dependencies section does use leafy-rack and for its logging you need a slf4j logger. org.slf4j slf4j-simple 1.7.6 ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-jar-maven-plugin/pom.xml0000644000000000000000000000271112674201751023251 0ustar 4.0.0 jruby9 de.saumya.mojo 0.2.3-SNAPSHOT jruby9-jar-maven-plugin maven-plugin JRuby9 Jar Maven Mojo org.apache.maven maven-core 3.3.3 true org.codehaus.plexus plexus-archiver de.saumya.mojo jruby9-common org.apache.maven.plugins maven-jar-plugin org.apache.maven.plugin-tools maven-plugin-annotations provided maven-invoker-plugin ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/.gitignore0000644000000000000000000000001112674201751017315 0ustar /target/ ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-extensions/0000755000000000000000000000000012674201751020756 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-extensions/src/0000755000000000000000000000000012674201751021545 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-extensions/src/main/0000755000000000000000000000000012674201751022471 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-extensions/src/main/resources/0000755000000000000000000000000012674201751024503 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-extensions/src/main/resources/META-INF/0000755000000000000000000000000012674201751025643 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-extensions/src/main/resources/META-INF/plexus/0000755000000000000000000000000012674201751027163 5ustar ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-extensions/src/main/resources/META-INF/plexus/components.xml./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-extensions/src/main/resources/META-INF/plexus/com0000644000000000000000000000756412674201751027700 0ustar org.apache.maven.lifecycle.mapping.LifecycleMapping jrubyJar org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping de.saumya.mojo:jruby9-jar-maven-plugin:generate org.apache.maven.plugins:maven-resources-plugin:resources, de.saumya.mojo:jruby9-jar-maven-plugin:process org.apache.maven.plugins:maven-compiler-plugin:compile org.apache.maven.plugins:maven-resources-plugin:testResources org.apache.maven.plugins:maven-compiler-plugin:testCompile org.apache.maven.plugins:maven-surefire-plugin:test de.saumya.mojo:jruby9-jar-maven-plugin:jar org.apache.maven.plugins:maven-install-plugin:install org.apache.maven.plugins:maven-deploy-plugin:deploy org.apache.maven.lifecycle.mapping.LifecycleMapping jrubyWar org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping de.saumya.mojo:jruby9-war-maven-plugin:generate org.apache.maven.plugins:maven-resources-plugin:resources, de.saumya.mojo:jruby9-war-maven-plugin:process org.apache.maven.plugins:maven-compiler-plugin:compile org.apache.maven.plugins:maven-resources-plugin:testResources org.apache.maven.plugins:maven-compiler-plugin:testCompile org.apache.maven.plugins:maven-surefire-plugin:test de.saumya.mojo:jruby9-war-maven-plugin:war org.apache.maven.plugins:maven-install-plugin:install org.apache.maven.plugins:maven-deploy-plugin:deploy org.apache.maven.artifact.handler.ArtifactHandler jrubyJar org.apache.maven.artifact.handler.DefaultArtifactHandler jar jar jrubyJar java false false org.apache.maven.artifact.handler.ArtifactHandler jrubyWar org.apache.maven.artifact.handler.DefaultArtifactHandler war war jrubyWar java false false ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-extensions/src/it/0000755000000000000000000000000012674201751022161 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-extensions/src/it/jrubyWarExample/0000755000000000000000000000000012674201751025302 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-extensions/src/it/jrubyWarExample/pom.xml0000644000000000000000000001167012674201751026624 0ustar 4.0.0 de.saumya.mojo.jruby9 test testing jrubyWar mavengems mavengem:https://rubygems.org mavengems mavengem:https://rubygems.org org.slf4j slf4j-api 1.7.6 rubygems leafy-rack 0.4.0 gem rubygems minitest 5.7.0 gem 9.0.3.0 de.saumya.mojo mavengem-wagon 0.1.0 de.saumya.mojo jruby9-extensions @project.version@ ${basedir} test.rb spec/** de.saumya.mojo jruby9-war-maven-plugin @project.version@ ${j.version} runnable rubygems rspec 3.3.0 gem org.slf4j slf4j-simple 1.7.6 org.codehaus.mojo exec-maven-plugin 1.2 java ${project.build.directory} path blabla ${basedir} ${basedir} ${basedir} simple verify exec -jar ${project.build.finalName}.war -rjars/setup -e p JRUBY_VERSION p $CLASSPATH.size expected = 10 raise "expected #{expected} classpath entries but got #{$CLASSPATH.size}: #{$CLASSPATH.inspect}" if $CLASSPATH.size != expected raise "expected jruby version ${j.version} but was #{JRUBY_VERSION}" if JRUBY_VERSION != "${j.version}" rspec verify exec -jar ${project.build.finalName}.war -S rspec test file verify exec -jar ${project.build.finalName}.war test.rb ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-extensions/src/it/jrubyWarExample/spec/0000755000000000000000000000000012674201751026234 5ustar ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-extensions/src/it/jrubyWarExample/spec/one_spec.rb./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-extensions/src/it/jrubyWarExample/spec/one_spec.r0000644000000000000000000000062712674201751030217 0ustar require 'jar-dependencies' describe 'something' do it 'runs inside the right environment' do expect(Dir.pwd).to eq 'uri:classloader://WEB-INF/classes/' expect(__FILE__).to eq 'uri:classloader:/WEB-INF/classes/spec/one_spec.rb' expect(Jars.home).to eq 'uri:classloader://WEB-INF/classes/jars' expect(Gem.dir).to eq 'uri:classloader://META-INF/jruby.home/lib/ruby/gems/shared' end end ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-extensions/src/it/jrubyWarExample/test.rb0000644000000000000000000000142112674201751026604 0ustar gem 'minitest' require 'minitest/autorun' require 'jars/setup' describe 'something' do it 'uses the right minitest version' do Gem.loaded_specs['minitest'].version.to_s.must_equal '5.7.0' end it 'runs from the jar' do __FILE__.must_equal 'test.rb' Dir.pwd.must_equal 'uri:classloader://WEB-INF/classes/' end it 'can use logger' do old = java.lang.System.err bytes = StringIO.new java.lang.System.err = java.io.PrintStream.new( bytes.to_outputstream ) begin # TODO capture java stderr and ensure there is no warning org.slf4j.LoggerFactory.get_logger('me').info 'hello' java.lang.System.err.flush bytes.string.strip.must_equal '[main] INFO me - hello' ensure java.lang.System.err = old end end end ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-extensions/src/it/jrubyWarExample/invoker.properties./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-extensions/src/it/jrubyWarExample/invoker.propert0000644000000000000000000000006312674201751030373 0ustar invoker.goals = verify invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-extensions/src/it/jrubyJarRunnable/0000755000000000000000000000000012674201751025440 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-extensions/src/it/jrubyJarRunnable/pom.xml0000644000000000000000000001076412674201751026765 0ustar 4.0.0 de.saumya.mojo.jruby9 test testing jrubyJar mavengems mavengem:https://rubygems.org mavengems mavengem:https://rubygems.org org.slf4j slf4j-api 1.7.6 rubygems leafy-rack 0.4.0 gem rubygems minitest 5.7.0 gem rubygems rspec 3.3.0 gem org.slf4j slf4j-simple 1.7.6 1.7.21 de.saumya.mojo mavengem-wagon 0.1.0 de.saumya.mojo jruby9-extensions @project.version@ ${basedir} test.rb spec/** org.codehaus.mojo exec-maven-plugin 1.2 java ${project.build.directory} path blabla ${basedir} ${basedir} ${basedir} simple verify exec -jar ${project.build.finalName}.jar -rjars/setup -e p JRUBY_VERSION p $CLASSPATH.size expected = 10 raise "expected #{expected} classpath entries but got #{$CLASSPATH.size}: #{$CLASSPATH.inspect}" if $CLASSPATH.size != expected raise "expected jruby version ${jruby.version} but was #{JRUBY_VERSION}" if JRUBY_VERSION != "${jruby.version}" rspec verify exec -jar ${project.build.finalName}.jar -S rspec test file verify exec -jar ${project.build.finalName}.jar test.rb ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-extensions/src/it/jrubyJarRunnable/spec/0000755000000000000000000000000012674201751026372 5ustar ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-extensions/src/it/jrubyJarRunnable/spec/one_spec.rb./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-extensions/src/it/jrubyJarRunnable/spec/one_spec.0000644000000000000000000000054712674201751030174 0ustar require 'jar-dependencies' describe 'something' do it 'runs inside the right environment' do expect(Dir.pwd).to eq 'uri:classloader://' expect(__FILE__).to eq 'uri:classloader:/spec/one_spec.rb' expect(Jars.home).to eq 'uri:classloader://jars' expect(Gem.dir).to eq 'uri:classloader://META-INF/jruby.home/lib/ruby/gems/shared' end end ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-extensions/src/it/jrubyJarRunnable/test.rb0000644000000000000000000000140112674201751026740 0ustar gem 'minitest' require 'minitest/autorun' require 'jars/setup' describe 'something' do it 'uses the right minitest version' do Gem.loaded_specs['minitest'].version.to_s.must_equal '5.7.0' end it 'runs from the jar' do __FILE__.must_equal 'test.rb' Dir.pwd.must_equal 'uri:classloader://' end it 'can use logger' do old = java.lang.System.err bytes = StringIO.new java.lang.System.err = java.io.PrintStream.new( bytes.to_outputstream ) begin # TODO capture java stderr and ensure there is no warning org.slf4j.LoggerFactory.get_logger('me').info 'hello' java.lang.System.err.flush bytes.string.strip.must_equal '[main] INFO me - hello' ensure java.lang.System.err = old end end end ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-extensions/src/it/jrubyJarRunnable/invoker.properties./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-extensions/src/it/jrubyJarRunnable/invoker.proper0000644000000000000000000000006312674201751030345 0ustar invoker.goals = verify invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-extensions/README.md0000644000000000000000000000552712674201751022246 0ustar # jruby jar extension it packs a ruby application as runnable jar, i.e. all the ruby code and the gems and jars (which ruby loads via require) are packed inside the jar. the jar will include jruby-complete and jruby-mains to execute the ruby application via, i.e. java -jar my.jar -S rake the extension uses the mojos from [../jruby9-jar-maven-plugin](jruby9-jar-maven-plugin) ## general command line switches to see the java/jruby command the plugin is executing use (for example with the verify goal) ```mvn verify -Djruby.verbose``` to quickly pick another jruby version use ```mvn verify -Djruby.version=1.7.20``` or to display some help ```mvn jruby9-jar:help -Ddetail``` ```mvn jruby9-jar:help -Ddetail -Dgoal=jar``` ## jruby jar it installs all the declared gems and jars from the dependencies section as well the plugin dependencies. the complete pom for the samples below is in [src/it/jrubyJarExample/pom.xml](src/it/jrubyJarExample/pom.xml) and more details on how it can be executed. the extension is used by declaring the right packaging jrubyJar the gem-artifacts are coming from the torquebox rubygems proxy rubygems-releases http://rubygems-proxy.torquebox.org/releases to use these gems within the depenencies of the plugin you need rubygems-releases http://rubygems-proxy.torquebox.org/releases the jar and gem artifacts for the JRuby application can be declared in the main dependencies section org.slf4j slf4j-api 1.7.6 rubygems leafy-rack 0.4.0 gem rubygems minitest 5.7.0 gem these artifacts ALL have the default scope which gets packed into the jar. adding ruby resources to your jar ${basedir} test.rb spec/** and pick the extension de.saumya.mojo jruby9-jar-extension @project.version@ ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-extensions/pom.xml0000644000000000000000000000121512674201751022272 0ustar 4.0.0 jruby9 de.saumya.mojo 0.2.3-SNAPSHOT jruby9-extensions jar JRuby9 Extensions maven-invoker-plugin ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-exec-maven-plugin/0000755000000000000000000000000012674201751022103 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-exec-maven-plugin/src/0000755000000000000000000000000012674201751022672 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-exec-maven-plugin/src/main/0000755000000000000000000000000012674201751023616 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-exec-maven-plugin/src/main/java/0000755000000000000000000000000012674201751024537 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-exec-maven-plugin/src/main/java/de/0000755000000000000000000000000012674201751025127 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-exec-maven-plugin/src/main/java/de/saumya/0000755000000000000000000000000012674201751026426 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-exec-maven-plugin/src/main/java/de/saumya/mojo/0000755000000000000000000000000012674201751027372 5ustar ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-exec-maven-plugin/src/main/java/de/saumya/mojo/jruby9/./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-exec-maven-plugin/src/main/java/de/saumya/mojo/jr0000755000000000000000000000000012674201751027726 5ustar ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-exec-maven-plugin/src/main/java/de/saumya/mojo/jruby9/exec/./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-exec-maven-plugin/src/main/java/de/saumya/mojo/jr0000755000000000000000000000000012674201751027726 5ustar ././@LongLink0000644000000000000000000000017400000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-exec-maven-plugin/src/main/java/de/saumya/mojo/jruby9/exec/ExecMojo.java./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-exec-maven-plugin/src/main/java/de/saumya/mojo/jr0000644000000000000000000001037012674201751027731 0ustar package de.saumya.mojo.jruby9.exec; import java.io.File; import java.io.IOException; import org.apache.maven.artifact.Artifact; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.plugins.annotations.ResolutionScope; import de.saumya.mojo.jruby9.AbstractJRuby9Mojo; import de.saumya.mojo.jruby9.JarDependencies; import de.saumya.mojo.jruby9.JarDependencies.Filter; import de.saumya.mojo.ruby.script.Script; import de.saumya.mojo.ruby.script.ScriptException; /** * executes a ruby script in context of the gems from pom. the arguments for * jruby are build like this: * ${jruby.args} ${exec.file} ${exec.args} ${args}
    * to execute an inline script the exec parameters are ignored. * */ @Mojo( name = "exec", requiresProject = true, threadSafe = true, requiresDependencyResolution = ResolutionScope.TEST ) public class ExecMojo extends AbstractJRuby9Mojo { /** * ruby code from the pom configuration part which gets executed. */ @Parameter(property = "exec.script") protected String script = null; /** * ruby file which gets executed in context of the given gems.. */ @Parameter(property = "exec.file") protected File file = null; /** * ruby file found on search path which gets executed. the search path * includes the executable scripts which were installed via the given * gem-artifacts. */ @Parameter(property = "exec.command") protected String command = null; /** * output file where the standard out will be written */ @Parameter(property = "exec.outputFile") protected File outputFile = null; /** * arguments separated by whitespaces for the ruby script given through file parameter. * no quoting or escaping possible - if needed use execArglines instead. */ @Parameter(property = "exec.args") protected String execArgs = null; /** * an array of arguments which can contain spaces for the ruby script given through file parameter. */ @Parameter protected String[] execArgLines = null; /** * add project test class path to JVM classpath. */ /* we want the opposite default here than the superclass */ @Parameter(property = "gem.addProjectClasspath", defaultValue = "false") protected boolean addProjectClasspath; @Override protected void executeWithGems() throws MojoExecutionException, ScriptException, IOException { JarDependencies jars = new JarDependencies(project.getBuild().getDirectory(), "Jars_" + plugin.getGoalPrefix() + ".lock"); jars.addAll(plugin.getArtifacts(), new Filter(){ @Override public boolean addIt(Artifact a) { return a.getScope().equals("runtime") && !project.getArtifactMap().containsKey(a.getGroupId() +":" + a.getArtifactId()); } }); jars.addAll(project.getArtifacts()); jars.generateJarsLock(); factory.addEnv("JARS_HOME", localRepository.getBasedir()); factory.addEnv("JARS_LOCK", jars.lockFilePath()); factory.addSwitch("-r", "jars/setup"); Script s; if (this.script != null && this.script.length() > 0) { s = this.factory.newScript(this.script); } else if (this.file != null) { s = this.factory.newScript(this.file); } else if (this.command != null) { s = this.factory.newScriptFromSearchPath( this.command ); } else { s = this.factory.newArguments(); } if ( execArgLines != null ){ for( String arg: execArgLines ){ s.addArg( arg ); } } s.addArgs(this.execArgs); s.addArgs(this.args); if (s.isValid()) { if(outputFile != null){ s.executeIn(launchDirectory(), outputFile); } else { s.executeIn(launchDirectory()); } } else { getLog().warn("no arguments given. for more details see: mvn ruby:help -Ddetail -Dgoals=exec"); } } } ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-exec-maven-plugin/src/it/0000755000000000000000000000000012674201751023306 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-exec-maven-plugin/src/it/jrubyExecExample/0000755000000000000000000000000012674201751026562 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-exec-maven-plugin/src/it/jrubyExecExample/pom.xml0000644000000000000000000000621512674201751030103 0ustar 4.0.0 de.saumya.mojo.jruby9 test testing mavengem mavengem:https://rubygems.org mavengem mavengem:https://rubygems.org org.slf4j slf4j-api 1.7.6 rubygems leafy-rack 0.4.0 gem rubygems minitest 5.7.0 gem test 9.0.3.0 de.saumya.mojo mavengem-wagon 0.1.0 de.saumya.mojo jruby9-exec-maven-plugin @project.version@ simple test exec ${j.version} rspec test exec rspec test file test exec test.rb rubygems rspec 3.3.0 gem org.slf4j slf4j-simple 1.7.6 ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-exec-maven-plugin/src/it/jrubyExecExample/spec/0000755000000000000000000000000012674201751027514 5ustar ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-exec-maven-plugin/src/it/jrubyExecExample/spec/one_spec.rb./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-exec-maven-plugin/src/it/jrubyExecExample/spec/on0000644000000000000000000000016712674201751030057 0ustar describe 'something' do it 'uses the right jruby version' do expect(JRUBY_VERSION).to eq '9.0.0.0' end end ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-exec-maven-plugin/src/it/jrubyExecExample/test.rb0000644000000000000000000000117312674201751030070 0ustar gem 'minitest' require 'minitest/autorun' describe 'something' do it 'uses the right minitest version' do Gem.loaded_specs['minitest'].version.to_s.must_equal '5.7.0' end it 'can use logger' do old = java.lang.System.err bytes = StringIO.new java.lang.System.err = java.io.PrintStream.new( bytes.to_outputstream ) begin # TODO capture java stderr and ensure there is no warning org.slf4j.LoggerFactory.get_logger('me').info 'hello' java.lang.System.err.flush bytes.string.strip.must_equal '[main] INFO me - hello' ensure java.lang.System.err = old end end end ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-exec-maven-plugin/src/it/jrubyExecExample/invoker.properties./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-exec-maven-plugin/src/it/jrubyExecExample/invoker0000644000000000000000000000006112674201751030157 0ustar invoker.goals = test invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-exec-maven-plugin/README.md0000644000000000000000000000740412674201751023367 0ustar # jruby maven plugin the plugin is modeled after [jruby-gradle](http://jruby-gradle.github.io/) and uses the old jruby maven plugins under the hood but it needs jruby-1.7.19 or newer (including jruby-9.0.0.0 serie). even if the plugin depends on the old jruby-maven-plugins BUT has a different version. ## general command line switches to see the java/jruby command the plugin is executing use (for example with the verify goal) ```mvn verify -Djruby.verbose``` to quickly pick another jruby version use ```mvn verify -Djruby.version=1.7.20``` or to display some help ```mvn jruby9:help -Ddetail``` ## jruby exec it installs all the declared gems from the dependencies section as well the plugin dependencies. all jars are loaded with JRuby via ```require``` which loads them in to the JRubyClassLoader. the complete pom for the samples below is in [src/it/jrubyExecExample/pom.xml](src/it/jrubyExecExample/pom.xml) the gem-artifacts are coming from the torquebox rubygems proxy rubygems-releases http://rubygems-proxy.torquebox.org/releases to use these gems within the depenencies of the plugin you need rubygems-releases http://rubygems-proxy.torquebox.org/releases the jar and gem artifacts for the JRuby application can be declared in the main dependencies section org.slf4j slf4j-api 1.7.6 rubygems leafy-rack 0.4.0 gem rubygems minitest 5.7.0 gem test these artifacts can have different scope BUT the exec goal will use ALL scopes. the plugin declaration de.saumya.mojo jruby9-maven-plugin simple validate exec 9.0.3.0 rspec test exec rspec test file test exec test.rb now the plugin uses rspec and needs rpsec gems installed via rubygems rspec 3.3.0 gem the main dependencies section does use leafy-rack and to see some of its logging you need a slf4j logger for the tests org.slf4j slf4j-simple 1.7.6 ./jruby-maven-plugins-1.1.5.ds1.orig/jruby9/jruby9-exec-maven-plugin/pom.xml0000644000000000000000000000175612674201751023431 0ustar 4.0.0 jruby9 de.saumya.mojo 0.2.3-SNAPSHOT jruby9-exec-maven-plugin maven-plugin JRuby9 Exec Maven Mojo de.saumya.mojo jruby9-common org.apache.maven.plugin-tools maven-plugin-annotations provided maven-invoker-plugin ./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/0000755000000000000000000000000012674201751017652 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/0000755000000000000000000000000012674201751020441 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/main/0000755000000000000000000000000012674201751021365 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/main/java/0000755000000000000000000000000012674201751022306 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/main/java/de/0000755000000000000000000000000012674201751022676 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/main/java/de/saumya/0000755000000000000000000000000012674201751024175 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/main/java/de/saumya/mojo/0000755000000000000000000000000012674201751025141 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/main/java/de/saumya/mojo/runit/0000755000000000000000000000000012674201751026302 5ustar ././@LongLink0000644000000000000000000000017400000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/main/java/de/saumya/mojo/runit/RunitMavenTestScriptFactory.java./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/main/java/de/saumya/mojo/runit/RunitMave0000644000000000000000000000353212674201751030142 0ustar package de.saumya.mojo.runit; public class RunitMavenTestScriptFactory extends AbstractRunitMavenTestScriptFactory { @Override void getTestRunnerScript(StringBuilder builder) { builder.append("require 'fileutils'\n"); builder.append("FileUtils.mkdir_p(File.dirname(REPORT_PATH))\n"); builder.append("if defined?( Test::Unit::AutoRunner ) and Test::Unit::AutoRunner.respond_to?(:setup_option)\n"); builder.append(" Test::Unit::AutoRunner.setup_option do |auto_runner, opts|\n"); builder.append(" opts.on('--output-file=FILE', String, 'Outputs to file') do |file|\n"); builder.append(" auto_runner.runner_options[:output] = Tee.open(file, 'w')\n"); builder.append(" end\n"); builder.append(" end\n"); builder.append(" ARGV << \"--output-file=#{REPORT_PATH}\"\n"); builder.append("else\n"); builder.append(" begin\n"); builder.append(" require 'minitest/autorun'\n"); builder.append(" MiniTest::Unit.output = Tee.open(REPORT_PATH, 'w') if MiniTest::Unit.respond_to? :output=\n"); builder.append(" rescue LoadError\n"); builder.append(" require 'test/unit/ui/console/testrunner'\n"); builder.append(" class Test::Unit::UI::Console::TestRunner\n"); builder.append(" extend Test::Unit::UI::TestRunnerUtilities\n"); builder.append(" alias :old_initialize :initialize\n"); builder.append(" def initialize(suite, output_level=NORMAL)\n"); builder.append(" old_initialize(suite, output_level, Tee.open(REPORT_PATH, 'w'))\n"); builder.append(" end\n"); builder.append(" end\n"); builder.append(" end\n"); builder.append("end\n"); } @Override protected String getScriptName() { return "test-runner.rb"; } } ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/main/java/de/saumya/mojo/runit/RUnitMojo.java./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/main/java/de/saumya/mojo/runit/RUnitMojo0000644000000000000000000000676612674201751030132 0ustar package de.saumya.mojo.runit; import java.io.File; import java.io.IOException; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; import de.saumya.mojo.jruby.JRubyVersion; import de.saumya.mojo.jruby.JRubyVersion.Mode; import de.saumya.mojo.ruby.script.Script; import de.saumya.mojo.ruby.script.ScriptException; import de.saumya.mojo.ruby.script.ScriptFactory; import de.saumya.mojo.tests.AbstractTestMojo; import de.saumya.mojo.tests.JRubyRun.Result; import de.saumya.mojo.tests.TestResultManager; import de.saumya.mojo.tests.TestScriptFactory; import org.apache.maven.plugins.annotations.LifecyclePhase; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.plugins.annotations.ResolutionScope; /** * maven wrapper around the runit/testcase command. */ @Mojo( name = "test", defaultPhase = LifecyclePhase.TEST, requiresDependencyResolution = ResolutionScope.TEST) public class RUnitMojo extends AbstractTestMojo { enum ResultEnum { TESTS, ASSERTIONS, FAILURES, ERRORS, SKIPS } /** * runit directory with glob to be used for the ruby unit command. */ @Parameter(property = "runit.dir", defaultValue = "test/**/*_test.rb") private final String runitDirectory = null; /** * arguments for the runit command. */ @Parameter(property = "runit.args" ) private final String runitArgs = null; /** * skip the ruby unit tests */ @Parameter(property = "skipRunit", defaultValue = "false") protected boolean skipRunit; private TestResultManager resultManager; private File outputfile; @Override public void execute() throws MojoExecutionException, MojoFailureException { if (this.skip || this.skipTests || this.skipRunit) { getLog().info("Skipping RUnit tests"); return; } else { outputfile = new File(this.project.getBuild().getDirectory() .replace("${project.basedir}/", ""), "runit.txt"); if (outputfile.exists()){ outputfile.delete(); } resultManager = new TestResultManager(project.getName(), "runit", testReportDirectory, summaryReport); super.execute(); } } protected Result runIt(ScriptFactory factory, Mode mode, JRubyVersion version, TestScriptFactory scriptFactory) throws IOException, ScriptException, MojoExecutionException { scriptFactory.setOutputDir(outputfile.getParentFile()); scriptFactory.setReportPath(outputfile); outputfile.delete(); if(runitDirectory.startsWith(launchDirectory().getAbsolutePath())){ scriptFactory.setSourceDir(new File(runitDirectory)); } else{ scriptFactory.setSourceDir(new File(launchDirectory(), runitDirectory)); } final Script script = factory.newScript(scriptFactory.getCoreScript()); if (this.runitArgs != null) { script.addArgs(this.runitArgs); } if (this.args != null) { script.addArgs(this.args); } try { script.executeIn(launchDirectory()); } catch (Exception e) { getLog().debug("exception in running tests", e); } return resultManager.generateReports(mode, version, outputfile); } @Override protected TestScriptFactory newTestScriptFactory() { return new RunitMavenTestScriptFactory(); } } ././@LongLink0000644000000000000000000000020400000000000011577 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/main/java/de/saumya/mojo/runit/AbstractRunitMavenTestScriptFactory.java./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/main/java/de/saumya/mojo/runit/AbstractR0000644000000000000000000000235412674201751030116 0ustar package de.saumya.mojo.runit; import de.saumya.mojo.tests.AbstractMavenTestScriptFactory; public abstract class AbstractRunitMavenTestScriptFactory extends AbstractMavenTestScriptFactory { @Override protected void getRunnerScript(StringBuilder builder) { getTeeClass(builder); getAddTestCases(builder); getTestRunnerScript(builder); } abstract void getTestRunnerScript(StringBuilder builder); @Override protected void getResultsScript(StringBuilder builder) { // just creates error since the tests run on exit hook } void getTeeClass(StringBuilder builder){ builder.append("class Tee < File\n"); builder.append(" def write(*args)\n"); builder.append(" super\n" ); builder.append(" STDOUT.write *args\n" ); builder.append(" end\n"); builder.append(" def flush(*args)\n" ); builder.append(" super\n" ); builder.append(" STDOUT.flush *args\n"); builder.append(" end\n" ); builder.append("end\n"); } void getAddTestCases(StringBuilder builder){ builder.append( "require 'test/unit'\n"); builder.append("Dir[SOURCE_DIR].each { |f| require f if File.file? f }\n"); } } ./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/0000755000000000000000000000000012674201751021055 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-failure-19/0000755000000000000000000000000012674201751024072 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-failure-19/verify.bsh0000644000000000000000000000077412674201751026104 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "1 tests, 1 assertions, 1 failures, 0 errors"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } File file = new File( basedir, "target/surefire-reports/TEST-runit.xml"); if ( !file.exists() ) { throw new RuntimeException( "file does not exists: '" + file.getAbsolutePath() + "'" ); } ./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-failure-19/test.properties0000644000000000000000000000002412674201751027163 0ustar jruby.switches=--1.9./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-failure-19/pom.xml0000644000000000000000000000116612674201751025413 0ustar 4.0.0 de.saumya.mojo runit-failure testing de.saumya.mojo runit-maven-plugin @project.version@ ./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-failure-19/test/0000755000000000000000000000000012674201751025051 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-failure-19/test/simple_test.rb0000644000000000000000000000012512674201751027724 0ustar class SimpleTest < Test::Unit::TestCase def test_it assert false end end ./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-failure-19/invoker.properties0000644000000000000000000000012512674201751027663 0ustar invoker.goals = runit:test invoker.mavenOpts = -client invoker.buildResult = failure ./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-18_19_20-156_161_175/0000755000000000000000000000000012674201751024552 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-18_19_20-156_161_175/verify.bsh0000644000000000000000000000500212674201751026551 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "jruby-1.5.6 mode 1.8: 1 tests, 1 assertions, 0 failures, 0 errors"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } expected = "jruby-1.6.1 mode 1.8: 1 tests, 1 assertions, 0 failures, 0 errors"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } expected = "jruby-1.6.1 mode 1.9: 1 tests, 1 assertions, 0 failures, 0 errors, 0 skips"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } expected = "jruby-1.7.5 mode 1.8: 1 tests, 1 assertions, 0 failures, 0 errors"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } expected = "jruby-1.7.5 mode 1.9: 1 tests, 1 assertions, 0 failures, 0 errors, 0 skips"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } expected = "jruby-1.7.5 mode 2.0: 1 tests, 1 assertions, 0 failures, 0 errors, 0 skips"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } File file = new File( basedir, "target/surefire-reports/TEST-runit-1.5.6--1.8.xml"); if ( !file.exists() ) { throw new RuntimeException( "file does not exists: '" + file.getAbsolutePath() + "'" ); } file = new File( basedir, "target/surefire-reports/TEST-runit-1.6.1--1.8.xml"); if ( !file.exists() ) { throw new RuntimeException( "file does not exists: '" + file.getAbsolutePath() + "'" ); } file = new File( basedir, "target/surefire-reports/TEST-runit-1.6.1--1.9.xml"); if ( !file.exists() ) { throw new RuntimeException( "file does not exists: '" + file.getAbsolutePath() + "'" ); } file = new File( basedir, "target/surefire-reports/TEST-runit-1.7.5--1.8.xml"); if ( !file.exists() ) { throw new RuntimeException( "file does not exists: '" + file.getAbsolutePath() + "'" ); } file = new File( basedir, "target/surefire-reports/TEST-runit-1.7.5--1.9.xml"); if ( !file.exists() ) { throw new RuntimeException( "file does not exists: '" + file.getAbsolutePath() + "'" ); } file = new File( basedir, "target/surefire-reports/TEST-runit-1.7.5--2.0.xml"); if ( !file.exists() ) { throw new RuntimeException( "file does not exists: '" + file.getAbsolutePath() + "'" ); } ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-18_19_20-156_161_175/test.properties./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-18_19_20-156_161_175/test.prope0000644000000000000000000000007012674201751026575 0ustar jruby.modes=1.8,1.9,2.0 jruby.versions=1.5.6,1.6.1,1.7.5./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-18_19_20-156_161_175/pom.xml0000644000000000000000000000132712674201751026072 0ustar 4.0.0 de.saumya.mojo runit-pom testing de.saumya.mojo runit-maven-plugin @project.version@ test ./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-18_19_20-156_161_175/test/0000755000000000000000000000000012674201751025531 5ustar ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-18_19_20-156_161_175/test/simple_test.rb./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-18_19_20-156_161_175/test/simpl0000644000000000000000000000012412674201751026575 0ustar class SimpleTest < Test::Unit::TestCase def test_it assert true end end ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-18_19_20-156_161_175/invoker.properties./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-18_19_20-156_161_175/invoker.pr0000644000000000000000000000006112674201751026567 0ustar invoker.goals = test invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-summary-report/0000755000000000000000000000000012674201751025222 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-summary-report/verify.bsh0000644000000000000000000000124412674201751027225 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "1 tests, 1 assertions, 0 failures, 0 errors"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } File file = new File( basedir, "target/surefire-reports/TEST-runit.xml"); if ( !file.exists() ) { throw new RuntimeException( "file does not exists: '" + file.getAbsolutePath() + "'" ); } file = new File( basedir, "target/summary.xml"); if ( !file.exists() ) { throw new RuntimeException( "file does not exists: '" + file.getAbsolutePath() + "'" ); } ./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-summary-report/pom.xml0000644000000000000000000000146612674201751026546 0ustar 4.0.0 de.saumya.mojo runit-pom testing de.saumya.mojo runit-maven-plugin @project.version@ test ${build.directory}/summary.xml ./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-summary-report/test/0000755000000000000000000000000012674201751026201 5ustar ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-summary-report/test/simple_test.rb./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-summary-report/test/simple_test0000644000000000000000000000012412674201751030451 0ustar class SimpleTest < Test::Unit::TestCase def test_it assert true end end ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-summary-report/invoker.properties./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-summary-report/invoker.properti0000644000000000000000000000006112674201751030462 0ustar invoker.goals = test invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-failure/0000755000000000000000000000000012674201751023643 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-failure/verify.bsh0000644000000000000000000000077412674201751025655 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "1 tests, 1 assertions, 1 failures, 0 errors"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } File file = new File( basedir, "target/surefire-reports/TEST-runit.xml"); if ( !file.exists() ) { throw new RuntimeException( "file does not exists: '" + file.getAbsolutePath() + "'" ); } ./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-failure/pom.xml0000644000000000000000000000116612674201751025164 0ustar 4.0.0 de.saumya.mojo runit-failure testing de.saumya.mojo runit-maven-plugin @project.version@ ./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-failure/test/0000755000000000000000000000000012674201751024622 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-failure/test/simple_test.rb0000644000000000000000000000012512674201751027475 0ustar class SimpleTest < Test::Unit::TestCase def test_it assert false end end ./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-failure/invoker.properties0000644000000000000000000000012512674201751027434 0ustar invoker.goals = runit:test invoker.mavenOpts = -client invoker.buildResult = failure ./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-somewhere/0000755000000000000000000000000012674201751024212 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-somewhere/verify.bsh0000644000000000000000000000077412674201751026224 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "1 tests, 1 assertions, 0 failures, 0 errors"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } File file = new File( basedir, "target/surefire-reports/TEST-runit.xml"); if ( !file.exists() ) { throw new RuntimeException( "file does not exists: '" + file.getAbsolutePath() + "'" ); } ./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-somewhere/pom.xml0000644000000000000000000000133512674201751025531 0ustar 4.0.0 de.saumya.mojo runit-somewhere testing de.saumya.mojo runit-maven-plugin @project.version@ somewhere ./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-somewhere/somewhere/0000755000000000000000000000000012674201751026210 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-somewhere/somewhere/test/0000755000000000000000000000000012674201751027167 5ustar ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-somewhere/somewhere/test/simple_test.rb./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-somewhere/somewhere/test/simple0000644000000000000000000000012412674201751030400 0ustar class SimpleTest < Test::Unit::TestCase def test_it assert true end end ./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-somewhere/invoker.properties0000644000000000000000000000006712674201751030010 0ustar invoker.goals = runit:test invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-pom/0000755000000000000000000000000012674201751023007 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-pom/verify.bsh0000644000000000000000000000077412674201751025021 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "1 tests, 1 assertions, 0 failures, 0 errors"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } File file = new File( basedir, "target/surefire-reports/TEST-runit.xml"); if ( !file.exists() ) { throw new RuntimeException( "file does not exists: '" + file.getAbsolutePath() + "'" ); } ./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-pom/pom.xml0000644000000000000000000000132712674201751024327 0ustar 4.0.0 de.saumya.mojo runit-pom testing de.saumya.mojo runit-maven-plugin @project.version@ test ./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-pom/test/0000755000000000000000000000000012674201751023766 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-pom/test/simple_test.rb0000644000000000000000000000012412674201751026640 0ustar class SimpleTest < Test::Unit::TestCase def test_it assert true end end ./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-pom/invoker.properties0000644000000000000000000000006112674201751026577 0ustar invoker.goals = test invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-with-env/0000755000000000000000000000000012674201751023755 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-with-env/verify.bsh0000644000000000000000000000131612674201751025760 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "1 tests, 1 assertions, 0 failures, 0 errors"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } File file = new File( basedir, "target/surefire-reports/TEST-runit-1.7.8--1.9.xml"); if ( !file.exists() ) { throw new RuntimeException( "file does not exists: '" + file.getAbsolutePath() + "'" ); } file = new File( basedir, "target/surefire-reports/TEST-runit-1.7.13--1.9.xml"); if ( !file.exists() ) { throw new RuntimeException( "file does not exists: '" + file.getAbsolutePath() + "'" ); } ./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-with-env/pom.xml0000644000000000000000000000153112674201751025272 0ustar 4.0.0 de.saumya.mojo runit-pom testing de.saumya.mojo runit-maven-plugin @project.version@ 123 1.7.8,1.7.13 test ./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-with-env/test/0000755000000000000000000000000012674201751024734 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-with-env/test/simple_test.rb0000644000000000000000000000014712674201751027613 0ustar class SimpleTest < Test::Unit::TestCase def test_it assert ENV['VERSION'] == '123' end end ./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-with-env/invoker.properties0000644000000000000000000000006112674201751027545 0ustar invoker.goals = test invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-with-jar-dependencies/0000755000000000000000000000000012674201751026365 5ustar ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-with-jar-dependencies/verify.bsh./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-with-jar-dependencies/verify.bs0000644000000000000000000000165412674201751030225 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "1 tests, 1 assertions, 0 failures, 0 errors, 0 skips"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } expected = "1 tests, 1 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } File f = new File( new File( new File( basedir, "target" ), "surefire-reports" ), "TEST-runit-9.0.1.0.xml" ); if ( !f.exists() ) { throw new RuntimeException( "file does not exists: " + f ); } f = new File( new File( new File( basedir, "target" ), "surefire-reports" ), "TEST-runit-1.7.22--1.9.xml" ); if ( !f.exists() ) { throw new RuntimeException( "file does not exists: " + f ); } ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-with-jar-dependencies/test.properties./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-with-jar-dependencies/test.prop0000644000000000000000000000003512674201751030244 0ustar jruby.versions=1.7.22,9.0.1.0./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-with-jar-dependencies/pom.xml0000644000000000000000000000212212674201751027677 0ustar 4.0.0 de.saumya.mojo runit-pom testing rubygems-releases http://rubygems-proxy.torquebox.org/releases rubygems leafy-complete 0.6.2 gem de.saumya.mojo runit-maven-plugin @project.version@ test ./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-with-jar-dependencies/test/0000755000000000000000000000000012674201751027344 5ustar ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-with-jar-dependencies/test/simple_test.rb./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-with-jar-dependencies/test/simp0000644000000000000000000000015012674201751030233 0ustar class SimpleTest < Test::Unit::TestCase def test_it assert require('leafy/metrics') end end ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-with-jar-dependencies/invoker.properties./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-with-jar-dependencies/invoker.p0000644000000000000000000000006112674201751030220 0ustar invoker.goals = test invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-18_19_20/0000755000000000000000000000000012674201751023256 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-18_19_20/verify.bsh0000644000000000000000000000245112674201751025262 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "mode 1.8: 1 tests, 1 assertions, 0 failures, 0 errors"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } expected = "mode 1.9: 1 tests, 1 assertions, 0 failures, 0 errors, 0 skips"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } expected = "mode 2.0: 1 tests, 1 assertions, 0 failures, 0 errors, 0 skips"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } File file = new File( basedir, "target/surefire-reports/TEST-runit-1.7.5--1.8.xml"); if ( !file.exists() ) { throw new RuntimeException( "file does not exists: '" + file.getAbsolutePath() + "'" ); } file = new File( basedir, "target/surefire-reports/TEST-runit-1.7.5--1.9.xml"); if ( !file.exists() ) { throw new RuntimeException( "file does not exists: '" + file.getAbsolutePath() + "'" ); } file = new File( basedir, "target/surefire-reports/TEST-runit-1.7.5--2.0.xml"); if ( !file.exists() ) { throw new RuntimeException( "file does not exists: '" + file.getAbsolutePath() + "'" ); } ./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-18_19_20/test.properties0000644000000000000000000000011612674201751026351 0ustar jruby.modes=18,19,20 # to allow the verify script to work jruby.version=1.7.5 ./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-18_19_20/pom.xml0000644000000000000000000000132712674201751024576 0ustar 4.0.0 de.saumya.mojo runit-pom testing de.saumya.mojo runit-maven-plugin @project.version@ test ./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-18_19_20/test/0000755000000000000000000000000012674201751024235 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-18_19_20/test/simple_test.rb0000644000000000000000000000012412674201751027107 0ustar class SimpleTest < Test::Unit::TestCase def test_it assert true end end ./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/runit-18_19_20/invoker.properties0000644000000000000000000000006112674201751027046 0ustar invoker.goals = test invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/src/it/settings.xml0000644000000000000000000000220412674201751023435 0ustar it-repo true local.central @localRepositoryUrl@ true true local.rubygems @localRepositoryUrl@ true false local.central @localRepositoryUrl@ true true ./jruby-maven-plugins-1.1.5.ds1.orig/runit-maven-plugin/pom.xml0000644000000000000000000000111412674201751021164 0ustar 4.0.0 test-parent-mojo de.saumya.mojo 1.1.5 ../test-parent-mojo/pom.xml runit-maven-plugin maven-plugin RUnit Maven Mojo ./jruby-maven-plugins-1.1.5.ds1.orig/eclipse-code-style.xml0000644000000000000000000006775712674201751020353 0ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/0000755000000000000000000000000012674201751021035 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/0000755000000000000000000000000012674201751021624 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/main/0000755000000000000000000000000012674201751022550 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/main/java/0000755000000000000000000000000012674201751023471 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/main/java/de/0000755000000000000000000000000012674201751024061 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/main/java/de/saumya/0000755000000000000000000000000012674201751025360 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/main/java/de/saumya/mojo/0000755000000000000000000000000012674201751026324 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/main/java/de/saumya/mojo/assembly/0000755000000000000000000000000012674201751030143 5ustar ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/main/java/de/saumya/mojo/assembly/Main.java./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/main/java/de/saumya/mojo/assembly/0000644000000000000000000000113712674201751030147 0ustar package de.saumya.mojo.assembly; import javax.script.ScriptEngine; import javax.script.ScriptEngineManager; public class Main { public static void main(String... args) throws Exception { if (args.length == 0){ System.err.println("missing name of bin-script as argument"); System.exit(-1); } ScriptEngineManager manager = new ScriptEngineManager(); ScriptEngine engine = manager.getEngineByName("jruby"); engine.eval("require 'rubygems'"); engine.eval("ARGV.delete_at(0)"); engine.eval("load '" + args[0] + "'"); } } ./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/main/resources/0000755000000000000000000000000012674201751024562 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/main/resources/assemblies/0000755000000000000000000000000012674201751026711 5ustar ././@LongLink0000644000000000000000000000017700000000000011610 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/main/resources/assemblies/jar-with-dependencies-and-gems.xml./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/main/resources/assemblies/jar-with0000644000000000000000000000243712674201751030367 0ustar jar-with-dependencies-and-gems jar false / ${project.basedir}/bin * / ${gem.home}/bin * / ${gem.home} gems/** specifications/** / true true runtime *:gem:* ././@LongLink0000644000000000000000000000020300000000000011576 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/main/resources/assemblies/jar-with-dependencies-without-gems.xml./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/main/resources/assemblies/jar-with0000644000000000000000000000104512674201751030361 0ustar jar-with-dependencies-without-gems jar false / true true runtime *:gem:* ./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/0000755000000000000000000000000012674201751022240 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-with-gems/0000755000000000000000000000000012674201751027401 5ustar ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-with-gems/verify.bsh./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-with-gems/veri0000644000000000000000000000067012674201751030274 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "hello ruby world"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } expected = "Hello Java World!"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); }././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-with-gems/ruby-world/./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-with-gems/ruby0000755000000000000000000000000012674201751030303 5ustar ././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-with-gems/ruby-world/pom.xml./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-with-gems/ruby0000644000000000000000000000152312674201751030306 0ustar 4.0.0 rubygems ruby-world 0.0.0 gem rubygems-releases http://rubygems-proxy.torquebox.org/releases de.saumya.mojo gem-maven-plugin @project.parent.version@ true ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-with-gems/ruby-world/lib/./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-with-gems/ruby0000755000000000000000000000000012674201751030303 5ustar ././@LongLink0000644000000000000000000000017000000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-with-gems/ruby-world/lib/hello.rb./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-with-gems/ruby0000644000000000000000000000007312674201751030305 0ustar class Hello def world "hello ruby world" end end ././@LongLink0000644000000000000000000000017600000000000011607 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-with-gems/ruby-world/ruby-world.gemspec./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-with-gems/ruby0000644000000000000000000000025412674201751030306 0ustar # create by maven - leave it as is Gem::Specification.new do |s| s.name = 'ruby-world' s.version = '0.0.0' s.summary = 'ruby-world' s.files = Dir['lib/**/*'] end././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-with-gems/pom.xml./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-with-gems/pom.0000644000000000000000000000107212674201751030175 0ustar 4.0.0 com.example small-project pom 0.0.0 play ground for gem testing java-world ruby-world application ././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-with-gems/invoker.properties./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-with-gems/invo0000644000000000000000000000006512674201751030300 0ustar invoker.goals = install invoker.mavenOpts = -client ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-with-gems/java-world/./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-with-gems/java0000755000000000000000000000000012674201751030243 5ustar ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-with-gems/java-world/src/./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-with-gems/java0000755000000000000000000000000012674201751030243 5ustar ././@LongLink0000644000000000000000000000016500000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-with-gems/java-world/src/main/./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-with-gems/java0000755000000000000000000000000012674201751030243 5ustar ././@LongLink0000644000000000000000000000017200000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-with-gems/java-world/src/main/java/./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-with-gems/java0000755000000000000000000000000012674201751030243 5ustar ././@LongLink0000644000000000000000000000017600000000000011607 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-with-gems/java-world/src/main/java/com/./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-with-gems/java0000755000000000000000000000000012674201751030243 5ustar ././@LongLink0000644000000000000000000000020600000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-with-gems/java-world/src/main/java/com/example/./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-with-gems/java0000755000000000000000000000000012674201751030243 5ustar ././@LongLink0000644000000000000000000000022000000000000011575 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-with-gems/java-world/src/main/java/com/example/Hello.java./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-with-gems/java0000644000000000000000000000022312674201751030242 0ustar package com.example; /** * Hello world! * */ public class Hello { public String world() { return "Hello Java World!"; } } ././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-with-gems/java-world/pom.xml./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-with-gems/java0000644000000000000000000000062512674201751030250 0ustar 4.0.0 com.example java-world jar 0.0.0 java-world ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-with-gems/application/./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-with-gems/appl0000755000000000000000000000000012674201751030256 5ustar ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-with-gems/application/bin/./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-with-gems/appl0000755000000000000000000000000012674201751030256 5ustar ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-with-gems/application/bin/hello./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-with-gems/appl0000644000000000000000000000012612674201751030257 0ustar require 'hello' puts Hello.new.world require 'java' puts com.example.Hello.new.world ././@LongLink0000644000000000000000000000016400000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-with-gems/application/pom.xml./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-with-gems/appl0000644000000000000000000000611512674201751030263 0ustar 4.0.0 rubygems application 0.0.0 jar rubygems-releases http://rubygems-proxy.torquebox.org/releases rubygems ruby-world 0.0.0 gem com.example java-world 0.0.0 org.jruby jruby-complete 1.6.6 de.saumya.mojo gem-assembly-descriptors @project.version@ runtime ${project.build.directory}/rubygems de.saumya.mojo gem-maven-plugin @project.parent.version@ initialize maven-assembly-plugin 2.2-beta-5 jar-with-dependencies-and-gems de.saumya.mojo.assembly.Main package assembly de.saumya.mojo gem-assembly-descriptors @project.version@ org.codehaus.mojo exec-maven-plugin 1.1 verify exec java -jar ${project.build.directory}/${project.build.finalName}-jar-with-dependencies-and-gems.jar hello ././@LongLink0000644000000000000000000000020000000000000011573 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-with-gems/application/application.gemspec./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-with-gems/appl0000644000000000000000000000027312674201751030262 0ustar # create by maven - leave it as is Gem::Specification.new do |s| s.name = 'application' s.version = '0.0.0' s.summary = 'application' s.add_dependency 'ruby-world', '0.0.0' end./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-without-gems/0000755000000000000000000000000012674201751030131 5ustar ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-without-gems/verify.bsh./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-without-gems/v0000644000000000000000000000067412674201751030330 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "no ruby hello found"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } expected = "Hello Java World!"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-without-gems/ruby-world/./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-without-gems/r0000755000000000000000000000000012674201751030313 5ustar ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-without-gems/ruby-world/pom.xml./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-without-gems/r0000644000000000000000000000152312674201751030316 0ustar 4.0.0 rubygems ruby-world 0.0.0 gem rubygems-releases http://rubygems-proxy.torquebox.org/releases de.saumya.mojo gem-maven-plugin @project.parent.version@ true ././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-without-gems/ruby-world/lib/./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-without-gems/r0000755000000000000000000000000012674201751030313 5ustar ././@LongLink0000644000000000000000000000017300000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-without-gems/ruby-world/lib/hello.rb./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-without-gems/r0000644000000000000000000000007312674201751030315 0ustar class Hello def world "hello ruby world" end end ././@LongLink0000644000000000000000000000020100000000000011574 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-without-gems/ruby-world/ruby-world.gemspec./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-without-gems/r0000644000000000000000000000025412674201751030316 0ustar # create by maven - leave it as is Gem::Specification.new do |s| s.name = 'ruby-world' s.version = '0.0.0' s.summary = 'ruby-world' s.files = Dir['lib/**/*'] end././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-without-gems/pom.xml./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-without-gems/p0000644000000000000000000000107212674201751030313 0ustar 4.0.0 com.example small-project pom 0.0.0 play ground for gem testing java-world ruby-world application ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-without-gems/invoker.properties./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-without-gems/i0000644000000000000000000000006512674201751030305 0ustar invoker.goals = install invoker.mavenOpts = -client ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-without-gems/java-world/./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-without-gems/j0000755000000000000000000000000012674201751030303 5ustar ././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-without-gems/java-world/src/./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-without-gems/j0000755000000000000000000000000012674201751030303 5ustar ././@LongLink0000644000000000000000000000017000000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-without-gems/java-world/src/main/./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-without-gems/j0000755000000000000000000000000012674201751030303 5ustar ././@LongLink0000644000000000000000000000017500000000000011606 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-without-gems/java-world/src/main/java/./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-without-gems/j0000755000000000000000000000000012674201751030303 5ustar ././@LongLink0000644000000000000000000000020100000000000011574 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-without-gems/java-world/src/main/java/com/./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-without-gems/j0000755000000000000000000000000012674201751030303 5ustar ././@LongLink0000644000000000000000000000021100000000000011575 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-without-gems/java-world/src/main/java/com/example/./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-without-gems/j0000755000000000000000000000000012674201751030303 5ustar ././@LongLink0000644000000000000000000000022300000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-without-gems/java-world/src/main/java/com/example/Hello.java./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-without-gems/j0000644000000000000000000000022312674201751030302 0ustar package com.example; /** * Hello world! * */ public class Hello { public String world() { return "Hello Java World!"; } } ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-without-gems/java-world/pom.xml./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-without-gems/j0000644000000000000000000000120112674201751030277 0ustar 4.0.0 com.example java-world jar 0.0.0 java-world maven-compiler-plugin 3.1 1.6 1.6 ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-without-gems/application/./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-without-gems/a0000755000000000000000000000000012674201751030272 5ustar ././@LongLink0000644000000000000000000000016400000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-without-gems/application/src/./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-without-gems/a0000755000000000000000000000000012674201751030272 5ustar ././@LongLink0000644000000000000000000000017100000000000011602 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-without-gems/application/src/main/./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-without-gems/a0000755000000000000000000000000012674201751030272 5ustar ././@LongLink0000644000000000000000000000017600000000000011607 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-without-gems/application/src/main/java/./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-without-gems/a0000755000000000000000000000000012674201751030272 5ustar ././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-without-gems/application/src/main/java/com/./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-without-gems/a0000755000000000000000000000000012674201751030272 5ustar ././@LongLink0000644000000000000000000000021200000000000011576 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-without-gems/application/src/main/java/com/example/./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-without-gems/a0000755000000000000000000000000012674201751030272 5ustar ././@LongLink0000644000000000000000000000022300000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-without-gems/application/src/main/java/com/example/assembly/./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-without-gems/a0000755000000000000000000000000012674201751030272 5ustar ././@LongLink0000644000000000000000000000023400000000000011602 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-without-gems/application/src/main/java/com/example/assembly/Main.java./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-without-gems/a0000644000000000000000000000116412674201751030276 0ustar package com.example.assembly; import com.example.Hello; import javax.script.ScriptEngine; import javax.script.ScriptEngineManager; import javax.script.SimpleBindings; class Main { public static void main(String... args) throws Exception { ScriptEngineManager manager = new ScriptEngineManager(); ScriptEngine engine = manager.getEngineByName("jruby"); engine.eval("require 'rubygems';"); System.out.println(engine.eval("begin\n" + "require 'hello'\n" + "Hello.new.world\n" + "rescue LoadError\n" + "'no ruby hello found'\n" + "end")); System.out.println(new Hello().world()); } } ././@LongLink0000644000000000000000000000016400000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-without-gems/application/bin/./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-without-gems/a0000755000000000000000000000000012674201751030272 5ustar ././@LongLink0000644000000000000000000000017100000000000011602 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-without-gems/application/bin/hello./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-without-gems/a0000644000000000000000000000022212674201751030270 0ustar begin require 'hello' puts Hello.new.world rescue LoadError puts 'no ruby hello found' end require 'java' puts com.example.Hello.new.world ././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-without-gems/application/pom.xml./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-without-gems/a0000644000000000000000000000622012674201751030274 0ustar 4.0.0 rubygems application 0.0.0 jar rubygems-releases http://rubygems-proxy.torquebox.org/releases rubygems ruby-world 0.0.0 gem com.example java-world 0.0.0 org.jruby jruby-complete 1.6.6 de.saumya.mojo gem-assembly-descriptors @project.version@ runtime maven-compiler-plugin 3.1 1.6 1.6 de.saumya.mojo gem-maven-plugin @project.parent.version@ initialize maven-assembly-plugin 2.2-beta-5 jar-with-dependencies-without-gems com.example.assembly.Main package assembly de.saumya.mojo gem-assembly-descriptors @project.version@ org.codehaus.mojo exec-maven-plugin 1.1 verify exec java -jar ${project.build.directory}/${project.build.finalName}-jar-with-dependencies-without-gems.jar ././@LongLink0000644000000000000000000000020300000000000011576 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-without-gems/application/application.gemspec./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/assemble-project-without-gems/a0000644000000000000000000000027312674201751030276 0ustar # create by maven - leave it as is Gem::Specification.new do |s| s.name = 'application' s.version = '0.0.0' s.summary = 'application' s.add_dependency 'ruby-world', '0.0.0' end./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/src/it/settings.xml0000644000000000000000000000221512674201751024622 0ustar it-repo true local.central @localRepositoryUrl@ true true local.rubygems-releases @localRepositoryUrl@ true false local.central @localRepositoryUrl@ true true ./jruby-maven-plugins-1.1.5.ds1.orig/gem-assembly-descriptors/pom.xml0000644000000000000000000000645212674201751022361 0ustar 4.0.0 jruby-maven-plugins de.saumya.mojo 1.1.5 gem-assembly-descriptors 1.1.5 Assembly Descriptors with the Gems org.jruby jruby-complete ${jruby.version} de.saumya.mojo gem-maven-plugin ${project.version} test org.eclipse.m2e lifecycle-mapping 1.0.0 org.apache.maven.plugins maven-plugin-plugin [2.5.1,) helpmojo org.codehaus.mojo build-helper-maven-plugin [1.4,) add-source integration-test true install maven-invoker-plugin 1.5 src/it ${project.build.directory}/it setup.bsh verify.bsh integration-test install run all false ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/0000755000000000000000000000000012674201751017644 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/0000755000000000000000000000000012674201751020433 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/main/0000755000000000000000000000000012674201751021357 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/main/java/0000755000000000000000000000000012674201751022300 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/main/java/de/0000755000000000000000000000000012674201751022670 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/main/java/de/saumya/0000755000000000000000000000000012674201751024167 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/main/java/de/saumya/mojo/0000755000000000000000000000000012674201751025133 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/main/java/de/saumya/mojo/jruby/0000755000000000000000000000000012674201751026266 5ustar ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/main/java/de/saumya/mojo/jruby/AbstractJRubyMojo.java./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/main/java/de/saumya/mojo/jruby/AbstractJ0000644000000000000000000003636312674201751030101 0ustar package de.saumya.mojo.jruby; import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Set; import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.DependencyResolutionRequiredException; import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.artifact.resolver.ArtifactResolutionRequest; import org.apache.maven.model.Dependency; import org.apache.maven.model.Resource; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.plugins.annotations.Component; import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.project.MavenProject; import org.apache.maven.repository.RepositorySystem; import org.codehaus.classworlds.ClassRealm; import org.codehaus.classworlds.NoSuchRealmException; import org.sonatype.plexus.build.incremental.BuildContext; import de.saumya.mojo.ruby.Logger; import de.saumya.mojo.ruby.script.ScriptException; import de.saumya.mojo.ruby.script.ScriptFactory; /** * Base for all JRuby mojos. */ //@Mojo( requiresProject = true ) public abstract class AbstractJRubyMojo extends AbstractMojo { protected static final String JRUBY_COMPLETE = "jruby-complete"; protected static final String JRUBY_CORE = "jruby-core"; protected static final String JRUBY_STDLIB = "jruby-stdlib"; protected static final String DEFAULT_JRUBY_VERSION = "1.7.22"; /** * common arguments */ @Parameter( property = "args") protected String args; /** * jvm arguments for the java command executing jruby */ @Parameter( property = "jruby.jvmargs") protected String jrubyJvmArgs; /** * switches for the jruby command, like '--1.9' */ @Parameter( property = "jruby.switches") protected String jrubySwitches; /** * environment values passed on to the jruby process. needs jrubyFork true. */ @Parameter( property = "jruby.env") protected Map env; /** * if the pom.xml has no runtime dependency to a jruby-complete.jar then * this version is used to resolve the jruby-complete dependency from the * local/remote maven repository. it overwrites the jruby version from * the dependencies if any. i.e. you can easily switch jruby version from the commandline ! * * default see {@code DEFAULT_JRUBY_VERSION} */ // no defaultVersion here since we treat null as default later on @Parameter( property = "jruby.version" ) private String jrubyVersion; /** * fork the JRuby execution. */ @Parameter( property = "jruby.fork", defaultValue = "true") protected boolean jrubyFork; /** * verbose jruby related output */ @Parameter( property = "jruby.verbose", defaultValue = "false") protected boolean jrubyVerbose; /** * directory with ruby sources - added to java classpath and ruby loadpath */ @Parameter( property = "jruby.sourceDirectory", defaultValue = "src/main/ruby") protected File rubySourceDirectory; /** * directory with ruby sources - added to ruby loadpath only */ @Parameter( property = "jruby.lib", defaultValue = "lib") protected File libDirectory; /** * the launch directory for the JRuby execution. */ @Parameter( property = "jruby.launchDirectory", defaultValue = "${project.basedir}") private File launchDirectory; /** * reference to maven project for internal use. */ @Parameter( defaultValue = "${project}", readonly = true ) protected MavenProject project; /** * add project class path to JVM classpath on executing jruby. */ @Parameter( defaultValue = "true", property = "jruby.addProjectClasspath" ) protected boolean addProjectClasspath; /** * local repository for internal use. */ @Parameter( readonly = true, defaultValue="${localRepository}" ) protected ArtifactRepository localRepository; /** * classrealm for internal use. */ @Parameter( readonly = true, defaultValue="${dummy}" ) protected ClassRealm classRealm; @Component protected RepositorySystem repositorySystem; protected Logger logger; protected ScriptFactory factory; private JRubyVersion jRubyVersion; @Component private BuildContext buildContext; @Parameter( property="m2e.jruby.watch" ) protected List eclipseWatches = new ArrayList(); @Parameter( property="m2e.jruby.refresh" ) protected List eclipseRefresh = new ArrayList(); protected String getDefaultJRubyVersion() { return DEFAULT_JRUBY_VERSION; } protected JRubyVersion getJrubyVersion() { if (jRubyVersion == null ) { this.jRubyVersion = new JRubyVersion( jrubyVersion == null ? getDefaultJRubyVersion() : jrubyVersion ); } return jRubyVersion; } private ScriptFactory newScriptFactory() throws MojoExecutionException { ScriptFactory factory = createScriptFactory(); if( env != null ){ for( Map.Entry entry: env.entrySet() ){ factory.addEnv( entry.getKey(), entry.getValue() ); } } return factory; } private ScriptFactory createScriptFactory() throws MojoExecutionException { try { classRealm.getWorld().disposeRealm("jruby-all"); } catch( NoSuchRealmException ignore ) { // ignore } try { ClassRealm realm = classRealm.getWorld().newRealm("jruby-all"); for (String path : getProjectClasspath()) { realm.addConstituent(new File(path).toURI().toURL()); } if (this.jrubyVersion != null) { // preference to command line or property version return newScriptFactory( resolveJRubyCompleteArtifact(this.jrubyVersion) ); } // check if there is jruby present Class clazz = realm.loadClass("org.jruby.runtime.Constants"); if ( jrubyVerbose ){ String version = clazz.getField( "VERSION" ).get(clazz).toString(); getLog().info("found jruby on classpath"); getLog().info("jruby version : " + version); } this.classRealm = realm; return newScriptFactory( null ); } catch (final Exception e) { //TODO debug //e.printStackTrace(); try { return newScriptFactory(resolveJRubyArtifact()); } catch (final DependencyResolutionRequiredException ee) { throw new MojoExecutionException("could not resolve jruby", e); } } } protected ScriptFactory newScriptFactory(Artifact artifact) throws MojoExecutionException { try { final ScriptFactory factory = artifact == null ? new ScriptFactory(this.logger, this.classRealm, null, getProjectClasspath(), this.jrubyFork): (JRUBY_CORE.equals(artifact.getArtifactId()) ? new ScriptFactory(this.logger, this.classRealm, artifact.getFile(), resolveJRubyStdlibArtifact(artifact).getFile(), getProjectClasspath(), this.jrubyFork) : new ScriptFactory(this.logger, this.classRealm, artifact.getFile(), getProjectClasspath(), this.jrubyFork) ); if(libDirectory != null && libDirectory.exists()){ if(jrubyVerbose){ getLog().info("add to ruby loadpath: " + libDirectory.getAbsolutePath()); } // add it to the load path for all scripts using that factory factory.addSwitch("-I", libDirectory.getAbsolutePath()); } if(rubySourceDirectory != null && rubySourceDirectory.exists()){ if(jrubyVerbose){ getLog().info("add to ruby loadpath: " + rubySourceDirectory.getAbsolutePath()); } // add it to the load path for all scripts using that factory factory.addSwitch("-I", rubySourceDirectory.getAbsolutePath()); } return factory; } catch (final DependencyResolutionRequiredException e) { throw new MojoExecutionException("could not resolve jruby", e); } catch (final ScriptException e) { throw new MojoExecutionException( "could not initialize script factory", e); } catch (final IOException e) { throw new MojoExecutionException( "could not initialize script factory", e); } } public void execute() throws MojoExecutionException, MojoFailureException { boolean shouldCheckChanges = buildContext.isIncremental() && !eclipseWatches.isEmpty(); if (shouldCheckChanges && !buildContext.hasDelta(eclipseWatches)) { return; } System.setProperty("jbundle.skip", "true"); this.logger = new MojoLogger(this.jrubyVerbose, getLog()); this.factory = newScriptFactory(); // skip installing jars via jbundler this.factory.addEnv("JBUNDLE_SKIP", "true"); // skip installing jars via jar-dependencies this.factory.addEnv("JARS_SKIP", "true"); this.factory.addJvmArgs(this.jrubyJvmArgs); this.factory.addSwitches(this.jrubySwitches); if(rubySourceDirectory != null && rubySourceDirectory.exists()){ if(jrubyVerbose){ getLog().info("add to java classpath: " + rubySourceDirectory.getAbsolutePath()); } // add it to the classpath so java classes can find the ruby files Resource resource = new Resource(); resource.setDirectory(rubySourceDirectory.getAbsolutePath()); project.getBuild().getResources().add(resource); } try { executeJRuby(); } catch (final IOException e) { throw new MojoExecutionException("error in executing jruby", e); } catch (final ScriptException e) { throw new MojoExecutionException("error in executing jruby", e); } finally { // ensure that eclipse update any changes, include errors reports if (!eclipseRefresh.isEmpty()) { for (String fileName : eclipseRefresh) { File file = new File(fileName); buildContext.refresh(file);; } } } } abstract protected void executeJRuby() throws MojoExecutionException, MojoFailureException, IOException, ScriptException; protected File launchDirectory() { if (this.launchDirectory == null) { this.launchDirectory = this.project.getBasedir(); if (this.launchDirectory == null || !this.launchDirectory.exists()) { this.launchDirectory = new File(System.getProperty("user.dir")); } } return this.launchDirectory; } protected Artifact resolveJRubyCompleteArtifact(final String version) throws DependencyResolutionRequiredException { getLog().debug("resolve jruby for version " + version); final Artifact artifact = this.repositorySystem.createArtifact( "org.jruby", JRUBY_COMPLETE, version, "jar"); return resolveJRubyArtifact(artifact); } private Artifact resolveJRubyArtifact(final Artifact artifact) throws DependencyResolutionRequiredException { final ArtifactResolutionRequest request = new ArtifactResolutionRequest(); request.setArtifact(artifact); request.setLocalRepository(this.localRepository); request.setRemoteRepositories(this.project.getRemoteArtifactRepositories()); this.repositorySystem.resolve(request); if (this.jrubyVerbose) { getLog().info("jruby version : " + artifact.getVersion()); } // set it so other plugins can retrieve the version in use this.jrubyVersion = artifact.getVersion(); return artifact; } protected Artifact resolveJRubyArtifact() throws DependencyResolutionRequiredException, MojoExecutionException { if (this.jrubyVersion != null) { // preference to command line or property version return resolveJRubyCompleteArtifact(this.jrubyVersion); } else { // then take jruby from the dependencies either jruby-complete or jruby-core for (final Dependency artifact : this.project.getDependencies()) { if ((artifact.getArtifactId().equals(JRUBY_COMPLETE) || artifact.getArtifactId().equals(JRUBY_CORE)) // TODO this condition is not needed ? && !artifact.getScope().equals(Artifact.SCOPE_PROVIDED) && !artifact.getScope().equals(Artifact.SCOPE_SYSTEM)) { return resolveJRubyArtifact(this.repositorySystem .createArtifact(artifact.getGroupId(), artifact .getArtifactId(), artifact.getVersion(), artifact.getType())); } } } // finally fall back on the default version of jruby return resolveJRubyCompleteArtifact(getDefaultJRubyVersion()); } protected Artifact resolveJRubyStdlibArtifact(Artifact jruby) throws DependencyResolutionRequiredException, MojoExecutionException { final ArtifactResolutionRequest request = new ArtifactResolutionRequest(); for (final Dependency artifact : this.project.getDependencies()) { if (artifact.getArtifactId().equals(JRUBY_STDLIB) // TODO this condition is not needed ? && !artifact.getScope().equals(Artifact.SCOPE_PROVIDED) && !artifact.getScope().equals(Artifact.SCOPE_SYSTEM)) { request.setArtifact(this.repositorySystem .createArtifact(artifact.getGroupId(), artifact .getArtifactId(), artifact.getVersion(), artifact.getType())); break; } } if (request.getArtifact() == null){ request.setResolveTransitively(true); request.setArtifact(jruby); } request.setLocalRepository(this.localRepository); request.setRemoteRepositories(this.project.getRemoteArtifactRepositories()); Set set = this.repositorySystem.resolve(request).getArtifacts(); for (Artifact a: set){ if (JRUBY_STDLIB.equals(a.getArtifactId())) { return a; } } throw new MojoExecutionException("failed to resolve jruby stdlib artifact"); } protected List getProjectClasspath() throws DependencyResolutionRequiredException { if (addProjectClasspath) { return project.getTestClasspathElements(); } else { return new ArrayList(); } } } ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/main/java/de/saumya/mojo/jruby/MojoLogger.java./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/main/java/de/saumya/mojo/jruby/MojoLogge0000644000000000000000000000146212674201751030076 0ustar /** * */ package de.saumya.mojo.jruby; import org.apache.maven.plugin.logging.Log; import de.saumya.mojo.ruby.Logger; public class MojoLogger implements Logger { private final boolean verbose; private final Log log; public MojoLogger(final boolean verbose, final Log log) { this.verbose = verbose; this.log = log; } public void debug(final CharSequence content) { if (this.verbose) { this.log.info(content); } else { this.log.debug(content); } } public void info(final CharSequence content) { this.log.info(content); } public void warn(final CharSequence content) { this.log.warn(content); } public void error(final CharSequence content) { this.log.error(content); } }././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/main/java/de/saumya/mojo/jruby/CompileMojo.java./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/main/java/de/saumya/mojo/jruby/CompileMo0000644000000000000000000000715412674201751030104 0ustar package de.saumya.mojo.jruby; import java.io.File; import java.io.IOException; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugins.annotations.LifecyclePhase; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.plugins.annotations.ResolutionScope; import de.saumya.mojo.ruby.script.Script; import de.saumya.mojo.ruby.script.ScriptException; /** * executes the compiles ruby classes to java bytecode (jrubyc). * *
    * * NOTE: this goal uses only a small subset of the features of jrubyc. */ @Mojo( name = "compile", defaultPhase = LifecyclePhase.COMPILE, requiresDependencyResolution = ResolutionScope.COMPILE, requiresProject = true ) public class CompileMojo extends AbstractJRubyMojo { /** * directory where to find the ruby files */ @Deprecated @Parameter protected File rubyDirectory; /** * where the compiled class files are written unless you choose to generate * java classes (needs >=jruby-1.5). default is the same as for java * classes. */ @Parameter( property = "project.build.outputDirectory", defaultValue = "${project.build.outputDirectory}" ) protected File outputDirectory; /** * do not fail the goal */ @Parameter( property = "jrubyc.ignoreFailue", defaultValue = "false" ) protected boolean ignoreFailures; /** * just generate java classes and add them to the maven source path */ @Parameter( property = "jrubyc.generateJava", defaultValue = "false" ) protected boolean generateJava; /** * where the java files (needs >=jruby-1.5). */ @Parameter( defaultValue = "${basedir}/target/jrubyc-generated-sources" ) protected File generatedJavaDirectory; /** * verbose jrubyc related output (only with > jruby-1.6.x) */ @Parameter( property = "jrubyc.verbose", defaultValue = "false" ) private boolean jrubycVerbose; @Override public void executeJRuby() throws MojoExecutionException, IOException, ScriptException { if(rubyDirectory != null){ getLog().warn("please use rubySourceDirectory instead"); } if (this.generateJava) { if (!this.generatedJavaDirectory.exists()) { this.generatedJavaDirectory.mkdirs(); } this.project.addCompileSourceRoot(this.generatedJavaDirectory .getAbsolutePath()); } else if (!this.outputDirectory.exists()) { this.outputDirectory.mkdirs(); } final Script script = this.factory.newScript( "\nrequire 'jruby/jrubyc'\n" + "status = JRubyCompiler::compile_argv(ARGV)\n" + "raise 'compilation-error(s)' if status !=0 && !" + this.ignoreFailures); if (this.generateJava) { script.addArg("--java") .addArg("-t", fixPathSeparator(this.generatedJavaDirectory)); } else { script.addArg("-t", fixPathSeparator(this.outputDirectory)); } if( getJrubyVersion().hasJRubycVerbose() && (this.jrubyVerbose || this.jrubycVerbose)){ script.addArg("--verbose"); } // add current directory script.addArg("."); script.executeIn(this.rubyDirectory == null? this.rubySourceDirectory : this.rubyDirectory); } private String fixPathSeparator(final File f) { // http://jira.codehaus.org/browse/JRUBY-5065 return f.getPath().replace(System.getProperty("file.separator"), "/"); } }././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/main/java/de/saumya/mojo/jruby/JRubyMojo.java./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/main/java/de/saumya/mojo/jruby/JRubyMojo0000644000000000000000000000642212674201751030075 0ustar package de.saumya.mojo.jruby; import java.io.File; import java.io.IOException; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.plugins.annotations.ResolutionScope; import de.saumya.mojo.ruby.script.Script; import de.saumya.mojo.ruby.script.ScriptException; /** * executes the jruby command. * * Deprecated: use the exec goal from gem-maven-plugin */ @Mojo( name = "jruby", requiresDependencyResolution = ResolutionScope.TEST ) @Deprecated public class JRubyMojo extends AbstractJRubyMojo { /** * arguments for the jruby command. */ @Parameter( property = "jruby.args" ) protected String jrubyArgs = null; /** * ruby code which gets executed. */ @Parameter( property = "jruby.script" ) protected String script = null; /** * ruby file which gets executed. */ @Parameter( property = "jruby.file" ) protected File file = null; /** * ruby file found on search path which gets executed. */ @Parameter( property = "jruby.filename" ) protected String filename = null; /** * output file where the standard out will be written */ @Parameter( property = "jruby.outputFile" ) protected File outputFile = null; /** * directory of gem home to use when forking JRuby. */ @Parameter( property = "gem.home", defaultValue="${project.build.directory}/rubygems" ) protected File gemHome; /** * directory of JRuby path to use when forking JRuby. */ @Parameter( property = "gem.path", defaultValue="${project.build.directory}/rubygems" ) protected File gemPath; /** * use system gems instead of setting up GemPath/GemHome inside the build directory and ignores any set * gemHome and gemPath. you need to have both GEM_HOME and GEM_PATH environment variable set to make it work. */ @Parameter( property = "gem.useSystem", defaultValue="false" ) protected boolean gemUseSystem; @Override public void executeJRuby() throws MojoExecutionException, IOException, ScriptException { if (gemHome != null && !gemUseSystem){ factory.addEnv("GEM_HOME", this.gemHome); } if (gemPath != null && !gemUseSystem){ factory.addEnv("GEM_PATH", this.gemPath); } Script s; if (this.script != null && this.script.length() > 0) { s = this.factory.newScript(this.script); } else if (this.file != null) { s = this.factory.newScript(this.file); } else if (this.filename != null) { s = this.factory.newScriptFromSearchPath( this.filename ); } else { s = this.factory.newArguments(); } s.addArgs(this.args); s.addArgs(this.jrubyArgs); if (s.isValid()) { if(outputFile != null){ s.executeIn(launchDirectory(), outputFile); } else { s.executeIn(launchDirectory()); } } else { getLog() .warn( "no arguments given. use -Dargs=... or -Djruby.script=... or -Djruby.file=..."); } } }././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/main/java/de/saumya/mojo/jruby/JRubyVersion.java./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/main/java/de/saumya/mojo/jruby/JRubyVers0000644000000000000000000000445712674201751030116 0ustar package de.saumya.mojo.jruby; public class JRubyVersion { public enum Mode { _22( "" ), _21( "" ), _20( "--2.0" ), _19( "--1.9" ), _18( "--1.8" ); public final String flag; Mode(){ this(null); } Mode( String flag ){ this.flag = flag; } public String toString(){ return flag == null? "" : flag.replace( "-", "" ); } } private final int minor; private final String version; private final int major; public JRubyVersion( String version ) { this.version = version; String v = version.replace( "-SNAPSHOT", "" ); int first = v.indexOf( '.' ); this.major = Integer.parseInt( first < 0 ? v : v.substring( 0, first ) ); int second = v.indexOf( '.', first + 1 ); if ( first < 0 || second < 0 ) { this.minor = 0; } else { int m = 0; try { m = Integer.parseInt( v.substring( first + 1, second ) ); } catch( NumberFormatException e ) { // ignore } this.minor = m; } } public Mode defaultMode() { if ( this.major == 1 ) { if (this.minor < 7) { return Mode._18; } else { return Mode._19; } } else { return Mode._22; } } public boolean hasMode( Mode mode ) { switch( mode ) { case _18: return this.major == 1; case _19: return this.major == 1 && this.minor > 5; case _20: return this.major == 1 && this.minor > 6; case _22: return this.major > 1; default: return false; } } public boolean needsOpenSSL() { return this.major == 1 && this.minor < 7; } public boolean hasJRubycVerbose() { return this.major == 1 && this.minor > 5; } public String toString() { return this.version; } public boolean equals( Object other ) { return other != null && this.version.equals( ( (JRubyVersion) other ).version ); } } ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/0000755000000000000000000000000012674201751021047 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/compile-failures/0000755000000000000000000000000012674201751024307 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/compile-failures/verify.bsh0000644000000000000000000000045212674201751026312 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "Failure during compilation"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); }./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/compile-failures/src/0000755000000000000000000000000012674201751025076 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/compile-failures/src/main/0000755000000000000000000000000012674201751026022 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/compile-failures/src/main/ruby/0000755000000000000000000000000012674201751027003 5ustar ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/compile-failures/src/main/ruby/file.rb./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/compile-failures/src/main/ruby/file.r0000644000000000000000000000003412674201751030102 0ustar class Fail blaput 'hello' ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/compile-failures/src/main/ruby/file.class./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/compile-failures/src/main/ruby/file.c0000644000000000000000000000635712674201751030101 0ustar 2src/main/ruby/file'org/jruby/ast/executable/AbstractScript setPosition%(Lorg/jruby/runtime/ThreadContext;I)Vp/home/kristian/projects/jruby-maven-plugins/jruby-maven-plugin/src/it/compilation-failures/src/main/ruby/file.rborg/jruby/runtime/ThreadContext setFileAndLine(Ljava/lang/String;I)V ()V  $classLjava/lang/Class;src.main.ruby.filejava/lang/ClassforName%(Ljava/lang/String;)Ljava/lang/Class;    filenameLjava/lang/String;  !file.rb__file__(Lsrc/main/ruby/file;Lorg/jruby/runtime/ThreadContext;Lorg/jruby/runtime/builtin/IRubyObject;[Lorg/jruby/runtime/builtin/IRubyObject;Lorg/jruby/runtime/Block;)Lorg/jruby/runtime/builtin/IRubyObject; getRuntime()Lorg/jruby/Ruby; &' (org/jruby/Ruby*getNil)()Lorg/jruby/runtime/builtin/IRubyObject; ,- +.(Lorg/jruby/runtime/ThreadContext;Lorg/jruby/runtime/builtin/IRubyObject;[Lorg/jruby/runtime/builtin/IRubyObject;Lorg/jruby/runtime/Block;)Lorg/jruby/runtime/builtin/IRubyObject; $% 1  3 getCallSite0()Lorg/jruby/runtime/CallSite; 56 7 getString0((Lorg/jruby/Ruby;)Lorg/jruby/RubyString; 9: ;org/jruby/runtime/CallSite=call(Lorg/jruby/runtime/ThreadContext;Lorg/jruby/runtime/builtin/IRubyObject;Lorg/jruby/runtime/builtin/IRubyObject;Lorg/jruby/runtime/builtin/IRubyObject;)Lorg/jruby/runtime/builtin/IRubyObject; ?@ >ALorg/jruby/anno/JRubyMethod;nameframerequiredoptionalrestloadjava/lang/StringM)org/jruby/javasupport/util/RuntimeHelpersOpreLoad7(Lorg/jruby/runtime/ThreadContext;[Ljava/lang/String;)V QR PSpostLoad$(Lorg/jruby/runtime/ThreadContext;)V UV PWjava/lang/ThrowableYmain([Ljava/lang/String;)V org/jruby/RubyInstanceConfig^ _setArgv a\ _b newInstance0(Lorg/jruby/RubyInstanceConfig;)Lorg/jruby/Ruby; de +fgetCurrentContext#()Lorg/jruby/runtime/ThreadContext; hi +j getTopSelf l- +m%org/jruby/runtime/builtin/IRubyObjecto NULL_ARRAY([Lorg/jruby/runtime/builtin/IRubyObject; qr psorg/jruby/runtime/Blocku NULL_BLOCKLorg/jruby/runtime/Block; wx vy L0 {4org/jruby/ast/executable/AbstractScript$RuntimeCache} ~ runtimeCache6Lorg/jruby/ast/executable/AbstractScript$RuntimeCache;  initCallSites(I)V ~ callSites[Lorg/jruby/runtime/CallSite; ~blaputsetFunctionalCallSiteO([Lorg/jruby/runtime/CallSite;ILjava/lang/String;)[Lorg/jruby/runtime/CallSite;  initStrings(I)[Lorg/jruby/util/ByteList; ~hellocreateByteListI([Lorg/jruby/util/ByteList;ILjava/lang/String;)[Lorg/jruby/util/ByteList; CodeLineNumberTableRuntimeVisibleAnnotations StackMapTable SourceFile! *NB***"*~Y*YW*HW $%; #+):/:+4*8+,,*<B CDs$EZFGIHIIHJIK$0 *+,-2L0;+NT*+,-2+X+XVZ [\4(Y]_Y`Y*cgYk_ntz|#./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/compile-failures/pom.xml0000644000000000000000000000113012674201751025617 0ustar 4.0.0 de.saumya.mojo jruby-version testing de.saumya.mojo jruby-maven-plugin @project.version@ ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/compile-failures/invoker.properties0000644000000000000000000000013012674201751030074 0ustar invoker.goals = ruby:compile invoker.buildResult = failure invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/jruby-version/0000755000000000000000000000000012674201751023665 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/jruby-version/verify.bsh0000644000000000000000000000043712674201751025673 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "[INFO] jruby 1."; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); }./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/jruby-version/flags.txt0000644000000000000000000000002712674201751025521 0ustar -Djruby.args=--version ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/jruby-version/test.properties0000644000000000000000000000001712674201751026760 0ustar args=--version ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/jruby-version/pom.xml0000644000000000000000000000115712674201751025206 0ustar 4.0.0 de.saumya.mojo jruby-version testing de.saumya.mojo jruby-maven-plugin @project.version@ ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/jruby-version/invoker.properties0000644000000000000000000000007012674201751027455 0ustar invoker.goals = ruby:jruby invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/jruby-version/goals.txt0000644000000000000000000000005012674201751025526 0ustar de.saumya.mojo:jruby-maven-plugin:jruby ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/simple-ruby-script-to-outputfile-somewhere/./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/simple-ruby-script-to-outputfile-some0000755000000000000000000000000012674201751030321 5ustar ././@LongLink0000644000000000000000000000016500000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/simple-ruby-script-to-outputfile-somewhere/verify.bsh./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/simple-ruby-script-to-outputfile-some0000644000000000000000000000042312674201751030322 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "log" ) ); String expected = "somewhere"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); }././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/simple-ruby-script-to-outputfile-somewhere/src/./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/simple-ruby-script-to-outputfile-some0000755000000000000000000000000012674201751030321 5ustar ././@LongLink0000644000000000000000000000016400000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/simple-ruby-script-to-outputfile-somewhere/src/main/./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/simple-ruby-script-to-outputfile-some0000755000000000000000000000000012674201751030321 5ustar ././@LongLink0000644000000000000000000000017100000000000011602 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/simple-ruby-script-to-outputfile-somewhere/src/main/ruby/./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/simple-ruby-script-to-outputfile-some0000755000000000000000000000000012674201751030321 5ustar ././@LongLink0000644000000000000000000000017700000000000011610 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/simple-ruby-script-to-outputfile-somewhere/src/main/ruby/dir.rb./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/simple-ruby-script-to-outputfile-some0000644000000000000000000000004212674201751030317 0ustar puts Dir[ File.join( '..', '*') ] ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/simple-ruby-script-to-outputfile-somewhere/pom.xml./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/simple-ruby-script-to-outputfile-some0000644000000000000000000000144212674201751030324 0ustar 4.0.0 de.saumya.mojo jruby-version testing de.saumya.mojo jruby-maven-plugin @project.version@ ${basedir}/src/main/ruby/dir.rb ${basedir}/log somewhere ././@LongLink0000644000000000000000000000016500000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/simple-ruby-script-to-outputfile-somewhere/somewhere/./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/simple-ruby-script-to-outputfile-some0000755000000000000000000000000012674201751030321 5ustar ././@LongLink0000644000000000000000000000017300000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/simple-ruby-script-to-outputfile-somewhere/somewhere/.empty./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/simple-ruby-script-to-outputfile-some0000644000000000000000000000000012674201751030311 0ustar ././@LongLink0000644000000000000000000000017500000000000011606 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/simple-ruby-script-to-outputfile-somewhere/invoker.properties./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/simple-ruby-script-to-outputfile-some0000644000000000000000000000007012674201751030320 0ustar invoker.goals = ruby:jruby invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/exec-file/0000755000000000000000000000000012674201751022710 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/exec-file/verify.bsh0000644000000000000000000000043312674201751024712 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "hello world"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); }./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/exec-file/file.rb0000644000000000000000000000002312674201751024147 0ustar puts "hello world" ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/exec-file/test.properties0000644000000000000000000000002312674201751026000 0ustar jruby.file=file.rb ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/exec-file/pom.xml0000644000000000000000000000115712674201751024231 0ustar 4.0.0 de.saumya.mojo jruby-version testing de.saumya.mojo jruby-maven-plugin @project.version@ ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/exec-file/invoker.properties0000644000000000000000000000007012674201751026500 0ustar invoker.goals = ruby:jruby invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/generate-java-and-compile/0000755000000000000000000000000012674201751025746 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/generate-java-and-compile/verify.bsh0000644000000000000000000000043512674201751027752 0ustar import java.io.*; File target = new File(basedir, "target/classes"); for(String f: new String[] { "com/example/Reply.class", "com/otherexample/MyReply.class" }){ if( !new File(target, f).exists() ){ throw new RuntimeException("file does not exists: target/classes/" + f); } }./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/generate-java-and-compile/src/0000755000000000000000000000000012674201751026535 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/generate-java-and-compile/src/test/0000755000000000000000000000000012674201751027514 5ustar ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/generate-java-and-compile/src/test/java/./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/generate-java-and-compile/src/test/ja0000755000000000000000000000000012674201751030027 5ustar ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/generate-java-and-compile/src/test/java/com/./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/generate-java-and-compile/src/test/ja0000755000000000000000000000000012674201751030027 5ustar ././@LongLink0000644000000000000000000000016400000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/generate-java-and-compile/src/test/java/com/example/./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/generate-java-and-compile/src/test/ja0000755000000000000000000000000012674201751030027 5ustar ././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/generate-java-and-compile/src/test/java/com/example/ReplyTest.java./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/generate-java-and-compile/src/test/ja0000644000000000000000000000071112674201751030030 0ustar package com.example; import junit.framework.TestCase; /** * Unit test for simple App. */ public class ReplyTest extends TestCase { /** * Create the test case * * @param testName name of the test case */ public ReplyTest( String testName ) { super( testName ); } /** * Rigourous Test :-) */ public void testApp() { com.example.Reply reply = new com.otherexample.MyReply(); } } ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/generate-java-and-compile/src/main/0000755000000000000000000000000012674201751027461 5ustar ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/generate-java-and-compile/src/main/ruby/./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/generate-java-and-compile/src/main/ru0000755000000000000000000000000012674201751030030 5ustar ././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/generate-java-and-compile/src/main/ruby/my_reply.rb./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/generate-java-and-compile/src/main/ru0000644000000000000000000000030612674201751030031 0ustar require 'java' java_import 'com.example.Reply' java_package 'com.otherexample' class MyReply java_implements Reply java_signature "String reply()" def reply "may all be happy" end end ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/generate-java-and-compile/src/main/java/./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/generate-java-and-compile/src/main/ja0000755000000000000000000000000012674201751027774 5ustar ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/generate-java-and-compile/src/main/java/com/./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/generate-java-and-compile/src/main/ja0000755000000000000000000000000012674201751027774 5ustar ././@LongLink0000644000000000000000000000016400000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/generate-java-and-compile/src/main/java/com/example/./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/generate-java-and-compile/src/main/ja0000755000000000000000000000000012674201751027774 5ustar ././@LongLink0000644000000000000000000000017600000000000011607 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/generate-java-and-compile/src/main/java/com/example/Reply.java./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/generate-java-and-compile/src/main/ja0000644000000000000000000000010412674201751027771 0ustar package com.example; public interface Reply { String reply(); } ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/generate-java-and-compile/pom.xml0000644000000000000000000000175712674201751027275 0ustar 4.0.0 de.saumya.mojo jruby-version testing org.jruby jruby-complete 1.7.20 de.saumya.mojo jruby-maven-plugin @project.version@ true process-resources compile ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/generate-java-and-compile/invoker.properties./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/generate-java-and-compile/invoker.pro0000644000000000000000000000006512674201751030146 0ustar invoker.goals = compile invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/compile-dir-156/0000755000000000000000000000000012674201751023564 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/compile-dir-156/verify.bsh0000644000000000000000000000040212674201751025562 0ustar import java.io.*; File target = new File(basedir, "target/classes"); for(String f: new String[] { "file.class", "more/hello.class" }){ if( !new File(target, f).exists() ){ throw new RuntimeException("file does not exists: target/classes" + f); } }./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/compile-dir-156/src/0000755000000000000000000000000012674201751024353 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/compile-dir-156/src/main/0000755000000000000000000000000012674201751025277 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/compile-dir-156/src/main/ruby/0000755000000000000000000000000012674201751026260 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/compile-dir-156/src/main/ruby/file.rb0000644000000000000000000000005712674201751027526 0ustar require 'more/hello' include More puts hello ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/compile-dir-156/src/main/ruby/more/0000755000000000000000000000000012674201751027222 5ustar ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/compile-dir-156/src/main/ruby/more/hello.rb./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/compile-dir-156/src/main/ruby/more/he0000644000000000000000000000006612674201751027543 0ustar module More def hello "hello world" end end ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/compile-dir-156/test.properties0000644000000000000000000000002412674201751026655 0ustar jruby.version=1.5.6 ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/compile-dir-156/pom.xml0000644000000000000000000000115712674201751025105 0ustar 4.0.0 de.saumya.mojo jruby-version testing de.saumya.mojo jruby-maven-plugin @project.version@ ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/compile-dir-156/invoker.properties0000644000000000000000000000007212674201751027356 0ustar invoker.goals = ruby:compile invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/exec-file-from-ruby-source-directory/0000755000000000000000000000000012674201751030130 5ustar ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/exec-file-from-ruby-source-directory/verify.bsh./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/exec-file-from-ruby-source-directory/0000644000000000000000000000044112674201751030131 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "hello jruby world"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); }././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/exec-file-from-ruby-source-directory/src/./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/exec-file-from-ruby-source-directory/0000755000000000000000000000000012674201751030130 5ustar ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/exec-file-from-ruby-source-directory/src/main/./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/exec-file-from-ruby-source-directory/0000755000000000000000000000000012674201751030130 5ustar ././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/exec-file-from-ruby-source-directory/src/main/ruby/./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/exec-file-from-ruby-source-directory/0000755000000000000000000000000012674201751030130 5ustar ././@LongLink0000644000000000000000000000017300000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/exec-file-from-ruby-source-directory/src/main/ruby/hello.rb./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/exec-file-from-ruby-source-directory/0000644000000000000000000000003112674201751030124 0ustar puts 'hello jruby world' ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/exec-file-from-ruby-source-directory/pom.xml./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/exec-file-from-ruby-source-directory/0000644000000000000000000000136412674201751030136 0ustar 4.0.0 com.example jruby-exec-file-from-ruby-source-directory 0.0.0 de.saumya.mojo jruby-maven-plugin @project.parent.version@ false ././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/exec-file-from-ruby-source-directory/invoker.properties./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/exec-file-from-ruby-source-directory/0000644000000000000000000000007012674201751030127 0ustar invoker.goals = ruby:jruby invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/simple-ruby-script-to-outputfile/0000755000000000000000000000000012674201751027437 5ustar ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/simple-ruby-script-to-outputfile/verify.bsh./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/simple-ruby-script-to-outputfile/veri0000644000000000000000000000043012674201751030324 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "log" ) ); String expected = "hello kristian"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); }./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/simple-ruby-script-to-outputfile/src/0000755000000000000000000000000012674201751030226 5ustar ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/simple-ruby-script-to-outputfile/src/main/./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/simple-ruby-script-to-outputfile/src/0000755000000000000000000000000012674201751030226 5ustar ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/simple-ruby-script-to-outputfile/src/main/ruby/./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/simple-ruby-script-to-outputfile/src/0000755000000000000000000000000012674201751030226 5ustar ././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/simple-ruby-script-to-outputfile/src/main/ruby/hello.rb./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/simple-ruby-script-to-outputfile/src/0000644000000000000000000000003012674201751030221 0ustar puts "hello #{ARGV[0]}" ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/simple-ruby-script-to-outputfile/pom.xml./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/simple-ruby-script-to-outputfile/pom.0000644000000000000000000000145312674201751030236 0ustar 4.0.0 de.saumya.mojo jruby-version testing de.saumya.mojo jruby-maven-plugin @project.version@ ${basedir}/src/main/ruby/hello.rb kristian ${basedir}/log ././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/simple-ruby-script-to-outputfile/invoker.properties./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/simple-ruby-script-to-outputfile/invo0000644000000000000000000000007012674201751030332 0ustar invoker.goals = ruby:jruby invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/exec-embed/0000755000000000000000000000000012674201751023045 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/exec-embed/verify.bsh0000644000000000000000000000043312674201751025047 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "hello world"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); }./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/exec-embed/test.properties0000644000000000000000000000004112674201751026135 0ustar jruby.script=puts("hello world") ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/exec-embed/pom.xml0000644000000000000000000000113012674201751024355 0ustar 4.0.0 de.saumya.mojo jruby-version testing de.saumya.mojo jruby-maven-plugin @project.version@ ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/exec-embed/invoker.properties0000644000000000000000000000007012674201751026635 0ustar invoker.goals = ruby:jruby invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/compile-failures-but-ignore-failures/0000755000000000000000000000000012674201751030170 5ustar ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/compile-failures-but-ignore-failures/verify.bsh./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/compile-failures-but-ignore-failures/0000644000000000000000000000045212674201751030173 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "Failure during compilation"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); }././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/compile-failures-but-ignore-failures/src/./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/compile-failures-but-ignore-failures/0000755000000000000000000000000012674201751030170 5ustar ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/compile-failures-but-ignore-failures/src/main/./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/compile-failures-but-ignore-failures/0000755000000000000000000000000012674201751030170 5ustar ././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/compile-failures-but-ignore-failures/src/main/ruby/./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/compile-failures-but-ignore-failures/0000755000000000000000000000000012674201751030170 5ustar ././@LongLink0000644000000000000000000000017200000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/compile-failures-but-ignore-failures/src/main/ruby/file.rb./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/compile-failures-but-ignore-failures/0000644000000000000000000000003412674201751030167 0ustar class Fail blaput 'hello' ././@LongLink0000644000000000000000000000017500000000000011606 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/compile-failures-but-ignore-failures/src/main/ruby/file.class./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/compile-failures-but-ignore-failures/0000644000000000000000000000635712674201751030205 0ustar 2src/main/ruby/file'org/jruby/ast/executable/AbstractScript setPosition%(Lorg/jruby/runtime/ThreadContext;I)Vp/home/kristian/projects/jruby-maven-plugins/jruby-maven-plugin/src/it/compilation-failures/src/main/ruby/file.rborg/jruby/runtime/ThreadContext setFileAndLine(Ljava/lang/String;I)V ()V  $classLjava/lang/Class;src.main.ruby.filejava/lang/ClassforName%(Ljava/lang/String;)Ljava/lang/Class;    filenameLjava/lang/String;  !file.rb__file__(Lsrc/main/ruby/file;Lorg/jruby/runtime/ThreadContext;Lorg/jruby/runtime/builtin/IRubyObject;[Lorg/jruby/runtime/builtin/IRubyObject;Lorg/jruby/runtime/Block;)Lorg/jruby/runtime/builtin/IRubyObject; getRuntime()Lorg/jruby/Ruby; &' (org/jruby/Ruby*getNil)()Lorg/jruby/runtime/builtin/IRubyObject; ,- +.(Lorg/jruby/runtime/ThreadContext;Lorg/jruby/runtime/builtin/IRubyObject;[Lorg/jruby/runtime/builtin/IRubyObject;Lorg/jruby/runtime/Block;)Lorg/jruby/runtime/builtin/IRubyObject; $% 1  3 getCallSite0()Lorg/jruby/runtime/CallSite; 56 7 getString0((Lorg/jruby/Ruby;)Lorg/jruby/RubyString; 9: ;org/jruby/runtime/CallSite=call(Lorg/jruby/runtime/ThreadContext;Lorg/jruby/runtime/builtin/IRubyObject;Lorg/jruby/runtime/builtin/IRubyObject;Lorg/jruby/runtime/builtin/IRubyObject;)Lorg/jruby/runtime/builtin/IRubyObject; ?@ >ALorg/jruby/anno/JRubyMethod;nameframerequiredoptionalrestloadjava/lang/StringM)org/jruby/javasupport/util/RuntimeHelpersOpreLoad7(Lorg/jruby/runtime/ThreadContext;[Ljava/lang/String;)V QR PSpostLoad$(Lorg/jruby/runtime/ThreadContext;)V UV PWjava/lang/ThrowableYmain([Ljava/lang/String;)V org/jruby/RubyInstanceConfig^ _setArgv a\ _b newInstance0(Lorg/jruby/RubyInstanceConfig;)Lorg/jruby/Ruby; de +fgetCurrentContext#()Lorg/jruby/runtime/ThreadContext; hi +j getTopSelf l- +m%org/jruby/runtime/builtin/IRubyObjecto NULL_ARRAY([Lorg/jruby/runtime/builtin/IRubyObject; qr psorg/jruby/runtime/Blocku NULL_BLOCKLorg/jruby/runtime/Block; wx vy L0 {4org/jruby/ast/executable/AbstractScript$RuntimeCache} ~ runtimeCache6Lorg/jruby/ast/executable/AbstractScript$RuntimeCache;  initCallSites(I)V ~ callSites[Lorg/jruby/runtime/CallSite; ~blaputsetFunctionalCallSiteO([Lorg/jruby/runtime/CallSite;ILjava/lang/String;)[Lorg/jruby/runtime/CallSite;  initStrings(I)[Lorg/jruby/util/ByteList; ~hellocreateByteListI([Lorg/jruby/util/ByteList;ILjava/lang/String;)[Lorg/jruby/util/ByteList; CodeLineNumberTableRuntimeVisibleAnnotations StackMapTable SourceFile! *NB***"*~Y*YW*HW $%; #+):/:+4*8+,,*<B CDs$EZFGIHIIHJIK$0 *+,-2L0;+NT*+,-2+X+XVZ [\4(Y]_Y`Y*cgYk_ntz|#././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/compile-failures-but-ignore-failures/pom.xml./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/compile-failures-but-ignore-failures/0000644000000000000000000000124412674201751030173 0ustar 4.0.0 de.saumya.mojo jruby-version testing de.saumya.mojo jruby-maven-plugin @project.version@ true ././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/compile-failures-but-ignore-failures/invoker.properties./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/compile-failures-but-ignore-failures/0000644000000000000000000000007212674201751030171 0ustar invoker.goals = ruby:compile invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/compile-dir/0000755000000000000000000000000012674201751023253 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/compile-dir/verify.bsh0000644000000000000000000000040212674201751025251 0ustar import java.io.*; File target = new File(basedir, "target/classes"); for(String f: new String[] { "file.class", "more/hello.class" }){ if( !new File(target, f).exists() ){ throw new RuntimeException("file does not exists: target/classes" + f); } }./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/compile-dir/src/0000755000000000000000000000000012674201751024042 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/compile-dir/src/main/0000755000000000000000000000000012674201751024766 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/compile-dir/src/main/ruby/0000755000000000000000000000000012674201751025747 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/compile-dir/src/main/ruby/file.rb0000644000000000000000000000005712674201751027215 0ustar require 'more/hello' include More puts hello ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/compile-dir/src/main/ruby/more/0000755000000000000000000000000012674201751026711 5ustar ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/compile-dir/src/main/ruby/more/hello.rb./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/compile-dir/src/main/ruby/more/hello.0000644000000000000000000000006612674201751030017 0ustar module More def hello "hello world" end end ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/compile-dir/pom.xml0000644000000000000000000000115712674201751024574 0ustar 4.0.0 de.saumya.mojo jruby-version testing de.saumya.mojo jruby-maven-plugin @project.version@ ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/compile-dir/invoker.properties0000644000000000000000000000007212674201751027045 0ustar invoker.goals = ruby:compile invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/compile-verbose/0000755000000000000000000000000012674201751024142 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/compile-verbose/verify.bsh0000644000000000000000000000044312674201751026145 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "Compiling ./file.rb"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); }./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/compile-verbose/src/0000755000000000000000000000000012674201751024731 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/compile-verbose/src/main/0000755000000000000000000000000012674201751025655 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/compile-verbose/src/main/ruby/0000755000000000000000000000000012674201751026636 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/compile-verbose/src/main/ruby/file.rb0000644000000000000000000000001512674201751030076 0ustar puts 'hello' ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/compile-verbose/src/main/ruby/file.class./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/compile-verbose/src/main/ruby/file.cl0000644000000000000000000000635712674201751030110 0ustar 2src/main/ruby/file'org/jruby/ast/executable/AbstractScript setPosition%(Lorg/jruby/runtime/ThreadContext;I)Vp/home/kristian/projects/jruby-maven-plugins/jruby-maven-plugin/src/it/compilation-failures/src/main/ruby/file.rborg/jruby/runtime/ThreadContext setFileAndLine(Ljava/lang/String;I)V ()V  $classLjava/lang/Class;src.main.ruby.filejava/lang/ClassforName%(Ljava/lang/String;)Ljava/lang/Class;    filenameLjava/lang/String;  !file.rb__file__(Lsrc/main/ruby/file;Lorg/jruby/runtime/ThreadContext;Lorg/jruby/runtime/builtin/IRubyObject;[Lorg/jruby/runtime/builtin/IRubyObject;Lorg/jruby/runtime/Block;)Lorg/jruby/runtime/builtin/IRubyObject; getRuntime()Lorg/jruby/Ruby; &' (org/jruby/Ruby*getNil)()Lorg/jruby/runtime/builtin/IRubyObject; ,- +.(Lorg/jruby/runtime/ThreadContext;Lorg/jruby/runtime/builtin/IRubyObject;[Lorg/jruby/runtime/builtin/IRubyObject;Lorg/jruby/runtime/Block;)Lorg/jruby/runtime/builtin/IRubyObject; $% 1  3 getCallSite0()Lorg/jruby/runtime/CallSite; 56 7 getString0((Lorg/jruby/Ruby;)Lorg/jruby/RubyString; 9: ;org/jruby/runtime/CallSite=call(Lorg/jruby/runtime/ThreadContext;Lorg/jruby/runtime/builtin/IRubyObject;Lorg/jruby/runtime/builtin/IRubyObject;Lorg/jruby/runtime/builtin/IRubyObject;)Lorg/jruby/runtime/builtin/IRubyObject; ?@ >ALorg/jruby/anno/JRubyMethod;nameframerequiredoptionalrestloadjava/lang/StringM)org/jruby/javasupport/util/RuntimeHelpersOpreLoad7(Lorg/jruby/runtime/ThreadContext;[Ljava/lang/String;)V QR PSpostLoad$(Lorg/jruby/runtime/ThreadContext;)V UV PWjava/lang/ThrowableYmain([Ljava/lang/String;)V org/jruby/RubyInstanceConfig^ _setArgv a\ _b newInstance0(Lorg/jruby/RubyInstanceConfig;)Lorg/jruby/Ruby; de +fgetCurrentContext#()Lorg/jruby/runtime/ThreadContext; hi +j getTopSelf l- +m%org/jruby/runtime/builtin/IRubyObjecto NULL_ARRAY([Lorg/jruby/runtime/builtin/IRubyObject; qr psorg/jruby/runtime/Blocku NULL_BLOCKLorg/jruby/runtime/Block; wx vy L0 {4org/jruby/ast/executable/AbstractScript$RuntimeCache} ~ runtimeCache6Lorg/jruby/ast/executable/AbstractScript$RuntimeCache;  initCallSites(I)V ~ callSites[Lorg/jruby/runtime/CallSite; ~blaputsetFunctionalCallSiteO([Lorg/jruby/runtime/CallSite;ILjava/lang/String;)[Lorg/jruby/runtime/CallSite;  initStrings(I)[Lorg/jruby/util/ByteList; ~hellocreateByteListI([Lorg/jruby/util/ByteList;ILjava/lang/String;)[Lorg/jruby/util/ByteList; CodeLineNumberTableRuntimeVisibleAnnotations StackMapTable SourceFile! *NB***"*~Y*YW*HW $%; #+):/:+4*8+,,*<B CDs$EZFGIHIIHJIK$0 *+,-2L0;+NT*+,-2+X+XVZ [\4(Y]_Y`Y*cgYk_ntz|#./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/compile-verbose/test.properties0000644000000000000000000000002312674201751027232 0ustar jrubyc.verbose=true./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/compile-verbose/pom.xml0000644000000000000000000000113012674201751025452 0ustar 4.0.0 de.saumya.mojo jruby-version testing de.saumya.mojo jruby-maven-plugin @project.version@ ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/compile-verbose/invoker.properties0000644000000000000000000000007212674201751027734 0ustar invoker.goals = ruby:compile invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/generate-java-and-compile-156/0000755000000000000000000000000012674201751026257 5ustar ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/generate-java-and-compile-156/verify.bsh./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/generate-java-and-compile-156/verify.0000644000000000000000000000043512674201751027566 0ustar import java.io.*; File target = new File(basedir, "target/classes"); for(String f: new String[] { "com/example/Reply.class", "com/otherexample/MyReply.class" }){ if( !new File(target, f).exists() ){ throw new RuntimeException("file does not exists: target/classes/" + f); } }./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/generate-java-and-compile-156/src/0000755000000000000000000000000012674201751027046 5ustar ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/generate-java-and-compile-156/src/test/./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/generate-java-and-compile-156/src/tes0000755000000000000000000000000012674201751027562 5ustar ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/generate-java-and-compile-156/src/test/java/./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/generate-java-and-compile-156/src/tes0000755000000000000000000000000012674201751027562 5ustar ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/generate-java-and-compile-156/src/test/java/com/./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/generate-java-and-compile-156/src/tes0000755000000000000000000000000012674201751027562 5ustar ././@LongLink0000644000000000000000000000017000000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/generate-java-and-compile-156/src/test/java/com/example/./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/generate-java-and-compile-156/src/tes0000755000000000000000000000000012674201751027562 5ustar ././@LongLink0000644000000000000000000000020600000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/generate-java-and-compile-156/src/test/java/com/example/ReplyTest.java./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/generate-java-and-compile-156/src/tes0000644000000000000000000000071112674201751027563 0ustar package com.example; import junit.framework.TestCase; /** * Unit test for simple App. */ public class ReplyTest extends TestCase { /** * Create the test case * * @param testName name of the test case */ public ReplyTest( String testName ) { super( testName ); } /** * Rigourous Test :-) */ public void testApp() { com.example.Reply reply = new com.otherexample.MyReply(); } } ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/generate-java-and-compile-156/src/main/./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/generate-java-and-compile-156/src/mai0000755000000000000000000000000012674201751027535 5ustar ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/generate-java-and-compile-156/src/main/ruby/./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/generate-java-and-compile-156/src/mai0000755000000000000000000000000012674201751027535 5ustar ././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/generate-java-and-compile-156/src/main/ruby/my_reply.rb./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/generate-java-and-compile-156/src/mai0000644000000000000000000000030612674201751027536 0ustar require 'java' java_import 'com.example.Reply' java_package 'com.otherexample' class MyReply java_implements Reply java_signature "String reply()" def reply "may all be happy" end end ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/generate-java-and-compile-156/src/main/java/./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/generate-java-and-compile-156/src/mai0000755000000000000000000000000012674201751027535 5ustar ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/generate-java-and-compile-156/src/main/java/com/./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/generate-java-and-compile-156/src/mai0000755000000000000000000000000012674201751027535 5ustar ././@LongLink0000644000000000000000000000017000000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/generate-java-and-compile-156/src/main/java/com/example/./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/generate-java-and-compile-156/src/mai0000755000000000000000000000000012674201751027535 5ustar ././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/generate-java-and-compile-156/src/main/java/com/example/Reply.java./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/generate-java-and-compile-156/src/mai0000644000000000000000000000010412674201751027532 0ustar package com.example; public interface Reply { String reply(); } ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/generate-java-and-compile-156/pom.xml0000644000000000000000000000175612674201751027605 0ustar 4.0.0 de.saumya.mojo jruby-version testing org.jruby jruby-complete 1.5.6 de.saumya.mojo jruby-maven-plugin @project.version@ true process-resources compile ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/generate-java-and-compile-156/invoker.properties./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/generate-java-and-compile-156/invoker0000644000000000000000000000006512674201751027660 0ustar invoker.goals = compile invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/exec-file-from-lib/0000755000000000000000000000000012674201751024415 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/exec-file-from-lib/verify.bsh0000644000000000000000000000044112674201751026416 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "hello jruby world"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); }./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/exec-file-from-lib/pom.xml0000644000000000000000000000134212674201751025732 0ustar 4.0.0 com.example jruby-exec-file-from-lib 0.0.0 de.saumya.mojo jruby-maven-plugin @project.parent.version@ false ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/exec-file-from-lib/invoker.properties0000644000000000000000000000007012674201751030205 0ustar invoker.goals = ruby:jruby invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/exec-file-from-lib/lib/0000755000000000000000000000000012674201751025163 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/exec-file-from-lib/lib/hello.rb0000644000000000000000000000003112674201751026605 0ustar puts 'hello jruby world' ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/simple-ruby-script/0000755000000000000000000000000012674201751024621 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/simple-ruby-script/verify.bsh0000644000000000000000000000043312674201751026623 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "hello world"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); }./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/simple-ruby-script/pom.xml0000644000000000000000000000130712674201751026137 0ustar 4.0.0 de.saumya.mojo jruby testing de.saumya.mojo jruby-maven-plugin @project.version@ ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/src/it/simple-ruby-script/invoker.properties0000644000000000000000000000007012674201751030411 0ustar invoker.goals = ruby:jruby invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/pom.xml0000644000000000000000000000534612674201751021171 0ustar 4.0.0 parent-mojo de.saumya.mojo 1.1.5 ../parent-mojo/pom.xml jruby-maven-plugin maven-plugin JRuby Maven Mojo de.saumya.mojo ruby-tools ${project.parent.version} org.codehaus.plexus plexus-velocity org.yaml snakeyaml org.jruby jruby-complete org.sonatype.plexus plexus-build-api 0.0.7 maven-plugin-plugin UTF-8 ruby org.eclipse.m2e lifecycle-mapping 1.0.0 org.apache.maven.plugins maven-plugin-plugin [2.5.1,) helpmojo descriptor ./jruby-maven-plugins-1.1.5.ds1.orig/jruby-maven-plugin/.gitignore0000644000000000000000000000000712674201751021631 0ustar target ./jruby-maven-plugins-1.1.5.ds1.orig/gem-extension/0000755000000000000000000000000012674201751016673 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-extension/src/0000755000000000000000000000000012674201751017462 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-extension/src/main/0000755000000000000000000000000012674201751020406 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-extension/src/main/resources/0000755000000000000000000000000012674201751022420 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-extension/src/main/resources/META-INF/0000755000000000000000000000000012674201751023560 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-extension/src/main/resources/META-INF/plexus/0000755000000000000000000000000012674201751025100 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-extension/src/main/resources/META-INF/plexus/components.xml0000644000000000000000000000266712674201751030022 0ustar org.apache.maven.lifecycle.mapping.LifecycleMapping gem org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping de.saumya.mojo:gem-maven-plugin:initialize org.apache.maven.plugins:maven-resources-plugin:resources org.apache.maven.plugins:maven-compiler-plugin:compile de.saumya.mojo:gem-maven-plugin:package org.apache.maven.plugins:maven-install-plugin:install de.saumya.mojo:gem-maven-plugin:push org.apache.maven.artifact.handler.ArtifactHandler gem org.apache.maven.artifact.handler.DefaultArtifactHandler gem gem gem ruby false false ./jruby-maven-plugins-1.1.5.ds1.orig/gem-extension/pom.xml0000644000000000000000000000345512674201751020217 0ustar 4.0.0 parent-mojo de.saumya.mojo 1.1.5 ../parent-mojo/pom.xml gem-extension jar Gem Maven Extension org.eclipse.m2e lifecycle-mapping 1.0.0 org.codehaus.mojo build-helper-maven-plugin [1.4,) add-source org.apache.maven.plugins maven-dependency-plugin [2.1,) unpack-dependencies ./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/0000755000000000000000000000000012674201751020316 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/0000755000000000000000000000000012674201751021105 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/main/0000755000000000000000000000000012674201751022031 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/main/java/0000755000000000000000000000000012674201751022752 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/main/java/de/0000755000000000000000000000000012674201751023342 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/main/java/de/saumya/0000755000000000000000000000000012674201751024641 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/main/java/de/saumya/mojo/0000755000000000000000000000000012674201751025605 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/main/java/de/saumya/mojo/cucumber/0000755000000000000000000000000012674201751027412 5ustar ././@LongLink0000644000000000000000000000020500000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/main/java/de/saumya/mojo/cucumber/CucumberMavenTestScriptFactory.java./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/main/java/de/saumya/mojo/cucumber/Cuc0000644000000000000000000000512512674201751030052 0ustar package de.saumya.mojo.cucumber; import de.saumya.mojo.tests.AbstractMavenTestScriptFactory; public class CucumberMavenTestScriptFactory extends AbstractMavenTestScriptFactory { @Override protected void getRunnerScript(StringBuilder builder) { builder.append("cucumber_report_path = REPORT_PATH + '_tmp'\n"); builder.append("at_exit do\n"); builder.append(" # create test like result files\n"); builder.append("\n"); builder.append(" require 'rexml/document'\n"); builder.append(" require 'fileutils'\n"); builder.append(" FileUtils.mkdir_p(REPORT_PATH)\n"); builder.append(" tests, errors, failures, skips, time = 0, 0, 0, 0, 0.0\n"); builder.append(" Dir[File.join(cucumber_report_path, '*xml')].each do |report|\n"); builder.append(" doc = REXML::Document.new(File.new(report))\n"); builder.append(" suite = REXML::XPath.first(doc, '//testsuite')\n"); builder.append(" tests += suite.attributes['tests'].to_i\n"); builder.append(" errors += suite.attributes['errors'].to_i\n"); builder.append(" failures += suite.attributes['failures'].to_i\n"); builder.append(" skips += suite.attributes['skips'].to_i\n"); builder.append(" time += suite.attributes['time'].to_f\n"); builder.append(" FileUtils.move(report, File.join(REPORT_PATH, " + "File.basename(report).sub(/\\.xml/, \"-#{JRUBY_VERSION}--#{RUBY_VERSION.sub(/([0-9]\\.[0-9])\\..*$/) { $1 }}.xml\")))\n"); builder.append(" end\n"); builder.append(" FileUtils.rm_rf(cucumber_report_path)\n"); builder.append(" cucumber_summary = File.join(TARGET_DIR, 'cucumber.txt')\n"); builder.append(" File.open(cucumber_summary, 'w') do |f|\n"); builder.append(" f.puts \"Finished tests in #{time}s.\"\n"); builder.append(" f.puts \"#{tests} tests, 0 assertions, #{failures} failures, #{errors} errors, #{skips} skips\"\n"); builder.append(" end\n"); builder.append("end\n"); builder.append("\n"); builder.append("require 'rubygems'\n"); builder.append("gem 'cucumber'\n"); builder.append("argv = ['-f', 'pretty', '-f', 'junit', '-o', cucumber_report_path] + ARGV\n"); builder.append("ARGV.replace(argv)\n"); builder.append("load Gem.bin_path('cucumber', 'cucumber')\n"); builder.append("\n"); } @Override protected void getResultsScript(StringBuilder builder) { } @Override protected String getScriptName() { return "cucumber-runner.rb"; } }././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/main/java/de/saumya/mojo/cucumber/CucumberMojo.java./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/main/java/de/saumya/mojo/cucumber/Cuc0000644000000000000000000000674312674201751030061 0ustar package de.saumya.mojo.cucumber; import java.io.File; import java.io.IOException; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; import de.saumya.mojo.jruby.JRubyVersion; import de.saumya.mojo.jruby.JRubyVersion.Mode; import de.saumya.mojo.ruby.script.Script; import de.saumya.mojo.ruby.script.ScriptException; import de.saumya.mojo.ruby.script.ScriptFactory; import de.saumya.mojo.tests.AbstractTestMojo; import de.saumya.mojo.tests.JRubyRun.Result; import de.saumya.mojo.tests.TestResultManager; import de.saumya.mojo.tests.TestScriptFactory; import org.apache.maven.plugins.annotations.LifecyclePhase; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.plugins.annotations.ResolutionScope; /** * maven wrapper around the cucumber command. */ @Mojo(name = "test", defaultPhase = LifecyclePhase.TEST, requiresDependencyResolution = ResolutionScope.TEST) public class CucumberMojo extends AbstractTestMojo { enum ResultEnum { ERRORS, FAILURES, SKIPPED, TEST } /** * cucumber features directory to be used for the cucumber command. */ @Parameter(property = "cucumber.dir", defaultValue = "features") private final File cucumberDirectory = null; /** * arguments for the cucumber command. */ @Parameter(property = "cucumber.args") private final String cucumberArgs = null; @Parameter(property = "skipCucumber", defaultValue ="false") protected boolean skipCucumber = false; private TestResultManager resultManager; private File outputfile; @Override public void execute() throws MojoExecutionException, MojoFailureException { if (this.skip || this.skipTests || this.skipCucumber) { getLog().info("Skipping Cucumber tests"); } else { if (this.project.getBasedir() != null && this.cucumberDirectory != null && !this.cucumberDirectory.exists() && this.args == null) { getLog().info("Skipping cucumber tests since " + this.cucumberDirectory + " is missing"); } else { outputfile = new File(this.project.getBuild().getDirectory() .replace("${project.basedir}/", ""), "cucumber.txt"); if (outputfile.exists()){ outputfile.delete(); } resultManager = new TestResultManager(summaryReport); getLog().debug("Running Cucumber tests from " + this.cucumberDirectory); super.execute(); } } } @Override protected TestScriptFactory newTestScriptFactory() { return new CucumberMavenTestScriptFactory(); } @Override protected Result runIt(ScriptFactory factory, Mode mode, final JRubyVersion version, TestScriptFactory scriptFactory) throws IOException, ScriptException, MojoExecutionException { scriptFactory.setSourceDir(new File(".")); scriptFactory.emit(); final Script script = factory.newScript(scriptFactory.getCoreScript()); if (this.cucumberArgs != null) { script.addArgs(this.cucumberArgs); } if (this.args != null) { script.addArgs(this.args); } if (this.cucumberDirectory != null) { script.addArg(this.cucumberDirectory); } try { script.executeIn(launchDirectory()); } catch (Exception e) { getLog().debug("exception in running tests", e); } return resultManager.generateReports(mode, version, outputfile); } } ./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/0000755000000000000000000000000012674201751021521 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-somewhere/0000755000000000000000000000000012674201751025322 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-somewhere/verify.bsh0000644000000000000000000000044112674201751027323 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "2 steps (2 passed)"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); }./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-somewhere/test.properties0000644000000000000000000000002012674201751030407 0ustar args=--no-color ./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-somewhere/pom.xml0000644000000000000000000000242112674201751026636 0ustar 4.0.0 de.saumya.mojo jruby-version testing rubygems-releases http://rubygems-proxy.torquebox.org/releases rubygems cucumber 0.9.2 gem de.saumya.mojo gem-maven-plugin @project.version@ true de.saumya.mojo cucumber-maven-plugin @project.version@ somewhere ./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-somewhere/somewhere/0000755000000000000000000000000012674201751027320 5ustar ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-somewhere/somewhere/features/./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-somewhere/somewhere/featu0000755000000000000000000000000012674201751030345 5ustar ././@LongLink0000644000000000000000000000017100000000000011602 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-somewhere/somewhere/features/simplest.feature./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-somewhere/somewhere/featu0000644000000000000000000000015412674201751030347 0ustar Feature: Sample Background: Given this step works Scenario: Run a good step Given this step works ././@LongLink0000644000000000000000000000017200000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-somewhere/somewhere/features/step_definitions/./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-somewhere/somewhere/featu0000755000000000000000000000000012674201751030345 5ustar ././@LongLink0000644000000000000000000000021300000000000011577 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-somewhere/somewhere/features/step_definitions/simplest_steps.rb./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-somewhere/somewhere/featu0000644000000000000000000000004212674201751030343 0ustar Given /^this step works$/ do end ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-somewhere/invoker.properties./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-somewhere/invoker.propert0000644000000000000000000000007212674201751030413 0ustar invoker.goals = cucumber:test invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-failure/0000755000000000000000000000000012674201751024753 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-failure/verify.bsh0000644000000000000000000000045412674201751026760 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "2 steps (1 failed, 1 skipped)"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); }./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-failure/test.properties0000644000000000000000000000002012674201751030040 0ustar args=--no-color ./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-failure/pom.xml0000644000000000000000000000200512674201751026265 0ustar 4.0.0 de.saumya.mojo cucumber-file testing rubygems-releases http://rubygems-proxy.torquebox.org/releases rubygems cucumber 0.9.2 gem de.saumya.mojo cucumber-maven-plugin @project.version@ true ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-failure/invoker.properties./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-failure/invoker.propertie0000644000000000000000000000013012674201751030355 0ustar invoker.goals = cucumber:test invoker.mavenOpts = -client invoker.buildResult = failure ./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-failure/features/0000755000000000000000000000000012674201751026571 5ustar ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-failure/features/simplest.feature./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-failure/features/simplest0000644000000000000000000000015412674201751030354 0ustar Feature: Sample Background: Given this step works Scenario: Run a good step Given this step works ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-failure/features/step_definitions/./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-failure/features/step_def0000755000000000000000000000000012674201751030303 5ustar ././@LongLink0000644000000000000000000000017700000000000011610 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-failure/features/step_definitions/simplest_steps.rb./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-failure/features/step_def0000644000000000000000000000006412674201751030305 0ustar Given /^this step works$/ do raise "failure" end ./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-failure-19/0000755000000000000000000000000012674201751025202 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-failure-19/verify.bsh0000644000000000000000000000045412674201751027207 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "2 steps (1 failed, 1 skipped)"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); }././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-failure-19/test.properties./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-failure-19/test.propertie0000644000000000000000000000004412674201751030112 0ustar args=--no-color jruby.switches=--1.9./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-failure-19/pom.xml0000644000000000000000000000200512674201751026514 0ustar 4.0.0 de.saumya.mojo cucumber-file testing rubygems-releases http://rubygems-proxy.torquebox.org/releases rubygems cucumber 0.9.2 gem de.saumya.mojo cucumber-maven-plugin @project.version@ true ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-failure-19/invoker.properties./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-failure-19/invoker.proper0000644000000000000000000000013012674201751030102 0ustar invoker.goals = cucumber:test invoker.mavenOpts = -client invoker.buildResult = failure ./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-failure-19/features/0000755000000000000000000000000012674201751027020 5ustar ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-failure-19/features/simplest.feature./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-failure-19/features/simpl0000644000000000000000000000015412674201751030067 0ustar Feature: Sample Background: Given this step works Scenario: Run a good step Given this step works ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-failure-19/features/step_definitions/./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-failure-19/features/step_0000755000000000000000000000000012674201751030053 5ustar ././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-failure-19/features/step_definitions/simplest_steps.rb./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-failure-19/features/step_0000644000000000000000000000006412674201751030055 0ustar Given /^this step works$/ do raise "failure" end ./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-pom/0000755000000000000000000000000012674201751024117 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-pom/verify.bsh0000644000000000000000000000044112674201751026120 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "2 steps (2 passed)"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); }./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-pom/test.properties0000644000000000000000000000002012674201751027204 0ustar args=--no-color ./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-pom/pom.xml0000644000000000000000000000215112674201751025433 0ustar 4.0.0 de.saumya.mojo cucumber-file testing rubygems-releases http://rubygems-proxy.torquebox.org/releases rubygems cucumber 0.9.2 gem de.saumya.mojo cucumber-maven-plugin @project.version@ true test ./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-pom/invoker.properties0000644000000000000000000000006112674201751027707 0ustar invoker.goals = test invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-pom/features/0000755000000000000000000000000012674201751025735 5ustar ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-pom/features/simplest.feature./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-pom/features/simplest.fea0000644000000000000000000000015412674201751030252 0ustar Feature: Sample Background: Given this step works Scenario: Run a good step Given this step works ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-pom/features/step_definitions/./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-pom/features/step_definit0000755000000000000000000000000012674201751030333 5ustar ././@LongLink0000644000000000000000000000017300000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-pom/features/step_definitions/simplest_steps.rb./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-pom/features/step_definit0000644000000000000000000000004212674201751030331 0ustar Given /^this step works$/ do end ./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-summary-report/0000755000000000000000000000000012674201751026332 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-summary-report/verify.bsh0000644000000000000000000000123112674201751030331 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "2 steps (2 passed)"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } File file = new File( basedir, "target/surefire-reports/TEST-simplest-1.6.5--1.8.xml"); if ( !file.exists() ) { throw new RuntimeException( "file does not exists: '" + file.getAbsolutePath() + "'" ); } file = new File( basedir, "target/summary.xml"); if ( !file.exists() ) { throw new RuntimeException( "file does not exists: '" + file.getAbsolutePath() + "'" ); } ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-summary-report/test.properties./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-summary-report/test.prope0000644000000000000000000000002312674201751030353 0ustar jruby.version=1.6.5./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-summary-report/pom.xml0000644000000000000000000000231312674201751027646 0ustar 4.0.0 de.saumya.mojo cucumber-pom testing rubygems-releases http://rubygems-proxy.torquebox.org/releases rubygems cucumber 0.9.2 gem test de.saumya.mojo cucumber-maven-plugin @project.version@ test ${project.build.directory}/summary.xml ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-summary-report/invoker.properties./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-summary-report/invoker.pr0000644000000000000000000000006112674201751030347 0ustar invoker.goals = test invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-summary-report/features/0000755000000000000000000000000012674201751030150 5ustar ././@LongLink0000644000000000000000000000016400000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-summary-report/features/simplest.feature./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-summary-report/features/s0000644000000000000000000000015412674201751030335 0ustar Feature: Sample Background: Given this step works Scenario: Run a good step Given this step works ././@LongLink0000644000000000000000000000016500000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-summary-report/features/step_definitions/./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-summary-report/features/s0000755000000000000000000000000012674201751030333 5ustar ././@LongLink0000644000000000000000000000020600000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-summary-report/features/step_definitions/simplest_steps.rb./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/cucumber-summary-report/features/s0000644000000000000000000000004212674201751030331 0ustar Given /^this step works$/ do end ./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/src/it/settings.xml0000644000000000000000000000221512674201751024103 0ustar it-repo true local.central @localRepositoryUrl@ true true local.rubygems-releases @localRepositoryUrl@ true false local.central @localRepositoryUrl@ true true ./jruby-maven-plugins-1.1.5.ds1.orig/cucumber-maven-plugin/pom.xml0000644000000000000000000000155712674201751021643 0ustar 4.0.0 test-parent-mojo de.saumya.mojo 1.1.5 ../test-parent-mojo/pom.xml cucumber-maven-plugin maven-plugin Cucumber Maven Mojo integration-test true all false ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/0000755000000000000000000000000012674201751017261 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/0000755000000000000000000000000012674201751020050 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/main/0000755000000000000000000000000012674201751020774 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/main/java/0000755000000000000000000000000012674201751021715 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/main/java/de/0000755000000000000000000000000012674201751022305 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/main/java/de/saumya/0000755000000000000000000000000012674201751023604 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/main/java/de/saumya/mojo/0000755000000000000000000000000012674201751024550 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/main/java/de/saumya/mojo/gem/0000755000000000000000000000000012674201751025320 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/main/java/de/saumya/mojo/gem/IrbMojo.java0000644000000000000000000000273712674201751027535 0ustar package de.saumya.mojo.gem; import java.io.IOException; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.plugins.annotations.ResolutionScope; import de.saumya.mojo.ruby.script.ScriptException; /** * maven wrapper around IRB. *
    * DEPRECATED - DO NOT USE */ @Deprecated @Mojo( name = "irb", requiresDependencyResolution = ResolutionScope.TEST, requiresProject = false ) public class IrbMojo extends AbstractGemMojo { /** * arguments for the irb command. */ @Parameter( property = "irb.args" ) protected String irbArgs = null; /** * launch IRB in a swing window. */ @Parameter( property = "irb.swing", defaultValue = "false" ) protected boolean swing; @Override public void execute() throws MojoExecutionException, MojoFailureException { // make sure the whole things run in the same process super.jrubyFork = false; // this.includeOpenSSL = false; super.execute(); } @Override public void executeWithGems() throws MojoExecutionException, ScriptException, IOException { this.factory.newScriptFromJRubyJar(this.swing ? "jirb_swing" : "jirb") .addArgs(this.irbArgs) .addArgs(this.args) .execute(); } } ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/main/java/de/saumya/mojo/gem/PomMojo.java0000644000000000000000000001362512674201751027552 0ustar package de.saumya.mojo.gem; import java.io.File; import java.io.IOException; import java.net.URL; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.descriptor.PluginDescriptor; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import org.codehaus.plexus.util.FileUtils; import de.saumya.mojo.jruby.AbstractJRubyMojo; import de.saumya.mojo.ruby.script.ScriptException; /** * goal to converts a gemspec file into pom.xml. */ @Mojo( name = "pom", requiresProject = false ) public class PomMojo extends AbstractJRubyMojo { @Parameter( defaultValue = "${plugin}", readonly = true ) PluginDescriptor plugin; /** * the pom file to generate */ @Parameter( property ="pom", defaultValue = "pom.xml" ) protected File pom; /** * force overwrite of an existing pom */ @Parameter( property ="pom.force", defaultValue = "false" ) protected boolean force; /** * temporary store generated pom. */ @Parameter( defaultValue = "${project.build.directory}/pom.xml" ) protected File tmpPom; /** * use a gemspec file to generate a pom */ @Parameter( property ="pom.gemspec", defaultValue = "gemspec" ) protected File gemspec; /** * use Gemfile to generate a pom */ @Parameter( property ="pom.gemfile", defaultValue = "Gemfile" ) protected File gemfile; @Parameter private boolean skipGeneration; @Override public void executeJRuby() throws MojoExecutionException, ScriptException, IOException { if (tmpPom.getPath().contains( "${project.basedir}" ) ) { tmpPom = new File( tmpPom.getPath().replace( "${project.basedir}/", "" ) ); } File source = null; if( this.skipGeneration ) { this.gemfile = null; this.gemspec = null; } else { if ( this.gemfile.exists() ) { this.gemspec = null; } else { this.gemfile = null; if (this.gemspec == null) { this.gemspec = findGemspec(); } } if (this.gemspec != null) { generatePom( this.gemspec, "gemspec" ); source = this.gemspec; } if (this.gemfile != null ) { generatePom( this.gemfile, "gemfile" ); source = this.gemspec; } } copyGeneratedPom( source ); } private void copyGeneratedPom( File source ) throws IOException { if( pom.exists() && tmpPom.exists() ) { String pomString = FileUtils.fileRead( pom ); String tmpString = FileUtils.fileRead( tmpPom ); if ( force || // no source then copy on change ( source == null && ! pomString.equals( tmpString ) ) || // with source copy on modification ( source != null && source.lastModified() > pom.lastModified() ) ) { movePom(); } else if (this.jrubyVerbose) { if ( source != null ) { getLog().info( "skip creation of pom. force creation with -Dpom.force"); } else { rubyMavenHelper(); tmpPom.delete(); getLog().info( "generated pom up to date - deleted " + tmpPom.getAbsolutePath().replace( this.project.getBasedir().getAbsolutePath() + "/", "" ) ); } } } else if ( tmpPom.exists() ) { movePom(); } } private void movePom() throws IOException { //pom.delete(); FileUtils.rename( tmpPom, pom ); rubyMavenHelper(); if (this.jrubyVerbose) { getLog().info( "moved " + tmpPom.getAbsolutePath().replace( this.project.getBasedir().getAbsolutePath() + "/", "" ) + " to " + pom.getAbsolutePath().replace( this.project.getBasedir().getAbsolutePath() + "/", "" ) ); } } private void rubyMavenHelper() { // helper for ruby-maven to keep the project data valid if (project.getFile() != null && project.getFile().getAbsolutePath().equals( tmpPom.getAbsolutePath() ) ){ project.setFile( pom ); } } private void generatePom(File file, String type) throws ScriptException, IOException { this.tmpPom.getParentFile().mkdirs(); URL url = Thread.currentThread().getContextClassLoader().getResource("maven/tools/pom.rb"); this.factory.newScript("$LOAD_PATH << '" + url.toString().replace("maven/tools/pom.rb", "")+"';" + "require 'maven/tools/pom';" + "puts Maven::Tools::POM.new('" + file.getAbsolutePath() + "').to_s") .execute(tmpPom); } private File findGemspec() { getLog().debug("no gemspec file given, see if there is single one"); File result = null; File basedir = this.project.getBasedir() == null ? new File(".") : this.project.getBasedir(); for (final File file : basedir.listFiles()) { if (file.getName().endsWith(".gemspec")) { if (result != null) { getLog().info("there is no gemspec file given but there are more then one in the current directory."); getLog().info("use '-Dpom.gemspec=...' to select the gemspec file or -Dpom.gemfile to select a Gemfile to process"); return null; } result = file; } } return result; } } ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/main/java/de/saumya/mojo/gem/GemifyMojo.java./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/main/java/de/saumya/mojo/gem/GemifyMojo.ja0000644000000000000000000004037012674201751027705 0ustar package de.saumya.mojo.gem; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.util.HashMap; import java.util.LinkedHashSet; import java.util.Map; import java.util.Set; import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.resolver.ArtifactResolutionRequest; import org.apache.maven.artifact.resolver.ArtifactResolutionResult; import org.apache.maven.model.Dependency; import org.apache.maven.model.Relocation; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugins.annotations.Component; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.plugins.annotations.ResolutionScope; import org.apache.maven.project.DefaultProjectBuildingRequest; import org.apache.maven.project.MavenProject; import org.apache.maven.project.ProjectBuilder; import org.apache.maven.project.ProjectBuildingException; import org.apache.maven.project.ProjectBuildingRequest; import org.apache.maven.project.artifact.InvalidDependencyVersionException; import org.codehaus.plexus.util.StringUtils; import de.saumya.mojo.ruby.gems.GemException; import de.saumya.mojo.ruby.script.Script; import de.saumya.mojo.ruby.script.ScriptException; /** * goal to convert that artifact into a gem. */ @Mojo( name = "gemify", requiresDependencyResolution = ResolutionScope.TEST, requiresProject = true ) public class GemifyMojo extends AbstractGemMojo { @Parameter( property = "artifactId", defaultValue="${artifactId}" ) String artifactId; @Parameter( property = "groupId", defaultValue="${groupId}" ) String groupId; @Parameter( property = "version", defaultValue="${version}" ) String version; @Parameter( defaultValue="${project.build.directory}/gemify" ) File gemify; @Parameter( defaultValue="${project.build.directory}" ) File buildDirectory; @Parameter( property = "skipGemInstall", defaultValue="${skipGemInstall}" ) public boolean skipGemInstall = false; @Parameter( defaultValue="${repositorySystemSession}", readonly = true ) private Object repositorySession; @Component protected ProjectBuilder builder; private final Map relocationMap = new HashMap(); @Override public void executeJRuby() throws MojoExecutionException, IOException, ScriptException { if (this.project.getBasedir() == null || !this.project.getBasedir().exists()) { if (!this.buildDirectory.exists()) { this.buildDirectory = new File("target"); } if (!this.gemify.exists()) { this.gemify = new File(this.buildDirectory, "gemify"); } // TODO this should be obsolete // if (!this.gemHome.exists()) { // this.gemHome = new File(this.buildDirectory, "rubygems"); // } // if (!this.gemPath.exists()) { // this.gemPath = new File(this.buildDirectory, "rubygems"); // } } if (this.artifactId != null || this.groupId != null || this.version != null) { if (this.artifactId != null && this.groupId != null && this.version != null) { final Artifact artifact = this.repositorySystem.createArtifactWithClassifier(this.groupId, this.artifactId, this.version, "jar", null); ArtifactResolutionRequest request = new ArtifactResolutionRequest().setArtifact(artifact) .setLocalRepository(this.localRepository) .setRemoteRepositories(this.project.getRemoteArtifactRepositories()); this.repositorySystem.resolve(request); try { final MavenProject project = projectFromArtifact(artifact); project.setArtifact(artifact); final Set artifacts = new LinkedHashSet(); getLog().info("artifacts=" + artifacts); request = new ArtifactResolutionRequest().setArtifact(artifact) .setLocalRepository(this.localRepository) .setRemoteRepositories(this.project.getRemoteArtifactRepositories()) .setManagedVersionMap(project.getManagedVersionMap()); final ArtifactResolutionResult arr = this.repositorySystem.resolve(request); gemify(project, arr.getArtifacts()); } catch (final InvalidDependencyVersionException e) { throw new MojoExecutionException("can not resolve " + artifact.toString(), e); } catch (final ProjectBuildingException e) { throw new MojoExecutionException("error building project object model", e); } catch (final GemException e) { throw new MojoExecutionException("error building project object model", e); } } else { throw new MojoExecutionException("not all three artifactId, groupId and version are given"); } } else { gemify(this.project, this.project.getArtifacts()); } } private void gemify(MavenProject project, final Set artifacts) throws MojoExecutionException, IOException, ScriptException { getLog().info("gemify( " + project + ", " + artifacts + " )"); final Map gems = new HashMap(); try { if(project.getArtifact().getFile() == null){ throw new MojoExecutionException("no artifact file found: " + project.getArtifact() + "\n\trun 'package' goal first"); } final String gem = build(project, project.getArtifact().getFile()); gems.put(gem, project); } catch (final IOException e) { throw new MojoExecutionException("error gemifing pom", e); } for (final Artifact artifact : artifacts) { // only jar-files get gemified !!! if ("jar".equals(artifact.getType()) && !artifact.hasClassifier()) { try { project = projectFromArtifact(artifact); final String gem = build(project, artifact.getFile()); gems.put(gem, project); } catch (final ProjectBuildingException e) { getLog().error("skipping: " + artifact.getFile().getName(), e); } catch (final IOException e) { getLog().error("skipping: " + artifact.getFile().getName(), e); } catch (final GemException e) { getLog().error("skipping: " + artifact.getFile().getName(), e); } } } if (this.skipGemInstall) { getLog().info("skip installing gems"); } else { // assume we have the dependent gems in place so tell gems to // install them without dependency check final Script script = this.factory.newScriptFromJRubyJar("gem") .addArg("install") .addArg((installRDoc ? "--" : "--no-") + "rdoc") .addArg((installRI ? "--" : "--no-") + "ri") .addArg("--ignore-dependencies") .addArg("-l"); for (final String gem : gems.keySet()) { script.addArg(gem); } script.executeIn(launchDirectory()); } } private MavenProject projectFromArtifact(final Artifact artifact) throws ProjectBuildingException, GemException { final ProjectBuildingRequest request = new DefaultProjectBuildingRequest().setLocalRepository(this.localRepository) .setRemoteRepositories(this.project.getRemoteArtifactRepositories()); manager.setRepositorySession(request, this.repositorySession ); final MavenProject project = this.builder.build(artifact, request) .getProject(); if (project.getDistributionManagement() != null && project.getDistributionManagement().getRelocation() != null) { final Relocation reloc = project.getDistributionManagement() .getRelocation(); final String key = artifact.getGroupId() + ":" + artifact.getArtifactId() + ":" + artifact.getType() + ":" + artifact.getVersion(); artifact.setArtifactId(reloc.getArtifactId()); artifact.setGroupId(reloc.getGroupId()); if (reloc.getVersion() != null) { artifact.setVersion(reloc.getVersion()); } this.relocationMap.put(key, artifact.getGroupId() + ":" + artifact.getArtifactId() + ":" + artifact.getType() + ":" + artifact.getVersion()); return projectFromArtifact(artifact); } else { return project; } } private String build(final MavenProject project, final File jarfile) throws MojoExecutionException, IOException, ScriptException { getLog().info("building gem for " + jarfile + " . . ."); final String gemName = project.getGroupId() + "." + project.getArtifactId(); final File gemDir = new File(this.gemify, gemName); final File gemSpec = new File(gemDir, gemName + ".gemspec"); final GemspecWriter gemSpecWriter = new GemspecWriter(gemSpec, project, new GemArtifact(project)); gemSpecWriter.appendJarfile(jarfile, jarfile.getName()); final File lib = new File(gemDir, "lib"); lib.mkdirs(); // need relative filename here final File rubyFile = new File(lib.getName(), project.getGroupId() + "." + project.getArtifactId() + ".rb"); gemSpecWriter.appendFile(rubyFile); for (final Dependency dependency : project.getDependencies()) { if (!dependency.isOptional() && "jar".equals(dependency.getType()) && dependency.getClassifier() == null) { getLog().info("--"); getLog().info("dependency=" + dependency); // it will adjust the artifact as well (in case of relocation) Artifact arti = null; try { arti = this.repositorySystem.createArtifactWithClassifier(dependency.getGroupId(), dependency.getArtifactId(), dependency.getVersion(), dependency.getScope(), dependency.getClassifier()); getLog().info("arti=" + arti); projectFromArtifact(arti); dependency.setGroupId(arti.getGroupId()); dependency.setArtifactId(arti.getArtifactId()); dependency.setVersion(arti.getVersion()); } catch (final ProjectBuildingException e) { throw new MojoExecutionException("error building project for " + arti, e); } catch (final GemException e) { throw new MojoExecutionException("error building project for " + arti, e); } if ((Artifact.SCOPE_COMPILE + Artifact.SCOPE_RUNTIME).contains(dependency.getScope())) { gemSpecWriter.appendDependency(dependency.getGroupId() + "." + dependency.getArtifactId(), dependency.getVersion()); } else if ((Artifact.SCOPE_PROVIDED + Artifact.SCOPE_TEST).contains(dependency.getScope())) { gemSpecWriter.appendDevelopmentDependency(dependency.getGroupId() + "." + dependency.getArtifactId(), dependency.getVersion()); } else { // TODO put things into "requirements" } } } getLog().debug(" A"); gemSpecWriter.close(); gemSpecWriter.copy(gemDir); FileWriter writer = null; try { // need absolute filename here writer = new FileWriter(new File(lib, rubyFile.getName())); writer.append("module ") .append(titleizedClassname(project.getArtifactId())) .append("\n"); writer.append(" VERSION = '") .append(gemVersion(project.getVersion())) .append("'\n"); writer.append(" MAVEN_VERSION = '") .append(project.getVersion()) .append("'\n"); writer.append("end\n"); writer.append("begin\n"); writer.append(" require 'java'\n"); writer.append(" require File.dirname(__FILE__) + '/") .append(jarfile.getName()) .append("'\n"); writer.append("rescue LoadError\n"); writer.append(" puts 'JAR-based gems require JRuby to load. Please visit www.jruby.org.'\n"); writer.append(" raise\n"); writer.append("end\n"); } catch (final IOException e) { throw new MojoExecutionException("error writing ruby file", e); } finally { if (writer != null) { try { writer.close(); } catch (final IOException ignore) { } } } // this.launchDir = gemDir; getLog().debug(" B"); this.factory.newScriptFromJRubyJar("gem") .addArg("build") .addArg(gemSpec) .executeIn(gemDir); getLog().debug(" C"); return gemSpec.getAbsolutePath().replaceFirst(".gemspec$", "") + "-" + gemVersion(project.getVersion()) + ".gem"; } private String titleizedClassname(final String artifactId) { final StringBuilder name = new StringBuilder();// artifact.getGroupId()).append("."); for (final String part : artifactId.split("-")) { name.append(StringUtils.capitalise(part)); } return name.toString(); } private String gemVersion(final String versionString) { // needs to match with GemWriter#gemVersion return versionString.replaceAll("-SNAPSHOT", "") .replace("-", ".") .toLowerCase(); } // @Override // protected File launchDirectory() { // if (this.launchDir != null) { // return this.launchDir.getAbsoluteFile(); // } // else { // return super.launchDirectory(); // } // } @Override protected void executeWithGems() throws MojoExecutionException, ScriptException, IOException { // TODO Auto-generated method stub } } ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/main/java/de/saumya/mojo/gem/PackageMojo.java./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/main/java/de/saumya/mojo/gem/PackageMojo.j0000644000000000000000000004760212674201751027664 0ustar package de.saumya.mojo.gem; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.net.URL; import java.sql.Date; import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.resolver.ArtifactResolutionRequest; import org.apache.maven.artifact.resolver.ArtifactResolutionResult; import org.apache.maven.artifact.resolver.filter.ArtifactFilter; import org.apache.maven.model.Dependency; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.plugins.annotations.ResolutionScope; import org.apache.maven.project.MavenProject; import org.codehaus.plexus.util.FileUtils; import org.codehaus.plexus.util.StringUtils; import de.saumya.mojo.ruby.script.ScriptException; /** * goal to convert that artifact into a gem or uses a given gemspec to build a gem. */ @Mojo( name = "package", requiresDependencyResolution = ResolutionScope.TEST, requiresProject = false ) public class PackageMojo extends AbstractGemMojo { @Parameter( defaultValue = "${project.build.directory}" ) File buildDirectory; /** * the gemspec to use for building the gem */ @Parameter( property = "gemspec" ) File gemspec; /** * use the pom to generate a gemspec and overwrite the one in lauchDirectory. */ @Parameter( property = "gemspec.overwrite" ) boolean gemspecOverwrite = false; @Parameter private String date; @Parameter private String extraRdocFiles; @Parameter private String extraFiles; @Parameter private String rdocOptions; @Parameter private String requirePaths; @Parameter private String rubyforgeProject; @Parameter private String rubygemsVersion; @Parameter private String requiredRubygemsVersion; @Parameter private String bindir; @Parameter private String requiredRubyVersion; @Parameter private String postInstallMessage; @Parameter private String executables; @Parameter private String extensions; @Parameter private String platform; @Parameter( defaultValue = "gem_hook.rb" ) private String gemHook; @Parameter( defaultValue = "false" ) boolean includeDependencies; /** * use repository layout for included dependencies */ @Parameter( defaultValue = "false" ) boolean useRepositoryLayout; private void generatePom(File source, File target) throws ScriptException, IOException { URL url = Thread.currentThread().getContextClassLoader().getResource("maven/tools/pom.rb"); String baseUrl = url.toExternalForm().replace("/maven/tools/pom.rb", ""); // this assumes to get an url JRuby understands !! this.factory.newScript("def warn(*args);end;$LOAD_PATH << '" + baseUrl + "';" + "require 'maven/tools/pom';" + "puts Maven::Tools::POM.new('" + source.getAbsolutePath() + "').to_s") .executeIn(launchDirectory(), target); } @Override public void executeJRuby() throws MojoExecutionException, MojoFailureException, ScriptException { final MavenProject project = this.project; final GemArtifact artifact = new GemArtifact(project); try { // first case no gemspec file given but there is pom => use pom to generate gemspec if (this.gemspec == null && project.getBasedir() != null && project.getBasedir().exists()) { // TODO generate the gemspec in the prepare-package phase so we // can use it separately buildFromPom(project, artifact); // use POM generated by polyglot maven instead of project // file (which can be 'Gemfile' or a gemspec file) to allow // to install it into the local repository and be // usable for proper maven // maybe that is a bug in polyglot maven ? final File pom = new File(this.project.getFile() .getAbsolutePath() + ".pom"); if (pom.exists()) { this.project.setFile(pom); } } else { // no gemspec file given => find a gemspec file in launchDirectory if (this.gemspec == null) { for (final File f : launchDirectory().listFiles()) { if (f.getName().endsWith(".gemspec")) { if (this.gemspec == null) { this.gemspec = f; } else { throw new MojoFailureException("more than one gemspec file found, use -Dgemspec=... to specifiy one"); } } } if (this.gemspec == null) { throw new MojoFailureException("no gemspec file or pom found, use -Dgemspec=... to specifiy a gemspec file or '-f ...' to use a pom file"); } else { getLog().info("use gemspec: " + this.gemspec); } } ArtifactResolutionResult jarDependencyArtifacts = includeDependencies( project, artifact ); if (jarDependencyArtifacts != null ) { getLog().info("use repository layout? " + this.useRepositoryLayout); for (final Object element : jarDependencyArtifacts.getArtifacts()) { final Artifact dependency = (Artifact) element; getLog().info(" -- include -- " + dependency); File target; if ( useRepositoryLayout ) { StringBuilder path = new StringBuilder( libDirectory.getAbsolutePath() ); path.append( File.separatorChar ).append( dependency.getGroupId().replace( ".", File.separator ) ); path.append( File.separatorChar ).append( dependency.getArtifactId() ); path.append( File.separatorChar ).append( dependency.getVersion() ); target = new File( path.toString(), dependency.getFile().getName() ); target.getParentFile().mkdirs(); } else { target = new File( libDirectory, dependency.getFile().getName() ); } FileUtils.copyFile( dependency.getFile(), target ); } } // now we have a gemspec file - either found or given this.factory.newScriptFromJRubyJar("gem") .addArg("build", this.gemspec) .executeIn(launchDirectory()); File newPom = new File( this.gemspec.getParentFile(), "pom." + this.gemspec.getName() + ".xml"); generatePom(this.gemspec, newPom); project.setFile(newPom); // find file with biggest lastModified File gemFile = null; for (final File f : launchDirectory().listFiles()) { if (f.getName().endsWith(".gem")) { if (gemFile == null || gemFile.lastModified() < f.lastModified() ) { gemFile = f; } } } if (project.getFile() != null && artifact.isGem()) { // only when the pom exist there will be an artifact FileUtils.copyFileIfModified(gemFile, artifact.getFile()); gemFile.delete(); } else { // keep the gem where it is when there is no buildDirectory if (this.buildDirectory.exists()) { FileUtils.copyFileIfModified(gemFile, new File(this.buildDirectory, gemFile.getName())); gemFile.deleteOnExit(); } } } } catch (final IOException e) { throw new MojoExecutionException("error gemifing pom", e); } } private void buildFromPom(final MavenProject project, final GemArtifact artifact) throws MojoExecutionException, IOException, ScriptException { getLog().info("building gem for " + artifact + " . . ."); final File gemDir = new File(this.buildDirectory, artifact.getGemName()); final File gemSpec = new File(gemDir, artifact.getGemName() + ".gemspec"); final GemspecWriter gemSpecWriter = new GemspecWriter(gemSpec, project, artifact); if (this.date != null) { gemSpecWriter.append("date", Date.valueOf(this.date).toString()); } gemSpecWriter.append("rubygems_version", this.rubygemsVersion); gemSpecWriter.append("required_rubygems_version", this.requiredRubygemsVersion); gemSpecWriter.append("required_ruby_version", this.requiredRubyVersion); gemSpecWriter.append("bindir", this.bindir); gemSpecWriter.append("post_install_message", this.postInstallMessage); gemSpecWriter.append("rubyforge_project", this.rubyforgeProject); gemSpecWriter.appendRdocFiles(this.extraRdocFiles); gemSpecWriter.appendFiles(this.extraFiles); gemSpecWriter.appendList("executables", this.executables); gemSpecWriter.appendList("extensions", this.extensions); gemSpecWriter.appendList("rdoc_options", this.rdocOptions); gemSpecWriter.appendList("require_paths", this.requirePaths); final File rubyFile; if (artifact.hasJarFile()) { gemSpecWriter.appendPlatform(this.platform == null ? "java" : this.platform); gemSpecWriter.appendJarfile(artifact.getJarFile(), artifact.getJarFile().getName()); final File lib = new File(gemDir, "lib"); lib.mkdirs(); // need relative filename here rubyFile = new File(lib.getName(), artifact.getGemName() + ".rb"); gemSpecWriter.appendFile(rubyFile); } else { rubyFile = null; gemSpecWriter.appendPlatform(this.platform); } ArtifactResolutionResult jarDependencyArtifacts = includeDependencies( project, artifact ); if (jarDependencyArtifacts != null ) { for (final Object element : jarDependencyArtifacts.getArtifacts()) { final Artifact dependency = (Artifact) element; getLog().info(" -- include -- " + dependency); gemSpecWriter.appendJarfile(dependency.getFile(), dependency.getFile().getName()); } } // TODO make it the maven way (src/main/ruby + src/test/ruby) or the // ruby way (lib + spec + test) // TODO make a loop or so ;-) final File binDir = new File(project.getBasedir(), "bin"); final File libDir = new File(project.getBasedir(), "lib"); final File generatorsDir = new File(project.getBasedir(), "generators"); final File specDir = new File(project.getBasedir(), "spec"); final File testDir = new File(project.getBasedir(), "test"); if (binDir.exists()) { gemSpecWriter.appendPath("bin"); for (final File file : binDir.listFiles()) { // if ( file.canExecute() ) { // java1.6 feature which will fail // on jre1.5 runtimes gemSpecWriter.appendExecutable(file.getName()); // } } } if (libDir.exists()) { gemSpecWriter.appendPath("lib"); } if (generatorsDir.exists()) { gemSpecWriter.appendPath("generators"); } if (specDir.exists()) { gemSpecWriter.appendPath("spec"); gemSpecWriter.appendTestPath("spec"); } if (testDir.exists()) { gemSpecWriter.appendPath("test"); gemSpecWriter.appendTestPath("test"); } for (final Dependency dependency : project.getDependencies()) { if (!dependency.isOptional() && dependency.getType().contains("gem")) { final String prefix = dependency.getGroupId() .equals("rubygems") ? "" : dependency.getGroupId() + "."; if ((Artifact.SCOPE_COMPILE + Artifact.SCOPE_RUNTIME).contains(dependency.getScope())) { gemSpecWriter.appendDependency(prefix + dependency.getArtifactId(), dependency.getVersion()); } else if ((Artifact.SCOPE_PROVIDED + Artifact.SCOPE_TEST).contains(dependency.getScope())) { gemSpecWriter.appendDevelopmentDependency(prefix + dependency.getArtifactId(), dependency.getVersion()); } else { // TODO put things into "requirements" } } } gemSpecWriter.close(); gemSpecWriter.copy(gemDir); if (artifact.hasJarFile() && !rubyFile.exists()) { FileWriter writer = null; try { // need absolute filename here writer = new FileWriter(new File(gemDir, rubyFile.getPath())); writer.append("module ") .append(titleizedClassname(project.getArtifactId())) .append("\n"); writer.append(" VERSION = '") .append(artifact.getGemVersion()) .append("'\n"); writer.append(" MAVEN_VERSION = '") .append(project.getVersion()) .append("'\n"); writer.append("end\n"); writer.append("begin\n"); writer.append(" require 'java'\n"); writer.append(" require File.dirname(__FILE__) + '/") .append(artifact.getJarFile().getName()) .append("'\n"); if (jarDependencyArtifacts != null) { for (final Object element : jarDependencyArtifacts.getArtifacts()) { final Artifact dependency = (Artifact) element; writer.append(" require File.dirname(__FILE__) + '/") .append(dependency.getFile().getName()) .append("'\n"); } } writer.append("rescue LoadError\n"); writer.append(" puts 'JAR-based gems require JRuby to load. Please visit www.jruby.org.'\n"); writer.append(" raise\n"); writer.append("end\n"); writer.append("\n"); writer.append("load File.dirname(__FILE__) + '/" + this.gemHook + "' if File.exists?( File.dirname(__FILE__) + '/" + this.gemHook + "')\n"); } catch (final IOException e) { throw new MojoExecutionException("error writing ruby file", e); } finally { if (writer != null) { try { writer.close(); } catch (final IOException ignore) { } } } } final File localGemspec = new File(launchDirectory(), gemSpec.getName()); this.factory.newScriptFromJRubyJar("gem") .addArg("build", gemSpec) .executeIn(gemDir); if ((!localGemspec.exists() || !FileUtils.contentEquals(localGemspec, gemSpec)) && this.gemspecOverwrite) { getLog().info("overwrite gemspec '" + localGemspec.getName() + "'"); FileUtils.copyFile(gemSpec, localGemspec); } final StringBuilder gemFilename = new StringBuilder("rubygems".equals(artifact.getGroupId()) ? "" : artifact.getGroupId() + ".").append(artifact.getArtifactId()) .append("-") .append(artifact.getGemVersion()) .append("java-gem".equals(artifact.getType()) || "java".equals(this.platform) ? "-java" : "") .append(".gem"); FileUtils.copyFile(new File(gemDir, gemFilename.toString()), artifact.getFile()); } private ArtifactResolutionResult includeDependencies( MavenProject project, final GemArtifact artifact) throws IOException { ArtifactResolutionResult jarDependencyArtifacts = null; getLog().info("include dependencies? " + this.includeDependencies); if (this.includeDependencies) { final ArtifactFilter filter = new ArtifactFilter() { public boolean include(final Artifact candidate) { if (candidate == artifact) { return true; } final boolean result = (candidate.getType().equals("jar") && ("compile".equals(candidate.getScope()) || "runtime".equals(candidate.getScope()))); return result; } }; // remember file location since resolve will set it to // local-repository location final File artifactFile = artifact.getFile(); final ArtifactResolutionRequest request = new ArtifactResolutionRequest().setArtifact(project.getArtifact()) .setResolveRoot(false) .setLocalRepository(this.localRepository) .setRemoteRepositories(project.getRemoteArtifactRepositories()) .setCollectionFilter(filter) .setManagedVersionMap(project.getManagedVersionMap()) .setArtifactDependencies(project.getDependencyArtifacts()); jarDependencyArtifacts = this.repositorySystem.resolve(request); // keep the artifactFile on build directory artifact.setFile(artifactFile); } return jarDependencyArtifacts; } private String titleizedClassname(final String artifactId) { final StringBuilder name = new StringBuilder(); for (final String part : artifactId.split("-")) { name.append(StringUtils.capitalise(part)); } return name.toString(); } @Override protected void executeWithGems() throws MojoExecutionException, ScriptException, IOException { // nothing to do here since we override executeJRuby } } ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/main/java/de/saumya/mojo/gem/GemMojo.java0000644000000000000000000000167412674201751027530 0ustar package de.saumya.mojo.gem; import java.io.IOException; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import de.saumya.mojo.ruby.script.ScriptException; /** * goal to run gem with the given arguments. *
    * DEPRECATED - DO NOT USE */ @Deprecated @Mojo( name = "gem" ) public class GemMojo extends AbstractGemMojo { /** * arguments for the gem command of JRuby. */ @Parameter( property = "gem.args" ) protected String gemArgs = null; @Override public void executeWithGems() throws MojoExecutionException, ScriptException, IOException { getLog().warn( "DEPRECATED: just do not use that anymore. use gem:exec instead" ); this.factory.newScriptFromJRubyJar("gem") .addArgs(this.gemArgs) .addArgs(this.args) .execute(); } } ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/main/java/de/saumya/mojo/gem/SetsMojo.java0000644000000000000000000001535012674201751027732 0ustar package de.saumya.mojo.gem; import java.io.File; import java.io.IOException; import java.util.Collections; import java.util.LinkedHashSet; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Set; import java.util.TreeSet; import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.artifact.resolver.ArtifactResolutionRequest; import org.apache.maven.artifact.resolver.ArtifactResolutionResult; import org.apache.maven.model.Dependency; import org.apache.maven.model.Model; import org.apache.maven.model.io.ModelReader; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugins.annotations.Component; import org.apache.maven.plugins.annotations.LifecyclePhase; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.plugins.annotations.ResolutionScope; import de.saumya.mojo.ruby.gems.GemException; import de.saumya.mojo.ruby.script.ScriptException; import org.apache.maven.project.MavenProject; /** * installs a set of given gems without resolving any transitive dependencies */ @Mojo( name = "sets", defaultPhase = LifecyclePhase.INITIALIZE, requiresDependencyResolution = ResolutionScope.TEST ) public class SetsMojo extends AbstractGemMojo { /** * the scope under which the gems get installed */ @Parameter( defaultValue = "compile" ) protected String scope; /** * map of gemname to version, i.e. it is a "list" of gems with fixed version */ @Parameter protected Map gems = Collections.emptyMap(); @Component protected ModelReader reader; protected void executeWithGems() throws MojoExecutionException, ScriptException, IOException, GemException { Set gems = new TreeSet(); Set jars = new TreeSet(); for( Map.Entry gem : this.gems.entrySet() ) { Set set = manager.resolve( manager.createGemArtifact( gem.getKey(), gem.getValue() ), localRepository, project.getRemoteArtifactRepositories() ); if ( set.size() == 1 ) { Artifact artifact = set.iterator().next(); artifact.setScope(scope); gems.add(artifact); collectJarDependencies(jars, artifact); } else if ( set.size() > 1 ) { getLog().error( "found more then one artifact for given version: " + gem.getKey() + " " + gem.getValue() ); } } resolveJarDepedencies(jars); installGems(gems); Set resolved = (Set) project.getContextValue("jruby.resolved.artifacts"); if (resolved == null) { resolved = project.getArtifacts(); // TODO this might mix the java and ruby application jars // use resolved artifacts as project ones project.setResolvedArtifacts(resolved); project.setContextValue("jruby.resolved.artifacts", resolved); } resolved.addAll(jars); resolved.addAll(gems); } private void installGems(Set gems) throws IOException, ScriptException, GemException { File home = gemsConfig.getGemHome(); // use gemHome as base for other gems installation directories String base = this.gemsConfig.getGemHome() != null ? this.gemsConfig.getGemHome().getAbsolutePath() : (project.getBuild().getDirectory() + "/rubygems"); try { final File gemHome; if ( "test".equals( scope ) || "provided".equals( scope ) ) { gemHome = gemHome( base, scope); } else { gemHome = new File( base ); } this.gemsConfig.setGemHome(gemHome); this.gemsConfig.addGemPath(gemHome); getLog().info("installing gem sets for " + scope + " scope into " + gemHome.getAbsolutePath().replace(project.getBasedir().getAbsolutePath() + File.separatorChar, "")); gemsInstaller.installGems(project, gems, null, (List) null); } finally { // reset old gem home again this.gemsConfig.setGemHome(home); } } private void collectJarDependencies(Set jars, Artifact artifact) throws GemException, IOException { Set set = manager.resolve(manager.createArtifact(artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), "pom"), localRepository, project.getRemoteArtifactRepositories()); Model pom = reader.read(set.iterator().next().getFile(), null); for( Dependency dependency : pom.getDependencies() ){ if (!dependency.getType().equals("gem")) { if (dependency.getScope() == null || dependency.getScope().equals("compile") || dependency.equals("runtime")) { Artifact a = manager.createArtifact(dependency.getGroupId(), dependency.getArtifactId(), dependency.getVersion(), dependency.getClassifier(), dependency.getType()); a.setScope(dependency.getScope()); jars.add(a); } } } } private void resolveJarDepedencies(Set jars) { ArtifactResolutionRequest req = new ArtifactResolutionRequest() .setArtifact(project.getArtifact()) .setResolveRoot(false) .setArtifactDependencies(jars) .setResolveTransitively(true) .setLocalRepository(localRepository) .setRemoteRepositories(project.getRemoteArtifactRepositories()); ArtifactResolutionResult result = this.repositorySystem.resolve(req); Set resolvedArtifacts = result.getArtifacts(); for( Artifact artifact : resolvedArtifacts ){ // * compile scope we leave things as they are // * other scopes we only take runtime, compile time artifacts and set the scope to outer scope if ("compile".equals(scope)) { if (artifact.getScope() == null) artifact.setScope(scope); jars.add(artifact); } else if (!"test".equals(artifact.getScope()) && !"provided".equals(artifact.getScope())) { artifact.setScope(scope); jars.add(artifact); } } } } ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/main/java/de/saumya/mojo/gem/ProcessResourcesMojo.java./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/main/java/de/saumya/mojo/gem/ProcessResour0000644000000000000000000001046512674201751030067 0ustar package de.saumya.mojo.gem; import java.io.File; import java.io.FileFilter; import java.io.IOException; import java.util.Collections; import java.util.List; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugins.annotations.LifecyclePhase; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import org.codehaus.plexus.util.DirectoryScanner; import org.codehaus.plexus.util.FileUtils; import de.saumya.mojo.ruby.gems.GemException; import de.saumya.mojo.ruby.script.Script; import de.saumya.mojo.ruby.script.ScriptException; /** * installs a set of given gems without resolving any transitive dependencies */ @Mojo( name = "process-resources", defaultPhase = LifecyclePhase.PROCESS_RESOURCES ) public class ProcessResourcesMojo extends AbstractGemMojo { @Parameter protected List includeRubyResources; @Parameter protected List excludeRubyResources = Collections.emptyList(); @Override protected void executeWithGems() throws MojoExecutionException, ScriptException, IOException, GemException { File jrubydir = new File(project.getBuild().getOutputDirectory(), ".jrubydir"); if ( includeRubyResources != null ) { jrubydir.delete(); DirectoryScanner scanner = scan(includeRubyResources.toArray(new String[includeRubyResources.size()]), excludeRubyResources.toArray(new String[excludeRubyResources.size()]) ); processBaseDirectory(scanner, jrubydir); processNestedDiretories(scanner); } if ( rubySourceDirectory.exists() ) { processDir(jrubydir, rubySourceDirectory); } if ( libDirectory.exists() && includeLibDirectoryInResources ) { processDir(jrubydir, libDirectory); } } private void processDir(File jrubydir, File dir) throws IOException, ScriptException { File[] dirs = dir.listFiles(new FileFilter() { public boolean accept(File f) { return f.isDirectory(); } }); String[] includes = new String[ dirs.length + 1 ]; includes[ 0 ] = "*"; int index = 1; for( File d: dirs ) { includes[ index ++ ] = d.getName() + "/*"; } DirectoryScanner scanner = scan(includes, new String[0]); processBaseDirectory(scanner, jrubydir); processNestedDiretories(scanner); } private void processNestedDiretories(DirectoryScanner scanner) throws IOException, ScriptException { String[] directories = scanner.getIncludedDirectories(); if (directories.length > 0) { StringBuilder script = new StringBuilder("require 'jruby/commands';"); for( String dir: directories) { if (!dir.contains("/")) { script.append("JRuby::Commands.generate_dir_info('" + new File( project.getBuild().getOutputDirectory(), dir ).getAbsolutePath() + "', false) if JRuby::Commands.respond_to? :generate_dir_info;" ); } } Script s = this.factory.newScript(script.toString()); s.execute(); } } private void processBaseDirectory(DirectoryScanner scanner, File jrubydir) throws IOException { String[] files = scanner.getIncludedFiles(); if (files.length > 0) { StringBuilder fileList; if (jrubydir.exists()) { fileList = new StringBuilder(FileUtils.fileRead(jrubydir)); } else { fileList = new StringBuilder(".\n"); } for (String file: files) { if (!file.contains("/")) { fileList.append(file).append("\n"); } } FileUtils.fileWrite(jrubydir, fileList.toString()); } } private DirectoryScanner scan(String[] includes, String[] excludes) { DirectoryScanner scanner = new DirectoryScanner(); scanner.setBasedir(project.getBuild().getOutputDirectory()); scanner.addDefaultExcludes(); scanner.setIncludes(includes); scanner.setExcludes(excludes); scanner.scan(); return scanner; } } ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/main/java/de/saumya/mojo/gem/InitializeMojo.java./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/main/java/de/saumya/mojo/gem/InitializeMoj0000644000000000000000000000110512674201751030007 0ustar package de.saumya.mojo.gem; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugins.annotations.LifecyclePhase; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.ResolutionScope; /** * installs all declared gem in GEM_HOME */ @Mojo( name ="initialize", defaultPhase = LifecyclePhase.INITIALIZE, requiresDependencyResolution = ResolutionScope.TEST ) public class InitializeMojo extends AbstractGemMojo { @Override protected void executeWithGems() throws MojoExecutionException { } } ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/main/java/de/saumya/mojo/gem/ExecMojo.java0000644000000000000000000000623512674201751027702 0ustar package de.saumya.mojo.gem; import java.io.File; import java.io.IOException; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugins.annotations.LifecyclePhase; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.plugins.annotations.ResolutionScope; import de.saumya.mojo.ruby.script.Script; import de.saumya.mojo.ruby.script.ScriptException; /** * executes a ruby script in context of the gems from pom. the arguments for * jruby are build like this: * ${jruby.args} ${exec.file} ${exec.args} ${args}
    * to execute an inline script the exec parameters are ignored. */ @Mojo( name = "exec", defaultPhase = LifecyclePhase.INITIALIZE, requiresDependencyResolution = ResolutionScope.TEST, requiresProject = false ) public class ExecMojo extends AbstractGemMojo { /** * ruby code from the pom configuration part which gets executed. */ @Parameter( property = "exec.script" ) protected String script = null; /** * ruby file which gets executed in context of the given gems.. */ @Parameter( property = "exec.file" ) protected File file = null; /** * ruby file found on search path which gets executed. the search path * includes the executable scripts which were installed via the given * gem-artifacts. */ @Parameter( property = "exec.filename" ) protected String filename = null; /** * output file where the standard out will be written */ @Parameter( property = "exec.outputFile" ) protected File outputFile = null; /** * arguments separated by whitespaces for the ruby script given through file parameter. * no quoting or escaping possible - if needed use execArglines instead. */ @Parameter( property = "exec.args" ) protected String execArgs = null; /** * an array of arguments which can contain spaces for the ruby script given through file parameter. */ @Parameter protected String[] execArgLines = null; @Override protected void executeWithGems() throws MojoExecutionException, ScriptException, IOException { Script s; if (this.script != null && this.script.length() > 0) { s = this.factory.newScript(this.script); } else if (this.file != null) { s = this.factory.newScript(this.file); } else if (this.filename != null) { s = this.factory.newScriptFromSearchPath( this.filename ); } else { s = this.factory.newArguments(); } if ( execArgLines != null ){ for( String arg: execArgLines ){ s.addArg( arg ); } } s.addArgs(this.execArgs); s.addArgs(this.args); if (s.isValid()) { if(outputFile != null){ s.executeIn(launchDirectory(), outputFile); } else { s.executeIn(launchDirectory()); } } else { getLog().warn("no arguments given. use -Dexec.script=... or -Dexec.file=..."); } } } ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/main/java/de/saumya/mojo/gem/GemArtifact.java./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/main/java/de/saumya/mojo/gem/GemArtifact.j0000644000000000000000000002276612674201751027676 0ustar /** * */ package de.saumya.mojo.gem; import java.io.File; import java.util.Collection; import java.util.List; import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.handler.ArtifactHandler; import org.apache.maven.artifact.metadata.ArtifactMetadata; import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.artifact.resolver.filter.ArtifactFilter; import org.apache.maven.artifact.versioning.ArtifactVersion; import org.apache.maven.artifact.versioning.OverConstrainedVersionException; import org.apache.maven.artifact.versioning.VersionRange; import org.apache.maven.project.MavenProject; @SuppressWarnings("deprecation") public class GemArtifact implements Artifact { // helper to make maven2 behave like maven3 static class GemArtifactHandler implements ArtifactHandler { private final ArtifactHandler handler; GemArtifactHandler(final ArtifactHandler handler) { this.handler = handler; } public String getClassifier() { return this.handler.getClassifier(); } public String getDirectory() { return this.handler.getDirectory(); } public String getExtension() { if (this.handler.getExtension().equals("java-gem")) { return "gem"; } else { return this.handler.getExtension(); } } public String getLanguage() { return this.handler.getLanguage(); } public String getPackaging() { return this.handler.getPackaging(); } public boolean isAddedToClasspath() { return this.handler.isAddedToClasspath(); } public boolean isIncludesDependencies() { return this.handler.isIncludesDependencies(); } } private final Artifact artifact; private final File jarFile; public GemArtifact(final MavenProject project) { this.artifact = project.getArtifact(); this.jarFile = this.artifact.getFile(); if (isGem()) { if ( project.getBuild().getFinalName() == null || !project.getGroupId().equals("rubygems")) { this.artifact.setFile(new File(new File(project.getBuild() .getDirectory()), getGemFile())); } else { this.artifact.setFile(new File(new File(project.getBuild() .getDirectory()), project.getBuild().getFinalName() + ".gem" ) ); } } // allow maven2 to do the right thing with the classifier project.setArtifact(this); this.artifact.setArtifactHandler(new GemArtifactHandler(this.artifact.getArtifactHandler())); } public String getGemName() { if (getGroupId().equals("rubygems")) { return getArtifactId(); } else { final StringBuilder name = new StringBuilder(getGroupId()); name.append(".").append(getArtifactId()); return name.toString(); } } public String getGemVersion() { return getGemVersion(getVersion()); } public static String getGemVersion(final String artifactVersion) { final StringBuilder version = new StringBuilder(); boolean first = true; for (final String part : artifactVersion.replaceAll("-SNAPSHOT", "") .replace("-", ".") .split("\\.")) { if (part.length() > 0) { if (first) { first = false; version.append(part); } else { version.append(".").append(part); } } } return version.toString(); } public String getGemFile() { final StringBuilder name = new StringBuilder(getGemName()); name.append("-").append(getGemVersion()); if (hasJarFile()) { name.append("-java"); } name.append(".gem"); return name.toString(); } public File getFile() { return this.artifact.getFile(); } public String getClassifier() { return this.artifact.getClassifier(); } public boolean hasJarFile() { return "java-gem".equals(getType()); } public File getJarFile() { if (hasJarFile()) { return this.jarFile; } else { return null; } } public void addMetadata(final ArtifactMetadata metadata) { this.artifact.addMetadata(metadata); } public int compareTo(final Artifact o) { return this.artifact.compareTo(o); } public ArtifactHandler getArtifactHandler() { return this.artifact.getArtifactHandler(); } public String getArtifactId() { return this.artifact.getArtifactId(); } public List getAvailableVersions() { return this.artifact.getAvailableVersions(); } public String getBaseVersion() { return this.artifact.getBaseVersion(); } // public String getClassifier() { // return this.artifact.getClassifier(); // } public String getDependencyConflictId() { return this.artifact.getDependencyConflictId(); } public ArtifactFilter getDependencyFilter() { return this.artifact.getDependencyFilter(); } public List getDependencyTrail() { return this.artifact.getDependencyTrail(); } public String getDownloadUrl() { return this.artifact.getDownloadUrl(); } public String getGroupId() { return this.artifact.getGroupId(); } public String getId() { return this.artifact.getId(); } public Collection getMetadataList() { return this.artifact.getMetadataList(); } public ArtifactRepository getRepository() { return this.artifact.getRepository(); } public String getScope() { return this.artifact.getScope(); } public ArtifactVersion getSelectedVersion() throws OverConstrainedVersionException { return this.artifact.getSelectedVersion(); } public String getType() { return this.artifact.getType(); } public String getVersion() { return this.artifact.getVersion(); } public VersionRange getVersionRange() { return this.artifact.getVersionRange(); } public boolean hasClassifier() { return getClassifier() != null; } // public boolean hasClassifier() { // return this.artifact.hasClassifier(); // } public boolean isOptional() { return this.artifact.isOptional(); } public boolean isRelease() { return this.artifact.isRelease(); } public boolean isResolved() { return this.artifact.isResolved(); } public boolean isSelectedVersionKnown() throws OverConstrainedVersionException { return this.artifact.isSelectedVersionKnown(); } public boolean isSnapshot() { return this.artifact.getVersion().matches(".*[a-zA-Z].*"); } public void selectVersion(final String version) { this.artifact.selectVersion(version); } public void setArtifactHandler(final ArtifactHandler handler) { this.artifact.setArtifactHandler(handler); } public void setArtifactId(final String artifactId) { this.artifact.setArtifactId(artifactId); } public void setAvailableVersions(final List versions) { this.artifact.setAvailableVersions(versions); } public void setBaseVersion(final String baseVersion) { this.artifact.setBaseVersion(baseVersion); } public void setDependencyFilter(final ArtifactFilter artifactFilter) { this.artifact.setDependencyFilter(artifactFilter); } public void setDependencyTrail(final List dependencyTrail) { this.artifact.setDependencyTrail(dependencyTrail); } public void setDownloadUrl(final String downloadUrl) { this.artifact.setDownloadUrl(downloadUrl); } public void setFile(final File destination) { this.artifact.setFile(destination); } public void setGroupId(final String groupId) { this.artifact.setGroupId(groupId); } public void setOptional(final boolean optional) { this.artifact.setOptional(optional); } public void setRelease(final boolean release) { this.artifact.setRelease(release); } public void setRepository(final ArtifactRepository remoteRepository) { this.artifact.setRepository(remoteRepository); } public void setResolved(final boolean resolved) { this.artifact.setResolved(resolved); } public void setResolvedVersion(final String version) { this.artifact.setResolvedVersion(version); } public void setScope(final String scope) { this.artifact.setScope(scope); } public void setVersion(final String version) { this.artifact.setVersion(version); } public void setVersionRange(final VersionRange newRange) { this.artifact.setVersionRange(newRange); } public void updateVersion(final String version, final ArtifactRepository localRepository) { this.artifact.updateVersion(version, localRepository); } @Override public String toString() { return this.artifact.toString(); } public boolean isGem() { return this.artifact.getType().contains("gem"); } } ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/main/java/de/saumya/mojo/gem/GenerateResourcesMojo.java./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/main/java/de/saumya/mojo/gem/GenerateResou0000644000000000000000000000372312674201751030020 0ustar package de.saumya.mojo.gem; import java.io.IOException; import java.util.List; import org.apache.maven.model.Resource; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugins.annotations.LifecyclePhase; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import de.saumya.mojo.ruby.gems.GemException; import de.saumya.mojo.ruby.script.ScriptException; /** * installs a set of given gems without resolving any transitive dependencies */ @Mojo( name = "generate-resources", defaultPhase = LifecyclePhase.GENERATE_RESOURCES ) public class GenerateResourcesMojo extends AbstractGemMojo { @Parameter protected List includeRubyResources; @Parameter protected List excludeRubyResources; @Parameter protected boolean includeBinStubs = false; @Override protected void executeWithGems() throws MojoExecutionException, ScriptException, IOException, GemException { if ( includeRubyResources != null) { // add it to the classpath so java classes can find the ruby files Resource resource = new Resource(); resource.setDirectory(project.getBasedir().getAbsolutePath()); for( String include: includeRubyResources) { resource.addInclude(include); } if (excludeRubyResources != null) { for( String exclude: excludeRubyResources) { resource.addExclude(exclude); } } addResource(project.getBuild().getResources(), resource); } if (includeBinStubs) { Resource resource = new Resource(); resource.setDirectory(gemsConfig.getBinDirectory().getAbsolutePath()); resource.addInclude("*"); resource.setTargetPath("META-INF/jruby.home/bin"); addResource(project.getBuild().getResources(), resource); } } } ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/main/java/de/saumya/mojo/gem/JarsLockMojo.java./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/main/java/de/saumya/mojo/gem/JarsLockMojo.0000644000000000000000000003556412674201751027673 0ustar package de.saumya.mojo.gem; import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.io.PrintWriter; import java.util.Collection; import java.util.Collections; import java.util.HashSet; import java.util.LinkedList; import java.util.List; import java.util.Map.Entry; import java.util.Set; import java.util.TreeSet; import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.artifact.resolver.ArtifactResolutionRequest; import org.apache.maven.artifact.resolver.ArtifactResolutionResult; import org.apache.maven.artifact.resolver.filter.ArtifactFilter; import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException; import org.apache.maven.artifact.versioning.VersionRange; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.plugins.annotations.Component; import org.apache.maven.plugins.annotations.LifecyclePhase; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.plugins.annotations.ResolutionScope; import org.apache.maven.project.MavenProject; import org.apache.maven.repository.RepositorySystem; import org.codehaus.plexus.util.FileUtils; import org.codehaus.plexus.util.IOUtil; /** * installs a set of given gems without resolving any transitive dependencies */ @Mojo( name ="jars-lock", defaultPhase = LifecyclePhase.INITIALIZE, requiresDependencyResolution = ResolutionScope.TEST ) public class JarsLockMojo extends AbstractMojo { private static final String JARS_HOME = "JARS_HOME"; /** * reference to maven project for internal use. */ @Parameter( defaultValue = "${project}", readonly = true ) protected MavenProject project; /** * Jars.lock file to be updated or created. */ @Parameter( defaultValue = "Jars.lock", property = "jars.lock" ) public File jarsLock; /** * where to copy the jars - default to JARS_HOME environment if set. */ @Parameter( property = "jars.home" ) public File jarsHome; /** * force update of Jars.lock file. */ @Parameter( defaultValue = "false", property = "jars.force" ) public boolean force; /** * update of Jars.lock file for a given artifactId */ @Parameter( property = "jars.update" ) public String update; /** * list of gems. one line one gem: {gemname}:{version}:{scope} or * {gemname}:{version} where scope defaults to compile. */ @Parameter public List gems = Collections.emptyList(); /** * log output file. * @parameter expression="${jars.outputFile}" */ @Parameter( property = "jars.outputFile" ) File outputFile; @Component protected RepositorySystem repositorySystem; /** * local repository for internal use. */ @Parameter( defaultValue = "${localRepository}", readonly = true ) protected ArtifactRepository localRepository; public void execute() throws MojoExecutionException, MojoFailureException { if (update != null) { updateArtifact(); } else { processJarsLock(); } } void processJarsLock() throws MojoExecutionException { List lines = toLines(getArtifacts()); try { switch (checkForUpdates(lines)) { case NEEDS_FORCED_UPDATE: getLog().info(message(jarsLock() + " has outdated dependencies")); // resolve all artifacts from Jars.lock resolve(true); break; case CAN_UPDATE: // means Jars.lock misses some dependencies which can be safely // updated updateJarsLock(lines); break; case UP_TO_DATE: getLog().info(message(jarsLock() + " is up to date")); // ensure jars are vendored vendorJars(); default: } } catch (IOException e) { throw exception("can not read " + jarsLock, e); } } private List getArtifacts() { List artifacts = project.getRuntimeArtifacts(); artifacts.addAll(project.getSystemArtifacts()); for (String gem : gems) { if (!gem.endsWith(":")) gem += ":"; ArtifactResolutionRequest request = new ArtifactResolutionRequest(); // TODO instead of transitive just resolve pom and get the // dependency from it // via MavenProject and then resolve the jar dependencies // transitively. or similar. request.setResolveTransitively(true); request.setCollectionFilter(new ArtifactFilter() { public boolean include(Artifact artifact) { return artifact.getDependencyTrail() == null || artifact.getType().equals("jar"); } }); request.setResolveRoot(true); // type pom is enough here request.setArtifact(createArtifact("rubygems:" + gem, "pom")); request.setLocalRepository(localRepository); request.setRemoteRepositories(project .getRemoteArtifactRepositories()); ArtifactResolutionResult result = repositorySystem.resolve(request); artifacts.addAll(result.getArtifacts()); } return artifacts; } private void updateJarsLock(List lines) throws MojoExecutionException { String action = jarsLock.exists() ? "updated" : "created"; try { writeJarsLock(lines); } catch (IOException e) { throw exception("can not write " + jarsLock(), e); } try { // vendor new jars vendorJars(); } catch (IOException e) { throw exception("can not vendor jars from " + jarsLock(), e); } getLog().info(message(jarsLock() + " " + action)); } private MojoExecutionException exception(String text, IOException e) { return new MojoExecutionException(message(text), e); } private String message(String text) { if (outputFile != null){ try { FileUtils.fileAppend(outputFile.getPath(), text + "\n"); } catch (IOException e) { throw new RuntimeException("error writing text to output-file: " + text, e); } } return text; } private List toLines(Collection artifacts) { List lines = new LinkedList(); for (Artifact a : artifacts) { String line = toLine(a); if (line != null) lines.add(line); } return lines; } private void updateArtifact() throws MojoExecutionException { ArtifactResolutionResult result = resolveUpdate(); if (result == null) { getLog().error(message("no such artifact in " + jarsLock() + ": " + update)); } else if (result.isSuccess()) { for (Artifact a : result.getArtifacts()) { if (a.getArtifactId().equals(update)) { getLog().info(message("updated " + a)); break; } } updateJarsLock(toLines(result.getArtifacts())); } else { for (Exception e : result.getExceptions()) { getLog().error(message(e.getMessage())); } for (Artifact a : result.getMissingArtifacts()) { getLog().error(message("missing artifact: " + a)); } } } private ArtifactResolutionResult resolveUpdate() throws MojoExecutionException { return resolve(false); } private ArtifactResolutionResult resolve(boolean hasUpdate) throws MojoExecutionException { List jars = loadJarsLock(); ArtifactResolutionRequest request = new ArtifactResolutionRequest(); Set artifacts = new HashSet(); for (String jar : jars) { Artifact a = createArtifact(jar, "jar"); if (a != null) { if (a.getArtifactId().equals(update)) { try { a.setVersionRange(VersionRange .createFromVersionSpec("[" + a.getVersion() + ",)")); } catch (InvalidVersionSpecificationException e) { throw new RuntimeException( "something wrong with creating version range", e); } hasUpdate = true; } artifacts.add(a); } } if (!hasUpdate) { return null; } request.setArtifactDependencies(artifacts); request.setResolveTransitively(false); request.setResolveRoot(false); request.setArtifact(project.getArtifact()); request.setLocalRepository(localRepository); request.setRemoteRepositories(project.getRemoteArtifactRepositories()); return repositorySystem.resolve(request); } private Artifact createArtifact(String jar, String type) { if (!jar.endsWith(":") || jar.startsWith("#")) return null; String[] parts = jar.split(":"); if (parts.length == 3) { return repositorySystem.createArtifact(parts[0], parts[1], parts[2], "compile", type); } if (parts.length == 4) { return repositorySystem.createArtifact(parts[0], parts[1], parts[2], parts[3], type); } if (parts.length == 5) { Artifact a = repositorySystem.createArtifactWithClassifier( parts[0], parts[1], parts[3], type, parts[2]); a.setScope(parts[4]); return a; } getLog().warn(message("ignore :" + jar)); return null; } private String jarsLock() { return jarsLock.getAbsolutePath().replace( project.getBasedir().getAbsolutePath() + File.separator, ""); } private void vendorJars() throws IOException { if (jarsHome == null) { if (System.getenv(JARS_HOME) != null) { jarsHome = new File(System.getenv(JARS_HOME)); } } if (jarsHome != null) { jarsHome.mkdirs(); } if (jarsHome == null || !jarsHome.exists() || !jarsHome.isDirectory()) { return; } getLog().info(message("vendor jars:")); for (Artifact a : getArtifacts()) { if (a.getType().equals("jar") && !a.getScope().equals(Artifact.SCOPE_SYSTEM)) { File target = new File(jarsHome, a.getGroupId().replace(".", File.separator) + File.separator + a.getArtifactId() + File.separator + a.getVersion() + File.separator + a.getFile().getName()); if (force || a.getFile().length() != target.length() && !a.getFile().equals(target)) { getLog().info(message("\t- create " + target)); FileUtils.copyFile(a.getFile(), target); } else { getLog().info(message("\t- exists " + target)); } } getLog().info(message("")); } } private void writeJarsLock(List lines) throws FileNotFoundException { PrintWriter out = null; try { out = new PrintWriter(jarsLock); for (String line : lines) { out.println(line); } } finally { IOUtil.close(out); } } private static enum Status { CAN_UPDATE, NEEDS_FORCED_UPDATE, UP_TO_DATE } private Status checkForUpdates(List lines) throws IOException, MojoExecutionException { if (force) { return Status.CAN_UPDATE; } if (jarsLock.exists()) { Set newLines = new TreeSet(lines); Set oldLines = new TreeSet(loadJarsLock()); Set newLinesClone = new TreeSet(newLines); Set oldLinesClone = new TreeSet(oldLines); oldLinesClone.removeAll(newLines); newLinesClone.removeAll(oldLines); Set diffOld = new TreeSet(); for( String dep : oldLinesClone ) { diffOld.add( dep.replaceFirst("^([^:]+:[^:]+):.*", "$1" ) ); } Set diffNew = new TreeSet(); for( String dep : newLinesClone ) { diffNew.add( dep.replaceFirst("^([^:]+:[^:]+):.*", "$1") ); } boolean disjoint = ! new TreeSet(diffOld).removeAll(diffNew); disjoint = disjoint && ! diffNew.removeAll(diffOld); Status result = Status.NEEDS_FORCED_UPDATE; if (newLines.equals(oldLines) ) { result = Status.UP_TO_DATE; } else if (disjoint) { result = Status.CAN_UPDATE; } if (result != Status.UP_TO_DATE && getLog().isInfoEnabled()) { getLog().info("missing : " + newLinesClone); getLog().info("obsolete: " + oldLinesClone); } return result; } return Status.CAN_UPDATE; } @SuppressWarnings("unchecked") private List loadJarsLock() throws MojoExecutionException { try { return FileUtils.loadFile(jarsLock); } catch (IOException e) { throw exception("can not read " + jarsLock, e); } } private String toLine(Artifact a) { if (!a.getType().equals("jar")) return null; StringBuilder line = new StringBuilder(a.toString().replace(":jar:", ":")); line.append(":"); if (a.getScope().equals(Artifact.SCOPE_SYSTEM)) { line.append(getSystemFile(a.getFile().getPath())); } return line.toString(); } private String getSystemFile(String file) { for (Entry prop : System.getProperties().entrySet()) { String key = prop.getKey().toString(); String value = prop.getValue().toString(); int index = file.indexOf(value); if (index > -1 && new File(value).isDirectory() && !"file.separator".equals(key)) { return file.replace(value, "${" + key + "}"); } } return ""; } } ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/main/java/de/saumya/mojo/gem/InstallMojo.java./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/main/java/de/saumya/mojo/gem/InstallMojo.j0000644000000000000000000000562012674201751027731 0ustar package de.saumya.mojo.gem; import java.io.File; import java.io.IOException; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.plugins.annotations.LifecyclePhase; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.plugins.annotations.ResolutionScope; import de.saumya.mojo.ruby.script.Script; import de.saumya.mojo.ruby.script.ScriptException; /** * goal to locally install a given gem */ @Mojo( name ="install", defaultPhase = LifecyclePhase.INSTALL ) public class InstallMojo extends AbstractGemMojo { /** * arguments for the "gem install" command. */ @Parameter( property = "install.args" ) protected String installArgs = null; /** * gem file to install locally.
    * Note: this will install the gem in ${gem.home} so in general that is only * useful if some other goal does something with it */ @Parameter( property = "gem" ) protected File gem = null; @Override public void executeWithGems() throws MojoExecutionException, ScriptException, IOException, MojoFailureException { final Script script = this.factory.newScriptFromJRubyJar("gem") .addArg("install"); // no given gem and pom artifact in place if (this.gem == null && this.project.getArtifact() != null && this.project.getArtifact().getFile() != null && this.project.getArtifact().getFile().exists()) { final GemArtifact gemArtifact = new GemArtifact(this.project); // skip artifact unless it is a gem. // this allows to use this mojo for installing arbitrary gems // via the args parameter if (gemArtifact.isGem()) { script.addArg("-l", gemArtifact.getFile()); } } else { // no pom artifact and no given gem so search for a gem if (this.gem == null) { for (final File f : this.launchDirectory().listFiles()) { if (f.getName().endsWith(".gem")) { if (this.gem == null) { this.gem = f; } else { throw new MojoFailureException("more than one gem file found, use -Dgem=... to specifiy one"); } } } } if (this.gem != null) { getLog().info("use gem: " + this.gem); script.addArg("-l", this.gem); } } script.addArg((installRDoc ? "--" : "--no-") + "rdoc") .addArg((installRI ? "--" : "--no-") + "ri") .addArgs(this.installArgs) .addArgs(this.args) .execute(); } } ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/main/java/de/saumya/mojo/gem/AbstractGemMojo.java./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/main/java/de/saumya/mojo/gem/AbstractGemMo0000644000000000000000000005242212674201751027740 0ustar package de.saumya.mojo.gem; import java.io.File; import java.io.IOException; import java.lang.reflect.Method; import java.util.LinkedList; import java.util.List; import java.util.Map; import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.DependencyResolutionRequiredException; import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.model.Resource; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.plugin.descriptor.PluginDescriptor; import org.apache.maven.plugins.annotations.Component; import org.apache.maven.plugins.annotations.Parameter; import org.codehaus.plexus.archiver.ArchiverException; import org.codehaus.plexus.archiver.UnArchiver; import de.saumya.mojo.jruby.AbstractJRubyMojo; import de.saumya.mojo.ruby.gems.GemException; import de.saumya.mojo.ruby.gems.GemManager; import de.saumya.mojo.ruby.gems.GemsConfig; import de.saumya.mojo.ruby.gems.GemsInstaller; import de.saumya.mojo.ruby.script.GemScriptFactory; import de.saumya.mojo.ruby.script.ScriptException; import de.saumya.mojo.ruby.script.ScriptFactory; /** */ public abstract class AbstractGemMojo extends AbstractJRubyMojo { @Component( hint="zip" ) protected UnArchiver unzip; @Parameter( defaultValue = "${plugin}", readonly = true ) protected PluginDescriptor plugin; /** * flag whether to include open-ssl gem or not *
    * Command line -Dgem.includeOpenSSL=... * */ @Parameter( defaultValue = "false", property = "gem.includeOpenSSL" ) @Deprecated protected boolean includeOpenSSL; /** * flag whether to include all gems to test-resources, i.e. to test-classpath or not *
    * Command line -Dgem.includeRubygemsInTestResources=... * */ @Parameter( defaultValue = "true", property = "gem.includeRubygemsInTestResources" ) protected boolean includeRubygemsInTestResources; /** * flag whether to include all gems to resources, i.e. to classpath or not *
    * Command line -Dgem.includeRubygemsInResources=... * */ @Parameter( defaultValue = "false", property = "gem.includeRubygemsInResources" ) protected boolean includeRubygemsInResources; /** * flag whether to include all gems to resources, i.e. to classpath or not *
    * Command line -Dgem.includeProvidedRubygemsInResources=... * * @parameter expression="${gem.includeProvidedRubygemsInResources}" default-value="false" */ @Parameter( defaultValue = "false", property = "gem.includeProvidedRubygemsInResources" ) protected boolean includeProvidedRubygemsInResources; /** * EXPERIMENTAL * * this gives the scope of the gems which shall be included to resources. * * flag whether to include all gems to resources, i.e. to classpath or not. * the difference to the includeRubygemsInResources is that it * does not depend on rubygems during runtime since the required_path of the * gems gets added to resources. note that it expect the required_path of the * gem to be lib which is the default BUT that is not true for all gems. * in this sense this feature is incomplete and might not work for you !!! * * IMPORTANT: it only adds the gems with provided scope since they are packed * with the jar and then the pom.xml will not have them (since they are marked * 'provided') as transitive dependencies. * * this feature can be helpful in situations where the classloader does not work * for rubygems due to rubygems uses file system globs to find the gems and this * only works if the classloader reveals the jar url of its jars (i.e. URLClassLoader). * for example OSGi classloader can not work with rubygems !! *
    * Command line -Dgem.includeGemsInResources=... * */ @Parameter( property = "gem.includeGemsInResources" ) @Deprecated protected String includeGemsInResources; /** /** * flag whether to include file under the lib directory *
    * Command line -Dgem.includeLibDirectoryInResources=... * */ @Parameter( defaultValue = "false", property = "gem.includeLibDirectoryInResources" ) protected boolean includeLibDirectoryInResources; /** * flag whether to install rdocs of the used gems or not *
    * Command line -Dgem.installRDoc=... * */ @Parameter( defaultValue = "false", property = "gem.installRDoc" ) protected boolean installRDoc; /** * flag whether to install ri of the used gems or not *
    * Command line -Dgem.installRDoc=... * */ @Parameter( defaultValue = "false", property = "gem.installRI" ) protected boolean installRI; /** * use system gems instead of setting up GemPath/GemHome inside the build directory and ignores any set * gemHome and gemPath. you need to have both GEM_HOME and GEM_PATH environment variable set to make it work. *
    * Command line -Dgem.useSystem=... * */ @Parameter( defaultValue = "false", property = "gem.useSystem" ) protected boolean gemUseSystem; /** * map different install locations for rubygems (GEM_HOME) to a directory. for example * compile dependencies will be installed in ${project.build.directory}/rubygems and * provided dependencies in ${project.build.directory}/rubygems-provided, and * ${project.build.directory}/rubygems-test for the test scope. this mapping here allows * to map those different directories onto a single one, i.e.: test => ${gem.home}, provided => ${gem.home} *
    * */ @Parameter( property = "gem.homes" ) protected Map gemHomes; /** * directory of gem home to use when forking JRuby. default will be ignored * when gemUseSystem is true. *
    * Command line -Dgem.home=... * */ @Parameter( property = "gem.home", defaultValue = "${project.build.directory}/rubygems" ) protected File gemHome; /** * directory of JRuby path to use when forking JRuby. default will be ignored * when gemUseSystem is true. *
    * Command line -Dgem.path=... * */ @Parameter( property = "gem.path", defaultValue = "${project.build.directory}/rubygems" ) protected File gemPath; /** * directory of JRuby bin path to use when forking JRuby. *
    * Command line -Dgem.binDirectory=... * */ @Parameter( property = "gem.binDirectory" ) protected File binDirectory; /** * flag to indicate to setup jruby's native support for C-extensions *
    * Command line -Dgem.supportNative=... * * @parameter expression="${gem.supportNative}" default-value="false" */ @Parameter( defaultValue = "false", property = "gem.supportNative" ) @Deprecated protected boolean supportNative; @Component protected GemManager manager; protected GemsConfig gemsConfig; protected GemsInstaller gemsInstaller; @Override public void execute() throws MojoExecutionException, MojoFailureException{ if (this.project.getBasedir() == null) { this.gemHome = new File(this.gemHome.getAbsolutePath() .replace("/${project.basedir}/", "/")); this.gemPath = new File(this.gemPath.getAbsolutePath() .replace("/${project.basedir}/", "/")); } this.gemsConfig = new GemsConfig(); try { this.gemsConfig.setGemHome(this.gemHome.getCanonicalFile()); this.gemsConfig.addGemPath(this.gemPath.getCanonicalFile()); } catch (IOException e) { // fallback to the given files this.gemsConfig.setGemHome(this.gemHome); this.gemsConfig.addGemPath(this.gemPath); } if (this.gemUseSystem && (System.getenv("GEM_HOME") == null || System.getenv( "GEM_PATH") == null) ){ getLog().warn("with gemUseSystem set to true and no GEM_HOME and GEM_PATH is set, " + " then some maven goals might not work as expected"); } this.gemsConfig.setSystemInstall(this.gemUseSystem); this.gemsConfig.setAddRdoc(this.installRDoc); this.gemsConfig.setAddRI(this.installRI); this.gemsConfig.setBinDirectory(this.binDirectory); // this.gemsConfig.setUserInstall(userInstall); // this.gemsConfig.setSystemInstall(systemInstall); this.gemsConfig.setSkipJRubyOpenSSL( ! (this.includeOpenSSL && getJrubyVersion().needsOpenSSL() ) ); super.execute(); } @Override protected ScriptFactory newScriptFactory(Artifact artifact) throws MojoExecutionException { try { final GemScriptFactory factory = artifact == null ? new GemScriptFactory(this.logger, this.classRealm, null, getProjectClasspath(), this.jrubyFork, this.gemsConfig): (JRUBY_CORE.equals(artifact.getArtifactId()) ? new GemScriptFactory(this.logger, this.classRealm, artifact.getFile(), resolveJRubyStdlibArtifact(artifact).getFile(), getProjectClasspath(), this.jrubyFork, this.gemsConfig) : new GemScriptFactory(this.logger, this.classRealm, artifact.getFile(), getProjectClasspath(), this.jrubyFork, this.gemsConfig)); if(supportNative){ factory.addJvmArgs("-Djruby.home=" + setupNativeSupport().getAbsolutePath()); } if(rubySourceDirectory != null && rubySourceDirectory.exists()){ if(jrubyVerbose){ getLog().info("add to ruby loadpath: " + rubySourceDirectory.getAbsolutePath()); } // add it to the load path for all scripts using that factory factory.addSwitch("-I", rubySourceDirectory.getAbsolutePath()); } if( libDirectory != null && libDirectory.exists() ){ if(jrubyVerbose){ getLog().info("add to ruby loadpath: " + libDirectory.getAbsolutePath()); } // add it to the load path for all scripts using that factory factory.addSwitch("-I", libDirectory.getAbsolutePath()); } return factory; } catch (final DependencyResolutionRequiredException e) { throw new MojoExecutionException("could not resolve jruby", e); } catch (final ScriptException e) { throw new MojoExecutionException("could not initialize script factory", e); } catch (final IOException e) { throw new MojoExecutionException("could not initialize script factory", e); } } private File setupNativeSupport() throws MojoExecutionException { File target = new File(this.project.getBuild().getDirectory()); File jrubyDir = new File(target, "jruby-" + getJrubyVersion()); if (!jrubyDir.exists()){ Artifact dist = manager.createArtifact("org.jruby", "jruby-dist", getJrubyVersion().toString(), "bin", "zip"); try { manager.resolve(dist, localRepository, project.getRemoteArtifactRepositories()); } catch (final GemException e) { throw new MojoExecutionException("could not setup jruby distribution for native support", e); } if (jrubyVerbose) { getLog().info("unzip " + dist.getFile()); } target.mkdirs(); unzip.setSourceFile(dist.getFile()); unzip.setDestDirectory(target); File f = null; try { unzip.extract(); f = new File(target, "jruby-" + getJrubyVersion() + "/bin/jruby"); // use reflection so it compiles with java1.5 as well but does not set executable Method m = f.getClass().getMethod("setExecutable", boolean.class); m.invoke(f, new Boolean(true)); } catch (ArchiverException e) { throw new MojoExecutionException("could unzip jruby distribution for native support", e); } catch (Exception e) { getLog().warn("can not set executable flag: " + f.getAbsolutePath() + " (" + e.getMessage() + ")"); } } return jrubyDir; } protected File gemHome( String base, String key ) { if (gemHomes != null && gemHomes.containsKey(key)) { return new File(gemHomes.get(key)); } else { return new File(base + "-" + key); } } @Override protected void executeJRuby() throws MojoExecutionException, MojoFailureException, IOException, ScriptException { this.gemsInstaller = new GemsInstaller(this.gemsConfig, this.factory, this.manager); // remember gem_home File home = this.gemsConfig.getGemHome(); // use a common bindir, i.e. the one from the configured gemHome // remove default by setting it explicitly this.gemsConfig.setBinDirectory(this.gemsConfig.getBinDirectory()); // use gemHome as base for other gems installation directories String base = this.gemsConfig.getGemHome() != null ? this.gemsConfig.getGemHome().getAbsolutePath() : (project.getBuild().getDirectory() + "/rubygems"); try { // install the gem dependencies from the pom if ( jrubyVerbose ) { getLog().info("installing gems for compile scope . . ."); } this.gemsInstaller.installPom(this.project, this.localRepository, "compile"); if ( jrubyVerbose ) { getLog().info("installing gems for runtime scope . . ."); } this.gemsInstaller.installPom(this.project, this.localRepository, "runtime"); String[] SCOPES = new String[] { "provided", "test" }; for( String scope: SCOPES ){ File gemHome = gemHome( base, scope ); this.gemsConfig.setGemHome( gemHome ); this.gemsConfig.addGemPath( gemHome ); if ( jrubyVerbose ) { getLog().info("installing gems for " + scope + " scope . . ."); } // install the gem dependencies from the pom this.gemsInstaller.installPom(this.project, this.localRepository, scope); } File pluginGemHome = gemHome( base, plugin.getArtifactId() ); // use plugin home for plugin gems this.gemsConfig.setGemHome(pluginGemHome); this.gemsConfig.addGemPath(pluginGemHome); if ( jrubyVerbose ) { getLog().info("installing gems for plugin " + plugin.getGroupId() + ":" + plugin.getArtifactId() + " . . ."); } this.gemsInstaller.installGems(this.project, this.plugin.getArtifacts(), this.localRepository, getRemoteRepos()); } catch (final GemException e) { throw new MojoExecutionException("error in installing gems", e); } finally { // reset old gem home again this.gemsConfig.setGemHome(home); } if (this.includeRubygemsInTestResources) { for (File path : this.gemsConfig.getGemPath()) { if ( path.exists() ) { if (jrubyVerbose) { getLog().info("add gems to test-classpath from: " + path.getAbsolutePath()); } // add it to the classpath so java classes can find the ruby // files Resource resource = new Resource(); resource.setDirectory(path.getAbsolutePath()); resource.addInclude("gems/**"); resource.addInclude("specifications/**"); addResource(project.getBuild().getTestResources(), resource); } } } if (this.includeProvidedRubygemsInResources) { for (File path : this.gemsConfig.getGemPath()) { if ( path.exists() && path.getName().contains("provided")) { if (jrubyVerbose) { getLog().info("add gems to classpath from: " + path.getAbsolutePath()); } // add it to the classpath so java classes can find the ruby // files Resource resource = new Resource(); resource.setDirectory(path.getAbsolutePath()); resource.addInclude("gems/**"); resource.addInclude("specifications/**"); addResource(project.getBuild().getResources(), resource); } } } if (this.includeRubygemsInResources) { if (jrubyVerbose) { getLog().info("add gems to classpath from: " + home.getAbsolutePath()); } // add it to the classpath so java classes can find the ruby files Resource resource = new Resource(); resource.setDirectory(home.getAbsolutePath()); resource.addInclude("gems/**"); resource.addInclude("specifications/**"); // no java sources since resins application server tries to compile those resource.addExclude("gems/**/*.java"); addResource(project.getBuild().getResources(), resource); } if (this.includeLibDirectoryInResources) { if (jrubyVerbose) { getLog().info("add to classpath: " + libDirectory.getAbsolutePath()); } // add it to the classpath so java classes can find the ruby files Resource resource = new Resource(); resource.setDirectory(libDirectory.getAbsolutePath()); addResource(project.getBuild().getResources(), resource); } if (this.includeGemsInResources != null ) { String dir = "compile".equals( includeGemsInResources ) ? base : base + "-" + includeGemsInResources; File gems = new File(dir, "gems"); if ( gems.exists() ) { for( File g : gems.listFiles() ) { File lib = new File(g, "lib"); if (jrubyVerbose) { getLog().info("add to resource: " + lib.getAbsolutePath()); } Resource resource = new Resource(); resource.setDirectory(lib.getAbsolutePath()); project.getBuild().getResources().add(resource); } } } try { executeWithGems(); } catch (final GemException e) { throw new MojoExecutionException("error in executing with gems", e); } } protected void addResource(List resources, Resource resource) { String ref = resource.toString(); for( Resource r : resources ) { if (r.toString().equals(ref)) { return; } } if (jrubyVerbose) { logger.info("add resource: " + resource); } resources.add(resource); } abstract protected void executeWithGems() throws MojoExecutionException, ScriptException, GemException, IOException, MojoFailureException; protected List getRemoteRepos() { List remotes = new LinkedList(); remotes.addAll(project.getPluginArtifactRepositories() ); remotes.addAll(project.getRemoteArtifactRepositories() ); return remotes; } } ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/main/java/de/saumya/mojo/gem/GemspecWriter.java./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/main/java/de/saumya/mojo/gem/GemspecWriter0000644000000000000000000003472312674201751030034 0ustar /** * */ package de.saumya.mojo.gem; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.FileWriter; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.Writer; import java.net.MalformedURLException; import java.net.URL; import java.net.URLConnection; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.maven.model.Contributor; import org.apache.maven.model.Developer; import org.apache.maven.model.License; import org.apache.maven.project.MavenProject; import org.codehaus.plexus.util.FileUtils; class GemspecWriter { final MavenProject project; final Writer writer; final String excludes = ".*~$|^[.][a-zA-Z].*"; final List dirs = new ArrayList(); final List files = new ArrayList(); final List licenses = new ArrayList(); final Map jarFiles = new HashMap(); long latestModified = 0; final File gemspec; private boolean firstAuthor = true; private boolean firstFile = true; private boolean platformAppended = false; private boolean firstTestFile; // private List executables = new ArrayList(); GemspecWriter(final File gemspec, final MavenProject project, final GemArtifact artifact) throws IOException { this.latestModified = project.getFile() == null ? 0 : project.getFile() .lastModified(); this.gemspec = gemspec; this.gemspec.getParentFile().mkdirs(); this.writer = new FileWriter(gemspec); this.project = project; append("# create by maven - leave it as is"); append("Gem::Specification.new do |s|"); append("name", artifact.getGemName()); appendRaw("version", "'" + GemArtifact.getGemVersion(project.getVersion()) + "'"); append(); append("summary", project.getName()); append("description", project.getDescription()); append("homepage", project.getUrl()); append(); for (final Developer developer : project.getDevelopers()) { appendAuthor(developer.getName(), developer.getEmail()); } for (final Contributor contributor : project.getContributors()) { appendAuthor(contributor.getName(), contributor.getEmail()); } if (project.getDevelopers().isEmpty() && project.getContributors().isEmpty()){ appendList("authors", "dummy"); } append(); for (final License license : project.getLicenses()) { appendLicense(license.getUrl(), license.getName()); } } boolean isUptodate() { return this.gemspec.lastModified() > this.latestModified; } private String gemVersion(String version) { version = version.replaceAll("-SNAPSHOT", "").replace("-", "."); if (version.matches("^[\\[\\(].*[\\]\\)]$")) { final int comma = version.indexOf(","); final String first = version.substring(1, comma); final String second = version.substring(comma + 1, version.length() - 1); if (version.matches("\\[.*99999.99999\\)$")) { // out of '[1.2.0, 1.99999.99999]' make '1.2' final String prefix = second.replaceFirst("99999.99999$", ""); return "'~> " + prefix + first.substring(prefix.length()) .replaceFirst("[.].*", "") + "'"; } else if (version.matches("\\[.*,\\)$")) { final StringBuilder buf = new StringBuilder("'>"); buf.append(version.charAt(0) == '[' ? "=" : ""); buf.append(first).append("'"); return buf.toString(); } else { final StringBuilder buf = new StringBuilder("['>"); buf.append(version.charAt(0) == '[' ? "=" : ""); buf.append(first).append("','<"); buf.append(version.charAt(version.length() - 1) == '[' ? "=" : ""); buf.append(second); buf.append("']"); return buf.toString(); } } else { return "'" + version + "'"; } } private void append() throws IOException { this.writer.append("\n"); } private void append(final String line) throws IOException { this.writer.append(line).append("\n"); } private void appendAuthor(final String name, final String email) throws IOException { if (name != null && email != null) { if (this.firstAuthor) { this.writer.append(" s.authors = ['") .append(name) .append("']\n"); this.writer.append(" s.email = ['") .append(email) .append("']\n"); this.firstAuthor = false; } else { this.writer.append(" s.authors << '") .append(name) .append("'\n"); this.writer.append(" s.email << '") .append(email) .append("'\n"); } } } void append(final String key, final String value) throws IOException { if (value != null) { this.writer.append(" s.") .append(key) .append(" = '") .append(value.replaceAll("'", "\"")) .append("'\n"); } } private void appendRaw(final String key, final String value) throws IOException { if (value != null) { this.writer.append(" s.") .append(key) .append(" = ") .append(value) .append("\n"); } } void appendDependency(final String name, final String version) throws IOException { this.writer.append(" s.add_dependency '") .append(name) .append("', ") .append(gemVersion(version)) .append("\n"); } void appendDevelopmentDependency(final String name, final String version) throws IOException { this.writer.append(" s.add_development_dependency '") .append(name) .append("', ") .append(gemVersion(version)) .append("\n"); } void appendPath(final String path) throws IOException { if (this.firstFile) { this.writer.append(" s.files = Dir['") .append(path) .append("/**/*']\n"); this.firstFile = false; } else { this.writer.append(" s.files += Dir['") .append(path) .append("/**/*']\n"); } final File file = new File(this.project.getBasedir(), path); if (file.lastModified() > this.latestModified) { this.latestModified = file.lastModified(); } this.dirs.add(new File(path)); } void appendTestPath(final String path) throws IOException { if (this.firstTestFile) { this.writer.append(" s.test_files = Dir['") .append(path) .append("/**/*_" + path + ".rb']\n"); this.firstTestFile = false; } else { this.writer.append(" s.test_files += Dir['") .append(path) .append("/**/*_" + path + ".rb']\n"); } final File file = new File(this.project.getBasedir(), path); if (file.lastModified() > this.latestModified) { this.latestModified = file.lastModified(); } this.dirs.add(new File(path)); } void appendPlatform(final String platform) throws IOException { if (!this.platformAppended && platform != null) { append("platform", platform); this.platformAppended = true; } } void appendJarfile(final File jar, final String jarfileName) throws IOException { final File f = new File("lib", jarfileName); this.jarFiles.put(f.toString(), jar); appendFile(f); } void appendFile(final File file) throws IOException { if (this.firstFile) { this.writer.append(" s.files = Dir['") .append(file.toString()) .append("']\n"); this.firstFile = false; } else { this.writer.append(" s.files += Dir['") .append(file.toString()) .append("']\n"); } if (file.lastModified() > this.latestModified) { this.latestModified = file.lastModified(); } } void appendFile(final String file) throws IOException { final File f = new File(file); appendFile(f); this.files.add(f); } void appendExecutable(final String executable) throws IOException { this.writer.append(" s.executables << '" + executable + "'\n"); } private void appendLicense(final String url, final String name) throws IOException { URL u; try { u = new URL(url); } catch (final MalformedURLException e) { u = new URL("file:." + url); } this.licenses.add(u); final URLConnection con = u.openConnection(); if (this.latestModified < con.getLastModified()) { this.latestModified = con.getLastModified(); } // omit the first slash final File license = new File(u.getFile() .substring(1) .replaceFirst("^./", "")); appendFile(license); if ("file".equals(u.getProtocol())) { // make a nice File without unix style prefix "./" this.files.add(new File(license.getPath().replaceFirst("^./", ""))); } if (name != null) { append(" s.licenses << '" + name.replaceFirst("^./", "") + "'"); } } void copy(final File target) throws IOException { target.mkdirs(); copyJarFiles(target); copyFiles(target); copyLicenses(target); } private void copyLicenses(final File target) throws IOException { OutputStream writer = null; InputStream reader = null; for (final URL url : this.licenses) { try { try { reader = new BufferedInputStream(url.openStream()); } catch (final IOException e) { // TODO log it but otherwise ignore break; } final File licenseFile = new File(target, url.getFile()); licenseFile.getParentFile().mkdirs(); writer = new BufferedOutputStream(new FileOutputStream(licenseFile)); int b = reader.read(); while (b != -1) { writer.write(b); b = reader.read(); } } finally { if (reader != null) { try { reader.close(); } catch (final IOException ignore) { } } if (writer != null) { try { writer.close(); } catch (final IOException ignore) { } } } } } private void copyJarFiles(final File target) throws IOException { new File(target, "lib").mkdirs(); for (final Map.Entry entry : this.jarFiles.entrySet()) { FileUtils.copyFile(entry.getValue(), new File(target, entry.getKey())); } } private void copyFiles(final File target) throws IOException { for (final File file : this.files) { if (file.exists()) { FileUtils.copyFile(file, new File(target, file.getPath())); } } for (final File dir : this.dirs) { copyDir(target, dir); } } private void copyDir(final File target, final File dir) throws IOException { final File realDir = new File(this.project.getBasedir(), dir.getPath()); if (realDir.isDirectory()) { for (final String file : realDir.list()) { copyDir(target, new File(dir, file)); } } else { if (realDir.exists() && !realDir.getName().matches(this.excludes)) { final File targetFile = new File(target, dir.getPath()); FileUtils.copyFile(realDir, targetFile); } } } void close() throws IOException { try { this.writer.append("end"); } finally { this.writer.close(); } } void appendList(final String name, final String list) throws IOException { if (list != null) { final StringBuilder buf = new StringBuilder("["); boolean first = true; for (final String part : list.split(",")) { if (first) { first = false; } else { buf.append(","); } final char quoteChar = part.contains("'") ? '"' : '\''; buf.append(quoteChar).append(part.trim()).append(quoteChar); } buf.append("]"); appendRaw(name, buf.toString()); } } void appendRdocFiles(final String extraRdocFiles) throws IOException { if (extraRdocFiles != null) { for (final String f : extraRdocFiles.split(",")) { appendFile(f.trim()); } appendList("extra_rdoc_files", extraRdocFiles); } } void appendFiles(final String files) throws IOException { if (files != null) { for (final String f : files.split(",")) { appendFile(f.trim()); } } } } ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/main/java/de/saumya/mojo/gem/PushMojo.java0000644000000000000000000000726112674201751027735 0ustar package de.saumya.mojo.gem; import java.io.File; import java.io.IOException; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.plugins.annotations.LifecyclePhase; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import de.saumya.mojo.ruby.gems.GemException; import de.saumya.mojo.ruby.script.Script; import de.saumya.mojo.ruby.script.ScriptException; /** * goal to push a given gem or a gem artifact to rubygems.org via the * command "gem push {gem}" */ @Mojo( name = "push", defaultPhase = LifecyclePhase.DEPLOY ) public class PushMojo extends AbstractGemMojo { /** * skip the pushng the gem */ @Parameter( property = "push.skip", defaultValue = "false" ) protected boolean skip; /** * arguments for the ruby script given through file parameter. */ @Parameter( property = "push.args" ) protected String pushArgs; /** * arguments for the ruby script given through file parameter. */ @Parameter( property = "gem" ) protected File gem; @Parameter( defaultValue = "${repositorySystemSession}", readonly = true ) protected Object repoSession; @Override public void execute() throws MojoExecutionException, MojoFailureException{ if (skip){ getLog().info( "skipping to push gem" ); } else { super.execute(); } } @Override public void executeWithGems() throws MojoExecutionException, ScriptException, IOException, MojoFailureException, GemException { if ( getJrubyVersion().needsOpenSSL() ) { gemsInstaller.installOpenSSLGem(this.repoSession, localRepository, getRemoteRepos() ); } final Script script = this.factory.newScriptFromJRubyJar("gem") .addArg("push"); if(this.project.getArtifact().getFile() == null){ File f = new File(this.project.getBuild().getDirectory(), this.project.getBuild().getFinalName() +".gem"); if (f.exists()) { this.project.getArtifact().setFile(f); } } // no given gem and pom artifact in place if (this.gem == null && this.project.getArtifact() != null && this.project.getArtifact().getFile() != null && this.project.getArtifact().getFile().exists()) { final GemArtifact gemArtifact = new GemArtifact(this.project); // skip artifact unless it is a gem. // this allows to use this mojo for installing arbitrary gems if (!gemArtifact.isGem()) { throw new MojoExecutionException("not a gem artifact"); } script.addArg(gemArtifact.getFile()); } else { // no pom artifact and no given gem so search for a gem if (this.gem == null && null == args ) { for (final File f : this.launchDirectory().listFiles()) { if (f.getName().endsWith(".gem")) { if (this.gem == null) { this.gem = f; } else { throw new MojoFailureException("more than one gem file found, use -Dgem=... to specifiy one"); } } } } if (this.gem != null) { getLog().info("use gem: " + this.gem); script.addArg(this.gem); } } script.addArgs(this.pushArgs); script.addArgs(this.args); script.execute(); } } ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/main/resources/0000755000000000000000000000000012674201751023006 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/main/resources/metadata.rb0000644000000000000000000000142712674201751025117 0ustar require 'rubygems' name = ARGV[0] puts <<-POM rubygems #{name} POM dep = Gem::Dependency.new(name, Gem::Requirement.default) fetcher = Gem::SpecFetcher.fetcher # TODO make a flag to distinguish prereleases and/or releases - # and match it with the repository flag about SNAPSHOT and RELEASE tuples = fetcher.find_matching(dep, true, false, false) tuples = tuples + fetcher.find_matching(dep, false, false, true) warn name warn tuples.inspect tuples.each do |tuple| puts <<-POM #{tuple[0][1]} POM end puts <<-POM #{Time.now.strftime("%Y%m%d%H%M%S")} POM ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/main/resources/META-INF/0000755000000000000000000000000012674201751024146 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/main/resources/META-INF/plexus/0000755000000000000000000000000012674201751025466 5ustar ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/main/resources/META-INF/plexus/components.xml./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/main/resources/META-INF/plexus/components.0000644000000000000000000000674212674201751027665 0ustar org.apache.maven.lifecycle.mapping.LifecycleMapping gem org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping de.saumya.mojo:gem-maven-plugin:initialize org.apache.maven.plugins:maven-resources-plugin:resources org.apache.maven.plugins:maven-compiler-plugin:compile de.saumya.mojo:gem-maven-plugin:package org.apache.maven.plugins:maven-install-plugin:install de.saumya.mojo:gem-maven-plugin:push org.apache.maven.artifact.handler.ArtifactHandler gem org.apache.maven.artifact.handler.DefaultArtifactHandler gem gem gem ruby false false org.apache.maven.lifecycle.mapping.LifecycleMapping java-gem org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping de.saumya.mojo:gem-maven-plugin:initialize org.apache.maven.plugins:maven-resources-plugin:resources org.apache.maven.plugins:maven-compiler-plugin:compile org.apache.maven.plugins:maven-jar-plugin:jar, de.saumya.mojo:gem-maven-plugin:package org.apache.maven.plugins:maven-install-plugin:install de.saumya.mojo:gem-maven-plugin:push org.apache.maven.artifact.handler.ArtifactHandler java-gem org.apache.maven.artifact.handler.DefaultArtifactHandler gem gem gem ruby false false org.apache.maven.artifact.handler.ArtifactHandler jar-gem org.apache.maven.artifact.handler.DefaultArtifactHandler jar jar-gem jar java true false ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/main/resources/spec2pom.rb0000644000000000000000000000556212674201751025073 0ustar require 'rubygems' require 'rubygems/format' spec = Gem::Format.from_file_by_path(ARGV[0]).spec puts <<-POM 4.0.0 rubygems #{spec.name} #{spec.version} gem #{spec.homepage} POM fetcher = Gem::SpecFetcher.fetcher spec.dependencies.each do |dep| scope = case dep.type when :runtime "compile" when :development "test" else warn "unknown scope: #{dep.type}" "compile" end left_version = nil right_version = nil version = nil (0..(dep.version_requirements.requirements.size - 1)).each do |index| req = dep.version_requirements.requirements[index] gem_version = req[1].to_s gem_final_version = gem_version gem_final_version = gem_final_version + ".0" if gem_final_version =~ /^[0-9]+\.[0-9]+$/ gem_final_version = gem_final_version + ".0.0" if gem_final_version =~ /^[0-9]+$/ case req[0] when "=" version = gem_final_version when ">=" left_version = "[#{gem_final_version}" when ">" left_version = "(#{gem_final_version}" when "<=" right_version = "#{gem_final_version}]" when "<" right_version = "#{gem_final_version})" when "~>" pre_version = gem_version.sub(/[.][0-9]+$/, '') # hope the upper bound is "big" enough but needed, i.e. # version 4.0.0 is bigger than 4.0.0.pre and [3.0.0, 4.0.0) will allow # 4.0.0.pre which is NOT intended version = "[#{gem_version},#{pre_version.sub(/[0-9]+$/, '')}#{pre_version.sub(/.*[.]/, '').to_i}.99999.99999)" else puts "not implemented comparator: #{req.inspect}" end end warn "having left_version or right_version and version which does not makes sense" if (right_version || left_version) && version version = (left_version || "[") + "," + (right_version || ")") if right_version || left_version version = "[0.0.0,)" if version.nil? spec_tuples = fetcher.find_matching dep, true, false, nil is_java = spec_tuples.last[0][2] == 'java' unless spec_tuples.empty? require 'net/http' puts <<-POM rubygems #{dep.name} #{version} gem POM if is_java puts <<-POM java POM end puts <<-POM #{scope} POM # end end puts <<-POM POM ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/0000755000000000000000000000000012674201751020464 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/script-inside-pom/0000755000000000000000000000000012674201751024032 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/script-inside-pom/verify.bsh0000644000000000000000000000043312674201751026034 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "hello world"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); }./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/script-inside-pom/pom.xml0000644000000000000000000000130512674201751025346 0ustar 4.0.0 de.saumya.mojo dummy testing de.saumya.mojo gem-maven-plugin @project.version@ ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/script-inside-pom/invoker.properties0000644000000000000000000000006612674201751027627 0ustar invoker.goals = gem:exec invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gemfile-to-pom/0000755000000000000000000000000012674201751023305 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gemfile-to-pom/verify.bsh0000644000000000000000000000027612674201751025314 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; File f = new File( basedir, "pom.xml" ); if ( !f.exists() ) { throw new RuntimeException( "file does not exists: " + f ); }./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gemfile-to-pom/sample.gemspec0000644000000000000000000000077212674201751026141 0ustar Gem::Specification.new do |s| s.name = 'sample' s.version = '0.1.0' s.summary = 'summary of sample' s.description = 'description of sample' s.homepage = 'http://example.com/' s.authors = ['mkristian'] s.email = ['m.kristian@web.de'] s.files = Dir['MIT-LICENSE'] s.licenses << 'MIT-LICENSE' s.files += Dir['lib/**/*'] s.add_development_dependency 'rake', '0.8.7' s.post_install_message = <<-TEXT - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - TEXT end ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gemfile-to-pom/Gemfile0000644000000000000000000000003012674201751024571 0ustar gemspec 'sample.gemspec'./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gemfile-to-pom/setup.bsh0000644000000000000000000000007312674201751025143 0ustar import java.io.*; new File( basedir, "pom.xml").delete(); ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gemfile-to-pom/pom.xml0000644000000000000000000000115512674201751024624 0ustar 4.0.0 de.saumya.mojo jruby-version testing de.saumya.mojo gem-maven-plugin @project.version@ ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gemfile-to-pom/invoker.properties0000644000000000000000000000014412674201751027077 0ustar invoker.goals = de.saumya.mojo:gem-maven-plugin:${project.version}:pom invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/package-gem-artifact-from-gemspec-pom/0000755000000000000000000000000012674201751027573 5ustar ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/package-gem-artifact-from-gemspec-pom/verify.bsh./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/package-gem-artifact-from-gemspec-pom/v0000644000000000000000000000032112674201751027757 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; File f = new File( basedir, "target/gem_first-0.0.0.gem" ); if ( !f.exists() ) { throw new RuntimeException( "file does not exists: " + f ); }././@LongLink0000644000000000000000000000016500000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/package-gem-artifact-from-gemspec-pom/gem_first.gemspec./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/package-gem-artifact-from-gemspec-pom/g0000644000000000000000000000025312674201751027744 0ustar Gem::Specification.new do |s| s.name = "gem_first" s.version = "0.0.0" s.files = ["lib/gem_first.rb"] s.summary = "gem first test gem" s.authors = ['dummy'] end ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/package-gem-artifact-from-gemspec-pom/pom.xml./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/package-gem-artifact-from-gemspec-pom/p0000644000000000000000000000124512674201751027757 0ustar 4.0.0 rubygems gem_first 0.0.0 de.saumya.mojo gem-maven-plugin @project.version@ gem_first.gemspec ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/package-gem-artifact-from-gemspec-pom/invoker.properties./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/package-gem-artifact-from-gemspec-pom/i0000644000000000000000000000010112674201751027736 0ustar invoker.goals = package gem:package invoker.mavenOpts = -client ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/package-gem-artifact-from-gemspec-pom/lib/./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/package-gem-artifact-from-gemspec-pom/l0000755000000000000000000000000012674201751027747 5ustar ././@LongLink0000644000000000000000000000016400000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/package-gem-artifact-from-gemspec-pom/lib/gem_first.rb./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/package-gem-artifact-from-gemspec-pom/l0000644000000000000000000000006712674201751027754 0ustar class GemFirst def hello "hello world" end end ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/script-inside-pom-to-outputfile/0000755000000000000000000000000012674201751026650 5ustar ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/script-inside-pom-to-outputfile/verify.bsh./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/script-inside-pom-to-outputfile/verify.0000644000000000000000000000043012674201751030152 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "log" ) ); String expected = "hello kristian"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); }./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/script-inside-pom-to-outputfile/src/0000755000000000000000000000000012674201751027437 5ustar ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/script-inside-pom-to-outputfile/src/main/./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/script-inside-pom-to-outputfile/src/mai0000755000000000000000000000000012674201751030126 5ustar ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/script-inside-pom-to-outputfile/src/main/ruby/./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/script-inside-pom-to-outputfile/src/mai0000755000000000000000000000000012674201751030126 5ustar ././@LongLink0000644000000000000000000000016400000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/script-inside-pom-to-outputfile/src/main/ruby/hello.rb./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/script-inside-pom-to-outputfile/src/mai0000644000000000000000000000003012674201751030121 0ustar puts "hello #{ARGV[0]}" ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/script-inside-pom-to-outputfile/pom.xml0000644000000000000000000000142612674201751030170 0ustar 4.0.0 de.saumya.mojo dummy testing de.saumya.mojo gem-maven-plugin @project.version@ ${basedir}/src/main/ruby/hello.rb kristian log ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/script-inside-pom-to-outputfile/invoker.properties./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/script-inside-pom-to-outputfile/invoker0000644000000000000000000000006612674201751030252 0ustar invoker.goals = gem:exec invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/exec-file/0000755000000000000000000000000012674201751022325 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/exec-file/verify.bsh0000644000000000000000000000043312674201751024327 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "hello world"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); }./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/exec-file/file.rb0000644000000000000000000000007012674201751023566 0ustar require 'rubygems' require 'zip/zip' puts "hello world" ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/exec-file/pom.xml0000644000000000000000000000234012674201751023641 0ustar 4.0.0 de.saumya.mojo dummy testing rubygems-release http://rubygems-proxy.torquebox.org/releases rubygems rubyzip2 2.0.2 gem ${basedir}/../../../../ ${root.dir}/target/rubygems ${root.dir}/target/rubygems de.saumya.mojo gem-maven-plugin @project.version@ file.rb ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/exec-file/invoker.properties0000644000000000000000000000006612674201751026122 0ustar invoker.goals = gem:exec invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/irb-help-no-pom/0000755000000000000000000000000012674201751023371 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/irb-help-no-pom/verify.bsh0000644000000000000000000000070712674201751025377 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "irb.rb [options] [programfile] [arguments]"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } expected = "No POM"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); }./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/irb-help-no-pom/setup.bsh0000644000000000000000000000007312674201751025227 0ustar import java.io.*; new File( basedir, "pom.xml").delete(); ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/irb-help-no-pom/test.properties0000644000000000000000000000002012674201751026456 0ustar irb.args=--help ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/irb-help-no-pom/pom.xml0000644000000000000000000000115512674201751024710 0ustar 4.0.0 de.saumya.mojo jruby-version testing de.saumya.mojo gem-maven-plugin @project.version@ ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/irb-help-no-pom/invoker.properties0000644000000000000000000000014412674201751027163 0ustar invoker.goals = de.saumya.mojo:gem-maven-plugin:${project.version}:irb invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gemify-pom/0000755000000000000000000000000012674201751022535 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gemify-pom/verify.bsh0000644000000000000000000000075412674201751024545 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "Successfully installed com.example.gemify-1.0"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } expected = "Successfully installed junit.junit-3.8.1"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); }./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gemify-pom/src/0000755000000000000000000000000012674201751023324 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gemify-pom/src/test/0000755000000000000000000000000012674201751024303 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gemify-pom/src/test/java/0000755000000000000000000000000012674201751025224 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gemify-pom/src/test/java/com/0000755000000000000000000000000012674201751026002 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gemify-pom/src/test/java/com/example/0000755000000000000000000000000012674201751027435 5ustar ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gemify-pom/src/test/java/com/example/AppTest.java./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gemify-pom/src/test/java/com/example/Ap0000644000000000000000000000117612674201751027725 0ustar package com.example; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Unit test for simple App. */ public class AppTest extends TestCase { /** * Create the test case * * @param testName name of the test case */ public AppTest( String testName ) { super( testName ); } /** * @return the suite of tests being tested */ public static Test suite() { return new TestSuite( AppTest.class ); } /** * Rigourous Test :-) */ public void testApp() { assertTrue( true ); } } ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gemify-pom/src/main/0000755000000000000000000000000012674201751024250 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gemify-pom/src/main/java/0000755000000000000000000000000012674201751025171 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gemify-pom/src/main/java/com/0000755000000000000000000000000012674201751025747 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gemify-pom/src/main/java/com/example/0000755000000000000000000000000012674201751027402 5ustar ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gemify-pom/src/main/java/com/example/App.java./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gemify-pom/src/main/java/com/example/Ap0000644000000000000000000000025512674201751027667 0ustar package com.example; /** * Hello world! * */ public class App { public static void main( String[] args ) { System.out.println( "Hello World!" ); } } ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gemify-pom/pom.xml0000644000000000000000000000154112674201751024053 0ustar 4.0.0 com.example gemify jar 1.0 gemify http://maven.apache.org junit junit 3.8.1 test de.saumya.mojo gem-maven-plugin @project.version@ ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gemify-pom/invoker.properties0000644000000000000000000000010012674201751026317 0ustar invoker.goals = install gem:gemify invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gemspec-to-pom/0000755000000000000000000000000012674201751023320 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gemspec-to-pom/verify.bsh0000644000000000000000000000027612674201751025327 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; File f = new File( basedir, "pom.xml" ); if ( !f.exists() ) { throw new RuntimeException( "file does not exists: " + f ); }./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gemspec-to-pom/sample.gemspec0000644000000000000000000000077612674201751026160 0ustar Gem::Specification.new do |s| s.name = 'sample' s.version = '0.1.0.dev' s.summary = 'summary of sample' s.description = 'description of sample' s.homepage = 'http://example.com/' s.authors = ['mkristian'] s.email = ['m.kristian@web.de'] s.files = Dir['MIT-LICENSE'] s.licenses << 'MIT-LICENSE' s.files += Dir['lib/**/*'] s.add_development_dependency 'rake', '0.8.7' s.post_install_message = <<-TEXT - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - TEXT end ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gemspec-to-pom/setup.bsh0000644000000000000000000000007312674201751025156 0ustar import java.io.*; new File( basedir, "pom.xml").delete(); ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gemspec-to-pom/pom.xml0000644000000000000000000000115512674201751024637 0ustar 4.0.0 de.saumya.mojo jruby-version testing de.saumya.mojo gem-maven-plugin @project.version@ ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gemspec-to-pom/invoker.properties0000644000000000000000000000014412674201751027112 0ustar invoker.goals = de.saumya.mojo:gem-maven-plugin:${project.version}:pom invoker.mavenOpts = -client ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gems-with-compile-test-and-provided-scope/./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gems-with-compile-test-and-provided-sco0000755000000000000000000000000012674201751030050 5ustar ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gems-with-compile-test-and-provided-scope/verify.bsh./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gems-with-compile-test-and-provided-sco0000644000000000000000000000043412674201751030053 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "gems count "; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gems-with-compile-test-and-provided-scope/src/./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gems-with-compile-test-and-provided-sco0000755000000000000000000000000012674201751030050 5ustar ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gems-with-compile-test-and-provided-scope/src/main/./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gems-with-compile-test-and-provided-sco0000755000000000000000000000000012674201751030050 5ustar ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gems-with-compile-test-and-provided-scope/src/main/ruby/./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gems-with-compile-test-and-provided-sco0000755000000000000000000000000012674201751030050 5ustar ././@LongLink0000644000000000000000000000017500000000000011606 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gems-with-compile-test-and-provided-scope/src/main/ruby/only.rb./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gems-with-compile-test-and-provided-sco0000644000000000000000000000003012674201751030043 0ustar p require 'thread_safe' ././@LongLink0000644000000000000000000000017000000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gems-with-compile-test-and-provided-scope/src/main/webapp/./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gems-with-compile-test-and-provided-sco0000755000000000000000000000000012674201751030050 5ustar ././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gems-with-compile-test-and-provided-scope/src/main/webapp/resources/./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gems-with-compile-test-and-provided-sco0000755000000000000000000000000012674201751030050 5ustar ././@LongLink0000644000000000000000000000021300000000000011577 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gems-with-compile-test-and-provided-scope/src/main/webapp/resources/config.rb./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gems-with-compile-test-and-provided-sco0000644000000000000000000000153512674201751030056 0ustar # Require any additional compass plugins here. # Set this to the root of your project when deployed: http_path = "/" css_dir = "stylesheets" sass_dir = "sass" images_dir = "images" javascripts_dir = "javascripts" # You can select your preferred output style here (can be overridden via the command line): # output_style = :expanded or :nested or :compact or :compressed # To enable relative paths to assets via compass helper functions. Uncomment: # relative_assets = true # To disable debugging comments that display the original location of your selectors. Uncomment: # line_comments = false # If you prefer the indented syntax, you might want to regenerate this # project again passing --syntax sass, or you can uncomment this: # preferred_syntax = :sass # and then run: # sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass ././@LongLink0000644000000000000000000000020700000000000011602 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gems-with-compile-test-and-provided-scope/src/main/webapp/resources/sass/./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gems-with-compile-test-and-provided-sco0000755000000000000000000000000012674201751030050 5ustar ././@LongLink0000644000000000000000000000022100000000000011576 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gems-with-compile-test-and-provided-scope/src/main/webapp/resources/sass/print.scss./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gems-with-compile-test-and-provided-sco0000644000000000000000000000032512674201751030052 0ustar /* Welcome to Compass. Use this file to define print styles. * Import this file using the following HTML or equivalent: * */ ././@LongLink0000644000000000000000000000022200000000000011577 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gems-with-compile-test-and-provided-scope/src/main/webapp/resources/sass/screen.scss./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gems-with-compile-test-and-provided-sco0000644000000000000000000000044712674201751030057 0ustar /* Welcome to Compass. * In this file you should write your main styles. (or centralize your imports) * Import this file using the following HTML or equivalent: * */ @import "compass/reset"; ././@LongLink0000644000000000000000000000021600000000000011602 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gems-with-compile-test-and-provided-scope/src/main/webapp/resources/sass/ie.scss./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gems-with-compile-test-and-provided-sco0000644000000000000000000000041712674201751030054 0ustar /* Welcome to Compass. Use this file to write IE specific override styles. * Import this file using the following HTML or equivalent: * */ ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gems-with-compile-test-and-provided-scope/pom.xml./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gems-with-compile-test-and-provided-sco0000644000000000000000000001030112674201751030045 0ustar 4.0.0 com.example gems-test 0.0.0 rubygems-release http://rubygems-proxy.torquebox.org/releases rubygems compass 0.12.5 gem provided rubygems minitest 5.3.2 gem test rubygems virtus 1.0.1 gem ${basedir}/../../../../ ${root.dir}/target/rubygems ${root.dir}/target/rubygems de.saumya.mojo gem-maven-plugin @project.version@ init initialize true compass exec compile ${gem.home}/bin/compass compile ${basedir}/src/main/webapp/resources maven-dependency-plugin 2.8 install copy org.jruby jruby-complete 1.7.11 ${project.build.directory} org.codehaus.mojo exec-maven-plugin 1.2 java ${basedir} ${basedir} ${basedir} ${basedir} count installed gems install exec -cp ${project.build.directory}/jruby-complete-1.7.11.jar${path.separator}${project.build.directory}/gems-test-0.0.0.jar org.jruby.Main -e require 'stringio' require 'rubygems/commands/list_command' require 'rubygems/user_interaction' s = StringIO.new l = Gem::Commands::ListCommand.new l.ui= Gem::StreamUI.new( STDIN, s, STDERR, true ) l.execute c = s.string.split( /\n/ ).count puts 'gems count ' + c.to_s org.jruby jruby-complete 1.7.11 jar ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gems-with-compile-test-and-provided-scope/spec/./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gems-with-compile-test-and-provided-sco0000755000000000000000000000000012674201751030050 5ustar ././@LongLink0000644000000000000000000000017300000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gems-with-compile-test-and-provided-scope/spec/simple_spec.rb./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gems-with-compile-test-and-provided-sco0000644000000000000000000000012712674201751030052 0ustar describe 'something' do it 'works' do require('only').must_equal true end end ././@LongLink0000644000000000000000000000017200000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gems-with-compile-test-and-provided-scope/invoker.properties./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gems-with-compile-test-and-provided-sco0000644000000000000000000000007312674201751030052 0ustar invoker.goals = clean install invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gemspec-to-pom-forced/0000755000000000000000000000000012674201751024560 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gemspec-to-pom-forced/verify.bsh0000644000000000000000000000051212674201751026560 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; File f = new File( basedir, "pom.xml" ); if ( !f.exists() ) { throw new RuntimeException( "file does not exists: " + f ); } if ( f.lastModified() < new File( basedir, "timestamp" ).lastModified()) { throw new RuntimeException( "file not recreated: " + f ); }./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gemspec-to-pom-forced/sample.gemspec0000644000000000000000000000077212674201751027414 0ustar Gem::Specification.new do |s| s.name = 'sample' s.version = '0.1.0' s.summary = 'summary of sample' s.description = 'description of sample' s.homepage = 'http://example.com/' s.authors = ['mkristian'] s.email = ['m.kristian@web.de'] s.files = Dir['MIT-LICENSE'] s.licenses << 'MIT-LICENSE' s.files += Dir['lib/**/*'] s.add_development_dependency 'rake', '0.8.7' s.post_install_message = <<-TEXT - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - TEXT end ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gemspec-to-pom-forced/setup.bsh0000644000000000000000000000021212674201751026411 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; FileUtils.fileWrite(new File( basedir, "timestamp").getAbsolutePath(), ""); ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gemspec-to-pom-forced/test.properties0000644000000000000000000000001712674201751027653 0ustar pom.force=true ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gemspec-to-pom-forced/pom.xml0000644000000000000000000000115512674201751026077 0ustar 4.0.0 de.saumya.mojo jruby-version testing de.saumya.mojo gem-maven-plugin @project.version@ ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gemspec-to-pom-forced/invoker.properties./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gemspec-to-pom-forced/invoker.propertie0000644000000000000000000000014412674201751030167 0ustar invoker.goals = de.saumya.mojo:gem-maven-plugin:${project.version}:pom invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gemify-complex/0000755000000000000000000000000012674201751023411 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gemify-complex/verify.bsh0000644000000000000000000000053612674201751025417 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "Successfully installed org.apache.avalon.framework.avalon-framework-impl-4.3.1"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); }./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gemify-complex/test.properties0000644000000000000000000000012312674201751026502 0ustar artifactId=avalon-framework-impl groupId=org.apache.avalon.framework version=4.3.1 ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gemify-complex/pom.xml0000644000000000000000000000114512674201751024727 0ustar 4.0.0 de.saumya.mojo dummy testing de.saumya.mojo gem-maven-plugin @project.version@ ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gemify-complex/invoker.properties0000644000000000000000000000007012674201751027201 0ustar invoker.goals = gem:gemify invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gemfile-to-pom-forced/0000755000000000000000000000000012674201751024545 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gemfile-to-pom-forced/verify.bsh0000644000000000000000000000051212674201751026545 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; File f = new File( basedir, "pom.xml" ); if ( !f.exists() ) { throw new RuntimeException( "file does not exists: " + f ); } if ( f.lastModified() < new File( basedir, "timestamp" ).lastModified()) { throw new RuntimeException( "file not recreated: " + f ); }./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gemfile-to-pom-forced/sample.gemspec0000644000000000000000000000077212674201751027401 0ustar Gem::Specification.new do |s| s.name = 'sample' s.version = '0.1.0' s.summary = 'summary of sample' s.description = 'description of sample' s.homepage = 'http://example.com/' s.authors = ['mkristian'] s.email = ['m.kristian@web.de'] s.files = Dir['MIT-LICENSE'] s.licenses << 'MIT-LICENSE' s.files += Dir['lib/**/*'] s.add_development_dependency 'rake', '0.8.7' s.post_install_message = <<-TEXT - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - TEXT end ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gemfile-to-pom-forced/Gemfile0000644000000000000000000000003012674201751026031 0ustar gemspec 'sample.gemspec'./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gemfile-to-pom-forced/setup.bsh0000644000000000000000000000021212674201751026376 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; FileUtils.fileWrite(new File( basedir, "timestamp").getAbsolutePath(), ""); ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gemfile-to-pom-forced/test.properties0000644000000000000000000000001712674201751027640 0ustar pom.force=true ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gemfile-to-pom-forced/pom.xml0000644000000000000000000000115512674201751026064 0ustar 4.0.0 de.saumya.mojo jruby-version testing de.saumya.mojo gem-maven-plugin @project.version@ ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gemfile-to-pom-forced/invoker.properties./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gemfile-to-pom-forced/invoker.propertie0000644000000000000000000000014412674201751030154 0ustar invoker.goals = de.saumya.mojo:gem-maven-plugin:${project.version}:pom invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gem-sets/0000755000000000000000000000000012674201751022210 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gem-sets/verify.bsh0000644000000000000000000000436712674201751024224 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "installing gem sets for test scope into "; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } expected = "Successfully installed axiom-types-0.1.1"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } expected = "Successfully installed coercible-1.0.0"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } expected = "Successfully installed descendants_tracker-0.0.4"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } expected = "Successfully installed ice_nine-0.11.0"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } expected = "Successfully installed thread_safe-0.3.4-java"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } expected = "Successfully installed virtus-1.0.2"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } String lock = FileUtils.fileRead( new File( basedir, "Jars.lock" ) ); expected = "io.dropwizard.metrics:metrics-core"; if ( !lock.contains( expected ) ) { throw new RuntimeException( "Jars.lock file does not contain '" + expected + "'" ); } expected = "io.dropwizard.metrics:metrics-graphite"; if ( !lock.contains( expected ) ) { throw new RuntimeException( "Jars.lock file does not contain '" + expected + "'" ); } expected = "io.dropwizard.metrics:metrics-jvm"; if ( !lock.contains( expected ) ) { throw new RuntimeException( "Jars.lock file does not contain '" + expected + "'" ); } expected = "org.slf4j:slf4j-api"; if ( !lock.contains( expected ) ) { throw new RuntimeException( "Jars.lock file does not contain '" + expected + "'" ); } String unexpected = "org.slf4j:slf4j-simple"; if ( lock.contains( unexpected ) ) { throw new RuntimeException( "Jars.lock file contains unexpected '" + unexpected + "'" ); } ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gem-sets/pom.xml0000644000000000000000000000351412674201751023530 0ustar 4.0.0 de.saumya.mojo dummy testing rubygems-releases http://rubygems-proxy.torquebox.org/releases maven-clean-plugin clean validate de.saumya.mojo gem-maven-plugin @project.version@ test gems sets test 1.0.0.rc5 1.0.2 0.0.4 0.3.4 1.0.0 0.1.1 0.11.0 compile gems sets compile 0.3.2 0.6.2 Jars.lock jars-lock ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gem-sets/invoker.properties0000644000000000000000000000007012674201751026000 0ustar invoker.goals = initialize invoker.mavenOpts = -client ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/include-rubygems-in-test-resources-failure/./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/include-rubygems-in-test-resources-fail0000755000000000000000000000000012674201751030165 5ustar ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/include-rubygems-in-test-resources-failure/src/./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/include-rubygems-in-test-resources-fail0000755000000000000000000000000012674201751030165 5ustar ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/include-rubygems-in-test-resources-failure/src/test/./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/include-rubygems-in-test-resources-fail0000755000000000000000000000000012674201751030165 5ustar ././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/include-rubygems-in-test-resources-failure/src/test/java/./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/include-rubygems-in-test-resources-fail0000755000000000000000000000000012674201751030165 5ustar ././@LongLink0000644000000000000000000000017300000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/include-rubygems-in-test-resources-failure/src/test/java/org/./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/include-rubygems-in-test-resources-fail0000755000000000000000000000000012674201751030165 5ustar ././@LongLink0000644000000000000000000000020300000000000011576 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/include-rubygems-in-test-resources-failure/src/test/java/org/example/./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/include-rubygems-in-test-resources-fail0000755000000000000000000000000012674201751030165 5ustar ././@LongLink0000644000000000000000000000021400000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/include-rubygems-in-test-resources-failure/src/test/java/org/example/javasass/./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/include-rubygems-in-test-resources-fail0000755000000000000000000000000012674201751030165 5ustar ././@LongLink0000644000000000000000000000023500000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/include-rubygems-in-test-resources-failure/src/test/java/org/example/javasass/JavaSassTest.java./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/include-rubygems-in-test-resources-fail0000644000000000000000000000146212674201751030172 0ustar package org.example.javasass; import static org.junit.Assert.assertEquals; import javax.script.ScriptEngine; import javax.script.ScriptEngineManager; import javax.script.SimpleBindings; import org.junit.Test; public class JavaSassTest { @Test public void testJavaSass() throws Exception { ScriptEngineManager manager = new ScriptEngineManager(); ScriptEngine engine = manager.getEngineByName("jruby"); engine.eval("ENV['GEM_HOME'] = 'unknown'"); engine.eval("ENV['GEM_PATH'] = 'unknown'"); engine.eval("require 'rubygems'; require 'sass';"); String sass = ".test\n\tcolor: red"; SimpleBindings bindings = new SimpleBindings(); bindings.put("str", sass); String css = (String) engine.eval("Sass::Engine.new($str).render", bindings); assertEquals(".test {\n color: red; }\n", css); } } ././@LongLink0000644000000000000000000000017000000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/include-rubygems-in-test-resources-failure/test.properties./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/include-rubygems-in-test-resources-fail0000644000000000000000000000005012674201751030162 0ustar gem.includeRubygemsInTestResources=false././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/include-rubygems-in-test-resources-failure/pom.xml./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/include-rubygems-in-test-resources-fail0000644000000000000000000000306412674201751030172 0ustar 4.0.0 com.example target/rubygems-in-test-resources testing rubygems-release http://rubygems-proxy.torquebox.org/releases rubygems haml 3.0.25 gem junit junit 4.8.2 test org.jruby jruby-complete 1.6.2 ${basedir}/../../../../ ${root.dir}/target/rubygems ${root.dir}/target/rubygems de.saumya.mojo gem-maven-plugin @project.version@ initialize ././@LongLink0000644000000000000000000000017300000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/include-rubygems-in-test-resources-failure/invoker.properties./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/include-rubygems-in-test-resources-fail0000644000000000000000000000007312674201751030167 0ustar invoker.buildResult = failure invoker.mavenOpts = -client ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/package-gem-artifact-from-gemspec-no-pom/./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/package-gem-artifact-from-gemspec-no-po0000755000000000000000000000000012674201751027751 5ustar ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/package-gem-artifact-from-gemspec-no-pom/verify.bsh./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/package-gem-artifact-from-gemspec-no-po0000644000000000000000000000031212674201751027747 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; File f = new File( basedir, "gem_first-0.0.0.gem" ); if ( !f.exists() ) { throw new RuntimeException( "file does not exists: " + f ); }././@LongLink0000644000000000000000000000017000000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/package-gem-artifact-from-gemspec-no-pom/gem_first.gemspec./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/package-gem-artifact-from-gemspec-no-po0000644000000000000000000000025312674201751027753 0ustar Gem::Specification.new do |s| s.name = "gem_first" s.version = "0.0.0" s.files = ["lib/gem_first.rb"] s.summary = "gem first test gem" s.authors = ['dummy'] end ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/package-gem-artifact-from-gemspec-no-pom/setup.bsh./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/package-gem-artifact-from-gemspec-no-po0000644000000000000000000000016712674201751027757 0ustar import java.io.*; new File( basedir, "gem_first-0.0.0.gem").delete(); new File( basedir, "pom.xml").delete() || true; ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/package-gem-artifact-from-gemspec-no-pom/test.properties./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/package-gem-artifact-from-gemspec-no-po0000644000000000000000000000003212674201751027746 0ustar gemspec=gem_first.gemspec ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/package-gem-artifact-from-gemspec-no-pom/pom.xml./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/package-gem-artifact-from-gemspec-no-po0000644000000000000000000000060312674201751027752 0ustar 4.0.0 rubygems dummy 0.0.0 ././@LongLink0000644000000000000000000000017100000000000011602 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/package-gem-artifact-from-gemspec-no-pom/invoker.properties./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/package-gem-artifact-from-gemspec-no-po0000644000000000000000000000015012674201751027747 0ustar invoker.goals = de.saumya.mojo:gem-maven-plugin:${project.version}:package invoker.mavenOpts = -client ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/package-gem-artifact-from-gemspec-no-pom/lib/./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/package-gem-artifact-from-gemspec-no-po0000755000000000000000000000000012674201751027751 5ustar ././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/package-gem-artifact-from-gemspec-no-pom/lib/gem_first.rb./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/package-gem-artifact-from-gemspec-no-po0000644000000000000000000000006712674201751027756 0ustar class GemFirst def hello "hello world" end end ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/script-inside-pom-to-outputfile-somewhere/./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/script-inside-pom-to-outputfile-somewhe0000755000000000000000000000000012674201751030236 5ustar ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/script-inside-pom-to-outputfile-somewhere/verify.bsh./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/script-inside-pom-to-outputfile-somewhe0000644000000000000000000000042312674201751030237 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "log" ) ); String expected = "somewhere"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); }././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/script-inside-pom-to-outputfile-somewhere/src/./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/script-inside-pom-to-outputfile-somewhe0000755000000000000000000000000012674201751030236 5ustar ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/script-inside-pom-to-outputfile-somewhere/src/main/./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/script-inside-pom-to-outputfile-somewhe0000755000000000000000000000000012674201751030236 5ustar ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/script-inside-pom-to-outputfile-somewhere/src/main/ruby/./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/script-inside-pom-to-outputfile-somewhe0000755000000000000000000000000012674201751030236 5ustar ././@LongLink0000644000000000000000000000017400000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/script-inside-pom-to-outputfile-somewhere/src/main/ruby/dir.rb./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/script-inside-pom-to-outputfile-somewhe0000644000000000000000000000002712674201751030237 0ustar puts Dir.entries("..") ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/script-inside-pom-to-outputfile-somewhere/pom.xml./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/script-inside-pom-to-outputfile-somewhe0000644000000000000000000000142412674201751030241 0ustar 4.0.0 de.saumya.mojo dummy testing de.saumya.mojo gem-maven-plugin @project.version@ ${basedir}/src/main/ruby/dir.rb kristian log ././@LongLink0000644000000000000000000000017200000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/script-inside-pom-to-outputfile-somewhere/invoker.properties./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/script-inside-pom-to-outputfile-somewhe0000644000000000000000000000006612674201751030242 0ustar invoker.goals = gem:exec invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/jars-lock/0000755000000000000000000000000012674201751022351 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/jars-lock/verify.bsh0000644000000000000000000000360612674201751024360 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "Jars.lock created"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } expected = "Jars.lock is up to date"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } expected = "Jars2.lock has outdated dependencies"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } expected = "no such artifact in Jars.lock: unknown"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } expected = "updated org.slf4j:slf4j-simple:jar:1.7.12:compile"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } expected = "Jars2.lock updated"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } expected = "Jars3.lock updated"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } File file = new File( basedir, "target/jars/org/slf4j/log4j-over-slf4j/1.7.10/log4j-over-slf4j-1.7.10.jar" ); if ( !file.exists() ) { throw new RuntimeException( "expected file does not exists '" + file + "'" ); } file = new File( basedir, "target/jars/org/apache/kafka/kafka_2.10/0.8.1.1/kafka_2.10-0.8.1.1.jar" ); if ( !file.exists() ) { throw new RuntimeException( "expected file does not exists '" + file + "'" ); } file = new File( basedir, "target/jars/org/bouncycastle/bcprov-jdk15on/1.49/bcprov-jdk15on-1.49.jar" ); if ( !file.exists() ) { throw new RuntimeException( "expected file does not exists '" + file + "'" ); } ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/jars-lock/Jars2.lock0000644000000000000000000000415612674201751024212 0ustar io.dropwizard.metrics:metrics-core:3.1.0:compile: io.dropwizard.metrics:metrics-graphite:3.1.0:compile: io.dropwizard.metrics:metrics-healthchecks:3.1.0:compile: io.dropwizard.metrics:metrics-jvm:3.1.0:compile: io.dropwizard.metrics:metrics-json:3.1.0:compile: com.fasterxml.jackson.core:jackson-databind:2.4.2:compile: com.fasterxml.jackson.core:jackson-annotations:2.4.0:compile: com.fasterxml.jackson.core:jackson-core:2.4.2:compile: io.dropwizard:dropwizard-logging:0.8.0-rc5:compile: io.dropwizard:dropwizard-jackson:0.8.0-rc5:compile: com.google.guava:guava:18.0:compile: io.dropwizard:dropwizard-util:0.8.0-rc5:compile: com.google.code.findbugs:jsr305:3.0.0:compile: joda-time:joda-time:2.7:compile: com.fasterxml.jackson.datatype:jackson-datatype-jdk7:2.5.1:compile: com.fasterxml.jackson.datatype:jackson-datatype-guava:2.5.1:compile: com.fasterxml.jackson.module:jackson-module-afterburner:2.5.1:compile: com.fasterxml.jackson.datatype:jackson-datatype-joda:2.5.1:compile: io.dropwizard:dropwizard-validation:0.8.0-rc5:compile: org.hibernate:hibernate-validator:5.1.3.Final:compile: javax.validation:validation-api:1.1.0.Final:compile: org.jboss.logging:jboss-logging:3.1.3.GA:compile: com.fasterxml:classmate:1.0.0:compile: org.glassfish:javax.el:3.0.0:compile: io.dropwizard.metrics:metrics-logback:3.1.0:compile: org.slf4j:jul-to-slf4j:1.7.10:compile: ch.qos.logback:logback-core:1.1.2:compile: ch.qos.logback:logback-classic:1.1.2:compile: org.slf4j:log4j-over-slf4j:1.7.10:compile: org.slf4j:jcl-over-slf4j:1.7.10:compile: org.eclipse.jetty:jetty-util:9.2.9.v20150224:compile: io.dropwizard:dropwizard-configuration:0.8.0-rc5:compile: com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.5.1:compile: org.yaml:snakeyaml:1.12:compile: org.apache.commons:commons-lang3:3.3.2:compile: org.apache.hbase:hbase-annotations:0.98.7-hadoop2:compile: jdk.tools:jdk.tools:1.7:system:${java.home}/../lib/tools.jar com.github.stephenc.findbugs:findbugs-annotations:1.3.9-1:compile: log4j:log4j:1.2.17:compile: junit:junit:4.11:compile: org.hamcrest:hamcrest-core:1.3:compile: org.slf4j:slf4j-simple:1.7.1:compile: org.slf4j:slf4j-api:1.7.10:compile: ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/jars-lock/setup.bsh0000644000000000000000000000057112674201751024212 0ustar import java.io.*; new File( basedir, "Jars.lock" ).delete(); new File( basedir, "target/jars/org/slf4j/log4j-over-slf4j/1.7.10/log4j-over-slf4j-1.7.10.jar" ).delete(); // try to delete from local repo - might not work on custom setups new File( System.getProperty("user.home"), ".m2/repository/org/slf4j/log4j-over-slf4j/1.7.10/log4j-over-slf4j-1.7.10.jar" ).delete(); true; ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/jars-lock/Jars4.lock0000644000000000000000000000004012674201751024200 0ustar joda-time:joda-time:2.7:compile:./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/jars-lock/pom.xml0000644000000000000000000000630212674201751023667 0ustar 4.0.0 rubygems dummy testing rubygems-release http://rubygems-proxy.torquebox.org/releases rubygems leafy-complete 0.6.1 gem org.apache.hbase hbase-annotations 0.98.7-hadoop2 org.slf4j slf4j-simple [1.6, 2.0) ${basedir}/../../../../ ${root.dir}/target/rubygems ${root.dir}/target/rubygems de.saumya.mojo gem-maven-plugin @project.version@ create jars-lock is up to date jars-lock has outdated artifact jars-lock Jars2.lock just warn on update of unknown artifact jars-lock unknown update artifact jars-lock Jars2.lock slf4j-simple update jars-lock Jars3.lock vendor jars jars-lock Jars4.lock ${project.build.directory}/jars with gemslist jars-lock Jars5.lock ${project.build.directory}/jars hermann:0.20.2 jruby-openssl:0.9.6:provided ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/jars-lock/invoker.properties0000644000000000000000000000003012674201751026135 0ustar invoker.goals=initialize./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/jars-lock/Jars3.lock0000644000000000000000000000404012674201751024203 0ustar io.dropwizard.metrics:metrics-core:3.1.0:compile: io.dropwizard.metrics:metrics-graphite:3.1.0:compile: io.dropwizard.metrics:metrics-healthchecks:3.1.0:compile: io.dropwizard.metrics:metrics-jvm:3.1.0:compile: io.dropwizard.metrics:metrics-json:3.1.0:compile: com.fasterxml.jackson.core:jackson-databind:2.4.2:compile: com.fasterxml.jackson.core:jackson-annotations:2.4.0:compile: com.fasterxml.jackson.core:jackson-core:2.4.2:compile: io.dropwizard:dropwizard-logging:0.8.0-rc5:compile: io.dropwizard:dropwizard-jackson:0.8.0-rc5:compile: com.google.guava:guava:18.0:compile: io.dropwizard:dropwizard-util:0.8.0-rc5:compile: com.google.code.findbugs:jsr305:3.0.0:compile: joda-time:joda-time:2.7:compile: com.fasterxml.jackson.datatype:jackson-datatype-jdk7:2.5.1:compile: com.fasterxml.jackson.datatype:jackson-datatype-guava:2.5.1:compile: com.fasterxml.jackson.module:jackson-module-afterburner:2.5.1:compile: com.fasterxml.jackson.datatype:jackson-datatype-joda:2.5.1:compile: io.dropwizard:dropwizard-validation:0.8.0-rc5:compile: org.hibernate:hibernate-validator:5.1.3.Final:compile: javax.validation:validation-api:1.1.0.Final:compile: org.jboss.logging:jboss-logging:3.1.3.GA:compile: com.fasterxml:classmate:1.0.0:compile: org.glassfish:javax.el:3.0.0:compile: io.dropwizard.metrics:metrics-logback:3.1.0:compile: org.slf4j:jul-to-slf4j:1.7.10:compile: ch.qos.logback:logback-core:1.1.2:compile: ch.qos.logback:logback-classic:1.1.2:compile: org.slf4j:log4j-over-slf4j:1.7.10:compile: org.slf4j:jcl-over-slf4j:1.7.10:compile: org.eclipse.jetty:jetty-util:9.2.9.v20150224:compile: io.dropwizard:dropwizard-configuration:0.8.0-rc5:compile: com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.5.1:compile: org.yaml:snakeyaml:1.12:compile: org.apache.commons:commons-lang3:3.3.2:compile: org.apache.hbase:hbase-annotations:0.98.7-hadoop2:compile: jdk.tools:jdk.tools:1.7:system:${java.home}/../lib/tools.jar com.github.stephenc.findbugs:findbugs-annotations:1.3.9-1:compile: log4j:log4j:1.2.17:compile: junit:junit:4.11:compile: org.slf4j:slf4j-api:1.7.12:compile: ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/irb-help-pom/0000755000000000000000000000000012674201751022757 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/irb-help-pom/verify.bsh0000644000000000000000000000047212674201751024764 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "irb.rb [options] [programfile] [arguments]"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); }./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/irb-help-pom/test.properties0000644000000000000000000000002012674201751026044 0ustar irb.args=--help ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/irb-help-pom/pom.xml0000644000000000000000000000115512674201751024276 0ustar 4.0.0 de.saumya.mojo jruby-version testing de.saumya.mojo gem-maven-plugin @project.version@ ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/irb-help-pom/invoker.properties0000644000000000000000000000006512674201751026553 0ustar invoker.goals = gem:irb invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gemify-simple/0000755000000000000000000000000012674201751023233 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gemify-simple/verify.bsh0000644000000000000000000000050612674201751025236 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "Successfully installed com.google.code.guice.guice-1.0"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); }./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gemify-simple/flags.txt0000644000000000000000000000010112674201751025060 0ustar -DartifactId=guice -DgroupId=com.google.code.guice -Dversion=1.0 ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gemify-simple/test.properties0000644000000000000000000000007312674201751026330 0ustar artifactId=guice groupId=com.google.code.guice version=1.0 ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gemify-simple/pom.xml0000644000000000000000000000114512674201751024551 0ustar 4.0.0 de.saumya.mojo dummy testing de.saumya.mojo gem-maven-plugin @project.version@ ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gemify-simple/invoker.properties0000644000000000000000000000007012674201751027023 0ustar invoker.goals = gem:gemify invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/gemify-simple/goals.txt0000644000000000000000000000004712674201751025102 0ustar de.saumya.mojo:gem-maven-plugin:gemify ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/exec-args-with-spaces/0000755000000000000000000000000012674201751024567 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/exec-args-with-spaces/verify.bsh0000644000000000000000000000066012674201751026573 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "hello world"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); }expected = "may all be happy"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); }./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/exec-args-with-spaces/pom.xml0000644000000000000000000000145112674201751026105 0ustar 4.0.0 de.saumya.mojo dummy testing de.saumya.mojo gem-maven-plugin @project.version@ script with spaces.rb hello world may all be happy ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/exec-args-with-spaces/script with spaces.rb./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/exec-args-with-spaces/script with space0000644000000000000000000000004212674201751030022 0ustar ARGV.each do |arg| puts arg end ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/exec-args-with-spaces/invoker.properties./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/exec-args-with-spaces/invoker.propertie0000644000000000000000000000006612674201751030201 0ustar invoker.goals = gem:exec invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/execute-compass-with-gems-from-plugin/0000755000000000000000000000000012674201751027730 5ustar ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/execute-compass-with-gems-from-plugin/verify.bsh./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/execute-compass-with-gems-from-plugin/v0000644000000000000000000000120512674201751030116 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "Successfully installed compass-"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } expected = "Successfully installed sass-"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } expected = "Compass can't find any Sass files to compile."; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/execute-compass-with-gems-from-plugin/pom.xml./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/execute-compass-with-gems-from-plugin/p0000644000000000000000000000307112674201751030113 0ustar 4.0.0 com.example gems 0.0.0 rubygems-releases http://rubygems-proxy.torquebox.org/releases ${basedir} ${root.dir}/target/rubygems ${root.dir}/target/rubygems de.saumya.mojo gem-maven-plugin @project.parent.version@ exec compile ${project.build.directory}/rubygems/bin/compass compile ${basedir}/src/main/webapp/resources/sass rubygems compass 1.0.3 gem ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/execute-compass-with-gems-from-plugin/invoker.properties./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/execute-compass-with-gems-from-plugin/i0000644000000000000000000000013112674201751030076 0ustar invoker.goals = clean compile invoker.mavenOpts = -client invoker.buildResult = failure ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/initialize/0000755000000000000000000000000012674201751022625 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/initialize/verify.bsh0000644000000000000000000000073312674201751024632 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "Successfully installed rack-1.0.1"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } expected = "Successfully installed rails-2.3.5"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/initialize/setup.bsh0000644000000000000000000000020312674201751024456 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; FileUtils.deleteDirectory( new File( basedir, "target/rubygems" ) ); ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/initialize/pom.xml0000644000000000000000000000272612674201751024151 0ustar 4.0.0 rubygems dummy testing rubygems-release http://rubygems-proxy.torquebox.org/releases rubygems rails 2.3.5 gem rubygems rack 1.1.0 gem rubygems ffi 1.9.6 gem ${basedir} ${root.dir}/target/rubygems ${root.dir}/target/rubygems de.saumya.mojo gem-maven-plugin @project.version@ true ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/initialize/invoker.properties0000644000000000000000000000007412674201751026421 0ustar invoker.goals = gem:initialize invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/install-java-gem-pom/0000755000000000000000000000000012674201751024410 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/install-java-gem-pom/verify.bsh0000644000000000000000000000035212674201751026412 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; File f = new File( basedir, "target/com.example.package-java-gem-0.0.0-java.gem" ); if ( !f.exists() ) { throw new RuntimeException( "file does not exists: " + f ); } ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/install-java-gem-pom/src/0000755000000000000000000000000012674201751025177 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/install-java-gem-pom/src/test/0000755000000000000000000000000012674201751026156 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/install-java-gem-pom/src/test/java/0000755000000000000000000000000012674201751027077 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/install-java-gem-pom/src/test/java/com/0000755000000000000000000000000012674201751027655 5ustar ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/install-java-gem-pom/src/test/java/com/example/./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/install-java-gem-pom/src/test/java/com/0000755000000000000000000000000012674201751027655 5ustar ././@LongLink0000644000000000000000000000017100000000000011602 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/install-java-gem-pom/src/test/java/com/example/AppTest.java./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/install-java-gem-pom/src/test/java/com/0000644000000000000000000000117612674201751027664 0ustar package com.example; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; /** * Unit test for simple App. */ public class AppTest extends TestCase { /** * Create the test case * * @param testName name of the test case */ public AppTest( String testName ) { super( testName ); } /** * @return the suite of tests being tested */ public static Test suite() { return new TestSuite( AppTest.class ); } /** * Rigourous Test :-) */ public void testApp() { assertTrue( true ); } } ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/install-java-gem-pom/src/main/0000755000000000000000000000000012674201751026123 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/install-java-gem-pom/src/main/java/0000755000000000000000000000000012674201751027044 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/install-java-gem-pom/src/main/java/com/0000755000000000000000000000000012674201751027622 5ustar ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/install-java-gem-pom/src/main/java/com/example/./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/install-java-gem-pom/src/main/java/com/0000755000000000000000000000000012674201751027622 5ustar ././@LongLink0000644000000000000000000000016500000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/install-java-gem-pom/src/main/java/com/example/App.java./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/install-java-gem-pom/src/main/java/com/0000644000000000000000000000025512674201751027626 0ustar package com.example; /** * Hello world! * */ public class App { public static void main( String[] args ) { System.out.println( "Hello World!" ); } } ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/install-java-gem-pom/pom.xml0000644000000000000000000000121412674201751025723 0ustar 4.0.0 com.example package-java-gem 0.0.0 java-gem de.saumya.mojo gem-maven-plugin @project.version@ true ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/small-project/0000755000000000000000000000000012674201751023240 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/small-project/verify.bsh0000644000000000000000000000067012674201751025245 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "hello ruby world"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } expected = "Hello Java World!"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); }./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/small-project/ruby-world/0000755000000000000000000000000012674201751025346 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/small-project/ruby-world/pom.xml0000644000000000000000000000124512674201751026665 0ustar 4.0.0 rubygems ruby-world 0.0.0 gem de.saumya.mojo gem-maven-plugin @project.version@ true ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/small-project/ruby-world/lib/0000755000000000000000000000000012674201751026114 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/small-project/ruby-world/lib/hello.rb0000644000000000000000000000007312674201751027544 0ustar class Hello def world "hello ruby world" end end ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/small-project/ruby-world/ruby-world.gemspec./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/small-project/ruby-world/ruby-world.gem0000644000000000000000000000030312674201751030142 0ustar # create by maven - leave it as is Gem::Specification.new do |s| s.name = 'ruby-world' s.version = '0.0.0' s.summary = 'ruby-world' s.author = 'author' s.files = Dir['lib/**/*'] end ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/small-project/pom.xml0000644000000000000000000000136512674201751024562 0ustar 4.0.0 com.example small-project pom 0.0.0 play ground for gem testing ${basedir}/../../../../ ${root.dir}/target/rubygmes ${root.dir}/target/rubygmes java-world ruby-world application ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/small-project/invoker.properties0000644000000000000000000000006512674201751027034 0ustar invoker.goals = install invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/small-project/java-world/0000755000000000000000000000000012674201751025306 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/small-project/java-world/src/0000755000000000000000000000000012674201751026075 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/small-project/java-world/src/main/0000755000000000000000000000000012674201751027021 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/small-project/java-world/src/main/java/0000755000000000000000000000000012674201751027742 5ustar ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/small-project/java-world/src/main/java/com/./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/small-project/java-world/src/main/java/0000755000000000000000000000000012674201751027742 5ustar ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/small-project/java-world/src/main/java/com/example/./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/small-project/java-world/src/main/java/0000755000000000000000000000000012674201751027742 5ustar ././@LongLink0000644000000000000000000000017300000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/small-project/java-world/src/main/java/com/example/Hello.java./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/small-project/java-world/src/main/java/0000644000000000000000000000022312674201751027741 0ustar package com.example; /** * Hello world! * */ public class Hello { public String world() { return "Hello Java World!"; } } ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/small-project/java-world/pom.xml0000644000000000000000000000062512674201751026626 0ustar 4.0.0 com.example java-world jar 0.0.0 java-world ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/small-project/application/0000755000000000000000000000000012674201751025543 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/small-project/application/pom.xml0000644000000000000000000000312512674201751027061 0ustar 4.0.0 rubygems application 0.0.0 gem rubygems-release yhttp://rubygems-proxy.torquebox.org/releases rubygems ruby-world 0.0.0 gem com.example java-world 0.0.0 ${basedir}/../../../../../ de.saumya.mojo gem-maven-plugin @project.version@ true compile exec ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/small-project/application/application.gemspec./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/small-project/application/application.g0000644000000000000000000000032212674201751030213 0ustar # create by maven - leave it as is Gem::Specification.new do |s| s.name = 'application' s.version = '0.0.0' s.summary = 'application' s.author = 'author' s.add_dependency 'ruby-world', '0.0.0' end ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/exec-embed/0000755000000000000000000000000012674201751022462 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/exec-embed/verify.bsh0000644000000000000000000000043312674201751024464 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "hello world"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); }./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/exec-embed/test.properties0000644000000000000000000000004012674201751025551 0ustar exec.script=puts("hello world") ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/exec-embed/pom.xml0000644000000000000000000000111612674201751023776 0ustar 4.0.0 de.saumya.mojo dummy testing de.saumya.mojo gem-maven-plugin @project.version@ ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/exec-embed/invoker.properties0000644000000000000000000000006612674201751026257 0ustar invoker.goals = gem:exec invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/install-gem-pom/0000755000000000000000000000000012674201751023471 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/install-gem-pom/verify.bsh0000644000000000000000000000032112674201751025467 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; File f = new File( basedir, "target/pom_first-0.0.0.gem" ); if ( !f.exists() ) { throw new RuntimeException( "file does not exists: " + f ); }./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/install-gem-pom/pom_first.gemspec0000644000000000000000000000030112674201751027032 0ustar # create by maven - leave it as is Gem::Specification.new do |s| s.name = 'pom_first' s.version = '0.0.0' s.summary = 'pom_first' s.author = 'author' s.files = Dir['lib/**/*'] end ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/install-gem-pom/pom.xml0000644000000000000000000000122612674201751025007 0ustar 4.0.0 rubygems pom_first 0.0.0 gem de.saumya.mojo gem-maven-plugin @project.version@ true ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/install-gem-pom/lib/0000755000000000000000000000000012674201751024237 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/install-gem-pom/lib/gem_first.rb0000644000000000000000000000006712674201751026546 0ustar class GemFirst def hello "hello world" end end ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/install-pom-with-gemspec/0000755000000000000000000000000012674201751025315 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/install-pom-with-gemspec/verify.bsh0000644000000000000000000000052512674201751027321 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; File f = new File( basedir, "target/first.gem" ); if ( !f.exists() ) { throw new RuntimeException( "file does not exists: " + f ); } f = new File( basedir, "pom.pom_first.gemspec.xml" ); if ( !f.exists() ) { throw new RuntimeException( "file does not exists: " + f ); } ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/install-pom-with-gemspec/pom_first.gemspec./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/install-pom-with-gemspec/pom_first.gems0000644000000000000000000000030512674201751030172 0ustar # create by maven - leave it as is Gem::Specification.new do |s| s.name = 'pom_first' s.version = '0.0.0.dev' s.summary = 'pom_first' s.author = 'author' s.files = Dir['lib/**/*'] end ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/install-pom-with-gemspec/pom.xml0000644000000000000000000000141212674201751026630 0ustar 4.0.0 rubygems pom_first 0.0.0 gem first de.saumya.mojo gem-maven-plugin @project.version@ true pom_first.gemspec ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/install-pom-with-gemspec/lib/0000755000000000000000000000000012674201751026063 5ustar ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/install-pom-with-gemspec/lib/gem_first.rb./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/install-pom-with-gemspec/lib/gem_first.0000644000000000000000000000006712674201751030046 0ustar class GemFirst def hello "hello world" end end ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/script-inside-pom-failure/0000755000000000000000000000000012674201751025457 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/script-inside-pom-failure/verify.bsh0000644000000000000000000000044312674201751027462 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "some error happened"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); }./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/script-inside-pom-failure/pom.xml0000644000000000000000000000131612674201751026775 0ustar 4.0.0 de.saumya.mojo dummy testing de.saumya.mojo gem-maven-plugin @project.version@ ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/script-inside-pom-failure/invoker.properties./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/script-inside-pom-failure/invoker.prope0000644000000000000000000000012412674201751030200 0ustar invoker.goals = gem:exec invoker.buildResult = failure invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/support-native-extensions/0000755000000000000000000000000012674201751025661 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/support-native-extensions/verify.bsh0000644000000000000000000000046012674201751027663 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "Successfully installed typhoeus"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/support-native-extensions/pending-pom.xml./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/support-native-extensions/pending-pom.x0000644000000000000000000000201312674201751030263 0ustar 4.0.0 com.example typhoeus-test 0.0.0 target/rubygems-releases http://target/rubygems-proxy.torquebox.org/releases rubygems typhoeus 0.2.4 gem ${basedir}/../../../../ ${root.dir}/target/rubygems ${root.dir}/target/rubygems de.saumya.mojo gem-maven-plugin @project.version@ true ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/support-native-extensions/test.properties./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/support-native-extensions/test.properti0000644000000000000000000000007012674201751030423 0ustar exec.script=p require "rubygems"; p require "typhoeus"; ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/support-native-extensions/invoker.properties./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/support-native-extensions/invoker.prope0000644000000000000000000000007412674201751030406 0ustar invoker.goals = clean gem:exec invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/include-rubygems-in-resources/0000755000000000000000000000000012674201751026356 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/include-rubygems-in-resources/src/0000755000000000000000000000000012674201751027145 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/include-rubygems-in-resources/src/main/0000755000000000000000000000000012674201751030071 5ustar ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/include-rubygems-in-resources/src/main/java/./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/include-rubygems-in-resources/src/main/0000755000000000000000000000000012674201751030071 5ustar ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/include-rubygems-in-resources/src/main/java/com/./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/include-rubygems-in-resources/src/main/0000755000000000000000000000000012674201751030071 5ustar ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/include-rubygems-in-resources/src/main/java/com/example/./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/include-rubygems-in-resources/src/main/0000755000000000000000000000000012674201751030071 5ustar ././@LongLink0000644000000000000000000000017700000000000011610 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/include-rubygems-in-resources/src/main/java/com/example/javasass/./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/include-rubygems-in-resources/src/main/0000755000000000000000000000000012674201751030071 5ustar ././@LongLink0000644000000000000000000000022000000000000011575 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/include-rubygems-in-resources/src/main/java/com/example/javasass/JavaSassMain.java./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/include-rubygems-in-resources/src/main/0000644000000000000000000000076012674201751030076 0ustar package com.example.javasass; import org.jruby.embed.ScriptingContainer; public class JavaSassMain { public static void main(String[] args) { ScriptingContainer container = new ScriptingContainer(); container.runScriptlet("require 'rubygems'; require 'sass';"); String sass = ".test\n\tcolor: red"; container.put("str", sass); String css = (String)container.runScriptlet("Sass::Engine.new(str).render"); System.out.println(css); } } ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/include-rubygems-in-resources/pom.xml0000644000000000000000000000406012674201751027673 0ustar 4.0.0 com.example include-rubygems-in-resources testing jar rubygems-release http://rubygems-proxy.torquebox.org/releases rubygems sass 3.2.7 gem junit junit 4.8.2 test org.jruby jruby-complete 1.7.3 ${basedir}/../../../../ ${root.dir}/target/rubygems ${root.dir}/target/rubygems de.saumya.mojo gem-maven-plugin @project.version@ true initialize ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/script-inside-pom-somewhere/0000755000000000000000000000000012674201751026026 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/script-inside-pom-somewhere/verify.bsh0000644000000000000000000000043112674201751030026 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "somewhere"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); }././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/script-inside-pom-somewhere/validate.groovy./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/script-inside-pom-somewhere/validate.gr0000644000000000000000000000027112674201751030151 0ustar failure = false new File(basedir, 'build.log').eachLine{ failure = failure || (it =~ 'hello world') // println "read the following line -> " + it + " " + failure } assert failure ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/script-inside-pom-somewhere/pom.xml0000644000000000000000000000131512674201751027343 0ustar 4.0.0 de.saumya.mojo dummy testing de.saumya.mojo gem-maven-plugin @project.version@ ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/script-inside-pom-somewhere/invoker.properties./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/script-inside-pom-somewhere/invoker.pro0000644000000000000000000000006612674201751030227 0ustar invoker.goals = gem:exec invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/include-rubygems-in-test-resources/0000755000000000000000000000000012674201751027333 5ustar ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/include-rubygems-in-test-resources/verify.bsh./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/include-rubygems-in-test-resources/veri0000644000000000000000000000046412674201751030227 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "Tests run: 1, Failures: 0, Errors: 0"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); }./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/include-rubygems-in-test-resources/src/0000755000000000000000000000000012674201751030122 5ustar ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/include-rubygems-in-test-resources/src/test/./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/include-rubygems-in-test-resources/src/0000755000000000000000000000000012674201751030122 5ustar ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/include-rubygems-in-test-resources/src/test/java/./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/include-rubygems-in-test-resources/src/0000755000000000000000000000000012674201751030122 5ustar ././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/include-rubygems-in-test-resources/src/test/java/org/./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/include-rubygems-in-test-resources/src/0000755000000000000000000000000012674201751030122 5ustar ././@LongLink0000644000000000000000000000017300000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/include-rubygems-in-test-resources/src/test/java/org/example/./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/include-rubygems-in-test-resources/src/0000755000000000000000000000000012674201751030122 5ustar ././@LongLink0000644000000000000000000000020400000000000011577 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/include-rubygems-in-test-resources/src/test/java/org/example/javasass/./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/include-rubygems-in-test-resources/src/0000755000000000000000000000000012674201751030122 5ustar ././@LongLink0000644000000000000000000000022500000000000011602 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/include-rubygems-in-test-resources/src/test/java/org/example/javasass/JavaSassTest.java./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/include-rubygems-in-test-resources/src/0000644000000000000000000000114512674201751030125 0ustar package org.example.javasass; import static org.junit.Assert.assertEquals; import org.jruby.embed.ScriptingContainer; import org.junit.Test; public class JavaSassTest { @Test public void testJavaSass() throws Exception { ScriptingContainer container = new ScriptingContainer(); container.runScriptlet("require 'rubygems'; require 'sass';"); String sass = ".test\n\tcolor: red"; container.put("str", sass); String css = (String)container.runScriptlet("Sass::Engine.new(str).render"); assertEquals(".test {\n color: red; }\n", css); } } ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/include-rubygems-in-test-resources/pom.xml./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/include-rubygems-in-test-resources/pom.0000644000000000000000000000334712674201751030136 0ustar 4.0.0 com.example rubygems-in-test-resources testing rubygems-release http://rubygems-proxy.torquebox.org/releases rubygems haml 3.0.25 gem junit junit 4.8.2 test org.jruby jruby-complete 1.6.3 ${basedir}/../../../../ ${root.dir}/target/rubygems ${root.dir}/target/rubygems maven-compiler-plugin 3.1 1.6 1.6 de.saumya.mojo gem-maven-plugin @project.version@ initialize ././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/include-rubygems-in-test-resources/invoker.properties./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/src/it/include-rubygems-in-test-resources/invo0000644000000000000000000000003512674201751030227 0ustar invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/pom.xml0000644000000000000000000000143412674201751020600 0ustar 4.0.0 parent-mojo de.saumya.mojo 1.1.5 ../parent-mojo/pom.xml gem-maven-plugin maven-plugin Gem Maven Mojo ${project.parent.groupId} jruby-maven-plugin ${project.parent.version} ./jruby-maven-plugins-1.1.5.ds1.orig/gem-maven-plugin/.gitignore0000644000000000000000000000000712674201751021246 0ustar target ./jruby-maven-plugins-1.1.5.ds1.orig/test-base-plugin/0000755000000000000000000000000012674201751017274 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/test-base-plugin/src/0000755000000000000000000000000012674201751020063 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/test-base-plugin/src/main/0000755000000000000000000000000012674201751021007 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/test-base-plugin/src/main/java/0000755000000000000000000000000012674201751021730 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/test-base-plugin/src/main/java/de/0000755000000000000000000000000012674201751022320 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/test-base-plugin/src/main/java/de/saumya/0000755000000000000000000000000012674201751023617 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/test-base-plugin/src/main/java/de/saumya/mojo/0000755000000000000000000000000012674201751024563 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/test-base-plugin/src/main/java/de/saumya/mojo/tests/0000755000000000000000000000000012674201751025725 5ustar ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/test-base-plugin/src/main/java/de/saumya/mojo/tests/AbstractTestMojo.java./jruby-maven-plugins-1.1.5.ds1.orig/test-base-plugin/src/main/java/de/saumya/mojo/tests/AbstractTes0000644000000000000000000002002712674201751030070 0ustar package de.saumya.mojo.tests; import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; import org.apache.maven.artifact.DependencyResolutionRequiredException; import org.apache.maven.plugin.MojoExecutionException; import de.saumya.mojo.gem.AbstractGemMojo; import de.saumya.mojo.jruby.JRubyVersion; import de.saumya.mojo.jruby.JRubyVersion.Mode; import de.saumya.mojo.ruby.gems.GemException; import de.saumya.mojo.ruby.script.ScriptException; import de.saumya.mojo.ruby.script.ScriptFactory; import de.saumya.mojo.tests.JRubyRun.Result; import org.apache.maven.plugins.annotations.Parameter; /** * maven wrapper around some test command. */ public abstract class AbstractTestMojo extends AbstractGemMojo { /** */ @Parameter( defaultValue = "${project.build.directory}/surefire-reports") protected File testReportDirectory; /** * skip all tests */ @Parameter( property = "skipTests", defaultValue = "false") protected boolean skipTests; /** * skip all tests */ @Parameter(property = "maven.test.skip", defaultValue = "false") protected boolean skip; /** * run tests with list of ruby modes 1.8, 1.9, 2.0, 2.2 */ @Parameter(property = "jruby.modes") protected String modes; /** * run tests with a several versions of jruby */ @Parameter( property = "jruby.versions") protected String versions; /** * The name of the summary (xml-)report which can be used by TeamCity and Co. */ @Parameter protected File summaryReport; private Mode[] calculateModes( Mode defaultMode ) { List result = new ArrayList(); if (jrubySwitches != null ) { for ( Mode m: Mode.values() ) { if ( jrubySwitches.contains( m.flag ) && ! m.flag.equals( "" ) ) { result.add( m ); } } } if (this.modes != null ) { String[] modes = this.modes.split( "[\\ ,;]+" ); for( String m : modes ) { Mode mode = Mode.valueOf( "_" + m.replace( ".", "" ) ); if ( ! result.contains( mode ) ) { result.add( mode ); } } } if ( result.size() == 0) { result.add( defaultMode ); } return result.toArray( new Mode[ result.size() ] ); } private JRubyVersion[] calculateVersions() { if ( versions == null ) { return new JRubyVersion[] { getJrubyVersion() }; } else { String[] jrubyVersions = versions.split("[\\ ,;]+"); JRubyVersion[] result = new JRubyVersion[ jrubyVersions.length ]; int i = 0; for( String version: jrubyVersions ){ result[ i++ ] = new JRubyVersion( version ); } return result; } } protected void executeWithGems() throws MojoExecutionException, IOException, ScriptException, GemException { testReportDirectory = new File(testReportDirectory.getAbsolutePath().replace("${project.basedir}/","")); List runs = new ArrayList(); JRubyVersion[] versions = calculateVersions(); Mode[] modes = calculateModes( getJrubyVersion().defaultMode() ); if ( versions.length == 1 && versions[ 0 ].equals( getJrubyVersion() ) && modes.length == 1 && modes[0] == getJrubyVersion().defaultMode() ) { runs.add( new JRubyRun( getJrubyVersion() ) ); } else { for( JRubyVersion version : versions ) { if ( this.modes == null ) modes = calculateModes( version.defaultMode() ); runs.add( new JRubyRun( version, modes ) ); } } final File outputDir = new File(this.project.getBuild().getDirectory() .replace("${project.basedir}/", "")); TestScriptFactory scriptFactory = null; for( JRubyRun run: runs){ scriptFactory = newTestScriptFactory(); scriptFactory.setBaseDir(project.getBasedir()); scriptFactory.setGemHome(gemsConfig.getGemHome()); scriptFactory.setGemPaths(gemsConfig.getGemPath()); scriptFactory.setOutputDir(outputDir); scriptFactory.setSystemProperties(project.getProperties()); scriptFactory.setSummaryReport(summaryReport); scriptFactory.setReportPath(testReportDirectory); try { scriptFactory.setClasspathElements(project .getTestClasspathElements()); } catch (DependencyResolutionRequiredException e) { throw new MojoExecutionException("error getting classpath", e); } runIt(run, scriptFactory); if (run.modes.length == 0) { getLog().warn( "JRuby version " + run.version + " can not run any of the given modes: " + ( this.modes == null ? Arrays.toString( modes ) : this.modes ) ); } else { scriptFactory.emit(); } } boolean hasOverview = this.versions != null || modes != null; if(hasOverview){ getLog().info(""); getLog().info("\tOverall Summary"); getLog().info("\t==============="); } boolean failure = false; for( JRubyRun run: runs){ for(Mode mode: run.modes){ if(hasOverview){ getLog().info("\t" + run.toString(mode)); } failure |= !run.result(mode).success; } } if(hasOverview){ getLog().info(""); getLog().info("use '" + scriptFactory.getScriptFile() + "' for faster command line execution."); } if(failure){ throw new MojoExecutionException("There were test failures"); } } protected void runIt(JRubyRun run, TestScriptFactory testScriptFactory) throws MojoExecutionException, IOException, ScriptException { final de.saumya.mojo.ruby.script.ScriptFactory factory; if (getJrubyVersion().equals(run.version) ){//|| run.isDefaultModeOnly()){ factory = this.factory; } else { try { factory = newScriptFactory(resolveJRubyCompleteArtifact(run.version.toString())); // TODO remove this - it should have been already taken care of :( if( env != null ){ for( Map.Entry entry: env.entrySet() ){ factory.addEnv( entry.getKey(), entry.getValue() ); } } } catch (DependencyResolutionRequiredException e) { throw new MojoExecutionException("could not resolve jruby", e); } } for (Mode mode : run.modes) { JRubyVersion version = null; getLog().info(""); if ( !run.isDefaultModeOnly ) { if ( ! mode.flag.equals("") ) factory.addSwitch(mode.flag); getLog().info("\trun with jruby " + run.version + (mode.flag.equals("") ? "" : ( " in mode " + mode ) ) ); version = run.version; } else { getLog().info("\trun with jruby " + run.version); mode = null; version = null; } getLog().info(""); run.setResult(mode, runIt(factory, mode, version, testScriptFactory)); } } protected abstract TestScriptFactory newTestScriptFactory();//Mode mode); protected abstract Result runIt(ScriptFactory factory, Mode mode, JRubyVersion version, TestScriptFactory testScriptFactory) throws IOException, ScriptException, MojoExecutionException; } ././@LongLink0000644000000000000000000000017000000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/test-base-plugin/src/main/java/de/saumya/mojo/tests/AbstractTestScriptFactory.java./jruby-maven-plugins-1.1.5.ds1.orig/test-base-plugin/src/main/java/de/saumya/mojo/tests/AbstractTes0000644000000000000000000000435112674201751030072 0ustar package de.saumya.mojo.tests; import java.io.File; import java.io.IOException; import java.lang.reflect.Method; import java.util.List; import java.util.Properties; import org.codehaus.plexus.util.FileUtils; public abstract class AbstractTestScriptFactory implements TestScriptFactory { protected List classpathElements; protected File summaryReport; protected File outputDir; protected File baseDir; protected File sourceDir; protected File reportPath; protected Properties systemProperties; protected File gemHome; protected File[] gemPaths; public void setClasspathElements(List classpathElements) { this.classpathElements = classpathElements; } public void setSummaryReport(File summaryReport) { this.summaryReport = summaryReport; } public void setOutputDir(File outputDir) { this.outputDir = outputDir; } public void setBaseDir(File baseDir) { this.baseDir = baseDir == null ? new File(".") : baseDir; } public void setSourceDir(File sourceDir) { this.sourceDir = sourceDir; } public void setReportPath(File reportPath) { this.reportPath = reportPath; } public void setSystemProperties(Properties systemProperties) { this.systemProperties = systemProperties; } public void setGemHome(File gemHome) { this.gemHome = gemHome; } public void setGemPaths(File[] gemPaths) { this.gemPaths = gemPaths; } protected abstract String getScriptName(); public File getScriptFile() { return new File(new File(outputDir, "bin"), getScriptName()); } public void emit() throws IOException { String script = getFullScript(); File scriptFile = getScriptFile(); scriptFile.getParentFile().mkdirs(); FileUtils.fileWrite(scriptFile.getAbsolutePath(), "UTF-8", script); try { // use reflection so it compiles with java1.5 as well but does not set executable Method m = scriptFile.getClass().getMethod("setExecutable", boolean.class); m.invoke(scriptFile, new Boolean(true)); } catch (Exception e) { //ignore for the time being } } } ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/test-base-plugin/src/main/java/de/saumya/mojo/tests/JRubyRun.java./jruby-maven-plugins-1.1.5.ds1.orig/test-base-plugin/src/main/java/de/saumya/mojo/tests/JRubyRun.ja0000644000000000000000000000326012674201751027762 0ustar package de.saumya.mojo.tests; import java.util.ArrayList; import java.util.List; import de.saumya.mojo.jruby.JRubyVersion; import de.saumya.mojo.jruby.JRubyVersion.Mode; public class JRubyRun { public static class Result { public boolean success; public String message; } public final Mode[] modes; public final JRubyVersion version; public final boolean isDefaultModeOnly; final Result[] results = new Result[Mode.values().length]; private static Mode[] filter( JRubyVersion version, Mode[] modes ) { List result = new ArrayList(); for( Mode m: modes ) { if ( version.hasMode( m ) ) { result.add( m ); } } return result.toArray( new Mode[ result.size() ] ); } public JRubyRun( JRubyVersion version ){ this( true, version, version.defaultMode() ); } public JRubyRun( JRubyVersion version, Mode... modes ){ this( false, version, modes ); } public JRubyRun( boolean isDefault, JRubyVersion version, Mode... modes ){ this.modes = modes.length == 0 ? new Mode[] { version.defaultMode() }: filter( version, modes ); this.version = version; this.isDefaultModeOnly = isDefault; } public Result result(Mode mode){ return results[ mode.ordinal() ]; } public void setResult(Mode mode, Result result){ results[mode == null ? version.defaultMode().ordinal() : mode.ordinal()] = result; } public String toString(Mode mode){ Result result = result(mode); return "jruby-" + version + " mode " + mode + ": " + result.message; } } ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/test-base-plugin/src/main/java/de/saumya/mojo/tests/TestScriptFactory.java./jruby-maven-plugins-1.1.5.ds1.orig/test-base-plugin/src/main/java/de/saumya/mojo/tests/TestScriptF0000644000000000000000000000123712674201751030065 0ustar package de.saumya.mojo.tests; import java.io.File; import java.io.IOException; import java.util.List; import java.util.Properties; public interface TestScriptFactory { void setBaseDir(File baseDir); void setSummaryReport(File summaryReport); void setOutputDir(File outputDir); void setSourceDir(File sourceDir); void setReportPath(File reportPath); void setClasspathElements(List classpathElements); void setSystemProperties(Properties systemProperties); void setGemHome(File gemHome); void setGemPaths(File[] gemPaths); File getScriptFile(); String getCoreScript(); String getFullScript() throws IOException; void emit() throws IOException; } ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/test-base-plugin/src/main/java/de/saumya/mojo/tests/TestResultManager.java./jruby-maven-plugins-1.1.5.ds1.orig/test-base-plugin/src/main/java/de/saumya/mojo/tests/TestResultM0000644000000000000000000000714012674201751030105 0ustar package de.saumya.mojo.tests; import java.io.File; import java.io.IOException; import java.text.MessageFormat; import org.codehaus.plexus.util.FileUtils; import de.saumya.mojo.jruby.JRubyVersion; import de.saumya.mojo.jruby.JRubyVersion.Mode; import de.saumya.mojo.tests.JRubyRun.Result; public class TestResultManager { enum ResultEnum { TESTS, ASSERTIONS, FAILURES, ERRORS, SKIPS } private final String projectName; private final File testReportDirectory; private final File summaryReport; private final String filename; public TestResultManager(File summaryReport){ this(null, null, null, summaryReport); } public TestResultManager(String projectName, String filename, File testReportDirectory, File summaryReport){ this.projectName = projectName; this.filename = filename == null ? null : "TEST-" + filename; this.testReportDirectory = testReportDirectory; this.summaryReport = summaryReport; } public Result generateReports(Mode mode, JRubyVersion version, final File outputfile) throws IOException { Result result = new Result(); String time = null; for (Object lineObj : FileUtils.loadFile(outputfile)) { String line = lineObj.toString(); if (line.contains("Finished")) { time = line.replaceFirst(",.*$", "").replaceAll("[a-zA-Z]+", "").trim(); } if (line.contains("failures")) { result.message = line; int[] vector = new int[5]; int i = 0; String statusLine = line.replaceAll("[a-z]+,?", ""); for (String n : statusLine.split("\\s+")) { if (i < vector.length) vector[i++] = Integer.parseInt(n); } result.success = (vector[ResultEnum.FAILURES.ordinal()] == 0) && (vector[ResultEnum.ERRORS.ordinal()] == 0); if (filename != null || summaryReport != null) { // TODO should be a real report with testcases String surefireXml = MessageFormat .format("\n" + "\n" + "\n", time, vector[ResultEnum.ERRORS.ordinal()], vector[ResultEnum.TESTS.ordinal()], vector[ResultEnum.SKIPS.ordinal()], vector[ResultEnum.FAILURES.ordinal()], this.projectName); if (filename != null) { testReportDirectory.mkdirs(); String filename = this.filename + (version == null ? "" : "-" + version ) + (mode == null ? "" : mode.flag) + ".xml"; FileUtils.fileWrite(new File(testReportDirectory, filename).getAbsolutePath(), "UTF-8", surefireXml); } if (summaryReport != null) { FileUtils.fileWrite(summaryReport.getAbsolutePath(), "UTF-8", surefireXml); } } return result; } } result.message = "did not find test summary"; result.success = false; return result; } } ././@LongLink0000644000000000000000000000017500000000000011606 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/test-base-plugin/src/main/java/de/saumya/mojo/tests/AbstractMavenTestScriptFactory.java./jruby-maven-plugins-1.1.5.ds1.orig/test-base-plugin/src/main/java/de/saumya/mojo/tests/AbstractMav0000644000000000000000000001344212674201751030063 0ustar package de.saumya.mojo.tests; import java.io.File; import java.net.MalformedURLException; import java.net.URL; public abstract class AbstractMavenTestScriptFactory extends AbstractTestScriptFactory { public String getFullScript() throws MalformedURLException { StringBuilder builder = new StringBuilder(); getInterpreterScript(builder); getPrologScript(builder); getRubygemsSetupScript(builder); getSystemPropertiesScript(builder); builder.append(getPluginClasspathScript()); getTestClasspathSetupScript(builder); getConstantsConfigScript(builder); getRunnerScript(builder); getResultsScript(builder); return builder.toString(); } private void getSystemPropertiesScript(StringBuilder builder) { if (systemProperties.keySet().isEmpty()) { return; } builder.append("# Set up system-properties for running outside of maven\n"); builder.append("\n"); for (Object propName : systemProperties.keySet()) { String propValue = systemProperties.getProperty(propName.toString()); builder.append("Java::java.lang::System.setProperty( %q(" + propName.toString() + "), %q(" + propValue + ") )\n"); } builder.append("\n"); } private void getConstantsConfigScript(StringBuilder builder) { builder.append("# Constants used for configuration and execution\n"); builder.append("\n"); builder.append("BASE_DIR=%q(" + sanitize(baseDir.getAbsolutePath()) + ")\n"); builder.append("SOURCE_DIR=%q(" + sanitize(sourceDir.getAbsolutePath()) + ")\n"); builder.append("TARGET_DIR=%q(" + sanitize(outputDir.getAbsolutePath()) + ")\n"); builder.append("REPORT_PATH=%q(" + sanitize(reportPath.getAbsolutePath()) + ")\n"); if (summaryReport != null) { builder.append("SUMMARY_REPORT=%q(" + sanitize(summaryReport.getAbsolutePath()) + ")\n"); } else { builder.append("SUMMARY_REPORT=nil\n"); } builder.append("\n"); builder.append("$: << File.join( BASE_DIR, 'lib' )\n"); builder.append("$: << SOURCE_DIR.sub( /\\*.*$/, '' )\n"); builder.append("\n"); } protected abstract void getRunnerScript(StringBuilder builder); public String getCoreScript() { StringBuilder builder = new StringBuilder(); getPrologScript(builder); getConstantsConfigScript(builder); getRunnerScript(builder); return builder.toString(); } protected void getResultsScript(StringBuilder builder) { builder.append("exit RESULT if defined? RESULT\n"); builder.append("\n"); builder.append("# A little exit code magic\n"); builder.append("\n"); builder.append("if File.new(REPORT_PATH, 'r').read =~ /, 0 failures/ \n"); builder.append(" exit 0\n" ); builder.append("else\n"); builder.append(" exit 1\n" ); builder.append("end\n"); builder.append("\n"); } private void getInterpreterScript(StringBuilder builder) { builder.append("#!/usr/bin/env jruby\n"); builder.append("\n"); } private void getPrologScript(StringBuilder builder) { builder.append("require %(java)\n"); builder.append("require %(jruby)\n"); builder.append("\n"); } private void getRubygemsSetupScript(StringBuilder builder) { if (gemHome == null && gemPaths == null) { return; } builder.append("# Set up GEM_HOME and GEM_PATH for running outside of maven\n"); builder.append("\n"); if (gemHome != null) { builder.append("ENV['GEM_HOME']=%q(" + gemHome + ")\n"); } if (gemPaths != null) { builder.append("ENV['GEM_PATH']=%q("); String separator = ""; for(File path: gemPaths) { builder.append(separator + path); if (separator.length() == 0){ separator = System.getProperty("path.separator"); } } builder.append(")\n"); } builder.append("\n"); } private void getTestClasspathSetupScript(StringBuilder builder) { builder.append("# Set up the classpath for running outside of maven\n"); builder.append("\n"); builder.append("def add_classpath_element(element)\n"); builder.append(" JRuby.runtime.jruby_class_loader.addURL( Java::java.net::URL.new( element ) )\n"); builder.append("end\n"); builder.append("\n"); for (String path : classpathElements) { if (!(path.endsWith("jar") || path.endsWith("/"))) { path = path + "/"; } builder.append("add_classpath_element(%Q( file://" + sanitize(path) + " ))\n"); } builder.append("\n"); } private String sanitize(String path) { String sanitized = path.replaceAll( "\\\\", "/" ); if ( sanitized.matches( "^[a-z]:.*" ) ) { sanitized = sanitized.substring(0,1).toUpperCase() + sanitized.substring(1); } return sanitized; } protected String getPluginClasspathScript() { String pathToClass = getClass().getName().replaceAll("\\.", "/") + ".class"; URL here = getClass().getClassLoader().getResource(pathToClass); String herePath = here.getPath(); if (herePath.startsWith("file:")) { herePath = herePath.substring(5); int bangLoc = herePath.indexOf("!"); if (bangLoc > 0) { herePath = herePath.substring(0, bangLoc); } } if (herePath.endsWith(".jar")) { return "require %q(" + herePath + ")\n"; } else { return "$: << %q(" + herePath + ")\n"; } } } ./jruby-maven-plugins-1.1.5.ds1.orig/test-base-plugin/pom.xml0000644000000000000000000000104212674201751020606 0ustar 4.0.0 gem-parent-mojo de.saumya.mojo 1.1.5 ../gem-parent-mojo/pom.xml test-base-plugin Test Base Plugin ./jruby-maven-plugins-1.1.5.ds1.orig/bundler-maven-plugin/0000755000000000000000000000000012674201751020144 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/bundler-maven-plugin/src/0000755000000000000000000000000012674201751020733 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/bundler-maven-plugin/src/main/0000755000000000000000000000000012674201751021657 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/bundler-maven-plugin/src/main/java/0000755000000000000000000000000012674201751022600 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/bundler-maven-plugin/src/main/java/de/0000755000000000000000000000000012674201751023170 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/bundler-maven-plugin/src/main/java/de/saumya/0000755000000000000000000000000012674201751024467 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/bundler-maven-plugin/src/main/java/de/saumya/mojo/0000755000000000000000000000000012674201751025433 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/bundler-maven-plugin/src/main/java/de/saumya/mojo/bundler/0000755000000000000000000000000012674201751027066 5ustar ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/bundler-maven-plugin/src/main/java/de/saumya/mojo/bundler/UpdateMojo.java./jruby-maven-plugins-1.1.5.ds1.orig/bundler-maven-plugin/src/main/java/de/saumya/mojo/bundler/Updat0000644000000000000000000000255012674201751030070 0ustar package de.saumya.mojo.bundler; import java.io.IOException; import org.apache.maven.plugin.MojoExecutionException; import de.saumya.mojo.gem.AbstractGemMojo; import de.saumya.mojo.ruby.gems.GemException; import de.saumya.mojo.ruby.script.Script; import de.saumya.mojo.ruby.script.ScriptException; import org.apache.maven.plugins.annotations.LifecyclePhase; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.plugins.annotations.ResolutionScope; /** * maven wrapper around the bundler update command. */ @Mojo(name = "update", defaultPhase = LifecyclePhase.INITIALIZE, requiresDependencyResolution = ResolutionScope.TEST) public class UpdateMojo extends AbstractGemMojo { /** * arguments for the bundler command. */ @Parameter(property = "bundler.args") private String bundlerArgs; @Override public void executeWithGems() throws MojoExecutionException, ScriptException, IOException, GemException { final Script script = this.factory.newScriptFromSearchPath("bundle"); script.addArg("update"); if (this.bundlerArgs != null) { script.addArgs(this.bundlerArgs); } if (this.args != null) { script.addArgs(this.args); } script.executeIn(launchDirectory()); } } ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/bundler-maven-plugin/src/main/java/de/saumya/mojo/bundler/InstallMojo.java./jruby-maven-plugins-1.1.5.ds1.orig/bundler-maven-plugin/src/main/java/de/saumya/mojo/bundler/Insta0000644000000000000000000002676012674201751030102 0ustar package de.saumya.mojo.bundler; import java.io.File; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.lang.reflect.Method; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.List; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugins.annotations.LifecyclePhase; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.plugins.annotations.ResolutionScope; import org.codehaus.plexus.util.FileUtils; import org.codehaus.plexus.util.IOUtil; import de.saumya.mojo.gem.AbstractGemMojo; import de.saumya.mojo.ruby.gems.GemException; import de.saumya.mojo.ruby.script.Script; import de.saumya.mojo.ruby.script.ScriptException; /** * maven wrapper around the bundler install command. */ @Mojo(name = "install", defaultPhase = LifecyclePhase.INITIALIZE, requiresDependencyResolution = ResolutionScope.TEST) public class InstallMojo extends AbstractGemMojo { /** * arguments for the bundler command. */ @Parameter(property = "bundler.args") private String bundlerArgs; @Parameter(property = "bundler.binstubs", defaultValue = "${project.build.directory}/bin") private File binStubs; @Parameter( property = "bundler.binstubs.shebang", defaultValue = "jruby") private String sheBang; /** * The classpath elements of the project being tested. */ @Parameter(defaultValue = "${project.testClasspathElements", required = true, readonly = true) protected List classpathElements; /** * Determine if --local should used. */ @Parameter(property = "bundler.local", defaultValue = "true") protected boolean local; /** * Determine if --quiet should used. */ @Parameter( property = "bundler.quiet", defaultValue = "true") protected boolean quiet; private String sha1(String text) { MessageDigest md = newSha1Digest(); try { md.update(text.getBytes("UTF-8")); } catch (UnsupportedEncodingException e) { throw new RuntimeException("should not happen", e); } return toHex(md.digest()); } private MessageDigest newSha1Digest() { MessageDigest md; try { md = MessageDigest.getInstance("SHA-1"); } catch (NoSuchAlgorithmException e) { throw new RuntimeException("error getting sha1 instance", e); } return md; } private String toHex(byte[] data) { StringBuilder buf = new StringBuilder();//data.length * 2); for (byte b: data) { if(b < 0){ buf.append(Integer.toHexString(256 + b)); } else if(b < 16) { buf.append('0').append(Integer.toHexString(b)); } else { buf.append(Integer.toHexString(b)); } } return buf.toString(); } @Override public void executeWithGems() throws MojoExecutionException, ScriptException, IOException, GemException { if(project.getFile() != null){ String pomSha1 = sha1(FileUtils.fileRead(project.getFile())); File sha1 = new File(project.getBuild().getDirectory(), project.getFile().getName() + ".sha1"); if(sha1.exists()){ String oldPomSha1 = FileUtils.fileRead(sha1); if (pomSha1.equals(oldPomSha1)) { if(jrubyVerbose){ getLog().info("skip bundler install since pom did not change since last run"); } return; } else{ FileUtils.fileWrite(sha1, pomSha1); } } else{ // just do the timestamping if there is target dir if (sha1.getParentFile().exists()) { FileUtils.fileWrite(sha1, pomSha1); } } } final Script script = this.factory.newScriptFromSearchPath("bundle"); script.addArg("install"); if ( this.quiet ) { script.addArg("--quiet"); } if ( this.local ) { script.addArg("--local"); } if (this.bundlerArgs != null) { script.addArgs(this.bundlerArgs); } if (this.args != null) { script.addArgs(this.args); } script.executeIn(launchDirectory()); generateBinStubs(); } private void generateBinStubs() throws IOException { if(binStubs != null){ binStubs.mkdirs(); { noBundlerSetupStub("bundler", "bundle", true); } { File setupFile = new File(binStubs, "setup"); RubyStringBuilder builder = new RubyStringBuilder(); this.getPrologScript(builder); this.getHistoryLogScript(builder); this.getTestClasspathSetupScript(builder); this.getRubygemsSetupScript(builder); FileUtils.fileWrite(setupFile, builder.toString()); } String sep = System.getProperty("line.separator"); String stub = IOUtil.toString(Thread.currentThread().getContextClassLoader().getResourceAsStream("stub")) + sep; for( File f: gemsConfig.getBinDirectory().listFiles()){ if (f.getName().equals("bundle")){ continue; } if (f.getName().equals("rmvn")){ noBundlerSetupStub("ruby-maven", "rmvn", false); continue; } if (f.getName().equals("gwt")){ noBundlerSetupStub("ruby-maven", "gwt", false); continue; } if (f.getName().equals("jetty-run")){ noBundlerSetupStub("ruby-maven", "jetty-run", false); continue; } String[] lines = FileUtils.fileRead(f).split(sep); File binstubFile = new File(binStubs, f.getName()); if(!binstubFile.exists()){ if(jrubyVerbose){ getLog().info("create bin stub " + binstubFile); } FileUtils.fileWrite(binstubFile, stub + lines[lines.length - 1].replaceFirst(", version", "")); setExecutable(binstubFile); } } } } private void noBundlerSetupStub(String gem, String binFile, boolean needsClasspath) throws IOException { File file = new File(binStubs, binFile); // TODO make a stub from resource RubyStringBuilder script = new RubyStringBuilder(); script.append("#!/usr/bin/env ").appendLine(sheBang); if (needsClasspath) { script.appendLine("require 'pathname'"); script.appendLine("load(File.expand_path('../setup', Pathname.new(__FILE__).realpath))"); } this.getHistoryLogScript(script); this.getRubygemsSetupScript(script); script.appendLine("require 'rubygems'"); script.append("load Gem.bin_path('").append(gem).append("', '").append(binFile).appendLine("')"); FileUtils.fileWrite(file, script.toString()); setExecutable(file); } private void setExecutable(File stubFile) { try { // use reflection so it compiles with java1.5 as well but does not set executable Method m = stubFile.getClass().getDeclaredMethod("setExecutable", boolean.class); m.invoke(stubFile, new Boolean(true)); } catch (Exception e) { e.printStackTrace(); getLog().warn("can not set executable flag: " + stubFile.getAbsolutePath() + " (" + e.getMessage() + ")"); } } //TODO from rspec mojo - factor out to common! private void getTestClasspathSetupScript(RubyStringBuilder builder) { builder.appendLine("if defined? JRUBY_VERSION"); builder.appendLine(" # Set up the classpath for running outside of maven"); builder.appendLine(); builder.appendLine(" def add_classpath_element(element)"); builder.appendLine(" JRuby.runtime.jruby_class_loader.addURL( Java::java.net::URL.new( element ) )"); builder.appendLine(" end"); builder.appendLine(); for (String path : classpathElements) { if (!(path.endsWith("jar") || path.endsWith("/"))) { path = path + "/"; } if(!path.matches("jruby-complete-")){ builder.appendLine(" add_classpath_element(%Q( file://" + sanitize(path) + " ))"); } } builder.appendLine("end"); builder.appendLine(); } //TODO from rspec mojo - factor out to common! private void getRubygemsSetupScript(RubyStringBuilder builder) { File[] gemPaths = gemsConfig.getGemPath(); if (gemHome == null && gemPaths == null) { return; } builder.appendLine("# Set up GEM_HOME and GEM_PATH for running outside of maven"); builder.appendLine(); if (gemHome != null) { builder.appendLine("ENV['GEM_HOME']='" + gemHome + "'"); } if (gemPaths != null) { builder.append("ENV['GEM_PATH']='"); String sep = ""; for(File path: gemPaths) { builder.append(sep + path); sep = System.getProperty("path.separator"); } builder.appendLine("'"); } builder.appendLine(); } //TODO from rspec mojo - factor out to common! private String sanitize(String path) { String sanitized = path.replaceAll( "\\\\", "/" ); if ( sanitized.matches( "^[a-z]:.*" ) ) { sanitized = sanitized.substring(0,1).toUpperCase() + sanitized.substring(1); } return sanitized; } //TODO from rspec mojo - factor out to common! private void getPrologScript(RubyStringBuilder builder) { builder.appendLine("require %(java) if defined? JRUBY_VERSION"); builder.appendLine(); } static class RubyStringBuilder { private final StringBuilder builder = new StringBuilder(); private static final String LINE_SEPARATOR = System.getProperty("line.separator"); public RubyStringBuilder append(String val){ builder.append(val); return this; } public RubyStringBuilder appendLine(){ builder.append(LINE_SEPARATOR); return this; } public RubyStringBuilder appendLine(String val){ builder.append(val).append(LINE_SEPARATOR); return this; } public String toString(){ return builder.toString(); } } private void getHistoryLogScript(RubyStringBuilder builder) { builder.appendLine("log = File.join('log', 'history.log')"); builder.appendLine("if File.exists? File.dirname(log)"); builder.appendLine(" File.open(log, 'a') do |f|"); builder.appendLine(" f.puts \"#{$0.sub(/.*\\//, '')} #{ARGV.join ' '}\""); builder.appendLine(" end"); builder.appendLine("end"); builder.appendLine(); } } ./jruby-maven-plugins-1.1.5.ds1.orig/bundler-maven-plugin/src/main/resources/0000755000000000000000000000000012674201751023671 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/bundler-maven-plugin/src/main/resources/stub0000644000000000000000000000064112674201751024572 0ustar #!/usr/bin/env jruby # # This file was generated by Bundler and (Ruby-)Maven. # # The application which is installed as part of a gem, and # this file is here to facilitate running it. # require 'pathname' load(File.expand_path('../setup', Pathname.new(__FILE__).realpath)) ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../../Gemfile", Pathname.new(__FILE__).realpath) require 'rubygems' require 'bundler/setup' ./jruby-maven-plugins-1.1.5.ds1.orig/bundler-maven-plugin/src/it/0000755000000000000000000000000012674201751021347 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/bundler-maven-plugin/src/it/settings.xml0000644000000000000000000000220412674201751023727 0ustar it-repo true local.central @localRepositoryUrl@ true true local.rubygems @localRepositoryUrl@ true false local.central @localRepositoryUrl@ true true ./jruby-maven-plugins-1.1.5.ds1.orig/bundler-maven-plugin/src/it/bundler-pom/0000755000000000000000000000000012674201751023573 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/bundler-maven-plugin/src/it/bundler-pom/verify.bsh0000644000000000000000000000030412674201751025572 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; File f = new File( basedir, "Gemfile.lock" ); if ( !f.exists() ) { throw new RuntimeException( "file does not exists: " + f ); } ./jruby-maven-plugins-1.1.5.ds1.orig/bundler-maven-plugin/src/it/bundler-pom/Gemfile0000644000000000000000000000001712674201751025064 0ustar gem 'rubyzip2' ./jruby-maven-plugins-1.1.5.ds1.orig/bundler-maven-plugin/src/it/bundler-pom/setup.bsh0000644000000000000000000000011012674201751025421 0ustar import java.io.*; new File( basedir, "Gemfile.lock").delete() || true; ./jruby-maven-plugins-1.1.5.ds1.orig/bundler-maven-plugin/src/it/bundler-pom/pom.xml0000644000000000000000000000235012674201751025110 0ustar 4.0.0 de.saumya.mojo bundler testing rubygems-releases http://rubygems-proxy.torquebox.org/releases rubygems rubyzip2 2.0.1 gem rubygems bundler 1.3.5 gem de.saumya.mojo bundler-maven-plugin @project.version@ install ./jruby-maven-plugins-1.1.5.ds1.orig/bundler-maven-plugin/src/it/bundler-pom/invoker.properties0000644000000000000000000000007512674201751027370 0ustar invoker.goals = bundler:install invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/bundler-maven-plugin/pom.xml0000644000000000000000000000433312674201751021464 0ustar 4.0.0 gem-parent-mojo de.saumya.mojo 1.1.5 ../gem-parent-mojo/pom.xml bundler-maven-plugin maven-plugin Bundler Maven Mojo true integration-test true all false org.eclipse.m2e lifecycle-mapping 1.0.0 org.apache.maven.plugins maven-dependency-plugin [2.1,) unpack-dependencies org.codehaus.mojo build-helper-maven-plugin [1.4,) add-source ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/0000755000000000000000000000000012674201751017574 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/0000755000000000000000000000000012674201751020363 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/0000755000000000000000000000000012674201751020777 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_latest_rails_sqlite3/0000755000000000000000000000000012674201751026002 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_latest_rails_sqlite3/verify.bsh0000644000000000000000000000220212674201751030000 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; File target = new File( basedir, "target"); // File file = new File( target, "index.html" ); // if ( !file.isFile() ) // { // throw new FileNotFoundException( "Could not find: " + file ); // } // File users = new File( target, "users.html" ); // if ( !users.isFile() ) // { // throw new FileNotFoundException( "Could not find: " + users ); // } // File file = new File( target, "new.html" ); // if ( !file.isFile() ) // { // throw new FileNotFoundException( "Could not find: " + file ); // } String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); if ( !log.contains( "No POM" ) ) { throw new RuntimeException( "log file does not contain 'No POM'" ); } // String usersFile = FileUtils.fileRead( users ); // if ( !usersFile.contains( "

    Listing users

    " ) ) // { // throw new RuntimeException( "users file does not contain '

    Listing users

    '" ); // } // String newFile = FileUtils.fileRead( file ); // if ( !newFile.contains( "value=\"Create" ) ) // { // throw new RuntimeException( "new file does not contain 'value=\"Create'" ); // } ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_latest_rails_sqlite3/pom-server.xml./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_latest_rails_sqlite3/pom-server.xm0000644000000000000000000000371112674201751030451 0ustar 4.0.0 rails rails_app 0.0.0 pom-base.xml server war 8080 org.mortbay.jetty jetty-maven-plugin ${jetty.version} foo 9999 ${jetty.port} start-jetty pre-integration-test run-war true stop-jetty post-integration-test stop maven-antrun-plugin 1.3 get-files integration-test run ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_latest_rails_sqlite3/pom2pom.rb0000644000000000000000000000054312674201751027722 0ustar require 'fileutils' Dir.glob("rails_app/*").each do |f| path = f.sub(/rails_app./, '') FileUtils.rm_rf(path) FileUtils.mv(f, path) end FileUtils.rm_r("rails_app") FileUtils.rm_r(File.join("target", "jetty")) pom = File.read('pom.xml').sub(/>warpom<') File.open('pom-base.xml', 'w') { |f| f.print(pom) } File.rename('pom-server.xml', 'pom.xml') ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_latest_rails_sqlite3/setup.bsh0000644000000000000000000000037412674201751027644 0ustar import java.io.*; new File( new File( basedir, "script" ), "rails" ).delete(); new File( basedir, "script" ).delete(); new File( basedir, "Gemfile" ).delete(); new File( basedir, "Gemfile.maven" ).delete(); new File( basedir, "pom.xml").delete(); ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_latest_rails_sqlite3/test.properties./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_latest_rails_sqlite3/test.properti0000644000000000000000000000027112674201751030547 0ustar app_path=rails_app rails.args=-f # otherwise there is an NPE gem.includeOpenSSL=false jruby.file=pom2pom.rb task=db:create db:migrate generator=scaffold generate.args=user name:string ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_latest_rails_sqlite3/pom.xml0000644000000000000000000000060012674201751027313 0ustar 4.0.0 com.example no-pom-placeholder 0.0.0 ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_latest_rails_sqlite3/invoker.properties./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_latest_rails_sqlite3/invoker.prope0000644000000000000000000000063012674201751030525 0ustar invoker.goals = de.saumya.mojo:rails3-maven-plugin:${project.version}:new de.saumya.mojo:jruby-maven-plugin:${project.version}:jruby invoker.goals.2 = de.saumya.mojo:bundler-maven-plugin:${project.version}:install de.saumya.mojo:rails3-maven-plugin:${project.version}:generate invoker.goals.3 = de.saumya.mojo:rails3-maven-plugin:${project.version}:rake #invoker.goals.4 = verify invoker.mavenOpts = -client ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_latest_rails_sqlite3/#test.properties#./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_latest_rails_sqlite3/#test.propert0000644000000000000000000000027012674201751030440 0ustar app_path=rails_app rails.args=-f # otherwise there is an NPE gem.includeOpenSSL=false jruby.file=pom2pom.rb task=db:create db:migrate generator=scaffold generate.args=user name:string ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/pending_new_rails_3_1_1_sqlite3_offline/./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/pending_new_rails_3_1_1_sqlite3_offlin0000755000000000000000000000000012674201751030272 5ustar ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/pending_new_rails_3_1_1_sqlite3_offline/verify.bsh./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/pending_new_rails_3_1_1_sqlite3_offlin0000644000000000000000000000206712674201751030301 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; File target = new File( basedir, "target"); File file = new File( target, "index.html" ); if ( !file.isFile() ) { throw new FileNotFoundException( "Could not find: " + file ); } File users = new File( target, "users.html" ); if ( !users.isFile() ) { throw new FileNotFoundException( "Could not find: " + users ); } File file = new File( target, "new.html" ); if ( !file.isFile() ) { throw new FileNotFoundException( "Could not find: " + file ); } String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); if ( !log.contains( "No POM" ) ) { throw new RuntimeException( "log file does not contain 'No POM'" ); } String usersFile = FileUtils.fileRead( users ); if ( !usersFile.contains( "

    Listing users

    " ) ) { throw new RuntimeException( "users file does not contain '

    Listing users

    '" ); } String newFile = FileUtils.fileRead( file ); if ( !newFile.contains( "value=\"Create" ) ) { throw new RuntimeException( "new file does not contain 'value=\"Create'" ); } ././@LongLink0000644000000000000000000000016500000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/pending_new_rails_3_1_1_sqlite3_offline/pom-server.xml./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/pending_new_rails_3_1_1_sqlite3_offlin0000644000000000000000000000371112674201751030276 0ustar 4.0.0 rails rails_app 0.0.0 pom-base.xml server war 8080 org.mortbay.jetty jetty-maven-plugin ${jetty.version} foo 9999 ${jetty.port} start-jetty pre-integration-test run-war true stop-jetty post-integration-test stop maven-antrun-plugin 1.3 get-files integration-test run ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/pending_new_rails_3_1_1_sqlite3_offline/pom2pom.rb./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/pending_new_rails_3_1_1_sqlite3_offlin0000644000000000000000000000054312674201751030276 0ustar require 'fileutils' Dir.glob("rails_app/*").each do |f| path = f.sub(/rails_app./, '') FileUtils.rm_rf(path) FileUtils.mv(f, path) end FileUtils.rm_r("rails_app") FileUtils.rm_r(File.join("target", "jetty")) pom = File.read('pom.xml').sub(/>warpom<') File.open('pom-base.xml', 'w') { |f| f.print(pom) } File.rename('pom-server.xml', 'pom.xml') ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/pending_new_rails_3_1_1_sqlite3_offline/setup.bsh./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/pending_new_rails_3_1_1_sqlite3_offlin0000644000000000000000000000037412674201751030300 0ustar import java.io.*; new File( new File( basedir, "script" ), "rails" ).delete(); new File( basedir, "script" ).delete(); new File( basedir, "Gemfile" ).delete(); new File( basedir, "Gemfile.maven" ).delete(); new File( basedir, "pom.xml").delete(); ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/pending_new_rails_3_1_1_sqlite3_offline/test.properties./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/pending_new_rails_3_1_1_sqlite3_offlin0000644000000000000000000000030212674201751030267 0ustar app_path=rails_app rails.args=-f rails.version=3.1.1 # otherwise there is an NPE gem.includeOpenSSL=false jruby.file=pom2pom.rb task=db:migrate generator=scaffold generate.args=user name:string ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/pending_new_rails_3_1_1_sqlite3_offline/pom.xml./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/pending_new_rails_3_1_1_sqlite3_offlin0000644000000000000000000000060012674201751030270 0ustar 4.0.0 com.example no-pom-placeholder 0.0.0 ././@LongLink0000644000000000000000000000017100000000000011602 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/pending_new_rails_3_1_1_sqlite3_offline/invoker.properties./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/pending_new_rails_3_1_1_sqlite3_offlin0000644000000000000000000000056012674201751030275 0ustar invoker.goals = de.saumya.mojo:rails3-maven-plugin:${project.version}:new de.saumya.mojo:jruby-maven-plugin:${project.version}:jruby invoker.goals.2 = de.saumya.mojo:rails3-maven-plugin:${project.version}:generate invoker.goals.3 = de.saumya.mojo:rails3-maven-plugin:${project.version}:rake invoker.goals.4 = verify invoker.mavenOpts = -client #invoker.offline = true ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_rails_3_2_5_sqlite3/0000755000000000000000000000000012674201751025315 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_rails_3_2_5_sqlite3/verify.bsh0000644000000000000000000000206712674201751027324 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; File target = new File( basedir, "target"); File file = new File( target, "index.html" ); if ( !file.isFile() ) { throw new FileNotFoundException( "Could not find: " + file ); } File users = new File( target, "users.html" ); if ( !users.isFile() ) { throw new FileNotFoundException( "Could not find: " + users ); } File file = new File( target, "new.html" ); if ( !file.isFile() ) { throw new FileNotFoundException( "Could not find: " + file ); } String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); if ( !log.contains( "No POM" ) ) { throw new RuntimeException( "log file does not contain 'No POM'" ); } String usersFile = FileUtils.fileRead( users ); if ( !usersFile.contains( "

    Listing users

    " ) ) { throw new RuntimeException( "users file does not contain '

    Listing users

    '" ); } String newFile = FileUtils.fileRead( file ); if ( !newFile.contains( "value=\"Create" ) ) { throw new RuntimeException( "new file does not contain 'value=\"Create'" ); } ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_rails_3_2_5_sqlite3/pom-server.xml0000644000000000000000000000371112674201751030140 0ustar 4.0.0 rails rails_app 0.0.0 pom-base.xml server war 8080 org.mortbay.jetty jetty-maven-plugin ${jetty.version} foo 9999 ${jetty.port} start-jetty pre-integration-test run-war true stop-jetty post-integration-test stop maven-antrun-plugin 1.3 get-files integration-test run ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_rails_3_2_5_sqlite3/pom2pom.rb0000644000000000000000000000054312674201751027235 0ustar require 'fileutils' Dir.glob("rails_app/*").each do |f| path = f.sub(/rails_app./, '') FileUtils.rm_rf(path) FileUtils.mv(f, path) end FileUtils.rm_r("rails_app") FileUtils.rm_r(File.join("target", "jetty")) pom = File.read('pom.xml').sub(/>warpom<') File.open('pom-base.xml', 'w') { |f| f.print(pom) } File.rename('pom-server.xml', 'pom.xml') ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_rails_3_2_5_sqlite3/setup.bsh0000644000000000000000000000037412674201751027157 0ustar import java.io.*; new File( new File( basedir, "script" ), "rails" ).delete(); new File( basedir, "script" ).delete(); new File( basedir, "Gemfile" ).delete(); new File( basedir, "Gemfile.maven" ).delete(); new File( basedir, "pom.xml").delete(); ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_rails_3_2_5_sqlite3/test.properties./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_rails_3_2_5_sqlite3/test.propertie0000644000000000000000000000032212674201751030224 0ustar app_path=rails_app #orm=datamapper rails.args=-f rails.version=3.2.5 # otherwise there is an NPE gem.includeOpenSSL=false jruby.file=pom2pom.rb task=db:migrate generator=scaffold generate.args=user name:string ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_rails_3_2_5_sqlite3/pom.xml0000644000000000000000000000060012674201751026626 0ustar 4.0.0 com.example no-pom-placeholder 0.0.0 ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_rails_3_2_5_sqlite3/invoker.properties./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_rails_3_2_5_sqlite3/invoker.proper0000644000000000000000000000065712674201751030233 0ustar invoker.goals = de.saumya.mojo:rails3-maven-plugin:${project.version}:new de.saumya.mojo:jruby-maven-plugin:${project.version}:jruby invoker.goals.2 = de.saumya.mojo:bundler-maven-plugin:${project.version}:install de.saumya.mojo:rails3-maven-plugin:${project.version}:generate invoker.goals.3 = de.saumya.mojo:rails3-maven-plugin:${project.version}:rake invoker.goals.4 = verify invoker.mavenOpts = -client #invoker.offline = true ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_latest_rails_postgres/0000755000000000000000000000000012674201751026264 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_latest_rails_postgres/verify.bsh0000644000000000000000000000206712674201751030273 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; File target = new File( basedir, "target"); File file = new File( target, "index.html" ); if ( !file.isFile() ) { throw new FileNotFoundException( "Could not find: " + file ); } File users = new File( target, "users.html" ); if ( !users.isFile() ) { throw new FileNotFoundException( "Could not find: " + users ); } File file = new File( target, "new.html" ); if ( !file.isFile() ) { throw new FileNotFoundException( "Could not find: " + file ); } String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); if ( !log.contains( "No POM" ) ) { throw new RuntimeException( "log file does not contain 'No POM'" ); } String usersFile = FileUtils.fileRead( users ); if ( !usersFile.contains( "

    Listing users

    " ) ) { throw new RuntimeException( "users file does not contain '

    Listing users

    '" ); } String newFile = FileUtils.fileRead( file ); if ( !newFile.contains( "value=\"Create" ) ) { throw new RuntimeException( "new file does not contain 'value=\"Create'" ); } ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_latest_rails_postgres/pom-server.xml./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_latest_rails_postgres/pom-server.x0000644000000000000000000000371612674201751030563 0ustar 4.0.0 rails rails_app 0.0.0 pom-base.xml server war 8080 org.mortbay.jetty jetty-maven-plugin ${jetty.version} foo 9999 ${jetty.port} start-jetty pre-integration-test run-exploded true stop-jetty post-integration-test stop maven-antrun-plugin 1.3 get-files integration-test run ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_latest_rails_postgres/pom2pom.rb0000644000000000000000000000054312674201751030204 0ustar require 'fileutils' Dir.glob("rails_app/*").each do |f| path = f.sub(/rails_app./, '') FileUtils.rm_rf(path) FileUtils.mv(f, path) end FileUtils.rm_r("rails_app") FileUtils.rm_r(File.join("target", "jetty")) pom = File.read('pom.xml').sub(/>warpom<') File.open('pom-base.xml', 'w') { |f| f.print(pom) } File.rename('pom-server.xml', 'pom.xml') ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_latest_rails_postgres/setup.bsh0000644000000000000000000000037412674201751030126 0ustar import java.io.*; new File( new File( basedir, "script" ), "rails" ).delete(); new File( basedir, "script" ).delete(); new File( basedir, "Gemfile" ).delete(); new File( basedir, "Gemfile.maven" ).delete(); new File( basedir, "pom.xml").delete(); ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_latest_rails_postgres/test.properties./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_latest_rails_postgres/test.propert0000644000000000000000000000034712674201751030664 0ustar app_path=rails_app rails.args=-f database=postgres #gem.home=target/rubygems #gem.path=target/rubygems #rails.dir=rails_app jruby.file=pom2pom.rb task=db:drop db:create db:migrate generator=scaffold generate.args=user name:string ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_latest_rails_postgres/pom.xml0000644000000000000000000000060012674201751027575 0ustar 4.0.0 com.example no-pom-placeholder 0.0.0 ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_latest_rails_postgres/invoker.properties./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_latest_rails_postgres/invoker.prop0000644000000000000000000000056012674201751030644 0ustar invoker.goals = de.saumya.mojo:rails3-maven-plugin:${project.version}:new de.saumya.mojo:jruby-maven-plugin:${project.version}:jruby invoker.goals.2 = de.saumya.mojo:rails3-maven-plugin:${project.version}:generate invoker.goals.3 = de.saumya.mojo:rails3-maven-plugin:${project.version}:rake invoker.goals.4 = verify invoker.mavenOpts = -client #invoker.offline = true ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_rails_3_0_11_sqlite3_offline/0000755000000000000000000000000012674201751027072 5ustar ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_rails_3_0_11_sqlite3_offline/verify.bsh./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_rails_3_0_11_sqlite3_offline/verif0000644000000000000000000000206712674201751030135 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; File target = new File( basedir, "target"); File file = new File( target, "index.html" ); if ( !file.isFile() ) { throw new FileNotFoundException( "Could not find: " + file ); } File users = new File( target, "users.html" ); if ( !users.isFile() ) { throw new FileNotFoundException( "Could not find: " + users ); } File file = new File( target, "new.html" ); if ( !file.isFile() ) { throw new FileNotFoundException( "Could not find: " + file ); } String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); if ( !log.contains( "No POM" ) ) { throw new RuntimeException( "log file does not contain 'No POM'" ); } String usersFile = FileUtils.fileRead( users ); if ( !usersFile.contains( "

    Listing users

    " ) ) { throw new RuntimeException( "users file does not contain '

    Listing users

    '" ); } String newFile = FileUtils.fileRead( file ); if ( !newFile.contains( "value=\"Create" ) ) { throw new RuntimeException( "new file does not contain 'value=\"Create'" ); } ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_rails_3_0_11_sqlite3_offline/pom-server.xml./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_rails_3_0_11_sqlite3_offline/pom-s0000644000000000000000000000371112674201751030052 0ustar 4.0.0 rails rails_app 0.0.0 pom-base.xml server war 8080 org.mortbay.jetty jetty-maven-plugin ${jetty.version} foo 9999 ${jetty.port} start-jetty pre-integration-test run-war true stop-jetty post-integration-test stop maven-antrun-plugin 1.3 get-files integration-test run ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_rails_3_0_11_sqlite3_offline/pom2pom.rb./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_rails_3_0_11_sqlite3_offline/pom2p0000644000000000000000000000054312674201751030054 0ustar require 'fileutils' Dir.glob("rails_app/*").each do |f| path = f.sub(/rails_app./, '') FileUtils.rm_rf(path) FileUtils.mv(f, path) end FileUtils.rm_r("rails_app") FileUtils.rm_r(File.join("target", "jetty")) pom = File.read('pom.xml').sub(/>warpom<') File.open('pom-base.xml', 'w') { |f| f.print(pom) } File.rename('pom-server.xml', 'pom.xml') ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_rails_3_0_11_sqlite3_offline/setup.bsh./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_rails_3_0_11_sqlite3_offline/setup0000644000000000000000000000037412674201751030161 0ustar import java.io.*; new File( new File( basedir, "script" ), "rails" ).delete(); new File( basedir, "script" ).delete(); new File( basedir, "Gemfile" ).delete(); new File( basedir, "Gemfile.maven" ).delete(); new File( basedir, "pom.xml").delete(); ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_rails_3_0_11_sqlite3_offline/test.properties./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_rails_3_0_11_sqlite3_offline/test.0000644000000000000000000000031512674201751030051 0ustar app_path=rails_app rails.args=-f rails.version=3.0.11 gem.includeOpenSSL=false # otherwise there is an NPE jruby.file=pom2pom.rb task=db:create db:migrate generator=scaffold generate.args=user name:string ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_rails_3_0_11_sqlite3_offline/pom.xml./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_rails_3_0_11_sqlite3_offline/pom.x0000644000000000000000000000060012674201751030052 0ustar 4.0.0 com.example no-pom-placeholder 0.0.0 ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_rails_3_0_11_sqlite3_offline/invoker.properties./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_rails_3_0_11_sqlite3_offline/invok0000644000000000000000000000065612674201751030152 0ustar invoker.goals = de.saumya.mojo:rails3-maven-plugin:${project.version}:new de.saumya.mojo:jruby-maven-plugin:${project.version}:jruby invoker.goals.2 = de.saumya.mojo:bundler-maven-plugin:${project.version}:install de.saumya.mojo:rails3-maven-plugin:${project.version}:generate invoker.goals.3 = de.saumya.mojo:rails3-maven-plugin:${project.version}:rake invoker.goals.4 = verify invoker.mavenOpts = -client invoker.offline = true ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_latest_rails_mysql/0000755000000000000000000000000012674201751025563 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_latest_rails_mysql/verify.bsh0000644000000000000000000000206712674201751027572 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; File target = new File( basedir, "target"); File file = new File( target, "index.html" ); if ( !file.isFile() ) { throw new FileNotFoundException( "Could not find: " + file ); } File users = new File( target, "users.html" ); if ( !users.isFile() ) { throw new FileNotFoundException( "Could not find: " + users ); } File file = new File( target, "new.html" ); if ( !file.isFile() ) { throw new FileNotFoundException( "Could not find: " + file ); } String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); if ( !log.contains( "No POM" ) ) { throw new RuntimeException( "log file does not contain 'No POM'" ); } String usersFile = FileUtils.fileRead( users ); if ( !usersFile.contains( "

    Listing users

    " ) ) { throw new RuntimeException( "users file does not contain '

    Listing users

    '" ); } String newFile = FileUtils.fileRead( file ); if ( !newFile.contains( "value=\"Create" ) ) { throw new RuntimeException( "new file does not contain 'value=\"Create'" ); } ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_latest_rails_mysql/pom-server.xml0000644000000000000000000000371112674201751030406 0ustar 4.0.0 rails rails_app 0.0.0 pom-base.xml server war 8080 org.mortbay.jetty jetty-maven-plugin ${jetty.version} foo 9999 ${jetty.port} start-jetty pre-integration-test run-war true stop-jetty post-integration-test stop maven-antrun-plugin 1.3 get-files integration-test run ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_latest_rails_mysql/pom2pom.rb0000644000000000000000000000054312674201751027503 0ustar require 'fileutils' Dir.glob("rails_app/*").each do |f| path = f.sub(/rails_app./, '') FileUtils.rm_rf(path) FileUtils.mv(f, path) end FileUtils.rm_r("rails_app") FileUtils.rm_r(File.join("target", "jetty")) pom = File.read('pom.xml').sub(/>warpom<') File.open('pom-base.xml', 'w') { |f| f.print(pom) } File.rename('pom-server.xml', 'pom.xml') ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_latest_rails_mysql/setup.bsh0000644000000000000000000000037412674201751027425 0ustar import java.io.*; new File( new File( basedir, "script" ), "rails" ).delete(); new File( basedir, "script" ).delete(); new File( basedir, "Gemfile" ).delete(); new File( basedir, "Gemfile.maven" ).delete(); new File( basedir, "pom.xml").delete(); ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_latest_rails_mysql/test.properties0000644000000000000000000000033512674201751030661 0ustar app_path=rails_app rails.args=-f -d mysql #gem.home=target/rubygems #gem.path=target/rubygems #rails.dir=rails_app jruby.file=pom2pom.rb task=db:drop db:create db:migrate generator=scaffold generate.args=user name:string ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_latest_rails_mysql/pom.xml0000644000000000000000000000060012674201751027074 0ustar 4.0.0 com.example no-pom-placeholder 0.0.0 ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_latest_rails_mysql/invoker.properties./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_latest_rails_mysql/invoker.propert0000644000000000000000000000056212674201751030660 0ustar invoker.goals = de.saumya.mojo:rails3-maven-plugin:${project.version}:rails de.saumya.mojo:jruby-maven-plugin:${project.version}:jruby invoker.goals.2 = de.saumya.mojo:rails3-maven-plugin:${project.version}:generate invoker.goals.3 = de.saumya.mojo:rails3-maven-plugin:${project.version}:rake invoker.goals.4 = verify invoker.mavenOpts = -client #invoker.offline = true ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/0000755000000000000000000000000012674201751023205 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/verify.bsh0000644000000000000000000000207012674201751025206 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; File target = new File( basedir, "target"); File file = new File( target, "index.html" ); if ( !file.isFile() ) { throw new FileNotFoundException( "Could not find: " + file ); } File users = new File( target, "users.html" ); if ( !users.isFile() ) { throw new FileNotFoundException( "Could not find: " + users ); } File file = new File( target, "new.html" ); if ( !file.isFile() ) { throw new FileNotFoundException( "Could not find: " + file ); } String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); if ( !log.contains( "No POM" ) ) { throw new RuntimeException( "log file does not contain 'No POM'" ); } String usersFile = FileUtils.fileRead( users ); if ( !usersFile.contains( "

    Listing users

    " ) ) { throw new RuntimeException( "users file does not contain '

    Listing users

    '" ); } String newFile = FileUtils.fileRead( file ); if ( !newFile.contains( "value=\"Create" ) ) { throw new RuntimeException( "new file does not contain 'value=\"Create'" ); } ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/config/0000755000000000000000000000000012674201751024452 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/config/initializers/0000755000000000000000000000000012674201751027160 5ustar ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/config/initializers/secret_token.rb./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/config/initializers/secret0000644000000000000000000000076612674201751030401 0ustar # Be sure to restart your server when you modify this file. # Your secret key for verifying the integrity of signed cookies. # If you change this key, all old signed cookies will become invalid! # Make sure the secret is at least 30 characters and all random, # no regular words or you'll be exposed to dictionary attacks. Gemfile2pom::Application.config.secret_token = '34b39a37533b33972b85b89b5e304c16549bf09b3c98f9894adcdfa3419730759fc40ba5fc5a636628fed07907a16059edcbff559903ddd3cc299f9c46ef838d' ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/config/initializers/mime_types.rb./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/config/initializers/mime_t0000644000000000000000000000031512674201751030354 0ustar # Be sure to restart your server when you modify this file. # Add new mime types for use in respond_to blocks: # Mime::Type.register "text/richtext", :rtf # Mime::Type.register_alias "text/html", :iphone ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/config/initializers/inflections.rb./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/config/initializers/inflec0000644000000000000000000000057012674201751030345 0ustar # Be sure to restart your server when you modify this file. # Add new inflection rules using the following format # (all these examples are active by default): # ActiveSupport::Inflector.inflections do |inflect| # inflect.plural /^(ox)$/i, '\1en' # inflect.singular /^(ox)en/i, '\1' # inflect.irregular 'person', 'people' # inflect.uncountable %w( fish sheep ) # end ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/config/initializers/session_store.rb./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/config/initializers/sessio0000644000000000000000000000064312674201751030413 0ustar # Be sure to restart your server when you modify this file. Gemfile2pom::Application.config.session_store :cookie_store, :key => '_gemfile2pom_session' # Use the database for sessions instead of the cookie-based default, # which shouldn't be used to store highly confidential information # (create the session table with "rake db:sessions:create") # Gemfile2pom::Application.config.session_store :active_record_store ././@LongLink0000644000000000000000000000016500000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/config/initializers/backtrace_silencers.rb./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/config/initializers/backtr0000644000000000000000000000062412674201751030353 0ustar # Be sure to restart your server when you modify this file. # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. # Rails.backtrace_cleaner.remove_silencers! ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/config/locales/0000755000000000000000000000000012674201751026074 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/config/locales/en.yml0000644000000000000000000000032512674201751027221 0ustar # Sample localization file for English. Add more files in this directory for other locales. # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. en: hello: "Hello world" ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/config/environment.rb0000644000000000000000000000023312674201751027341 0ustar # Load the rails application require File.expand_path('../application', __FILE__) # Initialize the rails application Gemfile2pom::Application.initialize! ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/config/routes.rb0000644000000000000000000000342612674201751026325 0ustar Gemfile2pom::Application.routes.draw do resources :users # The priority is based upon order of creation: # first created -> highest priority. # Sample of regular route: # match 'products/:id' => 'catalog#view' # Keep in mind you can assign values other than :controller and :action # Sample of named route: # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase # This route can be invoked with purchase_url(:id => product.id) # Sample resource route (maps HTTP verbs to controller actions automatically): # resources :products # Sample resource route with options: # resources :products do # member do # get 'short' # post 'toggle' # end # # collection do # get 'sold' # end # end # Sample resource route with sub-resources: # resources :products do # resources :comments, :sales # resource :seller # end # Sample resource route with more complex sub-resources # resources :products do # resources :comments # resources :sales do # get 'recent', :on => :collection # end # end # Sample resource route within a namespace: # namespace :admin do # # Directs /admin/products/* to Admin::ProductsController # # (app/controllers/admin/products_controller.rb) # resources :products # end # You can have the root of your site routed with "root" # just remember to delete public/index.html. # root :to => "welcome#index" # See how all your routes lay out with "rake routes" # This is a legacy wild controller route that's not recommended for RESTful applications. # Note: This route will make all actions in every controller accessible via GET requests. # match ':controller(/:action(/:id(.:format)))' end ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/config/application.rb0000644000000000000000000000361112674201751027303 0ustar require File.expand_path('../boot', __FILE__) require 'rails/all' # If you have a Gemfile, require the gems listed there, including any gems # you've limited to :test, :development, or :production. Bundler.require(:default, Rails.env) if defined?(Bundler) module Gemfile2pom class Application < Rails::Application # Settings in config/environments/* take precedence over those specified here. # Application configuration should go into files in config/initializers # -- all .rb files in that directory are automatically loaded. # Custom directories with classes and modules you want to be autoloadable. # config.autoload_paths += %W(#{config.root}/extras) # Only load the plugins named here, in the order given (default is alphabetical). # :all can be used as a placeholder for all plugins not explicitly named. # config.plugins = [ :exception_notification, :ssl_requirement, :all ] # Activate observers that should always be running. # config.active_record.observers = :cacher, :garbage_collector, :forum_observer # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. # config.time_zone = 'Central Time (US & Canada)' # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] # config.i18n.default_locale = :de # JavaScript files you want as :defaults (application.js is always included). # config.action_view.javascript_expansions[:defaults] = %w(jquery rails) # Configure the default encoding used in templates for Ruby 1.9. config.encoding = "utf-8" # Configure sensitive parameters which will be filtered from the log file. config.filter_parameters += [:password] end end ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/config/database.yml0000644000000000000000000000103212674201751026735 0ustar # SQLite version 3.x # gem install sqlite3-ruby (not necessary on OS X Leopard) development: adapter: sqlite3 database: db/development.sqlite3 pool: 5 timeout: 5000 # Warning: The database defined as "test" will be erased and # re-generated from your development database when you run "rake". # Do not set this db to the same as development or production. test: adapter: sqlite3 database: db/test.sqlite3 pool: 5 timeout: 5000 production: adapter: sqlite3 database: db/production.sqlite3 pool: 5 timeout: 5000 ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/config/environments/0000755000000000000000000000000012674201751027201 5ustar ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/config/environments/development.rb./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/config/environments/develo0000644000000000000000000000173712674201751030412 0ustar Gemfile2pom::Application.configure do # Settings specified here will take precedence over those in config/environment.rb # In the development environment your application's code is reloaded on # every request. This slows down response time but is perfect for development # since you don't have to restart the webserver when you make code changes. config.cache_classes = false # Log error messages when you accidentally call methods on nil. config.whiny_nils = true # Show full error reports and disable caching config.consider_all_requests_local = true config.action_view.debug_rjs = true config.action_controller.perform_caching = false # Don't care if the mailer can't send config.action_mailer.raise_delivery_errors = false # Print deprecation notices to the Rails logger config.active_support.deprecation = :log # Only use best-standards-support built into browsers config.action_dispatch.best_standards_support = :builtin end ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/config/environments/production.rb./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/config/environments/produc0000644000000000000000000000334012674201751030420 0ustar Gemfile2pom::Application.configure do # Settings specified here will take precedence over those in config/environment.rb # The production environment is meant for finished, "live" apps. # Code is not reloaded between requests config.cache_classes = true # Full error reports are disabled and caching is turned on config.consider_all_requests_local = false config.action_controller.perform_caching = true # Specifies the header that your server uses for sending files config.action_dispatch.x_sendfile_header = "X-Sendfile" # For nginx: # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # If you have no front-end server that supports something like X-Sendfile, # just comment this out and Rails will serve the files # See everything in the log (default is :info) # config.log_level = :debug # Use a different logger for distributed setups # config.logger = SyslogLogger.new # Use a different cache store in production # config.cache_store = :mem_cache_store # Disable Rails's static asset server # In production, Apache or nginx will already do this config.serve_static_assets = false # Enable serving of images, stylesheets, and javascripts from an asset server # config.action_controller.asset_host = "http://assets.example.com" # Disable delivery errors, bad email addresses will be ignored # config.action_mailer.raise_delivery_errors = false # Enable threaded mode # config.threadsafe! # Enable locale fallbacks for I18n (makes lookups for any locale fall back to # the I18n.default_locale when a translation can not be found) config.i18n.fallbacks = true # Send deprecation notices to registered listeners config.active_support.deprecation = :notify end ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/config/environments/test.rb./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/config/environments/test.r0000644000000000000000000000275312674201751030352 0ustar Gemfile2pom::Application.configure do # Settings specified here will take precedence over those in config/environment.rb # The test environment is used exclusively to run your application's # test suite. You never need to work with it otherwise. Remember that # your test database is "scratch space" for the test suite and is wiped # and recreated between test runs. Don't rely on the data there! config.cache_classes = true # Log error messages when you accidentally call methods on nil. config.whiny_nils = true # Show full error reports and disable caching config.consider_all_requests_local = true config.action_controller.perform_caching = false # Raise exceptions instead of rendering exception templates config.action_dispatch.show_exceptions = false # Disable request forgery protection in test environment config.action_controller.allow_forgery_protection = false # Tell Action Mailer not to deliver emails to the real world. # The :test delivery method accumulates sent emails in the # ActionMailer::Base.deliveries array. config.action_mailer.delivery_method = :test # Use SQL instead of Active Record's schema dumper when creating the test database. # This is necessary if your schema can't be completely dumped by the schema dumper, # like if you have constraints or database-specific column types # config.active_record.schema_format = :sql # Print deprecation notices to the stderr config.active_support.deprecation = :stderr end ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/Gemfile0000644000000000000000000000141212674201751024476 0ustar source 'http://rubygems.org' gem 'rails', '3.0.9' # Bundle edge Rails instead: # gem 'rails', :git => 'git://github.com/rails/rails.git' if defined?(JRUBY_VERSION) gem 'activerecord-jdbc-adapter' gem 'jdbc-sqlite3', :require => false else gem 'sqlite3-ruby', :require => 'sqlite3' end # Use unicorn as the web server # gem 'unicorn' # Deploy with Capistrano # gem 'capistrano' # To use debugger # gem 'ruby-debug' # Bundle the extra gems: # gem 'bj' # gem 'nokogiri' # gem 'sqlite3-ruby', :require => 'sqlite3' # gem 'aws-s3', :require => 'aws/s3' # Bundle gems for the local environment. Make sure to # put test-only gems in this group so their generators # and rake tasks are available in development mode: # group :development, :test do # gem 'webrat' # end ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/db/0000755000000000000000000000000012674201751023572 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/db/migrate/0000755000000000000000000000000012674201751025222 5ustar ././@LongLink0000644000000000000000000000016400000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/db/migrate/20101001163415_create_users.rb./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/db/migrate/20101001163415_0000644000000000000000000000030112674201751026646 0ustar class CreateUsers < ActiveRecord::Migration def self.up create_table :users do |t| t.string :name t.timestamps end end def self.down drop_table :users end end ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/db/seeds.rb0000644000000000000000000000054112674201751025222 0ustar # This file should contain all the record creation needed to seed the database with its default values. # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup). # # Examples: # # cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }]) # Mayor.create(:name => 'Daley', :city => cities.first) ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/db/schema.rb0000644000000000000000000000162012674201751025356 0ustar # This file is auto-generated from the current state of the database. Instead # of editing this file, please use the migrations feature of Active Record to # incrementally modify your database, and then regenerate this schema definition. # # Note that this schema.rb definition is the authoritative source for your # database schema. If you need to create the application database on another # system, you should be using db:schema:load, not running all the migrations # from scratch. The latter is a flawed and unsustainable approach (the more migrations # you'll amass, the slower it'll run and the greater likelihood for issues). # # It's strongly recommended to check this file into your version control system. ActiveRecord::Schema.define(:version => 20101001163415) do create_table "users", :force => true do |t| t.string "name" t.datetime "created_at" t.datetime "updated_at" end end ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/pom2pom.rb0000644000000000000000000000021512674201751025121 0ustar pom = File.read('pom.xml').sub(/>warpom<') File.open('pom-base.xml', 'w') { |f| f.print(pom) } File.rename('pom-server.xml', 'pom.xml') ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/setup.bsh0000644000000000000000000000007312674201751025043 0ustar import java.io.*; new File( basedir, "pom.xml").delete(); ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/config.ru0000644000000000000000000000024112674201751025017 0ustar # This file is used by Rack-based servers to start the application. require ::File.expand_path('../config/environment', __FILE__) run Gemfile2pom::Application ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/test.properties0000644000000000000000000000014512674201751026302 0ustar jruby.file=pom2pom.rb task=db:create db:migrate generator=scaffold generate.args=account name:string ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/script/0000755000000000000000000000000012674201751024511 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/script/rails0000755000000000000000000000045012674201751025550 0ustar #!/usr/bin/env jruby # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application. APP_PATH = File.expand_path('../../config/application', __FILE__) require File.expand_path('../../config/boot', __FILE__) require 'rails/commands' ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/test/0000755000000000000000000000000012674201751024164 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/test/functional/0000755000000000000000000000000012674201751026326 5ustar ././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/test/functional/users_controller_test.rb./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/test/functional/users_cont0000644000000000000000000000200312674201751030430 0ustar require 'test_helper' class UsersControllerTest < ActionController::TestCase setup do @user = users(:one) end test "should get index" do get :index assert_response :success assert_not_nil assigns(:users) end test "should get new" do get :new assert_response :success end test "should create user" do assert_difference('User.count') do post :create, :user => @user.attributes end assert_redirected_to user_path(assigns(:user)) end test "should show user" do get :show, :id => @user.to_param assert_response :success end test "should get edit" do get :edit, :id => @user.to_param assert_response :success end test "should update user" do put :update, :id => @user.to_param, :user => @user.attributes assert_redirected_to user_path(assigns(:user)) end test "should destroy user" do assert_difference('User.count', -1) do delete :destroy, :id => @user.to_param end assert_redirected_to users_path end end ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/test/test_helper.rb0000644000000000000000000000070612674201751027032 0ustar ENV["RAILS_ENV"] = "test" require File.expand_path('../../config/environment', __FILE__) require 'rails/test_help' class ActiveSupport::TestCase # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order. # # Note: You'll currently still have to declare fixtures explicitly in integration tests # -- they do not yet inherit this setting fixtures :all # Add more helper methods to be used by all tests here... end ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/test/unit/0000755000000000000000000000000012674201751025143 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/test/unit/helpers/0000755000000000000000000000000012674201751026605 5ustar ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/test/unit/helpers/users_helper_test.rb./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/test/unit/helpers/users_he0000644000000000000000000000011012674201751030335 0ustar require 'test_helper' class UsersHelperTest < ActionView::TestCase end ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/test/unit/user_test.rb0000644000000000000000000000022712674201751027506 0ustar require 'test_helper' class UserTest < ActiveSupport::TestCase # Replace this with your real tests. test "the truth" do assert true end end ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/test/fixtures/0000755000000000000000000000000012674201751026035 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/test/fixtures/users.yml0000644000000000000000000000016712674201751027725 0ustar # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html one: name: MyString two: name: MyString ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/test/performance/0000755000000000000000000000000012674201751026465 5ustar ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/test/performance/browsing_test.rb./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/test/performance/browsing_0000644000000000000000000000034512674201751030403 0ustar require 'test_helper' require 'rails/performance_test_help' # Profiling results for each test method are written to tmp/performance. class BrowsingTest < ActionDispatch::PerformanceTest def test_homepage get '/' end end ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/public/0000755000000000000000000000000012674201751024463 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/public/index.html0000644000000000000000000001322412674201751026462 0ustar Ruby on Rails: Welcome aboard

    Getting started

    Here’s how to get rolling:

    1. Use rails generate to create your models and controllers

      To see all available options, run it without parameters.

    2. Set up a default route and remove or rename this file

      Routes are set up in config/routes.rb.

    3. Create your database

      Run rake db:migrate to create your database. If you're not using SQLite (the default), edit config/database.yml with your username and password.

    ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/public/robots.txt0000644000000000000000000000031412674201751026532 0ustar # See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file # # To ban all spiders from the entire site uncomment the next two lines: # User-Agent: * # Disallow: / ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/public/500.html0000644000000000000000000000133012674201751025652 0ustar We're sorry, but something went wrong (500)

    We're sorry, but something went wrong.

    We've been notified about this issue and we'll take a look at it shortly.

    ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/public/images/0000755000000000000000000000000012674201751025730 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/public/images/rails.png0000644000000000000000000001476612674201751027566 0ustar PNG  IHDR2@X${tEXtSoftwareAdobe ImageReadyqe<IDATxڬ[ \eR֮^;Iwga@`gGgDgtqDFqFDqF@NRU]˫|_-Qy^Ǹ.݋0W_6kbf̻ܸ6<4 w5~*r?9m&"M7@vm' {_S)Vi\WG?իjMd@ lDLX鸺W-TU+@EPo\&*Rnn, fDWrX|3M=\EJB[d6A'=tx^$a86̈{, ϱPepN*_W_3o;ޥ(0E:i6eXnhGf"L|S+(+.gФg=Ych=m#V_#}Ǫ|tR D8VՄM~xg!ni%Dy( B,{(Np$3iر$h.@e[a'eJԂyϠ4>H*MHQ(Jgt-֢QI ^d„@s-'- 51{'0 |n4ۉh{V@ܩw"BT =rzqPpBHȃ?ň ]-qpgsPiSӪg`jn)m 御B2L.x!jJP! K/\ ʮRB[09Trӈu. uH$ DDQ+:ݘٻ 3/nލ%Sjm2!&D/[EHwW A-RR!PeuHim"t6lFgЫ-O.1?ƞksX~VtmZJR11Nu&<⽩,Tb,`w WPx-G5 `մ/5pbAtIVJ_]0/DiH=ô#*77-3 VuQ0.pݔ%yw hљW0),2$b6&I/@bj$I(fx' JnO"`<-/LѮ%^ȫͶn2wҗ2}}XսL'Q-,m/ꤋ4#0Q&00NKrsA,Aײ)aIEC(ERK{8Ȭ[y?iI5$%f{}u F 1~;v1l'@F 'IF'm!K7"&]w 15#4Vižn[v 8Ě)>C=LBo~/3% wF4֓ʿ8>bWX@bb@IzP9IvFfQL!2cEP(se4~5RhAŽ90_? cMEteVOaOr B]pȱؓ"Eyx: NJ)bl׋hYuTdԫw=آMgwVPOFΒ25-TD[Z2>]V,xӛIOƅ)Jͺ[)?cn28p#(mk+./phʮQ6?w7HIoSj)1<#-N9O1ͰސkIKr:(ŗ;rR&<93v@w(w:~:TFSޒ" ՊTdT9PIb3JzTQׄBP23ƵW*|@^)Qw?Iq =,<@ B8);50H-=T SA@@f5r[T%#c|Z&w(B)tDQ%vyC(,Ɵ|ʰi&<#u:3EHkzд)ndF>1V2kFGYL KMQlR&TB,igv8]C8Sf#ą4Q'?,= aV9WEXYrr*!cƯ~),=yџ]jlGeE̺5r_2Ԏ}d"a]0M9PZG17nE"Rr\YQ)!|5U(d=^ŗo8+2NU6jB[B5V.]ŲW/^䩬 ;Y"Vi$2ٲ_c(F^Egq{CP/ #K8Y+Q M1>ܞAߏ,gytޕn,zE$V.v.PyLapG9Tn:uiRZ! zI0?Џ1u#$6ɱGMhFdtd|~d\O9Ij**zD؍b)PBҽh-q ql%/{Gz*d7=QS]:RQbUMPᒯ$% du] XefQz$('ИZH#ARXDB ~`0.F|XXK)wFolzyhߚKz>.&n EjU,2' &iw[d[ V)*Qavl QDit[VIQhR@$)y~m|>?cJ+VH'6? 7 i.XH8Fި)dAYUBjE".4w-?l2Y.RjWD@Bج.߆s[H-gASF3Fj]آBP떬_>M%bt ?_rլ -h]r_ž[nȶQ+Gԭ_\Ê Z٦fet(|U('.g VFEN9}Ll4T&nto¨Ӓ X F "_fYzF~y& Gu]$O[v#].@$VA`ⱧTѰZ[2u+/mUC_ TnyѠ |l\ M"G[R$d|:ěFIire"ٵt,+ی1Z11udt*K2 sd; [)xW.z2jTh#DV\NO &e_vU2B^%0FH(/ԘI2>=L]dv UUpk"ijB$,O-0y<}~*T5LErE4B߳XXN:<9>Ed -V*uBLsN**JxRU辖,T( Gu @ůY{u|CJF(OLbnմiKhpFtx8#9FsFڋDTAn1veF^M ^kf.ĆݠVʓǰ3JaY@n&jLl:McӚ…vu?9w!/~#hM ڛ ̴nMA}m W,)(î.N y%$*={P9c DzH>Blu޾K78x->V,'JU \L]l>W*r-hXf~oI Z3f玱>vN3 uZTgg}Վ363:.g /-H+"PKۉSZ4Z_GlXMc7";ҿ (5fMUCOF6 CNft>$S1VaR&4) ٗay]%W A*|gX{Qc>iTX1F M`|![$P4ʊ$#,dɌ(?KTJR۸S%C7jHb浃j+N$,[.@˹_ ?.3ĵH"U$Z^ X02!Kc 8q.NMI6N&3n8exoWfPIJB<pREAdo$*m)e9D 5X[T$LΠ:]C$n#mC[P~Yt*d?\q^WXs!E-2#_mw8;2!vw:DUn$)GiGn3_o EZE3k-EHv.OûzE>"֛}l\/-nرQHԽab*#K׋eIƳd#G et\ ,:MێÜIC}m ٽO?eb%ːٰStB|Aznaz*FlQ/K uu*1wDvE֯SJTK;(4kƣ;v2P9`k{?~_[hʢ^9фǡ;m|]o9<#jz\wD,8V]]%K9er懇0n^FcI>`Ub+kօO1|NO]t+,Ȑl_ˮ6 ĒDbrz^pe7^[aþo確jN+xsNC߅wμ7|za2, omrbZ~,pN>;?Y,z[u◿jq 4aqڶNu6Zid@h!!F9#,#UrOa0=Då ,,,bE#ȮX3ªޏ=a< =&_~ ٵѽacj񫒆LsXuXB (wzEk_QIف*4'ѣSl{.,p۵2`jp^؇nZXPź^]wމ]aQ-oI5O3a] _wb ŭL]$"|sԩȬ= VсLIUbYY搮͢I$tf$2|r;~'GSXkᇦԭF4b4 xo[,04F~<}ۭR%myb׾\mlO.4}tE\7}M)tՉ13xF [-26t䢄&E"9;ٜrq e)K!:bwY }g;Jר)5D$!Kɤ9߫-K$$ hlDUFF J{s2R6rC&&0;@>]/Z3E,k;( 2^09'); this.iefix = $(this.update.id+'_iefix'); } if(this.iefix) setTimeout(this.fixIEOverlapping.bind(this), 50); }, fixIEOverlapping: function() { Position.clone(this.update, this.iefix, {setTop:(!this.update.style.height)}); this.iefix.style.zIndex = 1; this.update.style.zIndex = 2; Element.show(this.iefix); }, hide: function() { this.stopIndicator(); if(Element.getStyle(this.update, 'display')!='none') this.options.onHide(this.element, this.update); if(this.iefix) Element.hide(this.iefix); }, startIndicator: function() { if(this.options.indicator) Element.show(this.options.indicator); }, stopIndicator: function() { if(this.options.indicator) Element.hide(this.options.indicator); }, onKeyPress: function(event) { if(this.active) switch(event.keyCode) { case Event.KEY_TAB: case Event.KEY_RETURN: this.selectEntry(); Event.stop(event); case Event.KEY_ESC: this.hide(); this.active = false; Event.stop(event); return; case Event.KEY_LEFT: case Event.KEY_RIGHT: return; case Event.KEY_UP: this.markPrevious(); this.render(); Event.stop(event); return; case Event.KEY_DOWN: this.markNext(); this.render(); Event.stop(event); return; } else if(event.keyCode==Event.KEY_TAB || event.keyCode==Event.KEY_RETURN || (Prototype.Browser.WebKit > 0 && event.keyCode == 0)) return; this.changed = true; this.hasFocus = true; if(this.observer) clearTimeout(this.observer); this.observer = setTimeout(this.onObserverEvent.bind(this), this.options.frequency*1000); }, activate: function() { this.changed = false; this.hasFocus = true; this.getUpdatedChoices(); }, onHover: function(event) { var element = Event.findElement(event, 'LI'); if(this.index != element.autocompleteIndex) { this.index = element.autocompleteIndex; this.render(); } Event.stop(event); }, onClick: function(event) { var element = Event.findElement(event, 'LI'); this.index = element.autocompleteIndex; this.selectEntry(); this.hide(); }, onBlur: function(event) { // needed to make click events working setTimeout(this.hide.bind(this), 250); this.hasFocus = false; this.active = false; }, render: function() { if(this.entryCount > 0) { for (var i = 0; i < this.entryCount; i++) this.index==i ? Element.addClassName(this.getEntry(i),"selected") : Element.removeClassName(this.getEntry(i),"selected"); if(this.hasFocus) { this.show(); this.active = true; } } else { this.active = false; this.hide(); } }, markPrevious: function() { if(this.index > 0) this.index--; else this.index = this.entryCount-1; this.getEntry(this.index).scrollIntoView(true); }, markNext: function() { if(this.index < this.entryCount-1) this.index++; else this.index = 0; this.getEntry(this.index).scrollIntoView(false); }, getEntry: function(index) { return this.update.firstChild.childNodes[index]; }, getCurrentEntry: function() { return this.getEntry(this.index); }, selectEntry: function() { this.active = false; this.updateElement(this.getCurrentEntry()); }, updateElement: function(selectedElement) { if (this.options.updateElement) { this.options.updateElement(selectedElement); return; } var value = ''; if (this.options.select) { var nodes = $(selectedElement).select('.' + this.options.select) || []; if(nodes.length>0) value = Element.collectTextNodes(nodes[0], this.options.select); } else value = Element.collectTextNodesIgnoreClass(selectedElement, 'informal'); var bounds = this.getTokenBounds(); if (bounds[0] != -1) { var newValue = this.element.value.substr(0, bounds[0]); var whitespace = this.element.value.substr(bounds[0]).match(/^\s+/); if (whitespace) newValue += whitespace[0]; this.element.value = newValue + value + this.element.value.substr(bounds[1]); } else { this.element.value = value; } this.oldElementValue = this.element.value; this.element.focus(); if (this.options.afterUpdateElement) this.options.afterUpdateElement(this.element, selectedElement); }, updateChoices: function(choices) { if(!this.changed && this.hasFocus) { this.update.innerHTML = choices; Element.cleanWhitespace(this.update); Element.cleanWhitespace(this.update.down()); if(this.update.firstChild && this.update.down().childNodes) { this.entryCount = this.update.down().childNodes.length; for (var i = 0; i < this.entryCount; i++) { var entry = this.getEntry(i); entry.autocompleteIndex = i; this.addObservers(entry); } } else { this.entryCount = 0; } this.stopIndicator(); this.index = 0; if(this.entryCount==1 && this.options.autoSelect) { this.selectEntry(); this.hide(); } else { this.render(); } } }, addObservers: function(element) { Event.observe(element, "mouseover", this.onHover.bindAsEventListener(this)); Event.observe(element, "click", this.onClick.bindAsEventListener(this)); }, onObserverEvent: function() { this.changed = false; this.tokenBounds = null; if(this.getToken().length>=this.options.minChars) { this.getUpdatedChoices(); } else { this.active = false; this.hide(); } this.oldElementValue = this.element.value; }, getToken: function() { var bounds = this.getTokenBounds(); return this.element.value.substring(bounds[0], bounds[1]).strip(); }, getTokenBounds: function() { if (null != this.tokenBounds) return this.tokenBounds; var value = this.element.value; if (value.strip().empty()) return [-1, 0]; var diff = arguments.callee.getFirstDifferencePos(value, this.oldElementValue); var offset = (diff == this.oldElementValue.length ? 1 : 0); var prevTokenPos = -1, nextTokenPos = value.length; var tp; for (var index = 0, l = this.options.tokens.length; index < l; ++index) { tp = value.lastIndexOf(this.options.tokens[index], diff + offset - 1); if (tp > prevTokenPos) prevTokenPos = tp; tp = value.indexOf(this.options.tokens[index], diff + offset); if (-1 != tp && tp < nextTokenPos) nextTokenPos = tp; } return (this.tokenBounds = [prevTokenPos + 1, nextTokenPos]); } }); Autocompleter.Base.prototype.getTokenBounds.getFirstDifferencePos = function(newS, oldS) { var boundary = Math.min(newS.length, oldS.length); for (var index = 0; index < boundary; ++index) if (newS[index] != oldS[index]) return index; return boundary; }; Ajax.Autocompleter = Class.create(Autocompleter.Base, { initialize: function(element, update, url, options) { this.baseInitialize(element, update, options); this.options.asynchronous = true; this.options.onComplete = this.onComplete.bind(this); this.options.defaultParams = this.options.parameters || null; this.url = url; }, getUpdatedChoices: function() { this.startIndicator(); var entry = encodeURIComponent(this.options.paramName) + '=' + encodeURIComponent(this.getToken()); this.options.parameters = this.options.callback ? this.options.callback(this.element, entry) : entry; if(this.options.defaultParams) this.options.parameters += '&' + this.options.defaultParams; new Ajax.Request(this.url, this.options); }, onComplete: function(request) { this.updateChoices(request.responseText); } }); // The local array autocompleter. Used when you'd prefer to // inject an array of autocompletion options into the page, rather // than sending out Ajax queries, which can be quite slow sometimes. // // The constructor takes four parameters. The first two are, as usual, // the id of the monitored textbox, and id of the autocompletion menu. // The third is the array you want to autocomplete from, and the fourth // is the options block. // // Extra local autocompletion options: // - choices - How many autocompletion choices to offer // // - partialSearch - If false, the autocompleter will match entered // text only at the beginning of strings in the // autocomplete array. Defaults to true, which will // match text at the beginning of any *word* in the // strings in the autocomplete array. If you want to // search anywhere in the string, additionally set // the option fullSearch to true (default: off). // // - fullSsearch - Search anywhere in autocomplete array strings. // // - partialChars - How many characters to enter before triggering // a partial match (unlike minChars, which defines // how many characters are required to do any match // at all). Defaults to 2. // // - ignoreCase - Whether to ignore case when autocompleting. // Defaults to true. // // It's possible to pass in a custom function as the 'selector' // option, if you prefer to write your own autocompletion logic. // In that case, the other options above will not apply unless // you support them. Autocompleter.Local = Class.create(Autocompleter.Base, { initialize: function(element, update, array, options) { this.baseInitialize(element, update, options); this.options.array = array; }, getUpdatedChoices: function() { this.updateChoices(this.options.selector(this)); }, setOptions: function(options) { this.options = Object.extend({ choices: 10, partialSearch: true, partialChars: 2, ignoreCase: true, fullSearch: false, selector: function(instance) { var ret = []; // Beginning matches var partial = []; // Inside matches var entry = instance.getToken(); var count = 0; for (var i = 0; i < instance.options.array.length && ret.length < instance.options.choices ; i++) { var elem = instance.options.array[i]; var foundPos = instance.options.ignoreCase ? elem.toLowerCase().indexOf(entry.toLowerCase()) : elem.indexOf(entry); while (foundPos != -1) { if (foundPos == 0 && elem.length != entry.length) { ret.push("
  • " + elem.substr(0, entry.length) + "" + elem.substr(entry.length) + "
  • "); break; } else if (entry.length >= instance.options.partialChars && instance.options.partialSearch && foundPos != -1) { if (instance.options.fullSearch || /\s/.test(elem.substr(foundPos-1,1))) { partial.push("
  • " + elem.substr(0, foundPos) + "" + elem.substr(foundPos, entry.length) + "" + elem.substr( foundPos + entry.length) + "
  • "); break; } } foundPos = instance.options.ignoreCase ? elem.toLowerCase().indexOf(entry.toLowerCase(), foundPos + 1) : elem.indexOf(entry, foundPos + 1); } } if (partial.length) ret = ret.concat(partial.slice(0, instance.options.choices - ret.length)); return "
      " + ret.join('') + "
    "; } }, options || { }); } }); // AJAX in-place editor and collection editor // Full rewrite by Christophe Porteneuve (April 2007). // Use this if you notice weird scrolling problems on some browsers, // the DOM might be a bit confused when this gets called so do this // waits 1 ms (with setTimeout) until it does the activation Field.scrollFreeActivate = function(field) { setTimeout(function() { Field.activate(field); }, 1); }; Ajax.InPlaceEditor = Class.create({ initialize: function(element, url, options) { this.url = url; this.element = element = $(element); this.prepareOptions(); this._controls = { }; arguments.callee.dealWithDeprecatedOptions(options); // DEPRECATION LAYER!!! Object.extend(this.options, options || { }); if (!this.options.formId && this.element.id) { this.options.formId = this.element.id + '-inplaceeditor'; if ($(this.options.formId)) this.options.formId = ''; } if (this.options.externalControl) this.options.externalControl = $(this.options.externalControl); if (!this.options.externalControl) this.options.externalControlOnly = false; this._originalBackground = this.element.getStyle('background-color') || 'transparent'; this.element.title = this.options.clickToEditText; this._boundCancelHandler = this.handleFormCancellation.bind(this); this._boundComplete = (this.options.onComplete || Prototype.emptyFunction).bind(this); this._boundFailureHandler = this.handleAJAXFailure.bind(this); this._boundSubmitHandler = this.handleFormSubmission.bind(this); this._boundWrapperHandler = this.wrapUp.bind(this); this.registerListeners(); }, checkForEscapeOrReturn: function(e) { if (!this._editing || e.ctrlKey || e.altKey || e.shiftKey) return; if (Event.KEY_ESC == e.keyCode) this.handleFormCancellation(e); else if (Event.KEY_RETURN == e.keyCode) this.handleFormSubmission(e); }, createControl: function(mode, handler, extraClasses) { var control = this.options[mode + 'Control']; var text = this.options[mode + 'Text']; if ('button' == control) { var btn = document.createElement('input'); btn.type = 'submit'; btn.value = text; btn.className = 'editor_' + mode + '_button'; if ('cancel' == mode) btn.onclick = this._boundCancelHandler; this._form.appendChild(btn); this._controls[mode] = btn; } else if ('link' == control) { var link = document.createElement('a'); link.href = '#'; link.appendChild(document.createTextNode(text)); link.onclick = 'cancel' == mode ? this._boundCancelHandler : this._boundSubmitHandler; link.className = 'editor_' + mode + '_link'; if (extraClasses) link.className += ' ' + extraClasses; this._form.appendChild(link); this._controls[mode] = link; } }, createEditField: function() { var text = (this.options.loadTextURL ? this.options.loadingText : this.getText()); var fld; if (1 >= this.options.rows && !/\r|\n/.test(this.getText())) { fld = document.createElement('input'); fld.type = 'text'; var size = this.options.size || this.options.cols || 0; if (0 < size) fld.size = size; } else { fld = document.createElement('textarea'); fld.rows = (1 >= this.options.rows ? this.options.autoRows : this.options.rows); fld.cols = this.options.cols || 40; } fld.name = this.options.paramName; fld.value = text; // No HTML breaks conversion anymore fld.className = 'editor_field'; if (this.options.submitOnBlur) fld.onblur = this._boundSubmitHandler; this._controls.editor = fld; if (this.options.loadTextURL) this.loadExternalText(); this._form.appendChild(this._controls.editor); }, createForm: function() { var ipe = this; function addText(mode, condition) { var text = ipe.options['text' + mode + 'Controls']; if (!text || condition === false) return; ipe._form.appendChild(document.createTextNode(text)); }; this._form = $(document.createElement('form')); this._form.id = this.options.formId; this._form.addClassName(this.options.formClassName); this._form.onsubmit = this._boundSubmitHandler; this.createEditField(); if ('textarea' == this._controls.editor.tagName.toLowerCase()) this._form.appendChild(document.createElement('br')); if (this.options.onFormCustomization) this.options.onFormCustomization(this, this._form); addText('Before', this.options.okControl || this.options.cancelControl); this.createControl('ok', this._boundSubmitHandler); addText('Between', this.options.okControl && this.options.cancelControl); this.createControl('cancel', this._boundCancelHandler, 'editor_cancel'); addText('After', this.options.okControl || this.options.cancelControl); }, destroy: function() { if (this._oldInnerHTML) this.element.innerHTML = this._oldInnerHTML; this.leaveEditMode(); this.unregisterListeners(); }, enterEditMode: function(e) { if (this._saving || this._editing) return; this._editing = true; this.triggerCallback('onEnterEditMode'); if (this.options.externalControl) this.options.externalControl.hide(); this.element.hide(); this.createForm(); this.element.parentNode.insertBefore(this._form, this.element); if (!this.options.loadTextURL) this.postProcessEditField(); if (e) Event.stop(e); }, enterHover: function(e) { if (this.options.hoverClassName) this.element.addClassName(this.options.hoverClassName); if (this._saving) return; this.triggerCallback('onEnterHover'); }, getText: function() { return this.element.innerHTML.unescapeHTML(); }, handleAJAXFailure: function(transport) { this.triggerCallback('onFailure', transport); if (this._oldInnerHTML) { this.element.innerHTML = this._oldInnerHTML; this._oldInnerHTML = null; } }, handleFormCancellation: function(e) { this.wrapUp(); if (e) Event.stop(e); }, handleFormSubmission: function(e) { var form = this._form; var value = $F(this._controls.editor); this.prepareSubmission(); var params = this.options.callback(form, value) || ''; if (Object.isString(params)) params = params.toQueryParams(); params.editorId = this.element.id; if (this.options.htmlResponse) { var options = Object.extend({ evalScripts: true }, this.options.ajaxOptions); Object.extend(options, { parameters: params, onComplete: this._boundWrapperHandler, onFailure: this._boundFailureHandler }); new Ajax.Updater({ success: this.element }, this.url, options); } else { var options = Object.extend({ method: 'get' }, this.options.ajaxOptions); Object.extend(options, { parameters: params, onComplete: this._boundWrapperHandler, onFailure: this._boundFailureHandler }); new Ajax.Request(this.url, options); } if (e) Event.stop(e); }, leaveEditMode: function() { this.element.removeClassName(this.options.savingClassName); this.removeForm(); this.leaveHover(); this.element.style.backgroundColor = this._originalBackground; this.element.show(); if (this.options.externalControl) this.options.externalControl.show(); this._saving = false; this._editing = false; this._oldInnerHTML = null; this.triggerCallback('onLeaveEditMode'); }, leaveHover: function(e) { if (this.options.hoverClassName) this.element.removeClassName(this.options.hoverClassName); if (this._saving) return; this.triggerCallback('onLeaveHover'); }, loadExternalText: function() { this._form.addClassName(this.options.loadingClassName); this._controls.editor.disabled = true; var options = Object.extend({ method: 'get' }, this.options.ajaxOptions); Object.extend(options, { parameters: 'editorId=' + encodeURIComponent(this.element.id), onComplete: Prototype.emptyFunction, onSuccess: function(transport) { this._form.removeClassName(this.options.loadingClassName); var text = transport.responseText; if (this.options.stripLoadedTextTags) text = text.stripTags(); this._controls.editor.value = text; this._controls.editor.disabled = false; this.postProcessEditField(); }.bind(this), onFailure: this._boundFailureHandler }); new Ajax.Request(this.options.loadTextURL, options); }, postProcessEditField: function() { var fpc = this.options.fieldPostCreation; if (fpc) $(this._controls.editor)['focus' == fpc ? 'focus' : 'activate'](); }, prepareOptions: function() { this.options = Object.clone(Ajax.InPlaceEditor.DefaultOptions); Object.extend(this.options, Ajax.InPlaceEditor.DefaultCallbacks); [this._extraDefaultOptions].flatten().compact().each(function(defs) { Object.extend(this.options, defs); }.bind(this)); }, prepareSubmission: function() { this._saving = true; this.removeForm(); this.leaveHover(); this.showSaving(); }, registerListeners: function() { this._listeners = { }; var listener; $H(Ajax.InPlaceEditor.Listeners).each(function(pair) { listener = this[pair.value].bind(this); this._listeners[pair.key] = listener; if (!this.options.externalControlOnly) this.element.observe(pair.key, listener); if (this.options.externalControl) this.options.externalControl.observe(pair.key, listener); }.bind(this)); }, removeForm: function() { if (!this._form) return; this._form.remove(); this._form = null; this._controls = { }; }, showSaving: function() { this._oldInnerHTML = this.element.innerHTML; this.element.innerHTML = this.options.savingText; this.element.addClassName(this.options.savingClassName); this.element.style.backgroundColor = this._originalBackground; this.element.show(); }, triggerCallback: function(cbName, arg) { if ('function' == typeof this.options[cbName]) { this.options[cbName](this, arg); } }, unregisterListeners: function() { $H(this._listeners).each(function(pair) { if (!this.options.externalControlOnly) this.element.stopObserving(pair.key, pair.value); if (this.options.externalControl) this.options.externalControl.stopObserving(pair.key, pair.value); }.bind(this)); }, wrapUp: function(transport) { this.leaveEditMode(); // Can't use triggerCallback due to backward compatibility: requires // binding + direct element this._boundComplete(transport, this.element); } }); Object.extend(Ajax.InPlaceEditor.prototype, { dispose: Ajax.InPlaceEditor.prototype.destroy }); Ajax.InPlaceCollectionEditor = Class.create(Ajax.InPlaceEditor, { initialize: function($super, element, url, options) { this._extraDefaultOptions = Ajax.InPlaceCollectionEditor.DefaultOptions; $super(element, url, options); }, createEditField: function() { var list = document.createElement('select'); list.name = this.options.paramName; list.size = 1; this._controls.editor = list; this._collection = this.options.collection || []; if (this.options.loadCollectionURL) this.loadCollection(); else this.checkForExternalText(); this._form.appendChild(this._controls.editor); }, loadCollection: function() { this._form.addClassName(this.options.loadingClassName); this.showLoadingText(this.options.loadingCollectionText); var options = Object.extend({ method: 'get' }, this.options.ajaxOptions); Object.extend(options, { parameters: 'editorId=' + encodeURIComponent(this.element.id), onComplete: Prototype.emptyFunction, onSuccess: function(transport) { var js = transport.responseText.strip(); if (!/^\[.*\]$/.test(js)) // TODO: improve sanity check throw('Server returned an invalid collection representation.'); this._collection = eval(js); this.checkForExternalText(); }.bind(this), onFailure: this.onFailure }); new Ajax.Request(this.options.loadCollectionURL, options); }, showLoadingText: function(text) { this._controls.editor.disabled = true; var tempOption = this._controls.editor.firstChild; if (!tempOption) { tempOption = document.createElement('option'); tempOption.value = ''; this._controls.editor.appendChild(tempOption); tempOption.selected = true; } tempOption.update((text || '').stripScripts().stripTags()); }, checkForExternalText: function() { this._text = this.getText(); if (this.options.loadTextURL) this.loadExternalText(); else this.buildOptionList(); }, loadExternalText: function() { this.showLoadingText(this.options.loadingText); var options = Object.extend({ method: 'get' }, this.options.ajaxOptions); Object.extend(options, { parameters: 'editorId=' + encodeURIComponent(this.element.id), onComplete: Prototype.emptyFunction, onSuccess: function(transport) { this._text = transport.responseText.strip(); this.buildOptionList(); }.bind(this), onFailure: this.onFailure }); new Ajax.Request(this.options.loadTextURL, options); }, buildOptionList: function() { this._form.removeClassName(this.options.loadingClassName); this._collection = this._collection.map(function(entry) { return 2 === entry.length ? entry : [entry, entry].flatten(); }); var marker = ('value' in this.options) ? this.options.value : this._text; var textFound = this._collection.any(function(entry) { return entry[0] == marker; }.bind(this)); this._controls.editor.update(''); var option; this._collection.each(function(entry, index) { option = document.createElement('option'); option.value = entry[0]; option.selected = textFound ? entry[0] == marker : 0 == index; option.appendChild(document.createTextNode(entry[1])); this._controls.editor.appendChild(option); }.bind(this)); this._controls.editor.disabled = false; Field.scrollFreeActivate(this._controls.editor); } }); //**** DEPRECATION LAYER FOR InPlace[Collection]Editor! **** //**** This only exists for a while, in order to let **** //**** users adapt to the new API. Read up on the new **** //**** API and convert your code to it ASAP! **** Ajax.InPlaceEditor.prototype.initialize.dealWithDeprecatedOptions = function(options) { if (!options) return; function fallback(name, expr) { if (name in options || expr === undefined) return; options[name] = expr; }; fallback('cancelControl', (options.cancelLink ? 'link' : (options.cancelButton ? 'button' : options.cancelLink == options.cancelButton == false ? false : undefined))); fallback('okControl', (options.okLink ? 'link' : (options.okButton ? 'button' : options.okLink == options.okButton == false ? false : undefined))); fallback('highlightColor', options.highlightcolor); fallback('highlightEndColor', options.highlightendcolor); }; Object.extend(Ajax.InPlaceEditor, { DefaultOptions: { ajaxOptions: { }, autoRows: 3, // Use when multi-line w/ rows == 1 cancelControl: 'link', // 'link'|'button'|false cancelText: 'cancel', clickToEditText: 'Click to edit', externalControl: null, // id|elt externalControlOnly: false, fieldPostCreation: 'activate', // 'activate'|'focus'|false formClassName: 'inplaceeditor-form', formId: null, // id|elt highlightColor: '#ffff99', highlightEndColor: '#ffffff', hoverClassName: '', htmlResponse: true, loadingClassName: 'inplaceeditor-loading', loadingText: 'Loading...', okControl: 'button', // 'link'|'button'|false okText: 'ok', paramName: 'value', rows: 1, // If 1 and multi-line, uses autoRows savingClassName: 'inplaceeditor-saving', savingText: 'Saving...', size: 0, stripLoadedTextTags: false, submitOnBlur: false, textAfterControls: '', textBeforeControls: '', textBetweenControls: '' }, DefaultCallbacks: { callback: function(form) { return Form.serialize(form); }, onComplete: function(transport, element) { // For backward compatibility, this one is bound to the IPE, and passes // the element directly. It was too often customized, so we don't break it. new Effect.Highlight(element, { startcolor: this.options.highlightColor, keepBackgroundImage: true }); }, onEnterEditMode: null, onEnterHover: function(ipe) { ipe.element.style.backgroundColor = ipe.options.highlightColor; if (ipe._effect) ipe._effect.cancel(); }, onFailure: function(transport, ipe) { alert('Error communication with the server: ' + transport.responseText.stripTags()); }, onFormCustomization: null, // Takes the IPE and its generated form, after editor, before controls. onLeaveEditMode: null, onLeaveHover: function(ipe) { ipe._effect = new Effect.Highlight(ipe.element, { startcolor: ipe.options.highlightColor, endcolor: ipe.options.highlightEndColor, restorecolor: ipe._originalBackground, keepBackgroundImage: true }); } }, Listeners: { click: 'enterEditMode', keydown: 'checkForEscapeOrReturn', mouseover: 'enterHover', mouseout: 'leaveHover' } }); Ajax.InPlaceCollectionEditor.DefaultOptions = { loadingCollectionText: 'Loading options...' }; // Delayed observer, like Form.Element.Observer, // but waits for delay after last key input // Ideal for live-search fields Form.Element.DelayedObserver = Class.create({ initialize: function(element, delay, callback) { this.delay = delay || 0.5; this.element = $(element); this.callback = callback; this.timer = null; this.lastValue = $F(this.element); Event.observe(this.element,'keyup',this.delayedListener.bindAsEventListener(this)); }, delayedListener: function(event) { if(this.lastValue == $F(this.element)) return; if(this.timer) clearTimeout(this.timer); this.timer = setTimeout(this.onTimerEvent.bind(this), this.delay * 1000); this.lastValue = $F(this.element); }, onTimerEvent: function() { this.timer = null; this.callback(this.element, $F(this.element)); } });././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/public/javascripts/prototype.js./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/public/javascripts/prototy0000644000000000000000000047506112674201751030474 0ustar /* Prototype JavaScript framework, version 1.7_rc2 * (c) 2005-2010 Sam Stephenson * * Prototype is freely distributable under the terms of an MIT-style license. * For details, see the Prototype web site: http://www.prototypejs.org/ * *--------------------------------------------------------------------------*/ var Prototype = { Version: '1.7_rc2', Browser: (function(){ var ua = navigator.userAgent; var isOpera = Object.prototype.toString.call(window.opera) == '[object Opera]'; return { IE: !!window.attachEvent && !isOpera, Opera: isOpera, WebKit: ua.indexOf('AppleWebKit/') > -1, Gecko: ua.indexOf('Gecko') > -1 && ua.indexOf('KHTML') === -1, MobileSafari: /Apple.*Mobile/.test(ua) } })(), BrowserFeatures: { XPath: !!document.evaluate, SelectorsAPI: !!document.querySelector, ElementExtensions: (function() { var constructor = window.Element || window.HTMLElement; return !!(constructor && constructor.prototype); })(), SpecificElementExtensions: (function() { if (typeof window.HTMLDivElement !== 'undefined') return true; var div = document.createElement('div'), form = document.createElement('form'), isSupported = false; if (div['__proto__'] && (div['__proto__'] !== form['__proto__'])) { isSupported = true; } div = form = null; return isSupported; })() }, ScriptFragment: ']*>([\\S\\s]*?)<\/script>', JSONFilter: /^\/\*-secure-([\s\S]*)\*\/\s*$/, emptyFunction: function() { }, K: function(x) { return x } }; if (Prototype.Browser.MobileSafari) Prototype.BrowserFeatures.SpecificElementExtensions = false; var Abstract = { }; var Try = { these: function() { var returnValue; for (var i = 0, length = arguments.length; i < length; i++) { var lambda = arguments[i]; try { returnValue = lambda(); break; } catch (e) { } } return returnValue; } }; /* Based on Alex Arnell's inheritance implementation. */ var Class = (function() { var IS_DONTENUM_BUGGY = (function(){ for (var p in { toString: 1 }) { if (p === 'toString') return false; } return true; })(); function subclass() {}; function create() { var parent = null, properties = $A(arguments); if (Object.isFunction(properties[0])) parent = properties.shift(); function klass() { this.initialize.apply(this, arguments); } Object.extend(klass, Class.Methods); klass.superclass = parent; klass.subclasses = []; if (parent) { subclass.prototype = parent.prototype; klass.prototype = new subclass; parent.subclasses.push(klass); } for (var i = 0, length = properties.length; i < length; i++) klass.addMethods(properties[i]); if (!klass.prototype.initialize) klass.prototype.initialize = Prototype.emptyFunction; klass.prototype.constructor = klass; return klass; } function addMethods(source) { var ancestor = this.superclass && this.superclass.prototype, properties = Object.keys(source); if (IS_DONTENUM_BUGGY) { if (source.toString != Object.prototype.toString) properties.push("toString"); if (source.valueOf != Object.prototype.valueOf) properties.push("valueOf"); } for (var i = 0, length = properties.length; i < length; i++) { var property = properties[i], value = source[property]; if (ancestor && Object.isFunction(value) && value.argumentNames()[0] == "$super") { var method = value; value = (function(m) { return function() { return ancestor[m].apply(this, arguments); }; })(property).wrap(method); value.valueOf = method.valueOf.bind(method); value.toString = method.toString.bind(method); } this.prototype[property] = value; } return this; } return { create: create, Methods: { addMethods: addMethods } }; })(); (function() { var _toString = Object.prototype.toString, NULL_TYPE = 'Null', UNDEFINED_TYPE = 'Undefined', BOOLEAN_TYPE = 'Boolean', NUMBER_TYPE = 'Number', STRING_TYPE = 'String', OBJECT_TYPE = 'Object', BOOLEAN_CLASS = '[object Boolean]', NUMBER_CLASS = '[object Number]', STRING_CLASS = '[object String]', ARRAY_CLASS = '[object Array]', NATIVE_JSON_STRINGIFY_SUPPORT = window.JSON && typeof JSON.stringify === 'function' && JSON.stringify(0) === '0' && typeof JSON.stringify(Prototype.K) === 'undefined'; function Type(o) { switch(o) { case null: return NULL_TYPE; case (void 0): return UNDEFINED_TYPE; } var type = typeof o; switch(type) { case 'boolean': return BOOLEAN_TYPE; case 'number': return NUMBER_TYPE; case 'string': return STRING_TYPE; } return OBJECT_TYPE; } function extend(destination, source) { for (var property in source) destination[property] = source[property]; return destination; } function inspect(object) { try { if (isUndefined(object)) return 'undefined'; if (object === null) return 'null'; return object.inspect ? object.inspect() : String(object); } catch (e) { if (e instanceof RangeError) return '...'; throw e; } } function toJSON(value) { return Str('', { '': value }, []); } function Str(key, holder, stack) { var value = holder[key], type = typeof value; if (Type(value) === OBJECT_TYPE && typeof value.toJSON === 'function') { value = value.toJSON(key); } var _class = _toString.call(value); switch (_class) { case NUMBER_CLASS: case BOOLEAN_CLASS: case STRING_CLASS: value = value.valueOf(); } switch (value) { case null: return 'null'; case true: return 'true'; case false: return 'false'; } type = typeof value; switch (type) { case 'string': return value.inspect(true); case 'number': return isFinite(value) ? String(value) : 'null'; case 'object': for (var i = 0, length = stack.length; i < length; i++) { if (stack[i] === value) { throw new TypeError(); } } stack.push(value); var partial = []; if (_class === ARRAY_CLASS) { for (var i = 0, length = value.length; i < length; i++) { var str = Str(i, value, stack); partial.push(typeof str === 'undefined' ? 'null' : str); } partial = '[' + partial.join(',') + ']'; } else { var keys = Object.keys(value); for (var i = 0, length = keys.length; i < length; i++) { var key = keys[i], str = Str(key, value, stack); if (typeof str !== "undefined") { partial.push(key.inspect(true)+ ':' + str); } } partial = '{' + partial.join(',') + '}'; } stack.pop(); return partial; } } function stringify(object) { return JSON.stringify(object); } function toQueryString(object) { return $H(object).toQueryString(); } function toHTML(object) { return object && object.toHTML ? object.toHTML() : String.interpret(object); } function keys(object) { if (Type(object) !== OBJECT_TYPE) { throw new TypeError(); } var results = []; for (var property in object) { if (object.hasOwnProperty(property)) { results.push(property); } } return results; } function values(object) { var results = []; for (var property in object) results.push(object[property]); return results; } function clone(object) { return extend({ }, object); } function isElement(object) { return !!(object && object.nodeType == 1); } function isArray(object) { return _toString.call(object) === ARRAY_CLASS; } var hasNativeIsArray = (typeof Array.isArray == 'function') && Array.isArray([]) && !Array.isArray({}); if (hasNativeIsArray) { isArray = Array.isArray; } function isHash(object) { return object instanceof Hash; } function isFunction(object) { return typeof object === "function"; } function isString(object) { return _toString.call(object) === STRING_CLASS; } function isNumber(object) { return _toString.call(object) === NUMBER_CLASS; } function isUndefined(object) { return typeof object === "undefined"; } extend(Object, { extend: extend, inspect: inspect, toJSON: NATIVE_JSON_STRINGIFY_SUPPORT ? stringify : toJSON, toQueryString: toQueryString, toHTML: toHTML, keys: Object.keys || keys, values: values, clone: clone, isElement: isElement, isArray: isArray, isHash: isHash, isFunction: isFunction, isString: isString, isNumber: isNumber, isUndefined: isUndefined }); })(); Object.extend(Function.prototype, (function() { var slice = Array.prototype.slice; function update(array, args) { var arrayLength = array.length, length = args.length; while (length--) array[arrayLength + length] = args[length]; return array; } function merge(array, args) { array = slice.call(array, 0); return update(array, args); } function argumentNames() { var names = this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1] .replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\//g, '') .replace(/\s+/g, '').split(','); return names.length == 1 && !names[0] ? [] : names; } function bind(context) { if (arguments.length < 2 && Object.isUndefined(arguments[0])) return this; var __method = this, args = slice.call(arguments, 1); return function() { var a = merge(args, arguments); return __method.apply(context, a); } } function bindAsEventListener(context) { var __method = this, args = slice.call(arguments, 1); return function(event) { var a = update([event || window.event], args); return __method.apply(context, a); } } function curry() { if (!arguments.length) return this; var __method = this, args = slice.call(arguments, 0); return function() { var a = merge(args, arguments); return __method.apply(this, a); } } function delay(timeout) { var __method = this, args = slice.call(arguments, 1); timeout = timeout * 1000; return window.setTimeout(function() { return __method.apply(__method, args); }, timeout); } function defer() { var args = update([0.01], arguments); return this.delay.apply(this, args); } function wrap(wrapper) { var __method = this; return function() { var a = update([__method.bind(this)], arguments); return wrapper.apply(this, a); } } function methodize() { if (this._methodized) return this._methodized; var __method = this; return this._methodized = function() { var a = update([this], arguments); return __method.apply(null, a); }; } return { argumentNames: argumentNames, bind: bind, bindAsEventListener: bindAsEventListener, curry: curry, delay: delay, defer: defer, wrap: wrap, methodize: methodize } })()); (function(proto) { function toISOString() { return this.getUTCFullYear() + '-' + (this.getUTCMonth() + 1).toPaddedString(2) + '-' + this.getUTCDate().toPaddedString(2) + 'T' + this.getUTCHours().toPaddedString(2) + ':' + this.getUTCMinutes().toPaddedString(2) + ':' + this.getUTCSeconds().toPaddedString(2) + 'Z'; } function toJSON() { return this.toISOString(); } if (!proto.toISOString) proto.toISOString = toISOString; if (!proto.toJSON) proto.toJSON = toJSON; })(Date.prototype); RegExp.prototype.match = RegExp.prototype.test; RegExp.escape = function(str) { return String(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1'); }; var PeriodicalExecuter = Class.create({ initialize: function(callback, frequency) { this.callback = callback; this.frequency = frequency; this.currentlyExecuting = false; this.registerCallback(); }, registerCallback: function() { this.timer = setInterval(this.onTimerEvent.bind(this), this.frequency * 1000); }, execute: function() { this.callback(this); }, stop: function() { if (!this.timer) return; clearInterval(this.timer); this.timer = null; }, onTimerEvent: function() { if (!this.currentlyExecuting) { try { this.currentlyExecuting = true; this.execute(); this.currentlyExecuting = false; } catch(e) { this.currentlyExecuting = false; throw e; } } } }); Object.extend(String, { interpret: function(value) { return value == null ? '' : String(value); }, specialChar: { '\b': '\\b', '\t': '\\t', '\n': '\\n', '\f': '\\f', '\r': '\\r', '\\': '\\\\' } }); Object.extend(String.prototype, (function() { var NATIVE_JSON_PARSE_SUPPORT = window.JSON && typeof JSON.parse === 'function' && JSON.parse('{"test": true}').test; function prepareReplacement(replacement) { if (Object.isFunction(replacement)) return replacement; var template = new Template(replacement); return function(match) { return template.evaluate(match) }; } function gsub(pattern, replacement) { var result = '', source = this, match; replacement = prepareReplacement(replacement); if (Object.isString(pattern)) pattern = RegExp.escape(pattern); if (!(pattern.length || pattern.source)) { replacement = replacement(''); return replacement + source.split('').join(replacement) + replacement; } while (source.length > 0) { if (match = source.match(pattern)) { result += source.slice(0, match.index); result += String.interpret(replacement(match)); source = source.slice(match.index + match[0].length); } else { result += source, source = ''; } } return result; } function sub(pattern, replacement, count) { replacement = prepareReplacement(replacement); count = Object.isUndefined(count) ? 1 : count; return this.gsub(pattern, function(match) { if (--count < 0) return match[0]; return replacement(match); }); } function scan(pattern, iterator) { this.gsub(pattern, iterator); return String(this); } function truncate(length, truncation) { length = length || 30; truncation = Object.isUndefined(truncation) ? '...' : truncation; return this.length > length ? this.slice(0, length - truncation.length) + truncation : String(this); } function strip() { return this.replace(/^\s+/, '').replace(/\s+$/, ''); } function stripTags() { return this.replace(/<\w+(\s+("[^"]*"|'[^']*'|[^>])+)?>|<\/\w+>/gi, ''); } function stripScripts() { return this.replace(new RegExp(Prototype.ScriptFragment, 'img'), ''); } function extractScripts() { var matchAll = new RegExp(Prototype.ScriptFragment, 'img'), matchOne = new RegExp(Prototype.ScriptFragment, 'im'); return (this.match(matchAll) || []).map(function(scriptTag) { return (scriptTag.match(matchOne) || ['', ''])[1]; }); } function evalScripts() { return this.extractScripts().map(function(script) { return eval(script) }); } function escapeHTML() { return this.replace(/&/g,'&').replace(//g,'>'); } function unescapeHTML() { return this.stripTags().replace(/</g,'<').replace(/>/g,'>').replace(/&/g,'&'); } function toQueryParams(separator) { var match = this.strip().match(/([^?#]*)(#.*)?$/); if (!match) return { }; return match[1].split(separator || '&').inject({ }, function(hash, pair) { if ((pair = pair.split('='))[0]) { var key = decodeURIComponent(pair.shift()), value = pair.length > 1 ? pair.join('=') : pair[0]; if (value != undefined) value = decodeURIComponent(value); if (key in hash) { if (!Object.isArray(hash[key])) hash[key] = [hash[key]]; hash[key].push(value); } else hash[key] = value; } return hash; }); } function toArray() { return this.split(''); } function succ() { return this.slice(0, this.length - 1) + String.fromCharCode(this.charCodeAt(this.length - 1) + 1); } function times(count) { return count < 1 ? '' : new Array(count + 1).join(this); } function camelize() { return this.replace(/-+(.)?/g, function(match, chr) { return chr ? chr.toUpperCase() : ''; }); } function capitalize() { return this.charAt(0).toUpperCase() + this.substring(1).toLowerCase(); } function underscore() { return this.replace(/::/g, '/') .replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2') .replace(/([a-z\d])([A-Z])/g, '$1_$2') .replace(/-/g, '_') .toLowerCase(); } function dasherize() { return this.replace(/_/g, '-'); } function inspect(useDoubleQuotes) { var escapedString = this.replace(/[\x00-\x1f\\]/g, function(character) { if (character in String.specialChar) { return String.specialChar[character]; } return '\\u00' + character.charCodeAt().toPaddedString(2, 16); }); if (useDoubleQuotes) return '"' + escapedString.replace(/"/g, '\\"') + '"'; return "'" + escapedString.replace(/'/g, '\\\'') + "'"; } function unfilterJSON(filter) { return this.replace(filter || Prototype.JSONFilter, '$1'); } function isJSON() { var str = this; if (str.blank()) return false; str = str.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@'); str = str.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']'); str = str.replace(/(?:^|:|,)(?:\s*\[)+/g, ''); return (/^[\],:{}\s]*$/).test(str); } function evalJSON(sanitize) { var json = this.unfilterJSON(), cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g; if (cx.test(json)) { json = json.replace(cx, function (a) { return '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); }); } try { if (!sanitize || json.isJSON()) return eval('(' + json + ')'); } catch (e) { } throw new SyntaxError('Badly formed JSON string: ' + this.inspect()); } function parseJSON() { var json = this.unfilterJSON(); return JSON.parse(json); } function include(pattern) { return this.indexOf(pattern) > -1; } function startsWith(pattern) { return this.lastIndexOf(pattern, 0) === 0; } function endsWith(pattern) { var d = this.length - pattern.length; return d >= 0 && this.indexOf(pattern, d) === d; } function empty() { return this == ''; } function blank() { return /^\s*$/.test(this); } function interpolate(object, pattern) { return new Template(this, pattern).evaluate(object); } return { gsub: gsub, sub: sub, scan: scan, truncate: truncate, strip: String.prototype.trim || strip, stripTags: stripTags, stripScripts: stripScripts, extractScripts: extractScripts, evalScripts: evalScripts, escapeHTML: escapeHTML, unescapeHTML: unescapeHTML, toQueryParams: toQueryParams, parseQuery: toQueryParams, toArray: toArray, succ: succ, times: times, camelize: camelize, capitalize: capitalize, underscore: underscore, dasherize: dasherize, inspect: inspect, unfilterJSON: unfilterJSON, isJSON: isJSON, evalJSON: NATIVE_JSON_PARSE_SUPPORT ? parseJSON : evalJSON, include: include, startsWith: startsWith, endsWith: endsWith, empty: empty, blank: blank, interpolate: interpolate }; })()); var Template = Class.create({ initialize: function(template, pattern) { this.template = template.toString(); this.pattern = pattern || Template.Pattern; }, evaluate: function(object) { if (object && Object.isFunction(object.toTemplateReplacements)) object = object.toTemplateReplacements(); return this.template.gsub(this.pattern, function(match) { if (object == null) return (match[1] + ''); var before = match[1] || ''; if (before == '\\') return match[2]; var ctx = object, expr = match[3], pattern = /^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/; match = pattern.exec(expr); if (match == null) return before; while (match != null) { var comp = match[1].startsWith('[') ? match[2].replace(/\\\\]/g, ']') : match[1]; ctx = ctx[comp]; if (null == ctx || '' == match[3]) break; expr = expr.substring('[' == match[3] ? match[1].length : match[0].length); match = pattern.exec(expr); } return before + String.interpret(ctx); }); } }); Template.Pattern = /(^|.|\r|\n)(#\{(.*?)\})/; var $break = { }; var Enumerable = (function() { function each(iterator, context) { var index = 0; try { this._each(function(value) { iterator.call(context, value, index++); }); } catch (e) { if (e != $break) throw e; } return this; } function eachSlice(number, iterator, context) { var index = -number, slices = [], array = this.toArray(); if (number < 1) return array; while ((index += number) < array.length) slices.push(array.slice(index, index+number)); return slices.collect(iterator, context); } function all(iterator, context) { iterator = iterator || Prototype.K; var result = true; this.each(function(value, index) { result = result && !!iterator.call(context, value, index); if (!result) throw $break; }); return result; } function any(iterator, context) { iterator = iterator || Prototype.K; var result = false; this.each(function(value, index) { if (result = !!iterator.call(context, value, index)) throw $break; }); return result; } function collect(iterator, context) { iterator = iterator || Prototype.K; var results = []; this.each(function(value, index) { results.push(iterator.call(context, value, index)); }); return results; } function detect(iterator, context) { var result; this.each(function(value, index) { if (iterator.call(context, value, index)) { result = value; throw $break; } }); return result; } function findAll(iterator, context) { var results = []; this.each(function(value, index) { if (iterator.call(context, value, index)) results.push(value); }); return results; } function grep(filter, iterator, context) { iterator = iterator || Prototype.K; var results = []; if (Object.isString(filter)) filter = new RegExp(RegExp.escape(filter)); this.each(function(value, index) { if (filter.match(value)) results.push(iterator.call(context, value, index)); }); return results; } function include(object) { if (Object.isFunction(this.indexOf)) if (this.indexOf(object) != -1) return true; var found = false; this.each(function(value) { if (value == object) { found = true; throw $break; } }); return found; } function inGroupsOf(number, fillWith) { fillWith = Object.isUndefined(fillWith) ? null : fillWith; return this.eachSlice(number, function(slice) { while(slice.length < number) slice.push(fillWith); return slice; }); } function inject(memo, iterator, context) { this.each(function(value, index) { memo = iterator.call(context, memo, value, index); }); return memo; } function invoke(method) { var args = $A(arguments).slice(1); return this.map(function(value) { return value[method].apply(value, args); }); } function max(iterator, context) { iterator = iterator || Prototype.K; var result; this.each(function(value, index) { value = iterator.call(context, value, index); if (result == null || value >= result) result = value; }); return result; } function min(iterator, context) { iterator = iterator || Prototype.K; var result; this.each(function(value, index) { value = iterator.call(context, value, index); if (result == null || value < result) result = value; }); return result; } function partition(iterator, context) { iterator = iterator || Prototype.K; var trues = [], falses = []; this.each(function(value, index) { (iterator.call(context, value, index) ? trues : falses).push(value); }); return [trues, falses]; } function pluck(property) { var results = []; this.each(function(value) { results.push(value[property]); }); return results; } function reject(iterator, context) { var results = []; this.each(function(value, index) { if (!iterator.call(context, value, index)) results.push(value); }); return results; } function sortBy(iterator, context) { return this.map(function(value, index) { return { value: value, criteria: iterator.call(context, value, index) }; }).sort(function(left, right) { var a = left.criteria, b = right.criteria; return a < b ? -1 : a > b ? 1 : 0; }).pluck('value'); } function toArray() { return this.map(); } function zip() { var iterator = Prototype.K, args = $A(arguments); if (Object.isFunction(args.last())) iterator = args.pop(); var collections = [this].concat(args).map($A); return this.map(function(value, index) { return iterator(collections.pluck(index)); }); } function size() { return this.toArray().length; } function inspect() { return '#'; } return { each: each, eachSlice: eachSlice, all: all, every: all, any: any, some: any, collect: collect, map: collect, detect: detect, findAll: findAll, select: findAll, filter: findAll, grep: grep, include: include, member: include, inGroupsOf: inGroupsOf, inject: inject, invoke: invoke, max: max, min: min, partition: partition, pluck: pluck, reject: reject, sortBy: sortBy, toArray: toArray, entries: toArray, zip: zip, size: size, inspect: inspect, find: detect }; })(); function $A(iterable) { if (!iterable) return []; if ('toArray' in Object(iterable)) return iterable.toArray(); var length = iterable.length || 0, results = new Array(length); while (length--) results[length] = iterable[length]; return results; } function $w(string) { if (!Object.isString(string)) return []; string = string.strip(); return string ? string.split(/\s+/) : []; } Array.from = $A; (function() { var arrayProto = Array.prototype, slice = arrayProto.slice, _each = arrayProto.forEach; // use native browser JS 1.6 implementation if available function each(iterator) { for (var i = 0, length = this.length; i < length; i++) iterator(this[i]); } if (!_each) _each = each; function clear() { this.length = 0; return this; } function first() { return this[0]; } function last() { return this[this.length - 1]; } function compact() { return this.select(function(value) { return value != null; }); } function flatten() { return this.inject([], function(array, value) { if (Object.isArray(value)) return array.concat(value.flatten()); array.push(value); return array; }); } function without() { var values = slice.call(arguments, 0); return this.select(function(value) { return !values.include(value); }); } function reverse(inline) { return (inline === false ? this.toArray() : this)._reverse(); } function uniq(sorted) { return this.inject([], function(array, value, index) { if (0 == index || (sorted ? array.last() != value : !array.include(value))) array.push(value); return array; }); } function intersect(array) { return this.uniq().findAll(function(item) { return array.detect(function(value) { return item === value }); }); } function clone() { return slice.call(this, 0); } function size() { return this.length; } function inspect() { return '[' + this.map(Object.inspect).join(', ') + ']'; } function indexOf(item, i) { i || (i = 0); var length = this.length; if (i < 0) i = length + i; for (; i < length; i++) if (this[i] === item) return i; return -1; } function lastIndexOf(item, i) { i = isNaN(i) ? this.length : (i < 0 ? this.length + i : i) + 1; var n = this.slice(0, i).reverse().indexOf(item); return (n < 0) ? n : i - n - 1; } function concat() { var array = slice.call(this, 0), item; for (var i = 0, length = arguments.length; i < length; i++) { item = arguments[i]; if (Object.isArray(item) && !('callee' in item)) { for (var j = 0, arrayLength = item.length; j < arrayLength; j++) array.push(item[j]); } else { array.push(item); } } return array; } Object.extend(arrayProto, Enumerable); if (!arrayProto._reverse) arrayProto._reverse = arrayProto.reverse; Object.extend(arrayProto, { _each: _each, clear: clear, first: first, last: last, compact: compact, flatten: flatten, without: without, reverse: reverse, uniq: uniq, intersect: intersect, clone: clone, toArray: clone, size: size, inspect: inspect }); var CONCAT_ARGUMENTS_BUGGY = (function() { return [].concat(arguments)[0][0] !== 1; })(1,2) if (CONCAT_ARGUMENTS_BUGGY) arrayProto.concat = concat; if (!arrayProto.indexOf) arrayProto.indexOf = indexOf; if (!arrayProto.lastIndexOf) arrayProto.lastIndexOf = lastIndexOf; })(); function $H(object) { return new Hash(object); }; var Hash = Class.create(Enumerable, (function() { function initialize(object) { this._object = Object.isHash(object) ? object.toObject() : Object.clone(object); } function _each(iterator) { for (var key in this._object) { var value = this._object[key], pair = [key, value]; pair.key = key; pair.value = value; iterator(pair); } } function set(key, value) { return this._object[key] = value; } function get(key) { if (this._object[key] !== Object.prototype[key]) return this._object[key]; } function unset(key) { var value = this._object[key]; delete this._object[key]; return value; } function toObject() { return Object.clone(this._object); } function keys() { return this.pluck('key'); } function values() { return this.pluck('value'); } function index(value) { var match = this.detect(function(pair) { return pair.value === value; }); return match && match.key; } function merge(object) { return this.clone().update(object); } function update(object) { return new Hash(object).inject(this, function(result, pair) { result.set(pair.key, pair.value); return result; }); } function toQueryPair(key, value) { if (Object.isUndefined(value)) return key; return key + '=' + encodeURIComponent(String.interpret(value)); } function toQueryString() { return this.inject([], function(results, pair) { var key = encodeURIComponent(pair.key), values = pair.value; if (values && typeof values == 'object') { if (Object.isArray(values)) return results.concat(values.map(toQueryPair.curry(key))); } else results.push(toQueryPair(key, values)); return results; }).join('&'); } function inspect() { return '#'; } function clone() { return new Hash(this); } return { initialize: initialize, _each: _each, set: set, get: get, unset: unset, toObject: toObject, toTemplateReplacements: toObject, keys: keys, values: values, index: index, merge: merge, update: update, toQueryString: toQueryString, inspect: inspect, toJSON: toObject, clone: clone }; })()); Hash.from = $H; Object.extend(Number.prototype, (function() { function toColorPart() { return this.toPaddedString(2, 16); } function succ() { return this + 1; } function times(iterator, context) { $R(0, this, true).each(iterator, context); return this; } function toPaddedString(length, radix) { var string = this.toString(radix || 10); return '0'.times(length - string.length) + string; } function abs() { return Math.abs(this); } function round() { return Math.round(this); } function ceil() { return Math.ceil(this); } function floor() { return Math.floor(this); } return { toColorPart: toColorPart, succ: succ, times: times, toPaddedString: toPaddedString, abs: abs, round: round, ceil: ceil, floor: floor }; })()); function $R(start, end, exclusive) { return new ObjectRange(start, end, exclusive); } var ObjectRange = Class.create(Enumerable, (function() { function initialize(start, end, exclusive) { this.start = start; this.end = end; this.exclusive = exclusive; } function _each(iterator) { var value = this.start; while (this.include(value)) { iterator(value); value = value.succ(); } } function include(value) { if (value < this.start) return false; if (this.exclusive) return value < this.end; return value <= this.end; } return { initialize: initialize, _each: _each, include: include }; })()); var Ajax = { getTransport: function() { return Try.these( function() {return new XMLHttpRequest()}, function() {return new ActiveXObject('Msxml2.XMLHTTP')}, function() {return new ActiveXObject('Microsoft.XMLHTTP')} ) || false; }, activeRequestCount: 0 }; Ajax.Responders = { responders: [], _each: function(iterator) { this.responders._each(iterator); }, register: function(responder) { if (!this.include(responder)) this.responders.push(responder); }, unregister: function(responder) { this.responders = this.responders.without(responder); }, dispatch: function(callback, request, transport, json) { this.each(function(responder) { if (Object.isFunction(responder[callback])) { try { responder[callback].apply(responder, [request, transport, json]); } catch (e) { } } }); } }; Object.extend(Ajax.Responders, Enumerable); Ajax.Responders.register({ onCreate: function() { Ajax.activeRequestCount++ }, onComplete: function() { Ajax.activeRequestCount-- } }); Ajax.Base = Class.create({ initialize: function(options) { this.options = { method: 'post', asynchronous: true, contentType: 'application/x-www-form-urlencoded', encoding: 'UTF-8', parameters: '', evalJSON: true, evalJS: true }; Object.extend(this.options, options || { }); this.options.method = this.options.method.toLowerCase(); if (Object.isString(this.options.parameters)) this.options.parameters = this.options.parameters.toQueryParams(); else if (Object.isHash(this.options.parameters)) this.options.parameters = this.options.parameters.toObject(); } }); Ajax.Request = Class.create(Ajax.Base, { _complete: false, initialize: function($super, url, options) { $super(options); this.transport = Ajax.getTransport(); this.request(url); }, request: function(url) { this.url = url; this.method = this.options.method; var params = Object.clone(this.options.parameters); if (!['get', 'post'].include(this.method)) { params['_method'] = this.method; this.method = 'post'; } this.parameters = params; if (params = Object.toQueryString(params)) { if (this.method == 'get') this.url += (this.url.include('?') ? '&' : '?') + params; else if (/Konqueror|Safari|KHTML/.test(navigator.userAgent)) params += '&_='; } try { var response = new Ajax.Response(this); if (this.options.onCreate) this.options.onCreate(response); Ajax.Responders.dispatch('onCreate', this, response); this.transport.open(this.method.toUpperCase(), this.url, this.options.asynchronous); if (this.options.asynchronous) this.respondToReadyState.bind(this).defer(1); this.transport.onreadystatechange = this.onStateChange.bind(this); this.setRequestHeaders(); this.body = this.method == 'post' ? (this.options.postBody || params) : null; this.transport.send(this.body); /* Force Firefox to handle ready state 4 for synchronous requests */ if (!this.options.asynchronous && this.transport.overrideMimeType) this.onStateChange(); } catch (e) { this.dispatchException(e); } }, onStateChange: function() { var readyState = this.transport.readyState; if (readyState > 1 && !((readyState == 4) && this._complete)) this.respondToReadyState(this.transport.readyState); }, setRequestHeaders: function() { var headers = { 'X-Requested-With': 'XMLHttpRequest', 'X-Prototype-Version': Prototype.Version, 'Accept': 'text/javascript, text/html, application/xml, text/xml, */*' }; if (this.method == 'post') { headers['Content-type'] = this.options.contentType + (this.options.encoding ? '; charset=' + this.options.encoding : ''); /* Force "Connection: close" for older Mozilla browsers to work * around a bug where XMLHttpRequest sends an incorrect * Content-length header. See Mozilla Bugzilla #246651. */ if (this.transport.overrideMimeType && (navigator.userAgent.match(/Gecko\/(\d{4})/) || [0,2005])[1] < 2005) headers['Connection'] = 'close'; } if (typeof this.options.requestHeaders == 'object') { var extras = this.options.requestHeaders; if (Object.isFunction(extras.push)) for (var i = 0, length = extras.length; i < length; i += 2) headers[extras[i]] = extras[i+1]; else $H(extras).each(function(pair) { headers[pair.key] = pair.value }); } for (var name in headers) this.transport.setRequestHeader(name, headers[name]); }, success: function() { var status = this.getStatus(); return !status || (status >= 200 && status < 300); }, getStatus: function() { try { return this.transport.status || 0; } catch (e) { return 0 } }, respondToReadyState: function(readyState) { var state = Ajax.Request.Events[readyState], response = new Ajax.Response(this); if (state == 'Complete') { try { this._complete = true; (this.options['on' + response.status] || this.options['on' + (this.success() ? 'Success' : 'Failure')] || Prototype.emptyFunction)(response, response.headerJSON); } catch (e) { this.dispatchException(e); } var contentType = response.getHeader('Content-type'); if (this.options.evalJS == 'force' || (this.options.evalJS && this.isSameOrigin() && contentType && contentType.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i))) this.evalResponse(); } try { (this.options['on' + state] || Prototype.emptyFunction)(response, response.headerJSON); Ajax.Responders.dispatch('on' + state, this, response, response.headerJSON); } catch (e) { this.dispatchException(e); } if (state == 'Complete') { this.transport.onreadystatechange = Prototype.emptyFunction; } }, isSameOrigin: function() { var m = this.url.match(/^\s*https?:\/\/[^\/]*/); return !m || (m[0] == '#{protocol}//#{domain}#{port}'.interpolate({ protocol: location.protocol, domain: document.domain, port: location.port ? ':' + location.port : '' })); }, getHeader: function(name) { try { return this.transport.getResponseHeader(name) || null; } catch (e) { return null; } }, evalResponse: function() { try { return eval((this.transport.responseText || '').unfilterJSON()); } catch (e) { this.dispatchException(e); } }, dispatchException: function(exception) { (this.options.onException || Prototype.emptyFunction)(this, exception); Ajax.Responders.dispatch('onException', this, exception); } }); Ajax.Request.Events = ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete']; Ajax.Response = Class.create({ initialize: function(request){ this.request = request; var transport = this.transport = request.transport, readyState = this.readyState = transport.readyState; if ((readyState > 2 && !Prototype.Browser.IE) || readyState == 4) { this.status = this.getStatus(); this.statusText = this.getStatusText(); this.responseText = String.interpret(transport.responseText); this.headerJSON = this._getHeaderJSON(); } if (readyState == 4) { var xml = transport.responseXML; this.responseXML = Object.isUndefined(xml) ? null : xml; this.responseJSON = this._getResponseJSON(); } }, status: 0, statusText: '', getStatus: Ajax.Request.prototype.getStatus, getStatusText: function() { try { return this.transport.statusText || ''; } catch (e) { return '' } }, getHeader: Ajax.Request.prototype.getHeader, getAllHeaders: function() { try { return this.getAllResponseHeaders(); } catch (e) { return null } }, getResponseHeader: function(name) { return this.transport.getResponseHeader(name); }, getAllResponseHeaders: function() { return this.transport.getAllResponseHeaders(); }, _getHeaderJSON: function() { var json = this.getHeader('X-JSON'); if (!json) return null; json = decodeURIComponent(escape(json)); try { return json.evalJSON(this.request.options.sanitizeJSON || !this.request.isSameOrigin()); } catch (e) { this.request.dispatchException(e); } }, _getResponseJSON: function() { var options = this.request.options; if (!options.evalJSON || (options.evalJSON != 'force' && !(this.getHeader('Content-type') || '').include('application/json')) || this.responseText.blank()) return null; try { return this.responseText.evalJSON(options.sanitizeJSON || !this.request.isSameOrigin()); } catch (e) { this.request.dispatchException(e); } } }); Ajax.Updater = Class.create(Ajax.Request, { initialize: function($super, container, url, options) { this.container = { success: (container.success || container), failure: (container.failure || (container.success ? null : container)) }; options = Object.clone(options); var onComplete = options.onComplete; options.onComplete = (function(response, json) { this.updateContent(response.responseText); if (Object.isFunction(onComplete)) onComplete(response, json); }).bind(this); $super(url, options); }, updateContent: function(responseText) { var receiver = this.container[this.success() ? 'success' : 'failure'], options = this.options; if (!options.evalScripts) responseText = responseText.stripScripts(); if (receiver = $(receiver)) { if (options.insertion) { if (Object.isString(options.insertion)) { var insertion = { }; insertion[options.insertion] = responseText; receiver.insert(insertion); } else options.insertion(receiver, responseText); } else receiver.update(responseText); } } }); Ajax.PeriodicalUpdater = Class.create(Ajax.Base, { initialize: function($super, container, url, options) { $super(options); this.onComplete = this.options.onComplete; this.frequency = (this.options.frequency || 2); this.decay = (this.options.decay || 1); this.updater = { }; this.container = container; this.url = url; this.start(); }, start: function() { this.options.onComplete = this.updateComplete.bind(this); this.onTimerEvent(); }, stop: function() { this.updater.options.onComplete = undefined; clearTimeout(this.timer); (this.onComplete || Prototype.emptyFunction).apply(this, arguments); }, updateComplete: function(response) { if (this.options.decay) { this.decay = (response.responseText == this.lastText ? this.decay * this.options.decay : 1); this.lastText = response.responseText; } this.timer = this.onTimerEvent.bind(this).delay(this.decay * this.frequency); }, onTimerEvent: function() { this.updater = new Ajax.Updater(this.container, this.url, this.options); } }); function $(element) { if (arguments.length > 1) { for (var i = 0, elements = [], length = arguments.length; i < length; i++) elements.push($(arguments[i])); return elements; } if (Object.isString(element)) element = document.getElementById(element); return Element.extend(element); } if (Prototype.BrowserFeatures.XPath) { document._getElementsByXPath = function(expression, parentElement) { var results = []; var query = document.evaluate(expression, $(parentElement) || document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); for (var i = 0, length = query.snapshotLength; i < length; i++) results.push(Element.extend(query.snapshotItem(i))); return results; }; } /*--------------------------------------------------------------------------*/ if (!Node) var Node = { }; if (!Node.ELEMENT_NODE) { Object.extend(Node, { ELEMENT_NODE: 1, ATTRIBUTE_NODE: 2, TEXT_NODE: 3, CDATA_SECTION_NODE: 4, ENTITY_REFERENCE_NODE: 5, ENTITY_NODE: 6, PROCESSING_INSTRUCTION_NODE: 7, COMMENT_NODE: 8, DOCUMENT_NODE: 9, DOCUMENT_TYPE_NODE: 10, DOCUMENT_FRAGMENT_NODE: 11, NOTATION_NODE: 12 }); } (function(global) { var HAS_EXTENDED_CREATE_ELEMENT_SYNTAX = (function(){ try { var el = document.createElement(''); return el.tagName.toLowerCase() === 'input' && el.name === 'x'; } catch(err) { return false; } })(); var element = global.Element; global.Element = function(tagName, attributes) { attributes = attributes || { }; tagName = tagName.toLowerCase(); var cache = Element.cache; if (HAS_EXTENDED_CREATE_ELEMENT_SYNTAX && attributes.name) { tagName = '<' + tagName + ' name="' + attributes.name + '">'; delete attributes.name; return Element.writeAttribute(document.createElement(tagName), attributes); } if (!cache[tagName]) cache[tagName] = Element.extend(document.createElement(tagName)); return Element.writeAttribute(cache[tagName].cloneNode(false), attributes); }; Object.extend(global.Element, element || { }); if (element) global.Element.prototype = element.prototype; })(this); Element.idCounter = 1; Element.cache = { }; function purgeElement(element) { var uid = element._prototypeUID; if (uid) { Element.stopObserving(element); element._prototypeUID = void 0; delete Element.Storage[uid]; } } Element.Methods = { visible: function(element) { return $(element).style.display != 'none'; }, toggle: function(element) { element = $(element); Element[Element.visible(element) ? 'hide' : 'show'](element); return element; }, hide: function(element) { element = $(element); element.style.display = 'none'; return element; }, show: function(element) { element = $(element); element.style.display = ''; return element; }, remove: function(element) { element = $(element); element.parentNode.removeChild(element); return element; }, update: (function(){ var SELECT_ELEMENT_INNERHTML_BUGGY = (function(){ var el = document.createElement("select"), isBuggy = true; el.innerHTML = ""; if (el.options && el.options[0]) { isBuggy = el.options[0].nodeName.toUpperCase() !== "OPTION"; } el = null; return isBuggy; })(); var TABLE_ELEMENT_INNERHTML_BUGGY = (function(){ try { var el = document.createElement("table"); if (el && el.tBodies) { el.innerHTML = "test"; var isBuggy = typeof el.tBodies[0] == "undefined"; el = null; return isBuggy; } } catch (e) { return true; } })(); var SCRIPT_ELEMENT_REJECTS_TEXTNODE_APPENDING = (function () { var s = document.createElement("script"), isBuggy = false; try { s.appendChild(document.createTextNode("")); isBuggy = !s.firstChild || s.firstChild && s.firstChild.nodeType !== 3; } catch (e) { isBuggy = true; } s = null; return isBuggy; })(); function update(element, content) { element = $(element); var descendants = element.getElementsByTagName('*'), i = descendants.length; while (i--) purgeElement(descendants[i]); if (content && content.toElement) content = content.toElement(); if (Object.isElement(content)) return element.update().insert(content); content = Object.toHTML(content); var tagName = element.tagName.toUpperCase(); if (tagName === 'SCRIPT' && SCRIPT_ELEMENT_REJECTS_TEXTNODE_APPENDING) { element.text = content; return element; } if (SELECT_ELEMENT_INNERHTML_BUGGY || TABLE_ELEMENT_INNERHTML_BUGGY) { if (tagName in Element._insertionTranslations.tags) { while (element.firstChild) { element.removeChild(element.firstChild); } Element._getContentFromAnonymousElement(tagName, content.stripScripts()) .each(function(node) { element.appendChild(node) }); } else { element.innerHTML = content.stripScripts(); } } else { element.innerHTML = content.stripScripts(); } content.evalScripts.bind(content).defer(); return element; } return update; })(), replace: function(element, content) { element = $(element); if (content && content.toElement) content = content.toElement(); else if (!Object.isElement(content)) { content = Object.toHTML(content); var range = element.ownerDocument.createRange(); range.selectNode(element); content.evalScripts.bind(content).defer(); content = range.createContextualFragment(content.stripScripts()); } element.parentNode.replaceChild(content, element); return element; }, insert: function(element, insertions) { element = $(element); if (Object.isString(insertions) || Object.isNumber(insertions) || Object.isElement(insertions) || (insertions && (insertions.toElement || insertions.toHTML))) insertions = {bottom:insertions}; var content, insert, tagName, childNodes; for (var position in insertions) { content = insertions[position]; position = position.toLowerCase(); insert = Element._insertionTranslations[position]; if (content && content.toElement) content = content.toElement(); if (Object.isElement(content)) { insert(element, content); continue; } content = Object.toHTML(content); tagName = ((position == 'before' || position == 'after') ? element.parentNode : element).tagName.toUpperCase(); childNodes = Element._getContentFromAnonymousElement(tagName, content.stripScripts()); if (position == 'top' || position == 'after') childNodes.reverse(); childNodes.each(insert.curry(element)); content.evalScripts.bind(content).defer(); } return element; }, wrap: function(element, wrapper, attributes) { element = $(element); if (Object.isElement(wrapper)) $(wrapper).writeAttribute(attributes || { }); else if (Object.isString(wrapper)) wrapper = new Element(wrapper, attributes); else wrapper = new Element('div', wrapper); if (element.parentNode) element.parentNode.replaceChild(wrapper, element); wrapper.appendChild(element); return wrapper; }, inspect: function(element) { element = $(element); var result = '<' + element.tagName.toLowerCase(); $H({'id': 'id', 'className': 'class'}).each(function(pair) { var property = pair.first(), attribute = pair.last(), value = (element[property] || '').toString(); if (value) result += ' ' + attribute + '=' + value.inspect(true); }); return result + '>'; }, recursivelyCollect: function(element, property, maximumLength) { element = $(element); maximumLength = maximumLength || -1; var elements = []; while (element = element[property]) { if (element.nodeType == 1) elements.push(Element.extend(element)); if (elements.length == maximumLength) break; } return elements; }, ancestors: function(element) { return Element.recursivelyCollect(element, 'parentNode'); }, descendants: function(element) { return Element.select(element, "*"); }, firstDescendant: function(element) { element = $(element).firstChild; while (element && element.nodeType != 1) element = element.nextSibling; return $(element); }, immediateDescendants: function(element) { var results = [], child = $(element).firstChild; while (child) { if (child.nodeType === 1) { results.push(Element.extend(child)); } child = child.nextSibling; } return results; }, previousSiblings: function(element, maximumLength) { return Element.recursivelyCollect(element, 'previousSibling'); }, nextSiblings: function(element) { return Element.recursivelyCollect(element, 'nextSibling'); }, siblings: function(element) { element = $(element); return Element.previousSiblings(element).reverse() .concat(Element.nextSiblings(element)); }, match: function(element, selector) { element = $(element); if (Object.isString(selector)) return Prototype.Selector.match(element, selector); return selector.match(element); }, up: function(element, expression, index) { element = $(element); if (arguments.length == 1) return $(element.parentNode); var ancestors = Element.ancestors(element); return Object.isNumber(expression) ? ancestors[expression] : Prototype.Selector.find(ancestors, expression, index); }, down: function(element, expression, index) { element = $(element); if (arguments.length == 1) return Element.firstDescendant(element); return Object.isNumber(expression) ? Element.descendants(element)[expression] : Element.select(element, expression)[index || 0]; }, previous: function(element, expression, index) { element = $(element); if (Object.isNumber(expression)) index = expression, expression = false; if (!Object.isNumber(index)) index = 0; if (expression) { return Prototype.Selector.find(element.previousSiblings(), expression, index); } else { return element.recursivelyCollect("previousSibling", index + 1)[index]; } }, next: function(element, expression, index) { element = $(element); if (Object.isNumber(expression)) index = expression, expression = false; if (!Object.isNumber(index)) index = 0; if (expression) { return Prototype.Selector.find(element.nextSiblings(), expression, index); } else { var maximumLength = Object.isNumber(index) ? index + 1 : 1; return element.recursivelyCollect("nextSibling", index + 1)[index]; } }, select: function(element) { element = $(element); var expressions = Array.prototype.slice.call(arguments, 1).join(', '); return Prototype.Selector.select(expressions, element); }, adjacent: function(element) { element = $(element); var expressions = Array.prototype.slice.call(arguments, 1).join(', '); return Prototype.Selector.select(expressions, element.parentNode).without(element); }, identify: function(element) { element = $(element); var id = Element.readAttribute(element, 'id'); if (id) return id; do { id = 'anonymous_element_' + Element.idCounter++ } while ($(id)); Element.writeAttribute(element, 'id', id); return id; }, readAttribute: function(element, name) { element = $(element); if (Prototype.Browser.IE) { var t = Element._attributeTranslations.read; if (t.values[name]) return t.values[name](element, name); if (t.names[name]) name = t.names[name]; if (name.include(':')) { return (!element.attributes || !element.attributes[name]) ? null : element.attributes[name].value; } } return element.getAttribute(name); }, writeAttribute: function(element, name, value) { element = $(element); var attributes = { }, t = Element._attributeTranslations.write; if (typeof name == 'object') attributes = name; else attributes[name] = Object.isUndefined(value) ? true : value; for (var attr in attributes) { name = t.names[attr] || attr; value = attributes[attr]; if (t.values[attr]) name = t.values[attr](element, value); if (value === false || value === null) element.removeAttribute(name); else if (value === true) element.setAttribute(name, name); else element.setAttribute(name, value); } return element; }, getHeight: function(element) { return Element.getDimensions(element).height; }, getWidth: function(element) { return Element.getDimensions(element).width; }, classNames: function(element) { return new Element.ClassNames(element); }, hasClassName: function(element, className) { if (!(element = $(element))) return; var elementClassName = element.className; return (elementClassName.length > 0 && (elementClassName == className || new RegExp("(^|\\s)" + className + "(\\s|$)").test(elementClassName))); }, addClassName: function(element, className) { if (!(element = $(element))) return; if (!Element.hasClassName(element, className)) element.className += (element.className ? ' ' : '') + className; return element; }, removeClassName: function(element, className) { if (!(element = $(element))) return; element.className = element.className.replace( new RegExp("(^|\\s+)" + className + "(\\s+|$)"), ' ').strip(); return element; }, toggleClassName: function(element, className) { if (!(element = $(element))) return; return Element[Element.hasClassName(element, className) ? 'removeClassName' : 'addClassName'](element, className); }, cleanWhitespace: function(element) { element = $(element); var node = element.firstChild; while (node) { var nextNode = node.nextSibling; if (node.nodeType == 3 && !/\S/.test(node.nodeValue)) element.removeChild(node); node = nextNode; } return element; }, empty: function(element) { return $(element).innerHTML.blank(); }, descendantOf: function(element, ancestor) { element = $(element), ancestor = $(ancestor); if (element.compareDocumentPosition) return (element.compareDocumentPosition(ancestor) & 8) === 8; if (ancestor.contains) return ancestor.contains(element) && ancestor !== element; while (element = element.parentNode) if (element == ancestor) return true; return false; }, scrollTo: function(element) { element = $(element); var pos = Element.cumulativeOffset(element); window.scrollTo(pos[0], pos[1]); return element; }, getStyle: function(element, style) { element = $(element); style = style == 'float' ? 'cssFloat' : style.camelize(); var value = element.style[style]; if (!value || value == 'auto') { var css = document.defaultView.getComputedStyle(element, null); value = css ? css[style] : null; } if (style == 'opacity') return value ? parseFloat(value) : 1.0; return value == 'auto' ? null : value; }, getOpacity: function(element) { return $(element).getStyle('opacity'); }, setStyle: function(element, styles) { element = $(element); var elementStyle = element.style, match; if (Object.isString(styles)) { element.style.cssText += ';' + styles; return styles.include('opacity') ? element.setOpacity(styles.match(/opacity:\s*(\d?\.?\d*)/)[1]) : element; } for (var property in styles) if (property == 'opacity') element.setOpacity(styles[property]); else elementStyle[(property == 'float' || property == 'cssFloat') ? (Object.isUndefined(elementStyle.styleFloat) ? 'cssFloat' : 'styleFloat') : property] = styles[property]; return element; }, setOpacity: function(element, value) { element = $(element); element.style.opacity = (value == 1 || value === '') ? '' : (value < 0.00001) ? 0 : value; return element; }, makePositioned: function(element) { element = $(element); var pos = Element.getStyle(element, 'position'); if (pos == 'static' || !pos) { element._madePositioned = true; element.style.position = 'relative'; if (Prototype.Browser.Opera) { element.style.top = 0; element.style.left = 0; } } return element; }, undoPositioned: function(element) { element = $(element); if (element._madePositioned) { element._madePositioned = undefined; element.style.position = element.style.top = element.style.left = element.style.bottom = element.style.right = ''; } return element; }, makeClipping: function(element) { element = $(element); if (element._overflow) return element; element._overflow = Element.getStyle(element, 'overflow') || 'auto'; if (element._overflow !== 'hidden') element.style.overflow = 'hidden'; return element; }, undoClipping: function(element) { element = $(element); if (!element._overflow) return element; element.style.overflow = element._overflow == 'auto' ? '' : element._overflow; element._overflow = null; return element; }, cumulativeOffset: function(element) { var valueT = 0, valueL = 0; if (element.parentNode) { do { valueT += element.offsetTop || 0; valueL += element.offsetLeft || 0; element = element.offsetParent; } while (element); } return Element._returnOffset(valueL, valueT); }, positionedOffset: function(element) { var valueT = 0, valueL = 0; do { valueT += element.offsetTop || 0; valueL += element.offsetLeft || 0; element = element.offsetParent; if (element) { if (element.tagName.toUpperCase() == 'BODY') break; var p = Element.getStyle(element, 'position'); if (p !== 'static') break; } } while (element); return Element._returnOffset(valueL, valueT); }, absolutize: function(element) { element = $(element); if (Element.getStyle(element, 'position') == 'absolute') return element; var offsets = Element.positionedOffset(element), top = offsets[1], left = offsets[0], width = element.clientWidth, height = element.clientHeight; element._originalLeft = left - parseFloat(element.style.left || 0); element._originalTop = top - parseFloat(element.style.top || 0); element._originalWidth = element.style.width; element._originalHeight = element.style.height; element.style.position = 'absolute'; element.style.top = top + 'px'; element.style.left = left + 'px'; element.style.width = width + 'px'; element.style.height = height + 'px'; return element; }, relativize: function(element) { element = $(element); if (Element.getStyle(element, 'position') == 'relative') return element; element.style.position = 'relative'; var top = parseFloat(element.style.top || 0) - (element._originalTop || 0), left = parseFloat(element.style.left || 0) - (element._originalLeft || 0); element.style.top = top + 'px'; element.style.left = left + 'px'; element.style.height = element._originalHeight; element.style.width = element._originalWidth; return element; }, cumulativeScrollOffset: function(element) { var valueT = 0, valueL = 0; do { valueT += element.scrollTop || 0; valueL += element.scrollLeft || 0; element = element.parentNode; } while (element); return Element._returnOffset(valueL, valueT); }, getOffsetParent: function(element) { if (element.offsetParent) return $(element.offsetParent); if (element == document.body) return $(element); while ((element = element.parentNode) && element != document.body) if (Element.getStyle(element, 'position') != 'static') return $(element); return $(document.body); }, viewportOffset: function(forElement) { var valueT = 0, valueL = 0, element = forElement; do { valueT += element.offsetTop || 0; valueL += element.offsetLeft || 0; if (element.offsetParent == document.body && Element.getStyle(element, 'position') == 'absolute') break; } while (element = element.offsetParent); element = forElement; do { if (!Prototype.Browser.Opera || (element.tagName && (element.tagName.toUpperCase() == 'BODY'))) { valueT -= element.scrollTop || 0; valueL -= element.scrollLeft || 0; } } while (element = element.parentNode); return Element._returnOffset(valueL, valueT); }, clonePosition: function(element, source) { var options = Object.extend({ setLeft: true, setTop: true, setWidth: true, setHeight: true, offsetTop: 0, offsetLeft: 0 }, arguments[2] || { }); source = $(source); var p = Element.viewportOffset(source), delta = [0, 0], parent = null; element = $(element); if (Element.getStyle(element, 'position') == 'absolute') { parent = Element.getOffsetParent(element); delta = Element.viewportOffset(parent); } if (parent == document.body) { delta[0] -= document.body.offsetLeft; delta[1] -= document.body.offsetTop; } if (options.setLeft) element.style.left = (p[0] - delta[0] + options.offsetLeft) + 'px'; if (options.setTop) element.style.top = (p[1] - delta[1] + options.offsetTop) + 'px'; if (options.setWidth) element.style.width = source.offsetWidth + 'px'; if (options.setHeight) element.style.height = source.offsetHeight + 'px'; return element; } }; Object.extend(Element.Methods, { getElementsBySelector: Element.Methods.select, childElements: Element.Methods.immediateDescendants }); Element._attributeTranslations = { write: { names: { className: 'class', htmlFor: 'for' }, values: { } } }; if (Prototype.Browser.Opera) { Element.Methods.getStyle = Element.Methods.getStyle.wrap( function(proceed, element, style) { switch (style) { case 'left': case 'top': case 'right': case 'bottom': if (proceed(element, 'position') === 'static') return null; case 'height': case 'width': if (!Element.visible(element)) return null; var dim = parseInt(proceed(element, style), 10); if (dim !== element['offset' + style.capitalize()]) return dim + 'px'; var properties; if (style === 'height') { properties = ['border-top-width', 'padding-top', 'padding-bottom', 'border-bottom-width']; } else { properties = ['border-left-width', 'padding-left', 'padding-right', 'border-right-width']; } return properties.inject(dim, function(memo, property) { var val = proceed(element, property); return val === null ? memo : memo - parseInt(val, 10); }) + 'px'; default: return proceed(element, style); } } ); Element.Methods.readAttribute = Element.Methods.readAttribute.wrap( function(proceed, element, attribute) { if (attribute === 'title') return element.title; return proceed(element, attribute); } ); } else if (Prototype.Browser.IE) { Element.Methods.getOffsetParent = Element.Methods.getOffsetParent.wrap( function(proceed, element) { element = $(element); if (!element.parentNode) return $(document.body); var position = element.getStyle('position'); if (position !== 'static') return proceed(element); element.setStyle({ position: 'relative' }); var value = proceed(element); element.setStyle({ position: position }); return value; } ); $w('positionedOffset viewportOffset').each(function(method) { Element.Methods[method] = Element.Methods[method].wrap( function(proceed, element) { element = $(element); if (!element.parentNode) return Element._returnOffset(0, 0); var position = element.getStyle('position'); if (position !== 'static') return proceed(element); var offsetParent = element.getOffsetParent(); if (offsetParent && offsetParent.getStyle('position') === 'fixed') offsetParent.setStyle({ zoom: 1 }); element.setStyle({ position: 'relative' }); var value = proceed(element); element.setStyle({ position: position }); return value; } ); }); Element.Methods.getStyle = function(element, style) { element = $(element); style = (style == 'float' || style == 'cssFloat') ? 'styleFloat' : style.camelize(); var value = element.style[style]; if (!value && element.currentStyle) value = element.currentStyle[style]; if (style == 'opacity') { if (value = (element.getStyle('filter') || '').match(/alpha\(opacity=(.*)\)/)) if (value[1]) return parseFloat(value[1]) / 100; return 1.0; } if (value == 'auto') { if ((style == 'width' || style == 'height') && (element.getStyle('display') != 'none')) return element['offset' + style.capitalize()] + 'px'; return null; } return value; }; Element.Methods.setOpacity = function(element, value) { function stripAlpha(filter){ return filter.replace(/alpha\([^\)]*\)/gi,''); } element = $(element); var currentStyle = element.currentStyle; if ((currentStyle && !currentStyle.hasLayout) || (!currentStyle && element.style.zoom == 'normal')) element.style.zoom = 1; var filter = element.getStyle('filter'), style = element.style; if (value == 1 || value === '') { (filter = stripAlpha(filter)) ? style.filter = filter : style.removeAttribute('filter'); return element; } else if (value < 0.00001) value = 0; style.filter = stripAlpha(filter) + 'alpha(opacity=' + (value * 100) + ')'; return element; }; Element._attributeTranslations = (function(){ var classProp = 'className', forProp = 'for', el = document.createElement('div'); el.setAttribute(classProp, 'x'); if (el.className !== 'x') { el.setAttribute('class', 'x'); if (el.className === 'x') { classProp = 'class'; } } el = null; el = document.createElement('label'); el.setAttribute(forProp, 'x'); if (el.htmlFor !== 'x') { el.setAttribute('htmlFor', 'x'); if (el.htmlFor === 'x') { forProp = 'htmlFor'; } } el = null; return { read: { names: { 'class': classProp, 'className': classProp, 'for': forProp, 'htmlFor': forProp }, values: { _getAttr: function(element, attribute) { return element.getAttribute(attribute); }, _getAttr2: function(element, attribute) { return element.getAttribute(attribute, 2); }, _getAttrNode: function(element, attribute) { var node = element.getAttributeNode(attribute); return node ? node.value : ""; }, _getEv: (function(){ var el = document.createElement('div'), f; el.onclick = Prototype.emptyFunction; var value = el.getAttribute('onclick'); if (String(value).indexOf('{') > -1) { f = function(element, attribute) { attribute = element.getAttribute(attribute); if (!attribute) return null; attribute = attribute.toString(); attribute = attribute.split('{')[1]; attribute = attribute.split('}')[0]; return attribute.strip(); }; } else if (value === '') { f = function(element, attribute) { attribute = element.getAttribute(attribute); if (!attribute) return null; return attribute.strip(); }; } el = null; return f; })(), _flag: function(element, attribute) { return $(element).hasAttribute(attribute) ? attribute : null; }, style: function(element) { return element.style.cssText.toLowerCase(); }, title: function(element) { return element.title; } } } } })(); Element._attributeTranslations.write = { names: Object.extend({ cellpadding: 'cellPadding', cellspacing: 'cellSpacing' }, Element._attributeTranslations.read.names), values: { checked: function(element, value) { element.checked = !!value; }, style: function(element, value) { element.style.cssText = value ? value : ''; } } }; Element._attributeTranslations.has = {}; $w('colSpan rowSpan vAlign dateTime accessKey tabIndex ' + 'encType maxLength readOnly longDesc frameBorder').each(function(attr) { Element._attributeTranslations.write.names[attr.toLowerCase()] = attr; Element._attributeTranslations.has[attr.toLowerCase()] = attr; }); (function(v) { Object.extend(v, { href: v._getAttr2, src: v._getAttr2, type: v._getAttr, action: v._getAttrNode, disabled: v._flag, checked: v._flag, readonly: v._flag, multiple: v._flag, onload: v._getEv, onunload: v._getEv, onclick: v._getEv, ondblclick: v._getEv, onmousedown: v._getEv, onmouseup: v._getEv, onmouseover: v._getEv, onmousemove: v._getEv, onmouseout: v._getEv, onfocus: v._getEv, onblur: v._getEv, onkeypress: v._getEv, onkeydown: v._getEv, onkeyup: v._getEv, onsubmit: v._getEv, onreset: v._getEv, onselect: v._getEv, onchange: v._getEv }); })(Element._attributeTranslations.read.values); if (Prototype.BrowserFeatures.ElementExtensions) { (function() { function _descendants(element) { var nodes = element.getElementsByTagName('*'), results = []; for (var i = 0, node; node = nodes[i]; i++) if (node.tagName !== "!") // Filter out comment nodes. results.push(node); return results; } Element.Methods.down = function(element, expression, index) { element = $(element); if (arguments.length == 1) return element.firstDescendant(); return Object.isNumber(expression) ? _descendants(element)[expression] : Element.select(element, expression)[index || 0]; } })(); } } else if (Prototype.Browser.Gecko && /rv:1\.8\.0/.test(navigator.userAgent)) { Element.Methods.setOpacity = function(element, value) { element = $(element); element.style.opacity = (value == 1) ? 0.999999 : (value === '') ? '' : (value < 0.00001) ? 0 : value; return element; }; } else if (Prototype.Browser.WebKit) { Element.Methods.setOpacity = function(element, value) { element = $(element); element.style.opacity = (value == 1 || value === '') ? '' : (value < 0.00001) ? 0 : value; if (value == 1) if (element.tagName.toUpperCase() == 'IMG' && element.width) { element.width++; element.width--; } else try { var n = document.createTextNode(' '); element.appendChild(n); element.removeChild(n); } catch (e) { } return element; }; Element.Methods.cumulativeOffset = function(element) { var valueT = 0, valueL = 0; do { valueT += element.offsetTop || 0; valueL += element.offsetLeft || 0; if (element.offsetParent == document.body) if (Element.getStyle(element, 'position') == 'absolute') break; element = element.offsetParent; } while (element); return Element._returnOffset(valueL, valueT); }; } if ('outerHTML' in document.documentElement) { Element.Methods.replace = function(element, content) { element = $(element); if (content && content.toElement) content = content.toElement(); if (Object.isElement(content)) { element.parentNode.replaceChild(content, element); return element; } content = Object.toHTML(content); var parent = element.parentNode, tagName = parent.tagName.toUpperCase(); if (Element._insertionTranslations.tags[tagName]) { var nextSibling = element.next(), fragments = Element._getContentFromAnonymousElement(tagName, content.stripScripts()); parent.removeChild(element); if (nextSibling) fragments.each(function(node) { parent.insertBefore(node, nextSibling) }); else fragments.each(function(node) { parent.appendChild(node) }); } else element.outerHTML = content.stripScripts(); content.evalScripts.bind(content).defer(); return element; }; } Element._returnOffset = function(l, t) { var result = [l, t]; result.left = l; result.top = t; return result; }; Element._getContentFromAnonymousElement = function(tagName, html) { var div = new Element('div'), t = Element._insertionTranslations.tags[tagName]; if (t) { div.innerHTML = t[0] + html + t[1]; for (var i = t[2]; i--; ) { div = div.firstChild; } } else { div.innerHTML = html; } return $A(div.childNodes); }; Element._insertionTranslations = { before: function(element, node) { element.parentNode.insertBefore(node, element); }, top: function(element, node) { element.insertBefore(node, element.firstChild); }, bottom: function(element, node) { element.appendChild(node); }, after: function(element, node) { element.parentNode.insertBefore(node, element.nextSibling); }, tags: { TABLE: ['', '
    ', 1], TBODY: ['', '
    ', 2], TR: ['', '
    ', 3], TD: ['
    ', '
    ', 4], SELECT: ['', 1] } }; (function() { var tags = Element._insertionTranslations.tags; Object.extend(tags, { THEAD: tags.TBODY, TFOOT: tags.TBODY, TH: tags.TD }); })(); Element.Methods.Simulated = { hasAttribute: function(element, attribute) { attribute = Element._attributeTranslations.has[attribute] || attribute; var node = $(element).getAttributeNode(attribute); return !!(node && node.specified); } }; Element.Methods.ByTag = { }; Object.extend(Element, Element.Methods); (function(div) { if (!Prototype.BrowserFeatures.ElementExtensions && div['__proto__']) { window.HTMLElement = { }; window.HTMLElement.prototype = div['__proto__']; Prototype.BrowserFeatures.ElementExtensions = true; } div = null; })(document.createElement('div')); Element.extend = (function() { function checkDeficiency(tagName) { if (typeof window.Element != 'undefined') { var proto = window.Element.prototype; if (proto) { var id = '_' + (Math.random()+'').slice(2), el = document.createElement(tagName); proto[id] = 'x'; var isBuggy = (el[id] !== 'x'); delete proto[id]; el = null; return isBuggy; } } return false; } function extendElementWith(element, methods) { for (var property in methods) { var value = methods[property]; if (Object.isFunction(value) && !(property in element)) element[property] = value.methodize(); } } var HTMLOBJECTELEMENT_PROTOTYPE_BUGGY = checkDeficiency('object'); if (Prototype.BrowserFeatures.SpecificElementExtensions) { if (HTMLOBJECTELEMENT_PROTOTYPE_BUGGY) { return function(element) { if (element && typeof element._extendedByPrototype == 'undefined') { var t = element.tagName; if (t && (/^(?:object|applet|embed)$/i.test(t))) { extendElementWith(element, Element.Methods); extendElementWith(element, Element.Methods.Simulated); extendElementWith(element, Element.Methods.ByTag[t.toUpperCase()]); } } return element; } } return Prototype.K; } var Methods = { }, ByTag = Element.Methods.ByTag; var extend = Object.extend(function(element) { if (!element || typeof element._extendedByPrototype != 'undefined' || element.nodeType != 1 || element == window) return element; var methods = Object.clone(Methods), tagName = element.tagName.toUpperCase(); if (ByTag[tagName]) Object.extend(methods, ByTag[tagName]); extendElementWith(element, methods); element._extendedByPrototype = Prototype.emptyFunction; return element; }, { refresh: function() { if (!Prototype.BrowserFeatures.ElementExtensions) { Object.extend(Methods, Element.Methods); Object.extend(Methods, Element.Methods.Simulated); } } }); extend.refresh(); return extend; })(); if (document.documentElement.hasAttribute) { Element.hasAttribute = function(element, attribute) { return element.hasAttribute(attribute); }; } else { Element.hasAttribute = Element.Methods.Simulated.hasAttribute; } Element.addMethods = function(methods) { var F = Prototype.BrowserFeatures, T = Element.Methods.ByTag; if (!methods) { Object.extend(Form, Form.Methods); Object.extend(Form.Element, Form.Element.Methods); Object.extend(Element.Methods.ByTag, { "FORM": Object.clone(Form.Methods), "INPUT": Object.clone(Form.Element.Methods), "SELECT": Object.clone(Form.Element.Methods), "TEXTAREA": Object.clone(Form.Element.Methods) }); } if (arguments.length == 2) { var tagName = methods; methods = arguments[1]; } if (!tagName) Object.extend(Element.Methods, methods || { }); else { if (Object.isArray(tagName)) tagName.each(extend); else extend(tagName); } function extend(tagName) { tagName = tagName.toUpperCase(); if (!Element.Methods.ByTag[tagName]) Element.Methods.ByTag[tagName] = { }; Object.extend(Element.Methods.ByTag[tagName], methods); } function copy(methods, destination, onlyIfAbsent) { onlyIfAbsent = onlyIfAbsent || false; for (var property in methods) { var value = methods[property]; if (!Object.isFunction(value)) continue; if (!onlyIfAbsent || !(property in destination)) destination[property] = value.methodize(); } } function findDOMClass(tagName) { var klass; var trans = { "OPTGROUP": "OptGroup", "TEXTAREA": "TextArea", "P": "Paragraph", "FIELDSET": "FieldSet", "UL": "UList", "OL": "OList", "DL": "DList", "DIR": "Directory", "H1": "Heading", "H2": "Heading", "H3": "Heading", "H4": "Heading", "H5": "Heading", "H6": "Heading", "Q": "Quote", "INS": "Mod", "DEL": "Mod", "A": "Anchor", "IMG": "Image", "CAPTION": "TableCaption", "COL": "TableCol", "COLGROUP": "TableCol", "THEAD": "TableSection", "TFOOT": "TableSection", "TBODY": "TableSection", "TR": "TableRow", "TH": "TableCell", "TD": "TableCell", "FRAMESET": "FrameSet", "IFRAME": "IFrame" }; if (trans[tagName]) klass = 'HTML' + trans[tagName] + 'Element'; if (window[klass]) return window[klass]; klass = 'HTML' + tagName + 'Element'; if (window[klass]) return window[klass]; klass = 'HTML' + tagName.capitalize() + 'Element'; if (window[klass]) return window[klass]; var element = document.createElement(tagName), proto = element['__proto__'] || element.constructor.prototype; element = null; return proto; } var elementPrototype = window.HTMLElement ? HTMLElement.prototype : Element.prototype; if (F.ElementExtensions) { copy(Element.Methods, elementPrototype); copy(Element.Methods.Simulated, elementPrototype, true); } if (F.SpecificElementExtensions) { for (var tag in Element.Methods.ByTag) { var klass = findDOMClass(tag); if (Object.isUndefined(klass)) continue; copy(T[tag], klass.prototype); } } Object.extend(Element, Element.Methods); delete Element.ByTag; if (Element.extend.refresh) Element.extend.refresh(); Element.cache = { }; }; document.viewport = { getDimensions: function() { return { width: this.getWidth(), height: this.getHeight() }; }, getScrollOffsets: function() { return Element._returnOffset( window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft, window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop); } }; (function(viewport) { var B = Prototype.Browser, doc = document, element, property = {}; function getRootElement() { if (B.WebKit && !doc.evaluate) return document; if (B.Opera && window.parseFloat(window.opera.version()) < 9.5) return document.body; return document.documentElement; } function define(D) { if (!element) element = getRootElement(); property[D] = 'client' + D; viewport['get' + D] = function() { return element[property[D]] }; return viewport['get' + D](); } viewport.getWidth = define.curry('Width'); viewport.getHeight = define.curry('Height'); })(document.viewport); Element.Storage = { UID: 1 }; Element.addMethods({ getStorage: function(element) { if (!(element = $(element))) return; var uid; if (element === window) { uid = 0; } else { if (typeof element._prototypeUID === "undefined") element._prototypeUID = Element.Storage.UID++; uid = element._prototypeUID; } if (!Element.Storage[uid]) Element.Storage[uid] = $H(); return Element.Storage[uid]; }, store: function(element, key, value) { if (!(element = $(element))) return; if (arguments.length === 2) { Element.getStorage(element).update(key); } else { Element.getStorage(element).set(key, value); } return element; }, retrieve: function(element, key, defaultValue) { if (!(element = $(element))) return; var hash = Element.getStorage(element), value = hash.get(key); if (Object.isUndefined(value)) { hash.set(key, defaultValue); value = defaultValue; } return value; }, clone: function(element, deep) { if (!(element = $(element))) return; var clone = element.cloneNode(deep); clone._prototypeUID = void 0; if (deep) { var descendants = Element.select(clone, '*'), i = descendants.length; while (i--) { descendants[i]._prototypeUID = void 0; } } return Element.extend(clone); }, purge: function(element) { if (!(element = $(element))) return; purgeElement(element); var descendants = element.getElementsByTagName('*'), i = descendants.length; while (i--) purgeElement(descendants[i]); return null; } }); (function() { function toDecimal(pctString) { var match = pctString.match(/^(\d+)%?$/i); if (!match) return null; return (Number(match[1]) / 100); } function getPixelValue(value, property) { if (Object.isElement(value)) { element = value; value = element.getStyle(property); } if (value === null) { return null; } if ((/^(?:-)?\d+(\.\d+)?(px)?$/i).test(value)) { return window.parseFloat(value); } if (/\d/.test(value) && element.runtimeStyle) { var style = element.style.left, rStyle = element.runtimeStyle.left; element.runtimeStyle.left = element.currentStyle.left; element.style.left = value || 0; value = element.style.pixelLeft; element.style.left = style; element.runtimeStyle.left = rStyle; return value; } if (value.include('%')) { var decimal = toDecimal(value); var whole; if (property.include('left') || property.include('right') || property.include('width')) { whole = $(element.parentNode).measure('width'); } else if (property.include('top') || property.include('bottom') || property.include('height')) { whole = $(element.parentNode).measure('height'); } return whole * decimal; } return 0; } function toCSSPixels(number) { if (Object.isString(number) && number.endsWith('px')) { return number; } return number + 'px'; } function isDisplayed(element) { var originalElement = element; while (element && element.parentNode) { var display = element.getStyle('display'); if (display === 'none') { return false; } element = $(element.parentNode); } return true; } var hasLayout = Prototype.K; if ('currentStyle' in document.documentElement) { hasLayout = function(element) { if (!element.currentStyle.hasLayout) { element.style.zoom = 1; } return element; }; } function cssNameFor(key) { if (key.include('border')) key = key + '-width'; return key.camelize(); } Element.Layout = Class.create(Hash, { initialize: function($super, element, preCompute) { $super(); this.element = $(element); Element.Layout.PROPERTIES.each( function(property) { this._set(property, null); }, this); if (preCompute) { this._preComputing = true; this._begin(); Element.Layout.PROPERTIES.each( this._compute, this ); this._end(); this._preComputing = false; } }, _set: function(property, value) { return Hash.prototype.set.call(this, property, value); }, set: function(property, value) { throw "Properties of Element.Layout are read-only."; }, get: function($super, property) { var value = $super(property); return value === null ? this._compute(property) : value; }, _begin: function() { if (this._prepared) return; var element = this.element; if (isDisplayed(element)) { this._prepared = true; return; } var originalStyles = { position: element.style.position || '', width: element.style.width || '', visibility: element.style.visibility || '', display: element.style.display || '' }; element.store('prototype_original_styles', originalStyles); var position = element.getStyle('position'), width = element.getStyle('width'); element.setStyle({ position: 'absolute', visibility: 'hidden', display: 'block' }); var positionedWidth = element.getStyle('width'); var newWidth; if (width && (positionedWidth === width)) { newWidth = getPixelValue(width); } else if (width && (position === 'absolute' || position === 'fixed')) { newWidth = getPixelValue(width); } else { var parent = element.parentNode, pLayout = $(parent).getLayout(); newWidth = pLayout.get('width') - this.get('margin-left') - this.get('border-left') - this.get('padding-left') - this.get('padding-right') - this.get('border-right') - this.get('margin-right'); } element.setStyle({ width: newWidth + 'px' }); this._prepared = true; }, _end: function() { var element = this.element; var originalStyles = element.retrieve('prototype_original_styles'); element.store('prototype_original_styles', null); element.setStyle(originalStyles); this._prepared = false; }, _compute: function(property) { var COMPUTATIONS = Element.Layout.COMPUTATIONS; if (!(property in COMPUTATIONS)) { throw "Property not found."; } return this._set(property, COMPUTATIONS[property].call(this, this.element)); }, toObject: function() { var args = $A(arguments); var keys = (args.length === 0) ? Element.Layout.PROPERTIES : args.join(' ').split(' '); var obj = {}; keys.each( function(key) { if (!Element.Layout.PROPERTIES.include(key)) return; var value = this.get(key); if (value != null) obj[key] = value; }, this); return obj; }, toHash: function() { var obj = this.toObject.apply(this, arguments); return new Hash(obj); }, toCSS: function() { var args = $A(arguments); var keys = (args.length === 0) ? Element.Layout.PROPERTIES : args.join(' ').split(' '); var css = {}; keys.each( function(key) { if (!Element.Layout.PROPERTIES.include(key)) return; if (Element.Layout.COMPOSITE_PROPERTIES.include(key)) return; var value = this.get(key); if (value != null) css[cssNameFor(key)] = value + 'px'; }, this); return css; }, inspect: function() { return "#"; } }); Object.extend(Element.Layout, { PROPERTIES: $w('height width top left right bottom border-left border-right border-top border-bottom padding-left padding-right padding-top padding-bottom margin-top margin-bottom margin-left margin-right padding-box-width padding-box-height border-box-width border-box-height margin-box-width margin-box-height'), COMPOSITE_PROPERTIES: $w('padding-box-width padding-box-height margin-box-width margin-box-height border-box-width border-box-height'), COMPUTATIONS: { 'height': function(element) { if (!this._preComputing) this._begin(); var bHeight = this.get('border-box-height'); if (bHeight <= 0) return 0; var bTop = this.get('border-top'), bBottom = this.get('border-bottom'); var pTop = this.get('padding-top'), pBottom = this.get('padding-bottom'); if (!this._preComputing) this._end(); return bHeight - bTop - bBottom - pTop - pBottom; }, 'width': function(element) { if (!this._preComputing) this._begin(); var bWidth = this.get('border-box-width'); if (bWidth <= 0) return 0; var bLeft = this.get('border-left'), bRight = this.get('border-right'); var pLeft = this.get('padding-left'), pRight = this.get('padding-right'); if (!this._preComputing) this._end(); return bWidth - bLeft - bRight - pLeft - pRight; }, 'padding-box-height': function(element) { var height = this.get('height'), pTop = this.get('padding-top'), pBottom = this.get('padding-bottom'); return height + pTop + pBottom; }, 'padding-box-width': function(element) { var width = this.get('width'), pLeft = this.get('padding-left'), pRight = this.get('padding-right'); return width + pLeft + pRight; }, 'border-box-height': function(element) { return element.offsetHeight; }, 'border-box-width': function(element) { return element.offsetWidth; }, 'margin-box-height': function(element) { var bHeight = this.get('border-box-height'), mTop = this.get('margin-top'), mBottom = this.get('margin-bottom'); if (bHeight <= 0) return 0; return bHeight + mTop + mBottom; }, 'margin-box-width': function(element) { var bWidth = this.get('border-box-width'), mLeft = this.get('margin-left'), mRight = this.get('margin-right'); if (bWidth <= 0) return 0; return bWidth + mLeft + mRight; }, 'top': function(element) { var offset = element.positionedOffset(); return offset.top; }, 'bottom': function(element) { var offset = element.positionedOffset(), parent = element.getOffsetParent(), pHeight = parent.measure('height'); var mHeight = this.get('border-box-height'); return pHeight - mHeight - offset.top; }, 'left': function(element) { var offset = element.positionedOffset(); return offset.left; }, 'right': function(element) { var offset = element.positionedOffset(), parent = element.getOffsetParent(), pWidth = parent.measure('width'); var mWidth = this.get('border-box-width'); return pWidth - mWidth - offset.left; }, 'padding-top': function(element) { return getPixelValue(element, 'paddingTop'); }, 'padding-bottom': function(element) { return getPixelValue(element, 'paddingBottom'); }, 'padding-left': function(element) { return getPixelValue(element, 'paddingLeft'); }, 'padding-right': function(element) { return getPixelValue(element, 'paddingRight'); }, 'border-top': function(element) { return Object.isNumber(element.clientTop) ? element.clientTop : getPixelValue(element, 'borderTopWidth'); }, 'border-bottom': function(element) { return Object.isNumber(element.clientBottom) ? element.clientBottom : getPixelValue(element, 'borderBottomWidth'); }, 'border-left': function(element) { return Object.isNumber(element.clientLeft) ? element.clientLeft : getPixelValue(element, 'borderLeftWidth'); }, 'border-right': function(element) { return Object.isNumber(element.clientRight) ? element.clientRight : getPixelValue(element, 'borderRightWidth'); }, 'margin-top': function(element) { return getPixelValue(element, 'marginTop'); }, 'margin-bottom': function(element) { return getPixelValue(element, 'marginBottom'); }, 'margin-left': function(element) { return getPixelValue(element, 'marginLeft'); }, 'margin-right': function(element) { return getPixelValue(element, 'marginRight'); } } }); if ('getBoundingClientRect' in document.documentElement) { Object.extend(Element.Layout.COMPUTATIONS, { 'right': function(element) { var parent = hasLayout(element.getOffsetParent()); var rect = element.getBoundingClientRect(), pRect = parent.getBoundingClientRect(); return (pRect.right - rect.right).round(); }, 'bottom': function(element) { var parent = hasLayout(element.getOffsetParent()); var rect = element.getBoundingClientRect(), pRect = parent.getBoundingClientRect(); return (pRect.bottom - rect.bottom).round(); } }); } Element.Offset = Class.create({ initialize: function(left, top) { this.left = left.round(); this.top = top.round(); this[0] = this.left; this[1] = this.top; }, relativeTo: function(offset) { return new Element.Offset( this.left - offset.left, this.top - offset.top ); }, inspect: function() { return "#".interpolate(this); }, toString: function() { return "[#{left}, #{top}]".interpolate(this); }, toArray: function() { return [this.left, this.top]; } }); function getLayout(element, preCompute) { return new Element.Layout(element, preCompute); } function measure(element, property) { return $(element).getLayout().get(property); } function getDimensions(element) { var layout = $(element).getLayout(); return { width: layout.get('width'), height: layout.get('height') }; } function getOffsetParent(element) { if (isDetached(element)) return $(document.body); var isInline = (Element.getStyle(element, 'display') === 'inline'); if (!isInline && element.offsetParent) return $(element.offsetParent); if (element === document.body) return $(element); while ((element = element.parentNode) && element !== document.body) { if (Element.getStyle(element, 'position') !== 'static') { return (element.nodeName === 'HTML') ? $(document.body) : $(element); } } return $(document.body); } function cumulativeOffset(element) { var valueT = 0, valueL = 0; do { valueT += element.offsetTop || 0; valueL += element.offsetLeft || 0; element = element.offsetParent; } while (element); return new Element.Offset(valueL, valueT); } function positionedOffset(element) { var layout = element.getLayout(); var valueT = 0, valueL = 0; do { valueT += element.offsetTop || 0; valueL += element.offsetLeft || 0; element = element.offsetParent; if (element) { if (isBody(element)) break; var p = Element.getStyle(element, 'position'); if (p !== 'static') break; } } while (element); valueL -= layout.get('margin-top'); valueT -= layout.get('margin-left'); return new Element.Offset(valueL, valueT); } function cumulativeScrollOffset(element) { var valueT = 0, valueL = 0; do { valueT += element.scrollTop || 0; valueL += element.scrollLeft || 0; element = element.parentNode; } while (element); return new Element.Offset(valueL, valueT); } function viewportOffset(forElement) { var valueT = 0, valueL = 0, docBody = document.body; var element = forElement; do { valueT += element.offsetTop || 0; valueL += element.offsetLeft || 0; if (element.offsetParent == docBody && Element.getStyle(element, 'position') == 'absolute') break; } while (element = element.offsetParent); element = forElement; do { if (element != docBody) { valueT -= element.scrollTop || 0; valueL -= element.scrollLeft || 0; } } while (element = element.parentNode); return new Element.Offset(valueL, valueT); } function absolutize(element) { element = $(element); if (Element.getStyle(element, 'position') === 'absolute') { return element; } var offsetParent = getOffsetParent(element); var eOffset = element.viewportOffset(), pOffset = offsetParent.viewportOffset(); var offset = eOffset.relativeTo(pOffset); var layout = element.getLayout(); element.store('prototype_absolutize_original_styles', { left: element.getStyle('left'), top: element.getStyle('top'), width: element.getStyle('width'), height: element.getStyle('height') }); element.setStyle({ position: 'absolute', top: offset.top + 'px', left: offset.left + 'px', width: layout.get('width') + 'px', height: layout.get('height') + 'px' }); return element; } function relativize(element) { element = $(element); if (Element.getStyle(element, 'position') === 'relative') { return element; } var originalStyles = element.retrieve('prototype_absolutize_original_styles'); if (originalStyles) element.setStyle(originalStyles); return element; } Element.addMethods({ getLayout: getLayout, measure: measure, getDimensions: getDimensions, getOffsetParent: getOffsetParent, cumulativeOffset: cumulativeOffset, positionedOffset: positionedOffset, cumulativeScrollOffset: cumulativeScrollOffset, viewportOffset: viewportOffset, absolutize: absolutize, relativize: relativize }); function isBody(element) { return element.nodeName.toUpperCase() === 'BODY'; } function isDetached(element) { return element !== document.body && !Element.descendantOf(element, document.body); } if ('getBoundingClientRect' in document.documentElement) { Element.addMethods({ viewportOffset: function(element) { element = $(element); if (isDetached(element)) return new Element.Offset(0, 0); var rect = element.getBoundingClientRect(), docEl = document.documentElement; return new Element.Offset(rect.left - docEl.clientLeft, rect.top - docEl.clientTop); }, positionedOffset: function(element) { element = $(element); var parent = element.getOffsetParent(); if (isDetached(element)) return new Element.Offset(0, 0); if (element.offsetParent && element.offsetParent.nodeName.toUpperCase() === 'HTML') { return positionedOffset(element); } var eOffset = element.viewportOffset(), pOffset = isBody(parent) ? viewportOffset(parent) : parent.viewportOffset(); var retOffset = eOffset.relativeTo(pOffset); var layout = element.getLayout(); var top = retOffset.top - layout.get('margin-top'); var left = retOffset.left - layout.get('margin-left'); return new Element.Offset(left, top); } }); } })(); window.$$ = function() { var expression = $A(arguments).join(', '); return Prototype.Selector.select(expression, document); }; Prototype.Selector = (function() { function select() { throw new Error('Method "Prototype.Selector.select" must be defined.'); } function match() { throw new Error('Method "Prototype.Selector.match" must be defined.'); } function find(elements, expression, index) { index = index || 0; var match = Prototype.Selector.match, length = elements.length, matchIndex = 0, i; for (i = 0; i < length; i++) { if (match(elements[i], expression) && index == matchIndex++) { return Element.extend(elements[i]); } } } function extendElements(elements) { for (var i = 0, length = elements.length; i < length; i++) { Element.extend(elements[i]); } return elements; } var K = Prototype.K; return { select: select, match: match, find: find, extendElements: (Element.extend === K) ? K : extendElements, extendElement: Element.extend }; })(); Prototype._original_property = window.Sizzle; /*! * Sizzle CSS Selector Engine - v1.0 * Copyright 2009, The Dojo Foundation * Released under the MIT, BSD, and GPL Licenses. * More information: http://sizzlejs.com/ */ (function(){ var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, done = 0, toString = Object.prototype.toString, hasDuplicate = false, baseHasDuplicate = true; [0, 0].sort(function(){ baseHasDuplicate = false; return 0; }); var Sizzle = function(selector, context, results, seed) { results = results || []; var origContext = context = context || document; if ( context.nodeType !== 1 && context.nodeType !== 9 ) { return []; } if ( !selector || typeof selector !== "string" ) { return results; } var parts = [], m, set, checkSet, check, mode, extra, prune = true, contextXML = isXML(context), soFar = selector; while ( (chunker.exec(""), m = chunker.exec(soFar)) !== null ) { soFar = m[3]; parts.push( m[1] ); if ( m[2] ) { extra = m[3]; break; } } if ( parts.length > 1 && origPOS.exec( selector ) ) { if ( parts.length === 2 && Expr.relative[ parts[0] ] ) { set = posProcess( parts[0] + parts[1], context ); } else { set = Expr.relative[ parts[0] ] ? [ context ] : Sizzle( parts.shift(), context ); while ( parts.length ) { selector = parts.shift(); if ( Expr.relative[ selector ] ) selector += parts.shift(); set = posProcess( selector, set ); } } } else { if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML && Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) { var ret = Sizzle.find( parts.shift(), context, contextXML ); context = ret.expr ? Sizzle.filter( ret.expr, ret.set )[0] : ret.set[0]; } if ( context ) { var ret = seed ? { expr: parts.pop(), set: makeArray(seed) } : Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML ); set = ret.expr ? Sizzle.filter( ret.expr, ret.set ) : ret.set; if ( parts.length > 0 ) { checkSet = makeArray(set); } else { prune = false; } while ( parts.length ) { var cur = parts.pop(), pop = cur; if ( !Expr.relative[ cur ] ) { cur = ""; } else { pop = parts.pop(); } if ( pop == null ) { pop = context; } Expr.relative[ cur ]( checkSet, pop, contextXML ); } } else { checkSet = parts = []; } } if ( !checkSet ) { checkSet = set; } if ( !checkSet ) { throw "Syntax error, unrecognized expression: " + (cur || selector); } if ( toString.call(checkSet) === "[object Array]" ) { if ( !prune ) { results.push.apply( results, checkSet ); } else if ( context && context.nodeType === 1 ) { for ( var i = 0; checkSet[i] != null; i++ ) { if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && contains(context, checkSet[i])) ) { results.push( set[i] ); } } } else { for ( var i = 0; checkSet[i] != null; i++ ) { if ( checkSet[i] && checkSet[i].nodeType === 1 ) { results.push( set[i] ); } } } } else { makeArray( checkSet, results ); } if ( extra ) { Sizzle( extra, origContext, results, seed ); Sizzle.uniqueSort( results ); } return results; }; Sizzle.uniqueSort = function(results){ if ( sortOrder ) { hasDuplicate = baseHasDuplicate; results.sort(sortOrder); if ( hasDuplicate ) { for ( var i = 1; i < results.length; i++ ) { if ( results[i] === results[i-1] ) { results.splice(i--, 1); } } } } return results; }; Sizzle.matches = function(expr, set){ return Sizzle(expr, null, null, set); }; Sizzle.find = function(expr, context, isXML){ var set, match; if ( !expr ) { return []; } for ( var i = 0, l = Expr.order.length; i < l; i++ ) { var type = Expr.order[i], match; if ( (match = Expr.leftMatch[ type ].exec( expr )) ) { var left = match[1]; match.splice(1,1); if ( left.substr( left.length - 1 ) !== "\\" ) { match[1] = (match[1] || "").replace(/\\/g, ""); set = Expr.find[ type ]( match, context, isXML ); if ( set != null ) { expr = expr.replace( Expr.match[ type ], "" ); break; } } } } if ( !set ) { set = context.getElementsByTagName("*"); } return {set: set, expr: expr}; }; Sizzle.filter = function(expr, set, inplace, not){ var old = expr, result = [], curLoop = set, match, anyFound, isXMLFilter = set && set[0] && isXML(set[0]); while ( expr && set.length ) { for ( var type in Expr.filter ) { if ( (match = Expr.match[ type ].exec( expr )) != null ) { var filter = Expr.filter[ type ], found, item; anyFound = false; if ( curLoop == result ) { result = []; } if ( Expr.preFilter[ type ] ) { match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter ); if ( !match ) { anyFound = found = true; } else if ( match === true ) { continue; } } if ( match ) { for ( var i = 0; (item = curLoop[i]) != null; i++ ) { if ( item ) { found = filter( item, match, i, curLoop ); var pass = not ^ !!found; if ( inplace && found != null ) { if ( pass ) { anyFound = true; } else { curLoop[i] = false; } } else if ( pass ) { result.push( item ); anyFound = true; } } } } if ( found !== undefined ) { if ( !inplace ) { curLoop = result; } expr = expr.replace( Expr.match[ type ], "" ); if ( !anyFound ) { return []; } break; } } } if ( expr == old ) { if ( anyFound == null ) { throw "Syntax error, unrecognized expression: " + expr; } else { break; } } old = expr; } return curLoop; }; var Expr = Sizzle.selectors = { order: [ "ID", "NAME", "TAG" ], match: { ID: /#((?:[\w\u00c0-\uFFFF-]|\\.)+)/, CLASS: /\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/, NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/, ATTR: /\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/, TAG: /^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/, CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/, POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/, PSEUDO: /:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/ }, leftMatch: {}, attrMap: { "class": "className", "for": "htmlFor" }, attrHandle: { href: function(elem){ return elem.getAttribute("href"); } }, relative: { "+": function(checkSet, part, isXML){ var isPartStr = typeof part === "string", isTag = isPartStr && !/\W/.test(part), isPartStrNotTag = isPartStr && !isTag; if ( isTag && !isXML ) { part = part.toUpperCase(); } for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) { if ( (elem = checkSet[i]) ) { while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {} checkSet[i] = isPartStrNotTag || elem && elem.nodeName === part ? elem || false : elem === part; } } if ( isPartStrNotTag ) { Sizzle.filter( part, checkSet, true ); } }, ">": function(checkSet, part, isXML){ var isPartStr = typeof part === "string"; if ( isPartStr && !/\W/.test(part) ) { part = isXML ? part : part.toUpperCase(); for ( var i = 0, l = checkSet.length; i < l; i++ ) { var elem = checkSet[i]; if ( elem ) { var parent = elem.parentNode; checkSet[i] = parent.nodeName === part ? parent : false; } } } else { for ( var i = 0, l = checkSet.length; i < l; i++ ) { var elem = checkSet[i]; if ( elem ) { checkSet[i] = isPartStr ? elem.parentNode : elem.parentNode === part; } } if ( isPartStr ) { Sizzle.filter( part, checkSet, true ); } } }, "": function(checkSet, part, isXML){ var doneName = done++, checkFn = dirCheck; if ( !/\W/.test(part) ) { var nodeCheck = part = isXML ? part : part.toUpperCase(); checkFn = dirNodeCheck; } checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML); }, "~": function(checkSet, part, isXML){ var doneName = done++, checkFn = dirCheck; if ( typeof part === "string" && !/\W/.test(part) ) { var nodeCheck = part = isXML ? part : part.toUpperCase(); checkFn = dirNodeCheck; } checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML); } }, find: { ID: function(match, context, isXML){ if ( typeof context.getElementById !== "undefined" && !isXML ) { var m = context.getElementById(match[1]); return m ? [m] : []; } }, NAME: function(match, context, isXML){ if ( typeof context.getElementsByName !== "undefined" ) { var ret = [], results = context.getElementsByName(match[1]); for ( var i = 0, l = results.length; i < l; i++ ) { if ( results[i].getAttribute("name") === match[1] ) { ret.push( results[i] ); } } return ret.length === 0 ? null : ret; } }, TAG: function(match, context){ return context.getElementsByTagName(match[1]); } }, preFilter: { CLASS: function(match, curLoop, inplace, result, not, isXML){ match = " " + match[1].replace(/\\/g, "") + " "; if ( isXML ) { return match; } for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) { if ( elem ) { if ( not ^ (elem.className && (" " + elem.className + " ").indexOf(match) >= 0) ) { if ( !inplace ) result.push( elem ); } else if ( inplace ) { curLoop[i] = false; } } } return false; }, ID: function(match){ return match[1].replace(/\\/g, ""); }, TAG: function(match, curLoop){ for ( var i = 0; curLoop[i] === false; i++ ){} return curLoop[i] && isXML(curLoop[i]) ? match[1] : match[1].toUpperCase(); }, CHILD: function(match){ if ( match[1] == "nth" ) { var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec( match[2] == "even" && "2n" || match[2] == "odd" && "2n+1" || !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]); match[2] = (test[1] + (test[2] || 1)) - 0; match[3] = test[3] - 0; } match[0] = done++; return match; }, ATTR: function(match, curLoop, inplace, result, not, isXML){ var name = match[1].replace(/\\/g, ""); if ( !isXML && Expr.attrMap[name] ) { match[1] = Expr.attrMap[name]; } if ( match[2] === "~=" ) { match[4] = " " + match[4] + " "; } return match; }, PSEUDO: function(match, curLoop, inplace, result, not){ if ( match[1] === "not" ) { if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) { match[3] = Sizzle(match[3], null, null, curLoop); } else { var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not); if ( !inplace ) { result.push.apply( result, ret ); } return false; } } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) { return true; } return match; }, POS: function(match){ match.unshift( true ); return match; } }, filters: { enabled: function(elem){ return elem.disabled === false && elem.type !== "hidden"; }, disabled: function(elem){ return elem.disabled === true; }, checked: function(elem){ return elem.checked === true; }, selected: function(elem){ elem.parentNode.selectedIndex; return elem.selected === true; }, parent: function(elem){ return !!elem.firstChild; }, empty: function(elem){ return !elem.firstChild; }, has: function(elem, i, match){ return !!Sizzle( match[3], elem ).length; }, header: function(elem){ return /h\d/i.test( elem.nodeName ); }, text: function(elem){ return "text" === elem.type; }, radio: function(elem){ return "radio" === elem.type; }, checkbox: function(elem){ return "checkbox" === elem.type; }, file: function(elem){ return "file" === elem.type; }, password: function(elem){ return "password" === elem.type; }, submit: function(elem){ return "submit" === elem.type; }, image: function(elem){ return "image" === elem.type; }, reset: function(elem){ return "reset" === elem.type; }, button: function(elem){ return "button" === elem.type || elem.nodeName.toUpperCase() === "BUTTON"; }, input: function(elem){ return /input|select|textarea|button/i.test(elem.nodeName); } }, setFilters: { first: function(elem, i){ return i === 0; }, last: function(elem, i, match, array){ return i === array.length - 1; }, even: function(elem, i){ return i % 2 === 0; }, odd: function(elem, i){ return i % 2 === 1; }, lt: function(elem, i, match){ return i < match[3] - 0; }, gt: function(elem, i, match){ return i > match[3] - 0; }, nth: function(elem, i, match){ return match[3] - 0 == i; }, eq: function(elem, i, match){ return match[3] - 0 == i; } }, filter: { PSEUDO: function(elem, match, i, array){ var name = match[1], filter = Expr.filters[ name ]; if ( filter ) { return filter( elem, i, match, array ); } else if ( name === "contains" ) { return (elem.textContent || elem.innerText || "").indexOf(match[3]) >= 0; } else if ( name === "not" ) { var not = match[3]; for ( var i = 0, l = not.length; i < l; i++ ) { if ( not[i] === elem ) { return false; } } return true; } }, CHILD: function(elem, match){ var type = match[1], node = elem; switch (type) { case 'only': case 'first': while ( (node = node.previousSibling) ) { if ( node.nodeType === 1 ) return false; } if ( type == 'first') return true; node = elem; case 'last': while ( (node = node.nextSibling) ) { if ( node.nodeType === 1 ) return false; } return true; case 'nth': var first = match[2], last = match[3]; if ( first == 1 && last == 0 ) { return true; } var doneName = match[0], parent = elem.parentNode; if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) { var count = 0; for ( node = parent.firstChild; node; node = node.nextSibling ) { if ( node.nodeType === 1 ) { node.nodeIndex = ++count; } } parent.sizcache = doneName; } var diff = elem.nodeIndex - last; if ( first == 0 ) { return diff == 0; } else { return ( diff % first == 0 && diff / first >= 0 ); } } }, ID: function(elem, match){ return elem.nodeType === 1 && elem.getAttribute("id") === match; }, TAG: function(elem, match){ return (match === "*" && elem.nodeType === 1) || elem.nodeName === match; }, CLASS: function(elem, match){ return (" " + (elem.className || elem.getAttribute("class")) + " ") .indexOf( match ) > -1; }, ATTR: function(elem, match){ var name = match[1], result = Expr.attrHandle[ name ] ? Expr.attrHandle[ name ]( elem ) : elem[ name ] != null ? elem[ name ] : elem.getAttribute( name ), value = result + "", type = match[2], check = match[4]; return result == null ? type === "!=" : type === "=" ? value === check : type === "*=" ? value.indexOf(check) >= 0 : type === "~=" ? (" " + value + " ").indexOf(check) >= 0 : !check ? value && result !== false : type === "!=" ? value != check : type === "^=" ? value.indexOf(check) === 0 : type === "$=" ? value.substr(value.length - check.length) === check : type === "|=" ? value === check || value.substr(0, check.length + 1) === check + "-" : false; }, POS: function(elem, match, i, array){ var name = match[2], filter = Expr.setFilters[ name ]; if ( filter ) { return filter( elem, i, match, array ); } } } }; var origPOS = Expr.match.POS; for ( var type in Expr.match ) { Expr.match[ type ] = new RegExp( Expr.match[ type ].source + /(?![^\[]*\])(?![^\(]*\))/.source ); Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source ); } var makeArray = function(array, results) { array = Array.prototype.slice.call( array, 0 ); if ( results ) { results.push.apply( results, array ); return results; } return array; }; try { Array.prototype.slice.call( document.documentElement.childNodes, 0 ); } catch(e){ makeArray = function(array, results) { var ret = results || []; if ( toString.call(array) === "[object Array]" ) { Array.prototype.push.apply( ret, array ); } else { if ( typeof array.length === "number" ) { for ( var i = 0, l = array.length; i < l; i++ ) { ret.push( array[i] ); } } else { for ( var i = 0; array[i]; i++ ) { ret.push( array[i] ); } } } return ret; }; } var sortOrder; if ( document.documentElement.compareDocumentPosition ) { sortOrder = function( a, b ) { if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) { if ( a == b ) { hasDuplicate = true; } return 0; } var ret = a.compareDocumentPosition(b) & 4 ? -1 : a === b ? 0 : 1; if ( ret === 0 ) { hasDuplicate = true; } return ret; }; } else if ( "sourceIndex" in document.documentElement ) { sortOrder = function( a, b ) { if ( !a.sourceIndex || !b.sourceIndex ) { if ( a == b ) { hasDuplicate = true; } return 0; } var ret = a.sourceIndex - b.sourceIndex; if ( ret === 0 ) { hasDuplicate = true; } return ret; }; } else if ( document.createRange ) { sortOrder = function( a, b ) { if ( !a.ownerDocument || !b.ownerDocument ) { if ( a == b ) { hasDuplicate = true; } return 0; } var aRange = a.ownerDocument.createRange(), bRange = b.ownerDocument.createRange(); aRange.setStart(a, 0); aRange.setEnd(a, 0); bRange.setStart(b, 0); bRange.setEnd(b, 0); var ret = aRange.compareBoundaryPoints(Range.START_TO_END, bRange); if ( ret === 0 ) { hasDuplicate = true; } return ret; }; } (function(){ var form = document.createElement("div"), id = "script" + (new Date).getTime(); form.innerHTML = ""; var root = document.documentElement; root.insertBefore( form, root.firstChild ); if ( !!document.getElementById( id ) ) { Expr.find.ID = function(match, context, isXML){ if ( typeof context.getElementById !== "undefined" && !isXML ) { var m = context.getElementById(match[1]); return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : []; } }; Expr.filter.ID = function(elem, match){ var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); return elem.nodeType === 1 && node && node.nodeValue === match; }; } root.removeChild( form ); root = form = null; // release memory in IE })(); (function(){ var div = document.createElement("div"); div.appendChild( document.createComment("") ); if ( div.getElementsByTagName("*").length > 0 ) { Expr.find.TAG = function(match, context){ var results = context.getElementsByTagName(match[1]); if ( match[1] === "*" ) { var tmp = []; for ( var i = 0; results[i]; i++ ) { if ( results[i].nodeType === 1 ) { tmp.push( results[i] ); } } results = tmp; } return results; }; } div.innerHTML = ""; if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" && div.firstChild.getAttribute("href") !== "#" ) { Expr.attrHandle.href = function(elem){ return elem.getAttribute("href", 2); }; } div = null; // release memory in IE })(); if ( document.querySelectorAll ) (function(){ var oldSizzle = Sizzle, div = document.createElement("div"); div.innerHTML = "

    "; if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) { return; } Sizzle = function(query, context, extra, seed){ context = context || document; if ( !seed && context.nodeType === 9 && !isXML(context) ) { try { return makeArray( context.querySelectorAll(query), extra ); } catch(e){} } return oldSizzle(query, context, extra, seed); }; for ( var prop in oldSizzle ) { Sizzle[ prop ] = oldSizzle[ prop ]; } div = null; // release memory in IE })(); if ( document.getElementsByClassName && document.documentElement.getElementsByClassName ) (function(){ var div = document.createElement("div"); div.innerHTML = "
    "; if ( div.getElementsByClassName("e").length === 0 ) return; div.lastChild.className = "e"; if ( div.getElementsByClassName("e").length === 1 ) return; Expr.order.splice(1, 0, "CLASS"); Expr.find.CLASS = function(match, context, isXML) { if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) { return context.getElementsByClassName(match[1]); } }; div = null; // release memory in IE })(); function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { var sibDir = dir == "previousSibling" && !isXML; for ( var i = 0, l = checkSet.length; i < l; i++ ) { var elem = checkSet[i]; if ( elem ) { if ( sibDir && elem.nodeType === 1 ){ elem.sizcache = doneName; elem.sizset = i; } elem = elem[dir]; var match = false; while ( elem ) { if ( elem.sizcache === doneName ) { match = checkSet[elem.sizset]; break; } if ( elem.nodeType === 1 && !isXML ){ elem.sizcache = doneName; elem.sizset = i; } if ( elem.nodeName === cur ) { match = elem; break; } elem = elem[dir]; } checkSet[i] = match; } } } function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { var sibDir = dir == "previousSibling" && !isXML; for ( var i = 0, l = checkSet.length; i < l; i++ ) { var elem = checkSet[i]; if ( elem ) { if ( sibDir && elem.nodeType === 1 ) { elem.sizcache = doneName; elem.sizset = i; } elem = elem[dir]; var match = false; while ( elem ) { if ( elem.sizcache === doneName ) { match = checkSet[elem.sizset]; break; } if ( elem.nodeType === 1 ) { if ( !isXML ) { elem.sizcache = doneName; elem.sizset = i; } if ( typeof cur !== "string" ) { if ( elem === cur ) { match = true; break; } } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) { match = elem; break; } } elem = elem[dir]; } checkSet[i] = match; } } } var contains = document.compareDocumentPosition ? function(a, b){ return a.compareDocumentPosition(b) & 16; } : function(a, b){ return a !== b && (a.contains ? a.contains(b) : true); }; var isXML = function(elem){ return elem.nodeType === 9 && elem.documentElement.nodeName !== "HTML" || !!elem.ownerDocument && elem.ownerDocument.documentElement.nodeName !== "HTML"; }; var posProcess = function(selector, context){ var tmpSet = [], later = "", match, root = context.nodeType ? [context] : context; while ( (match = Expr.match.PSEUDO.exec( selector )) ) { later += match[0]; selector = selector.replace( Expr.match.PSEUDO, "" ); } selector = Expr.relative[selector] ? selector + "*" : selector; for ( var i = 0, l = root.length; i < l; i++ ) { Sizzle( selector, root[i], tmpSet ); } return Sizzle.filter( later, tmpSet ); }; window.Sizzle = Sizzle; })(); ;(function(engine) { var extendElements = Prototype.Selector.extendElements; function select(selector, scope) { return extendElements(engine(selector, scope || document)); } function match(element, selector) { return engine.matches(selector, [element]).length == 1; } Prototype.Selector.engine = engine; Prototype.Selector.select = select; Prototype.Selector.match = match; })(Sizzle); window.Sizzle = Prototype._original_property; delete Prototype._original_property; var Form = { reset: function(form) { form = $(form); form.reset(); return form; }, serializeElements: function(elements, options) { if (typeof options != 'object') options = { hash: !!options }; else if (Object.isUndefined(options.hash)) options.hash = true; var key, value, submitted = false, submit = options.submit; var data = elements.inject({ }, function(result, element) { if (!element.disabled && element.name) { key = element.name; value = $(element).getValue(); if (value != null && element.type != 'file' && (element.type != 'submit' || (!submitted && submit !== false && (!submit || key == submit) && (submitted = true)))) { if (key in result) { if (!Object.isArray(result[key])) result[key] = [result[key]]; result[key].push(value); } else result[key] = value; } } return result; }); return options.hash ? data : Object.toQueryString(data); } }; Form.Methods = { serialize: function(form, options) { return Form.serializeElements(Form.getElements(form), options); }, getElements: function(form) { var elements = $(form).getElementsByTagName('*'), element, arr = [ ], serializers = Form.Element.Serializers; for (var i = 0; element = elements[i]; i++) { arr.push(element); } return arr.inject([], function(elements, child) { if (serializers[child.tagName.toLowerCase()]) elements.push(Element.extend(child)); return elements; }) }, getInputs: function(form, typeName, name) { form = $(form); var inputs = form.getElementsByTagName('input'); if (!typeName && !name) return $A(inputs).map(Element.extend); for (var i = 0, matchingInputs = [], length = inputs.length; i < length; i++) { var input = inputs[i]; if ((typeName && input.type != typeName) || (name && input.name != name)) continue; matchingInputs.push(Element.extend(input)); } return matchingInputs; }, disable: function(form) { form = $(form); Form.getElements(form).invoke('disable'); return form; }, enable: function(form) { form = $(form); Form.getElements(form).invoke('enable'); return form; }, findFirstElement: function(form) { var elements = $(form).getElements().findAll(function(element) { return 'hidden' != element.type && !element.disabled; }); var firstByIndex = elements.findAll(function(element) { return element.hasAttribute('tabIndex') && element.tabIndex >= 0; }).sortBy(function(element) { return element.tabIndex }).first(); return firstByIndex ? firstByIndex : elements.find(function(element) { return /^(?:input|select|textarea)$/i.test(element.tagName); }); }, focusFirstElement: function(form) { form = $(form); form.findFirstElement().activate(); return form; }, request: function(form, options) { form = $(form), options = Object.clone(options || { }); var params = options.parameters, action = form.readAttribute('action') || ''; if (action.blank()) action = window.location.href; options.parameters = form.serialize(true); if (params) { if (Object.isString(params)) params = params.toQueryParams(); Object.extend(options.parameters, params); } if (form.hasAttribute('method') && !options.method) options.method = form.method; return new Ajax.Request(action, options); } }; /*--------------------------------------------------------------------------*/ Form.Element = { focus: function(element) { $(element).focus(); return element; }, select: function(element) { $(element).select(); return element; } }; Form.Element.Methods = { serialize: function(element) { element = $(element); if (!element.disabled && element.name) { var value = element.getValue(); if (value != undefined) { var pair = { }; pair[element.name] = value; return Object.toQueryString(pair); } } return ''; }, getValue: function(element) { element = $(element); var method = element.tagName.toLowerCase(); return Form.Element.Serializers[method](element); }, setValue: function(element, value) { element = $(element); var method = element.tagName.toLowerCase(); Form.Element.Serializers[method](element, value); return element; }, clear: function(element) { $(element).value = ''; return element; }, present: function(element) { return $(element).value != ''; }, activate: function(element) { element = $(element); try { element.focus(); if (element.select && (element.tagName.toLowerCase() != 'input' || !(/^(?:button|reset|submit)$/i.test(element.type)))) element.select(); } catch (e) { } return element; }, disable: function(element) { element = $(element); element.disabled = true; return element; }, enable: function(element) { element = $(element); element.disabled = false; return element; } }; /*--------------------------------------------------------------------------*/ var Field = Form.Element; var $F = Form.Element.Methods.getValue; /*--------------------------------------------------------------------------*/ Form.Element.Serializers = { input: function(element, value) { switch (element.type.toLowerCase()) { case 'checkbox': case 'radio': return Form.Element.Serializers.inputSelector(element, value); default: return Form.Element.Serializers.textarea(element, value); } }, inputSelector: function(element, value) { if (Object.isUndefined(value)) return element.checked ? element.value : null; else element.checked = !!value; }, textarea: function(element, value) { if (Object.isUndefined(value)) return element.value; else element.value = value; }, select: function(element, value) { if (Object.isUndefined(value)) return this[element.type == 'select-one' ? 'selectOne' : 'selectMany'](element); else { var opt, currentValue, single = !Object.isArray(value); for (var i = 0, length = element.length; i < length; i++) { opt = element.options[i]; currentValue = this.optionValue(opt); if (single) { if (currentValue == value) { opt.selected = true; return; } } else opt.selected = value.include(currentValue); } } }, selectOne: function(element) { var index = element.selectedIndex; return index >= 0 ? this.optionValue(element.options[index]) : null; }, selectMany: function(element) { var values, length = element.length; if (!length) return null; for (var i = 0, values = []; i < length; i++) { var opt = element.options[i]; if (opt.selected) values.push(this.optionValue(opt)); } return values; }, optionValue: function(opt) { return Element.extend(opt).hasAttribute('value') ? opt.value : opt.text; } }; /*--------------------------------------------------------------------------*/ Abstract.TimedObserver = Class.create(PeriodicalExecuter, { initialize: function($super, element, frequency, callback) { $super(callback, frequency); this.element = $(element); this.lastValue = this.getValue(); }, execute: function() { var value = this.getValue(); if (Object.isString(this.lastValue) && Object.isString(value) ? this.lastValue != value : String(this.lastValue) != String(value)) { this.callback(this.element, value); this.lastValue = value; } } }); Form.Element.Observer = Class.create(Abstract.TimedObserver, { getValue: function() { return Form.Element.getValue(this.element); } }); Form.Observer = Class.create(Abstract.TimedObserver, { getValue: function() { return Form.serialize(this.element); } }); /*--------------------------------------------------------------------------*/ Abstract.EventObserver = Class.create({ initialize: function(element, callback) { this.element = $(element); this.callback = callback; this.lastValue = this.getValue(); if (this.element.tagName.toLowerCase() == 'form') this.registerFormCallbacks(); else this.registerCallback(this.element); }, onElementEvent: function() { var value = this.getValue(); if (this.lastValue != value) { this.callback(this.element, value); this.lastValue = value; } }, registerFormCallbacks: function() { Form.getElements(this.element).each(this.registerCallback, this); }, registerCallback: function(element) { if (element.type) { switch (element.type.toLowerCase()) { case 'checkbox': case 'radio': Event.observe(element, 'click', this.onElementEvent.bind(this)); break; default: Event.observe(element, 'change', this.onElementEvent.bind(this)); break; } } } }); Form.Element.EventObserver = Class.create(Abstract.EventObserver, { getValue: function() { return Form.Element.getValue(this.element); } }); Form.EventObserver = Class.create(Abstract.EventObserver, { getValue: function() { return Form.serialize(this.element); } }); (function() { var Event = { KEY_BACKSPACE: 8, KEY_TAB: 9, KEY_RETURN: 13, KEY_ESC: 27, KEY_LEFT: 37, KEY_UP: 38, KEY_RIGHT: 39, KEY_DOWN: 40, KEY_DELETE: 46, KEY_HOME: 36, KEY_END: 35, KEY_PAGEUP: 33, KEY_PAGEDOWN: 34, KEY_INSERT: 45, cache: {} }; var docEl = document.documentElement; var MOUSEENTER_MOUSELEAVE_EVENTS_SUPPORTED = 'onmouseenter' in docEl && 'onmouseleave' in docEl; var _isButton; if (Prototype.Browser.IE) { var buttonMap = { 0: 1, 1: 4, 2: 2 }; _isButton = function(event, code) { return event.button === buttonMap[code]; }; } else if (Prototype.Browser.WebKit) { _isButton = function(event, code) { switch (code) { case 0: return event.which == 1 && !event.metaKey; case 1: return event.which == 1 && event.metaKey; default: return false; } }; } else { _isButton = function(event, code) { return event.which ? (event.which === code + 1) : (event.button === code); }; } function isLeftClick(event) { return _isButton(event, 0) } function isMiddleClick(event) { return _isButton(event, 1) } function isRightClick(event) { return _isButton(event, 2) } function element(event) { event = Event.extend(event); var node = event.target, type = event.type, currentTarget = event.currentTarget; if (currentTarget && currentTarget.tagName) { if (type === 'load' || type === 'error' || (type === 'click' && currentTarget.tagName.toLowerCase() === 'input' && currentTarget.type === 'radio')) node = currentTarget; } if (node.nodeType == Node.TEXT_NODE) node = node.parentNode; return Element.extend(node); } function findElement(event, expression) { var element = Event.element(event); if (!expression) return element; while (element) { if (Object.isElement(element) && Prototype.Selector.match(element, expression)) { return Element.extend(element); } element = element.parentNode; } } function pointer(event) { return { x: pointerX(event), y: pointerY(event) }; } function pointerX(event) { var docElement = document.documentElement, body = document.body || { scrollLeft: 0 }; return event.pageX || (event.clientX + (docElement.scrollLeft || body.scrollLeft) - (docElement.clientLeft || 0)); } function pointerY(event) { var docElement = document.documentElement, body = document.body || { scrollTop: 0 }; return event.pageY || (event.clientY + (docElement.scrollTop || body.scrollTop) - (docElement.clientTop || 0)); } function stop(event) { Event.extend(event); event.preventDefault(); event.stopPropagation(); event.stopped = true; } Event.Methods = { isLeftClick: isLeftClick, isMiddleClick: isMiddleClick, isRightClick: isRightClick, element: element, findElement: findElement, pointer: pointer, pointerX: pointerX, pointerY: pointerY, stop: stop }; var methods = Object.keys(Event.Methods).inject({ }, function(m, name) { m[name] = Event.Methods[name].methodize(); return m; }); if (Prototype.Browser.IE) { function _relatedTarget(event) { var element; switch (event.type) { case 'mouseover': element = event.fromElement; break; case 'mouseout': element = event.toElement; break; default: return null; } return Element.extend(element); } Object.extend(methods, { stopPropagation: function() { this.cancelBubble = true }, preventDefault: function() { this.returnValue = false }, inspect: function() { return '[object Event]' } }); Event.extend = function(event, element) { if (!event) return false; if (event._extendedByPrototype) return event; event._extendedByPrototype = Prototype.emptyFunction; var pointer = Event.pointer(event); Object.extend(event, { target: event.srcElement || element, relatedTarget: _relatedTarget(event), pageX: pointer.x, pageY: pointer.y }); return Object.extend(event, methods); }; } else { Event.prototype = window.Event.prototype || document.createEvent('HTMLEvents').__proto__; Object.extend(Event.prototype, methods); Event.extend = Prototype.K; } function _createResponder(element, eventName, handler) { var registry = Element.retrieve(element, 'prototype_event_registry'); if (Object.isUndefined(registry)) { CACHE.push(element); registry = Element.retrieve(element, 'prototype_event_registry', $H()); } var respondersForEvent = registry.get(eventName); if (Object.isUndefined(respondersForEvent)) { respondersForEvent = []; registry.set(eventName, respondersForEvent); } if (respondersForEvent.pluck('handler').include(handler)) return false; var responder; if (eventName.include(":")) { responder = function(event) { if (Object.isUndefined(event.eventName)) return false; if (event.eventName !== eventName) return false; Event.extend(event, element); handler.call(element, event); }; } else { if (!MOUSEENTER_MOUSELEAVE_EVENTS_SUPPORTED && (eventName === "mouseenter" || eventName === "mouseleave")) { if (eventName === "mouseenter" || eventName === "mouseleave") { responder = function(event) { Event.extend(event, element); var parent = event.relatedTarget; while (parent && parent !== element) { try { parent = parent.parentNode; } catch(e) { parent = element; } } if (parent === element) return; handler.call(element, event); }; } } else { responder = function(event) { Event.extend(event, element); handler.call(element, event); }; } } responder.handler = handler; respondersForEvent.push(responder); return responder; } function _destroyCache() { for (var i = 0, length = CACHE.length; i < length; i++) { Event.stopObserving(CACHE[i]); CACHE[i] = null; } } var CACHE = []; if (Prototype.Browser.IE) window.attachEvent('onunload', _destroyCache); if (Prototype.Browser.WebKit) window.addEventListener('unload', Prototype.emptyFunction, false); var _getDOMEventName = Prototype.K, translations = { mouseenter: "mouseover", mouseleave: "mouseout" }; if (!MOUSEENTER_MOUSELEAVE_EVENTS_SUPPORTED) { _getDOMEventName = function(eventName) { return (translations[eventName] || eventName); }; } function observe(element, eventName, handler) { element = $(element); var responder = _createResponder(element, eventName, handler); if (!responder) return element; if (eventName.include(':')) { if (element.addEventListener) element.addEventListener("dataavailable", responder, false); else { element.attachEvent("ondataavailable", responder); element.attachEvent("onfilterchange", responder); } } else { var actualEventName = _getDOMEventName(eventName); if (element.addEventListener) element.addEventListener(actualEventName, responder, false); else element.attachEvent("on" + actualEventName, responder); } return element; } function stopObserving(element, eventName, handler) { element = $(element); var registry = Element.retrieve(element, 'prototype_event_registry'); if (!registry) return element; if (!eventName) { registry.each( function(pair) { var eventName = pair.key; stopObserving(element, eventName); }); return element; } var responders = registry.get(eventName); if (!responders) return element; if (!handler) { responders.each(function(r) { stopObserving(element, eventName, r.handler); }); return element; } var responder = responders.find( function(r) { return r.handler === handler; }); if (!responder) return element; if (eventName.include(':')) { if (element.removeEventListener) element.removeEventListener("dataavailable", responder, false); else { element.detachEvent("ondataavailable", responder); element.detachEvent("onfilterchange", responder); } } else { var actualEventName = _getDOMEventName(eventName); if (element.removeEventListener) element.removeEventListener(actualEventName, responder, false); else element.detachEvent('on' + actualEventName, responder); } registry.set(eventName, responders.without(responder)); return element; } function fire(element, eventName, memo, bubble) { element = $(element); if (Object.isUndefined(bubble)) bubble = true; if (element == document && document.createEvent && !element.dispatchEvent) element = document.documentElement; var event; if (document.createEvent) { event = document.createEvent('HTMLEvents'); event.initEvent('dataavailable', true, true); } else { event = document.createEventObject(); event.eventType = bubble ? 'ondataavailable' : 'onfilterchange'; } event.eventName = eventName; event.memo = memo || { }; if (document.createEvent) element.dispatchEvent(event); else element.fireEvent(event.eventType, event); return Event.extend(event); } Event.Handler = Class.create({ initialize: function(element, eventName, selector, callback) { this.element = $(element); this.eventName = eventName; this.selector = selector; this.callback = callback; this.handler = this.handleEvent.bind(this); }, start: function() { Event.observe(this.element, this.eventName, this.handler); return this; }, stop: function() { Event.stopObserving(this.element, this.eventName, this.handler); return this; }, handleEvent: function(event) { var element = event.findElement(this.selector); if (element) this.callback.call(this.element, event, element); } }); function on(element, eventName, selector, callback) { element = $(element); if (Object.isFunction(selector) && Object.isUndefined(callback)) { callback = selector, selector = null; } return new Event.Handler(element, eventName, selector, callback).start(); } Object.extend(Event, Event.Methods); Object.extend(Event, { fire: fire, observe: observe, stopObserving: stopObserving, on: on }); Element.addMethods({ fire: fire, observe: observe, stopObserving: stopObserving, on: on }); Object.extend(document, { fire: fire.methodize(), observe: observe.methodize(), stopObserving: stopObserving.methodize(), on: on.methodize(), loaded: false }); if (window.Event) Object.extend(window.Event, Event); else window.Event = Event; })(); (function() { /* Support for the DOMContentLoaded event is based on work by Dan Webb, Matthias Miller, Dean Edwards, John Resig, and Diego Perini. */ var timer; function fireContentLoadedEvent() { if (document.loaded) return; if (timer) window.clearTimeout(timer); document.loaded = true; document.fire('dom:loaded'); } function checkReadyState() { if (document.readyState === 'complete') { document.stopObserving('readystatechange', checkReadyState); fireContentLoadedEvent(); } } function pollDoScroll() { try { document.documentElement.doScroll('left'); } catch(e) { timer = pollDoScroll.defer(); return; } fireContentLoadedEvent(); } if (document.addEventListener) { document.addEventListener('DOMContentLoaded', fireContentLoadedEvent, false); } else { document.observe('readystatechange', checkReadyState); if (window == top) timer = pollDoScroll.defer(); } Event.observe(window, 'load', fireContentLoadedEvent); })(); Element.addMethods(); /*------------------------------- DEPRECATED -------------------------------*/ Hash.toQueryString = Object.toQueryString; var Toggle = { display: Element.toggle }; Element.Methods.childOf = Element.Methods.descendantOf; var Insertion = { Before: function(element, content) { return Element.insert(element, {before:content}); }, Top: function(element, content) { return Element.insert(element, {top:content}); }, Bottom: function(element, content) { return Element.insert(element, {bottom:content}); }, After: function(element, content) { return Element.insert(element, {after:content}); } }; var $continue = new Error('"throw $continue" is deprecated, use "return" instead'); var Position = { includeScrollOffsets: false, prepare: function() { this.deltaX = window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft || 0; this.deltaY = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0; }, within: function(element, x, y) { if (this.includeScrollOffsets) return this.withinIncludingScrolloffsets(element, x, y); this.xcomp = x; this.ycomp = y; this.offset = Element.cumulativeOffset(element); return (y >= this.offset[1] && y < this.offset[1] + element.offsetHeight && x >= this.offset[0] && x < this.offset[0] + element.offsetWidth); }, withinIncludingScrolloffsets: function(element, x, y) { var offsetcache = Element.cumulativeScrollOffset(element); this.xcomp = x + offsetcache[0] - this.deltaX; this.ycomp = y + offsetcache[1] - this.deltaY; this.offset = Element.cumulativeOffset(element); return (this.ycomp >= this.offset[1] && this.ycomp < this.offset[1] + element.offsetHeight && this.xcomp >= this.offset[0] && this.xcomp < this.offset[0] + element.offsetWidth); }, overlap: function(mode, element) { if (!mode) return 0; if (mode == 'vertical') return ((this.offset[1] + element.offsetHeight) - this.ycomp) / element.offsetHeight; if (mode == 'horizontal') return ((this.offset[0] + element.offsetWidth) - this.xcomp) / element.offsetWidth; }, cumulativeOffset: Element.Methods.cumulativeOffset, positionedOffset: Element.Methods.positionedOffset, absolutize: function(element) { Position.prepare(); return Element.absolutize(element); }, relativize: function(element) { Position.prepare(); return Element.relativize(element); }, realOffset: Element.Methods.cumulativeScrollOffset, offsetParent: Element.Methods.getOffsetParent, page: Element.Methods.viewportOffset, clone: function(source, target, options) { options = options || { }; return Element.clonePosition(target, source, options); } }; /*--------------------------------------------------------------------------*/ if (!document.getElementsByClassName) document.getElementsByClassName = function(instanceMethods){ function iter(name) { return name.blank() ? null : "[contains(concat(' ', @class, ' '), ' " + name + " ')]"; } instanceMethods.getElementsByClassName = Prototype.BrowserFeatures.XPath ? function(element, className) { className = className.toString().strip(); var cond = /\s/.test(className) ? $w(className).map(iter).join('') : iter(className); return cond ? document._getElementsByXPath('.//*' + cond, element) : []; } : function(element, className) { className = className.toString().strip(); var elements = [], classNames = (/\s/.test(className) ? $w(className) : null); if (!classNames && !className) return elements; var nodes = $(element).getElementsByTagName('*'); className = ' ' + className + ' '; for (var i = 0, child, cn; child = nodes[i]; i++) { if (child.className && (cn = ' ' + child.className + ' ') && (cn.include(className) || (classNames && classNames.all(function(name) { return !name.toString().blank() && cn.include(' ' + name + ' '); })))) elements.push(Element.extend(child)); } return elements; }; return function(className, parentElement) { return $(parentElement || document.body).getElementsByClassName(className); }; }(Element.Methods); /*--------------------------------------------------------------------------*/ Element.ClassNames = Class.create(); Element.ClassNames.prototype = { initialize: function(element) { this.element = $(element); }, _each: function(iterator) { this.element.className.split(/\s+/).select(function(name) { return name.length > 0; })._each(iterator); }, set: function(className) { this.element.className = className; }, add: function(classNameToAdd) { if (this.include(classNameToAdd)) return; this.set($A(this).concat(classNameToAdd).join(' ')); }, remove: function(classNameToRemove) { if (!this.include(classNameToRemove)) return; this.set($A(this).without(classNameToRemove).join(' ')); }, toString: function() { return $A(this).join(' '); } }; Object.extend(Element.ClassNames.prototype, Enumerable); /*--------------------------------------------------------------------------*/ (function() { window.Selector = Class.create({ initialize: function(expression) { this.expression = expression.strip(); }, findElements: function(rootElement) { return Prototype.Selector.select(this.expression, rootElement); }, match: function(element) { return Prototype.Selector.match(element, this.expression); }, toString: function() { return this.expression; }, inspect: function() { return "#"; } }); Object.extend(Selector, { matchElements: function(elements, expression) { var match = Prototype.Selector.match, results = []; for (var i = 0, length = elements.length; i < length; i++) { var element = elements[i]; if (match(element, expression)) { results.push(Element.extend(element)); } } return results; }, findElement: function(elements, expression, index) { index = index || 0; var matchIndex = 0, element; for (var i = 0, length = elements.length; i < length; i++) { element = elements[i]; if (Prototype.Selector.match(element, expression) && index === matchIndex++) { return Element.extend(element); } } }, findChildElements: function(element, expressions) { var selector = expressions.toArray().join(', '); return Prototype.Selector.select(selector, element || document); } }); })(); ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/public/javascripts/rails.js./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/public/javascripts/rails.j0000644000000000000000000001333212674201751030303 0ustar (function() { // Technique from Juriy Zaytsev // http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/ function isEventSupported(eventName) { var el = document.createElement('div'); eventName = 'on' + eventName; var isSupported = (eventName in el); if (!isSupported) { el.setAttribute(eventName, 'return;'); isSupported = typeof el[eventName] == 'function'; } el = null; return isSupported; } function isForm(element) { return Object.isElement(element) && element.nodeName.toUpperCase() == 'FORM' } function isInput(element) { if (Object.isElement(element)) { var name = element.nodeName.toUpperCase() return name == 'INPUT' || name == 'SELECT' || name == 'TEXTAREA' } else return false } var submitBubbles = isEventSupported('submit'), changeBubbles = isEventSupported('change') if (!submitBubbles || !changeBubbles) { // augment the Event.Handler class to observe custom events when needed Event.Handler.prototype.initialize = Event.Handler.prototype.initialize.wrap( function(init, element, eventName, selector, callback) { init(element, eventName, selector, callback) // is the handler being attached to an element that doesn't support this event? if ( (!submitBubbles && this.eventName == 'submit' && !isForm(this.element)) || (!changeBubbles && this.eventName == 'change' && !isInput(this.element)) ) { // "submit" => "emulated:submit" this.eventName = 'emulated:' + this.eventName } } ) } if (!submitBubbles) { // discover forms on the page by observing focus events which always bubble document.on('focusin', 'form', function(focusEvent, form) { // special handler for the real "submit" event (one-time operation) if (!form.retrieve('emulated:submit')) { form.on('submit', function(submitEvent) { var emulated = form.fire('emulated:submit', submitEvent, true) // if custom event received preventDefault, cancel the real one too if (emulated.returnValue === false) submitEvent.preventDefault() }) form.store('emulated:submit', true) } }) } if (!changeBubbles) { // discover form inputs on the page document.on('focusin', 'input, select, texarea', function(focusEvent, input) { // special handler for real "change" events if (!input.retrieve('emulated:change')) { input.on('change', function(changeEvent) { input.fire('emulated:change', changeEvent, true) }) input.store('emulated:change', true) } }) } function handleRemote(element) { var method, url, params; var event = element.fire("ajax:before"); if (event.stopped) return false; if (element.tagName.toLowerCase() === 'form') { method = element.readAttribute('method') || 'post'; url = element.readAttribute('action'); params = element.serialize(); } else { method = element.readAttribute('data-method') || 'get'; url = element.readAttribute('href'); params = {}; } new Ajax.Request(url, { method: method, parameters: params, evalScripts: true, onComplete: function(request) { element.fire("ajax:complete", request); }, onSuccess: function(request) { element.fire("ajax:success", request); }, onFailure: function(request) { element.fire("ajax:failure", request); } }); element.fire("ajax:after"); } function handleMethod(element) { var method = element.readAttribute('data-method'), url = element.readAttribute('href'), csrf_param = $$('meta[name=csrf-param]')[0], csrf_token = $$('meta[name=csrf-token]')[0]; var form = new Element('form', { method: "POST", action: url, style: "display: none;" }); element.parentNode.insert(form); if (method !== 'post') { var field = new Element('input', { type: 'hidden', name: '_method', value: method }); form.insert(field); } if (csrf_param) { var param = csrf_param.readAttribute('content'), token = csrf_token.readAttribute('content'), field = new Element('input', { type: 'hidden', name: param, value: token }); form.insert(field); } form.submit(); } document.on("click", "*[data-confirm]", function(event, element) { var message = element.readAttribute('data-confirm'); if (!confirm(message)) event.stop(); }); document.on("click", "a[data-remote]", function(event, element) { if (event.stopped) return; handleRemote(element); event.stop(); }); document.on("click", "a[data-method]", function(event, element) { if (event.stopped) return; handleMethod(element); event.stop(); }); document.on("submit", function(event) { var element = event.findElement(), message = element.readAttribute('data-confirm'); if (message && !confirm(message)) { event.stop(); return false; } var inputs = element.select("input[type=submit][data-disable-with]"); inputs.each(function(input) { input.disabled = true; input.writeAttribute('data-original-value', input.value); input.value = input.readAttribute('data-disable-with'); }); var element = event.findElement("form[data-remote]"); if (element) { handleRemote(element); event.stop(); } }); document.on("ajax:after", "form", function(event, element) { var inputs = element.select("input[type=submit][disabled=true][data-disable-with]"); inputs.each(function(input) { input.value = input.readAttribute('data-original-value'); input.removeAttribute('data-original-value'); input.disabled = false; }); }); })(); ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/public/javascripts/effects.js./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/public/javascripts/effects0000644000000000000000000011310312674201751030355 0ustar // script.aculo.us effects.js v1.8.3, Thu Oct 08 11:23:33 +0200 2009 // Copyright (c) 2005-2009 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) // Contributors: // Justin Palmer (http://encytemedia.com/) // Mark Pilgrim (http://diveintomark.org/) // Martin Bialasinki // // script.aculo.us is freely distributable under the terms of an MIT-style license. // For details, see the script.aculo.us web site: http://script.aculo.us/ // converts rgb() and #xxx to #xxxxxx format, // returns self (or first argument) if not convertable String.prototype.parseColor = function() { var color = '#'; if (this.slice(0,4) == 'rgb(') { var cols = this.slice(4,this.length-1).split(','); var i=0; do { color += parseInt(cols[i]).toColorPart() } while (++i<3); } else { if (this.slice(0,1) == '#') { if (this.length==4) for(var i=1;i<4;i++) color += (this.charAt(i) + this.charAt(i)).toLowerCase(); if (this.length==7) color = this.toLowerCase(); } } return (color.length==7 ? color : (arguments[0] || this)); }; /*--------------------------------------------------------------------------*/ Element.collectTextNodes = function(element) { return $A($(element).childNodes).collect( function(node) { return (node.nodeType==3 ? node.nodeValue : (node.hasChildNodes() ? Element.collectTextNodes(node) : '')); }).flatten().join(''); }; Element.collectTextNodesIgnoreClass = function(element, className) { return $A($(element).childNodes).collect( function(node) { return (node.nodeType==3 ? node.nodeValue : ((node.hasChildNodes() && !Element.hasClassName(node,className)) ? Element.collectTextNodesIgnoreClass(node, className) : '')); }).flatten().join(''); }; Element.setContentZoom = function(element, percent) { element = $(element); element.setStyle({fontSize: (percent/100) + 'em'}); if (Prototype.Browser.WebKit) window.scrollBy(0,0); return element; }; Element.getInlineOpacity = function(element){ return $(element).style.opacity || ''; }; Element.forceRerendering = function(element) { try { element = $(element); var n = document.createTextNode(' '); element.appendChild(n); element.removeChild(n); } catch(e) { } }; /*--------------------------------------------------------------------------*/ var Effect = { _elementDoesNotExistError: { name: 'ElementDoesNotExistError', message: 'The specified DOM element does not exist, but is required for this effect to operate' }, Transitions: { linear: Prototype.K, sinoidal: function(pos) { return (-Math.cos(pos*Math.PI)/2) + .5; }, reverse: function(pos) { return 1-pos; }, flicker: function(pos) { var pos = ((-Math.cos(pos*Math.PI)/4) + .75) + Math.random()/4; return pos > 1 ? 1 : pos; }, wobble: function(pos) { return (-Math.cos(pos*Math.PI*(9*pos))/2) + .5; }, pulse: function(pos, pulses) { return (-Math.cos((pos*((pulses||5)-.5)*2)*Math.PI)/2) + .5; }, spring: function(pos) { return 1 - (Math.cos(pos * 4.5 * Math.PI) * Math.exp(-pos * 6)); }, none: function(pos) { return 0; }, full: function(pos) { return 1; } }, DefaultOptions: { duration: 1.0, // seconds fps: 100, // 100= assume 66fps max. sync: false, // true for combining from: 0.0, to: 1.0, delay: 0.0, queue: 'parallel' }, tagifyText: function(element) { var tagifyStyle = 'position:relative'; if (Prototype.Browser.IE) tagifyStyle += ';zoom:1'; element = $(element); $A(element.childNodes).each( function(child) { if (child.nodeType==3) { child.nodeValue.toArray().each( function(character) { element.insertBefore( new Element('span', {style: tagifyStyle}).update( character == ' ' ? String.fromCharCode(160) : character), child); }); Element.remove(child); } }); }, multiple: function(element, effect) { var elements; if (((typeof element == 'object') || Object.isFunction(element)) && (element.length)) elements = element; else elements = $(element).childNodes; var options = Object.extend({ speed: 0.1, delay: 0.0 }, arguments[2] || { }); var masterDelay = options.delay; $A(elements).each( function(element, index) { new effect(element, Object.extend(options, { delay: index * options.speed + masterDelay })); }); }, PAIRS: { 'slide': ['SlideDown','SlideUp'], 'blind': ['BlindDown','BlindUp'], 'appear': ['Appear','Fade'] }, toggle: function(element, effect, options) { element = $(element); effect = (effect || 'appear').toLowerCase(); return Effect[ Effect.PAIRS[ effect ][ element.visible() ? 1 : 0 ] ](element, Object.extend({ queue: { position:'end', scope:(element.id || 'global'), limit: 1 } }, options || {})); } }; Effect.DefaultOptions.transition = Effect.Transitions.sinoidal; /* ------------- core effects ------------- */ Effect.ScopedQueue = Class.create(Enumerable, { initialize: function() { this.effects = []; this.interval = null; }, _each: function(iterator) { this.effects._each(iterator); }, add: function(effect) { var timestamp = new Date().getTime(); var position = Object.isString(effect.options.queue) ? effect.options.queue : effect.options.queue.position; switch(position) { case 'front': // move unstarted effects after this effect this.effects.findAll(function(e){ return e.state=='idle' }).each( function(e) { e.startOn += effect.finishOn; e.finishOn += effect.finishOn; }); break; case 'with-last': timestamp = this.effects.pluck('startOn').max() || timestamp; break; case 'end': // start effect after last queued effect has finished timestamp = this.effects.pluck('finishOn').max() || timestamp; break; } effect.startOn += timestamp; effect.finishOn += timestamp; if (!effect.options.queue.limit || (this.effects.length < effect.options.queue.limit)) this.effects.push(effect); if (!this.interval) this.interval = setInterval(this.loop.bind(this), 15); }, remove: function(effect) { this.effects = this.effects.reject(function(e) { return e==effect }); if (this.effects.length == 0) { clearInterval(this.interval); this.interval = null; } }, loop: function() { var timePos = new Date().getTime(); for(var i=0, len=this.effects.length;i= this.startOn) { if (timePos >= this.finishOn) { this.render(1.0); this.cancel(); this.event('beforeFinish'); if (this.finish) this.finish(); this.event('afterFinish'); return; } var pos = (timePos - this.startOn) / this.totalTime, frame = (pos * this.totalFrames).round(); if (frame > this.currentFrame) { this.render(pos); this.currentFrame = frame; } } }, cancel: function() { if (!this.options.sync) Effect.Queues.get(Object.isString(this.options.queue) ? 'global' : this.options.queue.scope).remove(this); this.state = 'finished'; }, event: function(eventName) { if (this.options[eventName + 'Internal']) this.options[eventName + 'Internal'](this); if (this.options[eventName]) this.options[eventName](this); }, inspect: function() { var data = $H(); for(property in this) if (!Object.isFunction(this[property])) data.set(property, this[property]); return '#'; } }); Effect.Parallel = Class.create(Effect.Base, { initialize: function(effects) { this.effects = effects || []; this.start(arguments[1]); }, update: function(position) { this.effects.invoke('render', position); }, finish: function(position) { this.effects.each( function(effect) { effect.render(1.0); effect.cancel(); effect.event('beforeFinish'); if (effect.finish) effect.finish(position); effect.event('afterFinish'); }); } }); Effect.Tween = Class.create(Effect.Base, { initialize: function(object, from, to) { object = Object.isString(object) ? $(object) : object; var args = $A(arguments), method = args.last(), options = args.length == 5 ? args[3] : null; this.method = Object.isFunction(method) ? method.bind(object) : Object.isFunction(object[method]) ? object[method].bind(object) : function(value) { object[method] = value }; this.start(Object.extend({ from: from, to: to }, options || { })); }, update: function(position) { this.method(position); } }); Effect.Event = Class.create(Effect.Base, { initialize: function() { this.start(Object.extend({ duration: 0 }, arguments[0] || { })); }, update: Prototype.emptyFunction }); Effect.Opacity = Class.create(Effect.Base, { initialize: function(element) { this.element = $(element); if (!this.element) throw(Effect._elementDoesNotExistError); // make this work on IE on elements without 'layout' if (Prototype.Browser.IE && (!this.element.currentStyle.hasLayout)) this.element.setStyle({zoom: 1}); var options = Object.extend({ from: this.element.getOpacity() || 0.0, to: 1.0 }, arguments[1] || { }); this.start(options); }, update: function(position) { this.element.setOpacity(position); } }); Effect.Move = Class.create(Effect.Base, { initialize: function(element) { this.element = $(element); if (!this.element) throw(Effect._elementDoesNotExistError); var options = Object.extend({ x: 0, y: 0, mode: 'relative' }, arguments[1] || { }); this.start(options); }, setup: function() { this.element.makePositioned(); this.originalLeft = parseFloat(this.element.getStyle('left') || '0'); this.originalTop = parseFloat(this.element.getStyle('top') || '0'); if (this.options.mode == 'absolute') { this.options.x = this.options.x - this.originalLeft; this.options.y = this.options.y - this.originalTop; } }, update: function(position) { this.element.setStyle({ left: (this.options.x * position + this.originalLeft).round() + 'px', top: (this.options.y * position + this.originalTop).round() + 'px' }); } }); // for backwards compatibility Effect.MoveBy = function(element, toTop, toLeft) { return new Effect.Move(element, Object.extend({ x: toLeft, y: toTop }, arguments[3] || { })); }; Effect.Scale = Class.create(Effect.Base, { initialize: function(element, percent) { this.element = $(element); if (!this.element) throw(Effect._elementDoesNotExistError); var options = Object.extend({ scaleX: true, scaleY: true, scaleContent: true, scaleFromCenter: false, scaleMode: 'box', // 'box' or 'contents' or { } with provided values scaleFrom: 100.0, scaleTo: percent }, arguments[2] || { }); this.start(options); }, setup: function() { this.restoreAfterFinish = this.options.restoreAfterFinish || false; this.elementPositioning = this.element.getStyle('position'); this.originalStyle = { }; ['top','left','width','height','fontSize'].each( function(k) { this.originalStyle[k] = this.element.style[k]; }.bind(this)); this.originalTop = this.element.offsetTop; this.originalLeft = this.element.offsetLeft; var fontSize = this.element.getStyle('font-size') || '100%'; ['em','px','%','pt'].each( function(fontSizeType) { if (fontSize.indexOf(fontSizeType)>0) { this.fontSize = parseFloat(fontSize); this.fontSizeType = fontSizeType; } }.bind(this)); this.factor = (this.options.scaleTo - this.options.scaleFrom)/100; this.dims = null; if (this.options.scaleMode=='box') this.dims = [this.element.offsetHeight, this.element.offsetWidth]; if (/^content/.test(this.options.scaleMode)) this.dims = [this.element.scrollHeight, this.element.scrollWidth]; if (!this.dims) this.dims = [this.options.scaleMode.originalHeight, this.options.scaleMode.originalWidth]; }, update: function(position) { var currentScale = (this.options.scaleFrom/100.0) + (this.factor * position); if (this.options.scaleContent && this.fontSize) this.element.setStyle({fontSize: this.fontSize * currentScale + this.fontSizeType }); this.setDimensions(this.dims[0] * currentScale, this.dims[1] * currentScale); }, finish: function(position) { if (this.restoreAfterFinish) this.element.setStyle(this.originalStyle); }, setDimensions: function(height, width) { var d = { }; if (this.options.scaleX) d.width = width.round() + 'px'; if (this.options.scaleY) d.height = height.round() + 'px'; if (this.options.scaleFromCenter) { var topd = (height - this.dims[0])/2; var leftd = (width - this.dims[1])/2; if (this.elementPositioning == 'absolute') { if (this.options.scaleY) d.top = this.originalTop-topd + 'px'; if (this.options.scaleX) d.left = this.originalLeft-leftd + 'px'; } else { if (this.options.scaleY) d.top = -topd + 'px'; if (this.options.scaleX) d.left = -leftd + 'px'; } } this.element.setStyle(d); } }); Effect.Highlight = Class.create(Effect.Base, { initialize: function(element) { this.element = $(element); if (!this.element) throw(Effect._elementDoesNotExistError); var options = Object.extend({ startcolor: '#ffff99' }, arguments[1] || { }); this.start(options); }, setup: function() { // Prevent executing on elements not in the layout flow if (this.element.getStyle('display')=='none') { this.cancel(); return; } // Disable background image during the effect this.oldStyle = { }; if (!this.options.keepBackgroundImage) { this.oldStyle.backgroundImage = this.element.getStyle('background-image'); this.element.setStyle({backgroundImage: 'none'}); } if (!this.options.endcolor) this.options.endcolor = this.element.getStyle('background-color').parseColor('#ffffff'); if (!this.options.restorecolor) this.options.restorecolor = this.element.getStyle('background-color'); // init color calculations this._base = $R(0,2).map(function(i){ return parseInt(this.options.startcolor.slice(i*2+1,i*2+3),16) }.bind(this)); this._delta = $R(0,2).map(function(i){ return parseInt(this.options.endcolor.slice(i*2+1,i*2+3),16)-this._base[i] }.bind(this)); }, update: function(position) { this.element.setStyle({backgroundColor: $R(0,2).inject('#',function(m,v,i){ return m+((this._base[i]+(this._delta[i]*position)).round().toColorPart()); }.bind(this)) }); }, finish: function() { this.element.setStyle(Object.extend(this.oldStyle, { backgroundColor: this.options.restorecolor })); } }); Effect.ScrollTo = function(element) { var options = arguments[1] || { }, scrollOffsets = document.viewport.getScrollOffsets(), elementOffsets = $(element).cumulativeOffset(); if (options.offset) elementOffsets[1] += options.offset; return new Effect.Tween(null, scrollOffsets.top, elementOffsets[1], options, function(p){ scrollTo(scrollOffsets.left, p.round()); } ); }; /* ------------- combination effects ------------- */ Effect.Fade = function(element) { element = $(element); var oldOpacity = element.getInlineOpacity(); var options = Object.extend({ from: element.getOpacity() || 1.0, to: 0.0, afterFinishInternal: function(effect) { if (effect.options.to!=0) return; effect.element.hide().setStyle({opacity: oldOpacity}); } }, arguments[1] || { }); return new Effect.Opacity(element,options); }; Effect.Appear = function(element) { element = $(element); var options = Object.extend({ from: (element.getStyle('display') == 'none' ? 0.0 : element.getOpacity() || 0.0), to: 1.0, // force Safari to render floated elements properly afterFinishInternal: function(effect) { effect.element.forceRerendering(); }, beforeSetup: function(effect) { effect.element.setOpacity(effect.options.from).show(); }}, arguments[1] || { }); return new Effect.Opacity(element,options); }; Effect.Puff = function(element) { element = $(element); var oldStyle = { opacity: element.getInlineOpacity(), position: element.getStyle('position'), top: element.style.top, left: element.style.left, width: element.style.width, height: element.style.height }; return new Effect.Parallel( [ new Effect.Scale(element, 200, { sync: true, scaleFromCenter: true, scaleContent: true, restoreAfterFinish: true }), new Effect.Opacity(element, { sync: true, to: 0.0 } ) ], Object.extend({ duration: 1.0, beforeSetupInternal: function(effect) { Position.absolutize(effect.effects[0].element); }, afterFinishInternal: function(effect) { effect.effects[0].element.hide().setStyle(oldStyle); } }, arguments[1] || { }) ); }; Effect.BlindUp = function(element) { element = $(element); element.makeClipping(); return new Effect.Scale(element, 0, Object.extend({ scaleContent: false, scaleX: false, restoreAfterFinish: true, afterFinishInternal: function(effect) { effect.element.hide().undoClipping(); } }, arguments[1] || { }) ); }; Effect.BlindDown = function(element) { element = $(element); var elementDimensions = element.getDimensions(); return new Effect.Scale(element, 100, Object.extend({ scaleContent: false, scaleX: false, scaleFrom: 0, scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width}, restoreAfterFinish: true, afterSetup: function(effect) { effect.element.makeClipping().setStyle({height: '0px'}).show(); }, afterFinishInternal: function(effect) { effect.element.undoClipping(); } }, arguments[1] || { })); }; Effect.SwitchOff = function(element) { element = $(element); var oldOpacity = element.getInlineOpacity(); return new Effect.Appear(element, Object.extend({ duration: 0.4, from: 0, transition: Effect.Transitions.flicker, afterFinishInternal: function(effect) { new Effect.Scale(effect.element, 1, { duration: 0.3, scaleFromCenter: true, scaleX: false, scaleContent: false, restoreAfterFinish: true, beforeSetup: function(effect) { effect.element.makePositioned().makeClipping(); }, afterFinishInternal: function(effect) { effect.element.hide().undoClipping().undoPositioned().setStyle({opacity: oldOpacity}); } }); } }, arguments[1] || { })); }; Effect.DropOut = function(element) { element = $(element); var oldStyle = { top: element.getStyle('top'), left: element.getStyle('left'), opacity: element.getInlineOpacity() }; return new Effect.Parallel( [ new Effect.Move(element, {x: 0, y: 100, sync: true }), new Effect.Opacity(element, { sync: true, to: 0.0 }) ], Object.extend( { duration: 0.5, beforeSetup: function(effect) { effect.effects[0].element.makePositioned(); }, afterFinishInternal: function(effect) { effect.effects[0].element.hide().undoPositioned().setStyle(oldStyle); } }, arguments[1] || { })); }; Effect.Shake = function(element) { element = $(element); var options = Object.extend({ distance: 20, duration: 0.5 }, arguments[1] || {}); var distance = parseFloat(options.distance); var split = parseFloat(options.duration) / 10.0; var oldStyle = { top: element.getStyle('top'), left: element.getStyle('left') }; return new Effect.Move(element, { x: distance, y: 0, duration: split, afterFinishInternal: function(effect) { new Effect.Move(effect.element, { x: -distance*2, y: 0, duration: split*2, afterFinishInternal: function(effect) { new Effect.Move(effect.element, { x: distance*2, y: 0, duration: split*2, afterFinishInternal: function(effect) { new Effect.Move(effect.element, { x: -distance*2, y: 0, duration: split*2, afterFinishInternal: function(effect) { new Effect.Move(effect.element, { x: distance*2, y: 0, duration: split*2, afterFinishInternal: function(effect) { new Effect.Move(effect.element, { x: -distance, y: 0, duration: split, afterFinishInternal: function(effect) { effect.element.undoPositioned().setStyle(oldStyle); }}); }}); }}); }}); }}); }}); }; Effect.SlideDown = function(element) { element = $(element).cleanWhitespace(); // SlideDown need to have the content of the element wrapped in a container element with fixed height! var oldInnerBottom = element.down().getStyle('bottom'); var elementDimensions = element.getDimensions(); return new Effect.Scale(element, 100, Object.extend({ scaleContent: false, scaleX: false, scaleFrom: window.opera ? 0 : 1, scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width}, restoreAfterFinish: true, afterSetup: function(effect) { effect.element.makePositioned(); effect.element.down().makePositioned(); if (window.opera) effect.element.setStyle({top: ''}); effect.element.makeClipping().setStyle({height: '0px'}).show(); }, afterUpdateInternal: function(effect) { effect.element.down().setStyle({bottom: (effect.dims[0] - effect.element.clientHeight) + 'px' }); }, afterFinishInternal: function(effect) { effect.element.undoClipping().undoPositioned(); effect.element.down().undoPositioned().setStyle({bottom: oldInnerBottom}); } }, arguments[1] || { }) ); }; Effect.SlideUp = function(element) { element = $(element).cleanWhitespace(); var oldInnerBottom = element.down().getStyle('bottom'); var elementDimensions = element.getDimensions(); return new Effect.Scale(element, window.opera ? 0 : 1, Object.extend({ scaleContent: false, scaleX: false, scaleMode: 'box', scaleFrom: 100, scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width}, restoreAfterFinish: true, afterSetup: function(effect) { effect.element.makePositioned(); effect.element.down().makePositioned(); if (window.opera) effect.element.setStyle({top: ''}); effect.element.makeClipping().show(); }, afterUpdateInternal: function(effect) { effect.element.down().setStyle({bottom: (effect.dims[0] - effect.element.clientHeight) + 'px' }); }, afterFinishInternal: function(effect) { effect.element.hide().undoClipping().undoPositioned(); effect.element.down().undoPositioned().setStyle({bottom: oldInnerBottom}); } }, arguments[1] || { }) ); }; // Bug in opera makes the TD containing this element expand for a instance after finish Effect.Squish = function(element) { return new Effect.Scale(element, window.opera ? 1 : 0, { restoreAfterFinish: true, beforeSetup: function(effect) { effect.element.makeClipping(); }, afterFinishInternal: function(effect) { effect.element.hide().undoClipping(); } }); }; Effect.Grow = function(element) { element = $(element); var options = Object.extend({ direction: 'center', moveTransition: Effect.Transitions.sinoidal, scaleTransition: Effect.Transitions.sinoidal, opacityTransition: Effect.Transitions.full }, arguments[1] || { }); var oldStyle = { top: element.style.top, left: element.style.left, height: element.style.height, width: element.style.width, opacity: element.getInlineOpacity() }; var dims = element.getDimensions(); var initialMoveX, initialMoveY; var moveX, moveY; switch (options.direction) { case 'top-left': initialMoveX = initialMoveY = moveX = moveY = 0; break; case 'top-right': initialMoveX = dims.width; initialMoveY = moveY = 0; moveX = -dims.width; break; case 'bottom-left': initialMoveX = moveX = 0; initialMoveY = dims.height; moveY = -dims.height; break; case 'bottom-right': initialMoveX = dims.width; initialMoveY = dims.height; moveX = -dims.width; moveY = -dims.height; break; case 'center': initialMoveX = dims.width / 2; initialMoveY = dims.height / 2; moveX = -dims.width / 2; moveY = -dims.height / 2; break; } return new Effect.Move(element, { x: initialMoveX, y: initialMoveY, duration: 0.01, beforeSetup: function(effect) { effect.element.hide().makeClipping().makePositioned(); }, afterFinishInternal: function(effect) { new Effect.Parallel( [ new Effect.Opacity(effect.element, { sync: true, to: 1.0, from: 0.0, transition: options.opacityTransition }), new Effect.Move(effect.element, { x: moveX, y: moveY, sync: true, transition: options.moveTransition }), new Effect.Scale(effect.element, 100, { scaleMode: { originalHeight: dims.height, originalWidth: dims.width }, sync: true, scaleFrom: window.opera ? 1 : 0, transition: options.scaleTransition, restoreAfterFinish: true}) ], Object.extend({ beforeSetup: function(effect) { effect.effects[0].element.setStyle({height: '0px'}).show(); }, afterFinishInternal: function(effect) { effect.effects[0].element.undoClipping().undoPositioned().setStyle(oldStyle); } }, options) ); } }); }; Effect.Shrink = function(element) { element = $(element); var options = Object.extend({ direction: 'center', moveTransition: Effect.Transitions.sinoidal, scaleTransition: Effect.Transitions.sinoidal, opacityTransition: Effect.Transitions.none }, arguments[1] || { }); var oldStyle = { top: element.style.top, left: element.style.left, height: element.style.height, width: element.style.width, opacity: element.getInlineOpacity() }; var dims = element.getDimensions(); var moveX, moveY; switch (options.direction) { case 'top-left': moveX = moveY = 0; break; case 'top-right': moveX = dims.width; moveY = 0; break; case 'bottom-left': moveX = 0; moveY = dims.height; break; case 'bottom-right': moveX = dims.width; moveY = dims.height; break; case 'center': moveX = dims.width / 2; moveY = dims.height / 2; break; } return new Effect.Parallel( [ new Effect.Opacity(element, { sync: true, to: 0.0, from: 1.0, transition: options.opacityTransition }), new Effect.Scale(element, window.opera ? 1 : 0, { sync: true, transition: options.scaleTransition, restoreAfterFinish: true}), new Effect.Move(element, { x: moveX, y: moveY, sync: true, transition: options.moveTransition }) ], Object.extend({ beforeStartInternal: function(effect) { effect.effects[0].element.makePositioned().makeClipping(); }, afterFinishInternal: function(effect) { effect.effects[0].element.hide().undoClipping().undoPositioned().setStyle(oldStyle); } }, options) ); }; Effect.Pulsate = function(element) { element = $(element); var options = arguments[1] || { }, oldOpacity = element.getInlineOpacity(), transition = options.transition || Effect.Transitions.linear, reverser = function(pos){ return 1 - transition((-Math.cos((pos*(options.pulses||5)*2)*Math.PI)/2) + .5); }; return new Effect.Opacity(element, Object.extend(Object.extend({ duration: 2.0, from: 0, afterFinishInternal: function(effect) { effect.element.setStyle({opacity: oldOpacity}); } }, options), {transition: reverser})); }; Effect.Fold = function(element) { element = $(element); var oldStyle = { top: element.style.top, left: element.style.left, width: element.style.width, height: element.style.height }; element.makeClipping(); return new Effect.Scale(element, 5, Object.extend({ scaleContent: false, scaleX: false, afterFinishInternal: function(effect) { new Effect.Scale(element, 1, { scaleContent: false, scaleY: false, afterFinishInternal: function(effect) { effect.element.hide().undoClipping().setStyle(oldStyle); } }); }}, arguments[1] || { })); }; Effect.Morph = Class.create(Effect.Base, { initialize: function(element) { this.element = $(element); if (!this.element) throw(Effect._elementDoesNotExistError); var options = Object.extend({ style: { } }, arguments[1] || { }); if (!Object.isString(options.style)) this.style = $H(options.style); else { if (options.style.include(':')) this.style = options.style.parseStyle(); else { this.element.addClassName(options.style); this.style = $H(this.element.getStyles()); this.element.removeClassName(options.style); var css = this.element.getStyles(); this.style = this.style.reject(function(style) { return style.value == css[style.key]; }); options.afterFinishInternal = function(effect) { effect.element.addClassName(effect.options.style); effect.transforms.each(function(transform) { effect.element.style[transform.style] = ''; }); }; } } this.start(options); }, setup: function(){ function parseColor(color){ if (!color || ['rgba(0, 0, 0, 0)','transparent'].include(color)) color = '#ffffff'; color = color.parseColor(); return $R(0,2).map(function(i){ return parseInt( color.slice(i*2+1,i*2+3), 16 ); }); } this.transforms = this.style.map(function(pair){ var property = pair[0], value = pair[1], unit = null; if (value.parseColor('#zzzzzz') != '#zzzzzz') { value = value.parseColor(); unit = 'color'; } else if (property == 'opacity') { value = parseFloat(value); if (Prototype.Browser.IE && (!this.element.currentStyle.hasLayout)) this.element.setStyle({zoom: 1}); } else if (Element.CSS_LENGTH.test(value)) { var components = value.match(/^([\+\-]?[0-9\.]+)(.*)$/); value = parseFloat(components[1]); unit = (components.length == 3) ? components[2] : null; } var originalValue = this.element.getStyle(property); return { style: property.camelize(), originalValue: unit=='color' ? parseColor(originalValue) : parseFloat(originalValue || 0), targetValue: unit=='color' ? parseColor(value) : value, unit: unit }; }.bind(this)).reject(function(transform){ return ( (transform.originalValue == transform.targetValue) || ( transform.unit != 'color' && (isNaN(transform.originalValue) || isNaN(transform.targetValue)) ) ); }); }, update: function(position) { var style = { }, transform, i = this.transforms.length; while(i--) style[(transform = this.transforms[i]).style] = transform.unit=='color' ? '#'+ (Math.round(transform.originalValue[0]+ (transform.targetValue[0]-transform.originalValue[0])*position)).toColorPart() + (Math.round(transform.originalValue[1]+ (transform.targetValue[1]-transform.originalValue[1])*position)).toColorPart() + (Math.round(transform.originalValue[2]+ (transform.targetValue[2]-transform.originalValue[2])*position)).toColorPart() : (transform.originalValue + (transform.targetValue - transform.originalValue) * position).toFixed(3) + (transform.unit === null ? '' : transform.unit); this.element.setStyle(style, true); } }); Effect.Transform = Class.create({ initialize: function(tracks){ this.tracks = []; this.options = arguments[1] || { }; this.addTracks(tracks); }, addTracks: function(tracks){ tracks.each(function(track){ track = $H(track); var data = track.values().first(); this.tracks.push($H({ ids: track.keys().first(), effect: Effect.Morph, options: { style: data } })); }.bind(this)); return this; }, play: function(){ return new Effect.Parallel( this.tracks.map(function(track){ var ids = track.get('ids'), effect = track.get('effect'), options = track.get('options'); var elements = [$(ids) || $$(ids)].flatten(); return elements.map(function(e){ return new effect(e, Object.extend({ sync:true }, options)) }); }).flatten(), this.options ); } }); Element.CSS_PROPERTIES = $w( 'backgroundColor backgroundPosition borderBottomColor borderBottomStyle ' + 'borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth ' + 'borderRightColor borderRightStyle borderRightWidth borderSpacing ' + 'borderTopColor borderTopStyle borderTopWidth bottom clip color ' + 'fontSize fontWeight height left letterSpacing lineHeight ' + 'marginBottom marginLeft marginRight marginTop markerOffset maxHeight '+ 'maxWidth minHeight minWidth opacity outlineColor outlineOffset ' + 'outlineWidth paddingBottom paddingLeft paddingRight paddingTop ' + 'right textIndent top width wordSpacing zIndex'); Element.CSS_LENGTH = /^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/; String.__parseStyleElement = document.createElement('div'); String.prototype.parseStyle = function(){ var style, styleRules = $H(); if (Prototype.Browser.WebKit) style = new Element('div',{style:this}).style; else { String.__parseStyleElement.innerHTML = '
    '; style = String.__parseStyleElement.childNodes[0].style; } Element.CSS_PROPERTIES.each(function(property){ if (style[property]) styleRules.set(property, style[property]); }); if (Prototype.Browser.IE && this.include('opacity')) styleRules.set('opacity', this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1]); return styleRules; }; if (document.defaultView && document.defaultView.getComputedStyle) { Element.getStyles = function(element) { var css = document.defaultView.getComputedStyle($(element), null); return Element.CSS_PROPERTIES.inject({ }, function(styles, property) { styles[property] = css[property]; return styles; }); }; } else { Element.getStyles = function(element) { element = $(element); var css = element.currentStyle, styles; styles = Element.CSS_PROPERTIES.inject({ }, function(results, property) { results[property] = css[property]; return results; }); if (!styles.opacity) styles.opacity = element.getOpacity(); return styles; }; } Effect.Methods = { morph: function(element, style) { element = $(element); new Effect.Morph(element, Object.extend({ style: style }, arguments[2] || { })); return element; }, visualEffect: function(element, effect, options) { element = $(element); var s = effect.dasherize().camelize(), klass = s.charAt(0).toUpperCase() + s.substring(1); new Effect[klass](element, options); return element; }, highlight: function(element, options) { element = $(element); new Effect.Highlight(element, options); return element; } }; $w('fade appear grow shrink fold blindUp blindDown slideUp slideDown '+ 'pulsate shake puff squish switchOff dropOut').each( function(effect) { Effect.Methods[effect] = function(element, options){ element = $(element); Effect[effect.charAt(0).toUpperCase() + effect.substring(1)](element, options); return element; }; } ); $w('getInlineOpacity forceRerendering setContentZoom collectTextNodes collectTextNodesIgnoreClass getStyles').each( function(f) { Effect.Methods[f] = Element[f]; } ); Element.addMethods(Effect.Methods);././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/public/javascripts/application.js./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/public/javascripts/applica0000644000000000000000000000022412674201751030346 0ustar // Place your application-specific JavaScript functions and classes here // This file is automatically included by javascript_include_tag :defaults ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/public/javascripts/dragdrop.js./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/public/javascripts/dragdro0000644000000000000000000007452012674201751030371 0ustar // script.aculo.us dragdrop.js v1.8.3, Thu Oct 08 11:23:33 +0200 2009 // Copyright (c) 2005-2009 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) // // script.aculo.us is freely distributable under the terms of an MIT-style license. // For details, see the script.aculo.us web site: http://script.aculo.us/ if(Object.isUndefined(Effect)) throw("dragdrop.js requires including script.aculo.us' effects.js library"); var Droppables = { drops: [], remove: function(element) { this.drops = this.drops.reject(function(d) { return d.element==$(element) }); }, add: function(element) { element = $(element); var options = Object.extend({ greedy: true, hoverclass: null, tree: false }, arguments[1] || { }); // cache containers if(options.containment) { options._containers = []; var containment = options.containment; if(Object.isArray(containment)) { containment.each( function(c) { options._containers.push($(c)) }); } else { options._containers.push($(containment)); } } if(options.accept) options.accept = [options.accept].flatten(); Element.makePositioned(element); // fix IE options.element = element; this.drops.push(options); }, findDeepestChild: function(drops) { deepest = drops[0]; for (i = 1; i < drops.length; ++i) if (Element.isParent(drops[i].element, deepest.element)) deepest = drops[i]; return deepest; }, isContained: function(element, drop) { var containmentNode; if(drop.tree) { containmentNode = element.treeNode; } else { containmentNode = element.parentNode; } return drop._containers.detect(function(c) { return containmentNode == c }); }, isAffected: function(point, element, drop) { return ( (drop.element!=element) && ((!drop._containers) || this.isContained(element, drop)) && ((!drop.accept) || (Element.classNames(element).detect( function(v) { return drop.accept.include(v) } ) )) && Position.within(drop.element, point[0], point[1]) ); }, deactivate: function(drop) { if(drop.hoverclass) Element.removeClassName(drop.element, drop.hoverclass); this.last_active = null; }, activate: function(drop) { if(drop.hoverclass) Element.addClassName(drop.element, drop.hoverclass); this.last_active = drop; }, show: function(point, element) { if(!this.drops.length) return; var drop, affected = []; this.drops.each( function(drop) { if(Droppables.isAffected(point, element, drop)) affected.push(drop); }); if(affected.length>0) drop = Droppables.findDeepestChild(affected); if(this.last_active && this.last_active != drop) this.deactivate(this.last_active); if (drop) { Position.within(drop.element, point[0], point[1]); if(drop.onHover) drop.onHover(element, drop.element, Position.overlap(drop.overlap, drop.element)); if (drop != this.last_active) Droppables.activate(drop); } }, fire: function(event, element) { if(!this.last_active) return; Position.prepare(); if (this.isAffected([Event.pointerX(event), Event.pointerY(event)], element, this.last_active)) if (this.last_active.onDrop) { this.last_active.onDrop(element, this.last_active.element, event); return true; } }, reset: function() { if(this.last_active) this.deactivate(this.last_active); } }; var Draggables = { drags: [], observers: [], register: function(draggable) { if(this.drags.length == 0) { this.eventMouseUp = this.endDrag.bindAsEventListener(this); this.eventMouseMove = this.updateDrag.bindAsEventListener(this); this.eventKeypress = this.keyPress.bindAsEventListener(this); Event.observe(document, "mouseup", this.eventMouseUp); Event.observe(document, "mousemove", this.eventMouseMove); Event.observe(document, "keypress", this.eventKeypress); } this.drags.push(draggable); }, unregister: function(draggable) { this.drags = this.drags.reject(function(d) { return d==draggable }); if(this.drags.length == 0) { Event.stopObserving(document, "mouseup", this.eventMouseUp); Event.stopObserving(document, "mousemove", this.eventMouseMove); Event.stopObserving(document, "keypress", this.eventKeypress); } }, activate: function(draggable) { if(draggable.options.delay) { this._timeout = setTimeout(function() { Draggables._timeout = null; window.focus(); Draggables.activeDraggable = draggable; }.bind(this), draggable.options.delay); } else { window.focus(); // allows keypress events if window isn't currently focused, fails for Safari this.activeDraggable = draggable; } }, deactivate: function() { this.activeDraggable = null; }, updateDrag: function(event) { if(!this.activeDraggable) return; var pointer = [Event.pointerX(event), Event.pointerY(event)]; // Mozilla-based browsers fire successive mousemove events with // the same coordinates, prevent needless redrawing (moz bug?) if(this._lastPointer && (this._lastPointer.inspect() == pointer.inspect())) return; this._lastPointer = pointer; this.activeDraggable.updateDrag(event, pointer); }, endDrag: function(event) { if(this._timeout) { clearTimeout(this._timeout); this._timeout = null; } if(!this.activeDraggable) return; this._lastPointer = null; this.activeDraggable.endDrag(event); this.activeDraggable = null; }, keyPress: function(event) { if(this.activeDraggable) this.activeDraggable.keyPress(event); }, addObserver: function(observer) { this.observers.push(observer); this._cacheObserverCallbacks(); }, removeObserver: function(element) { // element instead of observer fixes mem leaks this.observers = this.observers.reject( function(o) { return o.element==element }); this._cacheObserverCallbacks(); }, notify: function(eventName, draggable, event) { // 'onStart', 'onEnd', 'onDrag' if(this[eventName+'Count'] > 0) this.observers.each( function(o) { if(o[eventName]) o[eventName](eventName, draggable, event); }); if(draggable.options[eventName]) draggable.options[eventName](draggable, event); }, _cacheObserverCallbacks: function() { ['onStart','onEnd','onDrag'].each( function(eventName) { Draggables[eventName+'Count'] = Draggables.observers.select( function(o) { return o[eventName]; } ).length; }); } }; /*--------------------------------------------------------------------------*/ var Draggable = Class.create({ initialize: function(element) { var defaults = { handle: false, reverteffect: function(element, top_offset, left_offset) { var dur = Math.sqrt(Math.abs(top_offset^2)+Math.abs(left_offset^2))*0.02; new Effect.Move(element, { x: -left_offset, y: -top_offset, duration: dur, queue: {scope:'_draggable', position:'end'} }); }, endeffect: function(element) { var toOpacity = Object.isNumber(element._opacity) ? element._opacity : 1.0; new Effect.Opacity(element, {duration:0.2, from:0.7, to:toOpacity, queue: {scope:'_draggable', position:'end'}, afterFinish: function(){ Draggable._dragging[element] = false } }); }, zindex: 1000, revert: false, quiet: false, scroll: false, scrollSensitivity: 20, scrollSpeed: 15, snap: false, // false, or xy or [x,y] or function(x,y){ return [x,y] } delay: 0 }; if(!arguments[1] || Object.isUndefined(arguments[1].endeffect)) Object.extend(defaults, { starteffect: function(element) { element._opacity = Element.getOpacity(element); Draggable._dragging[element] = true; new Effect.Opacity(element, {duration:0.2, from:element._opacity, to:0.7}); } }); var options = Object.extend(defaults, arguments[1] || { }); this.element = $(element); if(options.handle && Object.isString(options.handle)) this.handle = this.element.down('.'+options.handle, 0); if(!this.handle) this.handle = $(options.handle); if(!this.handle) this.handle = this.element; if(options.scroll && !options.scroll.scrollTo && !options.scroll.outerHTML) { options.scroll = $(options.scroll); this._isScrollChild = Element.childOf(this.element, options.scroll); } Element.makePositioned(this.element); // fix IE this.options = options; this.dragging = false; this.eventMouseDown = this.initDrag.bindAsEventListener(this); Event.observe(this.handle, "mousedown", this.eventMouseDown); Draggables.register(this); }, destroy: function() { Event.stopObserving(this.handle, "mousedown", this.eventMouseDown); Draggables.unregister(this); }, currentDelta: function() { return([ parseInt(Element.getStyle(this.element,'left') || '0'), parseInt(Element.getStyle(this.element,'top') || '0')]); }, initDrag: function(event) { if(!Object.isUndefined(Draggable._dragging[this.element]) && Draggable._dragging[this.element]) return; if(Event.isLeftClick(event)) { // abort on form elements, fixes a Firefox issue var src = Event.element(event); if((tag_name = src.tagName.toUpperCase()) && ( tag_name=='INPUT' || tag_name=='SELECT' || tag_name=='OPTION' || tag_name=='BUTTON' || tag_name=='TEXTAREA')) return; var pointer = [Event.pointerX(event), Event.pointerY(event)]; var pos = this.element.cumulativeOffset(); this.offset = [0,1].map( function(i) { return (pointer[i] - pos[i]) }); Draggables.activate(this); Event.stop(event); } }, startDrag: function(event) { this.dragging = true; if(!this.delta) this.delta = this.currentDelta(); if(this.options.zindex) { this.originalZ = parseInt(Element.getStyle(this.element,'z-index') || 0); this.element.style.zIndex = this.options.zindex; } if(this.options.ghosting) { this._clone = this.element.cloneNode(true); this._originallyAbsolute = (this.element.getStyle('position') == 'absolute'); if (!this._originallyAbsolute) Position.absolutize(this.element); this.element.parentNode.insertBefore(this._clone, this.element); } if(this.options.scroll) { if (this.options.scroll == window) { var where = this._getWindowScroll(this.options.scroll); this.originalScrollLeft = where.left; this.originalScrollTop = where.top; } else { this.originalScrollLeft = this.options.scroll.scrollLeft; this.originalScrollTop = this.options.scroll.scrollTop; } } Draggables.notify('onStart', this, event); if(this.options.starteffect) this.options.starteffect(this.element); }, updateDrag: function(event, pointer) { if(!this.dragging) this.startDrag(event); if(!this.options.quiet){ Position.prepare(); Droppables.show(pointer, this.element); } Draggables.notify('onDrag', this, event); this.draw(pointer); if(this.options.change) this.options.change(this); if(this.options.scroll) { this.stopScrolling(); var p; if (this.options.scroll == window) { with(this._getWindowScroll(this.options.scroll)) { p = [ left, top, left+width, top+height ]; } } else { p = Position.page(this.options.scroll); p[0] += this.options.scroll.scrollLeft + Position.deltaX; p[1] += this.options.scroll.scrollTop + Position.deltaY; p.push(p[0]+this.options.scroll.offsetWidth); p.push(p[1]+this.options.scroll.offsetHeight); } var speed = [0,0]; if(pointer[0] < (p[0]+this.options.scrollSensitivity)) speed[0] = pointer[0]-(p[0]+this.options.scrollSensitivity); if(pointer[1] < (p[1]+this.options.scrollSensitivity)) speed[1] = pointer[1]-(p[1]+this.options.scrollSensitivity); if(pointer[0] > (p[2]-this.options.scrollSensitivity)) speed[0] = pointer[0]-(p[2]-this.options.scrollSensitivity); if(pointer[1] > (p[3]-this.options.scrollSensitivity)) speed[1] = pointer[1]-(p[3]-this.options.scrollSensitivity); this.startScrolling(speed); } // fix AppleWebKit rendering if(Prototype.Browser.WebKit) window.scrollBy(0,0); Event.stop(event); }, finishDrag: function(event, success) { this.dragging = false; if(this.options.quiet){ Position.prepare(); var pointer = [Event.pointerX(event), Event.pointerY(event)]; Droppables.show(pointer, this.element); } if(this.options.ghosting) { if (!this._originallyAbsolute) Position.relativize(this.element); delete this._originallyAbsolute; Element.remove(this._clone); this._clone = null; } var dropped = false; if(success) { dropped = Droppables.fire(event, this.element); if (!dropped) dropped = false; } if(dropped && this.options.onDropped) this.options.onDropped(this.element); Draggables.notify('onEnd', this, event); var revert = this.options.revert; if(revert && Object.isFunction(revert)) revert = revert(this.element); var d = this.currentDelta(); if(revert && this.options.reverteffect) { if (dropped == 0 || revert != 'failure') this.options.reverteffect(this.element, d[1]-this.delta[1], d[0]-this.delta[0]); } else { this.delta = d; } if(this.options.zindex) this.element.style.zIndex = this.originalZ; if(this.options.endeffect) this.options.endeffect(this.element); Draggables.deactivate(this); Droppables.reset(); }, keyPress: function(event) { if(event.keyCode!=Event.KEY_ESC) return; this.finishDrag(event, false); Event.stop(event); }, endDrag: function(event) { if(!this.dragging) return; this.stopScrolling(); this.finishDrag(event, true); Event.stop(event); }, draw: function(point) { var pos = this.element.cumulativeOffset(); if(this.options.ghosting) { var r = Position.realOffset(this.element); pos[0] += r[0] - Position.deltaX; pos[1] += r[1] - Position.deltaY; } var d = this.currentDelta(); pos[0] -= d[0]; pos[1] -= d[1]; if(this.options.scroll && (this.options.scroll != window && this._isScrollChild)) { pos[0] -= this.options.scroll.scrollLeft-this.originalScrollLeft; pos[1] -= this.options.scroll.scrollTop-this.originalScrollTop; } var p = [0,1].map(function(i){ return (point[i]-pos[i]-this.offset[i]) }.bind(this)); if(this.options.snap) { if(Object.isFunction(this.options.snap)) { p = this.options.snap(p[0],p[1],this); } else { if(Object.isArray(this.options.snap)) { p = p.map( function(v, i) { return (v/this.options.snap[i]).round()*this.options.snap[i] }.bind(this)); } else { p = p.map( function(v) { return (v/this.options.snap).round()*this.options.snap }.bind(this)); } }} var style = this.element.style; if((!this.options.constraint) || (this.options.constraint=='horizontal')) style.left = p[0] + "px"; if((!this.options.constraint) || (this.options.constraint=='vertical')) style.top = p[1] + "px"; if(style.visibility=="hidden") style.visibility = ""; // fix gecko rendering }, stopScrolling: function() { if(this.scrollInterval) { clearInterval(this.scrollInterval); this.scrollInterval = null; Draggables._lastScrollPointer = null; } }, startScrolling: function(speed) { if(!(speed[0] || speed[1])) return; this.scrollSpeed = [speed[0]*this.options.scrollSpeed,speed[1]*this.options.scrollSpeed]; this.lastScrolled = new Date(); this.scrollInterval = setInterval(this.scroll.bind(this), 10); }, scroll: function() { var current = new Date(); var delta = current - this.lastScrolled; this.lastScrolled = current; if(this.options.scroll == window) { with (this._getWindowScroll(this.options.scroll)) { if (this.scrollSpeed[0] || this.scrollSpeed[1]) { var d = delta / 1000; this.options.scroll.scrollTo( left + d*this.scrollSpeed[0], top + d*this.scrollSpeed[1] ); } } } else { this.options.scroll.scrollLeft += this.scrollSpeed[0] * delta / 1000; this.options.scroll.scrollTop += this.scrollSpeed[1] * delta / 1000; } Position.prepare(); Droppables.show(Draggables._lastPointer, this.element); Draggables.notify('onDrag', this); if (this._isScrollChild) { Draggables._lastScrollPointer = Draggables._lastScrollPointer || $A(Draggables._lastPointer); Draggables._lastScrollPointer[0] += this.scrollSpeed[0] * delta / 1000; Draggables._lastScrollPointer[1] += this.scrollSpeed[1] * delta / 1000; if (Draggables._lastScrollPointer[0] < 0) Draggables._lastScrollPointer[0] = 0; if (Draggables._lastScrollPointer[1] < 0) Draggables._lastScrollPointer[1] = 0; this.draw(Draggables._lastScrollPointer); } if(this.options.change) this.options.change(this); }, _getWindowScroll: function(w) { var T, L, W, H; with (w.document) { if (w.document.documentElement && documentElement.scrollTop) { T = documentElement.scrollTop; L = documentElement.scrollLeft; } else if (w.document.body) { T = body.scrollTop; L = body.scrollLeft; } if (w.innerWidth) { W = w.innerWidth; H = w.innerHeight; } else if (w.document.documentElement && documentElement.clientWidth) { W = documentElement.clientWidth; H = documentElement.clientHeight; } else { W = body.offsetWidth; H = body.offsetHeight; } } return { top: T, left: L, width: W, height: H }; } }); Draggable._dragging = { }; /*--------------------------------------------------------------------------*/ var SortableObserver = Class.create({ initialize: function(element, observer) { this.element = $(element); this.observer = observer; this.lastValue = Sortable.serialize(this.element); }, onStart: function() { this.lastValue = Sortable.serialize(this.element); }, onEnd: function() { Sortable.unmark(); if(this.lastValue != Sortable.serialize(this.element)) this.observer(this.element) } }); var Sortable = { SERIALIZE_RULE: /^[^_\-](?:[A-Za-z0-9\-\_]*)[_](.*)$/, sortables: { }, _findRootElement: function(element) { while (element.tagName.toUpperCase() != "BODY") { if(element.id && Sortable.sortables[element.id]) return element; element = element.parentNode; } }, options: function(element) { element = Sortable._findRootElement($(element)); if(!element) return; return Sortable.sortables[element.id]; }, destroy: function(element){ element = $(element); var s = Sortable.sortables[element.id]; if(s) { Draggables.removeObserver(s.element); s.droppables.each(function(d){ Droppables.remove(d) }); s.draggables.invoke('destroy'); delete Sortable.sortables[s.element.id]; } }, create: function(element) { element = $(element); var options = Object.extend({ element: element, tag: 'li', // assumes li children, override with tag: 'tagname' dropOnEmpty: false, tree: false, treeTag: 'ul', overlap: 'vertical', // one of 'vertical', 'horizontal' constraint: 'vertical', // one of 'vertical', 'horizontal', false containment: element, // also takes array of elements (or id's); or false handle: false, // or a CSS class only: false, delay: 0, hoverclass: null, ghosting: false, quiet: false, scroll: false, scrollSensitivity: 20, scrollSpeed: 15, format: this.SERIALIZE_RULE, // these take arrays of elements or ids and can be // used for better initialization performance elements: false, handles: false, onChange: Prototype.emptyFunction, onUpdate: Prototype.emptyFunction }, arguments[1] || { }); // clear any old sortable with same element this.destroy(element); // build options for the draggables var options_for_draggable = { revert: true, quiet: options.quiet, scroll: options.scroll, scrollSpeed: options.scrollSpeed, scrollSensitivity: options.scrollSensitivity, delay: options.delay, ghosting: options.ghosting, constraint: options.constraint, handle: options.handle }; if(options.starteffect) options_for_draggable.starteffect = options.starteffect; if(options.reverteffect) options_for_draggable.reverteffect = options.reverteffect; else if(options.ghosting) options_for_draggable.reverteffect = function(element) { element.style.top = 0; element.style.left = 0; }; if(options.endeffect) options_for_draggable.endeffect = options.endeffect; if(options.zindex) options_for_draggable.zindex = options.zindex; // build options for the droppables var options_for_droppable = { overlap: options.overlap, containment: options.containment, tree: options.tree, hoverclass: options.hoverclass, onHover: Sortable.onHover }; var options_for_tree = { onHover: Sortable.onEmptyHover, overlap: options.overlap, containment: options.containment, hoverclass: options.hoverclass }; // fix for gecko engine Element.cleanWhitespace(element); options.draggables = []; options.droppables = []; // drop on empty handling if(options.dropOnEmpty || options.tree) { Droppables.add(element, options_for_tree); options.droppables.push(element); } (options.elements || this.findElements(element, options) || []).each( function(e,i) { var handle = options.handles ? $(options.handles[i]) : (options.handle ? $(e).select('.' + options.handle)[0] : e); options.draggables.push( new Draggable(e, Object.extend(options_for_draggable, { handle: handle }))); Droppables.add(e, options_for_droppable); if(options.tree) e.treeNode = element; options.droppables.push(e); }); if(options.tree) { (Sortable.findTreeElements(element, options) || []).each( function(e) { Droppables.add(e, options_for_tree); e.treeNode = element; options.droppables.push(e); }); } // keep reference this.sortables[element.identify()] = options; // for onupdate Draggables.addObserver(new SortableObserver(element, options.onUpdate)); }, // return all suitable-for-sortable elements in a guaranteed order findElements: function(element, options) { return Element.findChildren( element, options.only, options.tree ? true : false, options.tag); }, findTreeElements: function(element, options) { return Element.findChildren( element, options.only, options.tree ? true : false, options.treeTag); }, onHover: function(element, dropon, overlap) { if(Element.isParent(dropon, element)) return; if(overlap > .33 && overlap < .66 && Sortable.options(dropon).tree) { return; } else if(overlap>0.5) { Sortable.mark(dropon, 'before'); if(dropon.previousSibling != element) { var oldParentNode = element.parentNode; element.style.visibility = "hidden"; // fix gecko rendering dropon.parentNode.insertBefore(element, dropon); if(dropon.parentNode!=oldParentNode) Sortable.options(oldParentNode).onChange(element); Sortable.options(dropon.parentNode).onChange(element); } } else { Sortable.mark(dropon, 'after'); var nextElement = dropon.nextSibling || null; if(nextElement != element) { var oldParentNode = element.parentNode; element.style.visibility = "hidden"; // fix gecko rendering dropon.parentNode.insertBefore(element, nextElement); if(dropon.parentNode!=oldParentNode) Sortable.options(oldParentNode).onChange(element); Sortable.options(dropon.parentNode).onChange(element); } } }, onEmptyHover: function(element, dropon, overlap) { var oldParentNode = element.parentNode; var droponOptions = Sortable.options(dropon); if(!Element.isParent(dropon, element)) { var index; var children = Sortable.findElements(dropon, {tag: droponOptions.tag, only: droponOptions.only}); var child = null; if(children) { var offset = Element.offsetSize(dropon, droponOptions.overlap) * (1.0 - overlap); for (index = 0; index < children.length; index += 1) { if (offset - Element.offsetSize (children[index], droponOptions.overlap) >= 0) { offset -= Element.offsetSize (children[index], droponOptions.overlap); } else if (offset - (Element.offsetSize (children[index], droponOptions.overlap) / 2) >= 0) { child = index + 1 < children.length ? children[index + 1] : null; break; } else { child = children[index]; break; } } } dropon.insertBefore(element, child); Sortable.options(oldParentNode).onChange(element); droponOptions.onChange(element); } }, unmark: function() { if(Sortable._marker) Sortable._marker.hide(); }, mark: function(dropon, position) { // mark on ghosting only var sortable = Sortable.options(dropon.parentNode); if(sortable && !sortable.ghosting) return; if(!Sortable._marker) { Sortable._marker = ($('dropmarker') || Element.extend(document.createElement('DIV'))). hide().addClassName('dropmarker').setStyle({position:'absolute'}); document.getElementsByTagName("body").item(0).appendChild(Sortable._marker); } var offsets = dropon.cumulativeOffset(); Sortable._marker.setStyle({left: offsets[0]+'px', top: offsets[1] + 'px'}); if(position=='after') if(sortable.overlap == 'horizontal') Sortable._marker.setStyle({left: (offsets[0]+dropon.clientWidth) + 'px'}); else Sortable._marker.setStyle({top: (offsets[1]+dropon.clientHeight) + 'px'}); Sortable._marker.show(); }, _tree: function(element, options, parent) { var children = Sortable.findElements(element, options) || []; for (var i = 0; i < children.length; ++i) { var match = children[i].id.match(options.format); if (!match) continue; var child = { id: encodeURIComponent(match ? match[1] : null), element: element, parent: parent, children: [], position: parent.children.length, container: $(children[i]).down(options.treeTag) }; /* Get the element containing the children and recurse over it */ if (child.container) this._tree(child.container, options, child); parent.children.push (child); } return parent; }, tree: function(element) { element = $(element); var sortableOptions = this.options(element); var options = Object.extend({ tag: sortableOptions.tag, treeTag: sortableOptions.treeTag, only: sortableOptions.only, name: element.id, format: sortableOptions.format }, arguments[1] || { }); var root = { id: null, parent: null, children: [], container: element, position: 0 }; return Sortable._tree(element, options, root); }, /* Construct a [i] index for a particular node */ _constructIndex: function(node) { var index = ''; do { if (node.id) index = '[' + node.position + ']' + index; } while ((node = node.parent) != null); return index; }, sequence: function(element) { element = $(element); var options = Object.extend(this.options(element), arguments[1] || { }); return $(this.findElements(element, options) || []).map( function(item) { return item.id.match(options.format) ? item.id.match(options.format)[1] : ''; }); }, setSequence: function(element, new_sequence) { element = $(element); var options = Object.extend(this.options(element), arguments[2] || { }); var nodeMap = { }; this.findElements(element, options).each( function(n) { if (n.id.match(options.format)) nodeMap[n.id.match(options.format)[1]] = [n, n.parentNode]; n.parentNode.removeChild(n); }); new_sequence.each(function(ident) { var n = nodeMap[ident]; if (n) { n[1].appendChild(n[0]); delete nodeMap[ident]; } }); }, serialize: function(element) { element = $(element); var options = Object.extend(Sortable.options(element), arguments[1] || { }); var name = encodeURIComponent( (arguments[1] && arguments[1].name) ? arguments[1].name : element.id); if (options.tree) { return Sortable.tree(element, arguments[1]).children.map( function (item) { return [name + Sortable._constructIndex(item) + "[id]=" + encodeURIComponent(item.id)].concat(item.children.map(arguments.callee)); }).flatten().join('&'); } else { return Sortable.sequence(element, arguments[1]).map( function(item) { return name + "[]=" + encodeURIComponent(item); }).join('&'); } } }; // Returns true if child is contained within element Element.isParent = function(child, element) { if (!child.parentNode || child == element) return false; if (child.parentNode == element) return true; return Element.isParent(child.parentNode, element); }; Element.findChildren = function(element, only, recursive, tagName) { if(!element.hasChildNodes()) return null; tagName = tagName.toUpperCase(); if(only) only = [only].flatten(); var elements = []; $A(element.childNodes).each( function(e) { if(e.tagName && e.tagName.toUpperCase()==tagName && (!only || (Element.classNames(e).detect(function(v) { return only.include(v) })))) elements.push(e); if(recursive) { var grandchildren = Element.findChildren(e, only, recursive, tagName); if(grandchildren) elements.push(grandchildren); } }); return (elements.length>0 ? elements.flatten() : []); }; Element.offsetSize = function (element, type) { return element['offset' + ((type=='vertical' || type=='height') ? 'Height' : 'Width')]; };./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/public/422.html0000644000000000000000000000130712674201751025661 0ustar The change you wanted was rejected (422)

    The change you wanted was rejected.

    Maybe you tried to change something you didn't have access to.

    ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/public/favicon.ico0000644000000000000000000000000012674201751026572 0ustar ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/public/404.html0000644000000000000000000000133012674201751025655 0ustar The page you were looking for doesn't exist (404)

    The page you were looking for doesn't exist.

    You may have mistyped the address or the page may have moved.

    ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/public/stylesheets/0000755000000000000000000000000012674201751027037 5ustar ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/public/stylesheets/.gitkeep./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/public/stylesheets/.gitkee0000644000000000000000000000000012674201751030276 0ustar ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/public/stylesheets/scaffold.css./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/public/stylesheets/scaffol0000644000000000000000000000162412674201751030402 0ustar body { background-color: #fff; color: #333; } body, p, ol, ul, td { font-family: verdana, arial, helvetica, sans-serif; font-size: 13px; line-height: 18px; } pre { background-color: #eee; padding: 10px; font-size: 11px; } a { color: #000; } a:visited { color: #666; } a:hover { color: #fff; background-color:#000; } div.field, div.actions { margin-bottom: 10px; } #notice { color: green; } .field_with_errors { padding: 2px; background-color: red; display: table; } #error_explanation { width: 450px; border: 2px solid red; padding: 7px; padding-bottom: 0; margin-bottom: 20px; background-color: #f0f0f0; } #error_explanation h2 { text-align: left; font-weight: bold; padding: 5px 5px 5px 15px; font-size: 12px; margin: -7px; margin-bottom: 0px; background-color: #c00; color: #fff; } #error_explanation ul li { font-size: 12px; list-style: square; } ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/.gitignore0000644000000000000000000000010312674201751025167 0ustar .bundle db/*.sqlite3 log/*.log tmp/**/* src config/boot.rb pom*xml ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/invoker.properties0000644000000000000000000000056012674201751027001 0ustar invoker.goals = de.saumya.mojo:rails3-maven-plugin:${project.version}:pom de.saumya.mojo:jruby-maven-plugin:${project.version}:jruby invoker.goals.2 = de.saumya.mojo:rails3-maven-plugin:${project.version}:generate invoker.goals.3 = de.saumya.mojo:rails3-maven-plugin:${project.version}:rake invoker.goals.4 = verify invoker.mavenOpts = -client #invoker.offline = true ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/vendor/0000755000000000000000000000000012674201751024502 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/vendor/plugins/0000755000000000000000000000000012674201751026163 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/vendor/plugins/.gitkeep0000644000000000000000000000000012674201751027602 0ustar ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/app/0000755000000000000000000000000012674201751023765 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/app/helpers/0000755000000000000000000000000012674201751025427 5ustar ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/app/helpers/users_helper.rb./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/app/helpers/users_helper.r0000644000000000000000000000002712674201751030311 0ustar module UsersHelper end ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/app/helpers/application_helper.rb./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/app/helpers/application_he0000644000000000000000000000003512674201751030327 0ustar module ApplicationHelper end ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/app/models/0000755000000000000000000000000012674201751025250 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/app/models/user.rb0000644000000000000000000000004412674201751026551 0ustar class User < ActiveRecord::Base end ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/app/controllers/0000755000000000000000000000000012674201751026333 5ustar ././@LongLink0000644000000000000000000000016400000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/app/controllers/application_controller.rb./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/app/controllers/applicatio0000644000000000000000000000012012674201751030374 0ustar class ApplicationController < ActionController::Base protect_from_forgery end ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/app/controllers/users_controller.rb./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/app/controllers/users_cont0000644000000000000000000000351712674201751030450 0ustar class UsersController < ApplicationController # GET /users # GET /users.xml def index @users = User.all respond_to do |format| format.html # index.html.erb format.xml { render :xml => @users } end end # GET /users/1 # GET /users/1.xml def show @user = User.find(params[:id]) respond_to do |format| format.html # show.html.erb format.xml { render :xml => @user } end end # GET /users/new # GET /users/new.xml def new @user = User.new respond_to do |format| format.html # new.html.erb format.xml { render :xml => @user } end end # GET /users/1/edit def edit @user = User.find(params[:id]) end # POST /users # POST /users.xml def create @user = User.new(params[:user]) respond_to do |format| if @user.save format.html { redirect_to(@user, :notice => 'User was successfully created.') } format.xml { render :xml => @user, :status => :created, :location => @user } else format.html { render :action => "new" } format.xml { render :xml => @user.errors, :status => :unprocessable_entity } end end end # PUT /users/1 # PUT /users/1.xml def update @user = User.find(params[:id]) respond_to do |format| if @user.update_attributes(params[:user]) format.html { redirect_to(@user, :notice => 'User was successfully updated.') } format.xml { head :ok } else format.html { render :action => "edit" } format.xml { render :xml => @user.errors, :status => :unprocessable_entity } end end end # DELETE /users/1 # DELETE /users/1.xml def destroy @user = User.find(params[:id]) @user.destroy respond_to do |format| format.html { redirect_to(users_url) } format.xml { head :ok } end end end ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/app/views/0000755000000000000000000000000012674201751025122 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/app/views/users/0000755000000000000000000000000012674201751026263 5ustar ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/app/views/users/show.html.erb./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/app/views/users/show.html.0000644000000000000000000000024112674201751030204 0ustar

    <%= notice %>

    Name: <%= @user.name %>

    <%= link_to 'Edit', edit_user_path(@user) %> | <%= link_to 'Back', users_path %> ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/app/views/users/edit.html.erb./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/app/views/users/edit.html.0000644000000000000000000000015612674201751030156 0ustar

    Editing user

    <%= render 'form' %> <%= link_to 'Show', @user %> | <%= link_to 'Back', users_path %> ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/app/views/users/index.html.erb./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/app/views/users/index.html0000644000000000000000000000067112674201751030264 0ustar

    Listing users

    <% @users.each do |user| %> <% end %>
    Name
    <%= user.name %> <%= link_to 'Show', user %> <%= link_to 'Edit', edit_user_path(user) %> <%= link_to 'Destroy', user, :confirm => 'Are you sure?', :method => :delete %>

    <%= link_to 'New User', new_user_path %> ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/app/views/users/_form.html.erb./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/app/views/users/_form.html0000644000000000000000000000075412674201751030261 0ustar <%= form_for(@user) do |f| %> <% if @user.errors.any? %>

    <%= pluralize(@user.errors.count, "error") %> prohibited this user from being saved:

      <% @user.errors.full_messages.each do |msg| %>
    • <%= msg %>
    • <% end %>
    <% end %>
    <%= f.label :name %>
    <%= f.text_field :name %>
    <%= f.submit %>
    <% end %> ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/app/views/users/new.html.erb./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/app/views/users/new.html.e0000644000000000000000000000011312674201751030160 0ustar

    New user

    <%= render 'form' %> <%= link_to 'Back', users_path %> ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/app/views/layouts/0000755000000000000000000000000012674201751026622 5ustar ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/app/views/layouts/application.html.erb./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/app/views/layouts/applicat0000644000000000000000000000031412674201751030340 0ustar Gemfile2pom <%= stylesheet_link_tag :all %> <%= javascript_include_tag :defaults %> <%= csrf_meta_tag %> <%= yield %> ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/lib/0000755000000000000000000000000012674201751023753 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/lib/tasks/0000755000000000000000000000000012674201751025100 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/lib/tasks/.gitkeep0000644000000000000000000000000012674201751026517 0ustar ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/gemfile2pom/Rakefile0000644000000000000000000000041712674201751024654 0ustar # Add your own tasks in files placed in lib/tasks ending in .rake, # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. require File.expand_path('../config/application', __FILE__) require 'rake' Gemfile2pom::Application.load_tasks ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_rails_3_0_11_sqlite3_datamapper/0000755000000000000000000000000012674201751027566 5ustar ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_rails_3_0_11_sqlite3_datamapper/verify.bsh./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_rails_3_0_11_sqlite3_datamapper/ve0000644000000000000000000000220212674201751030117 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; File target = new File( basedir, "target"); // File file = new File( target, "index.html" ); // if ( !file.isFile() ) // { // throw new FileNotFoundException( "Could not find: " + file ); // } // File users = new File( target, "users.html" ); // if ( !users.isFile() ) // { // throw new FileNotFoundException( "Could not find: " + users ); // } // File file = new File( target, "new.html" ); // if ( !file.isFile() ) // { // throw new FileNotFoundException( "Could not find: " + file ); // } String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); if ( !log.contains( "No POM" ) ) { throw new RuntimeException( "log file does not contain 'No POM'" ); } // String usersFile = FileUtils.fileRead( users ); // if ( !usersFile.contains( "

    Listing users

    " ) ) // { // throw new RuntimeException( "users file does not contain '

    Listing users

    '" ); // } // String newFile = FileUtils.fileRead( file ); // if ( !newFile.contains( "value=\"Create" ) ) // { // throw new RuntimeException( "new file does not contain 'value=\"Create'" ); // } ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_rails_3_0_11_sqlite3_datamapper/pom-server.xml./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_rails_3_0_11_sqlite3_datamapper/po0000644000000000000000000000371112674201751030131 0ustar 4.0.0 rails rails_app 0.0.0 pom-base.xml server war 8080 org.mortbay.jetty jetty-maven-plugin ${jetty.version} foo 9999 ${jetty.port} start-jetty pre-integration-test run-war true stop-jetty post-integration-test stop maven-antrun-plugin 1.3 get-files integration-test run ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_rails_3_0_11_sqlite3_datamapper/pom2pom.rb./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_rails_3_0_11_sqlite3_datamapper/po0000644000000000000000000000054312674201751030131 0ustar require 'fileutils' Dir.glob("rails_app/*").each do |f| path = f.sub(/rails_app./, '') FileUtils.rm_rf(path) FileUtils.mv(f, path) end FileUtils.rm_r("rails_app") FileUtils.rm_r(File.join("target", "jetty")) pom = File.read('pom.xml').sub(/>warpom<') File.open('pom-base.xml', 'w') { |f| f.print(pom) } File.rename('pom-server.xml', 'pom.xml') ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_rails_3_0_11_sqlite3_datamapper/setup.bsh./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_rails_3_0_11_sqlite3_datamapper/se0000644000000000000000000000037412674201751030124 0ustar import java.io.*; new File( new File( basedir, "script" ), "rails" ).delete(); new File( basedir, "script" ).delete(); new File( basedir, "Gemfile" ).delete(); new File( basedir, "Gemfile.maven" ).delete(); new File( basedir, "pom.xml").delete(); ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_rails_3_0_11_sqlite3_datamapper/test.properties./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_rails_3_0_11_sqlite3_datamapper/te0000644000000000000000000000032612674201751030122 0ustar app_path=rails_app orm=datamapper rails.args=-f rails.version=3.0.11 gem.includeOpenSSL=false # otherwise there is an NPE jruby.file=pom2pom.rb task=db:automigrate generator=scaffold generate.args=user name:string ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_rails_3_0_11_sqlite3_datamapper/pom.xml./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_rails_3_0_11_sqlite3_datamapper/po0000644000000000000000000000060012674201751030123 0ustar 4.0.0 com.example no-pom-placeholder 0.0.0 ././@LongLink0000644000000000000000000000016500000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_rails_3_0_11_sqlite3_datamapper/invoker.properties./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_rails_3_0_11_sqlite3_datamapper/in0000644000000000000000000000053112674201751030116 0ustar invoker.goals = de.saumya.mojo:rails3-maven-plugin:${project.version}:new de.saumya.mojo:jruby-maven-plugin:${project.version}:jruby invoker.goals.2 = de.saumya.mojo:rails3-maven-plugin:${project.version}:generate invoker.goals.3 = de.saumya.mojo:rails3-maven-plugin:${project.version}:rake #invoker.goals.4 = verify invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_rails_3_0_11_sqlite3/0000755000000000000000000000000012674201751025370 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_rails_3_0_11_sqlite3/verify.bsh0000644000000000000000000000206712674201751027377 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; File target = new File( basedir, "target"); File file = new File( target, "index.html" ); if ( !file.isFile() ) { throw new FileNotFoundException( "Could not find: " + file ); } File users = new File( target, "users.html" ); if ( !users.isFile() ) { throw new FileNotFoundException( "Could not find: " + users ); } File file = new File( target, "new.html" ); if ( !file.isFile() ) { throw new FileNotFoundException( "Could not find: " + file ); } String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); if ( !log.contains( "No POM" ) ) { throw new RuntimeException( "log file does not contain 'No POM'" ); } String usersFile = FileUtils.fileRead( users ); if ( !usersFile.contains( "

    Listing users

    " ) ) { throw new RuntimeException( "users file does not contain '

    Listing users

    '" ); } String newFile = FileUtils.fileRead( file ); if ( !newFile.contains( "value=\"Create" ) ) { throw new RuntimeException( "new file does not contain 'value=\"Create'" ); } ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_rails_3_0_11_sqlite3/pom-server.xml./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_rails_3_0_11_sqlite3/pom-server.xm0000644000000000000000000000371212674201751030040 0ustar 4.0.0 rails rails_app 0.0.0 pom-base.xml server war 8080 org.mortbay.jetty jetty-maven-plugin ${jetty.version} foo 9999 ${jetty.port} start-jetty pre-integration-test run-war true stop-jetty post-integration-test stop maven-antrun-plugin 1.3 get-files integration-test run ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_rails_3_0_11_sqlite3/pom2pom.rb0000644000000000000000000000054312674201751027310 0ustar require 'fileutils' Dir.glob("rails_app/*").each do |f| path = f.sub(/rails_app./, '') FileUtils.rm_rf(path) FileUtils.mv(f, path) end FileUtils.rm_r("rails_app") FileUtils.rm_r(File.join("target", "jetty")) pom = File.read('pom.xml').sub(/>warpom<') File.open('pom-base.xml', 'w') { |f| f.print(pom) } File.rename('pom-server.xml', 'pom.xml') ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_rails_3_0_11_sqlite3/setup.bsh0000644000000000000000000000037412674201751027232 0ustar import java.io.*; new File( new File( basedir, "script" ), "rails" ).delete(); new File( basedir, "script" ).delete(); new File( basedir, "Gemfile" ).delete(); new File( basedir, "Gemfile.maven" ).delete(); new File( basedir, "pom.xml").delete(); ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_rails_3_0_11_sqlite3/test.properties./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_rails_3_0_11_sqlite3/test.properti0000644000000000000000000000031512674201751030134 0ustar app_path=rails_app rails.version=3.0.11 rails.args=-f gem.includeOpenSSL=false # otherwise there is an NPE jruby.file=pom2pom.rb task=db:create db:migrate generator=scaffold generate.args=user name:string ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_rails_3_0_11_sqlite3/pom.xml0000644000000000000000000000060012674201751026701 0ustar 4.0.0 com.example no-pom-placeholder 0.0.0 ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_rails_3_0_11_sqlite3/invoker.properties./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/new_rails_3_0_11_sqlite3/invoker.prope0000644000000000000000000000056012674201751030115 0ustar invoker.goals = de.saumya.mojo:rails3-maven-plugin:${project.version}:new de.saumya.mojo:jruby-maven-plugin:${project.version}:jruby invoker.goals.2 = de.saumya.mojo:rails3-maven-plugin:${project.version}:generate invoker.goals.3 = de.saumya.mojo:rails3-maven-plugin:${project.version}:rake invoker.goals.4 = verify invoker.mavenOpts = -client #invoker.offline = true ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/0000755000000000000000000000000012674201751024026 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/verify.bsh0000644000000000000000000000207012674201751026027 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; File target = new File( basedir, "target"); File file = new File( target, "index.html" ); if ( !file.isFile() ) { throw new FileNotFoundException( "Could not find: " + file ); } File users = new File( target, "users.html" ); if ( !users.isFile() ) { throw new FileNotFoundException( "Could not find: " + users ); } File file = new File( target, "new.html" ); if ( !file.isFile() ) { throw new FileNotFoundException( "Could not find: " + file ); } String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); if ( !log.contains( "No POM" ) ) { throw new RuntimeException( "log file does not contain 'No POM'" ); } String usersFile = FileUtils.fileRead( users ); if ( !usersFile.contains( "

    Listing users

    " ) ) { throw new RuntimeException( "users file does not contain '

    Listing users

    '" ); } String newFile = FileUtils.fileRead( file ); if ( !newFile.contains( "value=\"Create" ) ) { throw new RuntimeException( "new file does not contain 'value=\"Create'" ); } ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/config/0000755000000000000000000000000012674201751025273 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/config/initializers/0000755000000000000000000000000012674201751030001 5ustar ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/config/initializers/secret_token.rb./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/config/initializers/se0000644000000000000000000000076612674201751030344 0ustar # Be sure to restart your server when you modify this file. # Your secret key for verifying the integrity of signed cookies. # If you change this key, all old signed cookies will become invalid! # Make sure the secret is at least 30 characters and all random, # no regular words or you'll be exposed to dictionary attacks. Gemfile2pom::Application.config.secret_token = '34b39a37533b33972b85b89b5e304c16549bf09b3c98f9894adcdfa3419730759fc40ba5fc5a636628fed07907a16059edcbff559903ddd3cc299f9c46ef838d' ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/config/initializers/mime_types.rb./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/config/initializers/mi0000644000000000000000000000031512674201751030330 0ustar # Be sure to restart your server when you modify this file. # Add new mime types for use in respond_to blocks: # Mime::Type.register "text/richtext", :rtf # Mime::Type.register_alias "text/html", :iphone ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/config/initializers/inflections.rb./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/config/initializers/in0000644000000000000000000000057012674201751030334 0ustar # Be sure to restart your server when you modify this file. # Add new inflection rules using the following format # (all these examples are active by default): # ActiveSupport::Inflector.inflections do |inflect| # inflect.plural /^(ox)$/i, '\1en' # inflect.singular /^(ox)en/i, '\1' # inflect.irregular 'person', 'people' # inflect.uncountable %w( fish sheep ) # end ././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/config/initializers/session_store.rb./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/config/initializers/se0000644000000000000000000000064312674201751030336 0ustar # Be sure to restart your server when you modify this file. Gemfile2pom::Application.config.session_store :cookie_store, :key => '_gemfile2pom_session' # Use the database for sessions instead of the cookie-based default, # which shouldn't be used to store highly confidential information # (create the session table with "rake db:sessions:create") # Gemfile2pom::Application.config.session_store :active_record_store ././@LongLink0000644000000000000000000000017100000000000011602 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/config/initializers/backtrace_silencers.rb./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/config/initializers/ba0000644000000000000000000000062412674201751030310 0ustar # Be sure to restart your server when you modify this file. # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. # Rails.backtrace_cleaner.remove_silencers! ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/config/locales/0000755000000000000000000000000012674201751026715 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/config/locales/en.yml0000644000000000000000000000032512674201751030042 0ustar # Sample localization file for English. Add more files in this directory for other locales. # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. en: hello: "Hello world" ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/config/environment.rb0000644000000000000000000000023312674201751030162 0ustar # Load the rails application require File.expand_path('../application', __FILE__) # Initialize the rails application Gemfile2pom::Application.initialize! ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/config/routes.rb0000644000000000000000000000342612674201751027146 0ustar Gemfile2pom::Application.routes.draw do resources :users # The priority is based upon order of creation: # first created -> highest priority. # Sample of regular route: # match 'products/:id' => 'catalog#view' # Keep in mind you can assign values other than :controller and :action # Sample of named route: # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase # This route can be invoked with purchase_url(:id => product.id) # Sample resource route (maps HTTP verbs to controller actions automatically): # resources :products # Sample resource route with options: # resources :products do # member do # get 'short' # post 'toggle' # end # # collection do # get 'sold' # end # end # Sample resource route with sub-resources: # resources :products do # resources :comments, :sales # resource :seller # end # Sample resource route with more complex sub-resources # resources :products do # resources :comments # resources :sales do # get 'recent', :on => :collection # end # end # Sample resource route within a namespace: # namespace :admin do # # Directs /admin/products/* to Admin::ProductsController # # (app/controllers/admin/products_controller.rb) # resources :products # end # You can have the root of your site routed with "root" # just remember to delete public/index.html. # root :to => "welcome#index" # See how all your routes lay out with "rake routes" # This is a legacy wild controller route that's not recommended for RESTful applications. # Note: This route will make all actions in every controller accessible via GET requests. # match ':controller(/:action(/:id(.:format)))' end ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/config/application.rb0000644000000000000000000000361112674201751030124 0ustar require File.expand_path('../boot', __FILE__) require 'rails/all' # If you have a Gemfile, require the gems listed there, including any gems # you've limited to :test, :development, or :production. Bundler.require(:default, Rails.env) if defined?(Bundler) module Gemfile2pom class Application < Rails::Application # Settings in config/environments/* take precedence over those specified here. # Application configuration should go into files in config/initializers # -- all .rb files in that directory are automatically loaded. # Custom directories with classes and modules you want to be autoloadable. # config.autoload_paths += %W(#{config.root}/extras) # Only load the plugins named here, in the order given (default is alphabetical). # :all can be used as a placeholder for all plugins not explicitly named. # config.plugins = [ :exception_notification, :ssl_requirement, :all ] # Activate observers that should always be running. # config.active_record.observers = :cacher, :garbage_collector, :forum_observer # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. # config.time_zone = 'Central Time (US & Canada)' # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] # config.i18n.default_locale = :de # JavaScript files you want as :defaults (application.js is always included). # config.action_view.javascript_expansions[:defaults] = %w(jquery rails) # Configure the default encoding used in templates for Ruby 1.9. config.encoding = "utf-8" # Configure sensitive parameters which will be filtered from the log file. config.filter_parameters += [:password] end end ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/config/database.yml0000644000000000000000000000103212674201751027556 0ustar # SQLite version 3.x # gem install sqlite3-ruby (not necessary on OS X Leopard) development: adapter: sqlite3 database: db/development.sqlite3 pool: 5 timeout: 5000 # Warning: The database defined as "test" will be erased and # re-generated from your development database when you run "rake". # Do not set this db to the same as development or production. test: adapter: sqlite3 database: db/test.sqlite3 pool: 5 timeout: 5000 production: adapter: sqlite3 database: db/production.sqlite3 pool: 5 timeout: 5000 ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/config/environments/0000755000000000000000000000000012674201751030022 5ustar ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/config/environments/development.rb./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/config/environments/de0000644000000000000000000000173712674201751030345 0ustar Gemfile2pom::Application.configure do # Settings specified here will take precedence over those in config/environment.rb # In the development environment your application's code is reloaded on # every request. This slows down response time but is perfect for development # since you don't have to restart the webserver when you make code changes. config.cache_classes = false # Log error messages when you accidentally call methods on nil. config.whiny_nils = true # Show full error reports and disable caching config.consider_all_requests_local = true config.action_view.debug_rjs = true config.action_controller.perform_caching = false # Don't care if the mailer can't send config.action_mailer.raise_delivery_errors = false # Print deprecation notices to the Rails logger config.active_support.deprecation = :log # Only use best-standards-support built into browsers config.action_dispatch.best_standards_support = :builtin end ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/config/environments/production.rb./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/config/environments/pr0000644000000000000000000000334012674201751030366 0ustar Gemfile2pom::Application.configure do # Settings specified here will take precedence over those in config/environment.rb # The production environment is meant for finished, "live" apps. # Code is not reloaded between requests config.cache_classes = true # Full error reports are disabled and caching is turned on config.consider_all_requests_local = false config.action_controller.perform_caching = true # Specifies the header that your server uses for sending files config.action_dispatch.x_sendfile_header = "X-Sendfile" # For nginx: # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # If you have no front-end server that supports something like X-Sendfile, # just comment this out and Rails will serve the files # See everything in the log (default is :info) # config.log_level = :debug # Use a different logger for distributed setups # config.logger = SyslogLogger.new # Use a different cache store in production # config.cache_store = :mem_cache_store # Disable Rails's static asset server # In production, Apache or nginx will already do this config.serve_static_assets = false # Enable serving of images, stylesheets, and javascripts from an asset server # config.action_controller.asset_host = "http://assets.example.com" # Disable delivery errors, bad email addresses will be ignored # config.action_mailer.raise_delivery_errors = false # Enable threaded mode # config.threadsafe! # Enable locale fallbacks for I18n (makes lookups for any locale fall back to # the I18n.default_locale when a translation can not be found) config.i18n.fallbacks = true # Send deprecation notices to registered listeners config.active_support.deprecation = :notify end ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/config/environments/test.rb./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/config/environments/te0000644000000000000000000000275312674201751030364 0ustar Gemfile2pom::Application.configure do # Settings specified here will take precedence over those in config/environment.rb # The test environment is used exclusively to run your application's # test suite. You never need to work with it otherwise. Remember that # your test database is "scratch space" for the test suite and is wiped # and recreated between test runs. Don't rely on the data there! config.cache_classes = true # Log error messages when you accidentally call methods on nil. config.whiny_nils = true # Show full error reports and disable caching config.consider_all_requests_local = true config.action_controller.perform_caching = false # Raise exceptions instead of rendering exception templates config.action_dispatch.show_exceptions = false # Disable request forgery protection in test environment config.action_controller.allow_forgery_protection = false # Tell Action Mailer not to deliver emails to the real world. # The :test delivery method accumulates sent emails in the # ActionMailer::Base.deliveries array. config.action_mailer.delivery_method = :test # Use SQL instead of Active Record's schema dumper when creating the test database. # This is necessary if your schema can't be completely dumped by the schema dumper, # like if you have constraints or database-specific column types # config.active_record.schema_format = :sql # Print deprecation notices to the stderr config.active_support.deprecation = :stderr end ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/Gemfile0000644000000000000000000000425612674201751025330 0ustar source 'http://rubygems.org' gem 'rails' gem 'annotate' gem 'normalize_attributes' gem 'haml-rails' gem 'jquery-rails' gem 'devise_ldap_authenticatable' gem 'meta_where' gem 'meta_search' gem 'simple_form' gem 'inherited_resources' gem 'inherited_resources_views' gem 'rails_config' gem 'mongrel' gem 'kaminari' # Bundle edge Rails instead: # gem 'rails', :git => 'git://github.com/rails/rails.git' platforms :ruby do gem 'sqlite3' # Deploy with Capistrano gem 'capistrano' end platforms :jruby do gem 'activerecord-jdbc-adapter' # As rails --database switch does not support derby, hsqldb, h2 nor mssql # as valid values, if you are not using SQLite, comment out the SQLite gem # below and uncomment the gem declaration for the adapter you are using. # If you are using oracle, db2, sybase, informix or prefer to use the plain # JDBC adapter, comment out all the adapter gems below. # SQLite JDBC adapter gem 'jdbc-sqlite3', :require => false gem 'jruby-openssl' end # Use unicorn as the web server # gem 'unicorn' # Deploy with Capistrano # gem 'capistrano' # To use debugger (ruby-debug for Ruby 1.8.7+, ruby-debug19 for Ruby 1.9.2+) #platforms :ruby_18 do # gem 'ruby-debug' # gem 'mongrel', '1.1.5' # gem 'thin' #end #platforms :ruby_19 do #gem 'ruby-debug19', :require => 'ruby-debug' #gem 'mongrel', '1.2.0.pre2' #end # Bundle the extra gems: # gem 'bj' # gem 'nokogiri' # gem 'sqlite3-ruby', :require => 'sqlite3' # gem 'aws-s3', :require => 'aws/s3' # Bundle gems for the local environment. Make sure to # put test-only gems in this group so their generators # and rake tasks are available in development mode: group :development, :test do gem 'rspec-rails' # gem 'cucumber-rails' has a dependency with a prerelease version gem 'capybara' gem 'launchy' gem 'configuration', '~> 1.2.0' # needed by ruby-maven: launchy has it as test dependency gem 'autotest-rails', '4.1.0' #needs ZenTest-4.5 which does not exist gem 'autotest-notification' gem 'database_cleaner' # gem 'spork', '~> 0.9.0.rc' # gem 'machinist', '~> 2.0.0.beta' gem 'faker' end group :development do gem 'hpricot' gem 'ruby_parser' gem 'warbler' if defined?(JRUBY_VERSION) end ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/db/0000755000000000000000000000000012674201751024413 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/db/migrate/0000755000000000000000000000000012674201751026043 5ustar ././@LongLink0000644000000000000000000000017000000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/db/migrate/20101001163415_create_users.rb./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/db/migrate/201010011630000644000000000000000000000030112674201751027076 0ustar class CreateUsers < ActiveRecord::Migration def self.up create_table :users do |t| t.string :name t.timestamps end end def self.down drop_table :users end end ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/db/seeds.rb0000644000000000000000000000054112674201751026043 0ustar # This file should contain all the record creation needed to seed the database with its default values. # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup). # # Examples: # # cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }]) # Mayor.create(:name => 'Daley', :city => cities.first) ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/db/schema.rb0000644000000000000000000000162012674201751026177 0ustar # This file is auto-generated from the current state of the database. Instead # of editing this file, please use the migrations feature of Active Record to # incrementally modify your database, and then regenerate this schema definition. # # Note that this schema.rb definition is the authoritative source for your # database schema. If you need to create the application database on another # system, you should be using db:schema:load, not running all the migrations # from scratch. The latter is a flawed and unsustainable approach (the more migrations # you'll amass, the slower it'll run and the greater likelihood for issues). # # It's strongly recommended to check this file into your version control system. ActiveRecord::Schema.define(:version => 20101001163415) do create_table "users", :force => true do |t| t.string "name" t.datetime "created_at" t.datetime "updated_at" end end ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/pom2pom.rb0000644000000000000000000000021512674201751025742 0ustar pom = File.read('pom.xml').sub(/>warpom<') File.open('pom-base.xml', 'w') { |f| f.print(pom) } File.rename('pom-server.xml', 'pom.xml') ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/setup.bsh0000644000000000000000000000007312674201751025664 0ustar import java.io.*; new File( basedir, "pom.xml").delete(); ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/config.ru0000644000000000000000000000024112674201751025640 0ustar # This file is used by Rack-based servers to start the application. require ::File.expand_path('../config/environment', __FILE__) run Gemfile2pom::Application ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/test.properties0000644000000000000000000000014512674201751027123 0ustar jruby.file=pom2pom.rb task=db:create db:migrate generator=scaffold generate.args=account name:string ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/script/0000755000000000000000000000000012674201751025332 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/script/rails0000755000000000000000000000045012674201751026371 0ustar #!/usr/bin/env jruby # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application. APP_PATH = File.expand_path('../../config/application', __FILE__) require File.expand_path('../../config/boot', __FILE__) require 'rails/commands' ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/test/0000755000000000000000000000000012674201751025005 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/test/functional/0000755000000000000000000000000012674201751027147 5ustar ././@LongLink0000644000000000000000000000016700000000000011607 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/test/functional/users_controller_test.rb./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/test/functional/users_0000644000000000000000000000200312674201751030365 0ustar require 'test_helper' class UsersControllerTest < ActionController::TestCase setup do @user = users(:one) end test "should get index" do get :index assert_response :success assert_not_nil assigns(:users) end test "should get new" do get :new assert_response :success end test "should create user" do assert_difference('User.count') do post :create, :user => @user.attributes end assert_redirected_to user_path(assigns(:user)) end test "should show user" do get :show, :id => @user.to_param assert_response :success end test "should get edit" do get :edit, :id => @user.to_param assert_response :success end test "should update user" do put :update, :id => @user.to_param, :user => @user.attributes assert_redirected_to user_path(assigns(:user)) end test "should destroy user" do assert_difference('User.count', -1) do delete :destroy, :id => @user.to_param end assert_redirected_to users_path end end ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/test/test_helper.rb0000644000000000000000000000070612674201751027653 0ustar ENV["RAILS_ENV"] = "test" require File.expand_path('../../config/environment', __FILE__) require 'rails/test_help' class ActiveSupport::TestCase # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order. # # Note: You'll currently still have to declare fixtures explicitly in integration tests # -- they do not yet inherit this setting fixtures :all # Add more helper methods to be used by all tests here... end ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/test/unit/0000755000000000000000000000000012674201751025764 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/test/unit/helpers/0000755000000000000000000000000012674201751027426 5ustar ././@LongLink0000644000000000000000000000016500000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/test/unit/helpers/users_helper_test.rb./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/test/unit/helpers/user0000644000000000000000000000011012674201751030317 0ustar require 'test_helper' class UsersHelperTest < ActionView::TestCase end ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/test/unit/user_test.rb0000644000000000000000000000022712674201751030327 0ustar require 'test_helper' class UserTest < ActiveSupport::TestCase # Replace this with your real tests. test "the truth" do assert true end end ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/test/fixtures/0000755000000000000000000000000012674201751026656 5ustar ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/test/fixtures/users.yml./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/test/fixtures/users.ym0000644000000000000000000000016712674201751030372 0ustar # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html one: name: MyString two: name: MyString ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/test/performance/0000755000000000000000000000000012674201751027306 5ustar ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/test/performance/browsing_test.rb./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/test/performance/brows0000644000000000000000000000034512674201751030367 0ustar require 'test_helper' require 'rails/performance_test_help' # Profiling results for each test method are written to tmp/performance. class BrowsingTest < ActionDispatch::PerformanceTest def test_homepage get '/' end end ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/public/0000755000000000000000000000000012674201751025304 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/public/index.html0000644000000000000000000001322412674201751027303 0ustar Ruby on Rails: Welcome aboard

    Getting started

    Here’s how to get rolling:

    1. Use rails generate to create your models and controllers

      To see all available options, run it without parameters.

    2. Set up a default route and remove or rename this file

      Routes are set up in config/routes.rb.

    3. Create your database

      Run rake db:migrate to create your database. If you're not using SQLite (the default), edit config/database.yml with your username and password.

    ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/public/robots.txt0000644000000000000000000000031412674201751027353 0ustar # See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file # # To ban all spiders from the entire site uncomment the next two lines: # User-Agent: * # Disallow: / ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/public/500.html0000644000000000000000000000133012674201751026473 0ustar We're sorry, but something went wrong (500)

    We're sorry, but something went wrong.

    We've been notified about this issue and we'll take a look at it shortly.

    ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/public/images/0000755000000000000000000000000012674201751026551 5ustar ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/public/images/rails.png./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/public/images/rails.pn0000644000000000000000000001476612674201751030240 0ustar PNG  IHDR2@X${tEXtSoftwareAdobe ImageReadyqe<IDATxڬ[ \eR֮^;Iwga@`gGgDgtqDFqFDqF@NRU]˫|_-Qy^Ǹ.݋0W_6kbf̻ܸ6<4 w5~*r?9m&"M7@vm' {_S)Vi\WG?իjMd@ lDLX鸺W-TU+@EPo\&*Rnn, fDWrX|3M=\EJB[d6A'=tx^$a86̈{, ϱPepN*_W_3o;ޥ(0E:i6eXnhGf"L|S+(+.gФg=Ych=m#V_#}Ǫ|tR D8VՄM~xg!ni%Dy( B,{(Np$3iر$h.@e[a'eJԂyϠ4>H*MHQ(Jgt-֢QI ^d„@s-'- 51{'0 |n4ۉh{V@ܩw"BT =rzqPpBHȃ?ň ]-qpgsPiSӪg`jn)m 御B2L.x!jJP! K/\ ʮRB[09Trӈu. uH$ DDQ+:ݘٻ 3/nލ%Sjm2!&D/[EHwW A-RR!PeuHim"t6lFgЫ-O.1?ƞksX~VtmZJR11Nu&<⽩,Tb,`w WPx-G5 `մ/5pbAtIVJ_]0/DiH=ô#*77-3 VuQ0.pݔ%yw hљW0),2$b6&I/@bj$I(fx' JnO"`<-/LѮ%^ȫͶn2wҗ2}}XսL'Q-,m/ꤋ4#0Q&00NKrsA,Aײ)aIEC(ERK{8Ȭ[y?iI5$%f{}u F 1~;v1l'@F 'IF'm!K7"&]w 15#4Vižn[v 8Ě)>C=LBo~/3% wF4֓ʿ8>bWX@bb@IzP9IvFfQL!2cEP(se4~5RhAŽ90_? cMEteVOaOr B]pȱؓ"Eyx: NJ)bl׋hYuTdԫw=آMgwVPOFΒ25-TD[Z2>]V,xӛIOƅ)Jͺ[)?cn28p#(mk+./phʮQ6?w7HIoSj)1<#-N9O1ͰސkIKr:(ŗ;rR&<93v@w(w:~:TFSޒ" ՊTdT9PIb3JzTQׄBP23ƵW*|@^)Qw?Iq =,<@ B8);50H-=T SA@@f5r[T%#c|Z&w(B)tDQ%vyC(,Ɵ|ʰi&<#u:3EHkzд)ndF>1V2kFGYL KMQlR&TB,igv8]C8Sf#ą4Q'?,= aV9WEXYrr*!cƯ~),=yџ]jlGeE̺5r_2Ԏ}d"a]0M9PZG17nE"Rr\YQ)!|5U(d=^ŗo8+2NU6jB[B5V.]ŲW/^䩬 ;Y"Vi$2ٲ_c(F^Egq{CP/ #K8Y+Q M1>ܞAߏ,gytޕn,zE$V.v.PyLapG9Tn:uiRZ! zI0?Џ1u#$6ɱGMhFdtd|~d\O9Ij**zD؍b)PBҽh-q ql%/{Gz*d7=QS]:RQbUMPᒯ$% du] XefQz$('ИZH#ARXDB ~`0.F|XXK)wFolzyhߚKz>.&n EjU,2' &iw[d[ V)*Qavl QDit[VIQhR@$)y~m|>?cJ+VH'6? 7 i.XH8Fި)dAYUBjE".4w-?l2Y.RjWD@Bج.߆s[H-gASF3Fj]آBP떬_>M%bt ?_rլ -h]r_ž[nȶQ+Gԭ_\Ê Z٦fet(|U('.g VFEN9}Ll4T&nto¨Ӓ X F "_fYzF~y& Gu]$O[v#].@$VA`ⱧTѰZ[2u+/mUC_ TnyѠ |l\ M"G[R$d|:ěFIire"ٵt,+ی1Z11udt*K2 sd; [)xW.z2jTh#DV\NO &e_vU2B^%0FH(/ԘI2>=L]dv UUpk"ijB$,O-0y<}~*T5LErE4B߳XXN:<9>Ed -V*uBLsN**JxRU辖,T( Gu @ůY{u|CJF(OLbnմiKhpFtx8#9FsFڋDTAn1veF^M ^kf.ĆݠVʓǰ3JaY@n&jLl:McӚ…vu?9w!/~#hM ڛ ̴nMA}m W,)(î.N y%$*={P9c DzH>Blu޾K78x->V,'JU \L]l>W*r-hXf~oI Z3f玱>vN3 uZTgg}Վ363:.g /-H+"PKۉSZ4Z_GlXMc7";ҿ (5fMUCOF6 CNft>$S1VaR&4) ٗay]%W A*|gX{Qc>iTX1F M`|![$P4ʊ$#,dɌ(?KTJR۸S%C7jHb浃j+N$,[.@˹_ ?.3ĵH"U$Z^ X02!Kc 8q.NMI6N&3n8exoWfPIJB<pREAdo$*m)e9D 5X[T$LΠ:]C$n#mC[P~Yt*d?\q^WXs!E-2#_mw8;2!vw:DUn$)GiGn3_o EZE3k-EHv.OûzE>"֛}l\/-nرQHԽab*#K׋eIƳd#G et\ ,:MێÜIC}m ٽO?eb%ːٰStB|Aznaz*FlQ/K uu*1wDvE֯SJTK;(4kƣ;v2P9`k{?~_[hʢ^9фǡ;m|]o9<#jz\wD,8V]]%K9er懇0n^FcI>`Ub+kօO1|NO]t+,Ȑl_ˮ6 ĒDbrz^pe7^[aþo確jN+xsNC߅wμ7|za2, omrbZ~,pN>;?Y,z[u◿jq 4aqڶNu6Zid@h!!F9#,#UrOa0=Då ,,,bE#ȮX3ªޏ=a< =&_~ ٵѽacj񫒆LsXuXB (wzEk_QIف*4'ѣSl{.,p۵2`jp^؇nZXPź^]wމ]aQ-oI5O3a] _wb ŭL]$"|sԩȬ= VсLIUbYY搮͢I$tf$2|r;~'GSXkᇦԭF4b4 xo[,04F~<}ۭR%myb׾\mlO.4}tE\7}M)tՉ13xF [-26t䢄&E"9;ٜrq e)K!:bwY }g;Jר)5D$!Kɤ9߫-K$$ hlDUFF J{s2R6rC&&0;@>]/Z3E,k;( 2^09'); this.iefix = $(this.update.id+'_iefix'); } if(this.iefix) setTimeout(this.fixIEOverlapping.bind(this), 50); }, fixIEOverlapping: function() { Position.clone(this.update, this.iefix, {setTop:(!this.update.style.height)}); this.iefix.style.zIndex = 1; this.update.style.zIndex = 2; Element.show(this.iefix); }, hide: function() { this.stopIndicator(); if(Element.getStyle(this.update, 'display')!='none') this.options.onHide(this.element, this.update); if(this.iefix) Element.hide(this.iefix); }, startIndicator: function() { if(this.options.indicator) Element.show(this.options.indicator); }, stopIndicator: function() { if(this.options.indicator) Element.hide(this.options.indicator); }, onKeyPress: function(event) { if(this.active) switch(event.keyCode) { case Event.KEY_TAB: case Event.KEY_RETURN: this.selectEntry(); Event.stop(event); case Event.KEY_ESC: this.hide(); this.active = false; Event.stop(event); return; case Event.KEY_LEFT: case Event.KEY_RIGHT: return; case Event.KEY_UP: this.markPrevious(); this.render(); Event.stop(event); return; case Event.KEY_DOWN: this.markNext(); this.render(); Event.stop(event); return; } else if(event.keyCode==Event.KEY_TAB || event.keyCode==Event.KEY_RETURN || (Prototype.Browser.WebKit > 0 && event.keyCode == 0)) return; this.changed = true; this.hasFocus = true; if(this.observer) clearTimeout(this.observer); this.observer = setTimeout(this.onObserverEvent.bind(this), this.options.frequency*1000); }, activate: function() { this.changed = false; this.hasFocus = true; this.getUpdatedChoices(); }, onHover: function(event) { var element = Event.findElement(event, 'LI'); if(this.index != element.autocompleteIndex) { this.index = element.autocompleteIndex; this.render(); } Event.stop(event); }, onClick: function(event) { var element = Event.findElement(event, 'LI'); this.index = element.autocompleteIndex; this.selectEntry(); this.hide(); }, onBlur: function(event) { // needed to make click events working setTimeout(this.hide.bind(this), 250); this.hasFocus = false; this.active = false; }, render: function() { if(this.entryCount > 0) { for (var i = 0; i < this.entryCount; i++) this.index==i ? Element.addClassName(this.getEntry(i),"selected") : Element.removeClassName(this.getEntry(i),"selected"); if(this.hasFocus) { this.show(); this.active = true; } } else { this.active = false; this.hide(); } }, markPrevious: function() { if(this.index > 0) this.index--; else this.index = this.entryCount-1; this.getEntry(this.index).scrollIntoView(true); }, markNext: function() { if(this.index < this.entryCount-1) this.index++; else this.index = 0; this.getEntry(this.index).scrollIntoView(false); }, getEntry: function(index) { return this.update.firstChild.childNodes[index]; }, getCurrentEntry: function() { return this.getEntry(this.index); }, selectEntry: function() { this.active = false; this.updateElement(this.getCurrentEntry()); }, updateElement: function(selectedElement) { if (this.options.updateElement) { this.options.updateElement(selectedElement); return; } var value = ''; if (this.options.select) { var nodes = $(selectedElement).select('.' + this.options.select) || []; if(nodes.length>0) value = Element.collectTextNodes(nodes[0], this.options.select); } else value = Element.collectTextNodesIgnoreClass(selectedElement, 'informal'); var bounds = this.getTokenBounds(); if (bounds[0] != -1) { var newValue = this.element.value.substr(0, bounds[0]); var whitespace = this.element.value.substr(bounds[0]).match(/^\s+/); if (whitespace) newValue += whitespace[0]; this.element.value = newValue + value + this.element.value.substr(bounds[1]); } else { this.element.value = value; } this.oldElementValue = this.element.value; this.element.focus(); if (this.options.afterUpdateElement) this.options.afterUpdateElement(this.element, selectedElement); }, updateChoices: function(choices) { if(!this.changed && this.hasFocus) { this.update.innerHTML = choices; Element.cleanWhitespace(this.update); Element.cleanWhitespace(this.update.down()); if(this.update.firstChild && this.update.down().childNodes) { this.entryCount = this.update.down().childNodes.length; for (var i = 0; i < this.entryCount; i++) { var entry = this.getEntry(i); entry.autocompleteIndex = i; this.addObservers(entry); } } else { this.entryCount = 0; } this.stopIndicator(); this.index = 0; if(this.entryCount==1 && this.options.autoSelect) { this.selectEntry(); this.hide(); } else { this.render(); } } }, addObservers: function(element) { Event.observe(element, "mouseover", this.onHover.bindAsEventListener(this)); Event.observe(element, "click", this.onClick.bindAsEventListener(this)); }, onObserverEvent: function() { this.changed = false; this.tokenBounds = null; if(this.getToken().length>=this.options.minChars) { this.getUpdatedChoices(); } else { this.active = false; this.hide(); } this.oldElementValue = this.element.value; }, getToken: function() { var bounds = this.getTokenBounds(); return this.element.value.substring(bounds[0], bounds[1]).strip(); }, getTokenBounds: function() { if (null != this.tokenBounds) return this.tokenBounds; var value = this.element.value; if (value.strip().empty()) return [-1, 0]; var diff = arguments.callee.getFirstDifferencePos(value, this.oldElementValue); var offset = (diff == this.oldElementValue.length ? 1 : 0); var prevTokenPos = -1, nextTokenPos = value.length; var tp; for (var index = 0, l = this.options.tokens.length; index < l; ++index) { tp = value.lastIndexOf(this.options.tokens[index], diff + offset - 1); if (tp > prevTokenPos) prevTokenPos = tp; tp = value.indexOf(this.options.tokens[index], diff + offset); if (-1 != tp && tp < nextTokenPos) nextTokenPos = tp; } return (this.tokenBounds = [prevTokenPos + 1, nextTokenPos]); } }); Autocompleter.Base.prototype.getTokenBounds.getFirstDifferencePos = function(newS, oldS) { var boundary = Math.min(newS.length, oldS.length); for (var index = 0; index < boundary; ++index) if (newS[index] != oldS[index]) return index; return boundary; }; Ajax.Autocompleter = Class.create(Autocompleter.Base, { initialize: function(element, update, url, options) { this.baseInitialize(element, update, options); this.options.asynchronous = true; this.options.onComplete = this.onComplete.bind(this); this.options.defaultParams = this.options.parameters || null; this.url = url; }, getUpdatedChoices: function() { this.startIndicator(); var entry = encodeURIComponent(this.options.paramName) + '=' + encodeURIComponent(this.getToken()); this.options.parameters = this.options.callback ? this.options.callback(this.element, entry) : entry; if(this.options.defaultParams) this.options.parameters += '&' + this.options.defaultParams; new Ajax.Request(this.url, this.options); }, onComplete: function(request) { this.updateChoices(request.responseText); } }); // The local array autocompleter. Used when you'd prefer to // inject an array of autocompletion options into the page, rather // than sending out Ajax queries, which can be quite slow sometimes. // // The constructor takes four parameters. The first two are, as usual, // the id of the monitored textbox, and id of the autocompletion menu. // The third is the array you want to autocomplete from, and the fourth // is the options block. // // Extra local autocompletion options: // - choices - How many autocompletion choices to offer // // - partialSearch - If false, the autocompleter will match entered // text only at the beginning of strings in the // autocomplete array. Defaults to true, which will // match text at the beginning of any *word* in the // strings in the autocomplete array. If you want to // search anywhere in the string, additionally set // the option fullSearch to true (default: off). // // - fullSsearch - Search anywhere in autocomplete array strings. // // - partialChars - How many characters to enter before triggering // a partial match (unlike minChars, which defines // how many characters are required to do any match // at all). Defaults to 2. // // - ignoreCase - Whether to ignore case when autocompleting. // Defaults to true. // // It's possible to pass in a custom function as the 'selector' // option, if you prefer to write your own autocompletion logic. // In that case, the other options above will not apply unless // you support them. Autocompleter.Local = Class.create(Autocompleter.Base, { initialize: function(element, update, array, options) { this.baseInitialize(element, update, options); this.options.array = array; }, getUpdatedChoices: function() { this.updateChoices(this.options.selector(this)); }, setOptions: function(options) { this.options = Object.extend({ choices: 10, partialSearch: true, partialChars: 2, ignoreCase: true, fullSearch: false, selector: function(instance) { var ret = []; // Beginning matches var partial = []; // Inside matches var entry = instance.getToken(); var count = 0; for (var i = 0; i < instance.options.array.length && ret.length < instance.options.choices ; i++) { var elem = instance.options.array[i]; var foundPos = instance.options.ignoreCase ? elem.toLowerCase().indexOf(entry.toLowerCase()) : elem.indexOf(entry); while (foundPos != -1) { if (foundPos == 0 && elem.length != entry.length) { ret.push("
  • " + elem.substr(0, entry.length) + "" + elem.substr(entry.length) + "
  • "); break; } else if (entry.length >= instance.options.partialChars && instance.options.partialSearch && foundPos != -1) { if (instance.options.fullSearch || /\s/.test(elem.substr(foundPos-1,1))) { partial.push("
  • " + elem.substr(0, foundPos) + "" + elem.substr(foundPos, entry.length) + "" + elem.substr( foundPos + entry.length) + "
  • "); break; } } foundPos = instance.options.ignoreCase ? elem.toLowerCase().indexOf(entry.toLowerCase(), foundPos + 1) : elem.indexOf(entry, foundPos + 1); } } if (partial.length) ret = ret.concat(partial.slice(0, instance.options.choices - ret.length)); return "
      " + ret.join('') + "
    "; } }, options || { }); } }); // AJAX in-place editor and collection editor // Full rewrite by Christophe Porteneuve (April 2007). // Use this if you notice weird scrolling problems on some browsers, // the DOM might be a bit confused when this gets called so do this // waits 1 ms (with setTimeout) until it does the activation Field.scrollFreeActivate = function(field) { setTimeout(function() { Field.activate(field); }, 1); }; Ajax.InPlaceEditor = Class.create({ initialize: function(element, url, options) { this.url = url; this.element = element = $(element); this.prepareOptions(); this._controls = { }; arguments.callee.dealWithDeprecatedOptions(options); // DEPRECATION LAYER!!! Object.extend(this.options, options || { }); if (!this.options.formId && this.element.id) { this.options.formId = this.element.id + '-inplaceeditor'; if ($(this.options.formId)) this.options.formId = ''; } if (this.options.externalControl) this.options.externalControl = $(this.options.externalControl); if (!this.options.externalControl) this.options.externalControlOnly = false; this._originalBackground = this.element.getStyle('background-color') || 'transparent'; this.element.title = this.options.clickToEditText; this._boundCancelHandler = this.handleFormCancellation.bind(this); this._boundComplete = (this.options.onComplete || Prototype.emptyFunction).bind(this); this._boundFailureHandler = this.handleAJAXFailure.bind(this); this._boundSubmitHandler = this.handleFormSubmission.bind(this); this._boundWrapperHandler = this.wrapUp.bind(this); this.registerListeners(); }, checkForEscapeOrReturn: function(e) { if (!this._editing || e.ctrlKey || e.altKey || e.shiftKey) return; if (Event.KEY_ESC == e.keyCode) this.handleFormCancellation(e); else if (Event.KEY_RETURN == e.keyCode) this.handleFormSubmission(e); }, createControl: function(mode, handler, extraClasses) { var control = this.options[mode + 'Control']; var text = this.options[mode + 'Text']; if ('button' == control) { var btn = document.createElement('input'); btn.type = 'submit'; btn.value = text; btn.className = 'editor_' + mode + '_button'; if ('cancel' == mode) btn.onclick = this._boundCancelHandler; this._form.appendChild(btn); this._controls[mode] = btn; } else if ('link' == control) { var link = document.createElement('a'); link.href = '#'; link.appendChild(document.createTextNode(text)); link.onclick = 'cancel' == mode ? this._boundCancelHandler : this._boundSubmitHandler; link.className = 'editor_' + mode + '_link'; if (extraClasses) link.className += ' ' + extraClasses; this._form.appendChild(link); this._controls[mode] = link; } }, createEditField: function() { var text = (this.options.loadTextURL ? this.options.loadingText : this.getText()); var fld; if (1 >= this.options.rows && !/\r|\n/.test(this.getText())) { fld = document.createElement('input'); fld.type = 'text'; var size = this.options.size || this.options.cols || 0; if (0 < size) fld.size = size; } else { fld = document.createElement('textarea'); fld.rows = (1 >= this.options.rows ? this.options.autoRows : this.options.rows); fld.cols = this.options.cols || 40; } fld.name = this.options.paramName; fld.value = text; // No HTML breaks conversion anymore fld.className = 'editor_field'; if (this.options.submitOnBlur) fld.onblur = this._boundSubmitHandler; this._controls.editor = fld; if (this.options.loadTextURL) this.loadExternalText(); this._form.appendChild(this._controls.editor); }, createForm: function() { var ipe = this; function addText(mode, condition) { var text = ipe.options['text' + mode + 'Controls']; if (!text || condition === false) return; ipe._form.appendChild(document.createTextNode(text)); }; this._form = $(document.createElement('form')); this._form.id = this.options.formId; this._form.addClassName(this.options.formClassName); this._form.onsubmit = this._boundSubmitHandler; this.createEditField(); if ('textarea' == this._controls.editor.tagName.toLowerCase()) this._form.appendChild(document.createElement('br')); if (this.options.onFormCustomization) this.options.onFormCustomization(this, this._form); addText('Before', this.options.okControl || this.options.cancelControl); this.createControl('ok', this._boundSubmitHandler); addText('Between', this.options.okControl && this.options.cancelControl); this.createControl('cancel', this._boundCancelHandler, 'editor_cancel'); addText('After', this.options.okControl || this.options.cancelControl); }, destroy: function() { if (this._oldInnerHTML) this.element.innerHTML = this._oldInnerHTML; this.leaveEditMode(); this.unregisterListeners(); }, enterEditMode: function(e) { if (this._saving || this._editing) return; this._editing = true; this.triggerCallback('onEnterEditMode'); if (this.options.externalControl) this.options.externalControl.hide(); this.element.hide(); this.createForm(); this.element.parentNode.insertBefore(this._form, this.element); if (!this.options.loadTextURL) this.postProcessEditField(); if (e) Event.stop(e); }, enterHover: function(e) { if (this.options.hoverClassName) this.element.addClassName(this.options.hoverClassName); if (this._saving) return; this.triggerCallback('onEnterHover'); }, getText: function() { return this.element.innerHTML.unescapeHTML(); }, handleAJAXFailure: function(transport) { this.triggerCallback('onFailure', transport); if (this._oldInnerHTML) { this.element.innerHTML = this._oldInnerHTML; this._oldInnerHTML = null; } }, handleFormCancellation: function(e) { this.wrapUp(); if (e) Event.stop(e); }, handleFormSubmission: function(e) { var form = this._form; var value = $F(this._controls.editor); this.prepareSubmission(); var params = this.options.callback(form, value) || ''; if (Object.isString(params)) params = params.toQueryParams(); params.editorId = this.element.id; if (this.options.htmlResponse) { var options = Object.extend({ evalScripts: true }, this.options.ajaxOptions); Object.extend(options, { parameters: params, onComplete: this._boundWrapperHandler, onFailure: this._boundFailureHandler }); new Ajax.Updater({ success: this.element }, this.url, options); } else { var options = Object.extend({ method: 'get' }, this.options.ajaxOptions); Object.extend(options, { parameters: params, onComplete: this._boundWrapperHandler, onFailure: this._boundFailureHandler }); new Ajax.Request(this.url, options); } if (e) Event.stop(e); }, leaveEditMode: function() { this.element.removeClassName(this.options.savingClassName); this.removeForm(); this.leaveHover(); this.element.style.backgroundColor = this._originalBackground; this.element.show(); if (this.options.externalControl) this.options.externalControl.show(); this._saving = false; this._editing = false; this._oldInnerHTML = null; this.triggerCallback('onLeaveEditMode'); }, leaveHover: function(e) { if (this.options.hoverClassName) this.element.removeClassName(this.options.hoverClassName); if (this._saving) return; this.triggerCallback('onLeaveHover'); }, loadExternalText: function() { this._form.addClassName(this.options.loadingClassName); this._controls.editor.disabled = true; var options = Object.extend({ method: 'get' }, this.options.ajaxOptions); Object.extend(options, { parameters: 'editorId=' + encodeURIComponent(this.element.id), onComplete: Prototype.emptyFunction, onSuccess: function(transport) { this._form.removeClassName(this.options.loadingClassName); var text = transport.responseText; if (this.options.stripLoadedTextTags) text = text.stripTags(); this._controls.editor.value = text; this._controls.editor.disabled = false; this.postProcessEditField(); }.bind(this), onFailure: this._boundFailureHandler }); new Ajax.Request(this.options.loadTextURL, options); }, postProcessEditField: function() { var fpc = this.options.fieldPostCreation; if (fpc) $(this._controls.editor)['focus' == fpc ? 'focus' : 'activate'](); }, prepareOptions: function() { this.options = Object.clone(Ajax.InPlaceEditor.DefaultOptions); Object.extend(this.options, Ajax.InPlaceEditor.DefaultCallbacks); [this._extraDefaultOptions].flatten().compact().each(function(defs) { Object.extend(this.options, defs); }.bind(this)); }, prepareSubmission: function() { this._saving = true; this.removeForm(); this.leaveHover(); this.showSaving(); }, registerListeners: function() { this._listeners = { }; var listener; $H(Ajax.InPlaceEditor.Listeners).each(function(pair) { listener = this[pair.value].bind(this); this._listeners[pair.key] = listener; if (!this.options.externalControlOnly) this.element.observe(pair.key, listener); if (this.options.externalControl) this.options.externalControl.observe(pair.key, listener); }.bind(this)); }, removeForm: function() { if (!this._form) return; this._form.remove(); this._form = null; this._controls = { }; }, showSaving: function() { this._oldInnerHTML = this.element.innerHTML; this.element.innerHTML = this.options.savingText; this.element.addClassName(this.options.savingClassName); this.element.style.backgroundColor = this._originalBackground; this.element.show(); }, triggerCallback: function(cbName, arg) { if ('function' == typeof this.options[cbName]) { this.options[cbName](this, arg); } }, unregisterListeners: function() { $H(this._listeners).each(function(pair) { if (!this.options.externalControlOnly) this.element.stopObserving(pair.key, pair.value); if (this.options.externalControl) this.options.externalControl.stopObserving(pair.key, pair.value); }.bind(this)); }, wrapUp: function(transport) { this.leaveEditMode(); // Can't use triggerCallback due to backward compatibility: requires // binding + direct element this._boundComplete(transport, this.element); } }); Object.extend(Ajax.InPlaceEditor.prototype, { dispose: Ajax.InPlaceEditor.prototype.destroy }); Ajax.InPlaceCollectionEditor = Class.create(Ajax.InPlaceEditor, { initialize: function($super, element, url, options) { this._extraDefaultOptions = Ajax.InPlaceCollectionEditor.DefaultOptions; $super(element, url, options); }, createEditField: function() { var list = document.createElement('select'); list.name = this.options.paramName; list.size = 1; this._controls.editor = list; this._collection = this.options.collection || []; if (this.options.loadCollectionURL) this.loadCollection(); else this.checkForExternalText(); this._form.appendChild(this._controls.editor); }, loadCollection: function() { this._form.addClassName(this.options.loadingClassName); this.showLoadingText(this.options.loadingCollectionText); var options = Object.extend({ method: 'get' }, this.options.ajaxOptions); Object.extend(options, { parameters: 'editorId=' + encodeURIComponent(this.element.id), onComplete: Prototype.emptyFunction, onSuccess: function(transport) { var js = transport.responseText.strip(); if (!/^\[.*\]$/.test(js)) // TODO: improve sanity check throw('Server returned an invalid collection representation.'); this._collection = eval(js); this.checkForExternalText(); }.bind(this), onFailure: this.onFailure }); new Ajax.Request(this.options.loadCollectionURL, options); }, showLoadingText: function(text) { this._controls.editor.disabled = true; var tempOption = this._controls.editor.firstChild; if (!tempOption) { tempOption = document.createElement('option'); tempOption.value = ''; this._controls.editor.appendChild(tempOption); tempOption.selected = true; } tempOption.update((text || '').stripScripts().stripTags()); }, checkForExternalText: function() { this._text = this.getText(); if (this.options.loadTextURL) this.loadExternalText(); else this.buildOptionList(); }, loadExternalText: function() { this.showLoadingText(this.options.loadingText); var options = Object.extend({ method: 'get' }, this.options.ajaxOptions); Object.extend(options, { parameters: 'editorId=' + encodeURIComponent(this.element.id), onComplete: Prototype.emptyFunction, onSuccess: function(transport) { this._text = transport.responseText.strip(); this.buildOptionList(); }.bind(this), onFailure: this.onFailure }); new Ajax.Request(this.options.loadTextURL, options); }, buildOptionList: function() { this._form.removeClassName(this.options.loadingClassName); this._collection = this._collection.map(function(entry) { return 2 === entry.length ? entry : [entry, entry].flatten(); }); var marker = ('value' in this.options) ? this.options.value : this._text; var textFound = this._collection.any(function(entry) { return entry[0] == marker; }.bind(this)); this._controls.editor.update(''); var option; this._collection.each(function(entry, index) { option = document.createElement('option'); option.value = entry[0]; option.selected = textFound ? entry[0] == marker : 0 == index; option.appendChild(document.createTextNode(entry[1])); this._controls.editor.appendChild(option); }.bind(this)); this._controls.editor.disabled = false; Field.scrollFreeActivate(this._controls.editor); } }); //**** DEPRECATION LAYER FOR InPlace[Collection]Editor! **** //**** This only exists for a while, in order to let **** //**** users adapt to the new API. Read up on the new **** //**** API and convert your code to it ASAP! **** Ajax.InPlaceEditor.prototype.initialize.dealWithDeprecatedOptions = function(options) { if (!options) return; function fallback(name, expr) { if (name in options || expr === undefined) return; options[name] = expr; }; fallback('cancelControl', (options.cancelLink ? 'link' : (options.cancelButton ? 'button' : options.cancelLink == options.cancelButton == false ? false : undefined))); fallback('okControl', (options.okLink ? 'link' : (options.okButton ? 'button' : options.okLink == options.okButton == false ? false : undefined))); fallback('highlightColor', options.highlightcolor); fallback('highlightEndColor', options.highlightendcolor); }; Object.extend(Ajax.InPlaceEditor, { DefaultOptions: { ajaxOptions: { }, autoRows: 3, // Use when multi-line w/ rows == 1 cancelControl: 'link', // 'link'|'button'|false cancelText: 'cancel', clickToEditText: 'Click to edit', externalControl: null, // id|elt externalControlOnly: false, fieldPostCreation: 'activate', // 'activate'|'focus'|false formClassName: 'inplaceeditor-form', formId: null, // id|elt highlightColor: '#ffff99', highlightEndColor: '#ffffff', hoverClassName: '', htmlResponse: true, loadingClassName: 'inplaceeditor-loading', loadingText: 'Loading...', okControl: 'button', // 'link'|'button'|false okText: 'ok', paramName: 'value', rows: 1, // If 1 and multi-line, uses autoRows savingClassName: 'inplaceeditor-saving', savingText: 'Saving...', size: 0, stripLoadedTextTags: false, submitOnBlur: false, textAfterControls: '', textBeforeControls: '', textBetweenControls: '' }, DefaultCallbacks: { callback: function(form) { return Form.serialize(form); }, onComplete: function(transport, element) { // For backward compatibility, this one is bound to the IPE, and passes // the element directly. It was too often customized, so we don't break it. new Effect.Highlight(element, { startcolor: this.options.highlightColor, keepBackgroundImage: true }); }, onEnterEditMode: null, onEnterHover: function(ipe) { ipe.element.style.backgroundColor = ipe.options.highlightColor; if (ipe._effect) ipe._effect.cancel(); }, onFailure: function(transport, ipe) { alert('Error communication with the server: ' + transport.responseText.stripTags()); }, onFormCustomization: null, // Takes the IPE and its generated form, after editor, before controls. onLeaveEditMode: null, onLeaveHover: function(ipe) { ipe._effect = new Effect.Highlight(ipe.element, { startcolor: ipe.options.highlightColor, endcolor: ipe.options.highlightEndColor, restorecolor: ipe._originalBackground, keepBackgroundImage: true }); } }, Listeners: { click: 'enterEditMode', keydown: 'checkForEscapeOrReturn', mouseover: 'enterHover', mouseout: 'leaveHover' } }); Ajax.InPlaceCollectionEditor.DefaultOptions = { loadingCollectionText: 'Loading options...' }; // Delayed observer, like Form.Element.Observer, // but waits for delay after last key input // Ideal for live-search fields Form.Element.DelayedObserver = Class.create({ initialize: function(element, delay, callback) { this.delay = delay || 0.5; this.element = $(element); this.callback = callback; this.timer = null; this.lastValue = $F(this.element); Event.observe(this.element,'keyup',this.delayedListener.bindAsEventListener(this)); }, delayedListener: function(event) { if(this.lastValue == $F(this.element)) return; if(this.timer) clearTimeout(this.timer); this.timer = setTimeout(this.onTimerEvent.bind(this), this.delay * 1000); this.lastValue = $F(this.element); }, onTimerEvent: function() { this.timer = null; this.callback(this.element, $F(this.element)); } });././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/public/javascripts/prototype.js./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/public/javascripts/pro0000644000000000000000000047506112674201751030375 0ustar /* Prototype JavaScript framework, version 1.7_rc2 * (c) 2005-2010 Sam Stephenson * * Prototype is freely distributable under the terms of an MIT-style license. * For details, see the Prototype web site: http://www.prototypejs.org/ * *--------------------------------------------------------------------------*/ var Prototype = { Version: '1.7_rc2', Browser: (function(){ var ua = navigator.userAgent; var isOpera = Object.prototype.toString.call(window.opera) == '[object Opera]'; return { IE: !!window.attachEvent && !isOpera, Opera: isOpera, WebKit: ua.indexOf('AppleWebKit/') > -1, Gecko: ua.indexOf('Gecko') > -1 && ua.indexOf('KHTML') === -1, MobileSafari: /Apple.*Mobile/.test(ua) } })(), BrowserFeatures: { XPath: !!document.evaluate, SelectorsAPI: !!document.querySelector, ElementExtensions: (function() { var constructor = window.Element || window.HTMLElement; return !!(constructor && constructor.prototype); })(), SpecificElementExtensions: (function() { if (typeof window.HTMLDivElement !== 'undefined') return true; var div = document.createElement('div'), form = document.createElement('form'), isSupported = false; if (div['__proto__'] && (div['__proto__'] !== form['__proto__'])) { isSupported = true; } div = form = null; return isSupported; })() }, ScriptFragment: ']*>([\\S\\s]*?)<\/script>', JSONFilter: /^\/\*-secure-([\s\S]*)\*\/\s*$/, emptyFunction: function() { }, K: function(x) { return x } }; if (Prototype.Browser.MobileSafari) Prototype.BrowserFeatures.SpecificElementExtensions = false; var Abstract = { }; var Try = { these: function() { var returnValue; for (var i = 0, length = arguments.length; i < length; i++) { var lambda = arguments[i]; try { returnValue = lambda(); break; } catch (e) { } } return returnValue; } }; /* Based on Alex Arnell's inheritance implementation. */ var Class = (function() { var IS_DONTENUM_BUGGY = (function(){ for (var p in { toString: 1 }) { if (p === 'toString') return false; } return true; })(); function subclass() {}; function create() { var parent = null, properties = $A(arguments); if (Object.isFunction(properties[0])) parent = properties.shift(); function klass() { this.initialize.apply(this, arguments); } Object.extend(klass, Class.Methods); klass.superclass = parent; klass.subclasses = []; if (parent) { subclass.prototype = parent.prototype; klass.prototype = new subclass; parent.subclasses.push(klass); } for (var i = 0, length = properties.length; i < length; i++) klass.addMethods(properties[i]); if (!klass.prototype.initialize) klass.prototype.initialize = Prototype.emptyFunction; klass.prototype.constructor = klass; return klass; } function addMethods(source) { var ancestor = this.superclass && this.superclass.prototype, properties = Object.keys(source); if (IS_DONTENUM_BUGGY) { if (source.toString != Object.prototype.toString) properties.push("toString"); if (source.valueOf != Object.prototype.valueOf) properties.push("valueOf"); } for (var i = 0, length = properties.length; i < length; i++) { var property = properties[i], value = source[property]; if (ancestor && Object.isFunction(value) && value.argumentNames()[0] == "$super") { var method = value; value = (function(m) { return function() { return ancestor[m].apply(this, arguments); }; })(property).wrap(method); value.valueOf = method.valueOf.bind(method); value.toString = method.toString.bind(method); } this.prototype[property] = value; } return this; } return { create: create, Methods: { addMethods: addMethods } }; })(); (function() { var _toString = Object.prototype.toString, NULL_TYPE = 'Null', UNDEFINED_TYPE = 'Undefined', BOOLEAN_TYPE = 'Boolean', NUMBER_TYPE = 'Number', STRING_TYPE = 'String', OBJECT_TYPE = 'Object', BOOLEAN_CLASS = '[object Boolean]', NUMBER_CLASS = '[object Number]', STRING_CLASS = '[object String]', ARRAY_CLASS = '[object Array]', NATIVE_JSON_STRINGIFY_SUPPORT = window.JSON && typeof JSON.stringify === 'function' && JSON.stringify(0) === '0' && typeof JSON.stringify(Prototype.K) === 'undefined'; function Type(o) { switch(o) { case null: return NULL_TYPE; case (void 0): return UNDEFINED_TYPE; } var type = typeof o; switch(type) { case 'boolean': return BOOLEAN_TYPE; case 'number': return NUMBER_TYPE; case 'string': return STRING_TYPE; } return OBJECT_TYPE; } function extend(destination, source) { for (var property in source) destination[property] = source[property]; return destination; } function inspect(object) { try { if (isUndefined(object)) return 'undefined'; if (object === null) return 'null'; return object.inspect ? object.inspect() : String(object); } catch (e) { if (e instanceof RangeError) return '...'; throw e; } } function toJSON(value) { return Str('', { '': value }, []); } function Str(key, holder, stack) { var value = holder[key], type = typeof value; if (Type(value) === OBJECT_TYPE && typeof value.toJSON === 'function') { value = value.toJSON(key); } var _class = _toString.call(value); switch (_class) { case NUMBER_CLASS: case BOOLEAN_CLASS: case STRING_CLASS: value = value.valueOf(); } switch (value) { case null: return 'null'; case true: return 'true'; case false: return 'false'; } type = typeof value; switch (type) { case 'string': return value.inspect(true); case 'number': return isFinite(value) ? String(value) : 'null'; case 'object': for (var i = 0, length = stack.length; i < length; i++) { if (stack[i] === value) { throw new TypeError(); } } stack.push(value); var partial = []; if (_class === ARRAY_CLASS) { for (var i = 0, length = value.length; i < length; i++) { var str = Str(i, value, stack); partial.push(typeof str === 'undefined' ? 'null' : str); } partial = '[' + partial.join(',') + ']'; } else { var keys = Object.keys(value); for (var i = 0, length = keys.length; i < length; i++) { var key = keys[i], str = Str(key, value, stack); if (typeof str !== "undefined") { partial.push(key.inspect(true)+ ':' + str); } } partial = '{' + partial.join(',') + '}'; } stack.pop(); return partial; } } function stringify(object) { return JSON.stringify(object); } function toQueryString(object) { return $H(object).toQueryString(); } function toHTML(object) { return object && object.toHTML ? object.toHTML() : String.interpret(object); } function keys(object) { if (Type(object) !== OBJECT_TYPE) { throw new TypeError(); } var results = []; for (var property in object) { if (object.hasOwnProperty(property)) { results.push(property); } } return results; } function values(object) { var results = []; for (var property in object) results.push(object[property]); return results; } function clone(object) { return extend({ }, object); } function isElement(object) { return !!(object && object.nodeType == 1); } function isArray(object) { return _toString.call(object) === ARRAY_CLASS; } var hasNativeIsArray = (typeof Array.isArray == 'function') && Array.isArray([]) && !Array.isArray({}); if (hasNativeIsArray) { isArray = Array.isArray; } function isHash(object) { return object instanceof Hash; } function isFunction(object) { return typeof object === "function"; } function isString(object) { return _toString.call(object) === STRING_CLASS; } function isNumber(object) { return _toString.call(object) === NUMBER_CLASS; } function isUndefined(object) { return typeof object === "undefined"; } extend(Object, { extend: extend, inspect: inspect, toJSON: NATIVE_JSON_STRINGIFY_SUPPORT ? stringify : toJSON, toQueryString: toQueryString, toHTML: toHTML, keys: Object.keys || keys, values: values, clone: clone, isElement: isElement, isArray: isArray, isHash: isHash, isFunction: isFunction, isString: isString, isNumber: isNumber, isUndefined: isUndefined }); })(); Object.extend(Function.prototype, (function() { var slice = Array.prototype.slice; function update(array, args) { var arrayLength = array.length, length = args.length; while (length--) array[arrayLength + length] = args[length]; return array; } function merge(array, args) { array = slice.call(array, 0); return update(array, args); } function argumentNames() { var names = this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1] .replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\//g, '') .replace(/\s+/g, '').split(','); return names.length == 1 && !names[0] ? [] : names; } function bind(context) { if (arguments.length < 2 && Object.isUndefined(arguments[0])) return this; var __method = this, args = slice.call(arguments, 1); return function() { var a = merge(args, arguments); return __method.apply(context, a); } } function bindAsEventListener(context) { var __method = this, args = slice.call(arguments, 1); return function(event) { var a = update([event || window.event], args); return __method.apply(context, a); } } function curry() { if (!arguments.length) return this; var __method = this, args = slice.call(arguments, 0); return function() { var a = merge(args, arguments); return __method.apply(this, a); } } function delay(timeout) { var __method = this, args = slice.call(arguments, 1); timeout = timeout * 1000; return window.setTimeout(function() { return __method.apply(__method, args); }, timeout); } function defer() { var args = update([0.01], arguments); return this.delay.apply(this, args); } function wrap(wrapper) { var __method = this; return function() { var a = update([__method.bind(this)], arguments); return wrapper.apply(this, a); } } function methodize() { if (this._methodized) return this._methodized; var __method = this; return this._methodized = function() { var a = update([this], arguments); return __method.apply(null, a); }; } return { argumentNames: argumentNames, bind: bind, bindAsEventListener: bindAsEventListener, curry: curry, delay: delay, defer: defer, wrap: wrap, methodize: methodize } })()); (function(proto) { function toISOString() { return this.getUTCFullYear() + '-' + (this.getUTCMonth() + 1).toPaddedString(2) + '-' + this.getUTCDate().toPaddedString(2) + 'T' + this.getUTCHours().toPaddedString(2) + ':' + this.getUTCMinutes().toPaddedString(2) + ':' + this.getUTCSeconds().toPaddedString(2) + 'Z'; } function toJSON() { return this.toISOString(); } if (!proto.toISOString) proto.toISOString = toISOString; if (!proto.toJSON) proto.toJSON = toJSON; })(Date.prototype); RegExp.prototype.match = RegExp.prototype.test; RegExp.escape = function(str) { return String(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1'); }; var PeriodicalExecuter = Class.create({ initialize: function(callback, frequency) { this.callback = callback; this.frequency = frequency; this.currentlyExecuting = false; this.registerCallback(); }, registerCallback: function() { this.timer = setInterval(this.onTimerEvent.bind(this), this.frequency * 1000); }, execute: function() { this.callback(this); }, stop: function() { if (!this.timer) return; clearInterval(this.timer); this.timer = null; }, onTimerEvent: function() { if (!this.currentlyExecuting) { try { this.currentlyExecuting = true; this.execute(); this.currentlyExecuting = false; } catch(e) { this.currentlyExecuting = false; throw e; } } } }); Object.extend(String, { interpret: function(value) { return value == null ? '' : String(value); }, specialChar: { '\b': '\\b', '\t': '\\t', '\n': '\\n', '\f': '\\f', '\r': '\\r', '\\': '\\\\' } }); Object.extend(String.prototype, (function() { var NATIVE_JSON_PARSE_SUPPORT = window.JSON && typeof JSON.parse === 'function' && JSON.parse('{"test": true}').test; function prepareReplacement(replacement) { if (Object.isFunction(replacement)) return replacement; var template = new Template(replacement); return function(match) { return template.evaluate(match) }; } function gsub(pattern, replacement) { var result = '', source = this, match; replacement = prepareReplacement(replacement); if (Object.isString(pattern)) pattern = RegExp.escape(pattern); if (!(pattern.length || pattern.source)) { replacement = replacement(''); return replacement + source.split('').join(replacement) + replacement; } while (source.length > 0) { if (match = source.match(pattern)) { result += source.slice(0, match.index); result += String.interpret(replacement(match)); source = source.slice(match.index + match[0].length); } else { result += source, source = ''; } } return result; } function sub(pattern, replacement, count) { replacement = prepareReplacement(replacement); count = Object.isUndefined(count) ? 1 : count; return this.gsub(pattern, function(match) { if (--count < 0) return match[0]; return replacement(match); }); } function scan(pattern, iterator) { this.gsub(pattern, iterator); return String(this); } function truncate(length, truncation) { length = length || 30; truncation = Object.isUndefined(truncation) ? '...' : truncation; return this.length > length ? this.slice(0, length - truncation.length) + truncation : String(this); } function strip() { return this.replace(/^\s+/, '').replace(/\s+$/, ''); } function stripTags() { return this.replace(/<\w+(\s+("[^"]*"|'[^']*'|[^>])+)?>|<\/\w+>/gi, ''); } function stripScripts() { return this.replace(new RegExp(Prototype.ScriptFragment, 'img'), ''); } function extractScripts() { var matchAll = new RegExp(Prototype.ScriptFragment, 'img'), matchOne = new RegExp(Prototype.ScriptFragment, 'im'); return (this.match(matchAll) || []).map(function(scriptTag) { return (scriptTag.match(matchOne) || ['', ''])[1]; }); } function evalScripts() { return this.extractScripts().map(function(script) { return eval(script) }); } function escapeHTML() { return this.replace(/&/g,'&').replace(//g,'>'); } function unescapeHTML() { return this.stripTags().replace(/</g,'<').replace(/>/g,'>').replace(/&/g,'&'); } function toQueryParams(separator) { var match = this.strip().match(/([^?#]*)(#.*)?$/); if (!match) return { }; return match[1].split(separator || '&').inject({ }, function(hash, pair) { if ((pair = pair.split('='))[0]) { var key = decodeURIComponent(pair.shift()), value = pair.length > 1 ? pair.join('=') : pair[0]; if (value != undefined) value = decodeURIComponent(value); if (key in hash) { if (!Object.isArray(hash[key])) hash[key] = [hash[key]]; hash[key].push(value); } else hash[key] = value; } return hash; }); } function toArray() { return this.split(''); } function succ() { return this.slice(0, this.length - 1) + String.fromCharCode(this.charCodeAt(this.length - 1) + 1); } function times(count) { return count < 1 ? '' : new Array(count + 1).join(this); } function camelize() { return this.replace(/-+(.)?/g, function(match, chr) { return chr ? chr.toUpperCase() : ''; }); } function capitalize() { return this.charAt(0).toUpperCase() + this.substring(1).toLowerCase(); } function underscore() { return this.replace(/::/g, '/') .replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2') .replace(/([a-z\d])([A-Z])/g, '$1_$2') .replace(/-/g, '_') .toLowerCase(); } function dasherize() { return this.replace(/_/g, '-'); } function inspect(useDoubleQuotes) { var escapedString = this.replace(/[\x00-\x1f\\]/g, function(character) { if (character in String.specialChar) { return String.specialChar[character]; } return '\\u00' + character.charCodeAt().toPaddedString(2, 16); }); if (useDoubleQuotes) return '"' + escapedString.replace(/"/g, '\\"') + '"'; return "'" + escapedString.replace(/'/g, '\\\'') + "'"; } function unfilterJSON(filter) { return this.replace(filter || Prototype.JSONFilter, '$1'); } function isJSON() { var str = this; if (str.blank()) return false; str = str.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@'); str = str.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']'); str = str.replace(/(?:^|:|,)(?:\s*\[)+/g, ''); return (/^[\],:{}\s]*$/).test(str); } function evalJSON(sanitize) { var json = this.unfilterJSON(), cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g; if (cx.test(json)) { json = json.replace(cx, function (a) { return '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); }); } try { if (!sanitize || json.isJSON()) return eval('(' + json + ')'); } catch (e) { } throw new SyntaxError('Badly formed JSON string: ' + this.inspect()); } function parseJSON() { var json = this.unfilterJSON(); return JSON.parse(json); } function include(pattern) { return this.indexOf(pattern) > -1; } function startsWith(pattern) { return this.lastIndexOf(pattern, 0) === 0; } function endsWith(pattern) { var d = this.length - pattern.length; return d >= 0 && this.indexOf(pattern, d) === d; } function empty() { return this == ''; } function blank() { return /^\s*$/.test(this); } function interpolate(object, pattern) { return new Template(this, pattern).evaluate(object); } return { gsub: gsub, sub: sub, scan: scan, truncate: truncate, strip: String.prototype.trim || strip, stripTags: stripTags, stripScripts: stripScripts, extractScripts: extractScripts, evalScripts: evalScripts, escapeHTML: escapeHTML, unescapeHTML: unescapeHTML, toQueryParams: toQueryParams, parseQuery: toQueryParams, toArray: toArray, succ: succ, times: times, camelize: camelize, capitalize: capitalize, underscore: underscore, dasherize: dasherize, inspect: inspect, unfilterJSON: unfilterJSON, isJSON: isJSON, evalJSON: NATIVE_JSON_PARSE_SUPPORT ? parseJSON : evalJSON, include: include, startsWith: startsWith, endsWith: endsWith, empty: empty, blank: blank, interpolate: interpolate }; })()); var Template = Class.create({ initialize: function(template, pattern) { this.template = template.toString(); this.pattern = pattern || Template.Pattern; }, evaluate: function(object) { if (object && Object.isFunction(object.toTemplateReplacements)) object = object.toTemplateReplacements(); return this.template.gsub(this.pattern, function(match) { if (object == null) return (match[1] + ''); var before = match[1] || ''; if (before == '\\') return match[2]; var ctx = object, expr = match[3], pattern = /^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/; match = pattern.exec(expr); if (match == null) return before; while (match != null) { var comp = match[1].startsWith('[') ? match[2].replace(/\\\\]/g, ']') : match[1]; ctx = ctx[comp]; if (null == ctx || '' == match[3]) break; expr = expr.substring('[' == match[3] ? match[1].length : match[0].length); match = pattern.exec(expr); } return before + String.interpret(ctx); }); } }); Template.Pattern = /(^|.|\r|\n)(#\{(.*?)\})/; var $break = { }; var Enumerable = (function() { function each(iterator, context) { var index = 0; try { this._each(function(value) { iterator.call(context, value, index++); }); } catch (e) { if (e != $break) throw e; } return this; } function eachSlice(number, iterator, context) { var index = -number, slices = [], array = this.toArray(); if (number < 1) return array; while ((index += number) < array.length) slices.push(array.slice(index, index+number)); return slices.collect(iterator, context); } function all(iterator, context) { iterator = iterator || Prototype.K; var result = true; this.each(function(value, index) { result = result && !!iterator.call(context, value, index); if (!result) throw $break; }); return result; } function any(iterator, context) { iterator = iterator || Prototype.K; var result = false; this.each(function(value, index) { if (result = !!iterator.call(context, value, index)) throw $break; }); return result; } function collect(iterator, context) { iterator = iterator || Prototype.K; var results = []; this.each(function(value, index) { results.push(iterator.call(context, value, index)); }); return results; } function detect(iterator, context) { var result; this.each(function(value, index) { if (iterator.call(context, value, index)) { result = value; throw $break; } }); return result; } function findAll(iterator, context) { var results = []; this.each(function(value, index) { if (iterator.call(context, value, index)) results.push(value); }); return results; } function grep(filter, iterator, context) { iterator = iterator || Prototype.K; var results = []; if (Object.isString(filter)) filter = new RegExp(RegExp.escape(filter)); this.each(function(value, index) { if (filter.match(value)) results.push(iterator.call(context, value, index)); }); return results; } function include(object) { if (Object.isFunction(this.indexOf)) if (this.indexOf(object) != -1) return true; var found = false; this.each(function(value) { if (value == object) { found = true; throw $break; } }); return found; } function inGroupsOf(number, fillWith) { fillWith = Object.isUndefined(fillWith) ? null : fillWith; return this.eachSlice(number, function(slice) { while(slice.length < number) slice.push(fillWith); return slice; }); } function inject(memo, iterator, context) { this.each(function(value, index) { memo = iterator.call(context, memo, value, index); }); return memo; } function invoke(method) { var args = $A(arguments).slice(1); return this.map(function(value) { return value[method].apply(value, args); }); } function max(iterator, context) { iterator = iterator || Prototype.K; var result; this.each(function(value, index) { value = iterator.call(context, value, index); if (result == null || value >= result) result = value; }); return result; } function min(iterator, context) { iterator = iterator || Prototype.K; var result; this.each(function(value, index) { value = iterator.call(context, value, index); if (result == null || value < result) result = value; }); return result; } function partition(iterator, context) { iterator = iterator || Prototype.K; var trues = [], falses = []; this.each(function(value, index) { (iterator.call(context, value, index) ? trues : falses).push(value); }); return [trues, falses]; } function pluck(property) { var results = []; this.each(function(value) { results.push(value[property]); }); return results; } function reject(iterator, context) { var results = []; this.each(function(value, index) { if (!iterator.call(context, value, index)) results.push(value); }); return results; } function sortBy(iterator, context) { return this.map(function(value, index) { return { value: value, criteria: iterator.call(context, value, index) }; }).sort(function(left, right) { var a = left.criteria, b = right.criteria; return a < b ? -1 : a > b ? 1 : 0; }).pluck('value'); } function toArray() { return this.map(); } function zip() { var iterator = Prototype.K, args = $A(arguments); if (Object.isFunction(args.last())) iterator = args.pop(); var collections = [this].concat(args).map($A); return this.map(function(value, index) { return iterator(collections.pluck(index)); }); } function size() { return this.toArray().length; } function inspect() { return '#'; } return { each: each, eachSlice: eachSlice, all: all, every: all, any: any, some: any, collect: collect, map: collect, detect: detect, findAll: findAll, select: findAll, filter: findAll, grep: grep, include: include, member: include, inGroupsOf: inGroupsOf, inject: inject, invoke: invoke, max: max, min: min, partition: partition, pluck: pluck, reject: reject, sortBy: sortBy, toArray: toArray, entries: toArray, zip: zip, size: size, inspect: inspect, find: detect }; })(); function $A(iterable) { if (!iterable) return []; if ('toArray' in Object(iterable)) return iterable.toArray(); var length = iterable.length || 0, results = new Array(length); while (length--) results[length] = iterable[length]; return results; } function $w(string) { if (!Object.isString(string)) return []; string = string.strip(); return string ? string.split(/\s+/) : []; } Array.from = $A; (function() { var arrayProto = Array.prototype, slice = arrayProto.slice, _each = arrayProto.forEach; // use native browser JS 1.6 implementation if available function each(iterator) { for (var i = 0, length = this.length; i < length; i++) iterator(this[i]); } if (!_each) _each = each; function clear() { this.length = 0; return this; } function first() { return this[0]; } function last() { return this[this.length - 1]; } function compact() { return this.select(function(value) { return value != null; }); } function flatten() { return this.inject([], function(array, value) { if (Object.isArray(value)) return array.concat(value.flatten()); array.push(value); return array; }); } function without() { var values = slice.call(arguments, 0); return this.select(function(value) { return !values.include(value); }); } function reverse(inline) { return (inline === false ? this.toArray() : this)._reverse(); } function uniq(sorted) { return this.inject([], function(array, value, index) { if (0 == index || (sorted ? array.last() != value : !array.include(value))) array.push(value); return array; }); } function intersect(array) { return this.uniq().findAll(function(item) { return array.detect(function(value) { return item === value }); }); } function clone() { return slice.call(this, 0); } function size() { return this.length; } function inspect() { return '[' + this.map(Object.inspect).join(', ') + ']'; } function indexOf(item, i) { i || (i = 0); var length = this.length; if (i < 0) i = length + i; for (; i < length; i++) if (this[i] === item) return i; return -1; } function lastIndexOf(item, i) { i = isNaN(i) ? this.length : (i < 0 ? this.length + i : i) + 1; var n = this.slice(0, i).reverse().indexOf(item); return (n < 0) ? n : i - n - 1; } function concat() { var array = slice.call(this, 0), item; for (var i = 0, length = arguments.length; i < length; i++) { item = arguments[i]; if (Object.isArray(item) && !('callee' in item)) { for (var j = 0, arrayLength = item.length; j < arrayLength; j++) array.push(item[j]); } else { array.push(item); } } return array; } Object.extend(arrayProto, Enumerable); if (!arrayProto._reverse) arrayProto._reverse = arrayProto.reverse; Object.extend(arrayProto, { _each: _each, clear: clear, first: first, last: last, compact: compact, flatten: flatten, without: without, reverse: reverse, uniq: uniq, intersect: intersect, clone: clone, toArray: clone, size: size, inspect: inspect }); var CONCAT_ARGUMENTS_BUGGY = (function() { return [].concat(arguments)[0][0] !== 1; })(1,2) if (CONCAT_ARGUMENTS_BUGGY) arrayProto.concat = concat; if (!arrayProto.indexOf) arrayProto.indexOf = indexOf; if (!arrayProto.lastIndexOf) arrayProto.lastIndexOf = lastIndexOf; })(); function $H(object) { return new Hash(object); }; var Hash = Class.create(Enumerable, (function() { function initialize(object) { this._object = Object.isHash(object) ? object.toObject() : Object.clone(object); } function _each(iterator) { for (var key in this._object) { var value = this._object[key], pair = [key, value]; pair.key = key; pair.value = value; iterator(pair); } } function set(key, value) { return this._object[key] = value; } function get(key) { if (this._object[key] !== Object.prototype[key]) return this._object[key]; } function unset(key) { var value = this._object[key]; delete this._object[key]; return value; } function toObject() { return Object.clone(this._object); } function keys() { return this.pluck('key'); } function values() { return this.pluck('value'); } function index(value) { var match = this.detect(function(pair) { return pair.value === value; }); return match && match.key; } function merge(object) { return this.clone().update(object); } function update(object) { return new Hash(object).inject(this, function(result, pair) { result.set(pair.key, pair.value); return result; }); } function toQueryPair(key, value) { if (Object.isUndefined(value)) return key; return key + '=' + encodeURIComponent(String.interpret(value)); } function toQueryString() { return this.inject([], function(results, pair) { var key = encodeURIComponent(pair.key), values = pair.value; if (values && typeof values == 'object') { if (Object.isArray(values)) return results.concat(values.map(toQueryPair.curry(key))); } else results.push(toQueryPair(key, values)); return results; }).join('&'); } function inspect() { return '#'; } function clone() { return new Hash(this); } return { initialize: initialize, _each: _each, set: set, get: get, unset: unset, toObject: toObject, toTemplateReplacements: toObject, keys: keys, values: values, index: index, merge: merge, update: update, toQueryString: toQueryString, inspect: inspect, toJSON: toObject, clone: clone }; })()); Hash.from = $H; Object.extend(Number.prototype, (function() { function toColorPart() { return this.toPaddedString(2, 16); } function succ() { return this + 1; } function times(iterator, context) { $R(0, this, true).each(iterator, context); return this; } function toPaddedString(length, radix) { var string = this.toString(radix || 10); return '0'.times(length - string.length) + string; } function abs() { return Math.abs(this); } function round() { return Math.round(this); } function ceil() { return Math.ceil(this); } function floor() { return Math.floor(this); } return { toColorPart: toColorPart, succ: succ, times: times, toPaddedString: toPaddedString, abs: abs, round: round, ceil: ceil, floor: floor }; })()); function $R(start, end, exclusive) { return new ObjectRange(start, end, exclusive); } var ObjectRange = Class.create(Enumerable, (function() { function initialize(start, end, exclusive) { this.start = start; this.end = end; this.exclusive = exclusive; } function _each(iterator) { var value = this.start; while (this.include(value)) { iterator(value); value = value.succ(); } } function include(value) { if (value < this.start) return false; if (this.exclusive) return value < this.end; return value <= this.end; } return { initialize: initialize, _each: _each, include: include }; })()); var Ajax = { getTransport: function() { return Try.these( function() {return new XMLHttpRequest()}, function() {return new ActiveXObject('Msxml2.XMLHTTP')}, function() {return new ActiveXObject('Microsoft.XMLHTTP')} ) || false; }, activeRequestCount: 0 }; Ajax.Responders = { responders: [], _each: function(iterator) { this.responders._each(iterator); }, register: function(responder) { if (!this.include(responder)) this.responders.push(responder); }, unregister: function(responder) { this.responders = this.responders.without(responder); }, dispatch: function(callback, request, transport, json) { this.each(function(responder) { if (Object.isFunction(responder[callback])) { try { responder[callback].apply(responder, [request, transport, json]); } catch (e) { } } }); } }; Object.extend(Ajax.Responders, Enumerable); Ajax.Responders.register({ onCreate: function() { Ajax.activeRequestCount++ }, onComplete: function() { Ajax.activeRequestCount-- } }); Ajax.Base = Class.create({ initialize: function(options) { this.options = { method: 'post', asynchronous: true, contentType: 'application/x-www-form-urlencoded', encoding: 'UTF-8', parameters: '', evalJSON: true, evalJS: true }; Object.extend(this.options, options || { }); this.options.method = this.options.method.toLowerCase(); if (Object.isString(this.options.parameters)) this.options.parameters = this.options.parameters.toQueryParams(); else if (Object.isHash(this.options.parameters)) this.options.parameters = this.options.parameters.toObject(); } }); Ajax.Request = Class.create(Ajax.Base, { _complete: false, initialize: function($super, url, options) { $super(options); this.transport = Ajax.getTransport(); this.request(url); }, request: function(url) { this.url = url; this.method = this.options.method; var params = Object.clone(this.options.parameters); if (!['get', 'post'].include(this.method)) { params['_method'] = this.method; this.method = 'post'; } this.parameters = params; if (params = Object.toQueryString(params)) { if (this.method == 'get') this.url += (this.url.include('?') ? '&' : '?') + params; else if (/Konqueror|Safari|KHTML/.test(navigator.userAgent)) params += '&_='; } try { var response = new Ajax.Response(this); if (this.options.onCreate) this.options.onCreate(response); Ajax.Responders.dispatch('onCreate', this, response); this.transport.open(this.method.toUpperCase(), this.url, this.options.asynchronous); if (this.options.asynchronous) this.respondToReadyState.bind(this).defer(1); this.transport.onreadystatechange = this.onStateChange.bind(this); this.setRequestHeaders(); this.body = this.method == 'post' ? (this.options.postBody || params) : null; this.transport.send(this.body); /* Force Firefox to handle ready state 4 for synchronous requests */ if (!this.options.asynchronous && this.transport.overrideMimeType) this.onStateChange(); } catch (e) { this.dispatchException(e); } }, onStateChange: function() { var readyState = this.transport.readyState; if (readyState > 1 && !((readyState == 4) && this._complete)) this.respondToReadyState(this.transport.readyState); }, setRequestHeaders: function() { var headers = { 'X-Requested-With': 'XMLHttpRequest', 'X-Prototype-Version': Prototype.Version, 'Accept': 'text/javascript, text/html, application/xml, text/xml, */*' }; if (this.method == 'post') { headers['Content-type'] = this.options.contentType + (this.options.encoding ? '; charset=' + this.options.encoding : ''); /* Force "Connection: close" for older Mozilla browsers to work * around a bug where XMLHttpRequest sends an incorrect * Content-length header. See Mozilla Bugzilla #246651. */ if (this.transport.overrideMimeType && (navigator.userAgent.match(/Gecko\/(\d{4})/) || [0,2005])[1] < 2005) headers['Connection'] = 'close'; } if (typeof this.options.requestHeaders == 'object') { var extras = this.options.requestHeaders; if (Object.isFunction(extras.push)) for (var i = 0, length = extras.length; i < length; i += 2) headers[extras[i]] = extras[i+1]; else $H(extras).each(function(pair) { headers[pair.key] = pair.value }); } for (var name in headers) this.transport.setRequestHeader(name, headers[name]); }, success: function() { var status = this.getStatus(); return !status || (status >= 200 && status < 300); }, getStatus: function() { try { return this.transport.status || 0; } catch (e) { return 0 } }, respondToReadyState: function(readyState) { var state = Ajax.Request.Events[readyState], response = new Ajax.Response(this); if (state == 'Complete') { try { this._complete = true; (this.options['on' + response.status] || this.options['on' + (this.success() ? 'Success' : 'Failure')] || Prototype.emptyFunction)(response, response.headerJSON); } catch (e) { this.dispatchException(e); } var contentType = response.getHeader('Content-type'); if (this.options.evalJS == 'force' || (this.options.evalJS && this.isSameOrigin() && contentType && contentType.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i))) this.evalResponse(); } try { (this.options['on' + state] || Prototype.emptyFunction)(response, response.headerJSON); Ajax.Responders.dispatch('on' + state, this, response, response.headerJSON); } catch (e) { this.dispatchException(e); } if (state == 'Complete') { this.transport.onreadystatechange = Prototype.emptyFunction; } }, isSameOrigin: function() { var m = this.url.match(/^\s*https?:\/\/[^\/]*/); return !m || (m[0] == '#{protocol}//#{domain}#{port}'.interpolate({ protocol: location.protocol, domain: document.domain, port: location.port ? ':' + location.port : '' })); }, getHeader: function(name) { try { return this.transport.getResponseHeader(name) || null; } catch (e) { return null; } }, evalResponse: function() { try { return eval((this.transport.responseText || '').unfilterJSON()); } catch (e) { this.dispatchException(e); } }, dispatchException: function(exception) { (this.options.onException || Prototype.emptyFunction)(this, exception); Ajax.Responders.dispatch('onException', this, exception); } }); Ajax.Request.Events = ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete']; Ajax.Response = Class.create({ initialize: function(request){ this.request = request; var transport = this.transport = request.transport, readyState = this.readyState = transport.readyState; if ((readyState > 2 && !Prototype.Browser.IE) || readyState == 4) { this.status = this.getStatus(); this.statusText = this.getStatusText(); this.responseText = String.interpret(transport.responseText); this.headerJSON = this._getHeaderJSON(); } if (readyState == 4) { var xml = transport.responseXML; this.responseXML = Object.isUndefined(xml) ? null : xml; this.responseJSON = this._getResponseJSON(); } }, status: 0, statusText: '', getStatus: Ajax.Request.prototype.getStatus, getStatusText: function() { try { return this.transport.statusText || ''; } catch (e) { return '' } }, getHeader: Ajax.Request.prototype.getHeader, getAllHeaders: function() { try { return this.getAllResponseHeaders(); } catch (e) { return null } }, getResponseHeader: function(name) { return this.transport.getResponseHeader(name); }, getAllResponseHeaders: function() { return this.transport.getAllResponseHeaders(); }, _getHeaderJSON: function() { var json = this.getHeader('X-JSON'); if (!json) return null; json = decodeURIComponent(escape(json)); try { return json.evalJSON(this.request.options.sanitizeJSON || !this.request.isSameOrigin()); } catch (e) { this.request.dispatchException(e); } }, _getResponseJSON: function() { var options = this.request.options; if (!options.evalJSON || (options.evalJSON != 'force' && !(this.getHeader('Content-type') || '').include('application/json')) || this.responseText.blank()) return null; try { return this.responseText.evalJSON(options.sanitizeJSON || !this.request.isSameOrigin()); } catch (e) { this.request.dispatchException(e); } } }); Ajax.Updater = Class.create(Ajax.Request, { initialize: function($super, container, url, options) { this.container = { success: (container.success || container), failure: (container.failure || (container.success ? null : container)) }; options = Object.clone(options); var onComplete = options.onComplete; options.onComplete = (function(response, json) { this.updateContent(response.responseText); if (Object.isFunction(onComplete)) onComplete(response, json); }).bind(this); $super(url, options); }, updateContent: function(responseText) { var receiver = this.container[this.success() ? 'success' : 'failure'], options = this.options; if (!options.evalScripts) responseText = responseText.stripScripts(); if (receiver = $(receiver)) { if (options.insertion) { if (Object.isString(options.insertion)) { var insertion = { }; insertion[options.insertion] = responseText; receiver.insert(insertion); } else options.insertion(receiver, responseText); } else receiver.update(responseText); } } }); Ajax.PeriodicalUpdater = Class.create(Ajax.Base, { initialize: function($super, container, url, options) { $super(options); this.onComplete = this.options.onComplete; this.frequency = (this.options.frequency || 2); this.decay = (this.options.decay || 1); this.updater = { }; this.container = container; this.url = url; this.start(); }, start: function() { this.options.onComplete = this.updateComplete.bind(this); this.onTimerEvent(); }, stop: function() { this.updater.options.onComplete = undefined; clearTimeout(this.timer); (this.onComplete || Prototype.emptyFunction).apply(this, arguments); }, updateComplete: function(response) { if (this.options.decay) { this.decay = (response.responseText == this.lastText ? this.decay * this.options.decay : 1); this.lastText = response.responseText; } this.timer = this.onTimerEvent.bind(this).delay(this.decay * this.frequency); }, onTimerEvent: function() { this.updater = new Ajax.Updater(this.container, this.url, this.options); } }); function $(element) { if (arguments.length > 1) { for (var i = 0, elements = [], length = arguments.length; i < length; i++) elements.push($(arguments[i])); return elements; } if (Object.isString(element)) element = document.getElementById(element); return Element.extend(element); } if (Prototype.BrowserFeatures.XPath) { document._getElementsByXPath = function(expression, parentElement) { var results = []; var query = document.evaluate(expression, $(parentElement) || document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); for (var i = 0, length = query.snapshotLength; i < length; i++) results.push(Element.extend(query.snapshotItem(i))); return results; }; } /*--------------------------------------------------------------------------*/ if (!Node) var Node = { }; if (!Node.ELEMENT_NODE) { Object.extend(Node, { ELEMENT_NODE: 1, ATTRIBUTE_NODE: 2, TEXT_NODE: 3, CDATA_SECTION_NODE: 4, ENTITY_REFERENCE_NODE: 5, ENTITY_NODE: 6, PROCESSING_INSTRUCTION_NODE: 7, COMMENT_NODE: 8, DOCUMENT_NODE: 9, DOCUMENT_TYPE_NODE: 10, DOCUMENT_FRAGMENT_NODE: 11, NOTATION_NODE: 12 }); } (function(global) { var HAS_EXTENDED_CREATE_ELEMENT_SYNTAX = (function(){ try { var el = document.createElement(''); return el.tagName.toLowerCase() === 'input' && el.name === 'x'; } catch(err) { return false; } })(); var element = global.Element; global.Element = function(tagName, attributes) { attributes = attributes || { }; tagName = tagName.toLowerCase(); var cache = Element.cache; if (HAS_EXTENDED_CREATE_ELEMENT_SYNTAX && attributes.name) { tagName = '<' + tagName + ' name="' + attributes.name + '">'; delete attributes.name; return Element.writeAttribute(document.createElement(tagName), attributes); } if (!cache[tagName]) cache[tagName] = Element.extend(document.createElement(tagName)); return Element.writeAttribute(cache[tagName].cloneNode(false), attributes); }; Object.extend(global.Element, element || { }); if (element) global.Element.prototype = element.prototype; })(this); Element.idCounter = 1; Element.cache = { }; function purgeElement(element) { var uid = element._prototypeUID; if (uid) { Element.stopObserving(element); element._prototypeUID = void 0; delete Element.Storage[uid]; } } Element.Methods = { visible: function(element) { return $(element).style.display != 'none'; }, toggle: function(element) { element = $(element); Element[Element.visible(element) ? 'hide' : 'show'](element); return element; }, hide: function(element) { element = $(element); element.style.display = 'none'; return element; }, show: function(element) { element = $(element); element.style.display = ''; return element; }, remove: function(element) { element = $(element); element.parentNode.removeChild(element); return element; }, update: (function(){ var SELECT_ELEMENT_INNERHTML_BUGGY = (function(){ var el = document.createElement("select"), isBuggy = true; el.innerHTML = ""; if (el.options && el.options[0]) { isBuggy = el.options[0].nodeName.toUpperCase() !== "OPTION"; } el = null; return isBuggy; })(); var TABLE_ELEMENT_INNERHTML_BUGGY = (function(){ try { var el = document.createElement("table"); if (el && el.tBodies) { el.innerHTML = "test"; var isBuggy = typeof el.tBodies[0] == "undefined"; el = null; return isBuggy; } } catch (e) { return true; } })(); var SCRIPT_ELEMENT_REJECTS_TEXTNODE_APPENDING = (function () { var s = document.createElement("script"), isBuggy = false; try { s.appendChild(document.createTextNode("")); isBuggy = !s.firstChild || s.firstChild && s.firstChild.nodeType !== 3; } catch (e) { isBuggy = true; } s = null; return isBuggy; })(); function update(element, content) { element = $(element); var descendants = element.getElementsByTagName('*'), i = descendants.length; while (i--) purgeElement(descendants[i]); if (content && content.toElement) content = content.toElement(); if (Object.isElement(content)) return element.update().insert(content); content = Object.toHTML(content); var tagName = element.tagName.toUpperCase(); if (tagName === 'SCRIPT' && SCRIPT_ELEMENT_REJECTS_TEXTNODE_APPENDING) { element.text = content; return element; } if (SELECT_ELEMENT_INNERHTML_BUGGY || TABLE_ELEMENT_INNERHTML_BUGGY) { if (tagName in Element._insertionTranslations.tags) { while (element.firstChild) { element.removeChild(element.firstChild); } Element._getContentFromAnonymousElement(tagName, content.stripScripts()) .each(function(node) { element.appendChild(node) }); } else { element.innerHTML = content.stripScripts(); } } else { element.innerHTML = content.stripScripts(); } content.evalScripts.bind(content).defer(); return element; } return update; })(), replace: function(element, content) { element = $(element); if (content && content.toElement) content = content.toElement(); else if (!Object.isElement(content)) { content = Object.toHTML(content); var range = element.ownerDocument.createRange(); range.selectNode(element); content.evalScripts.bind(content).defer(); content = range.createContextualFragment(content.stripScripts()); } element.parentNode.replaceChild(content, element); return element; }, insert: function(element, insertions) { element = $(element); if (Object.isString(insertions) || Object.isNumber(insertions) || Object.isElement(insertions) || (insertions && (insertions.toElement || insertions.toHTML))) insertions = {bottom:insertions}; var content, insert, tagName, childNodes; for (var position in insertions) { content = insertions[position]; position = position.toLowerCase(); insert = Element._insertionTranslations[position]; if (content && content.toElement) content = content.toElement(); if (Object.isElement(content)) { insert(element, content); continue; } content = Object.toHTML(content); tagName = ((position == 'before' || position == 'after') ? element.parentNode : element).tagName.toUpperCase(); childNodes = Element._getContentFromAnonymousElement(tagName, content.stripScripts()); if (position == 'top' || position == 'after') childNodes.reverse(); childNodes.each(insert.curry(element)); content.evalScripts.bind(content).defer(); } return element; }, wrap: function(element, wrapper, attributes) { element = $(element); if (Object.isElement(wrapper)) $(wrapper).writeAttribute(attributes || { }); else if (Object.isString(wrapper)) wrapper = new Element(wrapper, attributes); else wrapper = new Element('div', wrapper); if (element.parentNode) element.parentNode.replaceChild(wrapper, element); wrapper.appendChild(element); return wrapper; }, inspect: function(element) { element = $(element); var result = '<' + element.tagName.toLowerCase(); $H({'id': 'id', 'className': 'class'}).each(function(pair) { var property = pair.first(), attribute = pair.last(), value = (element[property] || '').toString(); if (value) result += ' ' + attribute + '=' + value.inspect(true); }); return result + '>'; }, recursivelyCollect: function(element, property, maximumLength) { element = $(element); maximumLength = maximumLength || -1; var elements = []; while (element = element[property]) { if (element.nodeType == 1) elements.push(Element.extend(element)); if (elements.length == maximumLength) break; } return elements; }, ancestors: function(element) { return Element.recursivelyCollect(element, 'parentNode'); }, descendants: function(element) { return Element.select(element, "*"); }, firstDescendant: function(element) { element = $(element).firstChild; while (element && element.nodeType != 1) element = element.nextSibling; return $(element); }, immediateDescendants: function(element) { var results = [], child = $(element).firstChild; while (child) { if (child.nodeType === 1) { results.push(Element.extend(child)); } child = child.nextSibling; } return results; }, previousSiblings: function(element, maximumLength) { return Element.recursivelyCollect(element, 'previousSibling'); }, nextSiblings: function(element) { return Element.recursivelyCollect(element, 'nextSibling'); }, siblings: function(element) { element = $(element); return Element.previousSiblings(element).reverse() .concat(Element.nextSiblings(element)); }, match: function(element, selector) { element = $(element); if (Object.isString(selector)) return Prototype.Selector.match(element, selector); return selector.match(element); }, up: function(element, expression, index) { element = $(element); if (arguments.length == 1) return $(element.parentNode); var ancestors = Element.ancestors(element); return Object.isNumber(expression) ? ancestors[expression] : Prototype.Selector.find(ancestors, expression, index); }, down: function(element, expression, index) { element = $(element); if (arguments.length == 1) return Element.firstDescendant(element); return Object.isNumber(expression) ? Element.descendants(element)[expression] : Element.select(element, expression)[index || 0]; }, previous: function(element, expression, index) { element = $(element); if (Object.isNumber(expression)) index = expression, expression = false; if (!Object.isNumber(index)) index = 0; if (expression) { return Prototype.Selector.find(element.previousSiblings(), expression, index); } else { return element.recursivelyCollect("previousSibling", index + 1)[index]; } }, next: function(element, expression, index) { element = $(element); if (Object.isNumber(expression)) index = expression, expression = false; if (!Object.isNumber(index)) index = 0; if (expression) { return Prototype.Selector.find(element.nextSiblings(), expression, index); } else { var maximumLength = Object.isNumber(index) ? index + 1 : 1; return element.recursivelyCollect("nextSibling", index + 1)[index]; } }, select: function(element) { element = $(element); var expressions = Array.prototype.slice.call(arguments, 1).join(', '); return Prototype.Selector.select(expressions, element); }, adjacent: function(element) { element = $(element); var expressions = Array.prototype.slice.call(arguments, 1).join(', '); return Prototype.Selector.select(expressions, element.parentNode).without(element); }, identify: function(element) { element = $(element); var id = Element.readAttribute(element, 'id'); if (id) return id; do { id = 'anonymous_element_' + Element.idCounter++ } while ($(id)); Element.writeAttribute(element, 'id', id); return id; }, readAttribute: function(element, name) { element = $(element); if (Prototype.Browser.IE) { var t = Element._attributeTranslations.read; if (t.values[name]) return t.values[name](element, name); if (t.names[name]) name = t.names[name]; if (name.include(':')) { return (!element.attributes || !element.attributes[name]) ? null : element.attributes[name].value; } } return element.getAttribute(name); }, writeAttribute: function(element, name, value) { element = $(element); var attributes = { }, t = Element._attributeTranslations.write; if (typeof name == 'object') attributes = name; else attributes[name] = Object.isUndefined(value) ? true : value; for (var attr in attributes) { name = t.names[attr] || attr; value = attributes[attr]; if (t.values[attr]) name = t.values[attr](element, value); if (value === false || value === null) element.removeAttribute(name); else if (value === true) element.setAttribute(name, name); else element.setAttribute(name, value); } return element; }, getHeight: function(element) { return Element.getDimensions(element).height; }, getWidth: function(element) { return Element.getDimensions(element).width; }, classNames: function(element) { return new Element.ClassNames(element); }, hasClassName: function(element, className) { if (!(element = $(element))) return; var elementClassName = element.className; return (elementClassName.length > 0 && (elementClassName == className || new RegExp("(^|\\s)" + className + "(\\s|$)").test(elementClassName))); }, addClassName: function(element, className) { if (!(element = $(element))) return; if (!Element.hasClassName(element, className)) element.className += (element.className ? ' ' : '') + className; return element; }, removeClassName: function(element, className) { if (!(element = $(element))) return; element.className = element.className.replace( new RegExp("(^|\\s+)" + className + "(\\s+|$)"), ' ').strip(); return element; }, toggleClassName: function(element, className) { if (!(element = $(element))) return; return Element[Element.hasClassName(element, className) ? 'removeClassName' : 'addClassName'](element, className); }, cleanWhitespace: function(element) { element = $(element); var node = element.firstChild; while (node) { var nextNode = node.nextSibling; if (node.nodeType == 3 && !/\S/.test(node.nodeValue)) element.removeChild(node); node = nextNode; } return element; }, empty: function(element) { return $(element).innerHTML.blank(); }, descendantOf: function(element, ancestor) { element = $(element), ancestor = $(ancestor); if (element.compareDocumentPosition) return (element.compareDocumentPosition(ancestor) & 8) === 8; if (ancestor.contains) return ancestor.contains(element) && ancestor !== element; while (element = element.parentNode) if (element == ancestor) return true; return false; }, scrollTo: function(element) { element = $(element); var pos = Element.cumulativeOffset(element); window.scrollTo(pos[0], pos[1]); return element; }, getStyle: function(element, style) { element = $(element); style = style == 'float' ? 'cssFloat' : style.camelize(); var value = element.style[style]; if (!value || value == 'auto') { var css = document.defaultView.getComputedStyle(element, null); value = css ? css[style] : null; } if (style == 'opacity') return value ? parseFloat(value) : 1.0; return value == 'auto' ? null : value; }, getOpacity: function(element) { return $(element).getStyle('opacity'); }, setStyle: function(element, styles) { element = $(element); var elementStyle = element.style, match; if (Object.isString(styles)) { element.style.cssText += ';' + styles; return styles.include('opacity') ? element.setOpacity(styles.match(/opacity:\s*(\d?\.?\d*)/)[1]) : element; } for (var property in styles) if (property == 'opacity') element.setOpacity(styles[property]); else elementStyle[(property == 'float' || property == 'cssFloat') ? (Object.isUndefined(elementStyle.styleFloat) ? 'cssFloat' : 'styleFloat') : property] = styles[property]; return element; }, setOpacity: function(element, value) { element = $(element); element.style.opacity = (value == 1 || value === '') ? '' : (value < 0.00001) ? 0 : value; return element; }, makePositioned: function(element) { element = $(element); var pos = Element.getStyle(element, 'position'); if (pos == 'static' || !pos) { element._madePositioned = true; element.style.position = 'relative'; if (Prototype.Browser.Opera) { element.style.top = 0; element.style.left = 0; } } return element; }, undoPositioned: function(element) { element = $(element); if (element._madePositioned) { element._madePositioned = undefined; element.style.position = element.style.top = element.style.left = element.style.bottom = element.style.right = ''; } return element; }, makeClipping: function(element) { element = $(element); if (element._overflow) return element; element._overflow = Element.getStyle(element, 'overflow') || 'auto'; if (element._overflow !== 'hidden') element.style.overflow = 'hidden'; return element; }, undoClipping: function(element) { element = $(element); if (!element._overflow) return element; element.style.overflow = element._overflow == 'auto' ? '' : element._overflow; element._overflow = null; return element; }, cumulativeOffset: function(element) { var valueT = 0, valueL = 0; if (element.parentNode) { do { valueT += element.offsetTop || 0; valueL += element.offsetLeft || 0; element = element.offsetParent; } while (element); } return Element._returnOffset(valueL, valueT); }, positionedOffset: function(element) { var valueT = 0, valueL = 0; do { valueT += element.offsetTop || 0; valueL += element.offsetLeft || 0; element = element.offsetParent; if (element) { if (element.tagName.toUpperCase() == 'BODY') break; var p = Element.getStyle(element, 'position'); if (p !== 'static') break; } } while (element); return Element._returnOffset(valueL, valueT); }, absolutize: function(element) { element = $(element); if (Element.getStyle(element, 'position') == 'absolute') return element; var offsets = Element.positionedOffset(element), top = offsets[1], left = offsets[0], width = element.clientWidth, height = element.clientHeight; element._originalLeft = left - parseFloat(element.style.left || 0); element._originalTop = top - parseFloat(element.style.top || 0); element._originalWidth = element.style.width; element._originalHeight = element.style.height; element.style.position = 'absolute'; element.style.top = top + 'px'; element.style.left = left + 'px'; element.style.width = width + 'px'; element.style.height = height + 'px'; return element; }, relativize: function(element) { element = $(element); if (Element.getStyle(element, 'position') == 'relative') return element; element.style.position = 'relative'; var top = parseFloat(element.style.top || 0) - (element._originalTop || 0), left = parseFloat(element.style.left || 0) - (element._originalLeft || 0); element.style.top = top + 'px'; element.style.left = left + 'px'; element.style.height = element._originalHeight; element.style.width = element._originalWidth; return element; }, cumulativeScrollOffset: function(element) { var valueT = 0, valueL = 0; do { valueT += element.scrollTop || 0; valueL += element.scrollLeft || 0; element = element.parentNode; } while (element); return Element._returnOffset(valueL, valueT); }, getOffsetParent: function(element) { if (element.offsetParent) return $(element.offsetParent); if (element == document.body) return $(element); while ((element = element.parentNode) && element != document.body) if (Element.getStyle(element, 'position') != 'static') return $(element); return $(document.body); }, viewportOffset: function(forElement) { var valueT = 0, valueL = 0, element = forElement; do { valueT += element.offsetTop || 0; valueL += element.offsetLeft || 0; if (element.offsetParent == document.body && Element.getStyle(element, 'position') == 'absolute') break; } while (element = element.offsetParent); element = forElement; do { if (!Prototype.Browser.Opera || (element.tagName && (element.tagName.toUpperCase() == 'BODY'))) { valueT -= element.scrollTop || 0; valueL -= element.scrollLeft || 0; } } while (element = element.parentNode); return Element._returnOffset(valueL, valueT); }, clonePosition: function(element, source) { var options = Object.extend({ setLeft: true, setTop: true, setWidth: true, setHeight: true, offsetTop: 0, offsetLeft: 0 }, arguments[2] || { }); source = $(source); var p = Element.viewportOffset(source), delta = [0, 0], parent = null; element = $(element); if (Element.getStyle(element, 'position') == 'absolute') { parent = Element.getOffsetParent(element); delta = Element.viewportOffset(parent); } if (parent == document.body) { delta[0] -= document.body.offsetLeft; delta[1] -= document.body.offsetTop; } if (options.setLeft) element.style.left = (p[0] - delta[0] + options.offsetLeft) + 'px'; if (options.setTop) element.style.top = (p[1] - delta[1] + options.offsetTop) + 'px'; if (options.setWidth) element.style.width = source.offsetWidth + 'px'; if (options.setHeight) element.style.height = source.offsetHeight + 'px'; return element; } }; Object.extend(Element.Methods, { getElementsBySelector: Element.Methods.select, childElements: Element.Methods.immediateDescendants }); Element._attributeTranslations = { write: { names: { className: 'class', htmlFor: 'for' }, values: { } } }; if (Prototype.Browser.Opera) { Element.Methods.getStyle = Element.Methods.getStyle.wrap( function(proceed, element, style) { switch (style) { case 'left': case 'top': case 'right': case 'bottom': if (proceed(element, 'position') === 'static') return null; case 'height': case 'width': if (!Element.visible(element)) return null; var dim = parseInt(proceed(element, style), 10); if (dim !== element['offset' + style.capitalize()]) return dim + 'px'; var properties; if (style === 'height') { properties = ['border-top-width', 'padding-top', 'padding-bottom', 'border-bottom-width']; } else { properties = ['border-left-width', 'padding-left', 'padding-right', 'border-right-width']; } return properties.inject(dim, function(memo, property) { var val = proceed(element, property); return val === null ? memo : memo - parseInt(val, 10); }) + 'px'; default: return proceed(element, style); } } ); Element.Methods.readAttribute = Element.Methods.readAttribute.wrap( function(proceed, element, attribute) { if (attribute === 'title') return element.title; return proceed(element, attribute); } ); } else if (Prototype.Browser.IE) { Element.Methods.getOffsetParent = Element.Methods.getOffsetParent.wrap( function(proceed, element) { element = $(element); if (!element.parentNode) return $(document.body); var position = element.getStyle('position'); if (position !== 'static') return proceed(element); element.setStyle({ position: 'relative' }); var value = proceed(element); element.setStyle({ position: position }); return value; } ); $w('positionedOffset viewportOffset').each(function(method) { Element.Methods[method] = Element.Methods[method].wrap( function(proceed, element) { element = $(element); if (!element.parentNode) return Element._returnOffset(0, 0); var position = element.getStyle('position'); if (position !== 'static') return proceed(element); var offsetParent = element.getOffsetParent(); if (offsetParent && offsetParent.getStyle('position') === 'fixed') offsetParent.setStyle({ zoom: 1 }); element.setStyle({ position: 'relative' }); var value = proceed(element); element.setStyle({ position: position }); return value; } ); }); Element.Methods.getStyle = function(element, style) { element = $(element); style = (style == 'float' || style == 'cssFloat') ? 'styleFloat' : style.camelize(); var value = element.style[style]; if (!value && element.currentStyle) value = element.currentStyle[style]; if (style == 'opacity') { if (value = (element.getStyle('filter') || '').match(/alpha\(opacity=(.*)\)/)) if (value[1]) return parseFloat(value[1]) / 100; return 1.0; } if (value == 'auto') { if ((style == 'width' || style == 'height') && (element.getStyle('display') != 'none')) return element['offset' + style.capitalize()] + 'px'; return null; } return value; }; Element.Methods.setOpacity = function(element, value) { function stripAlpha(filter){ return filter.replace(/alpha\([^\)]*\)/gi,''); } element = $(element); var currentStyle = element.currentStyle; if ((currentStyle && !currentStyle.hasLayout) || (!currentStyle && element.style.zoom == 'normal')) element.style.zoom = 1; var filter = element.getStyle('filter'), style = element.style; if (value == 1 || value === '') { (filter = stripAlpha(filter)) ? style.filter = filter : style.removeAttribute('filter'); return element; } else if (value < 0.00001) value = 0; style.filter = stripAlpha(filter) + 'alpha(opacity=' + (value * 100) + ')'; return element; }; Element._attributeTranslations = (function(){ var classProp = 'className', forProp = 'for', el = document.createElement('div'); el.setAttribute(classProp, 'x'); if (el.className !== 'x') { el.setAttribute('class', 'x'); if (el.className === 'x') { classProp = 'class'; } } el = null; el = document.createElement('label'); el.setAttribute(forProp, 'x'); if (el.htmlFor !== 'x') { el.setAttribute('htmlFor', 'x'); if (el.htmlFor === 'x') { forProp = 'htmlFor'; } } el = null; return { read: { names: { 'class': classProp, 'className': classProp, 'for': forProp, 'htmlFor': forProp }, values: { _getAttr: function(element, attribute) { return element.getAttribute(attribute); }, _getAttr2: function(element, attribute) { return element.getAttribute(attribute, 2); }, _getAttrNode: function(element, attribute) { var node = element.getAttributeNode(attribute); return node ? node.value : ""; }, _getEv: (function(){ var el = document.createElement('div'), f; el.onclick = Prototype.emptyFunction; var value = el.getAttribute('onclick'); if (String(value).indexOf('{') > -1) { f = function(element, attribute) { attribute = element.getAttribute(attribute); if (!attribute) return null; attribute = attribute.toString(); attribute = attribute.split('{')[1]; attribute = attribute.split('}')[0]; return attribute.strip(); }; } else if (value === '') { f = function(element, attribute) { attribute = element.getAttribute(attribute); if (!attribute) return null; return attribute.strip(); }; } el = null; return f; })(), _flag: function(element, attribute) { return $(element).hasAttribute(attribute) ? attribute : null; }, style: function(element) { return element.style.cssText.toLowerCase(); }, title: function(element) { return element.title; } } } } })(); Element._attributeTranslations.write = { names: Object.extend({ cellpadding: 'cellPadding', cellspacing: 'cellSpacing' }, Element._attributeTranslations.read.names), values: { checked: function(element, value) { element.checked = !!value; }, style: function(element, value) { element.style.cssText = value ? value : ''; } } }; Element._attributeTranslations.has = {}; $w('colSpan rowSpan vAlign dateTime accessKey tabIndex ' + 'encType maxLength readOnly longDesc frameBorder').each(function(attr) { Element._attributeTranslations.write.names[attr.toLowerCase()] = attr; Element._attributeTranslations.has[attr.toLowerCase()] = attr; }); (function(v) { Object.extend(v, { href: v._getAttr2, src: v._getAttr2, type: v._getAttr, action: v._getAttrNode, disabled: v._flag, checked: v._flag, readonly: v._flag, multiple: v._flag, onload: v._getEv, onunload: v._getEv, onclick: v._getEv, ondblclick: v._getEv, onmousedown: v._getEv, onmouseup: v._getEv, onmouseover: v._getEv, onmousemove: v._getEv, onmouseout: v._getEv, onfocus: v._getEv, onblur: v._getEv, onkeypress: v._getEv, onkeydown: v._getEv, onkeyup: v._getEv, onsubmit: v._getEv, onreset: v._getEv, onselect: v._getEv, onchange: v._getEv }); })(Element._attributeTranslations.read.values); if (Prototype.BrowserFeatures.ElementExtensions) { (function() { function _descendants(element) { var nodes = element.getElementsByTagName('*'), results = []; for (var i = 0, node; node = nodes[i]; i++) if (node.tagName !== "!") // Filter out comment nodes. results.push(node); return results; } Element.Methods.down = function(element, expression, index) { element = $(element); if (arguments.length == 1) return element.firstDescendant(); return Object.isNumber(expression) ? _descendants(element)[expression] : Element.select(element, expression)[index || 0]; } })(); } } else if (Prototype.Browser.Gecko && /rv:1\.8\.0/.test(navigator.userAgent)) { Element.Methods.setOpacity = function(element, value) { element = $(element); element.style.opacity = (value == 1) ? 0.999999 : (value === '') ? '' : (value < 0.00001) ? 0 : value; return element; }; } else if (Prototype.Browser.WebKit) { Element.Methods.setOpacity = function(element, value) { element = $(element); element.style.opacity = (value == 1 || value === '') ? '' : (value < 0.00001) ? 0 : value; if (value == 1) if (element.tagName.toUpperCase() == 'IMG' && element.width) { element.width++; element.width--; } else try { var n = document.createTextNode(' '); element.appendChild(n); element.removeChild(n); } catch (e) { } return element; }; Element.Methods.cumulativeOffset = function(element) { var valueT = 0, valueL = 0; do { valueT += element.offsetTop || 0; valueL += element.offsetLeft || 0; if (element.offsetParent == document.body) if (Element.getStyle(element, 'position') == 'absolute') break; element = element.offsetParent; } while (element); return Element._returnOffset(valueL, valueT); }; } if ('outerHTML' in document.documentElement) { Element.Methods.replace = function(element, content) { element = $(element); if (content && content.toElement) content = content.toElement(); if (Object.isElement(content)) { element.parentNode.replaceChild(content, element); return element; } content = Object.toHTML(content); var parent = element.parentNode, tagName = parent.tagName.toUpperCase(); if (Element._insertionTranslations.tags[tagName]) { var nextSibling = element.next(), fragments = Element._getContentFromAnonymousElement(tagName, content.stripScripts()); parent.removeChild(element); if (nextSibling) fragments.each(function(node) { parent.insertBefore(node, nextSibling) }); else fragments.each(function(node) { parent.appendChild(node) }); } else element.outerHTML = content.stripScripts(); content.evalScripts.bind(content).defer(); return element; }; } Element._returnOffset = function(l, t) { var result = [l, t]; result.left = l; result.top = t; return result; }; Element._getContentFromAnonymousElement = function(tagName, html) { var div = new Element('div'), t = Element._insertionTranslations.tags[tagName]; if (t) { div.innerHTML = t[0] + html + t[1]; for (var i = t[2]; i--; ) { div = div.firstChild; } } else { div.innerHTML = html; } return $A(div.childNodes); }; Element._insertionTranslations = { before: function(element, node) { element.parentNode.insertBefore(node, element); }, top: function(element, node) { element.insertBefore(node, element.firstChild); }, bottom: function(element, node) { element.appendChild(node); }, after: function(element, node) { element.parentNode.insertBefore(node, element.nextSibling); }, tags: { TABLE: ['', '
    ', 1], TBODY: ['', '
    ', 2], TR: ['', '
    ', 3], TD: ['
    ', '
    ', 4], SELECT: ['', 1] } }; (function() { var tags = Element._insertionTranslations.tags; Object.extend(tags, { THEAD: tags.TBODY, TFOOT: tags.TBODY, TH: tags.TD }); })(); Element.Methods.Simulated = { hasAttribute: function(element, attribute) { attribute = Element._attributeTranslations.has[attribute] || attribute; var node = $(element).getAttributeNode(attribute); return !!(node && node.specified); } }; Element.Methods.ByTag = { }; Object.extend(Element, Element.Methods); (function(div) { if (!Prototype.BrowserFeatures.ElementExtensions && div['__proto__']) { window.HTMLElement = { }; window.HTMLElement.prototype = div['__proto__']; Prototype.BrowserFeatures.ElementExtensions = true; } div = null; })(document.createElement('div')); Element.extend = (function() { function checkDeficiency(tagName) { if (typeof window.Element != 'undefined') { var proto = window.Element.prototype; if (proto) { var id = '_' + (Math.random()+'').slice(2), el = document.createElement(tagName); proto[id] = 'x'; var isBuggy = (el[id] !== 'x'); delete proto[id]; el = null; return isBuggy; } } return false; } function extendElementWith(element, methods) { for (var property in methods) { var value = methods[property]; if (Object.isFunction(value) && !(property in element)) element[property] = value.methodize(); } } var HTMLOBJECTELEMENT_PROTOTYPE_BUGGY = checkDeficiency('object'); if (Prototype.BrowserFeatures.SpecificElementExtensions) { if (HTMLOBJECTELEMENT_PROTOTYPE_BUGGY) { return function(element) { if (element && typeof element._extendedByPrototype == 'undefined') { var t = element.tagName; if (t && (/^(?:object|applet|embed)$/i.test(t))) { extendElementWith(element, Element.Methods); extendElementWith(element, Element.Methods.Simulated); extendElementWith(element, Element.Methods.ByTag[t.toUpperCase()]); } } return element; } } return Prototype.K; } var Methods = { }, ByTag = Element.Methods.ByTag; var extend = Object.extend(function(element) { if (!element || typeof element._extendedByPrototype != 'undefined' || element.nodeType != 1 || element == window) return element; var methods = Object.clone(Methods), tagName = element.tagName.toUpperCase(); if (ByTag[tagName]) Object.extend(methods, ByTag[tagName]); extendElementWith(element, methods); element._extendedByPrototype = Prototype.emptyFunction; return element; }, { refresh: function() { if (!Prototype.BrowserFeatures.ElementExtensions) { Object.extend(Methods, Element.Methods); Object.extend(Methods, Element.Methods.Simulated); } } }); extend.refresh(); return extend; })(); if (document.documentElement.hasAttribute) { Element.hasAttribute = function(element, attribute) { return element.hasAttribute(attribute); }; } else { Element.hasAttribute = Element.Methods.Simulated.hasAttribute; } Element.addMethods = function(methods) { var F = Prototype.BrowserFeatures, T = Element.Methods.ByTag; if (!methods) { Object.extend(Form, Form.Methods); Object.extend(Form.Element, Form.Element.Methods); Object.extend(Element.Methods.ByTag, { "FORM": Object.clone(Form.Methods), "INPUT": Object.clone(Form.Element.Methods), "SELECT": Object.clone(Form.Element.Methods), "TEXTAREA": Object.clone(Form.Element.Methods) }); } if (arguments.length == 2) { var tagName = methods; methods = arguments[1]; } if (!tagName) Object.extend(Element.Methods, methods || { }); else { if (Object.isArray(tagName)) tagName.each(extend); else extend(tagName); } function extend(tagName) { tagName = tagName.toUpperCase(); if (!Element.Methods.ByTag[tagName]) Element.Methods.ByTag[tagName] = { }; Object.extend(Element.Methods.ByTag[tagName], methods); } function copy(methods, destination, onlyIfAbsent) { onlyIfAbsent = onlyIfAbsent || false; for (var property in methods) { var value = methods[property]; if (!Object.isFunction(value)) continue; if (!onlyIfAbsent || !(property in destination)) destination[property] = value.methodize(); } } function findDOMClass(tagName) { var klass; var trans = { "OPTGROUP": "OptGroup", "TEXTAREA": "TextArea", "P": "Paragraph", "FIELDSET": "FieldSet", "UL": "UList", "OL": "OList", "DL": "DList", "DIR": "Directory", "H1": "Heading", "H2": "Heading", "H3": "Heading", "H4": "Heading", "H5": "Heading", "H6": "Heading", "Q": "Quote", "INS": "Mod", "DEL": "Mod", "A": "Anchor", "IMG": "Image", "CAPTION": "TableCaption", "COL": "TableCol", "COLGROUP": "TableCol", "THEAD": "TableSection", "TFOOT": "TableSection", "TBODY": "TableSection", "TR": "TableRow", "TH": "TableCell", "TD": "TableCell", "FRAMESET": "FrameSet", "IFRAME": "IFrame" }; if (trans[tagName]) klass = 'HTML' + trans[tagName] + 'Element'; if (window[klass]) return window[klass]; klass = 'HTML' + tagName + 'Element'; if (window[klass]) return window[klass]; klass = 'HTML' + tagName.capitalize() + 'Element'; if (window[klass]) return window[klass]; var element = document.createElement(tagName), proto = element['__proto__'] || element.constructor.prototype; element = null; return proto; } var elementPrototype = window.HTMLElement ? HTMLElement.prototype : Element.prototype; if (F.ElementExtensions) { copy(Element.Methods, elementPrototype); copy(Element.Methods.Simulated, elementPrototype, true); } if (F.SpecificElementExtensions) { for (var tag in Element.Methods.ByTag) { var klass = findDOMClass(tag); if (Object.isUndefined(klass)) continue; copy(T[tag], klass.prototype); } } Object.extend(Element, Element.Methods); delete Element.ByTag; if (Element.extend.refresh) Element.extend.refresh(); Element.cache = { }; }; document.viewport = { getDimensions: function() { return { width: this.getWidth(), height: this.getHeight() }; }, getScrollOffsets: function() { return Element._returnOffset( window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft, window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop); } }; (function(viewport) { var B = Prototype.Browser, doc = document, element, property = {}; function getRootElement() { if (B.WebKit && !doc.evaluate) return document; if (B.Opera && window.parseFloat(window.opera.version()) < 9.5) return document.body; return document.documentElement; } function define(D) { if (!element) element = getRootElement(); property[D] = 'client' + D; viewport['get' + D] = function() { return element[property[D]] }; return viewport['get' + D](); } viewport.getWidth = define.curry('Width'); viewport.getHeight = define.curry('Height'); })(document.viewport); Element.Storage = { UID: 1 }; Element.addMethods({ getStorage: function(element) { if (!(element = $(element))) return; var uid; if (element === window) { uid = 0; } else { if (typeof element._prototypeUID === "undefined") element._prototypeUID = Element.Storage.UID++; uid = element._prototypeUID; } if (!Element.Storage[uid]) Element.Storage[uid] = $H(); return Element.Storage[uid]; }, store: function(element, key, value) { if (!(element = $(element))) return; if (arguments.length === 2) { Element.getStorage(element).update(key); } else { Element.getStorage(element).set(key, value); } return element; }, retrieve: function(element, key, defaultValue) { if (!(element = $(element))) return; var hash = Element.getStorage(element), value = hash.get(key); if (Object.isUndefined(value)) { hash.set(key, defaultValue); value = defaultValue; } return value; }, clone: function(element, deep) { if (!(element = $(element))) return; var clone = element.cloneNode(deep); clone._prototypeUID = void 0; if (deep) { var descendants = Element.select(clone, '*'), i = descendants.length; while (i--) { descendants[i]._prototypeUID = void 0; } } return Element.extend(clone); }, purge: function(element) { if (!(element = $(element))) return; purgeElement(element); var descendants = element.getElementsByTagName('*'), i = descendants.length; while (i--) purgeElement(descendants[i]); return null; } }); (function() { function toDecimal(pctString) { var match = pctString.match(/^(\d+)%?$/i); if (!match) return null; return (Number(match[1]) / 100); } function getPixelValue(value, property) { if (Object.isElement(value)) { element = value; value = element.getStyle(property); } if (value === null) { return null; } if ((/^(?:-)?\d+(\.\d+)?(px)?$/i).test(value)) { return window.parseFloat(value); } if (/\d/.test(value) && element.runtimeStyle) { var style = element.style.left, rStyle = element.runtimeStyle.left; element.runtimeStyle.left = element.currentStyle.left; element.style.left = value || 0; value = element.style.pixelLeft; element.style.left = style; element.runtimeStyle.left = rStyle; return value; } if (value.include('%')) { var decimal = toDecimal(value); var whole; if (property.include('left') || property.include('right') || property.include('width')) { whole = $(element.parentNode).measure('width'); } else if (property.include('top') || property.include('bottom') || property.include('height')) { whole = $(element.parentNode).measure('height'); } return whole * decimal; } return 0; } function toCSSPixels(number) { if (Object.isString(number) && number.endsWith('px')) { return number; } return number + 'px'; } function isDisplayed(element) { var originalElement = element; while (element && element.parentNode) { var display = element.getStyle('display'); if (display === 'none') { return false; } element = $(element.parentNode); } return true; } var hasLayout = Prototype.K; if ('currentStyle' in document.documentElement) { hasLayout = function(element) { if (!element.currentStyle.hasLayout) { element.style.zoom = 1; } return element; }; } function cssNameFor(key) { if (key.include('border')) key = key + '-width'; return key.camelize(); } Element.Layout = Class.create(Hash, { initialize: function($super, element, preCompute) { $super(); this.element = $(element); Element.Layout.PROPERTIES.each( function(property) { this._set(property, null); }, this); if (preCompute) { this._preComputing = true; this._begin(); Element.Layout.PROPERTIES.each( this._compute, this ); this._end(); this._preComputing = false; } }, _set: function(property, value) { return Hash.prototype.set.call(this, property, value); }, set: function(property, value) { throw "Properties of Element.Layout are read-only."; }, get: function($super, property) { var value = $super(property); return value === null ? this._compute(property) : value; }, _begin: function() { if (this._prepared) return; var element = this.element; if (isDisplayed(element)) { this._prepared = true; return; } var originalStyles = { position: element.style.position || '', width: element.style.width || '', visibility: element.style.visibility || '', display: element.style.display || '' }; element.store('prototype_original_styles', originalStyles); var position = element.getStyle('position'), width = element.getStyle('width'); element.setStyle({ position: 'absolute', visibility: 'hidden', display: 'block' }); var positionedWidth = element.getStyle('width'); var newWidth; if (width && (positionedWidth === width)) { newWidth = getPixelValue(width); } else if (width && (position === 'absolute' || position === 'fixed')) { newWidth = getPixelValue(width); } else { var parent = element.parentNode, pLayout = $(parent).getLayout(); newWidth = pLayout.get('width') - this.get('margin-left') - this.get('border-left') - this.get('padding-left') - this.get('padding-right') - this.get('border-right') - this.get('margin-right'); } element.setStyle({ width: newWidth + 'px' }); this._prepared = true; }, _end: function() { var element = this.element; var originalStyles = element.retrieve('prototype_original_styles'); element.store('prototype_original_styles', null); element.setStyle(originalStyles); this._prepared = false; }, _compute: function(property) { var COMPUTATIONS = Element.Layout.COMPUTATIONS; if (!(property in COMPUTATIONS)) { throw "Property not found."; } return this._set(property, COMPUTATIONS[property].call(this, this.element)); }, toObject: function() { var args = $A(arguments); var keys = (args.length === 0) ? Element.Layout.PROPERTIES : args.join(' ').split(' '); var obj = {}; keys.each( function(key) { if (!Element.Layout.PROPERTIES.include(key)) return; var value = this.get(key); if (value != null) obj[key] = value; }, this); return obj; }, toHash: function() { var obj = this.toObject.apply(this, arguments); return new Hash(obj); }, toCSS: function() { var args = $A(arguments); var keys = (args.length === 0) ? Element.Layout.PROPERTIES : args.join(' ').split(' '); var css = {}; keys.each( function(key) { if (!Element.Layout.PROPERTIES.include(key)) return; if (Element.Layout.COMPOSITE_PROPERTIES.include(key)) return; var value = this.get(key); if (value != null) css[cssNameFor(key)] = value + 'px'; }, this); return css; }, inspect: function() { return "#"; } }); Object.extend(Element.Layout, { PROPERTIES: $w('height width top left right bottom border-left border-right border-top border-bottom padding-left padding-right padding-top padding-bottom margin-top margin-bottom margin-left margin-right padding-box-width padding-box-height border-box-width border-box-height margin-box-width margin-box-height'), COMPOSITE_PROPERTIES: $w('padding-box-width padding-box-height margin-box-width margin-box-height border-box-width border-box-height'), COMPUTATIONS: { 'height': function(element) { if (!this._preComputing) this._begin(); var bHeight = this.get('border-box-height'); if (bHeight <= 0) return 0; var bTop = this.get('border-top'), bBottom = this.get('border-bottom'); var pTop = this.get('padding-top'), pBottom = this.get('padding-bottom'); if (!this._preComputing) this._end(); return bHeight - bTop - bBottom - pTop - pBottom; }, 'width': function(element) { if (!this._preComputing) this._begin(); var bWidth = this.get('border-box-width'); if (bWidth <= 0) return 0; var bLeft = this.get('border-left'), bRight = this.get('border-right'); var pLeft = this.get('padding-left'), pRight = this.get('padding-right'); if (!this._preComputing) this._end(); return bWidth - bLeft - bRight - pLeft - pRight; }, 'padding-box-height': function(element) { var height = this.get('height'), pTop = this.get('padding-top'), pBottom = this.get('padding-bottom'); return height + pTop + pBottom; }, 'padding-box-width': function(element) { var width = this.get('width'), pLeft = this.get('padding-left'), pRight = this.get('padding-right'); return width + pLeft + pRight; }, 'border-box-height': function(element) { return element.offsetHeight; }, 'border-box-width': function(element) { return element.offsetWidth; }, 'margin-box-height': function(element) { var bHeight = this.get('border-box-height'), mTop = this.get('margin-top'), mBottom = this.get('margin-bottom'); if (bHeight <= 0) return 0; return bHeight + mTop + mBottom; }, 'margin-box-width': function(element) { var bWidth = this.get('border-box-width'), mLeft = this.get('margin-left'), mRight = this.get('margin-right'); if (bWidth <= 0) return 0; return bWidth + mLeft + mRight; }, 'top': function(element) { var offset = element.positionedOffset(); return offset.top; }, 'bottom': function(element) { var offset = element.positionedOffset(), parent = element.getOffsetParent(), pHeight = parent.measure('height'); var mHeight = this.get('border-box-height'); return pHeight - mHeight - offset.top; }, 'left': function(element) { var offset = element.positionedOffset(); return offset.left; }, 'right': function(element) { var offset = element.positionedOffset(), parent = element.getOffsetParent(), pWidth = parent.measure('width'); var mWidth = this.get('border-box-width'); return pWidth - mWidth - offset.left; }, 'padding-top': function(element) { return getPixelValue(element, 'paddingTop'); }, 'padding-bottom': function(element) { return getPixelValue(element, 'paddingBottom'); }, 'padding-left': function(element) { return getPixelValue(element, 'paddingLeft'); }, 'padding-right': function(element) { return getPixelValue(element, 'paddingRight'); }, 'border-top': function(element) { return Object.isNumber(element.clientTop) ? element.clientTop : getPixelValue(element, 'borderTopWidth'); }, 'border-bottom': function(element) { return Object.isNumber(element.clientBottom) ? element.clientBottom : getPixelValue(element, 'borderBottomWidth'); }, 'border-left': function(element) { return Object.isNumber(element.clientLeft) ? element.clientLeft : getPixelValue(element, 'borderLeftWidth'); }, 'border-right': function(element) { return Object.isNumber(element.clientRight) ? element.clientRight : getPixelValue(element, 'borderRightWidth'); }, 'margin-top': function(element) { return getPixelValue(element, 'marginTop'); }, 'margin-bottom': function(element) { return getPixelValue(element, 'marginBottom'); }, 'margin-left': function(element) { return getPixelValue(element, 'marginLeft'); }, 'margin-right': function(element) { return getPixelValue(element, 'marginRight'); } } }); if ('getBoundingClientRect' in document.documentElement) { Object.extend(Element.Layout.COMPUTATIONS, { 'right': function(element) { var parent = hasLayout(element.getOffsetParent()); var rect = element.getBoundingClientRect(), pRect = parent.getBoundingClientRect(); return (pRect.right - rect.right).round(); }, 'bottom': function(element) { var parent = hasLayout(element.getOffsetParent()); var rect = element.getBoundingClientRect(), pRect = parent.getBoundingClientRect(); return (pRect.bottom - rect.bottom).round(); } }); } Element.Offset = Class.create({ initialize: function(left, top) { this.left = left.round(); this.top = top.round(); this[0] = this.left; this[1] = this.top; }, relativeTo: function(offset) { return new Element.Offset( this.left - offset.left, this.top - offset.top ); }, inspect: function() { return "#".interpolate(this); }, toString: function() { return "[#{left}, #{top}]".interpolate(this); }, toArray: function() { return [this.left, this.top]; } }); function getLayout(element, preCompute) { return new Element.Layout(element, preCompute); } function measure(element, property) { return $(element).getLayout().get(property); } function getDimensions(element) { var layout = $(element).getLayout(); return { width: layout.get('width'), height: layout.get('height') }; } function getOffsetParent(element) { if (isDetached(element)) return $(document.body); var isInline = (Element.getStyle(element, 'display') === 'inline'); if (!isInline && element.offsetParent) return $(element.offsetParent); if (element === document.body) return $(element); while ((element = element.parentNode) && element !== document.body) { if (Element.getStyle(element, 'position') !== 'static') { return (element.nodeName === 'HTML') ? $(document.body) : $(element); } } return $(document.body); } function cumulativeOffset(element) { var valueT = 0, valueL = 0; do { valueT += element.offsetTop || 0; valueL += element.offsetLeft || 0; element = element.offsetParent; } while (element); return new Element.Offset(valueL, valueT); } function positionedOffset(element) { var layout = element.getLayout(); var valueT = 0, valueL = 0; do { valueT += element.offsetTop || 0; valueL += element.offsetLeft || 0; element = element.offsetParent; if (element) { if (isBody(element)) break; var p = Element.getStyle(element, 'position'); if (p !== 'static') break; } } while (element); valueL -= layout.get('margin-top'); valueT -= layout.get('margin-left'); return new Element.Offset(valueL, valueT); } function cumulativeScrollOffset(element) { var valueT = 0, valueL = 0; do { valueT += element.scrollTop || 0; valueL += element.scrollLeft || 0; element = element.parentNode; } while (element); return new Element.Offset(valueL, valueT); } function viewportOffset(forElement) { var valueT = 0, valueL = 0, docBody = document.body; var element = forElement; do { valueT += element.offsetTop || 0; valueL += element.offsetLeft || 0; if (element.offsetParent == docBody && Element.getStyle(element, 'position') == 'absolute') break; } while (element = element.offsetParent); element = forElement; do { if (element != docBody) { valueT -= element.scrollTop || 0; valueL -= element.scrollLeft || 0; } } while (element = element.parentNode); return new Element.Offset(valueL, valueT); } function absolutize(element) { element = $(element); if (Element.getStyle(element, 'position') === 'absolute') { return element; } var offsetParent = getOffsetParent(element); var eOffset = element.viewportOffset(), pOffset = offsetParent.viewportOffset(); var offset = eOffset.relativeTo(pOffset); var layout = element.getLayout(); element.store('prototype_absolutize_original_styles', { left: element.getStyle('left'), top: element.getStyle('top'), width: element.getStyle('width'), height: element.getStyle('height') }); element.setStyle({ position: 'absolute', top: offset.top + 'px', left: offset.left + 'px', width: layout.get('width') + 'px', height: layout.get('height') + 'px' }); return element; } function relativize(element) { element = $(element); if (Element.getStyle(element, 'position') === 'relative') { return element; } var originalStyles = element.retrieve('prototype_absolutize_original_styles'); if (originalStyles) element.setStyle(originalStyles); return element; } Element.addMethods({ getLayout: getLayout, measure: measure, getDimensions: getDimensions, getOffsetParent: getOffsetParent, cumulativeOffset: cumulativeOffset, positionedOffset: positionedOffset, cumulativeScrollOffset: cumulativeScrollOffset, viewportOffset: viewportOffset, absolutize: absolutize, relativize: relativize }); function isBody(element) { return element.nodeName.toUpperCase() === 'BODY'; } function isDetached(element) { return element !== document.body && !Element.descendantOf(element, document.body); } if ('getBoundingClientRect' in document.documentElement) { Element.addMethods({ viewportOffset: function(element) { element = $(element); if (isDetached(element)) return new Element.Offset(0, 0); var rect = element.getBoundingClientRect(), docEl = document.documentElement; return new Element.Offset(rect.left - docEl.clientLeft, rect.top - docEl.clientTop); }, positionedOffset: function(element) { element = $(element); var parent = element.getOffsetParent(); if (isDetached(element)) return new Element.Offset(0, 0); if (element.offsetParent && element.offsetParent.nodeName.toUpperCase() === 'HTML') { return positionedOffset(element); } var eOffset = element.viewportOffset(), pOffset = isBody(parent) ? viewportOffset(parent) : parent.viewportOffset(); var retOffset = eOffset.relativeTo(pOffset); var layout = element.getLayout(); var top = retOffset.top - layout.get('margin-top'); var left = retOffset.left - layout.get('margin-left'); return new Element.Offset(left, top); } }); } })(); window.$$ = function() { var expression = $A(arguments).join(', '); return Prototype.Selector.select(expression, document); }; Prototype.Selector = (function() { function select() { throw new Error('Method "Prototype.Selector.select" must be defined.'); } function match() { throw new Error('Method "Prototype.Selector.match" must be defined.'); } function find(elements, expression, index) { index = index || 0; var match = Prototype.Selector.match, length = elements.length, matchIndex = 0, i; for (i = 0; i < length; i++) { if (match(elements[i], expression) && index == matchIndex++) { return Element.extend(elements[i]); } } } function extendElements(elements) { for (var i = 0, length = elements.length; i < length; i++) { Element.extend(elements[i]); } return elements; } var K = Prototype.K; return { select: select, match: match, find: find, extendElements: (Element.extend === K) ? K : extendElements, extendElement: Element.extend }; })(); Prototype._original_property = window.Sizzle; /*! * Sizzle CSS Selector Engine - v1.0 * Copyright 2009, The Dojo Foundation * Released under the MIT, BSD, and GPL Licenses. * More information: http://sizzlejs.com/ */ (function(){ var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, done = 0, toString = Object.prototype.toString, hasDuplicate = false, baseHasDuplicate = true; [0, 0].sort(function(){ baseHasDuplicate = false; return 0; }); var Sizzle = function(selector, context, results, seed) { results = results || []; var origContext = context = context || document; if ( context.nodeType !== 1 && context.nodeType !== 9 ) { return []; } if ( !selector || typeof selector !== "string" ) { return results; } var parts = [], m, set, checkSet, check, mode, extra, prune = true, contextXML = isXML(context), soFar = selector; while ( (chunker.exec(""), m = chunker.exec(soFar)) !== null ) { soFar = m[3]; parts.push( m[1] ); if ( m[2] ) { extra = m[3]; break; } } if ( parts.length > 1 && origPOS.exec( selector ) ) { if ( parts.length === 2 && Expr.relative[ parts[0] ] ) { set = posProcess( parts[0] + parts[1], context ); } else { set = Expr.relative[ parts[0] ] ? [ context ] : Sizzle( parts.shift(), context ); while ( parts.length ) { selector = parts.shift(); if ( Expr.relative[ selector ] ) selector += parts.shift(); set = posProcess( selector, set ); } } } else { if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML && Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) { var ret = Sizzle.find( parts.shift(), context, contextXML ); context = ret.expr ? Sizzle.filter( ret.expr, ret.set )[0] : ret.set[0]; } if ( context ) { var ret = seed ? { expr: parts.pop(), set: makeArray(seed) } : Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML ); set = ret.expr ? Sizzle.filter( ret.expr, ret.set ) : ret.set; if ( parts.length > 0 ) { checkSet = makeArray(set); } else { prune = false; } while ( parts.length ) { var cur = parts.pop(), pop = cur; if ( !Expr.relative[ cur ] ) { cur = ""; } else { pop = parts.pop(); } if ( pop == null ) { pop = context; } Expr.relative[ cur ]( checkSet, pop, contextXML ); } } else { checkSet = parts = []; } } if ( !checkSet ) { checkSet = set; } if ( !checkSet ) { throw "Syntax error, unrecognized expression: " + (cur || selector); } if ( toString.call(checkSet) === "[object Array]" ) { if ( !prune ) { results.push.apply( results, checkSet ); } else if ( context && context.nodeType === 1 ) { for ( var i = 0; checkSet[i] != null; i++ ) { if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && contains(context, checkSet[i])) ) { results.push( set[i] ); } } } else { for ( var i = 0; checkSet[i] != null; i++ ) { if ( checkSet[i] && checkSet[i].nodeType === 1 ) { results.push( set[i] ); } } } } else { makeArray( checkSet, results ); } if ( extra ) { Sizzle( extra, origContext, results, seed ); Sizzle.uniqueSort( results ); } return results; }; Sizzle.uniqueSort = function(results){ if ( sortOrder ) { hasDuplicate = baseHasDuplicate; results.sort(sortOrder); if ( hasDuplicate ) { for ( var i = 1; i < results.length; i++ ) { if ( results[i] === results[i-1] ) { results.splice(i--, 1); } } } } return results; }; Sizzle.matches = function(expr, set){ return Sizzle(expr, null, null, set); }; Sizzle.find = function(expr, context, isXML){ var set, match; if ( !expr ) { return []; } for ( var i = 0, l = Expr.order.length; i < l; i++ ) { var type = Expr.order[i], match; if ( (match = Expr.leftMatch[ type ].exec( expr )) ) { var left = match[1]; match.splice(1,1); if ( left.substr( left.length - 1 ) !== "\\" ) { match[1] = (match[1] || "").replace(/\\/g, ""); set = Expr.find[ type ]( match, context, isXML ); if ( set != null ) { expr = expr.replace( Expr.match[ type ], "" ); break; } } } } if ( !set ) { set = context.getElementsByTagName("*"); } return {set: set, expr: expr}; }; Sizzle.filter = function(expr, set, inplace, not){ var old = expr, result = [], curLoop = set, match, anyFound, isXMLFilter = set && set[0] && isXML(set[0]); while ( expr && set.length ) { for ( var type in Expr.filter ) { if ( (match = Expr.match[ type ].exec( expr )) != null ) { var filter = Expr.filter[ type ], found, item; anyFound = false; if ( curLoop == result ) { result = []; } if ( Expr.preFilter[ type ] ) { match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter ); if ( !match ) { anyFound = found = true; } else if ( match === true ) { continue; } } if ( match ) { for ( var i = 0; (item = curLoop[i]) != null; i++ ) { if ( item ) { found = filter( item, match, i, curLoop ); var pass = not ^ !!found; if ( inplace && found != null ) { if ( pass ) { anyFound = true; } else { curLoop[i] = false; } } else if ( pass ) { result.push( item ); anyFound = true; } } } } if ( found !== undefined ) { if ( !inplace ) { curLoop = result; } expr = expr.replace( Expr.match[ type ], "" ); if ( !anyFound ) { return []; } break; } } } if ( expr == old ) { if ( anyFound == null ) { throw "Syntax error, unrecognized expression: " + expr; } else { break; } } old = expr; } return curLoop; }; var Expr = Sizzle.selectors = { order: [ "ID", "NAME", "TAG" ], match: { ID: /#((?:[\w\u00c0-\uFFFF-]|\\.)+)/, CLASS: /\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/, NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/, ATTR: /\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/, TAG: /^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/, CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/, POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/, PSEUDO: /:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/ }, leftMatch: {}, attrMap: { "class": "className", "for": "htmlFor" }, attrHandle: { href: function(elem){ return elem.getAttribute("href"); } }, relative: { "+": function(checkSet, part, isXML){ var isPartStr = typeof part === "string", isTag = isPartStr && !/\W/.test(part), isPartStrNotTag = isPartStr && !isTag; if ( isTag && !isXML ) { part = part.toUpperCase(); } for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) { if ( (elem = checkSet[i]) ) { while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {} checkSet[i] = isPartStrNotTag || elem && elem.nodeName === part ? elem || false : elem === part; } } if ( isPartStrNotTag ) { Sizzle.filter( part, checkSet, true ); } }, ">": function(checkSet, part, isXML){ var isPartStr = typeof part === "string"; if ( isPartStr && !/\W/.test(part) ) { part = isXML ? part : part.toUpperCase(); for ( var i = 0, l = checkSet.length; i < l; i++ ) { var elem = checkSet[i]; if ( elem ) { var parent = elem.parentNode; checkSet[i] = parent.nodeName === part ? parent : false; } } } else { for ( var i = 0, l = checkSet.length; i < l; i++ ) { var elem = checkSet[i]; if ( elem ) { checkSet[i] = isPartStr ? elem.parentNode : elem.parentNode === part; } } if ( isPartStr ) { Sizzle.filter( part, checkSet, true ); } } }, "": function(checkSet, part, isXML){ var doneName = done++, checkFn = dirCheck; if ( !/\W/.test(part) ) { var nodeCheck = part = isXML ? part : part.toUpperCase(); checkFn = dirNodeCheck; } checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML); }, "~": function(checkSet, part, isXML){ var doneName = done++, checkFn = dirCheck; if ( typeof part === "string" && !/\W/.test(part) ) { var nodeCheck = part = isXML ? part : part.toUpperCase(); checkFn = dirNodeCheck; } checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML); } }, find: { ID: function(match, context, isXML){ if ( typeof context.getElementById !== "undefined" && !isXML ) { var m = context.getElementById(match[1]); return m ? [m] : []; } }, NAME: function(match, context, isXML){ if ( typeof context.getElementsByName !== "undefined" ) { var ret = [], results = context.getElementsByName(match[1]); for ( var i = 0, l = results.length; i < l; i++ ) { if ( results[i].getAttribute("name") === match[1] ) { ret.push( results[i] ); } } return ret.length === 0 ? null : ret; } }, TAG: function(match, context){ return context.getElementsByTagName(match[1]); } }, preFilter: { CLASS: function(match, curLoop, inplace, result, not, isXML){ match = " " + match[1].replace(/\\/g, "") + " "; if ( isXML ) { return match; } for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) { if ( elem ) { if ( not ^ (elem.className && (" " + elem.className + " ").indexOf(match) >= 0) ) { if ( !inplace ) result.push( elem ); } else if ( inplace ) { curLoop[i] = false; } } } return false; }, ID: function(match){ return match[1].replace(/\\/g, ""); }, TAG: function(match, curLoop){ for ( var i = 0; curLoop[i] === false; i++ ){} return curLoop[i] && isXML(curLoop[i]) ? match[1] : match[1].toUpperCase(); }, CHILD: function(match){ if ( match[1] == "nth" ) { var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec( match[2] == "even" && "2n" || match[2] == "odd" && "2n+1" || !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]); match[2] = (test[1] + (test[2] || 1)) - 0; match[3] = test[3] - 0; } match[0] = done++; return match; }, ATTR: function(match, curLoop, inplace, result, not, isXML){ var name = match[1].replace(/\\/g, ""); if ( !isXML && Expr.attrMap[name] ) { match[1] = Expr.attrMap[name]; } if ( match[2] === "~=" ) { match[4] = " " + match[4] + " "; } return match; }, PSEUDO: function(match, curLoop, inplace, result, not){ if ( match[1] === "not" ) { if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) { match[3] = Sizzle(match[3], null, null, curLoop); } else { var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not); if ( !inplace ) { result.push.apply( result, ret ); } return false; } } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) { return true; } return match; }, POS: function(match){ match.unshift( true ); return match; } }, filters: { enabled: function(elem){ return elem.disabled === false && elem.type !== "hidden"; }, disabled: function(elem){ return elem.disabled === true; }, checked: function(elem){ return elem.checked === true; }, selected: function(elem){ elem.parentNode.selectedIndex; return elem.selected === true; }, parent: function(elem){ return !!elem.firstChild; }, empty: function(elem){ return !elem.firstChild; }, has: function(elem, i, match){ return !!Sizzle( match[3], elem ).length; }, header: function(elem){ return /h\d/i.test( elem.nodeName ); }, text: function(elem){ return "text" === elem.type; }, radio: function(elem){ return "radio" === elem.type; }, checkbox: function(elem){ return "checkbox" === elem.type; }, file: function(elem){ return "file" === elem.type; }, password: function(elem){ return "password" === elem.type; }, submit: function(elem){ return "submit" === elem.type; }, image: function(elem){ return "image" === elem.type; }, reset: function(elem){ return "reset" === elem.type; }, button: function(elem){ return "button" === elem.type || elem.nodeName.toUpperCase() === "BUTTON"; }, input: function(elem){ return /input|select|textarea|button/i.test(elem.nodeName); } }, setFilters: { first: function(elem, i){ return i === 0; }, last: function(elem, i, match, array){ return i === array.length - 1; }, even: function(elem, i){ return i % 2 === 0; }, odd: function(elem, i){ return i % 2 === 1; }, lt: function(elem, i, match){ return i < match[3] - 0; }, gt: function(elem, i, match){ return i > match[3] - 0; }, nth: function(elem, i, match){ return match[3] - 0 == i; }, eq: function(elem, i, match){ return match[3] - 0 == i; } }, filter: { PSEUDO: function(elem, match, i, array){ var name = match[1], filter = Expr.filters[ name ]; if ( filter ) { return filter( elem, i, match, array ); } else if ( name === "contains" ) { return (elem.textContent || elem.innerText || "").indexOf(match[3]) >= 0; } else if ( name === "not" ) { var not = match[3]; for ( var i = 0, l = not.length; i < l; i++ ) { if ( not[i] === elem ) { return false; } } return true; } }, CHILD: function(elem, match){ var type = match[1], node = elem; switch (type) { case 'only': case 'first': while ( (node = node.previousSibling) ) { if ( node.nodeType === 1 ) return false; } if ( type == 'first') return true; node = elem; case 'last': while ( (node = node.nextSibling) ) { if ( node.nodeType === 1 ) return false; } return true; case 'nth': var first = match[2], last = match[3]; if ( first == 1 && last == 0 ) { return true; } var doneName = match[0], parent = elem.parentNode; if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) { var count = 0; for ( node = parent.firstChild; node; node = node.nextSibling ) { if ( node.nodeType === 1 ) { node.nodeIndex = ++count; } } parent.sizcache = doneName; } var diff = elem.nodeIndex - last; if ( first == 0 ) { return diff == 0; } else { return ( diff % first == 0 && diff / first >= 0 ); } } }, ID: function(elem, match){ return elem.nodeType === 1 && elem.getAttribute("id") === match; }, TAG: function(elem, match){ return (match === "*" && elem.nodeType === 1) || elem.nodeName === match; }, CLASS: function(elem, match){ return (" " + (elem.className || elem.getAttribute("class")) + " ") .indexOf( match ) > -1; }, ATTR: function(elem, match){ var name = match[1], result = Expr.attrHandle[ name ] ? Expr.attrHandle[ name ]( elem ) : elem[ name ] != null ? elem[ name ] : elem.getAttribute( name ), value = result + "", type = match[2], check = match[4]; return result == null ? type === "!=" : type === "=" ? value === check : type === "*=" ? value.indexOf(check) >= 0 : type === "~=" ? (" " + value + " ").indexOf(check) >= 0 : !check ? value && result !== false : type === "!=" ? value != check : type === "^=" ? value.indexOf(check) === 0 : type === "$=" ? value.substr(value.length - check.length) === check : type === "|=" ? value === check || value.substr(0, check.length + 1) === check + "-" : false; }, POS: function(elem, match, i, array){ var name = match[2], filter = Expr.setFilters[ name ]; if ( filter ) { return filter( elem, i, match, array ); } } } }; var origPOS = Expr.match.POS; for ( var type in Expr.match ) { Expr.match[ type ] = new RegExp( Expr.match[ type ].source + /(?![^\[]*\])(?![^\(]*\))/.source ); Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source ); } var makeArray = function(array, results) { array = Array.prototype.slice.call( array, 0 ); if ( results ) { results.push.apply( results, array ); return results; } return array; }; try { Array.prototype.slice.call( document.documentElement.childNodes, 0 ); } catch(e){ makeArray = function(array, results) { var ret = results || []; if ( toString.call(array) === "[object Array]" ) { Array.prototype.push.apply( ret, array ); } else { if ( typeof array.length === "number" ) { for ( var i = 0, l = array.length; i < l; i++ ) { ret.push( array[i] ); } } else { for ( var i = 0; array[i]; i++ ) { ret.push( array[i] ); } } } return ret; }; } var sortOrder; if ( document.documentElement.compareDocumentPosition ) { sortOrder = function( a, b ) { if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) { if ( a == b ) { hasDuplicate = true; } return 0; } var ret = a.compareDocumentPosition(b) & 4 ? -1 : a === b ? 0 : 1; if ( ret === 0 ) { hasDuplicate = true; } return ret; }; } else if ( "sourceIndex" in document.documentElement ) { sortOrder = function( a, b ) { if ( !a.sourceIndex || !b.sourceIndex ) { if ( a == b ) { hasDuplicate = true; } return 0; } var ret = a.sourceIndex - b.sourceIndex; if ( ret === 0 ) { hasDuplicate = true; } return ret; }; } else if ( document.createRange ) { sortOrder = function( a, b ) { if ( !a.ownerDocument || !b.ownerDocument ) { if ( a == b ) { hasDuplicate = true; } return 0; } var aRange = a.ownerDocument.createRange(), bRange = b.ownerDocument.createRange(); aRange.setStart(a, 0); aRange.setEnd(a, 0); bRange.setStart(b, 0); bRange.setEnd(b, 0); var ret = aRange.compareBoundaryPoints(Range.START_TO_END, bRange); if ( ret === 0 ) { hasDuplicate = true; } return ret; }; } (function(){ var form = document.createElement("div"), id = "script" + (new Date).getTime(); form.innerHTML = ""; var root = document.documentElement; root.insertBefore( form, root.firstChild ); if ( !!document.getElementById( id ) ) { Expr.find.ID = function(match, context, isXML){ if ( typeof context.getElementById !== "undefined" && !isXML ) { var m = context.getElementById(match[1]); return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : []; } }; Expr.filter.ID = function(elem, match){ var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); return elem.nodeType === 1 && node && node.nodeValue === match; }; } root.removeChild( form ); root = form = null; // release memory in IE })(); (function(){ var div = document.createElement("div"); div.appendChild( document.createComment("") ); if ( div.getElementsByTagName("*").length > 0 ) { Expr.find.TAG = function(match, context){ var results = context.getElementsByTagName(match[1]); if ( match[1] === "*" ) { var tmp = []; for ( var i = 0; results[i]; i++ ) { if ( results[i].nodeType === 1 ) { tmp.push( results[i] ); } } results = tmp; } return results; }; } div.innerHTML = ""; if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" && div.firstChild.getAttribute("href") !== "#" ) { Expr.attrHandle.href = function(elem){ return elem.getAttribute("href", 2); }; } div = null; // release memory in IE })(); if ( document.querySelectorAll ) (function(){ var oldSizzle = Sizzle, div = document.createElement("div"); div.innerHTML = "

    "; if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) { return; } Sizzle = function(query, context, extra, seed){ context = context || document; if ( !seed && context.nodeType === 9 && !isXML(context) ) { try { return makeArray( context.querySelectorAll(query), extra ); } catch(e){} } return oldSizzle(query, context, extra, seed); }; for ( var prop in oldSizzle ) { Sizzle[ prop ] = oldSizzle[ prop ]; } div = null; // release memory in IE })(); if ( document.getElementsByClassName && document.documentElement.getElementsByClassName ) (function(){ var div = document.createElement("div"); div.innerHTML = "
    "; if ( div.getElementsByClassName("e").length === 0 ) return; div.lastChild.className = "e"; if ( div.getElementsByClassName("e").length === 1 ) return; Expr.order.splice(1, 0, "CLASS"); Expr.find.CLASS = function(match, context, isXML) { if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) { return context.getElementsByClassName(match[1]); } }; div = null; // release memory in IE })(); function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { var sibDir = dir == "previousSibling" && !isXML; for ( var i = 0, l = checkSet.length; i < l; i++ ) { var elem = checkSet[i]; if ( elem ) { if ( sibDir && elem.nodeType === 1 ){ elem.sizcache = doneName; elem.sizset = i; } elem = elem[dir]; var match = false; while ( elem ) { if ( elem.sizcache === doneName ) { match = checkSet[elem.sizset]; break; } if ( elem.nodeType === 1 && !isXML ){ elem.sizcache = doneName; elem.sizset = i; } if ( elem.nodeName === cur ) { match = elem; break; } elem = elem[dir]; } checkSet[i] = match; } } } function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { var sibDir = dir == "previousSibling" && !isXML; for ( var i = 0, l = checkSet.length; i < l; i++ ) { var elem = checkSet[i]; if ( elem ) { if ( sibDir && elem.nodeType === 1 ) { elem.sizcache = doneName; elem.sizset = i; } elem = elem[dir]; var match = false; while ( elem ) { if ( elem.sizcache === doneName ) { match = checkSet[elem.sizset]; break; } if ( elem.nodeType === 1 ) { if ( !isXML ) { elem.sizcache = doneName; elem.sizset = i; } if ( typeof cur !== "string" ) { if ( elem === cur ) { match = true; break; } } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) { match = elem; break; } } elem = elem[dir]; } checkSet[i] = match; } } } var contains = document.compareDocumentPosition ? function(a, b){ return a.compareDocumentPosition(b) & 16; } : function(a, b){ return a !== b && (a.contains ? a.contains(b) : true); }; var isXML = function(elem){ return elem.nodeType === 9 && elem.documentElement.nodeName !== "HTML" || !!elem.ownerDocument && elem.ownerDocument.documentElement.nodeName !== "HTML"; }; var posProcess = function(selector, context){ var tmpSet = [], later = "", match, root = context.nodeType ? [context] : context; while ( (match = Expr.match.PSEUDO.exec( selector )) ) { later += match[0]; selector = selector.replace( Expr.match.PSEUDO, "" ); } selector = Expr.relative[selector] ? selector + "*" : selector; for ( var i = 0, l = root.length; i < l; i++ ) { Sizzle( selector, root[i], tmpSet ); } return Sizzle.filter( later, tmpSet ); }; window.Sizzle = Sizzle; })(); ;(function(engine) { var extendElements = Prototype.Selector.extendElements; function select(selector, scope) { return extendElements(engine(selector, scope || document)); } function match(element, selector) { return engine.matches(selector, [element]).length == 1; } Prototype.Selector.engine = engine; Prototype.Selector.select = select; Prototype.Selector.match = match; })(Sizzle); window.Sizzle = Prototype._original_property; delete Prototype._original_property; var Form = { reset: function(form) { form = $(form); form.reset(); return form; }, serializeElements: function(elements, options) { if (typeof options != 'object') options = { hash: !!options }; else if (Object.isUndefined(options.hash)) options.hash = true; var key, value, submitted = false, submit = options.submit; var data = elements.inject({ }, function(result, element) { if (!element.disabled && element.name) { key = element.name; value = $(element).getValue(); if (value != null && element.type != 'file' && (element.type != 'submit' || (!submitted && submit !== false && (!submit || key == submit) && (submitted = true)))) { if (key in result) { if (!Object.isArray(result[key])) result[key] = [result[key]]; result[key].push(value); } else result[key] = value; } } return result; }); return options.hash ? data : Object.toQueryString(data); } }; Form.Methods = { serialize: function(form, options) { return Form.serializeElements(Form.getElements(form), options); }, getElements: function(form) { var elements = $(form).getElementsByTagName('*'), element, arr = [ ], serializers = Form.Element.Serializers; for (var i = 0; element = elements[i]; i++) { arr.push(element); } return arr.inject([], function(elements, child) { if (serializers[child.tagName.toLowerCase()]) elements.push(Element.extend(child)); return elements; }) }, getInputs: function(form, typeName, name) { form = $(form); var inputs = form.getElementsByTagName('input'); if (!typeName && !name) return $A(inputs).map(Element.extend); for (var i = 0, matchingInputs = [], length = inputs.length; i < length; i++) { var input = inputs[i]; if ((typeName && input.type != typeName) || (name && input.name != name)) continue; matchingInputs.push(Element.extend(input)); } return matchingInputs; }, disable: function(form) { form = $(form); Form.getElements(form).invoke('disable'); return form; }, enable: function(form) { form = $(form); Form.getElements(form).invoke('enable'); return form; }, findFirstElement: function(form) { var elements = $(form).getElements().findAll(function(element) { return 'hidden' != element.type && !element.disabled; }); var firstByIndex = elements.findAll(function(element) { return element.hasAttribute('tabIndex') && element.tabIndex >= 0; }).sortBy(function(element) { return element.tabIndex }).first(); return firstByIndex ? firstByIndex : elements.find(function(element) { return /^(?:input|select|textarea)$/i.test(element.tagName); }); }, focusFirstElement: function(form) { form = $(form); form.findFirstElement().activate(); return form; }, request: function(form, options) { form = $(form), options = Object.clone(options || { }); var params = options.parameters, action = form.readAttribute('action') || ''; if (action.blank()) action = window.location.href; options.parameters = form.serialize(true); if (params) { if (Object.isString(params)) params = params.toQueryParams(); Object.extend(options.parameters, params); } if (form.hasAttribute('method') && !options.method) options.method = form.method; return new Ajax.Request(action, options); } }; /*--------------------------------------------------------------------------*/ Form.Element = { focus: function(element) { $(element).focus(); return element; }, select: function(element) { $(element).select(); return element; } }; Form.Element.Methods = { serialize: function(element) { element = $(element); if (!element.disabled && element.name) { var value = element.getValue(); if (value != undefined) { var pair = { }; pair[element.name] = value; return Object.toQueryString(pair); } } return ''; }, getValue: function(element) { element = $(element); var method = element.tagName.toLowerCase(); return Form.Element.Serializers[method](element); }, setValue: function(element, value) { element = $(element); var method = element.tagName.toLowerCase(); Form.Element.Serializers[method](element, value); return element; }, clear: function(element) { $(element).value = ''; return element; }, present: function(element) { return $(element).value != ''; }, activate: function(element) { element = $(element); try { element.focus(); if (element.select && (element.tagName.toLowerCase() != 'input' || !(/^(?:button|reset|submit)$/i.test(element.type)))) element.select(); } catch (e) { } return element; }, disable: function(element) { element = $(element); element.disabled = true; return element; }, enable: function(element) { element = $(element); element.disabled = false; return element; } }; /*--------------------------------------------------------------------------*/ var Field = Form.Element; var $F = Form.Element.Methods.getValue; /*--------------------------------------------------------------------------*/ Form.Element.Serializers = { input: function(element, value) { switch (element.type.toLowerCase()) { case 'checkbox': case 'radio': return Form.Element.Serializers.inputSelector(element, value); default: return Form.Element.Serializers.textarea(element, value); } }, inputSelector: function(element, value) { if (Object.isUndefined(value)) return element.checked ? element.value : null; else element.checked = !!value; }, textarea: function(element, value) { if (Object.isUndefined(value)) return element.value; else element.value = value; }, select: function(element, value) { if (Object.isUndefined(value)) return this[element.type == 'select-one' ? 'selectOne' : 'selectMany'](element); else { var opt, currentValue, single = !Object.isArray(value); for (var i = 0, length = element.length; i < length; i++) { opt = element.options[i]; currentValue = this.optionValue(opt); if (single) { if (currentValue == value) { opt.selected = true; return; } } else opt.selected = value.include(currentValue); } } }, selectOne: function(element) { var index = element.selectedIndex; return index >= 0 ? this.optionValue(element.options[index]) : null; }, selectMany: function(element) { var values, length = element.length; if (!length) return null; for (var i = 0, values = []; i < length; i++) { var opt = element.options[i]; if (opt.selected) values.push(this.optionValue(opt)); } return values; }, optionValue: function(opt) { return Element.extend(opt).hasAttribute('value') ? opt.value : opt.text; } }; /*--------------------------------------------------------------------------*/ Abstract.TimedObserver = Class.create(PeriodicalExecuter, { initialize: function($super, element, frequency, callback) { $super(callback, frequency); this.element = $(element); this.lastValue = this.getValue(); }, execute: function() { var value = this.getValue(); if (Object.isString(this.lastValue) && Object.isString(value) ? this.lastValue != value : String(this.lastValue) != String(value)) { this.callback(this.element, value); this.lastValue = value; } } }); Form.Element.Observer = Class.create(Abstract.TimedObserver, { getValue: function() { return Form.Element.getValue(this.element); } }); Form.Observer = Class.create(Abstract.TimedObserver, { getValue: function() { return Form.serialize(this.element); } }); /*--------------------------------------------------------------------------*/ Abstract.EventObserver = Class.create({ initialize: function(element, callback) { this.element = $(element); this.callback = callback; this.lastValue = this.getValue(); if (this.element.tagName.toLowerCase() == 'form') this.registerFormCallbacks(); else this.registerCallback(this.element); }, onElementEvent: function() { var value = this.getValue(); if (this.lastValue != value) { this.callback(this.element, value); this.lastValue = value; } }, registerFormCallbacks: function() { Form.getElements(this.element).each(this.registerCallback, this); }, registerCallback: function(element) { if (element.type) { switch (element.type.toLowerCase()) { case 'checkbox': case 'radio': Event.observe(element, 'click', this.onElementEvent.bind(this)); break; default: Event.observe(element, 'change', this.onElementEvent.bind(this)); break; } } } }); Form.Element.EventObserver = Class.create(Abstract.EventObserver, { getValue: function() { return Form.Element.getValue(this.element); } }); Form.EventObserver = Class.create(Abstract.EventObserver, { getValue: function() { return Form.serialize(this.element); } }); (function() { var Event = { KEY_BACKSPACE: 8, KEY_TAB: 9, KEY_RETURN: 13, KEY_ESC: 27, KEY_LEFT: 37, KEY_UP: 38, KEY_RIGHT: 39, KEY_DOWN: 40, KEY_DELETE: 46, KEY_HOME: 36, KEY_END: 35, KEY_PAGEUP: 33, KEY_PAGEDOWN: 34, KEY_INSERT: 45, cache: {} }; var docEl = document.documentElement; var MOUSEENTER_MOUSELEAVE_EVENTS_SUPPORTED = 'onmouseenter' in docEl && 'onmouseleave' in docEl; var _isButton; if (Prototype.Browser.IE) { var buttonMap = { 0: 1, 1: 4, 2: 2 }; _isButton = function(event, code) { return event.button === buttonMap[code]; }; } else if (Prototype.Browser.WebKit) { _isButton = function(event, code) { switch (code) { case 0: return event.which == 1 && !event.metaKey; case 1: return event.which == 1 && event.metaKey; default: return false; } }; } else { _isButton = function(event, code) { return event.which ? (event.which === code + 1) : (event.button === code); }; } function isLeftClick(event) { return _isButton(event, 0) } function isMiddleClick(event) { return _isButton(event, 1) } function isRightClick(event) { return _isButton(event, 2) } function element(event) { event = Event.extend(event); var node = event.target, type = event.type, currentTarget = event.currentTarget; if (currentTarget && currentTarget.tagName) { if (type === 'load' || type === 'error' || (type === 'click' && currentTarget.tagName.toLowerCase() === 'input' && currentTarget.type === 'radio')) node = currentTarget; } if (node.nodeType == Node.TEXT_NODE) node = node.parentNode; return Element.extend(node); } function findElement(event, expression) { var element = Event.element(event); if (!expression) return element; while (element) { if (Object.isElement(element) && Prototype.Selector.match(element, expression)) { return Element.extend(element); } element = element.parentNode; } } function pointer(event) { return { x: pointerX(event), y: pointerY(event) }; } function pointerX(event) { var docElement = document.documentElement, body = document.body || { scrollLeft: 0 }; return event.pageX || (event.clientX + (docElement.scrollLeft || body.scrollLeft) - (docElement.clientLeft || 0)); } function pointerY(event) { var docElement = document.documentElement, body = document.body || { scrollTop: 0 }; return event.pageY || (event.clientY + (docElement.scrollTop || body.scrollTop) - (docElement.clientTop || 0)); } function stop(event) { Event.extend(event); event.preventDefault(); event.stopPropagation(); event.stopped = true; } Event.Methods = { isLeftClick: isLeftClick, isMiddleClick: isMiddleClick, isRightClick: isRightClick, element: element, findElement: findElement, pointer: pointer, pointerX: pointerX, pointerY: pointerY, stop: stop }; var methods = Object.keys(Event.Methods).inject({ }, function(m, name) { m[name] = Event.Methods[name].methodize(); return m; }); if (Prototype.Browser.IE) { function _relatedTarget(event) { var element; switch (event.type) { case 'mouseover': element = event.fromElement; break; case 'mouseout': element = event.toElement; break; default: return null; } return Element.extend(element); } Object.extend(methods, { stopPropagation: function() { this.cancelBubble = true }, preventDefault: function() { this.returnValue = false }, inspect: function() { return '[object Event]' } }); Event.extend = function(event, element) { if (!event) return false; if (event._extendedByPrototype) return event; event._extendedByPrototype = Prototype.emptyFunction; var pointer = Event.pointer(event); Object.extend(event, { target: event.srcElement || element, relatedTarget: _relatedTarget(event), pageX: pointer.x, pageY: pointer.y }); return Object.extend(event, methods); }; } else { Event.prototype = window.Event.prototype || document.createEvent('HTMLEvents').__proto__; Object.extend(Event.prototype, methods); Event.extend = Prototype.K; } function _createResponder(element, eventName, handler) { var registry = Element.retrieve(element, 'prototype_event_registry'); if (Object.isUndefined(registry)) { CACHE.push(element); registry = Element.retrieve(element, 'prototype_event_registry', $H()); } var respondersForEvent = registry.get(eventName); if (Object.isUndefined(respondersForEvent)) { respondersForEvent = []; registry.set(eventName, respondersForEvent); } if (respondersForEvent.pluck('handler').include(handler)) return false; var responder; if (eventName.include(":")) { responder = function(event) { if (Object.isUndefined(event.eventName)) return false; if (event.eventName !== eventName) return false; Event.extend(event, element); handler.call(element, event); }; } else { if (!MOUSEENTER_MOUSELEAVE_EVENTS_SUPPORTED && (eventName === "mouseenter" || eventName === "mouseleave")) { if (eventName === "mouseenter" || eventName === "mouseleave") { responder = function(event) { Event.extend(event, element); var parent = event.relatedTarget; while (parent && parent !== element) { try { parent = parent.parentNode; } catch(e) { parent = element; } } if (parent === element) return; handler.call(element, event); }; } } else { responder = function(event) { Event.extend(event, element); handler.call(element, event); }; } } responder.handler = handler; respondersForEvent.push(responder); return responder; } function _destroyCache() { for (var i = 0, length = CACHE.length; i < length; i++) { Event.stopObserving(CACHE[i]); CACHE[i] = null; } } var CACHE = []; if (Prototype.Browser.IE) window.attachEvent('onunload', _destroyCache); if (Prototype.Browser.WebKit) window.addEventListener('unload', Prototype.emptyFunction, false); var _getDOMEventName = Prototype.K, translations = { mouseenter: "mouseover", mouseleave: "mouseout" }; if (!MOUSEENTER_MOUSELEAVE_EVENTS_SUPPORTED) { _getDOMEventName = function(eventName) { return (translations[eventName] || eventName); }; } function observe(element, eventName, handler) { element = $(element); var responder = _createResponder(element, eventName, handler); if (!responder) return element; if (eventName.include(':')) { if (element.addEventListener) element.addEventListener("dataavailable", responder, false); else { element.attachEvent("ondataavailable", responder); element.attachEvent("onfilterchange", responder); } } else { var actualEventName = _getDOMEventName(eventName); if (element.addEventListener) element.addEventListener(actualEventName, responder, false); else element.attachEvent("on" + actualEventName, responder); } return element; } function stopObserving(element, eventName, handler) { element = $(element); var registry = Element.retrieve(element, 'prototype_event_registry'); if (!registry) return element; if (!eventName) { registry.each( function(pair) { var eventName = pair.key; stopObserving(element, eventName); }); return element; } var responders = registry.get(eventName); if (!responders) return element; if (!handler) { responders.each(function(r) { stopObserving(element, eventName, r.handler); }); return element; } var responder = responders.find( function(r) { return r.handler === handler; }); if (!responder) return element; if (eventName.include(':')) { if (element.removeEventListener) element.removeEventListener("dataavailable", responder, false); else { element.detachEvent("ondataavailable", responder); element.detachEvent("onfilterchange", responder); } } else { var actualEventName = _getDOMEventName(eventName); if (element.removeEventListener) element.removeEventListener(actualEventName, responder, false); else element.detachEvent('on' + actualEventName, responder); } registry.set(eventName, responders.without(responder)); return element; } function fire(element, eventName, memo, bubble) { element = $(element); if (Object.isUndefined(bubble)) bubble = true; if (element == document && document.createEvent && !element.dispatchEvent) element = document.documentElement; var event; if (document.createEvent) { event = document.createEvent('HTMLEvents'); event.initEvent('dataavailable', true, true); } else { event = document.createEventObject(); event.eventType = bubble ? 'ondataavailable' : 'onfilterchange'; } event.eventName = eventName; event.memo = memo || { }; if (document.createEvent) element.dispatchEvent(event); else element.fireEvent(event.eventType, event); return Event.extend(event); } Event.Handler = Class.create({ initialize: function(element, eventName, selector, callback) { this.element = $(element); this.eventName = eventName; this.selector = selector; this.callback = callback; this.handler = this.handleEvent.bind(this); }, start: function() { Event.observe(this.element, this.eventName, this.handler); return this; }, stop: function() { Event.stopObserving(this.element, this.eventName, this.handler); return this; }, handleEvent: function(event) { var element = event.findElement(this.selector); if (element) this.callback.call(this.element, event, element); } }); function on(element, eventName, selector, callback) { element = $(element); if (Object.isFunction(selector) && Object.isUndefined(callback)) { callback = selector, selector = null; } return new Event.Handler(element, eventName, selector, callback).start(); } Object.extend(Event, Event.Methods); Object.extend(Event, { fire: fire, observe: observe, stopObserving: stopObserving, on: on }); Element.addMethods({ fire: fire, observe: observe, stopObserving: stopObserving, on: on }); Object.extend(document, { fire: fire.methodize(), observe: observe.methodize(), stopObserving: stopObserving.methodize(), on: on.methodize(), loaded: false }); if (window.Event) Object.extend(window.Event, Event); else window.Event = Event; })(); (function() { /* Support for the DOMContentLoaded event is based on work by Dan Webb, Matthias Miller, Dean Edwards, John Resig, and Diego Perini. */ var timer; function fireContentLoadedEvent() { if (document.loaded) return; if (timer) window.clearTimeout(timer); document.loaded = true; document.fire('dom:loaded'); } function checkReadyState() { if (document.readyState === 'complete') { document.stopObserving('readystatechange', checkReadyState); fireContentLoadedEvent(); } } function pollDoScroll() { try { document.documentElement.doScroll('left'); } catch(e) { timer = pollDoScroll.defer(); return; } fireContentLoadedEvent(); } if (document.addEventListener) { document.addEventListener('DOMContentLoaded', fireContentLoadedEvent, false); } else { document.observe('readystatechange', checkReadyState); if (window == top) timer = pollDoScroll.defer(); } Event.observe(window, 'load', fireContentLoadedEvent); })(); Element.addMethods(); /*------------------------------- DEPRECATED -------------------------------*/ Hash.toQueryString = Object.toQueryString; var Toggle = { display: Element.toggle }; Element.Methods.childOf = Element.Methods.descendantOf; var Insertion = { Before: function(element, content) { return Element.insert(element, {before:content}); }, Top: function(element, content) { return Element.insert(element, {top:content}); }, Bottom: function(element, content) { return Element.insert(element, {bottom:content}); }, After: function(element, content) { return Element.insert(element, {after:content}); } }; var $continue = new Error('"throw $continue" is deprecated, use "return" instead'); var Position = { includeScrollOffsets: false, prepare: function() { this.deltaX = window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft || 0; this.deltaY = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0; }, within: function(element, x, y) { if (this.includeScrollOffsets) return this.withinIncludingScrolloffsets(element, x, y); this.xcomp = x; this.ycomp = y; this.offset = Element.cumulativeOffset(element); return (y >= this.offset[1] && y < this.offset[1] + element.offsetHeight && x >= this.offset[0] && x < this.offset[0] + element.offsetWidth); }, withinIncludingScrolloffsets: function(element, x, y) { var offsetcache = Element.cumulativeScrollOffset(element); this.xcomp = x + offsetcache[0] - this.deltaX; this.ycomp = y + offsetcache[1] - this.deltaY; this.offset = Element.cumulativeOffset(element); return (this.ycomp >= this.offset[1] && this.ycomp < this.offset[1] + element.offsetHeight && this.xcomp >= this.offset[0] && this.xcomp < this.offset[0] + element.offsetWidth); }, overlap: function(mode, element) { if (!mode) return 0; if (mode == 'vertical') return ((this.offset[1] + element.offsetHeight) - this.ycomp) / element.offsetHeight; if (mode == 'horizontal') return ((this.offset[0] + element.offsetWidth) - this.xcomp) / element.offsetWidth; }, cumulativeOffset: Element.Methods.cumulativeOffset, positionedOffset: Element.Methods.positionedOffset, absolutize: function(element) { Position.prepare(); return Element.absolutize(element); }, relativize: function(element) { Position.prepare(); return Element.relativize(element); }, realOffset: Element.Methods.cumulativeScrollOffset, offsetParent: Element.Methods.getOffsetParent, page: Element.Methods.viewportOffset, clone: function(source, target, options) { options = options || { }; return Element.clonePosition(target, source, options); } }; /*--------------------------------------------------------------------------*/ if (!document.getElementsByClassName) document.getElementsByClassName = function(instanceMethods){ function iter(name) { return name.blank() ? null : "[contains(concat(' ', @class, ' '), ' " + name + " ')]"; } instanceMethods.getElementsByClassName = Prototype.BrowserFeatures.XPath ? function(element, className) { className = className.toString().strip(); var cond = /\s/.test(className) ? $w(className).map(iter).join('') : iter(className); return cond ? document._getElementsByXPath('.//*' + cond, element) : []; } : function(element, className) { className = className.toString().strip(); var elements = [], classNames = (/\s/.test(className) ? $w(className) : null); if (!classNames && !className) return elements; var nodes = $(element).getElementsByTagName('*'); className = ' ' + className + ' '; for (var i = 0, child, cn; child = nodes[i]; i++) { if (child.className && (cn = ' ' + child.className + ' ') && (cn.include(className) || (classNames && classNames.all(function(name) { return !name.toString().blank() && cn.include(' ' + name + ' '); })))) elements.push(Element.extend(child)); } return elements; }; return function(className, parentElement) { return $(parentElement || document.body).getElementsByClassName(className); }; }(Element.Methods); /*--------------------------------------------------------------------------*/ Element.ClassNames = Class.create(); Element.ClassNames.prototype = { initialize: function(element) { this.element = $(element); }, _each: function(iterator) { this.element.className.split(/\s+/).select(function(name) { return name.length > 0; })._each(iterator); }, set: function(className) { this.element.className = className; }, add: function(classNameToAdd) { if (this.include(classNameToAdd)) return; this.set($A(this).concat(classNameToAdd).join(' ')); }, remove: function(classNameToRemove) { if (!this.include(classNameToRemove)) return; this.set($A(this).without(classNameToRemove).join(' ')); }, toString: function() { return $A(this).join(' '); } }; Object.extend(Element.ClassNames.prototype, Enumerable); /*--------------------------------------------------------------------------*/ (function() { window.Selector = Class.create({ initialize: function(expression) { this.expression = expression.strip(); }, findElements: function(rootElement) { return Prototype.Selector.select(this.expression, rootElement); }, match: function(element) { return Prototype.Selector.match(element, this.expression); }, toString: function() { return this.expression; }, inspect: function() { return "#"; } }); Object.extend(Selector, { matchElements: function(elements, expression) { var match = Prototype.Selector.match, results = []; for (var i = 0, length = elements.length; i < length; i++) { var element = elements[i]; if (match(element, expression)) { results.push(Element.extend(element)); } } return results; }, findElement: function(elements, expression, index) { index = index || 0; var matchIndex = 0, element; for (var i = 0, length = elements.length; i < length; i++) { element = elements[i]; if (Prototype.Selector.match(element, expression) && index === matchIndex++) { return Element.extend(element); } } }, findChildElements: function(element, expressions) { var selector = expressions.toArray().join(', '); return Prototype.Selector.select(selector, element || document); } }); })(); ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/public/javascripts/rails.js./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/public/javascripts/rai0000644000000000000000000001333212674201751030335 0ustar (function() { // Technique from Juriy Zaytsev // http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/ function isEventSupported(eventName) { var el = document.createElement('div'); eventName = 'on' + eventName; var isSupported = (eventName in el); if (!isSupported) { el.setAttribute(eventName, 'return;'); isSupported = typeof el[eventName] == 'function'; } el = null; return isSupported; } function isForm(element) { return Object.isElement(element) && element.nodeName.toUpperCase() == 'FORM' } function isInput(element) { if (Object.isElement(element)) { var name = element.nodeName.toUpperCase() return name == 'INPUT' || name == 'SELECT' || name == 'TEXTAREA' } else return false } var submitBubbles = isEventSupported('submit'), changeBubbles = isEventSupported('change') if (!submitBubbles || !changeBubbles) { // augment the Event.Handler class to observe custom events when needed Event.Handler.prototype.initialize = Event.Handler.prototype.initialize.wrap( function(init, element, eventName, selector, callback) { init(element, eventName, selector, callback) // is the handler being attached to an element that doesn't support this event? if ( (!submitBubbles && this.eventName == 'submit' && !isForm(this.element)) || (!changeBubbles && this.eventName == 'change' && !isInput(this.element)) ) { // "submit" => "emulated:submit" this.eventName = 'emulated:' + this.eventName } } ) } if (!submitBubbles) { // discover forms on the page by observing focus events which always bubble document.on('focusin', 'form', function(focusEvent, form) { // special handler for the real "submit" event (one-time operation) if (!form.retrieve('emulated:submit')) { form.on('submit', function(submitEvent) { var emulated = form.fire('emulated:submit', submitEvent, true) // if custom event received preventDefault, cancel the real one too if (emulated.returnValue === false) submitEvent.preventDefault() }) form.store('emulated:submit', true) } }) } if (!changeBubbles) { // discover form inputs on the page document.on('focusin', 'input, select, texarea', function(focusEvent, input) { // special handler for real "change" events if (!input.retrieve('emulated:change')) { input.on('change', function(changeEvent) { input.fire('emulated:change', changeEvent, true) }) input.store('emulated:change', true) } }) } function handleRemote(element) { var method, url, params; var event = element.fire("ajax:before"); if (event.stopped) return false; if (element.tagName.toLowerCase() === 'form') { method = element.readAttribute('method') || 'post'; url = element.readAttribute('action'); params = element.serialize(); } else { method = element.readAttribute('data-method') || 'get'; url = element.readAttribute('href'); params = {}; } new Ajax.Request(url, { method: method, parameters: params, evalScripts: true, onComplete: function(request) { element.fire("ajax:complete", request); }, onSuccess: function(request) { element.fire("ajax:success", request); }, onFailure: function(request) { element.fire("ajax:failure", request); } }); element.fire("ajax:after"); } function handleMethod(element) { var method = element.readAttribute('data-method'), url = element.readAttribute('href'), csrf_param = $$('meta[name=csrf-param]')[0], csrf_token = $$('meta[name=csrf-token]')[0]; var form = new Element('form', { method: "POST", action: url, style: "display: none;" }); element.parentNode.insert(form); if (method !== 'post') { var field = new Element('input', { type: 'hidden', name: '_method', value: method }); form.insert(field); } if (csrf_param) { var param = csrf_param.readAttribute('content'), token = csrf_token.readAttribute('content'), field = new Element('input', { type: 'hidden', name: param, value: token }); form.insert(field); } form.submit(); } document.on("click", "*[data-confirm]", function(event, element) { var message = element.readAttribute('data-confirm'); if (!confirm(message)) event.stop(); }); document.on("click", "a[data-remote]", function(event, element) { if (event.stopped) return; handleRemote(element); event.stop(); }); document.on("click", "a[data-method]", function(event, element) { if (event.stopped) return; handleMethod(element); event.stop(); }); document.on("submit", function(event) { var element = event.findElement(), message = element.readAttribute('data-confirm'); if (message && !confirm(message)) { event.stop(); return false; } var inputs = element.select("input[type=submit][data-disable-with]"); inputs.each(function(input) { input.disabled = true; input.writeAttribute('data-original-value', input.value); input.value = input.readAttribute('data-disable-with'); }); var element = event.findElement("form[data-remote]"); if (element) { handleRemote(element); event.stop(); } }); document.on("ajax:after", "form", function(event, element) { var inputs = element.select("input[type=submit][disabled=true][data-disable-with]"); inputs.each(function(input) { input.value = input.readAttribute('data-original-value'); input.removeAttribute('data-original-value'); input.disabled = false; }); }); })(); ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/public/javascripts/effects.js./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/public/javascripts/eff0000644000000000000000000011310312674201751030317 0ustar // script.aculo.us effects.js v1.8.3, Thu Oct 08 11:23:33 +0200 2009 // Copyright (c) 2005-2009 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) // Contributors: // Justin Palmer (http://encytemedia.com/) // Mark Pilgrim (http://diveintomark.org/) // Martin Bialasinki // // script.aculo.us is freely distributable under the terms of an MIT-style license. // For details, see the script.aculo.us web site: http://script.aculo.us/ // converts rgb() and #xxx to #xxxxxx format, // returns self (or first argument) if not convertable String.prototype.parseColor = function() { var color = '#'; if (this.slice(0,4) == 'rgb(') { var cols = this.slice(4,this.length-1).split(','); var i=0; do { color += parseInt(cols[i]).toColorPart() } while (++i<3); } else { if (this.slice(0,1) == '#') { if (this.length==4) for(var i=1;i<4;i++) color += (this.charAt(i) + this.charAt(i)).toLowerCase(); if (this.length==7) color = this.toLowerCase(); } } return (color.length==7 ? color : (arguments[0] || this)); }; /*--------------------------------------------------------------------------*/ Element.collectTextNodes = function(element) { return $A($(element).childNodes).collect( function(node) { return (node.nodeType==3 ? node.nodeValue : (node.hasChildNodes() ? Element.collectTextNodes(node) : '')); }).flatten().join(''); }; Element.collectTextNodesIgnoreClass = function(element, className) { return $A($(element).childNodes).collect( function(node) { return (node.nodeType==3 ? node.nodeValue : ((node.hasChildNodes() && !Element.hasClassName(node,className)) ? Element.collectTextNodesIgnoreClass(node, className) : '')); }).flatten().join(''); }; Element.setContentZoom = function(element, percent) { element = $(element); element.setStyle({fontSize: (percent/100) + 'em'}); if (Prototype.Browser.WebKit) window.scrollBy(0,0); return element; }; Element.getInlineOpacity = function(element){ return $(element).style.opacity || ''; }; Element.forceRerendering = function(element) { try { element = $(element); var n = document.createTextNode(' '); element.appendChild(n); element.removeChild(n); } catch(e) { } }; /*--------------------------------------------------------------------------*/ var Effect = { _elementDoesNotExistError: { name: 'ElementDoesNotExistError', message: 'The specified DOM element does not exist, but is required for this effect to operate' }, Transitions: { linear: Prototype.K, sinoidal: function(pos) { return (-Math.cos(pos*Math.PI)/2) + .5; }, reverse: function(pos) { return 1-pos; }, flicker: function(pos) { var pos = ((-Math.cos(pos*Math.PI)/4) + .75) + Math.random()/4; return pos > 1 ? 1 : pos; }, wobble: function(pos) { return (-Math.cos(pos*Math.PI*(9*pos))/2) + .5; }, pulse: function(pos, pulses) { return (-Math.cos((pos*((pulses||5)-.5)*2)*Math.PI)/2) + .5; }, spring: function(pos) { return 1 - (Math.cos(pos * 4.5 * Math.PI) * Math.exp(-pos * 6)); }, none: function(pos) { return 0; }, full: function(pos) { return 1; } }, DefaultOptions: { duration: 1.0, // seconds fps: 100, // 100= assume 66fps max. sync: false, // true for combining from: 0.0, to: 1.0, delay: 0.0, queue: 'parallel' }, tagifyText: function(element) { var tagifyStyle = 'position:relative'; if (Prototype.Browser.IE) tagifyStyle += ';zoom:1'; element = $(element); $A(element.childNodes).each( function(child) { if (child.nodeType==3) { child.nodeValue.toArray().each( function(character) { element.insertBefore( new Element('span', {style: tagifyStyle}).update( character == ' ' ? String.fromCharCode(160) : character), child); }); Element.remove(child); } }); }, multiple: function(element, effect) { var elements; if (((typeof element == 'object') || Object.isFunction(element)) && (element.length)) elements = element; else elements = $(element).childNodes; var options = Object.extend({ speed: 0.1, delay: 0.0 }, arguments[2] || { }); var masterDelay = options.delay; $A(elements).each( function(element, index) { new effect(element, Object.extend(options, { delay: index * options.speed + masterDelay })); }); }, PAIRS: { 'slide': ['SlideDown','SlideUp'], 'blind': ['BlindDown','BlindUp'], 'appear': ['Appear','Fade'] }, toggle: function(element, effect, options) { element = $(element); effect = (effect || 'appear').toLowerCase(); return Effect[ Effect.PAIRS[ effect ][ element.visible() ? 1 : 0 ] ](element, Object.extend({ queue: { position:'end', scope:(element.id || 'global'), limit: 1 } }, options || {})); } }; Effect.DefaultOptions.transition = Effect.Transitions.sinoidal; /* ------------- core effects ------------- */ Effect.ScopedQueue = Class.create(Enumerable, { initialize: function() { this.effects = []; this.interval = null; }, _each: function(iterator) { this.effects._each(iterator); }, add: function(effect) { var timestamp = new Date().getTime(); var position = Object.isString(effect.options.queue) ? effect.options.queue : effect.options.queue.position; switch(position) { case 'front': // move unstarted effects after this effect this.effects.findAll(function(e){ return e.state=='idle' }).each( function(e) { e.startOn += effect.finishOn; e.finishOn += effect.finishOn; }); break; case 'with-last': timestamp = this.effects.pluck('startOn').max() || timestamp; break; case 'end': // start effect after last queued effect has finished timestamp = this.effects.pluck('finishOn').max() || timestamp; break; } effect.startOn += timestamp; effect.finishOn += timestamp; if (!effect.options.queue.limit || (this.effects.length < effect.options.queue.limit)) this.effects.push(effect); if (!this.interval) this.interval = setInterval(this.loop.bind(this), 15); }, remove: function(effect) { this.effects = this.effects.reject(function(e) { return e==effect }); if (this.effects.length == 0) { clearInterval(this.interval); this.interval = null; } }, loop: function() { var timePos = new Date().getTime(); for(var i=0, len=this.effects.length;i= this.startOn) { if (timePos >= this.finishOn) { this.render(1.0); this.cancel(); this.event('beforeFinish'); if (this.finish) this.finish(); this.event('afterFinish'); return; } var pos = (timePos - this.startOn) / this.totalTime, frame = (pos * this.totalFrames).round(); if (frame > this.currentFrame) { this.render(pos); this.currentFrame = frame; } } }, cancel: function() { if (!this.options.sync) Effect.Queues.get(Object.isString(this.options.queue) ? 'global' : this.options.queue.scope).remove(this); this.state = 'finished'; }, event: function(eventName) { if (this.options[eventName + 'Internal']) this.options[eventName + 'Internal'](this); if (this.options[eventName]) this.options[eventName](this); }, inspect: function() { var data = $H(); for(property in this) if (!Object.isFunction(this[property])) data.set(property, this[property]); return '#'; } }); Effect.Parallel = Class.create(Effect.Base, { initialize: function(effects) { this.effects = effects || []; this.start(arguments[1]); }, update: function(position) { this.effects.invoke('render', position); }, finish: function(position) { this.effects.each( function(effect) { effect.render(1.0); effect.cancel(); effect.event('beforeFinish'); if (effect.finish) effect.finish(position); effect.event('afterFinish'); }); } }); Effect.Tween = Class.create(Effect.Base, { initialize: function(object, from, to) { object = Object.isString(object) ? $(object) : object; var args = $A(arguments), method = args.last(), options = args.length == 5 ? args[3] : null; this.method = Object.isFunction(method) ? method.bind(object) : Object.isFunction(object[method]) ? object[method].bind(object) : function(value) { object[method] = value }; this.start(Object.extend({ from: from, to: to }, options || { })); }, update: function(position) { this.method(position); } }); Effect.Event = Class.create(Effect.Base, { initialize: function() { this.start(Object.extend({ duration: 0 }, arguments[0] || { })); }, update: Prototype.emptyFunction }); Effect.Opacity = Class.create(Effect.Base, { initialize: function(element) { this.element = $(element); if (!this.element) throw(Effect._elementDoesNotExistError); // make this work on IE on elements without 'layout' if (Prototype.Browser.IE && (!this.element.currentStyle.hasLayout)) this.element.setStyle({zoom: 1}); var options = Object.extend({ from: this.element.getOpacity() || 0.0, to: 1.0 }, arguments[1] || { }); this.start(options); }, update: function(position) { this.element.setOpacity(position); } }); Effect.Move = Class.create(Effect.Base, { initialize: function(element) { this.element = $(element); if (!this.element) throw(Effect._elementDoesNotExistError); var options = Object.extend({ x: 0, y: 0, mode: 'relative' }, arguments[1] || { }); this.start(options); }, setup: function() { this.element.makePositioned(); this.originalLeft = parseFloat(this.element.getStyle('left') || '0'); this.originalTop = parseFloat(this.element.getStyle('top') || '0'); if (this.options.mode == 'absolute') { this.options.x = this.options.x - this.originalLeft; this.options.y = this.options.y - this.originalTop; } }, update: function(position) { this.element.setStyle({ left: (this.options.x * position + this.originalLeft).round() + 'px', top: (this.options.y * position + this.originalTop).round() + 'px' }); } }); // for backwards compatibility Effect.MoveBy = function(element, toTop, toLeft) { return new Effect.Move(element, Object.extend({ x: toLeft, y: toTop }, arguments[3] || { })); }; Effect.Scale = Class.create(Effect.Base, { initialize: function(element, percent) { this.element = $(element); if (!this.element) throw(Effect._elementDoesNotExistError); var options = Object.extend({ scaleX: true, scaleY: true, scaleContent: true, scaleFromCenter: false, scaleMode: 'box', // 'box' or 'contents' or { } with provided values scaleFrom: 100.0, scaleTo: percent }, arguments[2] || { }); this.start(options); }, setup: function() { this.restoreAfterFinish = this.options.restoreAfterFinish || false; this.elementPositioning = this.element.getStyle('position'); this.originalStyle = { }; ['top','left','width','height','fontSize'].each( function(k) { this.originalStyle[k] = this.element.style[k]; }.bind(this)); this.originalTop = this.element.offsetTop; this.originalLeft = this.element.offsetLeft; var fontSize = this.element.getStyle('font-size') || '100%'; ['em','px','%','pt'].each( function(fontSizeType) { if (fontSize.indexOf(fontSizeType)>0) { this.fontSize = parseFloat(fontSize); this.fontSizeType = fontSizeType; } }.bind(this)); this.factor = (this.options.scaleTo - this.options.scaleFrom)/100; this.dims = null; if (this.options.scaleMode=='box') this.dims = [this.element.offsetHeight, this.element.offsetWidth]; if (/^content/.test(this.options.scaleMode)) this.dims = [this.element.scrollHeight, this.element.scrollWidth]; if (!this.dims) this.dims = [this.options.scaleMode.originalHeight, this.options.scaleMode.originalWidth]; }, update: function(position) { var currentScale = (this.options.scaleFrom/100.0) + (this.factor * position); if (this.options.scaleContent && this.fontSize) this.element.setStyle({fontSize: this.fontSize * currentScale + this.fontSizeType }); this.setDimensions(this.dims[0] * currentScale, this.dims[1] * currentScale); }, finish: function(position) { if (this.restoreAfterFinish) this.element.setStyle(this.originalStyle); }, setDimensions: function(height, width) { var d = { }; if (this.options.scaleX) d.width = width.round() + 'px'; if (this.options.scaleY) d.height = height.round() + 'px'; if (this.options.scaleFromCenter) { var topd = (height - this.dims[0])/2; var leftd = (width - this.dims[1])/2; if (this.elementPositioning == 'absolute') { if (this.options.scaleY) d.top = this.originalTop-topd + 'px'; if (this.options.scaleX) d.left = this.originalLeft-leftd + 'px'; } else { if (this.options.scaleY) d.top = -topd + 'px'; if (this.options.scaleX) d.left = -leftd + 'px'; } } this.element.setStyle(d); } }); Effect.Highlight = Class.create(Effect.Base, { initialize: function(element) { this.element = $(element); if (!this.element) throw(Effect._elementDoesNotExistError); var options = Object.extend({ startcolor: '#ffff99' }, arguments[1] || { }); this.start(options); }, setup: function() { // Prevent executing on elements not in the layout flow if (this.element.getStyle('display')=='none') { this.cancel(); return; } // Disable background image during the effect this.oldStyle = { }; if (!this.options.keepBackgroundImage) { this.oldStyle.backgroundImage = this.element.getStyle('background-image'); this.element.setStyle({backgroundImage: 'none'}); } if (!this.options.endcolor) this.options.endcolor = this.element.getStyle('background-color').parseColor('#ffffff'); if (!this.options.restorecolor) this.options.restorecolor = this.element.getStyle('background-color'); // init color calculations this._base = $R(0,2).map(function(i){ return parseInt(this.options.startcolor.slice(i*2+1,i*2+3),16) }.bind(this)); this._delta = $R(0,2).map(function(i){ return parseInt(this.options.endcolor.slice(i*2+1,i*2+3),16)-this._base[i] }.bind(this)); }, update: function(position) { this.element.setStyle({backgroundColor: $R(0,2).inject('#',function(m,v,i){ return m+((this._base[i]+(this._delta[i]*position)).round().toColorPart()); }.bind(this)) }); }, finish: function() { this.element.setStyle(Object.extend(this.oldStyle, { backgroundColor: this.options.restorecolor })); } }); Effect.ScrollTo = function(element) { var options = arguments[1] || { }, scrollOffsets = document.viewport.getScrollOffsets(), elementOffsets = $(element).cumulativeOffset(); if (options.offset) elementOffsets[1] += options.offset; return new Effect.Tween(null, scrollOffsets.top, elementOffsets[1], options, function(p){ scrollTo(scrollOffsets.left, p.round()); } ); }; /* ------------- combination effects ------------- */ Effect.Fade = function(element) { element = $(element); var oldOpacity = element.getInlineOpacity(); var options = Object.extend({ from: element.getOpacity() || 1.0, to: 0.0, afterFinishInternal: function(effect) { if (effect.options.to!=0) return; effect.element.hide().setStyle({opacity: oldOpacity}); } }, arguments[1] || { }); return new Effect.Opacity(element,options); }; Effect.Appear = function(element) { element = $(element); var options = Object.extend({ from: (element.getStyle('display') == 'none' ? 0.0 : element.getOpacity() || 0.0), to: 1.0, // force Safari to render floated elements properly afterFinishInternal: function(effect) { effect.element.forceRerendering(); }, beforeSetup: function(effect) { effect.element.setOpacity(effect.options.from).show(); }}, arguments[1] || { }); return new Effect.Opacity(element,options); }; Effect.Puff = function(element) { element = $(element); var oldStyle = { opacity: element.getInlineOpacity(), position: element.getStyle('position'), top: element.style.top, left: element.style.left, width: element.style.width, height: element.style.height }; return new Effect.Parallel( [ new Effect.Scale(element, 200, { sync: true, scaleFromCenter: true, scaleContent: true, restoreAfterFinish: true }), new Effect.Opacity(element, { sync: true, to: 0.0 } ) ], Object.extend({ duration: 1.0, beforeSetupInternal: function(effect) { Position.absolutize(effect.effects[0].element); }, afterFinishInternal: function(effect) { effect.effects[0].element.hide().setStyle(oldStyle); } }, arguments[1] || { }) ); }; Effect.BlindUp = function(element) { element = $(element); element.makeClipping(); return new Effect.Scale(element, 0, Object.extend({ scaleContent: false, scaleX: false, restoreAfterFinish: true, afterFinishInternal: function(effect) { effect.element.hide().undoClipping(); } }, arguments[1] || { }) ); }; Effect.BlindDown = function(element) { element = $(element); var elementDimensions = element.getDimensions(); return new Effect.Scale(element, 100, Object.extend({ scaleContent: false, scaleX: false, scaleFrom: 0, scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width}, restoreAfterFinish: true, afterSetup: function(effect) { effect.element.makeClipping().setStyle({height: '0px'}).show(); }, afterFinishInternal: function(effect) { effect.element.undoClipping(); } }, arguments[1] || { })); }; Effect.SwitchOff = function(element) { element = $(element); var oldOpacity = element.getInlineOpacity(); return new Effect.Appear(element, Object.extend({ duration: 0.4, from: 0, transition: Effect.Transitions.flicker, afterFinishInternal: function(effect) { new Effect.Scale(effect.element, 1, { duration: 0.3, scaleFromCenter: true, scaleX: false, scaleContent: false, restoreAfterFinish: true, beforeSetup: function(effect) { effect.element.makePositioned().makeClipping(); }, afterFinishInternal: function(effect) { effect.element.hide().undoClipping().undoPositioned().setStyle({opacity: oldOpacity}); } }); } }, arguments[1] || { })); }; Effect.DropOut = function(element) { element = $(element); var oldStyle = { top: element.getStyle('top'), left: element.getStyle('left'), opacity: element.getInlineOpacity() }; return new Effect.Parallel( [ new Effect.Move(element, {x: 0, y: 100, sync: true }), new Effect.Opacity(element, { sync: true, to: 0.0 }) ], Object.extend( { duration: 0.5, beforeSetup: function(effect) { effect.effects[0].element.makePositioned(); }, afterFinishInternal: function(effect) { effect.effects[0].element.hide().undoPositioned().setStyle(oldStyle); } }, arguments[1] || { })); }; Effect.Shake = function(element) { element = $(element); var options = Object.extend({ distance: 20, duration: 0.5 }, arguments[1] || {}); var distance = parseFloat(options.distance); var split = parseFloat(options.duration) / 10.0; var oldStyle = { top: element.getStyle('top'), left: element.getStyle('left') }; return new Effect.Move(element, { x: distance, y: 0, duration: split, afterFinishInternal: function(effect) { new Effect.Move(effect.element, { x: -distance*2, y: 0, duration: split*2, afterFinishInternal: function(effect) { new Effect.Move(effect.element, { x: distance*2, y: 0, duration: split*2, afterFinishInternal: function(effect) { new Effect.Move(effect.element, { x: -distance*2, y: 0, duration: split*2, afterFinishInternal: function(effect) { new Effect.Move(effect.element, { x: distance*2, y: 0, duration: split*2, afterFinishInternal: function(effect) { new Effect.Move(effect.element, { x: -distance, y: 0, duration: split, afterFinishInternal: function(effect) { effect.element.undoPositioned().setStyle(oldStyle); }}); }}); }}); }}); }}); }}); }; Effect.SlideDown = function(element) { element = $(element).cleanWhitespace(); // SlideDown need to have the content of the element wrapped in a container element with fixed height! var oldInnerBottom = element.down().getStyle('bottom'); var elementDimensions = element.getDimensions(); return new Effect.Scale(element, 100, Object.extend({ scaleContent: false, scaleX: false, scaleFrom: window.opera ? 0 : 1, scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width}, restoreAfterFinish: true, afterSetup: function(effect) { effect.element.makePositioned(); effect.element.down().makePositioned(); if (window.opera) effect.element.setStyle({top: ''}); effect.element.makeClipping().setStyle({height: '0px'}).show(); }, afterUpdateInternal: function(effect) { effect.element.down().setStyle({bottom: (effect.dims[0] - effect.element.clientHeight) + 'px' }); }, afterFinishInternal: function(effect) { effect.element.undoClipping().undoPositioned(); effect.element.down().undoPositioned().setStyle({bottom: oldInnerBottom}); } }, arguments[1] || { }) ); }; Effect.SlideUp = function(element) { element = $(element).cleanWhitespace(); var oldInnerBottom = element.down().getStyle('bottom'); var elementDimensions = element.getDimensions(); return new Effect.Scale(element, window.opera ? 0 : 1, Object.extend({ scaleContent: false, scaleX: false, scaleMode: 'box', scaleFrom: 100, scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width}, restoreAfterFinish: true, afterSetup: function(effect) { effect.element.makePositioned(); effect.element.down().makePositioned(); if (window.opera) effect.element.setStyle({top: ''}); effect.element.makeClipping().show(); }, afterUpdateInternal: function(effect) { effect.element.down().setStyle({bottom: (effect.dims[0] - effect.element.clientHeight) + 'px' }); }, afterFinishInternal: function(effect) { effect.element.hide().undoClipping().undoPositioned(); effect.element.down().undoPositioned().setStyle({bottom: oldInnerBottom}); } }, arguments[1] || { }) ); }; // Bug in opera makes the TD containing this element expand for a instance after finish Effect.Squish = function(element) { return new Effect.Scale(element, window.opera ? 1 : 0, { restoreAfterFinish: true, beforeSetup: function(effect) { effect.element.makeClipping(); }, afterFinishInternal: function(effect) { effect.element.hide().undoClipping(); } }); }; Effect.Grow = function(element) { element = $(element); var options = Object.extend({ direction: 'center', moveTransition: Effect.Transitions.sinoidal, scaleTransition: Effect.Transitions.sinoidal, opacityTransition: Effect.Transitions.full }, arguments[1] || { }); var oldStyle = { top: element.style.top, left: element.style.left, height: element.style.height, width: element.style.width, opacity: element.getInlineOpacity() }; var dims = element.getDimensions(); var initialMoveX, initialMoveY; var moveX, moveY; switch (options.direction) { case 'top-left': initialMoveX = initialMoveY = moveX = moveY = 0; break; case 'top-right': initialMoveX = dims.width; initialMoveY = moveY = 0; moveX = -dims.width; break; case 'bottom-left': initialMoveX = moveX = 0; initialMoveY = dims.height; moveY = -dims.height; break; case 'bottom-right': initialMoveX = dims.width; initialMoveY = dims.height; moveX = -dims.width; moveY = -dims.height; break; case 'center': initialMoveX = dims.width / 2; initialMoveY = dims.height / 2; moveX = -dims.width / 2; moveY = -dims.height / 2; break; } return new Effect.Move(element, { x: initialMoveX, y: initialMoveY, duration: 0.01, beforeSetup: function(effect) { effect.element.hide().makeClipping().makePositioned(); }, afterFinishInternal: function(effect) { new Effect.Parallel( [ new Effect.Opacity(effect.element, { sync: true, to: 1.0, from: 0.0, transition: options.opacityTransition }), new Effect.Move(effect.element, { x: moveX, y: moveY, sync: true, transition: options.moveTransition }), new Effect.Scale(effect.element, 100, { scaleMode: { originalHeight: dims.height, originalWidth: dims.width }, sync: true, scaleFrom: window.opera ? 1 : 0, transition: options.scaleTransition, restoreAfterFinish: true}) ], Object.extend({ beforeSetup: function(effect) { effect.effects[0].element.setStyle({height: '0px'}).show(); }, afterFinishInternal: function(effect) { effect.effects[0].element.undoClipping().undoPositioned().setStyle(oldStyle); } }, options) ); } }); }; Effect.Shrink = function(element) { element = $(element); var options = Object.extend({ direction: 'center', moveTransition: Effect.Transitions.sinoidal, scaleTransition: Effect.Transitions.sinoidal, opacityTransition: Effect.Transitions.none }, arguments[1] || { }); var oldStyle = { top: element.style.top, left: element.style.left, height: element.style.height, width: element.style.width, opacity: element.getInlineOpacity() }; var dims = element.getDimensions(); var moveX, moveY; switch (options.direction) { case 'top-left': moveX = moveY = 0; break; case 'top-right': moveX = dims.width; moveY = 0; break; case 'bottom-left': moveX = 0; moveY = dims.height; break; case 'bottom-right': moveX = dims.width; moveY = dims.height; break; case 'center': moveX = dims.width / 2; moveY = dims.height / 2; break; } return new Effect.Parallel( [ new Effect.Opacity(element, { sync: true, to: 0.0, from: 1.0, transition: options.opacityTransition }), new Effect.Scale(element, window.opera ? 1 : 0, { sync: true, transition: options.scaleTransition, restoreAfterFinish: true}), new Effect.Move(element, { x: moveX, y: moveY, sync: true, transition: options.moveTransition }) ], Object.extend({ beforeStartInternal: function(effect) { effect.effects[0].element.makePositioned().makeClipping(); }, afterFinishInternal: function(effect) { effect.effects[0].element.hide().undoClipping().undoPositioned().setStyle(oldStyle); } }, options) ); }; Effect.Pulsate = function(element) { element = $(element); var options = arguments[1] || { }, oldOpacity = element.getInlineOpacity(), transition = options.transition || Effect.Transitions.linear, reverser = function(pos){ return 1 - transition((-Math.cos((pos*(options.pulses||5)*2)*Math.PI)/2) + .5); }; return new Effect.Opacity(element, Object.extend(Object.extend({ duration: 2.0, from: 0, afterFinishInternal: function(effect) { effect.element.setStyle({opacity: oldOpacity}); } }, options), {transition: reverser})); }; Effect.Fold = function(element) { element = $(element); var oldStyle = { top: element.style.top, left: element.style.left, width: element.style.width, height: element.style.height }; element.makeClipping(); return new Effect.Scale(element, 5, Object.extend({ scaleContent: false, scaleX: false, afterFinishInternal: function(effect) { new Effect.Scale(element, 1, { scaleContent: false, scaleY: false, afterFinishInternal: function(effect) { effect.element.hide().undoClipping().setStyle(oldStyle); } }); }}, arguments[1] || { })); }; Effect.Morph = Class.create(Effect.Base, { initialize: function(element) { this.element = $(element); if (!this.element) throw(Effect._elementDoesNotExistError); var options = Object.extend({ style: { } }, arguments[1] || { }); if (!Object.isString(options.style)) this.style = $H(options.style); else { if (options.style.include(':')) this.style = options.style.parseStyle(); else { this.element.addClassName(options.style); this.style = $H(this.element.getStyles()); this.element.removeClassName(options.style); var css = this.element.getStyles(); this.style = this.style.reject(function(style) { return style.value == css[style.key]; }); options.afterFinishInternal = function(effect) { effect.element.addClassName(effect.options.style); effect.transforms.each(function(transform) { effect.element.style[transform.style] = ''; }); }; } } this.start(options); }, setup: function(){ function parseColor(color){ if (!color || ['rgba(0, 0, 0, 0)','transparent'].include(color)) color = '#ffffff'; color = color.parseColor(); return $R(0,2).map(function(i){ return parseInt( color.slice(i*2+1,i*2+3), 16 ); }); } this.transforms = this.style.map(function(pair){ var property = pair[0], value = pair[1], unit = null; if (value.parseColor('#zzzzzz') != '#zzzzzz') { value = value.parseColor(); unit = 'color'; } else if (property == 'opacity') { value = parseFloat(value); if (Prototype.Browser.IE && (!this.element.currentStyle.hasLayout)) this.element.setStyle({zoom: 1}); } else if (Element.CSS_LENGTH.test(value)) { var components = value.match(/^([\+\-]?[0-9\.]+)(.*)$/); value = parseFloat(components[1]); unit = (components.length == 3) ? components[2] : null; } var originalValue = this.element.getStyle(property); return { style: property.camelize(), originalValue: unit=='color' ? parseColor(originalValue) : parseFloat(originalValue || 0), targetValue: unit=='color' ? parseColor(value) : value, unit: unit }; }.bind(this)).reject(function(transform){ return ( (transform.originalValue == transform.targetValue) || ( transform.unit != 'color' && (isNaN(transform.originalValue) || isNaN(transform.targetValue)) ) ); }); }, update: function(position) { var style = { }, transform, i = this.transforms.length; while(i--) style[(transform = this.transforms[i]).style] = transform.unit=='color' ? '#'+ (Math.round(transform.originalValue[0]+ (transform.targetValue[0]-transform.originalValue[0])*position)).toColorPart() + (Math.round(transform.originalValue[1]+ (transform.targetValue[1]-transform.originalValue[1])*position)).toColorPart() + (Math.round(transform.originalValue[2]+ (transform.targetValue[2]-transform.originalValue[2])*position)).toColorPart() : (transform.originalValue + (transform.targetValue - transform.originalValue) * position).toFixed(3) + (transform.unit === null ? '' : transform.unit); this.element.setStyle(style, true); } }); Effect.Transform = Class.create({ initialize: function(tracks){ this.tracks = []; this.options = arguments[1] || { }; this.addTracks(tracks); }, addTracks: function(tracks){ tracks.each(function(track){ track = $H(track); var data = track.values().first(); this.tracks.push($H({ ids: track.keys().first(), effect: Effect.Morph, options: { style: data } })); }.bind(this)); return this; }, play: function(){ return new Effect.Parallel( this.tracks.map(function(track){ var ids = track.get('ids'), effect = track.get('effect'), options = track.get('options'); var elements = [$(ids) || $$(ids)].flatten(); return elements.map(function(e){ return new effect(e, Object.extend({ sync:true }, options)) }); }).flatten(), this.options ); } }); Element.CSS_PROPERTIES = $w( 'backgroundColor backgroundPosition borderBottomColor borderBottomStyle ' + 'borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth ' + 'borderRightColor borderRightStyle borderRightWidth borderSpacing ' + 'borderTopColor borderTopStyle borderTopWidth bottom clip color ' + 'fontSize fontWeight height left letterSpacing lineHeight ' + 'marginBottom marginLeft marginRight marginTop markerOffset maxHeight '+ 'maxWidth minHeight minWidth opacity outlineColor outlineOffset ' + 'outlineWidth paddingBottom paddingLeft paddingRight paddingTop ' + 'right textIndent top width wordSpacing zIndex'); Element.CSS_LENGTH = /^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/; String.__parseStyleElement = document.createElement('div'); String.prototype.parseStyle = function(){ var style, styleRules = $H(); if (Prototype.Browser.WebKit) style = new Element('div',{style:this}).style; else { String.__parseStyleElement.innerHTML = '
    '; style = String.__parseStyleElement.childNodes[0].style; } Element.CSS_PROPERTIES.each(function(property){ if (style[property]) styleRules.set(property, style[property]); }); if (Prototype.Browser.IE && this.include('opacity')) styleRules.set('opacity', this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1]); return styleRules; }; if (document.defaultView && document.defaultView.getComputedStyle) { Element.getStyles = function(element) { var css = document.defaultView.getComputedStyle($(element), null); return Element.CSS_PROPERTIES.inject({ }, function(styles, property) { styles[property] = css[property]; return styles; }); }; } else { Element.getStyles = function(element) { element = $(element); var css = element.currentStyle, styles; styles = Element.CSS_PROPERTIES.inject({ }, function(results, property) { results[property] = css[property]; return results; }); if (!styles.opacity) styles.opacity = element.getOpacity(); return styles; }; } Effect.Methods = { morph: function(element, style) { element = $(element); new Effect.Morph(element, Object.extend({ style: style }, arguments[2] || { })); return element; }, visualEffect: function(element, effect, options) { element = $(element); var s = effect.dasherize().camelize(), klass = s.charAt(0).toUpperCase() + s.substring(1); new Effect[klass](element, options); return element; }, highlight: function(element, options) { element = $(element); new Effect.Highlight(element, options); return element; } }; $w('fade appear grow shrink fold blindUp blindDown slideUp slideDown '+ 'pulsate shake puff squish switchOff dropOut').each( function(effect) { Effect.Methods[effect] = function(element, options){ element = $(element); Effect[effect.charAt(0).toUpperCase() + effect.substring(1)](element, options); return element; }; } ); $w('getInlineOpacity forceRerendering setContentZoom collectTextNodes collectTextNodesIgnoreClass getStyles').each( function(f) { Effect.Methods[f] = Element[f]; } ); Element.addMethods(Effect.Methods);././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/public/javascripts/application.js./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/public/javascripts/app0000644000000000000000000000022412674201751030336 0ustar // Place your application-specific JavaScript functions and classes here // This file is automatically included by javascript_include_tag :defaults ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/public/javascripts/dragdrop.js./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/public/javascripts/dra0000644000000000000000000007452012674201751030336 0ustar // script.aculo.us dragdrop.js v1.8.3, Thu Oct 08 11:23:33 +0200 2009 // Copyright (c) 2005-2009 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us) // // script.aculo.us is freely distributable under the terms of an MIT-style license. // For details, see the script.aculo.us web site: http://script.aculo.us/ if(Object.isUndefined(Effect)) throw("dragdrop.js requires including script.aculo.us' effects.js library"); var Droppables = { drops: [], remove: function(element) { this.drops = this.drops.reject(function(d) { return d.element==$(element) }); }, add: function(element) { element = $(element); var options = Object.extend({ greedy: true, hoverclass: null, tree: false }, arguments[1] || { }); // cache containers if(options.containment) { options._containers = []; var containment = options.containment; if(Object.isArray(containment)) { containment.each( function(c) { options._containers.push($(c)) }); } else { options._containers.push($(containment)); } } if(options.accept) options.accept = [options.accept].flatten(); Element.makePositioned(element); // fix IE options.element = element; this.drops.push(options); }, findDeepestChild: function(drops) { deepest = drops[0]; for (i = 1; i < drops.length; ++i) if (Element.isParent(drops[i].element, deepest.element)) deepest = drops[i]; return deepest; }, isContained: function(element, drop) { var containmentNode; if(drop.tree) { containmentNode = element.treeNode; } else { containmentNode = element.parentNode; } return drop._containers.detect(function(c) { return containmentNode == c }); }, isAffected: function(point, element, drop) { return ( (drop.element!=element) && ((!drop._containers) || this.isContained(element, drop)) && ((!drop.accept) || (Element.classNames(element).detect( function(v) { return drop.accept.include(v) } ) )) && Position.within(drop.element, point[0], point[1]) ); }, deactivate: function(drop) { if(drop.hoverclass) Element.removeClassName(drop.element, drop.hoverclass); this.last_active = null; }, activate: function(drop) { if(drop.hoverclass) Element.addClassName(drop.element, drop.hoverclass); this.last_active = drop; }, show: function(point, element) { if(!this.drops.length) return; var drop, affected = []; this.drops.each( function(drop) { if(Droppables.isAffected(point, element, drop)) affected.push(drop); }); if(affected.length>0) drop = Droppables.findDeepestChild(affected); if(this.last_active && this.last_active != drop) this.deactivate(this.last_active); if (drop) { Position.within(drop.element, point[0], point[1]); if(drop.onHover) drop.onHover(element, drop.element, Position.overlap(drop.overlap, drop.element)); if (drop != this.last_active) Droppables.activate(drop); } }, fire: function(event, element) { if(!this.last_active) return; Position.prepare(); if (this.isAffected([Event.pointerX(event), Event.pointerY(event)], element, this.last_active)) if (this.last_active.onDrop) { this.last_active.onDrop(element, this.last_active.element, event); return true; } }, reset: function() { if(this.last_active) this.deactivate(this.last_active); } }; var Draggables = { drags: [], observers: [], register: function(draggable) { if(this.drags.length == 0) { this.eventMouseUp = this.endDrag.bindAsEventListener(this); this.eventMouseMove = this.updateDrag.bindAsEventListener(this); this.eventKeypress = this.keyPress.bindAsEventListener(this); Event.observe(document, "mouseup", this.eventMouseUp); Event.observe(document, "mousemove", this.eventMouseMove); Event.observe(document, "keypress", this.eventKeypress); } this.drags.push(draggable); }, unregister: function(draggable) { this.drags = this.drags.reject(function(d) { return d==draggable }); if(this.drags.length == 0) { Event.stopObserving(document, "mouseup", this.eventMouseUp); Event.stopObserving(document, "mousemove", this.eventMouseMove); Event.stopObserving(document, "keypress", this.eventKeypress); } }, activate: function(draggable) { if(draggable.options.delay) { this._timeout = setTimeout(function() { Draggables._timeout = null; window.focus(); Draggables.activeDraggable = draggable; }.bind(this), draggable.options.delay); } else { window.focus(); // allows keypress events if window isn't currently focused, fails for Safari this.activeDraggable = draggable; } }, deactivate: function() { this.activeDraggable = null; }, updateDrag: function(event) { if(!this.activeDraggable) return; var pointer = [Event.pointerX(event), Event.pointerY(event)]; // Mozilla-based browsers fire successive mousemove events with // the same coordinates, prevent needless redrawing (moz bug?) if(this._lastPointer && (this._lastPointer.inspect() == pointer.inspect())) return; this._lastPointer = pointer; this.activeDraggable.updateDrag(event, pointer); }, endDrag: function(event) { if(this._timeout) { clearTimeout(this._timeout); this._timeout = null; } if(!this.activeDraggable) return; this._lastPointer = null; this.activeDraggable.endDrag(event); this.activeDraggable = null; }, keyPress: function(event) { if(this.activeDraggable) this.activeDraggable.keyPress(event); }, addObserver: function(observer) { this.observers.push(observer); this._cacheObserverCallbacks(); }, removeObserver: function(element) { // element instead of observer fixes mem leaks this.observers = this.observers.reject( function(o) { return o.element==element }); this._cacheObserverCallbacks(); }, notify: function(eventName, draggable, event) { // 'onStart', 'onEnd', 'onDrag' if(this[eventName+'Count'] > 0) this.observers.each( function(o) { if(o[eventName]) o[eventName](eventName, draggable, event); }); if(draggable.options[eventName]) draggable.options[eventName](draggable, event); }, _cacheObserverCallbacks: function() { ['onStart','onEnd','onDrag'].each( function(eventName) { Draggables[eventName+'Count'] = Draggables.observers.select( function(o) { return o[eventName]; } ).length; }); } }; /*--------------------------------------------------------------------------*/ var Draggable = Class.create({ initialize: function(element) { var defaults = { handle: false, reverteffect: function(element, top_offset, left_offset) { var dur = Math.sqrt(Math.abs(top_offset^2)+Math.abs(left_offset^2))*0.02; new Effect.Move(element, { x: -left_offset, y: -top_offset, duration: dur, queue: {scope:'_draggable', position:'end'} }); }, endeffect: function(element) { var toOpacity = Object.isNumber(element._opacity) ? element._opacity : 1.0; new Effect.Opacity(element, {duration:0.2, from:0.7, to:toOpacity, queue: {scope:'_draggable', position:'end'}, afterFinish: function(){ Draggable._dragging[element] = false } }); }, zindex: 1000, revert: false, quiet: false, scroll: false, scrollSensitivity: 20, scrollSpeed: 15, snap: false, // false, or xy or [x,y] or function(x,y){ return [x,y] } delay: 0 }; if(!arguments[1] || Object.isUndefined(arguments[1].endeffect)) Object.extend(defaults, { starteffect: function(element) { element._opacity = Element.getOpacity(element); Draggable._dragging[element] = true; new Effect.Opacity(element, {duration:0.2, from:element._opacity, to:0.7}); } }); var options = Object.extend(defaults, arguments[1] || { }); this.element = $(element); if(options.handle && Object.isString(options.handle)) this.handle = this.element.down('.'+options.handle, 0); if(!this.handle) this.handle = $(options.handle); if(!this.handle) this.handle = this.element; if(options.scroll && !options.scroll.scrollTo && !options.scroll.outerHTML) { options.scroll = $(options.scroll); this._isScrollChild = Element.childOf(this.element, options.scroll); } Element.makePositioned(this.element); // fix IE this.options = options; this.dragging = false; this.eventMouseDown = this.initDrag.bindAsEventListener(this); Event.observe(this.handle, "mousedown", this.eventMouseDown); Draggables.register(this); }, destroy: function() { Event.stopObserving(this.handle, "mousedown", this.eventMouseDown); Draggables.unregister(this); }, currentDelta: function() { return([ parseInt(Element.getStyle(this.element,'left') || '0'), parseInt(Element.getStyle(this.element,'top') || '0')]); }, initDrag: function(event) { if(!Object.isUndefined(Draggable._dragging[this.element]) && Draggable._dragging[this.element]) return; if(Event.isLeftClick(event)) { // abort on form elements, fixes a Firefox issue var src = Event.element(event); if((tag_name = src.tagName.toUpperCase()) && ( tag_name=='INPUT' || tag_name=='SELECT' || tag_name=='OPTION' || tag_name=='BUTTON' || tag_name=='TEXTAREA')) return; var pointer = [Event.pointerX(event), Event.pointerY(event)]; var pos = this.element.cumulativeOffset(); this.offset = [0,1].map( function(i) { return (pointer[i] - pos[i]) }); Draggables.activate(this); Event.stop(event); } }, startDrag: function(event) { this.dragging = true; if(!this.delta) this.delta = this.currentDelta(); if(this.options.zindex) { this.originalZ = parseInt(Element.getStyle(this.element,'z-index') || 0); this.element.style.zIndex = this.options.zindex; } if(this.options.ghosting) { this._clone = this.element.cloneNode(true); this._originallyAbsolute = (this.element.getStyle('position') == 'absolute'); if (!this._originallyAbsolute) Position.absolutize(this.element); this.element.parentNode.insertBefore(this._clone, this.element); } if(this.options.scroll) { if (this.options.scroll == window) { var where = this._getWindowScroll(this.options.scroll); this.originalScrollLeft = where.left; this.originalScrollTop = where.top; } else { this.originalScrollLeft = this.options.scroll.scrollLeft; this.originalScrollTop = this.options.scroll.scrollTop; } } Draggables.notify('onStart', this, event); if(this.options.starteffect) this.options.starteffect(this.element); }, updateDrag: function(event, pointer) { if(!this.dragging) this.startDrag(event); if(!this.options.quiet){ Position.prepare(); Droppables.show(pointer, this.element); } Draggables.notify('onDrag', this, event); this.draw(pointer); if(this.options.change) this.options.change(this); if(this.options.scroll) { this.stopScrolling(); var p; if (this.options.scroll == window) { with(this._getWindowScroll(this.options.scroll)) { p = [ left, top, left+width, top+height ]; } } else { p = Position.page(this.options.scroll); p[0] += this.options.scroll.scrollLeft + Position.deltaX; p[1] += this.options.scroll.scrollTop + Position.deltaY; p.push(p[0]+this.options.scroll.offsetWidth); p.push(p[1]+this.options.scroll.offsetHeight); } var speed = [0,0]; if(pointer[0] < (p[0]+this.options.scrollSensitivity)) speed[0] = pointer[0]-(p[0]+this.options.scrollSensitivity); if(pointer[1] < (p[1]+this.options.scrollSensitivity)) speed[1] = pointer[1]-(p[1]+this.options.scrollSensitivity); if(pointer[0] > (p[2]-this.options.scrollSensitivity)) speed[0] = pointer[0]-(p[2]-this.options.scrollSensitivity); if(pointer[1] > (p[3]-this.options.scrollSensitivity)) speed[1] = pointer[1]-(p[3]-this.options.scrollSensitivity); this.startScrolling(speed); } // fix AppleWebKit rendering if(Prototype.Browser.WebKit) window.scrollBy(0,0); Event.stop(event); }, finishDrag: function(event, success) { this.dragging = false; if(this.options.quiet){ Position.prepare(); var pointer = [Event.pointerX(event), Event.pointerY(event)]; Droppables.show(pointer, this.element); } if(this.options.ghosting) { if (!this._originallyAbsolute) Position.relativize(this.element); delete this._originallyAbsolute; Element.remove(this._clone); this._clone = null; } var dropped = false; if(success) { dropped = Droppables.fire(event, this.element); if (!dropped) dropped = false; } if(dropped && this.options.onDropped) this.options.onDropped(this.element); Draggables.notify('onEnd', this, event); var revert = this.options.revert; if(revert && Object.isFunction(revert)) revert = revert(this.element); var d = this.currentDelta(); if(revert && this.options.reverteffect) { if (dropped == 0 || revert != 'failure') this.options.reverteffect(this.element, d[1]-this.delta[1], d[0]-this.delta[0]); } else { this.delta = d; } if(this.options.zindex) this.element.style.zIndex = this.originalZ; if(this.options.endeffect) this.options.endeffect(this.element); Draggables.deactivate(this); Droppables.reset(); }, keyPress: function(event) { if(event.keyCode!=Event.KEY_ESC) return; this.finishDrag(event, false); Event.stop(event); }, endDrag: function(event) { if(!this.dragging) return; this.stopScrolling(); this.finishDrag(event, true); Event.stop(event); }, draw: function(point) { var pos = this.element.cumulativeOffset(); if(this.options.ghosting) { var r = Position.realOffset(this.element); pos[0] += r[0] - Position.deltaX; pos[1] += r[1] - Position.deltaY; } var d = this.currentDelta(); pos[0] -= d[0]; pos[1] -= d[1]; if(this.options.scroll && (this.options.scroll != window && this._isScrollChild)) { pos[0] -= this.options.scroll.scrollLeft-this.originalScrollLeft; pos[1] -= this.options.scroll.scrollTop-this.originalScrollTop; } var p = [0,1].map(function(i){ return (point[i]-pos[i]-this.offset[i]) }.bind(this)); if(this.options.snap) { if(Object.isFunction(this.options.snap)) { p = this.options.snap(p[0],p[1],this); } else { if(Object.isArray(this.options.snap)) { p = p.map( function(v, i) { return (v/this.options.snap[i]).round()*this.options.snap[i] }.bind(this)); } else { p = p.map( function(v) { return (v/this.options.snap).round()*this.options.snap }.bind(this)); } }} var style = this.element.style; if((!this.options.constraint) || (this.options.constraint=='horizontal')) style.left = p[0] + "px"; if((!this.options.constraint) || (this.options.constraint=='vertical')) style.top = p[1] + "px"; if(style.visibility=="hidden") style.visibility = ""; // fix gecko rendering }, stopScrolling: function() { if(this.scrollInterval) { clearInterval(this.scrollInterval); this.scrollInterval = null; Draggables._lastScrollPointer = null; } }, startScrolling: function(speed) { if(!(speed[0] || speed[1])) return; this.scrollSpeed = [speed[0]*this.options.scrollSpeed,speed[1]*this.options.scrollSpeed]; this.lastScrolled = new Date(); this.scrollInterval = setInterval(this.scroll.bind(this), 10); }, scroll: function() { var current = new Date(); var delta = current - this.lastScrolled; this.lastScrolled = current; if(this.options.scroll == window) { with (this._getWindowScroll(this.options.scroll)) { if (this.scrollSpeed[0] || this.scrollSpeed[1]) { var d = delta / 1000; this.options.scroll.scrollTo( left + d*this.scrollSpeed[0], top + d*this.scrollSpeed[1] ); } } } else { this.options.scroll.scrollLeft += this.scrollSpeed[0] * delta / 1000; this.options.scroll.scrollTop += this.scrollSpeed[1] * delta / 1000; } Position.prepare(); Droppables.show(Draggables._lastPointer, this.element); Draggables.notify('onDrag', this); if (this._isScrollChild) { Draggables._lastScrollPointer = Draggables._lastScrollPointer || $A(Draggables._lastPointer); Draggables._lastScrollPointer[0] += this.scrollSpeed[0] * delta / 1000; Draggables._lastScrollPointer[1] += this.scrollSpeed[1] * delta / 1000; if (Draggables._lastScrollPointer[0] < 0) Draggables._lastScrollPointer[0] = 0; if (Draggables._lastScrollPointer[1] < 0) Draggables._lastScrollPointer[1] = 0; this.draw(Draggables._lastScrollPointer); } if(this.options.change) this.options.change(this); }, _getWindowScroll: function(w) { var T, L, W, H; with (w.document) { if (w.document.documentElement && documentElement.scrollTop) { T = documentElement.scrollTop; L = documentElement.scrollLeft; } else if (w.document.body) { T = body.scrollTop; L = body.scrollLeft; } if (w.innerWidth) { W = w.innerWidth; H = w.innerHeight; } else if (w.document.documentElement && documentElement.clientWidth) { W = documentElement.clientWidth; H = documentElement.clientHeight; } else { W = body.offsetWidth; H = body.offsetHeight; } } return { top: T, left: L, width: W, height: H }; } }); Draggable._dragging = { }; /*--------------------------------------------------------------------------*/ var SortableObserver = Class.create({ initialize: function(element, observer) { this.element = $(element); this.observer = observer; this.lastValue = Sortable.serialize(this.element); }, onStart: function() { this.lastValue = Sortable.serialize(this.element); }, onEnd: function() { Sortable.unmark(); if(this.lastValue != Sortable.serialize(this.element)) this.observer(this.element) } }); var Sortable = { SERIALIZE_RULE: /^[^_\-](?:[A-Za-z0-9\-\_]*)[_](.*)$/, sortables: { }, _findRootElement: function(element) { while (element.tagName.toUpperCase() != "BODY") { if(element.id && Sortable.sortables[element.id]) return element; element = element.parentNode; } }, options: function(element) { element = Sortable._findRootElement($(element)); if(!element) return; return Sortable.sortables[element.id]; }, destroy: function(element){ element = $(element); var s = Sortable.sortables[element.id]; if(s) { Draggables.removeObserver(s.element); s.droppables.each(function(d){ Droppables.remove(d) }); s.draggables.invoke('destroy'); delete Sortable.sortables[s.element.id]; } }, create: function(element) { element = $(element); var options = Object.extend({ element: element, tag: 'li', // assumes li children, override with tag: 'tagname' dropOnEmpty: false, tree: false, treeTag: 'ul', overlap: 'vertical', // one of 'vertical', 'horizontal' constraint: 'vertical', // one of 'vertical', 'horizontal', false containment: element, // also takes array of elements (or id's); or false handle: false, // or a CSS class only: false, delay: 0, hoverclass: null, ghosting: false, quiet: false, scroll: false, scrollSensitivity: 20, scrollSpeed: 15, format: this.SERIALIZE_RULE, // these take arrays of elements or ids and can be // used for better initialization performance elements: false, handles: false, onChange: Prototype.emptyFunction, onUpdate: Prototype.emptyFunction }, arguments[1] || { }); // clear any old sortable with same element this.destroy(element); // build options for the draggables var options_for_draggable = { revert: true, quiet: options.quiet, scroll: options.scroll, scrollSpeed: options.scrollSpeed, scrollSensitivity: options.scrollSensitivity, delay: options.delay, ghosting: options.ghosting, constraint: options.constraint, handle: options.handle }; if(options.starteffect) options_for_draggable.starteffect = options.starteffect; if(options.reverteffect) options_for_draggable.reverteffect = options.reverteffect; else if(options.ghosting) options_for_draggable.reverteffect = function(element) { element.style.top = 0; element.style.left = 0; }; if(options.endeffect) options_for_draggable.endeffect = options.endeffect; if(options.zindex) options_for_draggable.zindex = options.zindex; // build options for the droppables var options_for_droppable = { overlap: options.overlap, containment: options.containment, tree: options.tree, hoverclass: options.hoverclass, onHover: Sortable.onHover }; var options_for_tree = { onHover: Sortable.onEmptyHover, overlap: options.overlap, containment: options.containment, hoverclass: options.hoverclass }; // fix for gecko engine Element.cleanWhitespace(element); options.draggables = []; options.droppables = []; // drop on empty handling if(options.dropOnEmpty || options.tree) { Droppables.add(element, options_for_tree); options.droppables.push(element); } (options.elements || this.findElements(element, options) || []).each( function(e,i) { var handle = options.handles ? $(options.handles[i]) : (options.handle ? $(e).select('.' + options.handle)[0] : e); options.draggables.push( new Draggable(e, Object.extend(options_for_draggable, { handle: handle }))); Droppables.add(e, options_for_droppable); if(options.tree) e.treeNode = element; options.droppables.push(e); }); if(options.tree) { (Sortable.findTreeElements(element, options) || []).each( function(e) { Droppables.add(e, options_for_tree); e.treeNode = element; options.droppables.push(e); }); } // keep reference this.sortables[element.identify()] = options; // for onupdate Draggables.addObserver(new SortableObserver(element, options.onUpdate)); }, // return all suitable-for-sortable elements in a guaranteed order findElements: function(element, options) { return Element.findChildren( element, options.only, options.tree ? true : false, options.tag); }, findTreeElements: function(element, options) { return Element.findChildren( element, options.only, options.tree ? true : false, options.treeTag); }, onHover: function(element, dropon, overlap) { if(Element.isParent(dropon, element)) return; if(overlap > .33 && overlap < .66 && Sortable.options(dropon).tree) { return; } else if(overlap>0.5) { Sortable.mark(dropon, 'before'); if(dropon.previousSibling != element) { var oldParentNode = element.parentNode; element.style.visibility = "hidden"; // fix gecko rendering dropon.parentNode.insertBefore(element, dropon); if(dropon.parentNode!=oldParentNode) Sortable.options(oldParentNode).onChange(element); Sortable.options(dropon.parentNode).onChange(element); } } else { Sortable.mark(dropon, 'after'); var nextElement = dropon.nextSibling || null; if(nextElement != element) { var oldParentNode = element.parentNode; element.style.visibility = "hidden"; // fix gecko rendering dropon.parentNode.insertBefore(element, nextElement); if(dropon.parentNode!=oldParentNode) Sortable.options(oldParentNode).onChange(element); Sortable.options(dropon.parentNode).onChange(element); } } }, onEmptyHover: function(element, dropon, overlap) { var oldParentNode = element.parentNode; var droponOptions = Sortable.options(dropon); if(!Element.isParent(dropon, element)) { var index; var children = Sortable.findElements(dropon, {tag: droponOptions.tag, only: droponOptions.only}); var child = null; if(children) { var offset = Element.offsetSize(dropon, droponOptions.overlap) * (1.0 - overlap); for (index = 0; index < children.length; index += 1) { if (offset - Element.offsetSize (children[index], droponOptions.overlap) >= 0) { offset -= Element.offsetSize (children[index], droponOptions.overlap); } else if (offset - (Element.offsetSize (children[index], droponOptions.overlap) / 2) >= 0) { child = index + 1 < children.length ? children[index + 1] : null; break; } else { child = children[index]; break; } } } dropon.insertBefore(element, child); Sortable.options(oldParentNode).onChange(element); droponOptions.onChange(element); } }, unmark: function() { if(Sortable._marker) Sortable._marker.hide(); }, mark: function(dropon, position) { // mark on ghosting only var sortable = Sortable.options(dropon.parentNode); if(sortable && !sortable.ghosting) return; if(!Sortable._marker) { Sortable._marker = ($('dropmarker') || Element.extend(document.createElement('DIV'))). hide().addClassName('dropmarker').setStyle({position:'absolute'}); document.getElementsByTagName("body").item(0).appendChild(Sortable._marker); } var offsets = dropon.cumulativeOffset(); Sortable._marker.setStyle({left: offsets[0]+'px', top: offsets[1] + 'px'}); if(position=='after') if(sortable.overlap == 'horizontal') Sortable._marker.setStyle({left: (offsets[0]+dropon.clientWidth) + 'px'}); else Sortable._marker.setStyle({top: (offsets[1]+dropon.clientHeight) + 'px'}); Sortable._marker.show(); }, _tree: function(element, options, parent) { var children = Sortable.findElements(element, options) || []; for (var i = 0; i < children.length; ++i) { var match = children[i].id.match(options.format); if (!match) continue; var child = { id: encodeURIComponent(match ? match[1] : null), element: element, parent: parent, children: [], position: parent.children.length, container: $(children[i]).down(options.treeTag) }; /* Get the element containing the children and recurse over it */ if (child.container) this._tree(child.container, options, child); parent.children.push (child); } return parent; }, tree: function(element) { element = $(element); var sortableOptions = this.options(element); var options = Object.extend({ tag: sortableOptions.tag, treeTag: sortableOptions.treeTag, only: sortableOptions.only, name: element.id, format: sortableOptions.format }, arguments[1] || { }); var root = { id: null, parent: null, children: [], container: element, position: 0 }; return Sortable._tree(element, options, root); }, /* Construct a [i] index for a particular node */ _constructIndex: function(node) { var index = ''; do { if (node.id) index = '[' + node.position + ']' + index; } while ((node = node.parent) != null); return index; }, sequence: function(element) { element = $(element); var options = Object.extend(this.options(element), arguments[1] || { }); return $(this.findElements(element, options) || []).map( function(item) { return item.id.match(options.format) ? item.id.match(options.format)[1] : ''; }); }, setSequence: function(element, new_sequence) { element = $(element); var options = Object.extend(this.options(element), arguments[2] || { }); var nodeMap = { }; this.findElements(element, options).each( function(n) { if (n.id.match(options.format)) nodeMap[n.id.match(options.format)[1]] = [n, n.parentNode]; n.parentNode.removeChild(n); }); new_sequence.each(function(ident) { var n = nodeMap[ident]; if (n) { n[1].appendChild(n[0]); delete nodeMap[ident]; } }); }, serialize: function(element) { element = $(element); var options = Object.extend(Sortable.options(element), arguments[1] || { }); var name = encodeURIComponent( (arguments[1] && arguments[1].name) ? arguments[1].name : element.id); if (options.tree) { return Sortable.tree(element, arguments[1]).children.map( function (item) { return [name + Sortable._constructIndex(item) + "[id]=" + encodeURIComponent(item.id)].concat(item.children.map(arguments.callee)); }).flatten().join('&'); } else { return Sortable.sequence(element, arguments[1]).map( function(item) { return name + "[]=" + encodeURIComponent(item); }).join('&'); } } }; // Returns true if child is contained within element Element.isParent = function(child, element) { if (!child.parentNode || child == element) return false; if (child.parentNode == element) return true; return Element.isParent(child.parentNode, element); }; Element.findChildren = function(element, only, recursive, tagName) { if(!element.hasChildNodes()) return null; tagName = tagName.toUpperCase(); if(only) only = [only].flatten(); var elements = []; $A(element.childNodes).each( function(e) { if(e.tagName && e.tagName.toUpperCase()==tagName && (!only || (Element.classNames(e).detect(function(v) { return only.include(v) })))) elements.push(e); if(recursive) { var grandchildren = Element.findChildren(e, only, recursive, tagName); if(grandchildren) elements.push(grandchildren); } }); return (elements.length>0 ? elements.flatten() : []); }; Element.offsetSize = function (element, type) { return element['offset' + ((type=='vertical' || type=='height') ? 'Height' : 'Width')]; };./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/public/422.html0000644000000000000000000000130712674201751026502 0ustar The change you wanted was rejected (422)

    The change you wanted was rejected.

    Maybe you tried to change something you didn't have access to.

    ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/public/favicon.ico0000644000000000000000000000000012674201751027413 0ustar ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/public/404.html0000644000000000000000000000133012674201751026476 0ustar The page you were looking for doesn't exist (404)

    The page you were looking for doesn't exist.

    You may have mistyped the address or the page may have moved.

    ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/public/stylesheets/0000755000000000000000000000000012674201751027660 5ustar ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/public/stylesheets/.gitkeep./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/public/stylesheets/.gi0000644000000000000000000000000012674201751030246 0ustar ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/public/stylesheets/scaffold.css./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/public/stylesheets/sca0000644000000000000000000000162412674201751030354 0ustar body { background-color: #fff; color: #333; } body, p, ol, ul, td { font-family: verdana, arial, helvetica, sans-serif; font-size: 13px; line-height: 18px; } pre { background-color: #eee; padding: 10px; font-size: 11px; } a { color: #000; } a:visited { color: #666; } a:hover { color: #fff; background-color:#000; } div.field, div.actions { margin-bottom: 10px; } #notice { color: green; } .field_with_errors { padding: 2px; background-color: red; display: table; } #error_explanation { width: 450px; border: 2px solid red; padding: 7px; padding-bottom: 0; margin-bottom: 20px; background-color: #f0f0f0; } #error_explanation h2 { text-align: left; font-weight: bold; padding: 5px 5px 5px 15px; font-size: 12px; margin: -7px; margin-bottom: 0px; background-color: #c00; color: #fff; } #error_explanation ul li { font-size: 12px; list-style: square; } ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/.gitignore0000644000000000000000000000010312674201751026010 0ustar .bundle db/*.sqlite3 log/*.log tmp/**/* src config/boot.rb pom*xml ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/invoker.properties0000644000000000000000000000056012674201751027622 0ustar invoker.goals = de.saumya.mojo:rails3-maven-plugin:${project.version}:pom de.saumya.mojo:jruby-maven-plugin:${project.version}:jruby invoker.goals.2 = de.saumya.mojo:rails3-maven-plugin:${project.version}:generate invoker.goals.3 = de.saumya.mojo:rails3-maven-plugin:${project.version}:rake invoker.goals.4 = verify invoker.mavenOpts = -client #invoker.offline = true ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/vendor/0000755000000000000000000000000012674201751025323 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/vendor/plugins/0000755000000000000000000000000012674201751027004 5ustar ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/vendor/plugins/.gitkeep./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/vendor/plugins/.gitkee0000644000000000000000000000000012674201751030243 0ustar ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/app/0000755000000000000000000000000012674201751024606 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/app/helpers/0000755000000000000000000000000012674201751026250 5ustar ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/app/helpers/users_helper.rb./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/app/helpers/users_help0000644000000000000000000000002712674201751030343 0ustar module UsersHelper end ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/app/helpers/application_helper.rb./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/app/helpers/applicatio0000644000000000000000000000003512674201751030316 0ustar module ApplicationHelper end ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/app/models/0000755000000000000000000000000012674201751026071 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/app/models/user.rb0000644000000000000000000000004412674201751027372 0ustar class User < ActiveRecord::Base end ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/app/controllers/0000755000000000000000000000000012674201751027154 5ustar ././@LongLink0000644000000000000000000000017000000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/app/controllers/application_controller.rb./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/app/controllers/applic0000644000000000000000000000012012674201751030340 0ustar class ApplicationController < ActionController::Base protect_from_forgery end ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/app/controllers/users_controller.rb./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/app/controllers/users_0000644000000000000000000000351712674201751030405 0ustar class UsersController < ApplicationController # GET /users # GET /users.xml def index @users = User.all respond_to do |format| format.html # index.html.erb format.xml { render :xml => @users } end end # GET /users/1 # GET /users/1.xml def show @user = User.find(params[:id]) respond_to do |format| format.html # show.html.erb format.xml { render :xml => @user } end end # GET /users/new # GET /users/new.xml def new @user = User.new respond_to do |format| format.html # new.html.erb format.xml { render :xml => @user } end end # GET /users/1/edit def edit @user = User.find(params[:id]) end # POST /users # POST /users.xml def create @user = User.new(params[:user]) respond_to do |format| if @user.save format.html { redirect_to(@user, :notice => 'User was successfully created.') } format.xml { render :xml => @user, :status => :created, :location => @user } else format.html { render :action => "new" } format.xml { render :xml => @user.errors, :status => :unprocessable_entity } end end end # PUT /users/1 # PUT /users/1.xml def update @user = User.find(params[:id]) respond_to do |format| if @user.update_attributes(params[:user]) format.html { redirect_to(@user, :notice => 'User was successfully updated.') } format.xml { head :ok } else format.html { render :action => "edit" } format.xml { render :xml => @user.errors, :status => :unprocessable_entity } end end end # DELETE /users/1 # DELETE /users/1.xml def destroy @user = User.find(params[:id]) @user.destroy respond_to do |format| format.html { redirect_to(users_url) } format.xml { head :ok } end end end ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/app/views/0000755000000000000000000000000012674201751025743 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/app/views/users/0000755000000000000000000000000012674201751027104 5ustar ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/app/views/users/show.html.erb./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/app/views/users/show.h0000644000000000000000000000024112674201751030232 0ustar

    <%= notice %>

    Name: <%= @user.name %>

    <%= link_to 'Edit', edit_user_path(@user) %> | <%= link_to 'Back', users_path %> ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/app/views/users/edit.html.erb./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/app/views/users/edit.h0000644000000000000000000000015612674201751030204 0ustar

    Editing user

    <%= render 'form' %> <%= link_to 'Show', @user %> | <%= link_to 'Back', users_path %> ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/app/views/users/index.html.erb./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/app/views/users/index.0000644000000000000000000000067112674201751030220 0ustar

    Listing users

    <% @users.each do |user| %> <% end %>
    Name
    <%= user.name %> <%= link_to 'Show', user %> <%= link_to 'Edit', edit_user_path(user) %> <%= link_to 'Destroy', user, :confirm => 'Are you sure?', :method => :delete %>

    <%= link_to 'New User', new_user_path %> ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/app/views/users/_form.html.erb./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/app/views/users/_form.0000644000000000000000000000075412674201751030215 0ustar <%= form_for(@user) do |f| %> <% if @user.errors.any? %>

    <%= pluralize(@user.errors.count, "error") %> prohibited this user from being saved:

      <% @user.errors.full_messages.each do |msg| %>
    • <%= msg %>
    • <% end %>
    <% end %>
    <%= f.label :name %>
    <%= f.text_field :name %>
    <%= f.submit %>
    <% end %> ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/app/views/users/new.html.erb./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/app/views/users/new.ht0000644000000000000000000000011312674201751030225 0ustar

    New user

    <%= render 'form' %> <%= link_to 'Back', users_path %> ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/app/views/layouts/0000755000000000000000000000000012674201751027443 5ustar ././@LongLink0000644000000000000000000000016500000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/app/views/layouts/application.html.erb./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/app/views/layouts/appl0000644000000000000000000000031412674201751030320 0ustar Gemfile2pom <%= stylesheet_link_tag :all %> <%= javascript_include_tag :defaults %> <%= csrf_meta_tag %> <%= yield %> ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/lib/0000755000000000000000000000000012674201751024574 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/lib/tasks/0000755000000000000000000000000012674201751025721 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/lib/tasks/.gitkeep0000644000000000000000000000000012674201751027340 0ustar ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/big_gemfile2pom/Rakefile0000644000000000000000000000041712674201751025475 0ustar # Add your own tasks in files placed in lib/tasks ending in .rake, # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. require File.expand_path('../config/application', __FILE__) require 'rake' Gemfile2pom::Application.load_tasks ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/src/it/settings.xml0000644000000000000000000000155412674201751023366 0ustar it-repo true local.central @localRepositoryUrl@ true true local.central @localRepositoryUrl@ true true ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/pom.xml0000644000000000000000000000422312674201751021112 0ustar 4.0.0 parent-mojo de.saumya.mojo 1.0.0-beta-SNAPSHOT ../parent-mojo/pom.xml integration-tests pom integration tests where all plugins are needed true skip-some maven-invoker-plugin new_*/pom.xml integration-test install maven-invoker-plugin integration-test install run */pom.xml big_*/pom.xml new_latest_*/pom.xml pending_*/pom.xml ${localRepositoryPath} all maven-invoker-plugin big_*/pom.xml pending_*/pom.xml nothing ./jruby-maven-plugins-1.1.5.ds1.orig/integration-tests/.gitignore0000644000000000000000000000000712674201751021561 0ustar target ./jruby-maven-plugins-1.1.5.ds1.orig/README.md0000644000000000000000000001073412674201751015375 0ustar jruby maven plugins =================== [![Build Status](https://buildhive.cloudbees.com/job/torquebox/job/jruby-maven-plugins/badge/icon)](https://buildhive.cloudbees.com/job/torquebox/job/jruby-maven-plugins/) gem artifacts ------------- there is maven repository with torquebox.org which delivers gem (only ruby and java platform) from rubygems.org as gem-artifacts. adding this repository to pom.xml (or settings.xml) enables maven to use gem-artifacts like this rubygems-release http://rubygems-proxy.torquebox.org/releases . . . rubygems compass 0.12.2 gem now maven will resolve the transient dependencies of the compass gem and downloads the artifact (includng the gem file) into the local repository. the next question is how to use those artfacts: installing gems into you project directory ------------------------------------------ just add the gem-maven-plugin in your pom and execute the 'initialize'. that will install the gem artfacts and its depdencencies into 'target/rubygems' de.saumya.mojo gem-maven-plugin ${jruby.plugins.version} initialize the will added as test-resource in way that you can use them with ScriptingContainer (from jruby) - see [src/test/java/org/example/javasass/JavaSassTest.java](https://github.com/torquebox/jruby-maven-plugins/tree/master/gem-maven-plugin/src/it/include-rubygems-in-test-resources/src/test/java/org/example/javasass/JavaSassTest.java) from integration tests. example: execute bin/compass from the compass gem ------------------------------------------------- add the following to you pom de.saumya.mojo gem-maven-plugin @project.parent.version@ exec compile ${project.build.directory}/rubygems/bin/compass compile ${basedir}/src/main/webapp/resources/sass this will execute **compass** from the compass gem during the *compile* phase. you can further isolate the gems by moving the dependency from root level into the plugin. de.saumya.mojo gem-maven-plugin @project.parent.version@ exec compile ${project.build.directory}/rubygems/bin/compass compile ${basedir}/src/main/webapp/resources/sass rubygems compass 0.12.2 gem see also [gem-maven-plugin/src/it/execute-compass-with-gems-from-plugin](https://github.com/torquebox/jruby-maven-plugins/tree/master/gem-maven-plugin/src/it/execute-compass-with-gems-from-plugin) more examples ------------- for more example look into the integration test of the various plugins * [jruby-maven-plugin/src/it](https://github.com/torquebox/jruby-maven-plugins/tree/master/jruby-maven-plugin/src/it) * [gem-maven-plugin/src/it](https://github.com/torquebox/jruby-maven-plugins/tree/master/gem-maven-plugin/src/it) * . . . running the intergration tests ------------------------------ ``` mvn clean install -Pintegration-test -Pall ``` contributing ------------ 1. Fork it 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am 'Added some feature'`) 4. Push to the branch (`git push origin my-new-feature`) 5. Create new Pull Request meta-fu ------- enjoy :) ./jruby-maven-plugins-1.1.5.ds1.orig/pom.xml0000644000000000000000000000741412674201751015434 0ustar 4.0.0 org.sonatype.oss oss-parent 7 de.saumya.mojo jruby-maven-plugins pom 1.1.5 JRuby Maven Mojos aggregation project for various jruby related maven plugins http://github.com/mkristian/jruby-maven-plugins scm:git:git://github.com/torquebox/jruby-maven-plugins.git scm:git:ssh://git@github.com/torquebox/jruby-maven-plugins.git http://github.com/torquebox/jruby-maven-plugins MIT http://www.opensource.org/licenses/mit-license.php repo mkristian Christian Meier m.kristian@web.de junit junit 4.8.2 test sonatype https://oss.sonatype.org/content/repositories/snapshots/ false true ${basedir} ${root.dir}/target/rubygems ${root.dir}/target/rubygems UTF-8 true 3.0.3 1.7.3 1.0.10 7.5.1.v20110908 2.1.1 2.3.1 1.1.3 maven-compiler-plugin 2.3.2 1.5 1.5 maven-resources-plugin 2.4.3 maven-surefire-plugin 2.9 maven-jar-plugin 2.3 maven-dependency-plugin 2.1 parent-mojo gem-parent-mojo test-base-plugin test-parent-mojo jruby-maven-plugin gem-maven-plugin rspec-maven-plugin cucumber-maven-plugin gem-assembly-descriptors ruby-tools rake-maven-plugin runit-maven-plugin minitest-maven-plugin bundler-maven-plugin gem-extension gem-with-jar-extension ./jruby-maven-plugins-1.1.5.ds1.orig/gem-with-jar-extension/0000755000000000000000000000000012674201751020416 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-with-jar-extension/src/0000755000000000000000000000000012674201751021205 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-with-jar-extension/src/main/0000755000000000000000000000000012674201751022131 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-with-jar-extension/src/main/resources/0000755000000000000000000000000012674201751024143 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-with-jar-extension/src/main/resources/META-INF/0000755000000000000000000000000012674201751025303 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-with-jar-extension/src/main/resources/META-INF/plexus/0000755000000000000000000000000012674201751026623 5ustar ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-with-jar-extension/src/main/resources/META-INF/plexus/components.xml./jruby-maven-plugins-1.1.5.ds1.orig/gem-with-jar-extension/src/main/resources/META-INF/plexus/compo0000644000000000000000000000361212674201751027665 0ustar org.apache.maven.lifecycle.mapping.LifecycleMapping gem org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping de.saumya.mojo:gem-maven-plugin:initialize org.apache.maven.plugins:maven-resources-plugin:resources org.apache.maven.plugins:maven-compiler-plugin:compile org.apache.maven.plugins:maven-jar-plugin:jar org.apache.maven.plugins:maven-resources-plugin:testResources org.apache.maven.plugins:maven-compiler-plugin:testCompile org.apache.maven.plugins:maven-surefire-plugin:test de.saumya.mojo:gem-maven-plugin:package org.apache.maven.plugins:maven-install-plugin:install de.saumya.mojo:gem-maven-plugin:push org.apache.maven.artifact.handler.ArtifactHandler gem org.apache.maven.artifact.handler.DefaultArtifactHandler gem gem gem ruby false false ./jruby-maven-plugins-1.1.5.ds1.orig/gem-with-jar-extension/pom.xml0000644000000000000000000000347712674201751021746 0ustar 4.0.0 parent-mojo de.saumya.mojo 1.1.5 ../parent-mojo/pom.xml gem-with-jar-extension jar Gem with Jar Maven Extension org.eclipse.m2e lifecycle-mapping 1.0.0 org.codehaus.mojo build-helper-maven-plugin [1.4,) add-source org.apache.maven.plugins maven-dependency-plugin [2.1,) unpack-dependencies ./jruby-maven-plugins-1.1.5.ds1.orig/license.txt0000644000000000000000000000206512674201751016277 0ustar (The MIT License) Copyright (c) 2009 Kristian Meier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/0000755000000000000000000000000012674201751016040 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/0000755000000000000000000000000012674201751016627 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/main/0000755000000000000000000000000012674201751017553 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/main/ruby/0000755000000000000000000000000012674201751020534 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/main/ruby/create_pom.rb0000644000000000000000000000044712674201751023204 0ustar require 'java' java_import 'de.saumya.mojo.ruby.ScriptUtils' require ScriptUtils.getScriptFromResource('maven/tools/pom.rb').to_s require 'rubygems/package' class CreatePom def create(gemfile) Maven::Tools::POM.new( Gem::Package.new( gemfile ).spec ).to_s end end CreatePom.new ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/main/java/0000755000000000000000000000000012674201751020474 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/main/java/de/0000755000000000000000000000000012674201751021064 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/main/java/de/saumya/0000755000000000000000000000000012674201751022363 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/main/java/de/saumya/mojo/0000755000000000000000000000000012674201751023327 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/main/java/de/saumya/mojo/proxy/0000755000000000000000000000000012674201751024510 5ustar ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/main/java/de/saumya/mojo/proxy/HtmlDirectoryBuilder.java./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/main/java/de/saumya/mojo/proxy/HtmlDirectoryBuild0000644000000000000000000000211412674201751030202 0ustar /** * */ package de.saumya.mojo.proxy; import java.io.IOException; public class HtmlDirectoryBuilder { private StringBuilder html = new StringBuilder("\n"); public String toHTML(){ return html.toString(); } public void buildHeader(String title) throws IOException{ html.append("\n"); html.append("
    \n"); html.append(" ").append(title).append("\n"); html.append("
    \n"); html.append(" \n"); html.append(" parent
    \n"); html.append("
    \n"); } public void buildFooter() throws IOException{ html.append(" \n"); html.append("\n"); } public void buildDirectoryLink(String dirname) { html.append(" ").append(dirname).append("
    \n"); } public void buildFileLink(String name) { html.append(" ").append(name).append("
    \n"); } }././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/main/java/de/saumya/mojo/proxy/RubygemsApiVisitor.java./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/main/java/de/saumya/mojo/proxy/RubygemsApiVisitor0000644000000000000000000000410112674201751030236 0ustar package de.saumya.mojo.proxy; import org.yaml.snakeyaml.Yaml; import org.yaml.snakeyaml.constructor.SafeConstructor; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.net.URL; import java.util.List; import java.util.Map; import java.util.Set; import java.util.TreeSet; public abstract class RubygemsApiVisitor { private final Set versions = new TreeSet(); private final boolean prereleases; private Set brokenVersions; protected String gemname; public RubygemsApiVisitor(String gemname, boolean prereleases, Set brokenVersions) { this.gemname = gemname; this.prereleases = prereleases; this.brokenVersions = brokenVersions; } public void accept(URL url) throws IOException{ accept(new BufferedReader(new InputStreamReader(url.openStream()))); } @SuppressWarnings("unchecked") private void accept(BufferedReader reader) throws IOException { Yaml yaml = new Yaml(new SafeConstructor()); try { List> versionsYaml = (List>) yaml.load(reader); for (Map versionYaml : versionsYaml) { String number = versionYaml.get("number").toString(); String platform = versionYaml.get("platform").toString(); boolean prerelease = (Boolean) versionYaml.get("prerelease"); if ((!prereleases && !prerelease) || (prereleases && prerelease)) { if (!versions.contains(number) && (brokenVersions == null || !brokenVersions.contains(number)) && !platform.contains("x86-m")) { if (prereleases) { number += "-SNAPSHOT"; } addVersion(number); versions.add(number); } } } } finally { reader.close(); } } abstract protected void addVersion(String version); } ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/main/java/de/saumya/mojo/proxy/MavenMetadataBuilder.java./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/main/java/de/saumya/mojo/proxy/MavenMetadataBuild0000644000000000000000000000406612674201751030130 0ustar /** * */ package de.saumya.mojo.proxy; import java.io.IOException; import java.net.URL; import java.util.Set; public class MavenMetadataBuilder extends RubygemsApiVisitor { public static void main(String... args) throws Exception{ String first = null; for(int i = 1; i < 5; i ++){ long start = System.currentTimeMillis(); MavenMetadataBuilder visitor = new MavenMetadataBuilder("rails", true, Controller.BROKEN_GEMS.get("rails")); visitor.build(); System.err.println(System.currentTimeMillis() - start); System.out.println(visitor.toXML()); if(first == null){ first = visitor.toXML().replaceFirst(".* brokenVersions) { super(gemname, prereleases, brokenVersions); } private StringBuilder xml = new StringBuilder("\n"); public String toXML(){ return xml.toString(); } public void build() throws IOException{ xml.append("\n"); xml.append(" rubygems\n"); xml.append(" ").append(this.gemname).append("\n"); xml.append(" \n"); xml.append(" \n"); accept(new URL("https://rubygems.org/api/v1/versions/" + this.gemname + ".yaml")); xml.append(" \n"); xml.append(" ") // hardcoded timestamp so the dynamic sha1 is correct .append("19990909090909") .append("\n"); xml.append(" \n"); xml.append("\n"); } protected void addVersion(String version) { xml.append(" ").append(version).append("\n"); } } ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/main/java/de/saumya/mojo/proxy/Controller.java0000644000000000000000000003563312674201751027510 0ustar package de.saumya.mojo.proxy; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.io.UnsupportedEncodingException; import java.net.HttpURLConnection; import java.net.URL; import java.nio.charset.Charset; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; import java.util.TreeSet; import de.saumya.mojo.proxy.Controller.FileLocation.Type; import de.saumya.mojo.ruby.GemScriptingContainer; public class Controller { private static final String SHA1 = ".sha1"; private static final String RUBYGEMS_URL = "https://rubygems.org/gems"; private static final String RUBYGEMS_S3_URL = "http://s3.amazonaws.com/production.s3.rubygems.org/gems"; public static final String[] PLATFORMS = { "-universal-java-1.5", "-universal-java-1.6", "-universal-java-1.7", "-universal-java-1.8", "-universal-java", "-universal-jruby-1.2", "-jruby", "-java", "-universal-ruby-1.8.7", "-universal-ruby-1.9.2", "-universal-ruby-1.9.3", "-universal-ruby", "" }; static final Map> BROKEN_GEMS = new HashMap>(); static { // activeresource-2.0.0 does not exist !!! Set rails = new TreeSet(); rails.add("2.0.0"); BROKEN_GEMS.put("rails", rails); // juby-openssl-0.7.6 can not open gem with jruby-1.6.8 Set openssl = new TreeSet(); openssl.add("0.7.6"); BROKEN_GEMS.put("jruby-openssl", openssl); } private final File localStorage; private final GemScriptingContainer script = new GemScriptingContainer(); public static class FileLocation { enum Type { XML_CONTENT, HTML_CONTENT, ASCII_FILE, XML_FILE, REDIRECT, NOT_FOUND , ASCII_CONTENT, REDIRECT_TO_DIRECTORY, TEMP_UNAVAILABLE } public FileLocation() { this(null, null, null, Type.REDIRECT_TO_DIRECTORY); } public FileLocation(String message) { this(null, null, message, Type.NOT_FOUND); } public FileLocation(String content, Type type) { this(null, null, content, type); } public FileLocation(File local, Type type) { this(local, null, null, type); } public FileLocation(URL remote) { this(null, remote, null, Type.REDIRECT); } private FileLocation(File localFile, URL remoteFile, String content, Type type) { this.content = content; this.remoteUrl = remoteFile; this.localFile = localFile; this.type = type; } final File localFile; final URL remoteUrl; final String content; final Type type; } private final Object createPom; // assume there will be only one instance of this class per servlet container private final Set fileLocks = new HashSet(); public Controller(File storage) throws IOException{ this.localStorage = storage; this.localStorage.mkdirs(); this.createPom = script.runScriptletFromClassloader("create_pom.rb"); } public FileLocation locate(String path) throws IOException{ // release/rubygems/name/version // release/rubygems/name/version/ // release/rubygems/name/version/name-version.gem // release/rubygems/name/version/name-version.gem.md5 // release/rubygems/name/version/name-version.pom // release/rubygems/name/version/name-version.pom.md5 // release/rubygems/name // release/rubygems/name/ // release/rubygems/name/maven-metadata.xml path = path.replaceAll("/+", "/"); if(path.endsWith("/")){ path += "index.html"; } String[] parts = path.split("/"); if(parts.length == 0){ // TODO make listing with two directories 'releases', 'prereleases' return new FileLocation("for maven", Type.ASCII_CONTENT); } else { boolean prereleases = parts[0].contains("pre"); if(parts.length > 1 && !"rubygems".equals(parts[1])){ return notFound("Only rubygems/ groupId is supported through this proxy."); } switch(parts.length){ case 1: case 2: // TODO make listing with one directory 'rubygems' return notFound("directory listing not implemented"); case 3: if("index.html".equals(parts[2])) { return notFound("directory listing not implemented"); } else { return new FileLocation(); } case 4: if("maven-metadata.xml".equals(parts[3])){ return metadata(parts[2], prereleases); } else if(("maven-metadata.xml" + SHA1).equals(parts[3])){ return metadataSha1(parts[2], prereleases); } else if("index.html".equals(parts[3])){ return versionListDirectory(parts[2], path, prereleases); } else { return notFound("not found"); } case 5: String filename = parts[4].replace("-SNAPSHOT", ""); if("index.html".equals(filename)){ return directory(parts[2], parts[3], path); } if(filename.endsWith(".gem")){ // keep it backward compatible filename = filename.replace("-java.gem", ".gem"); File local = new File(localStorage, filename.replace(".gem", ".pom")); if(!local.exists()){ try { if (!createFiles(parts[2], parts[3])){ return new FileLocation(filename + " is being generated", Type.TEMP_UNAVAILABLE); } } catch (FileNotFoundException e) { return notFound("not found"); } } String url = null; for( String platform : PLATFORMS ) { url = RUBYGEMS_S3_URL + "/" + filename.replace(".gem", platform + ".gem"); if ( exists( url ) ) { break; } } return new FileLocation( new URL( url ) ); } if(filename.endsWith(SHA1) || filename.endsWith(".pom")){ File local = new File(localStorage, filename); if(!local.exists()){ try { if (!createFiles(parts[2], parts[3])){ return new FileLocation(filename + " is being generated", Type.TEMP_UNAVAILABLE); } } catch (FileNotFoundException e) { return notFound("not found"); } } return new FileLocation(local, filename.endsWith(SHA1)? Type.ASCII_FILE: Type.XML_FILE); } return notFound("not found"); default: return notFound("Completely unhandleable request!"); } } } public boolean exists(String url){ try { HttpURLConnection con = (HttpURLConnection) new URL(url).openConnection(); con.setRequestMethod("HEAD"); return con.getResponseCode() == HttpURLConnection.HTTP_OK; } catch (FileNotFoundException e) { //e.printStackTrace(); return false; } catch (IOException e) { e.printStackTrace(); return false; } } private FileLocation directory(String gemname, String version, String path) throws IOException { HtmlDirectoryBuilder builder = new HtmlDirectoryBuilder(); builder.buildHeader(path); String basename = gemname + "-" + version; String pomfile = basename + ".pom"; String gemfile = basename + ".gem"; builder.buildFileLink(pomfile); builder.buildFileLink(pomfile + SHA1); builder.buildFileLink(gemfile); builder.buildFileLink(gemfile + SHA1); builder.buildFooter(); return new FileLocation(builder.toHTML(), Type.HTML_CONTENT); } private boolean createFiles(String name, String version) throws IOException { String gemname = name + "-" + version.replace( "-SNAPSHOT", "" ); try { synchronized (fileLocks) { if (fileLocks.contains(gemname)) { return false; } else { fileLocks.add(gemname); } } File gemfile = new File(this.localStorage, gemname + ".gem"); File gemfileSha = new File(this.localStorage, gemname + ".gem" + SHA1); File pomfile = new File(this.localStorage, gemname + ".pom"); File pomfileSha = new File(this.localStorage, gemname + ".pom" + SHA1); if (!(gemfileSha.exists() && pomfile.exists() && pomfileSha.exists())) { String url = null; for( String platform : PLATFORMS ) { url = RUBYGEMS_URL + "/" + gemname + platform + ".gem"; try { downloadGemfile(gemfile, new URL(url)); break; } catch (FileNotFoundException ignore) { } } String pom = createPom(gemfile); writeUTF8(pomfile, pom); writeUTF8(pomfileSha, sha1(pom)); } // we do not keep the gemfile on disc gemfile.delete(); return true; } finally { synchronized (fileLocks) { fileLocks.remove(gemname); } } } private String createPom(File gemfile) { // protect the script container synchronized (script) { return script.callMethod(createPom, "create", gemfile.getAbsolutePath(), String.class) .replaceAll("&", "&").replaceAll("&amp;", "&"); } } private void downloadGemfile(File gemfile, URL url) throws IOException { InputStream input = null; OutputStream output = null; MessageDigest sha = newSha1Digest(); try { input = new BufferedInputStream(url.openStream()); output = new BufferedOutputStream(new FileOutputStream(gemfile)); int b = input.read(); while(b != -1){ output.write(b); sha.update((byte) b); b = input.read(); } } finally { if( input != null){ input.close(); } if( output != null){ output.close(); writeSha(new File(gemfile.getAbsolutePath() + SHA1), sha); } } } private void writeSha(File file, MessageDigest sha) throws IOException { writeUTF8(file, toHex(sha.digest())); } private void writeUTF8(File file, String content) throws IOException { PrintWriter writer = null; try { writer = new PrintWriter(new OutputStreamWriter(new FileOutputStream(file), Charset.forName("UTF-8"))); writer.print(content); } finally { if(writer != null){ writer.close(); } } } private FileLocation versionListDirectory(String name, String path, boolean prereleases) throws IOException { HtmlDirectoryBuilder html = new HtmlDirectoryBuilder(); html.buildHeader(path); VersionDirectoryBuilder builder = new VersionDirectoryBuilder(name, prereleases, html, BROKEN_GEMS.get(name)); builder.build(); html.buildFileLink("maven-metadata.xml"); html.buildFileLink("maven-metadata.xml" + SHA1); html.buildFooter(); return new FileLocation(html.toHTML(), Type.HTML_CONTENT); } private FileLocation notFound(String message) { return new FileLocation(message); } private FileLocation metadata(String name, boolean prereleases) throws IOException { MavenMetadataBuilder builder = new MavenMetadataBuilder(name, prereleases, BROKEN_GEMS.get(name)); builder.build(); return new FileLocation(builder.toXML(), Type.XML_CONTENT); } private FileLocation metadataSha1(String name, boolean prereleases) throws IOException { MavenMetadataBuilder builder = new MavenMetadataBuilder(name, prereleases, BROKEN_GEMS.get(name)); builder.build(); return new FileLocation(sha1(builder.toXML()), Type.ASCII_CONTENT); } private String sha1(String text) { MessageDigest md = newSha1Digest(); try { md.update(text.getBytes("UTF-8")); } catch (UnsupportedEncodingException e) { throw new RuntimeException("should not happen", e); } return toHex(md.digest()); } private MessageDigest newSha1Digest() { MessageDigest md; try { md = MessageDigest.getInstance("SHA-1"); } catch (NoSuchAlgorithmException e) { throw new RuntimeException("error getting sha1 instance", e); } return md; } private String toHex(byte[] data) { StringBuilder buf = new StringBuilder();//data.length * 2); for (byte b: data) { if(b < 0){ buf.append(Integer.toHexString(256 + b)); } else if(b < 16) { buf.append('0').append(Integer.toHexString(b)); } else { buf.append(Integer.toHexString(b)); } } return buf.toString(); } } ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/main/java/de/saumya/mojo/proxy/GemProxyServletContextListener.java./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/main/java/de/saumya/mojo/proxy/GemProxyServletCon0000644000000000000000000000310612674201751030212 0ustar package de.saumya.mojo.proxy; import java.io.File; import java.io.IOException; import javax.servlet.ServletContextEvent; import javax.servlet.ServletContextListener; public class GemProxyServletContextListener implements ServletContextListener { public void contextDestroyed(final ServletContextEvent sce) { } public void contextInitialized(final ServletContextEvent sce) { try { sce.getServletContext().setAttribute(Controller.class.getName(), new Controller(new File(getStorage(sce)))); sce.getServletContext().log("registered " + Controller.class.getName()); } catch (final IOException e) { throw new RuntimeException("error initializing controller", e); } } private String getStorage(final ServletContextEvent sce) { String value = System.getenv("GEM_PROXY_STORAGE"); if(value == null){ value = System.getProperty("gem.proxy.storage"); if(value == null){ value = sce.getServletContext().getInitParameter("gem-proxy-storage"); if (value == null){ throw new RuntimeException("could not find directory location for storage:\n" + "\tsystem property : gem.proxy.storage\n" + "\tenvironment variable : GEM_PROXY_STORAGE\n" + "\tcontext init parameter: gem-proxy-storage\n"); } } } return value; } } ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/main/java/de/saumya/mojo/proxy/VersionDirectoryBuilder.java./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/main/java/de/saumya/mojo/proxy/VersionDirectoryBu0000644000000000000000000000322712674201751030240 0ustar /** * */ package de.saumya.mojo.proxy; import java.io.IOException; import java.net.URL; import java.util.Set; public class VersionDirectoryBuilder extends RubygemsApiVisitor { public static void main(String... args) throws Exception{ String first = null; for(int i = 1; i < 3; i ++){ long start = System.currentTimeMillis(); HtmlDirectoryBuilder builder = new HtmlDirectoryBuilder(); VersionDirectoryBuilder visitor = new VersionDirectoryBuilder("rails", true, builder, Controller.BROKEN_GEMS.get("rails")); visitor.build(); System.err.println(System.currentTimeMillis() - start); if(first == null){ first = builder.toHTML(); } else { String xml = builder.toHTML(); System.err.println(first.equals(xml)); } } System.err.println(first); } private final HtmlDirectoryBuilder builder; public VersionDirectoryBuilder(String gemname, boolean prereleases, HtmlDirectoryBuilder html, Set brokenVersions) { super(gemname, prereleases, brokenVersions); this.builder = html; } public void build() throws IOException{ accept(new URL("http://rubygems.org/api/v1/versions/" + this.gemname + ".yaml")); } protected void addVersion(String version) { builder.buildDirectoryLink(version); } }././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/main/java/de/saumya/mojo/proxy/ControllerServlet.java./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/main/java/de/saumya/mojo/proxy/ControllerServlet.0000644000000000000000000000674212674201751030212 0ustar package de.saumya.mojo.proxy; import java.io.BufferedInputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import de.saumya.mojo.proxy.Controller.FileLocation; public class ControllerServlet extends HttpServlet { private static final long serialVersionUID = -1377408089637782007L; private Controller controller; @Override public void init() throws ServletException { super.init(); this.controller = (Controller) getServletContext().getAttribute(Controller.class.getName()); } @Override protected void doGet(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException { FileLocation file = controller.locate(req.getPathInfo().substring(1)); switch(file.type){ case NOT_FOUND: resp.sendError(HttpServletResponse.SC_NOT_FOUND, file.content); break; case XML_CONTENT: resp.setContentType("application/xml"); resp.setCharacterEncoding("utf-8"); resp.setHeader("Vary", "Accept"); write(resp, file.content); break; case XML_FILE: resp.setContentType("application/xml"); resp.setCharacterEncoding("utf-8"); resp.setHeader("Vary", "Accept"); write(resp, file.localFile); break; case HTML_CONTENT: resp.setContentType("text/html"); resp.setCharacterEncoding("utf-8"); resp.setHeader("Vary", "Accept"); write(resp, file.content); break; case ASCII_FILE: resp.setContentType("text/plain"); resp.setCharacterEncoding("ASCII"); write(resp, file.localFile); break; case ASCII_CONTENT: resp.setContentType("text/plain"); resp.setCharacterEncoding("ASCII"); write(resp, file.content); break; case REDIRECT_TO_DIRECTORY: resp.sendRedirect(req.getRequestURI() + "/"); break; case REDIRECT: resp.sendRedirect(file.remoteUrl.toString()); break; case TEMP_UNAVAILABLE: resp.setHeader("Retry-After", "120");//seconds resp.sendError(HttpServletResponse.SC_SERVICE_UNAVAILABLE, file.content); break; default: resp.sendError(HttpServletResponse.SC_NOT_FOUND, "Completely unhandleable request!"); } } private void write(HttpServletResponse resp, File localFile) throws IOException { OutputStream output = resp.getOutputStream(); InputStream input = null; try { input = new BufferedInputStream(new FileInputStream(localFile)); int c = input.read(); while(c != -1){ output.write(c); c = input.read(); } } finally { output.flush(); if(input != null){ input.close(); } } } private void write(HttpServletResponse resp, String content) throws IOException { PrintWriter writer = resp.getWriter(); writer.append(content); writer.flush(); } } ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/main/webapp/0000755000000000000000000000000012674201751021031 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/main/webapp/WEB-INF/0000755000000000000000000000000012674201751022060 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/main/webapp/WEB-INF/web.xml0000644000000000000000000000246012674201751023361 0ustar Maven Repository serving rubygems gem-proxy-storage /var/cache/gem-proxy de.saumya.mojo.proxy.GemProxyServletContextListener gems de.saumya.mojo.proxy.ControllerServlet default /releases/ default /releases/index.html default /prereleases default /prereleases/index.html gems /* index.html ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/main/webapp/prereleases/0000755000000000000000000000000012674201751023343 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/main/webapp/prereleases/index.html0000644000000000000000000000007412674201751025341 0ustar

    200 For Maven

    ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/main/webapp/releases/0000755000000000000000000000000012674201751022634 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/main/webapp/releases/index.html0000644000000000000000000000007412674201751024632 0ustar

    200 For Maven

    ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/it/0000755000000000000000000000000012674201751017243 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/it/load_leafy_with_jars/0000755000000000000000000000000012674201751023414 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/it/load_leafy_with_jars/verify.bsh0000644000000000000000000000042412674201751025416 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = ":jar:"; if ( ! log.contains( expected ) ) { throw new RuntimeException( "did not find jar dependencies in log file" ); } ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/it/load_leafy_with_jars/pom.xml0000644000000000000000000000202212674201751024725 0ustar 4.0.0 com.example load-leafy-without-jars 0.0.0 rubygems-releases http://localhost:8989/releases rubygems leafy-health 0.4.0 gem de.saumya.mojo gem-maven-plugin @project.parent.version@ false ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/it/load_leafy_with_jars/invoker.properties0000644000000000000000000000007512674201751027211 0ustar invoker.goals = dependency:list invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/it/directory-browsing/0000755000000000000000000000000012674201751023077 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/it/directory-browsing/src/0000755000000000000000000000000012674201751023666 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/it/directory-browsing/src/main/0000755000000000000000000000000012674201751024612 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/it/directory-browsing/src/main/ruby/0000755000000000000000000000000012674201751025573 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/it/directory-browsing/src/main/ruby/crawl.rb0000644000000000000000000000074612674201751027237 0ustar require 'net/http' require 'fileutils' class Crawl attr_accessor :target, :base_url def load(path) target_file = File.join(@target, File.basename(path)) target_file = "#{target_file}-index.html" if path =~ /\/$/ p File.basename(target_file) FileUtils.mkdir_p(File.dirname(target_file)) File.open(target_file, 'w') do |f| f.print Net::HTTP.get(URI.parse("#{base_url}/#{path}")) end end end ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/it/directory-browsing/pom.xml0000644000000000000000000000442712674201751024423 0ustar 4.0.0 com.example directory-browsing 0.0.0 de.saumya.mojo gem-maven-plugin @project.parent.version@ false test test exec verify verify exec ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/it/directory-browsing/invoker.properties0000644000000000000000000000007212674201751026671 0ustar invoker.goals = clean verify invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/it/load_leafy_without_jars/0000755000000000000000000000000012674201751024144 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/it/load_leafy_without_jars/verify.bsh0000644000000000000000000000041312674201751026144 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = ":jar:"; if ( log.contains( expected ) ) { throw new RuntimeException( "found jar dependencies in log file" ); } ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/it/load_leafy_without_jars/pom.xml0000644000000000000000000000202212674201751025455 0ustar 4.0.0 com.example load-leafy-without-jars 0.0.0 rubygems-releases http://localhost:8989/releases rubygems leafy-health 0.2.1 gem de.saumya.mojo gem-maven-plugin @project.parent.version@ false ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/it/load_leafy_without_jars/invoker.properties0000644000000000000000000000007512674201751027741 0ustar invoker.goals = dependency:list invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/it/load-signet-gem/0000755000000000000000000000000012674201751022217 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/it/load-signet-gem/verify.bsh0000644000000000000000000000074112674201751024223 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "Successfully installed signet-0.5.0"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } expected = "Successfully installed faraday-0.9.0.rc6"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); }./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/it/load-signet-gem/pom.xml0000644000000000000000000000225512674201751023540 0ustar 4.0.0 com.example load-railties-gems 0.0.0 rubygems-releases http://localhost:8989/releases rubygems signet 0.5.0 gem rubygems faraday 0.9.0.rc6 gem de.saumya.mojo gem-maven-plugin @project.parent.version@ false ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/it/load-signet-gem/invoker.properties0000644000000000000000000000010212674201751026003 0ustar invoker.goals = clean gem:initialize invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/it/load-copyright-header-gem/0000755000000000000000000000000012674201751024164 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/it/load-copyright-header-gem/verify.bsh0000644000000000000000000000047512674201751026174 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "Successfully installed copyright-header-1.0.3"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); }./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/it/load-copyright-header-gem/pom.xml0000644000000000000000000000202112674201751025474 0ustar 4.0.0 com.example load-railties-gems 0.0.0 rubygems-releases http://localhost:8989/releases rubygems copyright-header 1.0.3 gem de.saumya.mojo gem-maven-plugin @project.parent.version@ false ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/it/load-copyright-header-gem/invoker.properties0000644000000000000000000000010212674201751027750 0ustar invoker.goals = clean gem:initialize invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/it/load-heroku-gem/0000755000000000000000000000000012674201751022223 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/it/load-heroku-gem/verify.bsh0000644000000000000000000000047412674201751024232 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "Successfully installed heroku_hatchet-1.3.4"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/it/load-heroku-gem/pom.xml0000644000000000000000000000206312674201751023541 0ustar 4.0.0 com.example load-railties-gems 0.0.0 rubygems-releases http://localhost:8989/releases rubygems heroku_hatchet 1.3.4 gem de.saumya.mojo gem-maven-plugin @project.parent.version@ false ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/it/load-heroku-gem/invoker.properties0000644000000000000000000000010212674201751026007 0ustar invoker.goals = clean gem:initialize invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/it/load-therubyrhino-gem/0000755000000000000000000000000012674201751023450 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/it/load-therubyrhino-gem/verify.bsh0000644000000000000000000000050012674201751025445 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "Successfully installed therubyrhino-1.72.4-java"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/it/load-therubyrhino-gem/pom.xml0000644000000000000000000000201612674201751024764 0ustar 4.0.0 com.example load-railties-gems 0.0.0 rubygems-releases http://localhost:8989/releases rubygems therubyrhino 1.72.4 gem de.saumya.mojo gem-maven-plugin @project.parent.version@ false ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/it/load-therubyrhino-gem/invoker.properties0000644000000000000000000000010212674201751027234 0ustar invoker.goals = clean gem:initialize invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/it/load-bundler-prerelease-gem/0000755000000000000000000000000012674201751024506 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/it/load-bundler-prerelease-gem/verify.bsh0000644000000000000000000000044012674201751026506 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "1 gem installed"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/it/load-bundler-prerelease-gem/pom.xml0000644000000000000000000000202412674201751026021 0ustar 4.0.0 com.example load-bunder-pre-gems 0.0.0 rubygems-prereleases http://localhost:8989/prereleases rubygems bundler 1.2.0.pre gem de.saumya.mojo gem-maven-plugin @project.parent.version@ false ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/it/load-bundler-prerelease-gem/invoker.properties0000644000000000000000000000010212674201751030272 0ustar invoker.goals = clean gem:initialize invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/it/load-bundler-gem/0000755000000000000000000000000012674201751022361 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/it/load-bundler-gem/verify.bsh0000644000000000000000000000043712674201751024367 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "1 gem installed"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); }./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/it/load-bundler-gem/pom.xml0000644000000000000000000000201012674201751023667 0ustar 4.0.0 com.example load-railties-gems 0.0.0 rubygems-releases http://localhost:8989/releases rubygems bundler 1.1.4 gem de.saumya.mojo gem-maven-plugin @project.parent.version@ false ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/it/load-bundler-gem/invoker.properties0000644000000000000000000000010212674201751026145 0ustar invoker.goals = clean gem:initialize invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/it/load-json-java-gem/0000755000000000000000000000000012674201751022616 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/it/load-json-java-gem/verify.bsh0000644000000000000000000000046712674201751024627 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "Successfully installed json-1.7.6-java"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/it/load-json-java-gem/pom.xml0000644000000000000000000000200512674201751024130 0ustar 4.0.0 com.example load-railties-gems 0.0.0 rubygems-releases http://localhost:8989/releases rubygems json 1.7.6 gem de.saumya.mojo gem-maven-plugin @project.parent.version@ false ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/it/load-json-java-gem/invoker.properties0000644000000000000000000000010212674201751026402 0ustar invoker.goals = clean gem:initialize invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/it/load-compass-gem/0000755000000000000000000000000012674201751022373 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/it/load-compass-gem/verify.bsh0000644000000000000000000000073012674201751024375 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "Successfully installed compass-0.12.2"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } expected = "Successfully installed sass-"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/it/load-compass-gem/pom.xml0000644000000000000000000000201112674201751023702 0ustar 4.0.0 com.example load-railties-gems 0.0.0 rubygems-releases http://localhost:8989/releases rubygems compass 0.12.2 gem de.saumya.mojo gem-maven-plugin @project.parent.version@ false ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/it/load-compass-gem/invoker.properties0000644000000000000000000000010212674201751026157 0ustar invoker.goals = clean gem:initialize invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/src/it/settings.xml0000644000000000000000000000112612674201751021625 0ustar it-repo true local.central @localRepositoryUrl@ true true ./jruby-maven-plugins-1.1.5.ds1.orig/gem-proxy/pom.xml0000644000000000000000000001331112674201751017354 0ustar 4.0.0 jruby-maven-plugins de.saumya.mojo 1.0.10-SNAPSHOT gem-proxy war Rubygems as Maven Repository Webapp http://github.com/mkristian/jruby-maven-plugins de.saumya.mojo ruby-tools ${project.version} org.codehaus.plexus plexus-classworlds ant ant org.apache.maven maven-model org.codehaus.plexus plexus-velocity org.codehaus.plexus plexus-component-annotations org.codehaus.plexus plexus-container-default org.codehaus.plexus plexus-utils org.codehaus.plexus plexus-archiver javax.servlet servlet-api 2.5 provided org.jruby jruby-complete 1.7.19 rubygems src/main/ruby maven-deploy-plugin 2.4 true org.mortbay.jetty jetty-maven-plugin ${jetty.version} 10 gem.proxy.storage ${project.build.directory}/storage jetty.port 8989 skip-some maven-invoker-plugin */pom.xml integration-test true install maven-invoker-plugin 1.5 src/it ${project.build.directory}/it setup.bsh verify.bsh integration-test install run src/it/settings.xml ${project.build.directory}/local-repo org.mortbay.jetty jetty-maven-plugin 4711 gem-proxy start-jetty pre-integration-test run 0 true stop-jetty post-integration-test stop ./jruby-maven-plugins-1.1.5.ds1.orig/.gitignore0000644000000000000000000000011512674201751016076 0ustar *~ target *.gpg .classpath .settings .project tmp *Backup release.properties ./jruby-maven-plugins-1.1.5.ds1.orig/.travis.yml0000644000000000000000000000024512674201751016223 0ustar language: java sudo: false install: mvn install -Dmaven.test.skip -Dinvoker.skip;cd jruby9;mvn install -Dmaven.test.skip -Dinvoker.skip script: cd jruby9;mvn verify ./jruby-maven-plugins-1.1.5.ds1.orig/TODO0000644000000000000000000000044312674201751014602 0ustar * assets:precompile needs env=production to avod respawning rake * minispec needs spec dir in load path * deprecate rails:new rails:pom gem:pom * allow system gems * jquery-rails has deps to rails. from version 2.0.0 it is rails-3.2.x, otherwise rails-3.x. that fails maven deps resolution ./jruby-maven-plugins-1.1.5.ds1.orig/rake-maven-plugin/0000755000000000000000000000000012674201751017433 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/rake-maven-plugin/src/0000755000000000000000000000000012674201751020222 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/rake-maven-plugin/src/main/0000755000000000000000000000000012674201751021146 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/rake-maven-plugin/src/main/java/0000755000000000000000000000000012674201751022067 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/rake-maven-plugin/src/main/java/de/0000755000000000000000000000000012674201751022457 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/rake-maven-plugin/src/main/java/de/saumya/0000755000000000000000000000000012674201751023756 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/rake-maven-plugin/src/main/java/de/saumya/mojo/0000755000000000000000000000000012674201751024722 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/rake-maven-plugin/src/main/java/de/saumya/mojo/rake/0000755000000000000000000000000012674201751025644 5ustar ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/rake-maven-plugin/src/main/java/de/saumya/mojo/rake/RakeMojo.java./jruby-maven-plugins-1.1.5.ds1.orig/rake-maven-plugin/src/main/java/de/saumya/mojo/rake/RakeMojo.ja0000644000000000000000000000307212674201751027671 0ustar package de.saumya.mojo.rake; import java.io.File; import java.io.IOException; import org.apache.maven.plugin.MojoExecutionException; import de.saumya.mojo.gem.AbstractGemMojo; import de.saumya.mojo.ruby.gems.GemException; import de.saumya.mojo.ruby.script.Script; import de.saumya.mojo.ruby.script.ScriptException; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.plugins.annotations.ResolutionScope; /** * maven wrapper around the rake command. * * deprecated - use gem:exec or jruby9:exec with rake command instead */ @Deprecated @Mojo(name = "rake", requiresDependencyResolution = ResolutionScope.TEST) public class RakeMojo extends AbstractGemMojo { /** * rakefile to be used for the rake command. */ @Parameter(property = "rake.file") private final File rakefile = null; /** * arguments for the rake command. */ @Parameter(property = "rake.args") private final String rakeArgs = null; @Override public void executeWithGems() throws MojoExecutionException, ScriptException, IOException, GemException { final Script script = this.factory.newScriptFromJRubyJar("rake"); if (this.rakefile != null){ script.addArg("-f", this.rakefile); } if (this.rakeArgs != null) { script.addArgs(this.rakeArgs); } if (this.args != null) { script.addArgs(this.args); } script.executeIn(launchDirectory()); } } ./jruby-maven-plugins-1.1.5.ds1.orig/rake-maven-plugin/src/it/0000755000000000000000000000000012674201751020636 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/rake-maven-plugin/src/it/rake-file/0000755000000000000000000000000012674201751022475 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/rake-maven-plugin/src/it/rake-file/verify.bsh0000644000000000000000000000042112674201751024474 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); if ( !log.contains( "do something meaningful" ) ) { throw new RuntimeException( "log file does not contain 'do something meaningful'" ); }./jruby-maven-plugins-1.1.5.ds1.orig/rake-maven-plugin/src/it/rake-file/file0000644000000000000000000000011612674201751023335 0ustar desc 'do something meaningful' task :something do puts "did something" end ./jruby-maven-plugins-1.1.5.ds1.orig/rake-maven-plugin/src/it/rake-file/test.properties0000644000000000000000000000003412674201751025567 0ustar rake.args=-T rake.file=file ./jruby-maven-plugins-1.1.5.ds1.orig/rake-maven-plugin/src/it/rake-file/pom.xml0000644000000000000000000000176412674201751024022 0ustar 4.0.0 de.saumya.mojo rake-file testing rubygems-releases http://rubygems-proxy.torquebox.org/releases rubygems rake 0.8.7 gem de.saumya.mojo rake-maven-plugin @project.version@ true ./jruby-maven-plugins-1.1.5.ds1.orig/rake-maven-plugin/src/it/rake-file/invoker.properties0000644000000000000000000000012212674201751026263 0ustar invoker.goals = de.saumya.mojo:rake-maven-plugin:rake invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/rake-maven-plugin/src/it/rake-somewhere/0000755000000000000000000000000012674201751023554 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/rake-maven-plugin/src/it/rake-somewhere/verify.bsh0000644000000000000000000000042212674201751025554 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); if ( !log.contains( "do something meaningful" ) ) { throw new RuntimeException( "log file does not contain 'do something meaningful'" ); }./jruby-maven-plugins-1.1.5.ds1.orig/rake-maven-plugin/src/it/rake-somewhere/test.properties0000644000000000000000000000001512674201751026645 0ustar rake.args=-T ./jruby-maven-plugins-1.1.5.ds1.orig/rake-maven-plugin/src/it/rake-somewhere/pom.xml0000644000000000000000000000254612674201751025100 0ustar 4.0.0 de.saumya.mojo jruby-version testing rubygems-releases http://rubygems-proxy.torquebox.org/releases rubygems rake 0.9.2.2 gem de.saumya.mojo gem-maven-plugin @project.version@ true de.saumya.mojo rake-maven-plugin @project.version@ somewhere ./jruby-maven-plugins-1.1.5.ds1.orig/rake-maven-plugin/src/it/rake-somewhere/somewhere/0000755000000000000000000000000012674201751025552 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/rake-maven-plugin/src/it/rake-somewhere/somewhere/rakefile0000644000000000000000000000011612674201751027255 0ustar desc 'do something meaningful' task :something do puts "did something" end ./jruby-maven-plugins-1.1.5.ds1.orig/rake-maven-plugin/src/it/rake-somewhere/invoker.properties0000644000000000000000000000012212674201751027342 0ustar invoker.goals = de.saumya.mojo:rake-maven-plugin:rake invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/rake-maven-plugin/src/it/rake-tasks/0000755000000000000000000000000012674201751022703 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/rake-maven-plugin/src/it/rake-tasks/verify.bsh0000644000000000000000000000042112674201751024702 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); if ( !log.contains( "do something meaningful" ) ) { throw new RuntimeException( "log file does not contain 'do something meaningful'" ); }./jruby-maven-plugins-1.1.5.ds1.orig/rake-maven-plugin/src/it/rake-tasks/rakefile0000644000000000000000000000011612674201751024406 0ustar desc 'do something meaningful' task :something do puts "did something" end ./jruby-maven-plugins-1.1.5.ds1.orig/rake-maven-plugin/src/it/rake-tasks/test.properties0000644000000000000000000000001512674201751025774 0ustar rake.args=-T ./jruby-maven-plugins-1.1.5.ds1.orig/rake-maven-plugin/src/it/rake-tasks/pom.xml0000644000000000000000000000176412674201751024230 0ustar 4.0.0 de.saumya.mojo rake-task testing rubygems-releases http://rubygems-proxy.torquebox.org/releases rubygems rake 0.8.7 gem de.saumya.mojo rake-maven-plugin @project.version@ true ./jruby-maven-plugins-1.1.5.ds1.orig/rake-maven-plugin/src/it/rake-tasks/invoker.properties0000644000000000000000000000012212674201751026471 0ustar invoker.goals = de.saumya.mojo:rake-maven-plugin:rake invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/rake-maven-plugin/src/it/settings.xml0000644000000000000000000000155412674201751023225 0ustar it-repo true local.central @localRepositoryUrl@ true true local.central @localRepositoryUrl@ true true ./jruby-maven-plugins-1.1.5.ds1.orig/rake-maven-plugin/pom.xml0000644000000000000000000000420612674201751020752 0ustar 4.0.0 gem-parent-mojo de.saumya.mojo 1.1.5 ../gem-parent-mojo/pom.xml rake-maven-plugin maven-plugin Rake Maven Mojo org.eclipse.m2e lifecycle-mapping 1.0.0 org.apache.maven.plugins maven-dependency-plugin [2.1,) unpack-dependencies org.codehaus.mojo build-helper-maven-plugin [1.4,) add-source ./jruby-maven-plugins-1.1.5.ds1.orig/gem-parent-mojo/0000755000000000000000000000000012674201751017112 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/gem-parent-mojo/pom.xml0000644000000000000000000000142112674201751020425 0ustar 4.0.0 parent-mojo de.saumya.mojo 1.1.5 ../parent-mojo/pom.xml gem-parent-mojo pom Gem Mojo Parent ${project.parent.groupId} gem-maven-plugin ${project.parent.version} ./jruby-maven-plugins-1.1.5.ds1.orig/History.txt0000644000000000000000000000307112674201751016314 0ustar === 0.28.0 / 2011-06-21 * run rspec with a list of jruby-versions and both for 1.8 and 1.9. producing a little summary at the end * runit mojo for testcases * add src/main/ruby and lib directory to load-path if exist * add src/main/ruby to classloader so java classes can find the scripts * add rubygems to test-resources, i.e. to test-classloader so java tests can use them (via scripting containers) * added assembly descriptors for packaging "uberjar" with all dependencies inside a single jar (jar as well gem dependencies) * gem-proxy is a total rewrite and comes with directory browsing for all but ONE directory. the pom generation is the same as done by the gem mojo and maven-metadata.xml is generated on the fly i.e. is up to date to rubygems.org * general improvements in Gemfile, gemspec tp pom convertion. rspec, etc. === 0.26.0 / 2011-03-30 * new bundle install mojo to allow to use Gemfile as pom * better Gemfile to pom support * fixes in gemify * allow to use gem dependencies inside plugin * gem:push mojo added to have a compete life-cycle for gem artifacts === 0.12.0 / 2010-05-14 * maven archetypes for rails2 and rails3 (inspired by email from Reto Schttel) * added rspec-maven-plugin (by Bob McWhirter previous mojo.codehaus.org) * more integration tests * compile goal can generate java code (as jrubyc from version 1.5.0 onwards can do) * updated version to jruby-1.5.0, jruby-rack-0.9.7, rails-3.0.0.beta3 * unified parameters for goals in rails2-plugin and rails3-plugin * better offline support * lots of little improvements here and there ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/0000755000000000000000000000000012674201751017625 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/0000755000000000000000000000000012674201751020414 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/main/0000755000000000000000000000000012674201751021340 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/main/ruby/0000755000000000000000000000000012674201751022321 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/main/ruby/de/0000755000000000000000000000000012674201751022711 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/main/ruby/de/saumya/0000755000000000000000000000000012674201751024210 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/main/ruby/de/saumya/mojo/0000755000000000000000000000000012674201751025154 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/main/ruby/de/saumya/mojo/rspec/0000755000000000000000000000000012674201751026270 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/main/ruby/de/saumya/mojo/rspec/rspec1/0000755000000000000000000000000012674201751027465 5ustar ././@LongLink0000644000000000000000000000020600000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/main/ruby/de/saumya/mojo/rspec/rspec1/maven_console_progress_formatter.rb./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/main/ruby/de/saumya/mojo/rspec/rspec1/ma0000644000000000000000000000532212674201751030007 0ustar require 'spec/runner/formatter/base_formatter' class MojoLog def info(str) puts str end end MOJO_LOG = MojoLog.new class MavenConsoleProgressFormatter < Spec::Runner::Formatter::BaseFormatter def initialize(options, where) super( options, where ) @first = true @passing = [] @pending = [] @failing = [] @filename = nil end def example_group_started(example_group) #MOJO_LOG.info( "spec dir #{SPEC_DIR}") #MOJO_LOG.info( "location #{example_group.location}" ) unless ( @first ) MOJO_LOG.info( " #{@passing.size} passing; #{@failing.size} failing; #{@pending.size} pending") end @first = false @passing = [] @pending = [] @failing = [] example_group.location =~ /^(.*):([0-9])+/ filename = $1 lineno = $2 filename = filename[ SPEC_DIR.length..-1 ] if ( filename[0,1] == "/" ) filename = filename[1..-1] end unless ( @filename == filename ) @filename = filename MOJO_LOG.info( "SPEC: #{@filename}" ) end MOJO_LOG.info( " - #{example_group.description}" ) super( example_group ) end def example_passed(example) @passing << example end def example_pending(example, message) @pending << example end def example_failed(example, counter, failure) @failing << example end def dump_summary(duration, example_count, failure_count, pending_count) unless ( @first ) MOJO_LOG.info( " #{@passing.size} passing; #{@failing.size} failing; #{@pending.size} pending") end pass_count = example_count - ( failure_count + pending_count ) MOJO_LOG.info( "=========================================" ) MOJO_LOG.info( "TOTAL: #{pass_count} passing; #{failure_count} failing; #{pending_count} pending") if SUMMARY_REPORT # Creating the XML report FileUtils.mkdir_p File.dirname SUMMARY_REPORT content = " \n" # Passing @passing.each { |test| content = content + "\n" } # Pending - considering as failures @pending.each { |test| content = content + "\n" } # Failures @failing.each { |test| content = content + "\n" } content = content + "" File.open(SUMMARY_REPORT, 'w+') {|f| f.write(content) } end end end ././@LongLink0000644000000000000000000000017500000000000011606 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/main/ruby/de/saumya/mojo/rspec/rspec1/maven_surefire_reporter.rb./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/main/ruby/de/saumya/mojo/rspec/rspec1/ma0000644000000000000000000001100612674201751030003 0ustar require 'spec/runner/formatter/base_formatter' class FileInfo attr_accessor :path attr_accessor :groups def initialize(path) @path = path @groups = [] end def duration @groups.inject(0){|sum,e|sum+=e.duration} end def examples @groups.collect{|e| e.examples}.flatten end def passing @groups.collect{|e| e.passing}.flatten end def failing @groups.collect{|e| e.failing}.flatten end def pending @groups.collect{|e| e.pending}.flatten end end class GroupInfo attr_accessor :rspec_group attr_accessor :examples def initialize(rspec_group) @rspec_group = rspec_group @examples = [] end def duration @examples.inject(0){|sum,e|sum+=e.duration} end def passing @examples.select{|e| e.status == :passing } end def failing @examples.select{|e| e.status == :failing } end def pending @examples.select{|e| e.status == :pending } end end class ExampleInfo attr_accessor :rspec_example attr_accessor :duration attr_accessor :status attr_accessor :failure attr_accessor :message def initialize(rspec_example) @rspec_example = rspec_example @duration = 0 @start_time = Time.now @status = :pending end def finish() @duration = ( Time.now - @start_time ).to_f end end class MavenSurefireReporter < Spec::Runner::Formatter::BaseFormatter attr_accessor :output def initialize(options, output) super( options, output ) @file_info = {} @output = output @current_file_info = nil @current_group_info = nil @current_example_info = nil end def files @file_info.values end def example_group_started(example_group) setup_current_file_info( example_group ) setup_current_group_info( example_group ) @current_group = example_group end def setup_current_file_info(example_group) filename = filename_for( example_group ) @current_file_info = @file_info[ filename ] if ( @current_file_info.nil? ) @current_file_info = FileInfo.new( filename ) @file_info[ filename ] = @current_file_info end end def setup_current_group_info(example_group) @current_group_info = GroupInfo.new( example_group ) @current_file_info.groups << @current_group_info end def setup_current_example_info(example) @current_example_info = ExampleInfo.new( example ) @current_group_info.examples << @current_example_info end def filename_for(example_group) example_group.location =~ /^(.*):([0-9])+/ filename = $1 lineno = $2 filename = filename[ SPEC_DIR.length..-1 ] if ( filename[0,1] == "/" ) filename = filename[1..-1] end filename end def example_started(example) example_finished() unless ( @current_example.nil? ) setup_current_example_info( example ) end def example_finished() @current_example_info.finish @current_example_info = nil end def example_passed(example) @current_example_info.status = :passing example_finished end def example_failed(example, counter, failure) return unless @current_example_info @current_example_info.status = :failing @current_example_info.failure = failure example_finished end def example_pending(example, message) @current_example_info.status = :pending @current_example_info.failure = message example_finished end def xml_escape(str) str.gsub( /&/, '&' ).gsub( /"/, '"' ) end def start_dump files.each do |f| output_filename = File.join( output, "TEST-#{File.basename(f.path, '.rb')}" ) + '.xml' FileUtils.mkdir_p( File.dirname( output_filename ) ) File.open( output_filename, 'w' ) do |output| output.puts( %Q() ) output.puts( %Q() ) f.groups.each do |g| g.examples.each do |ex| case_name = xml_escape( g.rspec_group.description + ' ' + ex.rspec_example.description ) output.puts( %Q( ) ) if ( ex.status == :pending ) output.puts( %Q( ) ) elsif ( ex.status == :failing ) output.puts( %Q( ) ) end output.puts( %Q( ) ) end end output.puts( %Q() ) end end end end ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/main/ruby/de/saumya/mojo/rspec/rspec3/0000755000000000000000000000000012674201751027467 5ustar ././@LongLink0000644000000000000000000000017500000000000011606 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/main/ruby/de/saumya/mojo/rspec/rspec3/maven_surefire_reporter.rb./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/main/ruby/de/saumya/mojo/rspec/rspec3/ma0000644000000000000000000001200012674201751030000 0ustar require 'rspec/core/formatters/base_formatter' require 'rspec/core/formatters/snippet_extractor' require 'fileutils' class MavenSurefireReporter < RSpec::Core::Formatters::BaseFormatter RSpec::Core::Formatters.register self, :dump_summary, :example_passed, :dump_pending, :dump_failures attr_reader :passing_examples, :pending_examples, :failed_examples def initialize(output) @started_at = Time.now @passing_examples = [] end def example_passed(notification) @passing_examples << notification.example end def dump_pending(notification) @pending_examples = notification.pending_examples end def dump_failures(notification) @failed_examples = notification.failed_examples end def dump_summary(summary) elapsed = Time.now - @started_at reporter = self extractor = SnippetExtractor.new report_file = File.join( TARGET_DIR, 'surefire-reports', 'TEST-rspec.xml' ) FileUtils.mkdir_p( File.dirname( report_file ) ) File.open( report_file, 'w' ) do |report_io| Emitter.new( report_io ) do tag( :testsuite, :time=>summary.duration, :errors=>0, :tests=>summary.example_count, :skipped=>summary.pending_count, :failures=>summary.failure_count, :name=>File.basename( BASE_DIR ) ) do reporter.passing_examples.each do |ex| class_name = File.basename( ex.metadata[:file_path], '_spec.rb' ) tag( :testcase, :time=>ex.metadata[:execution_result][:run_time], :classname=>class_name, :name=>ex.metadata[:description] ) end reporter.pending_examples.each do |ex| class_name = File.basename( ex.metadata[:file_path], '_spec.rb' ) tag( :testcase, :time=>ex.metadata[:elapsed], :classname=>class_name, :name=>ex.metadata[:description] ) do tag( :skipped ) end end reporter.failed_examples.each do |ex| class_name = File.basename( ex.metadata[:file_path], '_spec.rb' ) exception = ex.metadata[:execution_result][:exception] tag( :testcase, :time=>ex.metadata[:execution_result][:run_time], :classname=>class_name, :name=>ex.metadata[:description] ) do relevant_line = reporter.find_relevant_line( ex, exception ) tag( :failure, :message=>relevant_line ) do content( exception.backtrace() ) end end end end end end end def find_relevant_line(example, exception) match_prefix = example.metadata[:file_path].to_s file_line = nil exception.backtrace.each do |stack_line| if ( stack_line.to_s[0, match_prefix.length] == match_prefix ) file_line = stack_line break end end if ( file_line ) file, line, junk = file_line.split( ':' ) if ( File.exist?( file ) ) lines = File.readlines( file ) return lines[line.to_i-1].strip end end nil end class Converter def convert(code,pre) code end end class Emitter def initialize(io, &block) @io = io @indent = 0 @tag_stack = [] decl instance_eval &block if block end def decl @io.puts( %q() ) end def tag(tag_name, attrs={}, &block) if ( block ) start_tag( tag_name, attrs ) instance_eval &block if block end_tag() else start_tag( tag_name, attrs, false ) end end def start_tag(tag_name, attrs={}, has_body=true) if ( has_body ) @tag_stack.push( tag_name ) @io.puts( indent + "<#{tag_name}#{attributes(attrs)}>" ) @indent = @indent + 1 else @io.puts( indent + "<#{tag_name}#{attributes(attrs)}/>" ) end end def content(str) str.each do |line| @io.puts( indent + escape( line.strip ) ) end end def end_tag() @indent = @indent - 1 @io.puts( indent + "" ) end def attributes(attrs) str = attrs.entries.map{|e| e.first.to_s + "=" + quote(e.last.to_s) }.join( ' ' ) str.strip! return '' if str.empty? " #{str}" end def quote(str) %q(") + escape( str ) + %q(") end def escape(str) str.gsub( /&/, '&' ).gsub( /"/, '"' ).gsub( //, '>' ) end def indent() " " * @indent end end class SnippetExtractor def snippet_for(error_line) if error_line =~ /(.*):(\d+)/ file = $1 line = $2.to_i [lines_around(file, line), line] else ["# Couldn't get snippet for #{error_line}", 1] end end def lines_around(file, line) if File.file?(file) lines = File.open(file).read.split("\n") min = [0, line-3].max max = [line+1, lines.length-1].min selected_lines = [] selected_lines.join("\n") lines[min..max].join("\n") else "# Couldn't get snippet for #{file}" end end end end ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/main/ruby/de/saumya/mojo/rspec/rspec2/0000755000000000000000000000000012674201751027466 5ustar ././@LongLink0000644000000000000000000000020600000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/main/ruby/de/saumya/mojo/rspec/rspec2/maven_console_progress_formatter.rb./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/main/ruby/de/saumya/mojo/rspec/rspec2/ma0000644000000000000000000001053112674201751030006 0ustar require 'rspec/core/formatters/base_formatter' class MavenConsoleProgressFormatter < RSpec::Core::Formatters::BaseFormatter def initialize(output) super( output ) @printed_stacks = {} @started_at = Time.now end def current_file @current_file end def current_line @current_line end def set_location(hash) set_current_file( hash[:file_path] ) set_current_line( hash[:line_number] ) end def set_current_file(path) @current_file = relative_path( path ) end def set_current_line(line_number) @current_line = line_number end def relative_path(path) if Pathname.new( path ).relative? && Pathname.new( BASE_DIR ).absolute? File.join( BASE_DIR, path ) else Pathname.new( path ).relative_path_from( Pathname.new( BASE_DIR ) ) end end def spec_file_started(spec_file) spec_file.metadata[:started_at] = Time.now meta = spec_file.metadata[:example_group] set_location( meta ) @file_passing = [] @file_failing = [] @file_pending = [] puts "** #{current_file}" end def example_group_started(example_group) super if ( example_group.top_level? ) file_path = example_group.metadata[:example_group][:file_path] file_path = relative_path( file_path ) if ( current_file != file_path ) spec_file_started( example_group ) end end end def example_started(example) super example.metadata[:spec_file_path] = current_file set_location( example.metadata ) node = example.metadata[:example_group] depth = print_stack(node) + 1 print "#{" " * depth}#{example.metadata[:description]}" end def example_passed(example) super @file_passing << example example_completed(example) end def example_failed(example) super @file_failing << example example_completed(example, :failed) end def example_pending(example) super @file_pending << example example_completed(example, :pending) end def example_completed(example, status=nil) elapsed = Time.now - example.metadata[:execution_result][:started_at] print " - #{elapsed}s" if ( status ) print " #{status.to_s.upcase}" end puts "" end def print_stack(node) depth = 1 if ( node[:example_group] ) depth = depth + print_stack( node[:example_group] ) end puts "#{" " * depth }#{node[:description]}" unless @printed_stacks[node[:description]] @printed_stacks[node[:description]] = true depth end def example_finished(example) super end def example_group_finished(example_group) super end =begin def spec_file_finished(spec_file) elapsed = Time.now - spec_file.metadata[:started_at] puts ">> #{current_file} : #{elapsed}s : #{@file_passing.size} passing, #{@file_pending.size} pending, #{@file_failing.size} failing" end =end # Dump def start_dump end def dump_failures() super return if ( failed_examples.empty? ) puts "------------------------------------------------------------------------" puts "Failures" dump_example_list( failed_examples ) end def dump_pending() super return if ( pending_examples.empty? ) puts "------------------------------------------------------------------------" puts "Pending" dump_example_list( pending_examples ) end def dump_example_list(examples) spec_file_path = nil examples.each do |example| if ( example.metadata[:spec_file_path] != spec_file_path ) spec_file_path = example.metadata[:spec_file_path] puts " #{spec_file_path}" end puts " #{example.metadata[:line_number]}:#{example.metadata[:full_description]}" end end def dump_summary(duration, example_count, failure_count, pending_count) super elapsed = Time.now - @started_at passing_count = example_count - ( failure_count + pending_count ) puts "------------------------------------------------------------------------" puts "Completed in #{elapsed}s #{failure_count > 0 ? 'WITH FAILURES' : ''}" puts "------------------------------------------------------------------------" puts "Passing...#{passing_count}" puts "Pending...#{pending_count}" puts "Failing...#{failure_count}" puts "" puts "Total.....#{example_count}" puts "------------------------------------------------------------------------" end end ././@LongLink0000644000000000000000000000017500000000000011606 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/main/ruby/de/saumya/mojo/rspec/rspec2/maven_surefire_reporter.rb./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/main/ruby/de/saumya/mojo/rspec/rspec2/ma0000644000000000000000000001131712674201751030011 0ustar require 'rspec/core/formatters/base_formatter' require 'rspec/core/formatters/snippet_extractor' require 'fileutils' class MavenSurefireReporter < RSpec::Core::Formatters::BaseFormatter attr_reader :passing_examples def initialize(output) super( output ) @started_at = Time.now @passing_examples = [] end def example_passed(example) super @passing_examples << example end def dump_summary(duration, example_count, failure_count, pending_count) elapsed = Time.now - @started_at reporter = self extractor = SnippetExtractor.new report_file = File.join( TARGET_DIR, 'surefire-reports', 'TEST-rspec.xml' ) FileUtils.mkdir_p( File.dirname( report_file ) ) File.open( report_file, 'w' ) do |report_io| Emitter.new( report_io ) do tag( :testsuite, :time=>elapsed, :errors=>0, :tests=>example_count, :skipped=>pending_count, :failures=>failure_count, :name=>File.basename( BASE_DIR ) ) do reporter.passing_examples.each do |ex| class_name = File.basename( ex.metadata[:file_path], '_spec.rb' ) tag( :testcase, :time=>ex.metadata[:execution_result][:run_time], :classname=>class_name, :name=>ex.metadata[:description] ) end reporter.pending_examples.each do |ex| class_name = File.basename( ex.metadata[:file_path], '_spec.rb' ) tag( :testcase, :time=>ex.metadata[:elapsed], :classname=>class_name, :name=>ex.metadata[:description] ) do tag( :skipped ) end end reporter.failed_examples.each do |ex| class_name = File.basename( ex.metadata[:file_path], '_spec.rb' ) exception = ex.metadata[:execution_result][:exception] tag( :testcase, :time=>ex.metadata[:execution_result][:run_time], :classname=>class_name, :name=>ex.metadata[:description] ) do relevant_line = reporter.find_relevant_line( ex, exception ) tag( :failure, :message=>relevant_line ) do content( exception.backtrace() ) end end end end end end end def find_relevant_line(example, exception) match_prefix = example.metadata[:file_path].to_s file_line = nil exception.backtrace.each do |stack_line| if ( stack_line.to_s[0, match_prefix.length] == match_prefix ) file_line = stack_line break end end if ( file_line ) file, line, junk = file_line.split( ':' ) if ( File.exist?( file ) ) lines = File.readlines( file ) return lines[line.to_i-1].strip end end nil end class Converter def convert(code,pre) code end end class Emitter def initialize(io, &block) @io = io @indent = 0 @tag_stack = [] decl instance_eval &block if block end def decl @io.puts( %q() ) end def tag(tag_name, attrs={}, &block) if ( block ) start_tag( tag_name, attrs ) instance_eval &block if block end_tag() else start_tag( tag_name, attrs, false ) end end def start_tag(tag_name, attrs={}, has_body=true) if ( has_body ) @tag_stack.push( tag_name ) @io.puts( indent + "<#{tag_name}#{attributes(attrs)}>" ) @indent = @indent + 1 else @io.puts( indent + "<#{tag_name}#{attributes(attrs)}/>" ) end end def content(str) str.each do |line| @io.puts( indent + escape( line.strip ) ) end end def end_tag() @indent = @indent - 1 @io.puts( indent + "" ) end def attributes(attrs) str = attrs.entries.map{|e| e.first.to_s + "=" + quote(e.last.to_s) }.join( ' ' ) str.strip! return '' if str.empty? " #{str}" end def quote(str) %q(") + escape( str ) + %q(") end def escape(str) str.gsub( /&/, '&' ).gsub( /"/, '"' ).gsub( //, '>' ) end def indent() " " * @indent end end class SnippetExtractor def snippet_for(error_line) if error_line =~ /(.*):(\d+)/ file = $1 line = $2.to_i [lines_around(file, line), line] else ["# Couldn't get snippet for #{error_line}", 1] end end def lines_around(file, line) if File.file?(file) lines = File.open(file).read.split("\n") min = [0, line-3].max max = [line+1, lines.length-1].min selected_lines = [] selected_lines.join("\n") lines[min..max].join("\n") else "# Couldn't get snippet for #{file}" end end end end ././@LongLink0000644000000000000000000000016500000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/main/ruby/de/saumya/mojo/rspec/rspec2/multi_formatter.rb./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/main/ruby/de/saumya/mojo/rspec/rspec2/mu0000644000000000000000000000107212674201751030032 0ustar require 'rspec/core/formatters/base_formatter' class MultiFormatter def self.formatters @formatters ||= [] end def initialize(output) @formatters = [] MultiFormatter.formatters.each do |formatter_setup| formatter_class, formatter_output = *formatter_setup @formatters << formatter_class.new( formatter_output || output ) end end def method_missing(sym, *args) @formatters.each do |formatter| formatter.send( sym, *args ) if formatter.respond_to? sym end end def respond_to? method true end end ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/main/ruby/de/saumya/mojo/rspec/rspec2/monkey_patch.rb./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/main/ruby/de/saumya/mojo/rspec/rspec2/mo0000644000000000000000000000050612674201751030025 0ustar require 'rspec/core/metadata' module RSpec module Core class Metadata < Hash module LocationKeys def first_caller_from_outside_rspec #puts self[:caller].inspect self[:caller].detect {|l| l !~ /\/lib\/rspec\/core/ && l !~ /AbstractScript.java/ } end end end end end./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/main/java/0000755000000000000000000000000012674201751022261 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/main/java/de/0000755000000000000000000000000012674201751022651 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/main/java/de/saumya/0000755000000000000000000000000012674201751024150 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/main/java/de/saumya/mojo/0000755000000000000000000000000012674201751025114 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/main/java/de/saumya/mojo/rspec/0000755000000000000000000000000012674201751026230 5ustar ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/main/java/de/saumya/mojo/rspec/RSpecMojo.java./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/main/java/de/saumya/mojo/rspec/RSpecMojo0000644000000000000000000001416112674201751030017 0ustar package de.saumya.mojo.rspec; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.plugins.annotations.LifecyclePhase; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.plugins.annotations.ResolutionScope; import org.codehaus.plexus.util.FileUtils; import org.codehaus.plexus.util.IOUtil; import de.saumya.mojo.jruby.JRubyVersion; import de.saumya.mojo.jruby.JRubyVersion.Mode; import de.saumya.mojo.ruby.script.Script; import de.saumya.mojo.ruby.script.ScriptException; import de.saumya.mojo.tests.AbstractTestMojo; import de.saumya.mojo.tests.JRubyRun.Result; import de.saumya.mojo.tests.TestScriptFactory; /** * executes the jruby command. */ @Mojo(name ="test", defaultPhase = LifecyclePhase.TEST, requiresDependencyResolution = ResolutionScope.TEST) public class RSpecMojo extends AbstractTestMojo { /** * arguments for the rspec command. */ @Parameter( property = "rspec.args") private final String rspecArgs = null; /** * The directory containing the RSpec source files */ @Parameter(property = "rpsec.dir", defaultValue = "spec") protected String specSourceDirectory; /** * skip rspecs */ @Parameter(property = "skipSpecs", defaultValue = "false") protected boolean skipSpecs; /** * The name of the RSpec report. */ @Parameter(defaultValue = "rspec-report.html") private String reportName; private File outputfile; private File specsDir; @Override public void execute() throws MojoExecutionException, MojoFailureException { if (this.skip || this.skipTests || this.skipSpecs) { getLog().info("Skipping RSpec tests"); return; } else { this.specsDir = specSourceDirectory.startsWith( launchDirectory().getAbsolutePath() ) ? new File( specSourceDirectory ) : new File( launchDirectory(), specSourceDirectory ); if ( !this.specsDir.isDirectory() ) { getLog().info("given " + specSourceDirectory + " does not exists - skipping RSpec test'" ); return; } outputfile = new File( this.project.getBuild().getDirectory().replace( "${project.basedir}/", ""), reportName ); if (outputfile.exists()) { outputfile.delete(); } super.execute(); } } protected Result runIt(de.saumya.mojo.ruby.script.ScriptFactory factory, Mode mode, JRubyVersion version, TestScriptFactory scriptFactory) throws IOException, ScriptException, MojoExecutionException { scriptFactory.setOutputDir( outputfile.getParentFile() ); scriptFactory.setReportPath( outputfile ); scriptFactory.setSourceDir( specsDir ); final Script script = factory.newScript(scriptFactory.getCoreScript()); if (this.rspecArgs != null) { script.addArgs(this.rspecArgs); } if (this.args != null) { script.addArgs(this.args); } Exception error = null; try { script.executeIn(launchDirectory()); } catch (Exception e) { error = e; getLog().debug("exception in running specs", e); } String reportPath = outputfile.getAbsolutePath(); final File reportFile; if ( version != null && modes != null ) { reportFile = new File(reportPath.replace(".html", "-" + version + mode.name() + ".html")); } else if ( versions == null || versions.isEmpty() || version == null ) { reportFile = new File(reportPath); } else { reportFile = new File(reportPath.replace(".html", "-" + version + ".html")); } new File(reportPath).renameTo(reportFile); Result result = new Result(); BufferedReader reader = null; try { reader = new BufferedReader(new FileReader(reportFile)); String line = null; while ((line = reader.readLine()) != null) { // singular case needs to be treated as well if (line.contains("failure") && line.contains("example")) { result.message = line.replaceFirst("\";", "") .replaceFirst("<.*\"", ""); break; } } } catch (final IOException e) { throw new MojoExecutionException("Unable to read test report file: " + reportFile); } finally { IOUtil.close(reader); } if (result.message == null) { if(reportFile.length() == 0 ){ if ( error == null ){ result.success = true; } else{ result.message = "An error occurred"; result.success = false; } } else { // this means the report file partial and thus an error occured result.message = "An unknown error occurred"; result.success = false; } } else { String filename = "TEST-rspec" + ( mode == null ? "" : ( version == null ? "" : "-" + version + mode.flag ) ) + ".xml"; File xmlReport = new File(this.testReportDirectory, filename); new File(this.testReportDirectory, "TEST-rspec.xml").renameTo(xmlReport); if (this.summaryReport != null) { FileUtils.copyFile(xmlReport, this.summaryReport); } result.success = result.message.contains("0 failures") || result.message.contains("Failing...0"); } return result; } @Override protected TestScriptFactory newTestScriptFactory() { return new RSpecMavenTestScriptFactory(); } } ././@LongLink0000644000000000000000000000017400000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/main/java/de/saumya/mojo/rspec/RSpecMavenTestScriptFactory.java./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/main/java/de/saumya/mojo/rspec/RSpecMave0000644000000000000000000000533712674201751030010 0ustar package de.saumya.mojo.rspec; import de.saumya.mojo.tests.AbstractMavenTestScriptFactory; public class RSpecMavenTestScriptFactory extends AbstractMavenTestScriptFactory { @Override protected void getRunnerScript(StringBuilder builder) { builder.append("# Use reasonable default arguments or ARGV is passed in from command-line\n"); builder.append("\n"); builder.append(getPluginClasspathScript()); builder.append("\n"); builder.append("run_args = [ SOURCE_DIR ]\n"); builder.append("if ( ! ARGV.empty? )\n"); builder.append(" run_args = ARGV\n"); builder.append("end\n"); builder.append("\n"); builder.append("require %q(rubygems)\n"); builder.append("\n"); builder.append("require %q(rspec)\n"); builder.append("require %q(rspec/core/formatters/html_formatter)\n"); builder.append("\n"); builder.append("if RSpec::Core::Formatters.respond_to? :register\n"); builder.append(" require %q(de/saumya/mojo/rspec/rspec3/maven_surefire_reporter)\n"); builder.append("::RSpec.configure do |config|\n"); builder.append(" config.add_formatter RSpec::Core::Formatters::ProgressFormatter\n"); builder.append(" config.add_formatter RSpec::Core::Formatters::HtmlFormatter, File.open( \"#{REPORT_PATH}\", 'w' )\n"); builder.append(" config.add_formatter MavenSurefireReporter\n"); builder.append("end\n"); builder.append("else\n"); builder.append(" require %q(de/saumya/mojo/rspec/rspec2/multi_formatter)\n"); builder.append(" require %q(de/saumya/mojo/rspec/rspec2/maven_console_progress_formatter)\n"); builder.append(" require %q(de/saumya/mojo/rspec/rspec2/maven_surefire_reporter)\n"); builder.append(" require %q(de/saumya/mojo/rspec/rspec2/monkey_patch)\n"); builder.append("::MultiFormatter.formatters << [ MavenConsoleProgressFormatter, nil ]\n"); builder.append("::MultiFormatter.formatters << [ MavenSurefireReporter, \"#{TARGET_DIR}\" ] \n"); builder.append("::MultiFormatter.formatters << [ RSpec::Core::Formatters::HtmlFormatter, File.open( \"#{REPORT_PATH}\", 'w' ) ] \n"); builder.append("\n"); builder.append("::RSpec.configure do |config|\n"); builder.append(" config.formatter = ::MultiFormatter\n"); builder.append("end\n"); builder.append("end\n"); builder.append("\n"); builder.append("::RSpec::Core::Runner.disable_autorun!\n"); builder.append("RESULT = ::RSpec::Core::Runner.run( run_args, STDERR, STDOUT)\n"); builder.append("\n"); } @Override protected String getScriptName() { return "rspec-runner.rb"; } } ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/0000755000000000000000000000000012674201751021030 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-failure-19/0000755000000000000000000000000012674201751024020 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-failure-19/verify.bsh0000644000000000000000000000073112674201751026023 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "Failing...1"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } File f = new File( new File( new File( basedir, "target" ), "surefire-reports" ), "TEST-rspec.xml" ); if ( !f.exists() ) { throw new RuntimeException( "file does not exists: " + f ); } ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-failure-19/test.properties0000644000000000000000000000002412674201751027111 0ustar jruby.switches=--1.9./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-failure-19/pom.xml0000644000000000000000000000173612674201751025344 0ustar 4.0.0 de.saumya.mojo spec-success testing rubygems-releases http://rubygems-proxy.torquebox.org/releases rubygems rspec 2.7.0 gem test de.saumya.mojo rspec-maven-plugin @project.version@ ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-failure-19/spec/0000755000000000000000000000000012674201751024752 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-failure-19/spec/failure_spec.rb0000644000000000000000000000013112674201751027733 0ustar describe "spec" do it "should success" do "success".should = "failure" end end ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-failure-19/invoker.properties0000644000000000000000000000012412674201751027610 0ustar invoker.goals = rspec:test invoker.mavenOpts = -client invoker.buildResult = failure./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-path/0000755000000000000000000000000012674201751023076 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-path/verify.bsh0000644000000000000000000000072612674201751025105 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "mode 1.8: 1 example, 0 failures"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } expected = "mode 1.9: 1 example, 0 failures"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-path/test.properties0000644000000000000000000000015512674201751026174 0ustar jruby.modes=1.8,1.9 # to allow the verify script to work #jruby.version=1.7.0.preview2 jruby.version=1.6.7.2 ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-path/pom.xml0000644000000000000000000000200112674201751024404 0ustar 4.0.0 de.saumya.mojo spec-success testing rubygems-releases http://rubygems-proxy.torquebox.org/releases rubygems rspec 2.11.0 gem test de.saumya.mojo rspec-maven-plugin @project.version@ true ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-path/spec/0000755000000000000000000000000012674201751024030 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-path/spec/success_spec.rb0000644000000000000000000000010312674201751027031 0ustar describe "succeeding spec" do it "should succeed" do end end ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-path/invoker.properties0000644000000000000000000000006612674201751026673 0ustar invoker.goals = rspec:test invoker.mavenOpts = -client./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-failure/0000755000000000000000000000000012674201751023571 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-failure/verify.bsh0000644000000000000000000000073112674201751025574 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "Failing...1"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } File f = new File( new File( new File( basedir, "target" ), "surefire-reports" ), "TEST-rspec.xml" ); if ( !f.exists() ) { throw new RuntimeException( "file does not exists: " + f ); } ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-failure/pom.xml0000644000000000000000000000173612674201751025115 0ustar 4.0.0 de.saumya.mojo spec-success testing rubygems-releases http://rubygems-proxy.torquebox.org/releases rubygems rspec 2.7.0 gem test de.saumya.mojo rspec-maven-plugin @project.version@ ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-failure/spec/0000755000000000000000000000000012674201751024523 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-failure/spec/failure_spec.rb0000644000000000000000000000013112674201751027504 0ustar describe "spec" do it "should success" do "success".should = "failure" end end ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-failure/invoker.properties0000644000000000000000000000012412674201751027361 0ustar invoker.goals = rspec:test invoker.mavenOpts = -client invoker.buildResult = failure./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/with-error-in-before/0000755000000000000000000000000012674201751024776 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/with-error-in-before/verify.bsh0000644000000000000000000000043312674201751027000 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "Failing...1"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); }./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/with-error-in-before/pom.xml0000644000000000000000000000173612674201751026322 0ustar 4.0.0 de.saumya.mojo spec-success testing rubygems-releases http://rubygems-proxy.torquebox.org/releases rubygems rspec 2.7.0 gem test de.saumya.mojo rspec-maven-plugin @project.version@ ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/with-error-in-before/spec/0000755000000000000000000000000012674201751025730 5ustar ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/with-error-in-before/spec/success_spec.rb./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/with-error-in-before/spec/success_spe0000644000000000000000000000016212674201751030171 0ustar describe "error in before clause" do before :all do nil.unknown end it "should succeed" do end end ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/with-error-in-before/invoker.properties./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/with-error-in-before/invoker.properti0000644000000000000000000000012412674201751030236 0ustar invoker.goals = rspec:test invoker.buildResult = failure invoker.mavenOpts = -client./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-3.x/0000755000000000000000000000000012674201751022552 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-3.x/verify.bsh0000644000000000000000000000074412674201751024561 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "1 example, 0 failures"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } File f = new File( new File( new File( basedir, "target" ), "surefire-reports" ), "TEST-rspec.xml" ); if ( !f.exists() ) { throw new RuntimeException( "file does not exists: " + f ); } ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-3.x/pom.xml0000644000000000000000000000200412674201751024063 0ustar 4.0.0 de.saumya.mojo spec-success testing rubygems-releases http://rubygems-proxy.torquebox.org/releases rubygems rspec 3.0.0 gem test de.saumya.mojo rspec-maven-plugin @project.version@ true ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-3.x/spec/0000755000000000000000000000000012674201751023504 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-3.x/spec/success_spec.rb0000644000000000000000000000010312674201751026505 0ustar describe "succeeding spec" do it "should succeed" do end end ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-3.x/invoker.properties0000644000000000000000000000006612674201751026347 0ustar invoker.goals = rspec:test invoker.mavenOpts = -client./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/without-specs-path/0000755000000000000000000000000012674201751024600 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/without-specs-path/verify.bsh0000644000000000000000000000046512674201751026607 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "does not exists - skipping RSpec test"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); }./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/without-specs-path/pom.xml0000644000000000000000000000211312674201751026112 0ustar 4.0.0 de.saumya.mojo spec-file testing rubygems-releases http://rubygems-proxy.torquebox.org/releases rubygems rspec 2.7.0 gem test de.saumya.mojo rspec-maven-plugin @project.version@ test ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-failure-18and19-156_161/0000755000000000000000000000000012674201751025554 5ustar ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-failure-18and19-156_161/verify.bsh./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-failure-18and19-156_161/verify.0000644000000000000000000000145112674201751027062 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "jruby-1.5.6 mode 1.8: An error occurred"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } expected = "jruby-1.6.1 mode 1.8: An error occurred"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } expected = "jruby-1.6.1 mode 1.9: An error occurred"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } expected = "BUILD FAILURE"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-failure-18and19-156_161/test.properties./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-failure-18and19-156_161/test.pr0000644000000000000000000000005712674201751027100 0ustar jruby.modes=1.8,1.9 jruby.versions=1.5.6,1.6.1 ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-failure-18and19-156_161/pom.xml0000644000000000000000000000200412674201751027065 0ustar 4.0.0 de.saumya.mojo spec-success testing rubygems-releases http://rubygems-proxy.torquebox.org/releases rubygems rspec 2.7.0 gem test de.saumya.mojo rspec-maven-plugin @project.version@ true ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-failure-18and19-156_161/spec/0000755000000000000000000000000012674201751026506 5ustar ././@LongLink0000644000000000000000000000016200000000000011602 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-failure-18and19-156_161/spec/success_spec.rb./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-failure-18and19-156_161/spec/su0000644000000000000000000000012312674201751027054 0ustar describe "succeeding spec" do it "should succeed" do some_error$ end end ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-failure-18and19-156_161/invoker.properties./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-failure-18and19-156_161/invoker0000644000000000000000000000012412674201751027151 0ustar invoker.goals = rspec:test invoker.mavenOpts = -client invoker.buildResult = failure./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/with-java-classes/0000755000000000000000000000000012674201751024355 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/with-java-classes/verify.bsh0000644000000000000000000000043412674201751026360 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "Passing...1"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/with-java-classes/pom.xml0000644000000000000000000000215712674201751025677 0ustar 4.0.0 de.saumya.mojo spec-success testing rubygems-releases http://rubygems-proxy.torquebox.org/releases rubygems rspec 2.7.0 gem test org.slf4j slf4j-simple 1.6.1 de.saumya.mojo rspec-maven-plugin @project.version@ ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/with-java-classes/spec/0000755000000000000000000000000012674201751025307 5ustar ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/with-java-classes/spec/success_spec.rb./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/with-java-classes/spec/success_spec.r0000644000000000000000000000031312674201751030151 0ustar describe "succeeding spec" do it "should succeed" do logger = org.slf4j.LoggerFactory.getLogger("spec") logger.should_not be_nil logger.info("logging something very important") end end ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/with-java-classes/invoker.properties0000644000000000000000000000006612674201751030152 0ustar invoker.goals = rspec:test invoker.mavenOpts = -client./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-21_20-156/0000755000000000000000000000000012674201751023176 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-21_20-156/verify.bsh0000644000000000000000000000052012674201751025175 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "JRuby version 1.5.6 can not run any of the given modes: 2.0,2.1"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-21_20-156/test.properties0000644000000000000000000000005112674201751026267 0ustar jruby.modes=2.0,2.1 jruby.versions=1.5.6 ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-21_20-156/pom.xml0000644000000000000000000000200412674201751024507 0ustar 4.0.0 de.saumya.mojo spec-success testing rubygems-releases http://rubygems-proxy.torquebox.org/releases rubygems rspec 2.7.0 gem test de.saumya.mojo rspec-maven-plugin @project.version@ true ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-21_20-156/spec/0000755000000000000000000000000012674201751024130 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-21_20-156/spec/success_spec.rb0000644000000000000000000000010312674201751027131 0ustar describe "succeeding spec" do it "should succeed" do end end ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-21_20-156/invoker.properties0000644000000000000000000000006612674201751026773 0ustar invoker.goals = rspec:test invoker.mavenOpts = -client./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-summary-report/0000755000000000000000000000000012674201751025150 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-summary-report/verify.bsh0000644000000000000000000000116112674201751027151 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "Passing...1"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } File f = new File( new File( new File( basedir, "target" ), "surefire-reports" ), "TEST-rspec.xml" ); if ( !f.exists() ) { throw new RuntimeException( "file does not exists: " + f ); } f = new File( new File( basedir, "target" ), "TEST-Ruby.xml" ); if ( !f.exists() ) { throw new RuntimeException( "file does not exists: " + f ); } ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-summary-report/pom.xml0000644000000000000000000000226512674201751026472 0ustar 4.0.0 de.saumya.mojo spec-success testing rubygems-releases http://rubygems-proxy.torquebox.org/releases rubygems rspec 2.7.0 gem test de.saumya.mojo rspec-maven-plugin @project.version@ test ${project.build.directory}/TEST-Ruby.xml ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-summary-report/spec/0000755000000000000000000000000012674201751026102 5ustar ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-summary-report/spec/success_spec.rb./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-summary-report/spec/success_spe0000644000000000000000000000010312674201751030336 0ustar describe "succeeding spec" do it "should succeed" do end end ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-summary-report/invoker.properties./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-summary-report/invoker.properti0000644000000000000000000000006012674201751030407 0ustar invoker.goals = test invoker.mavenOpts = -client./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/.gitignore0000644000000000000000000000001212674201751023011 0ustar build.log ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-pom/0000755000000000000000000000000012674201751022735 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-pom/verify.bsh0000644000000000000000000000073212674201751024741 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "Passing...1"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } File f = new File( new File( new File( basedir, "target" ), "surefire-reports" ), "TEST-rspec.xml" ); if ( !f.exists() ) { throw new RuntimeException( "file does not exists: " + f ); } ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-pom/pom.xml0000644000000000000000000000200412674201751024246 0ustar 4.0.0 de.saumya.mojo spec-success testing rubygems-releases http://rubygems-proxy.torquebox.org/releases rubygems rspec 2.7.0 gem test de.saumya.mojo rspec-maven-plugin @project.version@ true ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-pom/spec/0000755000000000000000000000000012674201751023667 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-pom/spec/success_spec.rb0000644000000000000000000000010312674201751026670 0ustar describe "succeeding spec" do it "should succeed" do end end ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-pom/invoker.properties0000644000000000000000000000006612674201751026532 0ustar invoker.goals = rspec:test invoker.mavenOpts = -client./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-somewhere/0000755000000000000000000000000012674201751024140 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-somewhere/verify.bsh0000644000000000000000000000037212674201751026144 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); if ( !log.contains( "Passing...1" ) ) { throw new RuntimeException( "log file does not contain 'Passing...1'" ); }./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-somewhere/pom.xml0000644000000000000000000000224312674201751025456 0ustar 4.0.0 de.saumya.mojo spec-somewhere testing rubygems-releases http://rubygems-proxy.torquebox.org/releases rubygems rspec 2.7.0 gem test de.saumya.mojo rspec-maven-plugin @project.version@ somewhere test ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-somewhere/somewhere/0000755000000000000000000000000012674201751026136 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-somewhere/somewhere/spec/0000755000000000000000000000000012674201751027070 5ustar ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-somewhere/somewhere/spec/success_spec.rb./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-somewhere/somewhere/spec/succes0000644000000000000000000000006012674201751030274 0ustar describe "spec" do it "should" do end end ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-somewhere/invoker.properties0000644000000000000000000000006612674201751027735 0ustar invoker.goals = rspec:test invoker.mavenOpts = -client./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/with-custom-specs-path/0000755000000000000000000000000012674201751025360 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/with-custom-specs-path/verify.bsh0000644000000000000000000000043312674201751027362 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "Passing...1"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); }./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/with-custom-specs-path/my-specs/0000755000000000000000000000000012674201751027120 5ustar ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/with-custom-specs-path/my-specs/success_spec.rb./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/with-custom-specs-path/my-specs/succe0000644000000000000000000000010312674201751030137 0ustar describe "succeeding spec" do it "should succeed" do end end ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/with-custom-specs-path/pom.xml0000644000000000000000000000224512674201751026700 0ustar 4.0.0 de.saumya.mojo spec-file testing rubygems-releases http://rubygems-proxy.torquebox.org/releases rubygems rspec 2.7.0 gem test de.saumya.mojo rspec-maven-plugin @project.version@ test my-specs ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-with-jar-dependencies/0000755000000000000000000000000012674201751026313 5ustar ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-with-jar-dependencies/verify.bsh./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-with-jar-dependencies/verify.bs0000644000000000000000000000126112674201751030145 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "1 example, 0 failures"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } File f = new File( new File( new File( basedir, "target" ), "surefire-reports" ), "TEST-rspec-9.0.1.0.xml" ); if ( !f.exists() ) { throw new RuntimeException( "file does not exists: " + f ); } f = new File( new File( new File( basedir, "target" ), "surefire-reports" ), "TEST-rspec-1.7.22--1.9.xml" ); if ( !f.exists() ) { throw new RuntimeException( "file does not exists: " + f ); } ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-with-jar-dependencies/test.properties./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-with-jar-dependencies/test.prop0000644000000000000000000000003512674201751030172 0ustar jruby.versions=1.7.22,9.0.1.0./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-with-jar-dependencies/pom.xml0000644000000000000000000000221412674201751027627 0ustar 4.0.0 de.saumya.mojo spec-success testing rubygems-releases http://rubygems-proxy.torquebox.org/releases rubygems leafy-complete 0.6.2 gem rubygems rspec 3.0.0 gem test de.saumya.mojo rspec-maven-plugin @project.version@ ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-with-jar-dependencies/spec/0000755000000000000000000000000012674201751027245 5ustar ././@LongLink0000644000000000000000000000016000000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-with-jar-dependencies/spec/success_spec.rb./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-with-jar-dependencies/spec/succ0000644000000000000000000000016412674201751030126 0ustar describe "succeeding spec" do it "should succeed" do expect( require 'leafy/metrics' ).to eq true end end ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-with-jar-dependencies/invoker.properties./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-with-jar-dependencies/invoker.p0000644000000000000000000000006612674201751030153 0ustar invoker.goals = rspec:test invoker.mavenOpts = -client./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-20-156/0000755000000000000000000000000012674201751022674 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-20-156/verify.bsh0000644000000000000000000000051612674201751024700 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "JRuby version 1.5.6 can not run any of the given modes: [2.0]"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-20-156/test.properties0000644000000000000000000000005212674201751025766 0ustar jruby.switches=--2.0 jruby.versions=1.5.6 ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-20-156/pom.xml0000644000000000000000000000200412674201751024205 0ustar 4.0.0 de.saumya.mojo spec-success testing rubygems-releases http://rubygems-proxy.torquebox.org/releases rubygems rspec 2.7.0 gem test de.saumya.mojo rspec-maven-plugin @project.version@ true ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-20-156/spec/0000755000000000000000000000000012674201751023626 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-20-156/spec/success_spec.rb0000644000000000000000000000010312674201751026627 0ustar describe "succeeding spec" do it "should succeed" do end end ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/rspec-20-156/invoker.properties0000644000000000000000000000006612674201751026471 0ustar invoker.goals = rspec:test invoker.mavenOpts = -client./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/src/it/settings.xml0000644000000000000000000000221612674201751023413 0ustar it-repo true local.central @localRepositoryUrl@ true true local.rubygems-releases @localRepositoryUrl@ true false local.central @localRepositoryUrl@ true true ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/.project0000644000000000000000000000172512674201751021301 0ustar rspec-maven-plugin shared dependencies and plugins for the mojos. NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse. gem-maven-plugin jruby-maven-plugin ruby-tools org.eclipse.jdt.core.javabuilder org.maven.ide.eclipse.maven2Builder org.eclipse.m2e.core.maven2Builder org.eclipse.m2e.core.maven2Nature org.maven.ide.eclipse.maven2Nature org.eclipse.jdt.core.javanature ./jruby-maven-plugins-1.1.5.ds1.orig/rspec-maven-plugin/pom.xml0000644000000000000000000000204012674201751021136 0ustar 4.0.0 test-parent-mojo de.saumya.mojo 1.1.5 ../test-parent-mojo/pom.xml rspec-maven-plugin maven-plugin RSpec Maven Mojo integration-test maven-invoker-plugin integration-test-no-pom rspec1-no-pom/pom.xml ./jruby-maven-plugins-1.1.5.ds1.orig/test-parent-mojo/0000755000000000000000000000000012674201751017321 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/test-parent-mojo/pom.xml0000644000000000000000000000143312674201751020637 0ustar 4.0.0 gem-parent-mojo de.saumya.mojo 1.1.5 ../gem-parent-mojo/pom.xml test-parent-mojo pom Test Mojo Parent ${project.parent.groupId} test-base-plugin ${project.parent.version} ./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/0000755000000000000000000000000012674201751020345 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/0000755000000000000000000000000012674201751021134 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/main/0000755000000000000000000000000012674201751022060 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/main/java/0000755000000000000000000000000012674201751023001 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/main/java/de/0000755000000000000000000000000012674201751023371 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/main/java/de/saumya/0000755000000000000000000000000012674201751024670 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/main/java/de/saumya/mojo/0000755000000000000000000000000012674201751025634 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/main/java/de/saumya/mojo/minitest/0000755000000000000000000000000012674201751027470 5ustar ././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/main/java/de/saumya/mojo/minitest/MinitestMojo.java./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/main/java/de/saumya/mojo/minitest/Min0000644000000000000000000000667112674201751030150 0ustar package de.saumya.mojo.minitest; import java.io.File; import java.io.IOException; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; import de.saumya.mojo.jruby.JRubyVersion; import de.saumya.mojo.jruby.JRubyVersion.Mode; import de.saumya.mojo.ruby.script.Script; import de.saumya.mojo.ruby.script.ScriptException; import de.saumya.mojo.ruby.script.ScriptFactory; import de.saumya.mojo.tests.AbstractTestMojo; import de.saumya.mojo.tests.JRubyRun.Result; import de.saumya.mojo.tests.TestResultManager; import de.saumya.mojo.tests.TestScriptFactory; import org.apache.maven.plugins.annotations.LifecyclePhase; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.plugins.annotations.ResolutionScope; /** * maven wrapper around minitest. */ @Mojo( name = "test", defaultPhase = LifecyclePhase.TEST, requiresDependencyResolution = ResolutionScope.TEST) public class MinitestMojo extends AbstractTestMojo { /** * minitest directory with glob to speficy the test files. */ @Parameter( property = "minitest.dir", defaultValue = "test/**/*_test.rb" ) private final String minitestDirectory = null; /** * arguments for the minitest command. */ @Parameter( property = "minitest.args" ) private final String minitestArgs = null; /** * skip the minitests */ @Parameter( property = "skipMinitests", defaultValue = "false" ) protected boolean skipMinitests; private TestResultManager resultManager; private File outputfile; @Override public void execute() throws MojoExecutionException, MojoFailureException { if (this.skip || this.skipTests || this.skipMinitests) { getLog().info("Skipping Minitests"); } else { outputfile = new File(this.project.getBuild().getDirectory() .replace("${project.basedir}/", ""), "minitest.txt"); if (outputfile.exists()){ outputfile.delete(); } resultManager = new TestResultManager(project.getName(), "minitest", testReportDirectory, summaryReport); super.execute(); } } protected Result runIt(ScriptFactory factory, Mode mode, JRubyVersion version, TestScriptFactory scriptFactory) throws IOException, ScriptException, MojoExecutionException { scriptFactory.setOutputDir(outputfile.getParentFile()); scriptFactory.setReportPath(outputfile); if(minitestDirectory.startsWith(launchDirectory().getAbsolutePath())){ scriptFactory.setSourceDir(new File(minitestDirectory)); } else{ scriptFactory.setSourceDir(new File(launchDirectory(), minitestDirectory)); } final Script script = factory.newScript(scriptFactory.getCoreScript()); if (this.minitestArgs != null) { script.addArgs(this.minitestArgs); } if (this.args != null) { script.addArgs(this.args); } try { script.executeIn(launchDirectory()); } catch (Exception e) { getLog().debug("exception in running tests", e); } return resultManager.generateReports(mode, version, outputfile); } @Override protected TestScriptFactory newTestScriptFactory() { // TODO locate minitest gem return new MinitestMavenTestScriptFactory(); } } ././@LongLink0000644000000000000000000000020500000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/main/java/de/saumya/mojo/minitest/MinitestMavenTestScriptFactory.java./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/main/java/de/saumya/mojo/minitest/Min0000644000000000000000000000467312674201751030150 0ustar package de.saumya.mojo.minitest; import de.saumya.mojo.tests.AbstractMavenTestScriptFactory; public class MinitestMavenTestScriptFactory extends AbstractMavenTestScriptFactory { @Override protected void getRunnerScript(StringBuilder builder) { getTeeClass(builder); getAddTestCases(builder); getTestRunnerScript(builder); } @Override protected void getResultsScript(StringBuilder builder) { // not needed - is already done by test runner } void getTeeClass(StringBuilder builder){ builder.append("class Tee < File\n"); builder.append(" def write(*args)\n"); builder.append(" super\n" ); builder.append(" STDOUT.write *args\n" ); builder.append(" flush\n" ); builder.append(" end\n"); builder.append(" def flush(*args)\n" ); builder.append(" super\n" ); builder.append(" STDOUT.flush *args\n"); builder.append(" end\n" ); builder.append("end\n"); } void getAddTestCases(StringBuilder builder){ builder.append("require 'rubygems'\n"); builder.append("begin\n"); builder.append(" require 'bundler'\n"); builder.append(" Bundler.require\n"); builder.append("rescue Exception\n"); builder.append(" begin\n"); builder.append(" gem 'minitest'\n"); builder.append(" rescue Exception\n"); builder.append(" # assume we run ruby19\n"); builder.append(" end\n"); builder.append("end\n"); builder.append("begin\n"); builder.append(" require 'minitest/autorun'\n"); builder.append("rescue\n"); builder.append(" raise 'looks like minitest gem is missing'\n"); builder.append("end\n"); builder.append("Dir[SOURCE_DIR].each { |f| require f if File.file? f }\n"); } private void getTestRunnerScript(StringBuilder builder) { builder.append("require 'fileutils'\n"); builder.append("FileUtils.mkdir_p( File.dirname( REPORT_PATH ) )\n"); builder.append("if MiniTest::Unit.respond_to? :output\n"); builder.append(" MiniTest::Unit.output = Tee.open(REPORT_PATH, 'w')\n"); builder.append("else\n"); builder.append(" $stdout = Tee.open(REPORT_PATH, 'w')\n"); builder.append("end\n"); builder.append("\n"); } @Override protected String getScriptName() { return "minitest-runner.rb"; } } ././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/main/java/de/saumya/mojo/minitest/MinispecMojo.java./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/main/java/de/saumya/mojo/minitest/Min0000644000000000000000000000663312674201751030146 0ustar package de.saumya.mojo.minitest; import java.io.File; import java.io.IOException; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; import de.saumya.mojo.jruby.JRubyVersion; import de.saumya.mojo.jruby.JRubyVersion.Mode; import de.saumya.mojo.ruby.script.Script; import de.saumya.mojo.ruby.script.ScriptException; import de.saumya.mojo.ruby.script.ScriptFactory; import de.saumya.mojo.tests.AbstractTestMojo; import de.saumya.mojo.tests.JRubyRun.Result; import de.saumya.mojo.tests.TestResultManager; import de.saumya.mojo.tests.TestScriptFactory; import org.apache.maven.plugins.annotations.LifecyclePhase; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.plugins.annotations.ResolutionScope; /** * maven wrapper around minispec. */ @Mojo( name = "spec", defaultPhase = LifecyclePhase.TEST, requiresDependencyResolution = ResolutionScope.TEST) public class MinispecMojo extends AbstractTestMojo { /** * minispec directory with glob to speficy the test files. */ @Parameter( property = "minipec.dir", defaultValue = "spec/**/*_spec.rb" ) private String minispecDirectory = null; /** * arguments for the minitest command. */ @Parameter( property = "minipec.args") private String minispecArgs = null; /** * skip the minispecs */ @Parameter( property = "skipMinispecs", defaultValue = "false" ) protected boolean skipMinispecs; private TestResultManager resultManager; private File outputfile; @Override public void execute() throws MojoExecutionException, MojoFailureException { if (this.skip || this.skipTests || this.skipMinispecs) { getLog().info("Skipping Minispecs"); return; } else { outputfile = new File(this.project.getBuild().getDirectory() .replace("${project.basedir}/", ""), "minispec.txt"); if (outputfile.exists()){ outputfile.delete(); } resultManager = new TestResultManager(project.getName(), "minispec", testReportDirectory, summaryReport); super.execute(); } } protected Result runIt(ScriptFactory factory, Mode mode, JRubyVersion version, TestScriptFactory scriptFactory) throws IOException, ScriptException, MojoExecutionException { scriptFactory.setOutputDir(outputfile.getParentFile()); scriptFactory.setReportPath(outputfile); if(minispecDirectory.startsWith(launchDirectory().getAbsolutePath())){ scriptFactory.setSourceDir(new File(minispecDirectory)); } else{ scriptFactory.setSourceDir(new File(launchDirectory(), minispecDirectory)); } final Script script = factory.newScript(scriptFactory.getCoreScript()); if (this.minispecArgs != null) { script.addArgs(this.minispecArgs); } if (this.args != null) { script.addArgs(this.args); } try { script.executeIn(launchDirectory()); } catch (Exception e) { getLog().debug("exception in running specs", e); } return resultManager.generateReports(mode, version, outputfile); } @Override protected TestScriptFactory newTestScriptFactory() { return new MinitestMavenTestScriptFactory(); } } ./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/0000755000000000000000000000000012674201751021550 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minitest-failure-19/0000755000000000000000000000000012674201751025260 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minitest-failure-19/verify.bsh0000644000000000000000000000077012674201751027266 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = ", 1 assertions, 1 failures, 0 errors"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } File file = new File( basedir, "target/surefire-reports/TEST-minitest.xml"); if ( !file.exists() ) { throw new RuntimeException( "file does not exists: '" + file.getAbsolutePath() + "'" ); } ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minitest-failure-19/test.properties./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minitest-failure-19/test.propertie0000644000000000000000000000002412674201751030166 0ustar jruby.switches=--1.9./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minitest-failure-19/pom.xml0000644000000000000000000000200412674201751026571 0ustar 4.0.0 de.saumya.mojo minitest-failure testing rubygems-releases http://rubygems-proxy.torquebox.org/releases rubygems minitest 2.10.0 gem test de.saumya.mojo minitest-maven-plugin @project.version@ ./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minitest-failure-19/test/0000755000000000000000000000000012674201751026237 5ustar ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minitest-failure-19/test/simple_test.rb./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minitest-failure-19/test/simple_te0000644000000000000000000000013112674201751030136 0ustar class SimpleTest < MiniTest::Unit::TestCase def test_it assert false end end ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minitest-failure-19/invoker.properties./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minitest-failure-19/invoker.proper0000644000000000000000000000013012674201751030160 0ustar invoker.goals = minitest:test invoker.mavenOpts = -client invoker.buildResult = failure ./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minitest-from-jruby/0000755000000000000000000000000012674201751025476 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minitest-from-jruby/verify.bsh0000644000000000000000000000077012674201751027504 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = ", 1 assertions, 0 failures, 0 errors"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } File file = new File( basedir, "target/surefire-reports/TEST-minitest.xml"); if ( !file.exists() ) { throw new RuntimeException( "file does not exists: '" + file.getAbsolutePath() + "'" ); } ./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minitest-from-jruby/pom.xml0000644000000000000000000000134412674201751027015 0ustar 4.0.0 de.saumya.mojo minitest-from-jruby testing de.saumya.mojo minitest-maven-plugin @project.version@ test ./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minitest-from-jruby/test/0000755000000000000000000000000012674201751026455 5ustar ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minitest-from-jruby/test/simple_test.rb./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minitest-from-jruby/test/simple_te0000644000000000000000000000013012674201751030353 0ustar class SimpleTest < MiniTest::Unit::TestCase def test_it assert true end end ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minitest-from-jruby/invoker.properties./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minitest-from-jruby/invoker.proper0000644000000000000000000000006112674201751030401 0ustar invoker.goals = test invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minispec-with-jar-dependencies/0000755000000000000000000000000012674201751027526 5ustar ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minispec-with-jar-dependencies/verify.bsh./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minispec-with-jar-dependencies/ver0000644000000000000000000000132512674201751030246 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = "1 runs, 1 assertions, 0 failures, 0 errors, 0 skips"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } File f = new File( new File( new File( basedir, "target" ), "surefire-reports" ), "TEST-minispec-9.0.1.0.xml" ); if ( !f.exists() ) { throw new RuntimeException( "file does not exists: " + f ); } f = new File( new File( new File( basedir, "target" ), "surefire-reports" ), "TEST-minispec-1.7.22--1.9.xml" ); if ( !f.exists() ) { throw new RuntimeException( "file does not exists: " + f ); } ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minispec-with-jar-dependencies/test.properties./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minispec-with-jar-dependencies/tes0000644000000000000000000000003512674201751030242 0ustar jruby.versions=1.7.22,9.0.1.0././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minispec-with-jar-dependencies/pom.xml./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minispec-with-jar-dependencies/pom0000644000000000000000000000245112674201751030246 0ustar 4.0.0 de.saumya.mojo minitest-with-jar-dependencies testing rubygems-releases http://rubygems-proxy.torquebox.org/releases rubygems leafy-complete 0.6.2 gem rubygems minitest 5.8.0 gem test de.saumya.mojo minitest-maven-plugin @project.version@ spec ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minispec-with-jar-dependencies/spec/./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minispec-with-jar-dependencies/spe0000755000000000000000000000000012674201751030236 5ustar ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minispec-with-jar-dependencies/spec/success_spec.rb./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minispec-with-jar-dependencies/spe0000644000000000000000000000016112674201751030236 0ustar describe "succeeding spec" do it "should succeed" do require('leafy/metrics' ).must_equal true end end ././@LongLink0000644000000000000000000000016400000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minispec-with-jar-dependencies/invoker.properties./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minispec-with-jar-dependencies/inv0000644000000000000000000000006012674201751030241 0ustar invoker.goals = test invoker.mavenOpts = -client./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minitest-summary-report/0000755000000000000000000000000012674201751026410 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minitest-summary-report/verify.bsh0000644000000000000000000000124012674201751030407 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = ", 1 assertions, 0 failures, 0 errors"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } File file = new File( basedir, "target/surefire-reports/TEST-minitest.xml"); if ( !file.exists() ) { throw new RuntimeException( "file does not exists: '" + file.getAbsolutePath() + "'" ); } file = new File( basedir, "target/summary.xml"); if ( !file.exists() ) { throw new RuntimeException( "file does not exists: '" + file.getAbsolutePath() + "'" ); } ./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minitest-summary-report/pom.xml0000644000000000000000000000230412674201751027724 0ustar 4.0.0 de.saumya.mojo minitest-pom testing rubygems-releases http://rubygems-proxy.torquebox.org/releases rubygems minitest 2.10.0 gem test de.saumya.mojo minitest-maven-plugin @project.version@ test ${build.directory}/summary.xml ./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minitest-summary-report/test/0000755000000000000000000000000012674201751027367 5ustar ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minitest-summary-report/test/simple_test.rb./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minitest-summary-report/test/simpl0000644000000000000000000000013012674201751030430 0ustar class SimpleTest < MiniTest::Unit::TestCase def test_it assert true end end ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minitest-summary-report/invoker.properties./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minitest-summary-report/invoker.pr0000644000000000000000000000006112674201751030425 0ustar invoker.goals = test invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minitest-pom-508/0000755000000000000000000000000012674201751024507 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minitest-pom-508/verify.bsh0000644000000000000000000000077012674201751026515 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = ", 1 assertions, 0 failures, 0 errors"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } File file = new File( basedir, "target/surefire-reports/TEST-minitest.xml"); if ( !file.exists() ) { throw new RuntimeException( "file does not exists: '" + file.getAbsolutePath() + "'" ); } ./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minitest-pom-508/pom.xml0000644000000000000000000000214412674201751026025 0ustar 4.0.0 de.saumya.mojo minitest-pom testing rubygems-releases http://rubygems-proxy.torquebox.org/releases rubygems minitest 5.0.8 gem test de.saumya.mojo minitest-maven-plugin @project.version@ test ./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minitest-pom-508/test/0000755000000000000000000000000012674201751025466 5ustar ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minitest-pom-508/test/simple_test.rb./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minitest-pom-508/test/simple_test.0000644000000000000000000000013012674201751030011 0ustar class SimpleTest < MiniTest::Unit::TestCase def test_it assert true end end ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minitest-pom-508/invoker.properties./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minitest-pom-508/invoker.propertie0000644000000000000000000000006112674201751030114 0ustar invoker.goals = test invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minitest-somewhere/0000755000000000000000000000000012674201751025400 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minitest-somewhere/verify.bsh0000644000000000000000000000077012674201751027406 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = ", 1 assertions, 0 failures, 0 errors"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } File file = new File( basedir, "target/surefire-reports/TEST-minitest.xml"); if ( !file.exists() ) { throw new RuntimeException( "file does not exists: '" + file.getAbsolutePath() + "'" ); } ./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minitest-somewhere/pom.xml0000644000000000000000000000215312674201751026716 0ustar 4.0.0 de.saumya.mojo minitest-somewhere testing rubygems-releases http://rubygems-proxy.torquebox.org/releases rubygems minitest 2.10.0 gem test de.saumya.mojo minitest-maven-plugin @project.version@ somewhere ./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minitest-somewhere/somewhere/0000755000000000000000000000000012674201751027376 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minitest-somewhere/somewhere/test/0000755000000000000000000000000012674201751030355 5ustar ././@LongLink0000644000000000000000000000016300000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minitest-somewhere/somewhere/test/simple_test.rb./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minitest-somewhere/somewhere/test/0000644000000000000000000000013012674201751030351 0ustar class SimpleTest < MiniTest::Unit::TestCase def test_it assert true end end ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minitest-somewhere/invoker.properties./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minitest-somewhere/invoker.propert0000644000000000000000000000007212674201751030471 0ustar invoker.goals = minitest:test invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minitest-failure/0000755000000000000000000000000012674201751025031 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minitest-failure/verify.bsh0000644000000000000000000000077012674201751027037 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = ", 1 assertions, 1 failures, 0 errors"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } File file = new File( basedir, "target/surefire-reports/TEST-minitest.xml"); if ( !file.exists() ) { throw new RuntimeException( "file does not exists: '" + file.getAbsolutePath() + "'" ); } ./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minitest-failure/pom.xml0000644000000000000000000000200412674201751026342 0ustar 4.0.0 de.saumya.mojo minitest-failure testing rubygems-releases http://rubygems-proxy.torquebox.org/releases rubygems minitest 2.10.0 gem test de.saumya.mojo minitest-maven-plugin @project.version@ ./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minitest-failure/test/0000755000000000000000000000000012674201751026010 5ustar ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minitest-failure/test/simple_test.rb./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minitest-failure/test/simple_test.0000644000000000000000000000013112674201751030334 0ustar class SimpleTest < MiniTest::Unit::TestCase def test_it assert false end end ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minitest-failure/invoker.properties./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minitest-failure/invoker.propertie0000644000000000000000000000013012674201751030433 0ustar invoker.goals = minitest:test invoker.mavenOpts = -client invoker.buildResult = failure ./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/settings.xml0000644000000000000000000000220412674201751024130 0ustar it-repo true local.central @localRepositoryUrl@ true true local.rubygems @localRepositoryUrl@ true false local.central @localRepositoryUrl@ true true ./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minitest-pom-210/0000755000000000000000000000000012674201751024475 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minitest-pom-210/verify.bsh0000644000000000000000000000077012674201751026503 0ustar import java.io.*; import org.codehaus.plexus.util.FileUtils; String log = FileUtils.fileRead( new File( basedir, "build.log" ) ); String expected = ", 1 assertions, 0 failures, 0 errors"; if ( !log.contains( expected ) ) { throw new RuntimeException( "log file does not contain '" + expected + "'" ); } File file = new File( basedir, "target/surefire-reports/TEST-minitest.xml"); if ( !file.exists() ) { throw new RuntimeException( "file does not exists: '" + file.getAbsolutePath() + "'" ); } ./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minitest-pom-210/pom.xml0000644000000000000000000000214512674201751026014 0ustar 4.0.0 de.saumya.mojo minitest-pom testing rubygems-releases http://rubygems-proxy.torquebox.org/releases rubygems minitest 2.10.0 gem test de.saumya.mojo minitest-maven-plugin @project.version@ test ./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minitest-pom-210/test/0000755000000000000000000000000012674201751025454 5ustar ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minitest-pom-210/test/simple_test.rb./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minitest-pom-210/test/simple_test.0000644000000000000000000000013012674201751027777 0ustar class SimpleTest < MiniTest::Unit::TestCase def test_it assert true end end ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minitest-pom-210/invoker.properties./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/src/it/minitest-pom-210/invoker.propertie0000644000000000000000000000006112674201751030102 0ustar invoker.goals = test invoker.mavenOpts = -client ./jruby-maven-plugins-1.1.5.ds1.orig/minitest-maven-plugin/pom.xml0000644000000000000000000000112212674201751021656 0ustar 4.0.0 test-parent-mojo de.saumya.mojo 1.1.5 ../test-parent-mojo/pom.xml minitest-maven-plugin maven-plugin Minitest Maven Mojo ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/0000755000000000000000000000000012674201751016230 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/0000755000000000000000000000000012674201751017017 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/0000755000000000000000000000000012674201751017776 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/java/0000755000000000000000000000000012674201751020717 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/java/de/0000755000000000000000000000000012674201751021307 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/java/de/saumya/0000755000000000000000000000000012674201751022606 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/java/de/saumya/mojo/0000755000000000000000000000000012674201751023552 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/java/de/saumya/mojo/ruby/0000755000000000000000000000000012674201751024533 5ustar ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/java/de/saumya/mojo/ruby/EmbeddedLauncherTest.java./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/java/de/saumya/mojo/ruby/EmbeddedLauncherTe0000644000000000000000000001754312674201751030134 0ustar package de.saumya.mojo.ruby; import java.io.File; import java.util.ArrayList; import java.util.List; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import org.codehaus.plexus.util.FileUtils; import de.saumya.mojo.ruby.gems.GemsConfig; import de.saumya.mojo.ruby.script.GemScriptFactory; import de.saumya.mojo.ruby.script.ScriptFactory; public class EmbeddedLauncherTest extends TestCase { private static final String SEP = System.getProperty("line.separator"); public EmbeddedLauncherTest(final String testName) { super(testName); } public static Test suite() { return new TestSuite(EmbeddedLauncherTest.class); } private ScriptFactory factory; private String expected; private File home; private File path; @Override public void setUp() throws Exception { final List classpathElements = new ArrayList(); classpathElements.add("."); // setup local rubygems repository this.home = new File("target"); this.path = new File("target/rubygems"); GemsConfig config = new GemsConfig(); config.setGemHome(home); config.addGemPath(path); this.path.mkdirs(); this.expected = "onetwothree" + SEP + this.home.getAbsolutePath() + SEP + this.path.getAbsolutePath() + SEP; final Logger logger = new NoopLogger(); // no classrealm this.factory = new GemScriptFactory(logger, null, new File(""), new File(""), classpathElements, false, config); // for eclipse final File output = new File("target/test-classes"); if (!output.exists()) { FileUtils.copyDirectory(new File("src/test/resources"), output); } } public void testExecution() throws Exception { this.factory.newArguments() .addArg("target/test-classes/test.rb") .addArg("one") .addArg("two") .addArg("three") .execute(); File f = new File("target/test-classes/test.rb.txt"); if (!f.exists()) { // in this case GEM_HOME was set in system environment f = new File("target/test-classes/test.rb-gem.txt"); } assertEquals("onetwothree", FileUtils.fileRead(f).trim() ); } public void testExecutionInTarget() throws Exception { final File f; if (System.getenv("GEM_HOME") != null) { f = new File("target/test-classes/test.rb-gem.txt"); } else { f = new File("target/test-classes/test.rb.txt"); } f.delete(); this.factory.newArguments() .addArg("test-classes/test.rb") .addArg("one") .addArg("two") .addArg("three") .executeIn(new File("target")); assertEquals("onetwothree", FileUtils.fileRead(f) .replace( SEP, "--n--") .replaceFirst("--n--.*", "")); } public void testExecutionWithOutput() throws Exception { final File output = new File("target/test-classes/test_with_output.rb.txt"); output.delete(); this.factory.newArguments() .addArg("target/test-classes/test_with_output.rb") .addArg("one") .addArg("two") .addArg("three") .execute(output); assertEquals("onetwothree", FileUtils.fileRead(output) .replace("\n", "--n--") .replaceFirst("--n--.*", "")); } public void testExecutionWithOutputInTarget() throws Exception { final File output = new File("target/test-classes/test_with_output.rb.txt"); output.delete(); this.factory.newArguments() .addArg("test-classes/test_with_output.rb") .addArg("one") .addArg("two") .addArg("three") .executeIn(new File("target"), output); assertEquals("onetwothree", FileUtils.fileRead(output) .replace("\n", "--n--") .replaceFirst("--n--.*", "")); } public void testScript() throws Exception { this.factory.newScriptFromResource("test.rb") .addArg("one") .addArg("two") .addArg("three") .execute(); assertEquals(this.expected, FileUtils.fileRead("target/test-classes/test.rb-gem.txt")); } public void testScriptInTarget() throws Exception { this.factory.newScriptFromResource("test.rb") .addArg("one") .addArg("two") .addArg("three") .executeIn(new File("target")); assertEquals(this.expected, FileUtils.fileRead("target/test-classes/test.rb-gem.txt") ); } public void testScriptWithOutput() throws Exception { final File output = new File("target/test-classes/test_with_output.rb-gem.txt"); output.delete(); this.factory.newScriptFromResource("test_with_output.rb") .addArg("one") .addArg("two") .addArg("three") .execute(output); assertEquals(this.expected, FileUtils.fileRead(output).replaceAll( "\\s", SEP ) ); } public void testScriptWithOutputInTarget() throws Exception { final File output = new File("target/test-classes/test_with_output.rb-gem.txt"); output.delete(); this.factory.newScriptFromResource("test_with_output.rb") .addArg("one") .addArg("two") .addArg("three") .executeIn(new File("target"), output); assertEquals(this.expected, FileUtils.fileRead(output).replaceAll( "\\s", SEP ) ); } public void testSimpleScriptInTarget() throws Exception { final File output = new File("target/simple.txt"); output.delete(); this.factory.newScript("File.open('simple.txt', 'w') { |f| f.puts ARGV.join }") .addArg("one") .addArg("two") .addArg("three") .executeIn(new File("target")); assertEquals("onetwothree", FileUtils.fileRead(output).trim() ); } public void testSimpleScriptWithOutputInTarget() throws Exception { final File output = new File("target/test-classes/simple.txt"); this.factory.newScript("puts ARGV.join") .addArg("one") .addArg("two") .addArg("three") .executeIn(new File("target"), output); assertEquals("onetwothree", FileUtils.fileRead(output).trim() ); } public void testGemHomeAndGemPath() throws Exception { final File output = new File("target/test-classes/gem.txt"); this.factory.newScriptFromResource("META-INF/jruby.home/bin/gem") .addArg("env") .execute(output); final String[] lines = FileUtils.fileRead(output).split( "\n" ); int countDir = 0; int countHome = 0; int countPath = 0; String home = this.home.getAbsolutePath(); home = home.replaceAll("\\\\", "/" ).toLowerCase(); String path = this.path.getAbsolutePath(); path = path.replaceAll("\\\\", "/" ).toLowerCase(); for (final String line : lines) { if (line.toLowerCase().contains("directory: " + home ) ) { countDir++; } if (line.toLowerCase().contains(home) && !line.toLowerCase().contains(path) ) { countHome++; } if (line.toLowerCase().contains(path)) { countPath++; } } assertEquals(2, countDir); assertEquals(3, countHome); assertEquals(1, countPath); } } ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/java/de/saumya/mojo/ruby/PlexusHelper.java0000644000000000000000000000171012674201751030015 0ustar package de.saumya.mojo.ruby; import org.codehaus.plexus.ContainerConfiguration; import org.codehaus.plexus.DefaultContainerConfiguration; import org.codehaus.plexus.DefaultPlexusContainer; import org.codehaus.plexus.PlexusContainer; import org.codehaus.plexus.classworlds.ClassWorld; public class PlexusHelper { private final DefaultPlexusContainer container; public PlexusHelper() throws Exception { this(null); } public PlexusHelper(ClassWorld classWorld) throws Exception { if (classWorld == null) { classWorld = new ClassWorld("plexus.core", Thread.currentThread() .getContextClassLoader()); } final ContainerConfiguration cc = new DefaultContainerConfiguration().setClassWorld(classWorld) .setName("ruby-tools"); this.container = new DefaultPlexusContainer(cc); } public PlexusContainer getContainer() { return this.container; } } ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/java/de/saumya/mojo/gems/0000755000000000000000000000000012674201751024505 5ustar ././@LongLink0000644000000000000000000000016500000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/java/de/saumya/mojo/gems/Maven2GemVersionConverterTest.java./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/java/de/saumya/mojo/gems/Maven2GemVersionCo0000644000000000000000000000707112674201751030046 0ustar package de.saumya.mojo.gems; import java.io.IOException; import junit.framework.TestCase; import org.codehaus.plexus.util.IOUtil; public class Maven2GemVersionConverterTest extends TestCase { private static final String SEP = System.getProperty("line.separator"); private Maven2GemVersionConverter converter; @Override protected void setUp() throws Exception { super.setUp(); converter = new Maven2GemVersionConverter(); } public void testSimple() { check( "1", "1.0.0", false ); check( "1.2", "1.2.0", false ); check( "1.2.3", "1.2.3", true ); check( "1.2-SNAPSHOT", "1.2.0.snapshot", false ); check( "1.2.3-SNAPSHOT", "1.2.3.snapshot", false ); check( "1.2-3", "1.2.0.3", false ); check( "1_2_3", "1.0.0.2.3", false ); check( "1-2-3", "1.0.0.2.3", false ); check( "1-2.3", "1.0.0.2.3", false ); check( "1.2.3a", "1.2.3.a", false ); check( "1.2.3alpha", "1.2.3.a", false ); check( "1.2.3beta", "1.2.3.b", false ); check( "1.2.3.gamma", "1.2.3.g", false ); check( "2.3.3-RC1", "2.3.3.r.1", false ); check( "1.2.3-alpha-2", "1.2.3.a.2", false ); check( "12.23beta23", "12.23.b.23", false ); check( "3.0-alpha-1.20020912.045138", "3.0.0.a.1.20020912.045138", false ); check( "2.2-b1", "2.2.0.b.1", false ); check( "2.2b1", "2.2.b.1", false ); check( "3.3.2.GA", "3.3.2.ga", false ); check( "3.3.0.SP1", "3.3.0.s.1", false ); check( "3.3.0.CR1", "3.3.0.r.1", false ); check( "1.0.0.RC3_JONAS", "1.0.0.r.3.jonas", false ); check( "1.1.0-M1b-JONAS", "1.1.0.m.1.b.jonas", false ); check( "2.0-m5", "2.0.0.m.5", false ); check( "2.1_3", "2.1.0.3", false ); check( "1.2beta4", "1.2.b.4", false ); check( "R8pre2", "0.0.1.r.8.pre.2", false ); check( "R8RC2.3", "0.0.1.r.8.r.2.3", false ); check( "Somethin", "0.0.1.somethin", false ); } public void testMore() throws IOException { String[] versions = IOUtil.toString( Thread.currentThread().getContextClassLoader().getResourceAsStream( "versions.txt" ) ) .split( SEP ); for ( String version : versions ) { String gemVersion = converter.createGemVersion( version ); assertTrue( Maven2GemVersionConverter.gemVersionPattern.matcher( gemVersion ).matches() ); assertNotSame( Maven2GemVersionConverter.DUMMY_VERSION, gemVersion ); } } // == protected void check( String mavenVersion, String expectedVersion, boolean inputIsProperGemVersion ) { String gemVersion = converter.createGemVersion( mavenVersion ); if ( expectedVersion != null ) { assertEquals( "Expected and got versions differ!", expectedVersion, gemVersion ); } if ( inputIsProperGemVersion ) { assertTrue( "The input is proper Gem version, SAME INSTANCE of String should be returned!", mavenVersion == gemVersion ); } else { assertFalse( "The input is not a proper Gem version, NEW INSTANCE of String should be returned!", mavenVersion == gemVersion ); } assertTrue( "The version \"" + gemVersion + "\" is not a proper Gem version!", isProperGemVersion( gemVersion ) ); } protected boolean isProperGemVersion( String gemVersion ) { return Maven2GemVersionConverter.gemVersionPattern.matcher( gemVersion ).matches(); } } ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/resources/0000755000000000000000000000000012674201751022010 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/resources/de/0000755000000000000000000000000012674201751022400 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/resources/de/saumya/0000755000000000000000000000000012674201751023677 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/resources/de/saumya/mojo/0000755000000000000000000000000012674201751024643 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/resources/de/saumya/mojo/gems/0000755000000000000000000000000012674201751025576 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/resources/de/saumya/mojo/gems/gem_tester.rb0000644000000000000000000000056412674201751030266 0ustar def setup_gems( gem_path ) ENV['GEM_PATH'] = gem_path ENV['GEM_HOME'] = gem_path require 'rubygems' end def install_gems( *gem_names ) require 'rubygems/dependency_installer' gems = Gem::DependencyInstaller.new( :domain => :local ) gem_names.each do |gem_name| gems.install( gem_name ) end end def require_gem( gem_name ) require gem_name end self././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/resources/de/saumya/mojo/gems/MavenArtifactConverterTest.xml./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/resources/de/saumya/mojo/gems/MavenArtifact0000644000000000000000000000406612674201751030253 0ustar de.saumya.mojo.gems.MavenArtifactConverter de.saumya.mojo.gems.DefaultMavenArtifactConverter org.codehaus.plexus.velocity.VelocityComponent default velocityComponent de.saumya.mojo.gems.gem.GemPackager default gemPackager de.saumya.mojo.gems.spec.GemSpecificationIO yaml de.saumya.mojo.gems.spec.yaml.YamlGemSpecificationIO de.saumya.mojo.gems.gem.GemPackager de.saumya.mojo.gems.gem.DefaultGemPackager de.saumya.mojo.gems.spec.GemSpecificationIO yaml gemSpecificationIO org.codehaus.plexus.velocity.VelocityComponent org.codehaus.plexus.velocity.DefaultVelocityComponent runtime.log.logsystem.class org.codehaus.plexus.velocity.Log4JLoggingSystem runtime.log.logsystem.log4j.category org.codehaus.plexus.velocity.DefaultVelocityComponentTest resource.loader classpath classpath.resource.loader.class org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/resources/test.gemspec0000644000000000000000000000101712674201751024333 0ustar # -*- encoding: utf-8 -*- Gem::Specification.new do |s| s.name = %q{test} s.version = "0.0.0" s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version= s.authors = ["mkristian"] s.date = %q{2010-05-29} s.description = %q{test description of that gem} s.email = ["m.kristian@web.de"] s.homepage = %q{http://example.com} s.rdoc_options = ["--main", "README.txt"] s.require_paths = ["lib"] s.rubygems_version = %q{1.3.5} s.summary = %q{test summary} end ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/resources/versions.txt0000644000000000000000000001050712674201751024424 0ustar 8 8_8 8-8 8.8 8-8-8 8-8.8 8.8_8 8.8-8 8.8.8 8-8.8.8 8.8_8_8 8.8-8.8 8.8.8_8 8.8.8-8 8.8.8.8 8.8-8.8-8 8.8-8.8.8 8.8.8-8_8 8.8.8-8.8 8.8.8.8_8 8.8.8.8-8 8.8.8.8.8 8.8-8.8-8.8 8.8.8-8.8-8.8 8.8.8-8.8beta 8.8-8.8.8beta8 8.8-8.8-8_ea_b8 8.8-8.8.8rc8 8.8.8.8a 8.8-8.8b8 8.8.8.8b8 8.8.8.8beta8 8.8.8.8d_b8_min 8.8.8.8_min 8.8.8.8.O 8.8.8.8.pkg 8.8.8.8-pre 8.8-8.8rc8 8.8.8.8-rc8 8.8.8.8-RC8 8.8.8a 8.8.8-alpha 8.8.8.alpha 8.8.8alpha8 8.8.8-alpha-8 8.8.8.alpha8 8.8.8-ALPHA8 8.8.8alpha-8-8 8.8.8.alpha8a 8.8.8-ALT 8.8.8a_min 8.8.8b 8.8.8B 8.8.8b8 8.8.8-b8 8.8_8-B8 8.8.8.B8.8.p8 8.8.8.B8.p8 8-8-8-beta 8.8.8-beta 8.8.8.beta 8.8.8-BETA 8-8.8-beta8 8.8.8beta8 8.8.8-beta8 8.8.8-beta-8 8.8.8.beta8 8.8.8Beta8 8.8.8.Beta8 8.8.8-beta-8.8 8.8.8-beta-8a 8.8.8.beta8a 8.8.8-beta-8-c8 8.8.8B-rc8 8.8.8-build8 8.8.8c 8.8.8c_8 8.8.8.cr8 8.8.8.CR8 8.8.8D8 8-8.8dev 8.8.8-dev 8-8.8dev-8 8.8.8dev8 8.8.8-dev-8 8.8.8DR8 8.8.8e 8.8.8f 8.8.8-FINAL 8.8.8.FINAL 8.8.8-final-8 8.8.8.ga 8.8.8_GA 8.8.8.GA 8.8.8_gt8.8.x 8.8.8H8 8.8.8-hudson-8 8.8.8-I8 8.8.8-I8-8 8.8.8-incubating 8.8.8-incubating_8 8.8.8-j8 8.8.8-java8.8 8.8.8.javadoc 8.8-8.jdbc8 8.8.8-jdbc8 8.8.8-JONAS 8.8.8-m8 8.8.8.m8 8.8.8_M8 8.8.8-M8 8.8.8.M8 8.8.8-M8-8 8.8.8-M8-8b 8.8.8-M8b-JONAS 8.8.8-M8-JONAS 8.8.8-nojdbc8 8.8.8-patch 8.8_8_pd 8.8.8_PR8 8.8-8pre8 8.8.8pre8 8.8.8-pre8 8.8.8.pre8 8.8.8-r8 8.8.8-r8_v8 8.8.8-R8_v8 8.8.8-r8_v8-8ekW8BxmcpPUOoq 8.8.8-r8_v8-8vYLLdQ8Nk8DrFG 8.8.8-r8_v8-b_XVA-INSQSyMtx 8.8.8-r8_v8-R8CM8Znkvre8wC-8 8.8.8-R8x_v8 8.8.8-R8x_v8-8 8.8.8RC 8.8.8-RC 8-8.8-rc8 8.8.8rc8 8.8.8-rc8 8.8.8-rc-8 8.8.8.rc8 8.8.8RC8 8.8.8_RC8 8.8.8-RC8 8.8.8.RC8 8.8.8rc8_8 8.8.8-rc8-alpha 8.8.8_rc8-dev 8.8.8RC8-java8.8 8.8.8-RC8_JONAS 8.8.8.RC8_JONAS 8.8.8.RC8-JONAS 8.8.8.RELEASE 8.8.8.RELEASE-A 8.8.8.SEC8 8.8.8-SNAPHOST 8.8.8-SNAPSHOT 8.8.8.sp8 8.8.8.SP8 8.8.8.SR8 8.8.8.src 8.8.8-universal 8.8.8-v8 8.8.8-v_8 8.8.8.v8 8.8.8.v_8 8.8.8-v8-8 8.8.8-v8-8-8o8jCHEFpPoqQYvnXqejeR 8.8.8-v8-8-8oA8P8M8C8KCK 8.8.8-v8-8-8w8 8.8.8-v8-8C8_8EI8g_Y8e 8.8.8-v8-8n8LECYEOFjsvtv8NlGpLb 8.8.8-v8-8N8M-DUUEF8Ez8H8IcCC 8.8.8-v8-_8UEkLEzwsdF8jSqQ-G 8.8.8-v8-8y8eE8NEbsN8X_fjWS8HPNG 8.8.8-v8-8Y8oA8P8M8P8JA8 8.8.8-v8-8Y8s8G8E8C8B8 8.8.8-v8a 8.8.8-v8A 8.8.8-v8b 8.8.8-v8-compatibility 8.8.8-v8e 8.8.8-v_8_R8x 8.8.8-xml 8.8a 8.8a8 8.8-a8 8.8-a-8 8.8alpha 8.8-alpha 8.8alpha8 8.8-alpha8 8.8-alpha-8 8.8.alpha8 8.8ALPHA8 8.8-ALPHA-8 8.8-alpha-8.8 8.8-alpha8_8 8.8alpha8-8 8.8-alpha-8.8.8 8.8-alpha8.8.8 8.8-alpha-8-8.8-8 8.8-alpha8-dp8-java8.8 8.8-alpha-8-stable-8 8.8-ALT 8.8b 8.8b8 8.8-b8 8.8.b8 8.8B8 8.8-b8-8 8.8-b8.8 8.8beta 8.8-beta 8.8beta8 8.8-beta8 8.8-beta-8 8.8.beta8 8.8beta-8 8.8Beta8 8.8BETA8 8.8-BETA-8 8.8-beta-8.8 8.8-beta-8-8.8 8.8-beta-8.8.8 8.8-beta-8a 8.8beta8b 8.8-beta8-dev 8.8-beta-8-dev-a 8.8-beta-8-j8 8.8-beta-8.javadoc 8.8-beta-8-PATCHEDv8-WAGON-8 8.8-beta-8-PATCHED-WAGON-8 8.8-beta-8.pico-8.8 8.8-beta-8-RC8 8.8-beta-rc8 8.8-bsd 8.8c 8.8-cs-8 8.8d8 8.8.D8 8.8-Dec_8 8.8-dev 8.8-dev8 8.8-dev-8 8.8.dev-8 8.8dev-8 8.8-dev8_8 8.8-dev-8.8.8 8.8-dev-8Sep8 8.8-dp8 8.8-dtddoc 8.8-ea 8.8-EA 8.8ea8 8.8EA8 8.8_EA8 8.8-edr8-8 8.8.edr.pre8 8.8fcs 8.8-FCS 8.8final 8.8-final 8.8-FINAL 8.8-final-8 8.8.G8 8.8-G8M8 8.8.ga 8.8.GA 8.8_gt8.8.x 8.8h 8.8H.8 8.8H.8.8 8.8H.8-beta 8.8H.8rc8 8.8-incubating-M8.8_8 8.8-incubator 8.8_Java8.8 8.8_javadoc 8.8.javadoc 8.8-jsr-8 8.8-jsr-8-8 8.8m8 8.8-m8 8.8M8 8.8-M8 8.8.M8 8.8-M8-dev 8.8-M8-JONAS 8.8-mahout 8.8-patched 8.8_PFD 8.8-platina-8 8.8.pre8 8.8-preview 8.8.public_draft 8.8-public-draft-8 8.8-public_review 8.8r8 8.8-r8 8.8R8 8.8-r8_8 8.8R8_8 8.8R8.8 8.8R8-candidate8 8.8R8-RC8 8.8rc 8.8-rc 8.8-RC 8-8-rc8 8.8rc8 8.8-rc8 8.8-rc-8 8.8.rc8 8.8RC8 8.8_RC8 8.8-RC8 8.8-RC-8 8.8.RC8 8.8-RC8.8 8.8-RC-8.8.8 8.8-RC8b 8.8.RC8.dev.8 8.8-RC8-j8 8.8_RC8_Java8.8 8.8-rc8-wicket-8.8.8 8.8-snapshot8 8.8-start-8 8.8-u8 8aug8r8-dev 8.javadoc 8Jun 8m8-8.8 8May8 8Nov8 8-platina-8 8PR 8Pre8 8RC8 alpha alpha-8.8.8 apre-8.8.8 archetypes b8 b8g beta8 beta-8 beta-8.8 beta-8.8.8 build8 build8-svnkit-8.8-patch common configuration current cvs dbunit8.8.8 dev-8 ea8 ext final fractal full g8_8-8.8.8 genschema http INF jar jdk8.8-8.8 jline jruby-pre meterware nanoweb pre-8.8.8.8 r8 r8-8 r8-8.8 r8p8 R8pre8 rc8 rc8-8.8 rc8.8.8 release-8.8 release-8.8-G8M8 sample SNAPHSOT snapshot-8 SNASHOT sources src struts taglib test-8.8 test-8.8.8 test-8.8.8rc8 test-8.8-alpha-8 test-8.8-alpha-8-8.8-8 TSS unofficial-8 usedbypico util-bundle.version V8R8 webwork X ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/resources/metadata-a2ws0000644000000000000000000000344112674201751024367 0ustar --- !ruby/object:Gem::Specification name: a2ws version: !ruby/object:Gem::Version version: 0.1.9 platform: ruby authors: - Andy Shen - Josh Owens autorequire: bindir: bin cert_chain: [] date: 2009-10-30 00:00:00 +11:00 default_executable: dependencies: - !ruby/object:Gem::Dependency name: httparty type: :runtime version_requirement: version_requirements: !ruby/object:Gem::Requirement requirements: - - ">=" - !ruby/object:Gem::Version version: 0.4.3 version: - !ruby/object:Gem::Dependency name: activesupport type: :runtime version_requirement: version_requirements: !ruby/object:Gem::Requirement requirements: - - ">=" - !ruby/object:Gem::Version version: 2.2.2 version: description: email: andy@shenie.info executables: [] extensions: [] extra_rdoc_files: - LICENSE - README.rdoc files: - .document - .gitignore - LICENSE - README.rdoc - Rakefile - VERSION.yml - a2ws.gemspec - lib/a2ws.rb - lib/a2ws/base.rb - lib/a2ws/image.rb - lib/a2ws/image_search.rb - lib/a2ws/item.rb - lib/a2ws/item_search.rb - lib/a2ws/methodize.rb - spec/a2ws_spec.rb - spec/spec_helper.rb has_rdoc: true homepage: http://github.com/shenie/a2ws licenses: [] post_install_message: rdoc_options: - --charset=UTF-8 require_paths: - lib required_ruby_version: !ruby/object:Gem::Requirement requirements: - - ">=" - !ruby/object:Gem::Version version: "0" version: required_rubygems_version: !ruby/object:Gem::Requirement requirements: - - ">=" - !ruby/object:Gem::Version version: "0" version: requirements: [] rubyforge_project: rubygems_version: 1.3.5 signing_key: specification_version: 3 summary: Wrapper for Amazon Associates Web Service (A2WS). test_files: - spec/a2ws_spec.rb - spec/spec_helper.rb ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/resources/metadata-prawn0000644000000000000000000000675312674201751024653 0ustar --- !ruby/object:Gem::Specification name: prawn version: !ruby/object:Gem::Version version: 0.6.3 platform: ruby authors: - Gregory Brown autorequire: bindir: bin cert_chain: [] date: 2009-11-17 00:00:00 -05:00 default_executable: dependencies: - !ruby/object:Gem::Dependency name: prawn-core type: :runtime version_requirement: version_requirements: !ruby/object:Gem::Requirement requirements: - - ">=" - !ruby/object:Gem::Version version: 0.6.3 - - < - !ruby/object:Gem::Version version: "0.7" version: - !ruby/object:Gem::Dependency name: prawn-layout type: :runtime version_requirement: version_requirements: !ruby/object:Gem::Requirement requirements: - - ">=" - !ruby/object:Gem::Version version: 0.3.2 - - < - !ruby/object:Gem::Version version: "0.4" version: - !ruby/object:Gem::Dependency name: prawn-format type: :runtime version_requirement: version_requirements: !ruby/object:Gem::Requirement requirements: - - ">=" - !ruby/object:Gem::Version version: 0.2.3 - - < - !ruby/object:Gem::Version version: "0.3" version: - !ruby/object:Gem::Dependency name: prawn-security type: :runtime version_requirement: version_requirements: !ruby/object:Gem::Requirement requirements: - - ">=" - !ruby/object:Gem::Version version: 0.1.1 - - < - !ruby/object:Gem::Version version: "0.2" version: description: Prawn is a fast, tiny, and nimble PDF generator for Ruby email: " gregory.t.brown@gmail.com" executables: [] extensions: [] extra_rdoc_files: [] files: - lib/prawn.rb has_rdoc: true homepage: http://prawn.majesticseacreature.com licenses: [] post_install_message: "\n Welcome to Prawn, the best pure-Ruby PDF solution ever!\n This is version 0.6\n \n For those coming from Prawn 0.5 or earlier, note that this release has\n some API breaking changes as well as many new features. *** You'll want \n to know about these changes, as we will no longer be supporting\n Prawn 0.5 or any earlier version of Prawn***\n\n For details on what has changed, see:\n http://wiki.github.com/sandal/prawn/changelog\n\n If you have questions, contact us at:\n http://groups.google.com/group/prawn-ruby\n\n To submit a patch or report a bug, select the appropriate package below: \n http://github.com/sandal/prawn\n http://github.com/sandal/prawn-layout\n http://github.com/sandal/prawn-format\n http://github.com/madriska/prawn-security\n\n Prawn is meant for experienced Ruby hackers, so if you are new to Ruby, you\n might want to wait until you've had some practice with the language before\n expecting Prawn to work for you. Things may change after 1.0, but for now\n if you're not ready to read source code and patch bugs or missing features \n yourself (with our help), Prawn might not be the right fit.\n\n But if you know what you're getting yourself into, enjoy!\n " rdoc_options: [] require_paths: - lib required_ruby_version: !ruby/object:Gem::Requirement requirements: - - ">=" - !ruby/object:Gem::Version version: "0" version: required_rubygems_version: !ruby/object:Gem::Requirement requirements: - - ">=" - !ruby/object:Gem::Version version: "0" version: requirements: [] rubyforge_project: prawn rubygems_version: 1.3.5 signing_key: specification_version: 3 summary: A fast and nimble PDF generator for Ruby test_files: [] ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/resources/test_with_output.rb0000644000000000000000000000014412674201751025766 0ustar puts ARGV.join.to_s puts ENV['GEM_HOME'] if ENV['GEM_HOME'] puts ENV['GEM_PATH'] if ENV['GEM_PATH'] ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/resources/test.rb0000644000000000000000000000027212674201751023315 0ustar File.open(__FILE__ + (ENV['GEM_HOME'] ? "-gem" : "") + '.txt', 'w') do |f| f.puts ARGV.join f.puts ENV['GEM_HOME'] if ENV['GEM_HOME'] f.puts ENV['GEM_PATH'] if ENV['GEM_PATH'] end ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/resources/repository/0000755000000000000000000000000012674201751024227 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/resources/repository/org/0000755000000000000000000000000012674201751025016 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/resources/repository/org/apache/0000755000000000000000000000000012674201751026237 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/resources/repository/org/apache/ant/0000755000000000000000000000000012674201751027021 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/resources/repository/org/apache/ant/ant/0000755000000000000000000000000012674201751027603 5ustar ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/resources/repository/org/apache/ant/ant/1.7.1/./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/resources/repository/org/apache/ant/ant/1.70000755000000000000000000000000013031007567030026 5ustar ././@LongLink0000644000000000000000000000017200000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/resources/repository/org/apache/ant/ant/1.7.1/ant-1.7.1.pom.sha1./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/resources/repository/org/apache/ant/ant/1.70000644000000000000000000000005012674201751030026 0ustar b7ffdc772faa065c36a292a9db0242f19241cc50././@LongLink0000644000000000000000000000017200000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/resources/repository/org/apache/ant/ant/1.7.1/ant-1.7.1.jar.sha1./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/resources/repository/org/apache/ant/ant/1.70000644000000000000000000000005112674201751030027 0ustar 1d33711018e7649a8427fff62a87f94f4e7d310f ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/resources/repository/org/apache/ant/ant-launcher/./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/resources/repository/org/apache/ant/ant-lau0000755000000000000000000000000012674201751030303 5ustar ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/resources/repository/org/apache/ant/ant-launcher/1.7.1/./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/resources/repository/org/apache/ant/ant-lau0000755000000000000000000000000013031007567030300 5ustar ././@LongLink0000644000000000000000000000021400000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/resources/repository/org/apache/ant/ant-launcher/1.7.1/ant-launcher-1.7.1.jar.sha1./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/resources/repository/org/apache/ant/ant-lau0000644000000000000000000000005112674201751030301 0ustar a9cbbcefbbb5e7f97596045268243a8c1c7aafca ././@LongLink0000644000000000000000000000021400000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/resources/repository/org/apache/ant/ant-launcher/1.7.1/ant-launcher-1.7.1.pom.sha1./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/resources/repository/org/apache/ant/ant-lau0000644000000000000000000000005012674201751030300 0ustar 05d6ac6979b89f1f82b0a6df723e60d158c8095b././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/resources/repository/org/apache/ant/ant-parent/./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/resources/repository/org/apache/ant/ant-par0000755000000000000000000000000012674201751030304 5ustar ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/resources/repository/org/apache/ant/ant-parent/1.7.1/./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/resources/repository/org/apache/ant/ant-par0000755000000000000000000000000013031007567030301 5ustar ././@LongLink0000644000000000000000000000021000000000000011574 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/resources/repository/org/apache/ant/ant-parent/1.7.1/ant-parent-1.7.1.pom.sha1./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/resources/repository/org/apache/ant/ant-par0000644000000000000000000000005112674201751030302 0ustar a6059057a4a8aed8f1326c4e0b19fe8414fc43fc ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/resources/repository/org/slf4j/0000755000000000000000000000000012674201751026040 5ustar ././@LongLink0000644000000000000000000000014600000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/resources/repository/org/slf4j/slf4j-simple/./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/resources/repository/org/slf4j/slf4j-simple0000755000000000000000000000000012674201751030272 5ustar ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/resources/repository/org/slf4j/slf4j-simple/1.5.8/./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/resources/repository/org/slf4j/slf4j-simple0000755000000000000000000000000013031007567030267 5ustar ././@LongLink0000644000000000000000000000020200000000000011575 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/resources/repository/org/slf4j/slf4j-simple/1.5.8/slf4j-simple-1.5.8.pom./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/resources/repository/org/slf4j/slf4j-simple0000644000000000000000000000260012674201751030272 0ustar org.slf4j slf4j-parent 1.5.8 4.0.0 org.slf4j slf4j-simple jar SLF4J Simple Binding http://www.slf4j.org SLF4J Simple binding org.slf4j slf4j-api org.apache.maven.plugins maven-jar-plugin ${project.version} ${project.description} ${project.version} ${project.build.outputDirectory}/META-INF/MANIFEST.MF ././@LongLink0000644000000000000000000000022100000000000011576 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/resources/repository/org/slf4j/slf4j-simple/1.5.8/org.slf4j.slf4j-simple-1.5.8-java.gem./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/resources/repository/org/slf4j/slf4j-simple0000644000000000000000000002400012674201751030270 0ustar data.tar.gz 644 765 24 14666 11321346432 12730 0ustarcstamasstaff 0 0 ZTTY9G M& sFZh 4I-Y@D ( (9Hu5ΙsNs[{_Uݪw@m.EP _Jp1QQoK DBB"""@BBh~MH痹ڝ00|ׯΗBz_J}ۃw~h+zWK&z [6myueC#JXn e\+,hw螏ۊ!^g~!B~sp g6'<<9΢TpOoiN>00PojI&x'UwqȜOfY3U 7lESo0Hns K)ggGMuFGíN=ԣg}u{*:_arР5m%ٯo(%hJb!eX5P\pr'9&aj. dp7KF!ba7a PXX|aAuij&VT4_079ŏ;  \,f6Bh98@@;0i5dP lcH (Bˁ[T[¦Mx&'4ڰsڨQ|ft}>Hꤛ1ier[yRq̫叇/v SqE—4U-RCR,vJ8|Fp/7y*,,vDE4x^7/jV:`,6J+ɿflLxUMm|[˾њ Ef^A秧Ӝ0+ \u|g?e(}qFQ'mkn6n8D"`9YnbxГ!OD7Hz ߭~*RR(Gv'?  JѽColM篈ΘXVʢ=Vr* E{pJ/Z˻8"R"%BQ^J&s'IIA'[*F46fGҩ;2k؛9vӽXf4cV]xqpi!VHȪIfXs- `Ttg+A3TJTiW\AaR(hT-ww2ڭ-3n>T1<Y58д'@ӥ\GD&䝮9Agďđ ɕs]964'ϭy!l+;l)}ΥIgoNhLs3M&K3eN"y#[{Z2va-)n8) 6vͥwڦwvC&VyV<J,uO&Z~unKڶiRi_նs}U_Reաhq9W۴3%ؔ‰l)2, ξStШg+tlK!%+Kt4gU]FKbۂJ B};숋{j@M7XXr7x̖0h{:Z`-`KɝcvB$ԇt{|i+b%F̍N$Hi4E}Nhulobwtx7zεLF5glNH)dU'G2ۂf˗!d{Kõ :aWq:{ ;*D)e>g2 WmH_W=ۊm,ކ= 59=R^khzFS )!%k9}6LuV7;ďwvlY,yū Ct(k;no]y DZ>TG"UNN!]L\W"HDWl]TMzP)IᦆM[i 1ߨsuDGAȵ6nC^JKz 4ƽv ,L/+zd!c 29+&fj-~k3-D=p8!<-MA kcxe!̸^۲@b"V LU1 >ebʤŖRiPy0`L䰱T׺_)؜ H5^Z ֑Ǹ`)DjB"؍J>NCT9Sna?XVs鷍 re62{ةQ! TrO\iC{x|#XQb):JT^zuR\U~8*V0lp]>\m7RSAWC1IWr;ӧ}%C״d #&X>hƭʝ` )'Bk7dK5/-yN4^vsRsĜM38W~l*u+FU !Y}f!qN$9qDn&R|[1٤n>(F~{2b1tkvD˞~<*i<_m˴p,hZ^'(ȃlq uoTLYl #oA<} X}<2rıʧADf\κRl?RJ4bܷyҠ2|,͙R t0fU@ 1y)E,f sKM[j%j9 ,˿9ldK3Fʿӻ`]^msvTfI$$;+u/R9Pַ_TK"e2Q /f#, & Չ9.iɞ*1SLEz] [ր 'ӷJ˄9>|{X{3z^@TLF=,Y48GR:]6-a%w~$FDN}r(/ jD ]UFwX޻.K=^e 6]b6+ 6Z*Bt, .C0}wW3ʺsG2^M?77_$IDAւrlTB.RG2hvXܬR&i+W'b'%7PvF xbMi"Y[9˹f6Tѳ;=uMĄc.N3Dz8vBPJ-{ʩxbd'+ӭsĴR$ϨPug1!(n`"xC+JO\?O=ТmHn8()v]f@d$3WgLصj7WYN$/HZ2y텎@FgSl9IVu^Ի`݋gA+К1Ӑ!ʊ܋4^ϗ`}9S# H\OpO5j2Fss k3.e879#M././@LongLink0000644000000000000000000000020700000000000011602 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/resources/repository/org/slf4j/slf4j-simple/1.5.8/slf4j-simple-1.5.8.pom.sha1./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/resources/repository/org/slf4j/slf4j-simple0000644000000000000000000000005012674201751030267 0ustar 14e4792aa0779d566f696dece31a7a2aef557026././@LongLink0000644000000000000000000000020700000000000011602 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/resources/repository/org/slf4j/slf4j-simple/1.5.8/slf4j-simple-1.5.8.jar.sha1./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/resources/repository/org/slf4j/slf4j-simple0000644000000000000000000000005012674201751030267 0ustar 5fda3cd5f3d8112d88c682dcbc060b4b2830364b./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/resources/repository/org/slf4j/slf4j-api/0000755000000000000000000000000012674201751027631 5ustar ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/resources/repository/org/slf4j/slf4j-api/1.5.8/./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/resources/repository/org/slf4j/slf4j-api/1.0000755000000000000000000000000013031007567027765 5ustar ././@LongLink0000644000000000000000000000020100000000000011574 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/resources/repository/org/slf4j/slf4j-api/1.5.8/slf4j-api-1.5.8.pom.sha1./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/resources/repository/org/slf4j/slf4j-api/1.0000644000000000000000000000005012674201751027765 0ustar 8692e4210c1fa89b7e6aa388a47653127d5ee08f././@LongLink0000644000000000000000000000021300000000000011577 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/resources/repository/org/slf4j/slf4j-api/1.5.8/org.slf4j.slf4j-api-1.5.8-java.gem./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/test/resources/repository/org/slf4j/slf4j-api/1.0000644000000000000000000007400012674201751027773 0ustar data.tar.gz 644 765 24 50514 11321346432 12720 0ustarcstamasstaff 0 0 Իc&Ͷ.Z]]m[m۶emvUo9g}]{?ύgș3fDfX18ۘZ:X1ѳs[:L쬬9Y2'3211s22232p02_&:S\?s矲0'IQ 柭c 'ˉ Iɋ3/XKJ% 0ڿTTCBw W!b2o]EPhtv¾{#xxOX:g8`,B:{_Qz: 4!J7cIsYôxxWb2^:R89P5Ñe~݆ B]dxb@/ רiuP>>S/.JKSlc}8`Tap余elNJpIjt Ytsmѓ?يfTlʓYc;'pVODZt=ũg6Xy{`!/?m /8 SS'忩!D@@@@$qlaCgKc9C'kS'zcCgTuMg45OIHC@AbB3F~,hY8MbQ0wG>]qK%hRqŪq k_A/[y3`U> ;ϛ<;\=@ S&,eد|dp|Tl&?^AnNNjrrKS U*N3FKK䬸 `=e&Zѽ^^!;H_P>U[+VPqB%.43pfK.GD[LHrY'eyk$}滣٠jt]L]bl0ʩam]%a9k^[:45PiLedEfa B;.cRZ>2Kb)g(G\oX; _ʢϟfZn#.Y jcbvtdIJt!'j>+Ω 6"h9((!Ho Uӕn!! !X߂UG"V9PٱX#I M\̆/EaHDf+<|bR$Zl I0! D#M\*k?!%MD>47իJ&)&}z׸D#,ׄj1l \pC.MV Q p6Ȉ0DC۬Xެpթ@mTdyA*:& 4&j;o-B(j| Uj"!"J͜J^gNv4Q_Kp{&$r۽?m{ؑ΢dkx&2 q,³ž [ӹw` fn=؜"7N^vT/f98ݐ@]{Ze7K&73eةjם?[bԐp<2WA\J}>oUXXpb$CoF+rRM"tV_ad5n tQ0--o%YW|56i{) av86Z {m~}~pB9#h m+Ȯ.Vğ{Jp re40!Z==%NyӠvtڔկ/G{['N@Нz֛ d9CsT\YVG᣿ >Byd]V4ǫ/[|I(Wf Ն$'0 пNx}Rtcl{岽@̚kKCS==Q4߽Cv./ѢW@*~}fP8ZPD!86@߾R0ӞC*/ 9Ѫqՠx}<,6Ь+`DطDxj^7kxe][4"-P? R0pidipXA X2_;v~"k{{Fhs S늻3WKeL( &}K& MT8`4}9 XcHSѹi+p$iu J F-7Xjy%v)6z8:lR܊SWd! 3,J=_mTox %eU ̉=>ʘAG} /x l *gI%^\"L[|>o֜gݒ=*25C 34 bI LTzV #:L?omsvY(w_LWcP R\Mhao&E ~X(2G B\.?鱪s2h~S  B$.{!pćܨ4gDV' E#D6^1_KO 5ETIVoĥX~玫hod ZJ[rOjZm^<pl|v˓,kX/Ϸ{x{E!mAiwFqT -EeݮLm=.W[-0% W``„CTD[*8jXgKJ+H45CG0r.:@7ٰ;n]nZ)'Gc*so|:&]vM|$ Iъߨp{ *8Nx >=4߫螗.p CK6Zf(3-$g'V2}9\UZCYx`C{JWyJ iWmцh:Tҵ] U0Evb'VD?l *9lW5[JSK-296B;9-ůjӚ:bʡK;{:+P›Im74pxgLȃXEah._ǰ*_.>w'"f|hGMEE=QLʢf\1mr#Q$k'fcS/}{*j,*VT[aV$:n-lpBhpmQl]UgD7\ըAQW$M5*Sr xB_^!͸a+}ԮaS{^.)ֵp$%8'؟d #^O L>þLjZd>J*(.;oY;O?ʼnPKLa@ItadG=xN%m6p^F^/ $mod>ft ]uz~nKCx|XZ ypD t>MtpL g {J=_ҏ'" $,KCwNAצbh.je PT:gbUݎYau*%F:ه;&ulQNdMٹbHNYu1߼2[uۍ'߃<}pOD0];KsorzҬ4b>ghD`Z9!ZѾvXR=PT5'pB&.fY8w뿦V)s;{'K;?_^$ZG k{ a)x, Up}"a[ !rH-$ئֺj;wm Ãw'Ȑthg߷[SW(g~"8#KIaHn6J:%=K&&%K1NKJ4 %V'U'HG4EuXF=Րp}#Vh.^y=5Moʌ^w9qXW7*o2B~(Hjܡ $OcSH[Ȇ0{JہCC[0RWx[`f 1Qj-V *9Mж%<`eΩ }? Phi{ G -1Z"َnɈ[rـhh"1X{h%2)" -ꑀ,h!bv˴Kpg2Ub@=tZ&i=J5귬lc۰:&%;I mb!ȄMUUbcLA7\v aLa Ʌ.x7uDRVhgy7A1t&g[=z6\t.=$ *&m"-C PLaߌō ?/3v">'ӳ.ebA',Gǯcg{<7:OB?L @M Ml ]w飺>&($ o -ID(!s'o6 ըyc֊"ݶFjYݺfkCMyj"۶s=sU6>X{4׍&3v$nM&~jRݘO\A։ܶH܋΃NGEH6Wk;ǽ$9.\vzWM5[׽{ٜ5JGsG^PB9Ǝ"eq?3=9',rRXxiԴWgk;ʑ3tPoI*-kW쀏OԩH-UZu=W|~޵H_Mڲ-ոnX/kا8@T?v'R[ʁd ֑',XS¨XbT)rȊpհ[*c t{W*ϵ5?q(caWS0VM s劽p5O SMboOպfEZdsdd3OxzT)p`РmndȞNiak]]S>ě(-ֵxoT'"?fv.zaFtjhVuq|@}P8h^k#h46ۊ7(6֕uմCUIbCz_y2Uu"u̸Qhhu63]$v"*XwA|?t455ub=jmkEˈMZT;2 6׼w=EBRETzWq<6w1) VjY@<1D` Cx,3GLIXϊXh9׊'oaФ%J{2,nT^cֆaݷ|b  oz{ EVOC- :BA6ΔW]{BOf󐦾^uiP\shC,jזV ?uF<5l o!+{tgI3ϘD~683vvOnPJC6,.{f j(15Vd&Tj PG[Q˰dvYFʦKjr]?&<=Y^tI[HF F ft[S=@:6ц4q A^;% ᦧXlL;Ԟ $r&q:y.7ؔ|Oxr'̱W \jՠlqwc}G~J0"Wꗤry#*}5yfkͬlq-,4c?c(tzM>T1;L'44>AWLIG`RPUlIJ:*A 4+A[(zİa@mJ1i MӿbGF) Uyr|36DG  gܸt -t<].jDJ>ӄ+,b9 JѦ ٲ(j*i _EK- }/Dr%S*H*WյqO"W? O\t!S:RXВY(d&q̯حdGuUҎX^H,8+!W:gb)7E)$TjErQ-1SԼZY+$PDvPbRZEFhP&Ȩ,G|FZZӊXTuƨTG~fW''ڝVŧduΩ8sn|; X755777u?[H|v" a7orAxjQеX\( AEHMjQ!,EfqOw0}a 2'1bGr>(OmƘ:܀fݰ<8Ӯ:UW 6hqE ɱ_}T+cb$QUMע}k\}*Er{f!yQXtdBSh?Xe+!ϡ4SUV9RN.KMVƲU~TfrJ4!$RVtxn4_,?5Ϙt>Ы~z;e:3&ʠ %bKP??}e{uJ.C)uIP &y֞ҵEAx = 5oWcE h?WA_bsdQFv\v l E}JJIЃɳl5j.38#~[޲f1XׯJ,L(Op+)[) uUZq)V(,K)kjAi;Bԛ$&4FF]N>QԿJP6.ȁ !Bݣ'By68$3uq&;,%45:ᑡ681_*<`GL5[)I<7>Tki5v~BSyI.W:`)tűUڒ:GQ``he2LQ[7eh#s0C SvFI^KUey⤋!Q轇B߀r.@9dFkX&dX_Oa5Rpi'-ǻiYHi-Yd5 !VVRBEAoD c!OӌOi`XvdrqÌd6zo,n02;:3eo\2O4_F엝 K pS E\5̉>wS9ԑDmAvPl8\u`l 91q!xxc)}Y۵B9_(c$ NP|\~91S,Z l}cShA"bSW<*rA[(ghmw9r HXBҚ Аz҉`SX%kv6\TVZEs8o@_"4ͥ WˣYxonʣP^UDT B $;B+ll%f@1 H7ÄCF`8HO~EĖk{)ZޅQY85YʇʾX /٫e, 4a_thnԢL,C^=y(>x1i)Uݵ]'VN/M]_ݍO Rmy #޺o~ N<afi&,k {L藌ؐ;K+W2!a7†fGx궰'$!δ O-UOf߾4x(C ?`Pq5rvtqu1+pe[E,Vh[\Ί{Sv aAtqџSʍv(_b/JjBvWΜ3cz~xv4Յ-+mqx.G4& `GXR(168s:~~Ǎ'uJQbQ(8o&p%}o_fkhpPF} 8\N&΀|QH)W qj5do9,f6>VjJ,rY?& &v^ y. pR_-fp43뾇zz{cQf_[+7{LA>i,ODi-guw2 7 *?E_̰UֵGBM u}#՚i)  7 +GUWvaun`7y[SQː*jngv0$4n%Me"[҈"4ѕ'$qf4 CPǃ %EBsv` Y,OZ c@*1\q %:g=aMU;*AgAp UTIlܬ Ģ-_ <97lEEt#y& 37"B=h'`m=ςli!9(4ä jDˇ9m2ai`0aGNBZ_JMo/}|]Κ")kFմX{଼ b}#]6keGF>.en7h,vJrD *<.,mU0eglgP*tnrGkiwJذ*Ձ9 I`^?O\qr6yԌb&G l;TE;,QzM2_$ ϣ ?/8"Ebq6Ճ9].I].r ]>sXi}#!jw T['sT! "ڴJG!CU=!C>4+lbbd{GG{'{AA!&EUZ۟KmlB RW 1Д)lV\M~Hm½BO﯑{7Y99E b\ў(UХE iCoR*A$ ,;#aRSC{֛LD?F=(y*xǥ!~MI<`A]6يW\ t2uȫ/L0AKB Sc{%K\طN TTِaXdH͕k`…=1[;_~<DExi{M[\/Yphwvh, P:dQBbOu$&_HH1` '_X?OeƾVu&cŮchxz+~E.rUZ`٪>ĭXh=|[}6]7gTvýޞ՗]7lXs!q`?hMbbՑgQ'ﵜ9Ҷ~ޝ ә›SQ ǥ(Nd|GTT1by$YŹ%;0l3J']hd#Gv9,$obV;`9t.9DQWcx Az(=\=.p`^wj0ɴKܐ@ߐRWkܠi_ֺ W^D@q^R:j-]v"r+d%MZrcntC/̞RfGCQmoAM d``CxhB;7?ȓez쯼&9?;Y?}Q6O%ՌzH;}F⥯'4nԸ6)x6G"Z"mI~I}}HXy+F|^,2?(XyOGT^BY nb.Txռ HL骽~҆xb/pXN창[P#2(nрb@N$IY$j_-u&pM7]vfMHVVf D: <*ϖ*FX*[2Y Xs$*QE%:Qlf0;(.bBht2+(jP;rA/S$E/awu ۛEF6MmR C 5io S: YbړrܐG%f'cU&_I)pL Ԡ 4v9)#bC>?Yޙu \۠w)qe:V-K͹䲉wy  /7%#BKג{Gj\ EZ*&xKhBn|'pĴ;#EvMv1L\X9;lq. y6xgXXΐ5=ˮ_^E̞xkdIe(Em!u' ֌- | q"YZ?H {\2:1b{vu$*v[pSԽdPq75WۄJ)AqZC)YEyiMK=VӭFC|fÌ?\MM'qj:KQ&CphT7GSt5l*,M/Jɺ\M5& *EKF=]*9.1Gn5g*yrhZ6Ѫ6 ^)iy*j؍=DQKmJ#QR8^ƯnZD&WLS/ ld2}byG Am?Zwh­j19?Jص?f3ph(=\nɌcV7yyysPS0rK8RutCYlZf,#DvKs7~||0Oq'ܰjĀvcN ú6,8`E7(cV Z6E%?1.q;gηXmdFqkNO ק6x 3%o,Qy-؛%".|DV-4u7%F,`v"97(DUwH0J]:1Ukq@į#6% ZUl݌!|+v݇ 0SWv?H_#_}Oc=Ӷpi9gҏFצ)W9"6``*pKLM U)ݷѵAnBc:_gRMk'f=HNn"-8" ޚvYVav[Q/S;;3:}!ϋܵAͭfr}srG9EV L 7""oMUI+,9vL [6+2%ei$ljt!Y*m1r Fmat3w=m|I'TąǛ[CFaݟ9Rrw2]뤌PysB^kr=%g!!C_C`֨Oe98bH~sߣ{ 6։u=?-y*~q JX@|Pd_1yP~I JIGSkrA$={(>^`q>YI:B&q%"`,_ 7>0#æ1ǵ$$HP03eޯhP6c0qU85F+x]o!1H0Cx{ը+ϞS7.'j"sGdrTw <١*Ff>韺fljk8MFoM -0+\|8iKdmˎg0D?oL-8n_<貣 B_nvI"t/gSoVZA8ŇE?x#[y7/"7`/t0, ;L#jl=29\c7× s`t!c`}s"% m:z\nϧ={À8WJ7'qShKr~j5Mr/$4>F} U1*$d?K!G!"O{ޓרD,d6c΄$+R[:vLΤ~JY?i4?qku} 99)nIHbutsU+M0$ A\ ENS>s9ϳ LR\\,xʣS>˃w3?*NvU7{hIfHɨ{iGg,:^R(\꤯) nV7XO%_z&E]&]3_g628} ̩)pm2‰Gu֔sXtI`extE>z< J c/>S =qyRԵxd& YjXw>'lNE)yczYz[n'Ro]}ۛ3R/R!ht:HJ1^20-C{W&#8tњ:(${LIct'm) f 6Qqx;?VUsr:kXISP7 ߥa"$sg|nF~UBXW{7V ~EİȶdlbUM4,Vafd6qf8@#e8BOBka(|O2d%0Cˀ  Bު:=*b3U EXQ6k4xQ͋ YL36IJ2U 7+cl*Rl*/kVcim5ϘYN],а8SH./|*u'nǘͤ#ԭtMoDJ%Yͥnrm`ncVor^4\.&a}>f2mV7#_OWFTJyZ%TwdEkςjwˆ*I1mDk]]t't˅o2_>c~ yxI5*@oJp┙\AlQ^Qߊ̶K~@61h Wꋊf3߆t! ua, jMl 3 uq|s ~sؽb,\yr"B< 9םv#@,O{TqDz"* AЫRDEP^)2E"QD J̍sL3[oݻ[,$s6\Ʒ*¡(>Z19ד"ߩC ɖ"*q#ϨhS`6 SBMZK'wJ2#44z/e&tkWG9{9clڤ\זxRO8Ę(ʛΧ4t3 ̮)* KŦ5mBr//> { A:򁴙67yggN%C+5GڹX|5hL,ӜoI91e$@A*!C/17`jҔc^k-+811lȐ9y:=댤6 g%\G|l>ESnpN)Q Vi u0#Wz ;565^?lJ*܃Q4ZWHH̾("ғ<3ʻ=lte9?Vh֕kb_v2ȾQ"K}<<Ž%§OpAW=:vٷ* >^Žfze0!ϼ2 tKPxyŹ3Qpy/P|\əTa'V`K98~ɺ㜰Õed=͓E؄ 3&O΂=cALW䯨\Oٝt0pQ:;ALiDJtesN,Ӹ$*pZW}^[Þw~N%Q-A%K0̗>m^[r !ܿԣt9燙 DHS]S+oHdHNw |I({=uɵY@}nq3EjhFF=)  F$\ϋ#OT9>˷ĉNp  Ys+s*b!y}{#/*uA~LQ{r\QЮ'SbjkۿJuo1<5Pt<Ġ6WS &Oۜ>eֶ`Gjg9ikh;/Kfnow~Fo-Rx) ɵ# Bec :0}UoG }1hdT,]vMz͎]kag:_u-j^z,{NfllF\9@%qT<9t&>sվ8ca3h=.Q|2l|DUA4TѰ`9CDǯjXIdS\\_JH[T[wj;NMfl7qb޽99ZJ+ XrMIwQ\D=ԟ YyR8 r󩆕vuz⤸ X&'atlc3=r2ܑYτ),_({״S[pig9 R.(k=e]~7|1:[XZDY9_=:\l.rz(Ƿ5IbȵGo(LJLoht7n*$q7d'1''2>TE>0ЊrC0( r)ӋЪ_팃ƦI[~((~uɄoIYaFA2]RԚ-b3*#vAu}z0~ܧHE$ B >hpǂl1uKO?16uBfO&FUOesdʡ1bq ЅǕqSBWK>u|Wop?!G.m72~gw&u4Ь &Wam*˓ѴTT%L^tWʑL(W7Xd1<%k>x 麲[|{n +;>SxWEYO~k:ܸ7FkqFߕ[yWx$m0ڰY&#񳕒PDݷI!{sቝ3E:ҵUz-=rKu_ƎEizp_DTǨLڞJG `_t)1jrѺ-9g+K^y=j?2ooe뤑^xXf.GE)+V؍AYՕ,|:Lnω<]a3o#R}pֈ䈭[%n$Pom}y?p[OP`KB8 B%tlqd%u5سӷl9#0s#rm;bgɕ6sԑ)Oo`WiYPg34"9"EHͼP}A3gH{`HK;OFiFiFQEGQEGQEGQEGQ [xxmetadata.gz 644 765 24 611 11321346432 12733 0ustarcstamasstaff 0 0 mRj0|W`4Eo}iIi ЗRZZ{[$9'ʲ$`J;34M?Ĺ:*h h c, &3\y1 3f=9M cjr!Ewtyw1&K|D5g"1Ƥ"ŗwjbhL|R!2j@Ϙ-b 7cҞ nwƞMl) 3` >ZO,%i1*ê__^i[e<Οo\F*0ڨGm΢˛tGc.g(rz2Q ˠ׳AT2v)9Qu2{,XXΐ5=ˮ_^E̞xkdIe(Em!u' ֌- | q"YZ?H {\2:1b{vu$*v[pSԽdPq75WۄJ)AqZC)YEyiMK=VӭFC|fÌ?\MM'qj:KQ&CphT7GSt5l*,M/Jɺ\M5& *EKF=]*9.1Gn5g*yrhZ6Ѫ6 ^)iy*j؍=DQKmJ#QR8^ƯnZD&WLS/ ld2}byG Am?Zwh­j19?Jص?f3ph(=\nɌcV7yyysPS0rK8RutCYlZf,#DvKs7~||0Oq'ܰjĀvcN ú6,8`E7(cV Z6E%?1.q;gηXmdFqkNO ק6x 3%o,Qy-؛%".|DV-4u7%F,`v"97(DUwH0J]:1Ukq@į#6% ZUl݌!|+v݇ 0SWv?H_#_}Oc=Ӷpi9gҏFצ)W9"6``*pKLM U)ݷѵAnBc:_gRMk'f=HNn"-8" ޚvYVav[Q/S;;3:}!ϋܵAͭfr}srG9EV L 7""oMUI+,9vL [6+2%ei$ljt!Y*m1r Fmat3w=m|I'TąǛ[CFaݟ9Rrw2]뤌PysB^kr=%g!!C_C`֨Oe98bH~sߣ{ 6։u=?-y*~q JX@|Pd_1yP~I JIGSkrA$={(>^`q>YI:B&q%"`,_ 7>0#æ1ǵ$$HP03eޯhP6c0qU85F+x]o!1H0Cx{ը+ϞS7.'j"sGdrTw <١*Ff>韺fljk8MFoM -0+\|8iKdmˎg0D?oL-8n_<貣 B_nvI"t/gSoVZA8ŇE?x#[y7/"7`/t0, ;L#jl=29\c7× s`t!c`}s"% m:z\nϧ={À8WJ7'qShKr~j5Mr/$4>F} U1*$d?K!G!"O{ޓרD,d6c΄$+R[:vLΤ~JY?i4?qku} 99)nIHbutsU+M0$ A\ ENS>s9ϳ LR\\,xʣS>˃w3?*NvU7{hIfHɨ{iGg,:^R(\꤯) nV7XO%_z&E]&]3_g628} ̩)pm2‰Gu֔sXtI`extE>z< J c/>S =qyRԵxd& YjXw>'lNE)yczYz[n'Ro]}ۛ3R/R!ht:HJ1^20-C{W&#8tњ:(${LIct'm) f 6Qqx;?VUsr:kXISP7 ߥa"$sg|nF~UBXW{7V ~EİȶdlbUM4,Vafd6qf8@#e8BOBka(|O2d%0Cˀ  Bު:=*b3U EXQ6k4xQ͋ YL36IJ2U 7+cl*Rl*/kVcim5ϘYN],а8SH./|*u'nǘͤ#ԭtMoDJ%Yͥnrm`ncVor^4\.&a}>f2mV7#_OWFTJyZ%TwdEkςjwˆ*I1mDk]]t't˅o2_>c~ yxI5*@oJp┙\AlQ^Qߊ̶K~@61h Wꋊf3߆t! ua, jMl 3 uq|s ~sؽb,\yr"B< 9םv#@,O{TqDz"* AЫRDEP^)2E"QD J̍sL3[oݻ[,$s6\Ʒ*¡(>Z19ד"ߩC ɖ"*q#ϨhS`6 SBMZK'wJ2#44z/e&tkWG9{9clڤ\זxRO8Ę(ʛΧ4t3 ̮)* KŦ5mBr//> { A:򁴙67yggN%C+5GڹX|5hL,ӜoI91e$@A*!C/17`jҔc^k-+811lȐ9y:=댤6 g%\G|l>ESnpN)Q Vi u0#Wz ;565^?lJ*܃Q4ZWHH̾("ғ<3ʻ=lte9?Vh֕kb_v2ȾQ"K}<<Ž%§OpAW=:vٷ* >^Žfze0!ϼ2 tKPxyŹ3Qpy/P|\əTa'V`K98~ɺ㜰Õed=͓E؄ 3&O΂=cALW䯨\Oٝt0pQ:;ALiDJtesN,Ӹ$*pZW}^[Þw~N%Q-A%K0̗>m^[r !ܿԣt9燙 DHS]S+oHdHNw |I({=uɵY@}nq3EjhFF=)  F$\ϋ#OT9>˷ĉNp  Ys+s*b!y}{#/*uA~LQ{r\QЮ'SbjkۿJuo1<5Pt<Ġ6WS &Oۜ>eֶ`Gjg9ikh;/Kfnow~Fo-Rx) ɵ# Bec :0}UoG }1hdT,]vMz͎]kag:_u-j^z,{NfllF\9@%qT<9t&>sվ8ca3h=.Q|2l|DUA4TѰ`9CDǯjXIdS\\_JH[T[wj;NMfl7qb޽99ZJ+ XrMIwQ\D=ԟ YyR8 r󩆕vuz⤸ X&'atlc3=r2ܑYτ),_({״S[pig9 R.(k=e]~7|1:[XZDY9_=:\l.rz(Ƿ5IbȵGo(LJLoht7n*$q7d'1''2>TE>0ЊrC0( r)ӋЪ_팃ƦI[~((~uɄoIYaFA2]RԚ-b3*#vAu}z0~ܧHE$ B >hpǂl1uKO?16uBfO&FUOesdʡ1bq ЅǕqSBWK>u|Wop?!G.m72~gw&u4Ь &Wam*˓ѴTT%L^tWʑL(W7Xd1<%k>x 麲[|{n +;>SxWEYO~k:ܸ7FkqFߕ[yWx$m0ڰY&#񳕒PDݷI!{sቝ3E:ҵUz-=rKu_ƎEizp_DTǨLڞJG `_t)1jrѺ-9g+K^y=j?2ooe뤑^xXf.GE)+V؍AYՕ,|:Lnω<]a3o#R} org.slf4j slf4j-parent 1.5.8 4.0.0 org.slf4j slf4j-api jar SLF4J API Module http://www.slf4j.org The slf4j API org.apache.maven.plugins maven-surefire-plugin once plain false **/AllTest.java **/PackageTest.java org.apache.maven.plugins maven-jar-plugin ${project.version} ${project.description} ${project.version} ${project.build.outputDirectory}/META-INF/MANIFEST.MF bundle-test-jar package jar test-jar org.apache.maven.plugins maven-antrun-plugin process-classes run Removing slf4j-api's dummy StaticLoggerBinder and StaticMarkerBinder org.codehaus.mojo clirr-maven-plugin 1.5.6 ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/0000755000000000000000000000000012674201751017743 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/scripts/0000755000000000000000000000000012674201751021432 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/scripts/install_gems.rb0000644000000000000000000000120512674201751024436 0ustar require 'rubygems/installer' require 'fileutils' Dir[ 'target/dependency/*gem' ].each do |file| installer = Gem::Installer.new( file, :ignore_dependencies => true, :install_dir => '../target/rubygems' ) installer.install end Dir[ 'target/dependency/*gem' ].each do |file| f = "../target/rubygems/gems/#{File.basename(file).sub(/.gem/, '')}/lib" unless File.exists?( f ) f = "../target/rubygems/gems/#{File.basename(file).sub(/.gem/, '')}-java/lib" end Dir[ File.expand_path( f ) + "/*" ].each do |ff| FileUtils.cp_r( "#{ff}", 'target/classes' ) end end ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/0000755000000000000000000000000012674201751020664 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/0000755000000000000000000000000012674201751021254 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/0000755000000000000000000000000012674201751022553 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/0000755000000000000000000000000012674201751023517 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/ruby/0000755000000000000000000000000012674201751024500 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/ruby/rails/0000755000000000000000000000000012674201751025612 5ustar ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/ruby/rails/DefaultRailsManager.java./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/ruby/rails/DefaultRails0000644000000000000000000004342012674201751030117 0ustar /** * */ package de.saumya.mojo.ruby.rails; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.FileWriter; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.HashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; import org.apache.maven.artifact.InvalidRepositoryException; import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy; import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout; import org.apache.maven.model.building.ModelBuildingRequest; import org.apache.maven.project.DefaultProjectBuildingRequest; import org.apache.maven.project.MavenProject; import org.apache.maven.project.ProjectBuilder; import org.apache.maven.project.ProjectBuildingException; import org.apache.maven.project.ProjectBuildingRequest; import org.apache.maven.repository.RepositorySystem; import org.apache.velocity.VelocityContext; import org.codehaus.plexus.component.annotations.Component; import org.codehaus.plexus.component.annotations.Requirement; import org.codehaus.plexus.logging.Logger; import org.codehaus.plexus.util.FileUtils; import org.codehaus.plexus.util.IOUtil; import org.codehaus.plexus.velocity.VelocityComponent; import de.saumya.mojo.ruby.gems.DefaultGemManager; import de.saumya.mojo.ruby.gems.GemException; import de.saumya.mojo.ruby.gems.GemsInstaller; import de.saumya.mojo.ruby.script.Script; import de.saumya.mojo.ruby.script.ScriptException; @Component(role = RailsManager.class) public class DefaultRailsManager implements RailsManager { private static Map DATABASES = new HashMap(); static { DATABASES.put("sqlite", "sqilte3"); DATABASES.put("postgres", "postgresql"); } @Requirement private RepositorySystem repositorySystem; @Requirement private ProjectBuilder builder; @Requirement private VelocityComponent velocityComponent; @Requirement private Logger logger; public void initInstaller(final GemsInstaller installer, final File launchDirectory) throws RailsException, IOException { patchBootScript(launchDirectory); setupWebXML(launchDirectory); setupGemfile(installer, launchDirectory); } @Deprecated private void patchBootScript(final File launchDirectory) throws RailsException { final File boot = new File(new File(launchDirectory, "config"), "boot.rb"); if (boot.exists() && new File(launchDirectory, "Gemfile.maven").exists()) { this.logger.info( "DEPRECATED: the use of Gemfile.maven deprecated. " + "use '$ mvn rails:pom' to generate a pom out of the Gemfile"); InputStream bootIn = null; InputStream bootOrig = null; InputStream bootPatched = null; OutputStream bootOut = null; try { bootIn = new FileInputStream(boot); bootOrig = Thread.currentThread() .getContextClassLoader() .getResourceAsStream("boot.rb.orig"); if (IOUtil.contentEquals(bootIn, bootOrig)) { bootIn.close(); bootOut = new FileOutputStream(boot); bootPatched = Thread.currentThread() .getContextClassLoader() .getResourceAsStream("boot.rb"); IOUtil.copy(bootPatched, bootOut); } } catch (final IOException e) { throw new RailsException("error patching config/boot.rb", e); } finally { IOUtil.close(bootIn); IOUtil.close(bootOrig); IOUtil.close(bootPatched); IOUtil.close(bootOut); } } } @Deprecated private void setupGemfile(final GemsInstaller installer, final File launchDirectory) { final File gemfile = new File(launchDirectory, "Gemfile.maven"); if (gemfile.exists()) { installer.factory.addEnv("BUNDLE_GEMFILE", gemfile); } } public void createNew(final GemsInstaller installer, final Object repositorySystemSession, final File appPath, String database, String railsVersion, ORM orm, final String... args) throws RailsException, GemException, IOException, ScriptException { createNew(installer, repositorySystemSession, appPath, database, railsVersion, orm, null, null, args); } public void createNew(final GemsInstaller installer, final Object repositorySystemSession, final File appPath, String database, String railsVersion, final ORM orm, final String template, final GwtOptions gwt, final String... args) throws RailsException, GemException, IOException, ScriptException { final File pomFile = new File(appPath, "pom.xml"); if (pomFile.exists()) { throw new RailsException(pomFile + " exists - skip installation of rails"); } // use a rubygems directory in way that the new application can also use it if(installer.config.getGemHome() == null || !installer.config.getGemHome().exists()){ installer.config.setGemBase(new File(new File(appPath, "target"), "rubygems")); } if (railsVersion == null) { this.logger.info("NOTE: use rails version 3.0.9 to creates a nice platform independent Gemfile." + " change the rails version anytime later"); } List remotes = new LinkedList(); ArtifactRepositoryPolicy enabled = new ArtifactRepositoryPolicy(true, "never", "strict"); ArtifactRepositoryPolicy disabled = new ArtifactRepositoryPolicy(false, "never", "strict"); ArtifactRepository repo = this.repositorySystem.createArtifactRepository("rubygems-releases", DefaultGemManager.DEFAULT_GEMS_REPOSITORY_BASE_URL + "releases", new DefaultRepositoryLayout(), enabled, disabled); remotes.add(repo); //installer. railsVersion = installer.installGem("rails", railsVersion, repositorySystemSession, localRepository(), remotes).getVersion(); // correct spelling if (DATABASES.containsKey(database)) { database = DATABASES.get(database); } // run the "rails new"-script final Script script = installer.factory.newScript(installer.config.binScriptFile("rails")) .addArg("_" + railsVersion + "_") .addArg("new"); if (appPath != null) { script.addArg(appPath.getAbsolutePath()); } for (final String arg : args) { script.addArg(arg); } if (database != null) { script.addArg("-d", database); } if (isOffline( repositorySystemSession )) { this.logger.info("system is offline: using jruby rails templates from jar file - might be outdated"); } if (template != null || (gwt != null && gwt.packageName != null)){ String tmp = templateFrom(orm, isOffline( repositorySystemSession ), railsVersion); if(tmp != null ){ System.setProperty("maven.rails.basetemplate", tmp); } if (template != null){ System.setProperty("maven.rails.extratemplate", template); } if (gwt != null && gwt.packageName != null){ System.setProperty("maven.rails.gwt", gwt.packageName); } script.addArg("-m", templateFromResource("templates")); } else { script.addArg("-m", templateFrom(orm, isOffline( repositorySystemSession ), railsVersion)); } // skip bundler script.addArg("--skip-bundle"); script.execute(); if (appPath != null) { installer.factory.newScriptFromResource("maven/tools/pom_generator.rb") .addArg("rails") .addArg("Gemfile") .executeIn(appPath, new File(appPath, "pom.xml")); // write out a new index.html final VelocityContext context = new VelocityContext(); context.put("railsVersion", railsVersion); filterContent(appPath, context, "src/main/webapp/index.html"); filterContent(appPath, context, "src/main/webapp/index.html", "public/index.html", true); setupWebXML(appPath); if (gwt!= null && gwt.packageName != null){ installer.installGem("activerecord-jdbc" + database + "-adapter", null,// use the latest version repositorySystemSession, localRepository(), remotes); installer.installGem("resty-generators", null,// use the latest versiona repositorySystemSession, localRepository(), remotes); generate(installer, repositorySystemSession, appPath, "resty:setup", gwt.packageName, railsBooleanOption(gwt.session, "session"), railsBooleanOption(gwt.menu, "menu")); } } } private boolean isOffline( Object repositorySystemSession ){ try { Method m = repositorySystemSession.getClass().getMethod( "isOffline", Boolean.class ); return (Boolean) m.invoke( repositorySystemSession ); } catch (IllegalAccessException e) { throw new RuntimeException( "error in calling isOffline", e ); } catch (IllegalArgumentException e) { throw new RuntimeException( "error in calling isOffline", e ); } catch (InvocationTargetException e) { throw new RuntimeException( "error in calling isOffline", e ); } catch (NoSuchMethodException e) { throw new RuntimeException( "error in calling isOffline", e ); } catch (SecurityException e) { throw new RuntimeException( "error in calling isOffline", e ); } } private String railsBooleanOption(final boolean option, final String name) { return "--" + (option ? "" : "skip-") + name; } private String templateFrom(final ORM orm, final boolean offline, String railsVersion) { switch(orm){ case activerecord: if (railsVersion.matches("3.0.[0-9]")){ if (offline) { return templateFromResource(orm.name()); } return "http://jruby.org/rails3.rb"; } return null; case datamapper: if (railsVersion.startsWith("3.0.") || offline) { return templateFromResource(orm.name()); } return "http://datamapper.org/templates/rails.rb"; default: throw new RuntimeException( "unknown ORM :" + orm); } } private String templateFromResource(final String name) { return getClass().getResource("/rails-templates/" + name + ".rb").toString() .replaceFirst("^jar:", ""); } private void setupWebXML(final File launchDirectory) throws RailsException, IOException { // patch the system only when you find a config/application.rb file if (!new File(new File(launchDirectory, "config"), "application.rb").exists()) { // TODO log this !! return; } final VelocityContext context = new VelocityContext(); context.put("basedir", launchDirectory.getAbsolutePath()); // create web.xml unless it exists neither in maven location nor in rails location if ( !new File(launchDirectory, "src/main/webapp/WEB-INF/web.xml").exists() ) { filterContent(launchDirectory, context, "config/web.xml"); } // create override-xyz-web.xml filterContent(launchDirectory, context, "target/jetty/override-development-web.xml"); filterContent(launchDirectory, context, "target/jetty/override-production-web.xml"); // create the keystore for SSL copyFile(launchDirectory, "src/test/resources/server.keystore"); // add a monkey patch for throwables copyFile(launchDirectory, "config/initializers/java_throwable_monkey_patch.rb"); } private void copyFile(final File launchDirectory, final String name) throws IOException { final File file = new File(launchDirectory, name); if (!file.exists()) { FileUtils.copyURLToFile(getClass().getResource("/rails-resources/" + name), file); } } private void filterContent(final File app, final VelocityContext context, final String template) throws RailsException { filterContent(app, context, template, template, false); } private void filterContent(final File app, final VelocityContext context, final String template, final String targetName, final boolean force) throws RailsException { final File templateFile = new File(app, targetName); if (!force && templateFile.exists()) { return; } final InputStream input = Thread.currentThread().getContextClassLoader().getResourceAsStream("rails-resources/" + template); try { if (input == null) { throw new FileNotFoundException(template); } final String templateString = IOUtil.toString(input); templateFile.getParentFile().mkdirs(); final FileWriter fw = new FileWriter(templateFile); this.velocityComponent.getEngine().evaluate(context, fw, "velocity", templateString); fw.flush(); fw.close(); } catch (final IOException e) { throw new RailsException("failed to filter " + template, e); } } public void rake(final GemsInstaller installer, final Object repositorySystemSession, final File launchDirectory, final String environment, final String task, final String... args) throws IOException, ScriptException, GemException, RailsException { final Script script = installer.factory.newScriptFromSearchPath("rake"); script.addArgs(task); for (final String arg : args) { script.addArg(arg); } if(environment != null && environment.trim().length() > 0){ script.addArg("RAILS_ENV=" + environment); } script.executeIn(launchDirectory); } public void generate(final GemsInstaller installer, final Object repositorySystemSession, final File launchDirectory, final String generator, final String... args) throws IOException, ScriptException, GemException, RailsException { final Script script = installer.factory.newScript(new File(new File(launchDirectory, "script"), "rails")) .addArg("generate") .addArg(generator); for (final String arg : args) { script.addArg(arg); } script.executeIn(launchDirectory); } public void installGems(final GemsInstaller gemsInstaller, final Object repositorySystemSession) throws IOException, ScriptException, GemException, RailsException { final ArtifactRepository localRepository = localRepository(); final ProjectBuildingRequest pomRequest = new DefaultProjectBuildingRequest().setLocalRepository(localRepository) .setValidationLevel(ModelBuildingRequest.VALIDATION_LEVEL_STRICT) .setResolveDependencies(true); gemsInstaller.manager.setRepositorySession(pomRequest, repositorySystemSession); MavenProject pom; try { pom = this.builder.build(new File("pom.xml"), pomRequest) .getProject(); } catch (final ProjectBuildingException e) { throw new RailsException("error building the POM", e); } gemsInstaller.installPom(pom); } private ArtifactRepository localRepository() throws RailsException { ArtifactRepository localRepository; try { localRepository = this.repositorySystem.createDefaultLocalRepository(); } catch (final InvalidRepositoryException e) { throw new RailsException("error creating local repository", e); } return localRepository; } } ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/ruby/rails/RailsException.java./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/ruby/rails/RailsExcepti0000644000000000000000000000064512674201751030136 0ustar package de.saumya.mojo.ruby.rails; public class RailsException extends Exception { private static final long serialVersionUID = 5463785987091179445L; public RailsException(final Exception e) { super( e ); } public RailsException(final String msg, final Exception e) { super( msg, e ); } public RailsException(final String msg) { super( msg ); } } ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/ruby/rails/RailsManager.java./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/ruby/rails/RailsManager0000644000000000000000000000364112674201751030106 0ustar package de.saumya.mojo.ruby.rails; import java.io.File; import java.io.IOException; import de.saumya.mojo.ruby.gems.GemException; import de.saumya.mojo.ruby.gems.GemsInstaller; import de.saumya.mojo.ruby.script.ScriptException; public interface RailsManager { public enum ORM { activerecord, datamapper } public abstract void initInstaller(final GemsInstaller installer, final File launchDirectory) throws RailsException, IOException; public abstract void createNew(final GemsInstaller installer, final Object repositorySystemSession, final File appPath, String database, final String railsVersion, ORM orm, final String... args) throws RailsException, GemException, IOException, ScriptException; public abstract void createNew(final GemsInstaller installer, final Object repositorySystemSession, final File appPath, String database, String railsVersion, final ORM orm, final String template, final GwtOptions gwt, final String... args) throws RailsException, GemException, IOException, ScriptException; public abstract void rake(final GemsInstaller installer, final Object repositorySystemSession, final File launchDirectory, final String environment, final String task, final String... args) throws IOException, ScriptException, GemException, RailsException; public abstract void generate(final GemsInstaller installer, final Object repositorySystemSession, final File launchDirectory, final String generator, final String... args) throws IOException, ScriptException, GemException, RailsException; public abstract void installGems(final GemsInstaller gemsInstaller, final Object repositorySystemSession) throws IOException, ScriptException, GemException, RailsException; }././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/ruby/rails/RailsState.java./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/ruby/rails/RailsState.j0000644000000000000000000000265412674201751030047 0ustar /** * */ package de.saumya.mojo.ruby.rails; import java.io.File; import de.saumya.mojo.ruby.gems.GemsConfig; public class RailsState { private final GemsConfig gemsConfig; private File launchDirectory; private boolean patched = false; private String model; public RailsState(final GemsConfig gemsConfig) { this.gemsConfig = gemsConfig; this.gemsConfig.setEnvironment("development"); } void setLaunchDirectory(final File launchDirectory) { this.launchDirectory = launchDirectory; } public File getLaunchDirectory() { if (this.launchDirectory == null) { return new File(System.getProperty("user.dir")); } else { return this.launchDirectory; } } public boolean isPatched() { return this.patched; } public void setPatched(final boolean patched) { this.patched = patched; } @Override public RailsState clone() { final RailsState clone = new RailsState(this.gemsConfig.clone()); clone.setLaunchDirectory(this.launchDirectory); clone.setModel(this.getModel()); return clone; } public void setModel(final String model) { this.model = model; } public String getModel() { return this.model; } public GemsConfig getRubygemsConfig() { return this.gemsConfig; } }././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/ruby/rails/GwtOptions.java./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/ruby/rails/GwtOptions.j0000644000000000000000000000054212674201751030103 0ustar /** * */ package de.saumya.mojo.ruby.rails; public class GwtOptions { final String packageName; final boolean session; final boolean menu; public GwtOptions(String packageName, boolean session, boolean menu){ this.packageName = packageName; this.session = session; this.menu = menu; } }././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/ruby/rails/RailsService.java./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/ruby/rails/RailsService0000644000000000000000000000532412674201751030134 0ustar /** * */ package de.saumya.mojo.ruby.rails; import java.io.File; import java.io.IOException; import de.saumya.mojo.ruby.gems.GemException; import de.saumya.mojo.ruby.gems.GemManager; import de.saumya.mojo.ruby.gems.GemsInstaller; import de.saumya.mojo.ruby.script.ScriptException; import de.saumya.mojo.ruby.script.ScriptFactory; public class RailsService { private final GemsInstaller installer; private final RailsManager manager; private final RailsState state; private final Object session; public RailsService(final RailsState state, final Object repositorySystemSession, final ScriptFactory factory, final GemManager gemManager, final RailsManager manager) throws RailsException, IOException { assert state != null; assert this.session != null; assert factory != null; assert manager != null; this.state = state; this.session = repositorySystemSession; this.installer = new GemsInstaller(state.getRubygemsConfig(), factory, gemManager); this.manager = manager; manager.initInstaller(this.installer, state.getLaunchDirectory()); } public void resetState() throws RailsException, IOException { this.manager.initInstaller(this.installer, this.state.getLaunchDirectory()); } public void createNew(final String appPath, final String railsVersion, final String... args) throws RailsException, GemException, IOException, ScriptException { // TODO check there is no pom here to avoid conflicts this.manager.createNew(this.installer, this.session, new File(appPath), null, railsVersion, null, args); } public void rake(final String tasks) throws IOException, ScriptException, GemException, RailsException { this.manager.rake(this.installer, this.session, this.state.getLaunchDirectory(), this.state.getRubygemsConfig().getEnvironment(), tasks, new String[0]); } public void generate(final String generator, final String... args) throws IOException, ScriptException, GemException, RailsException { this.manager.generate(this.installer, this.session, this.state.getLaunchDirectory(), generator, args); } }./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/ruby/ScriptUtils.java0000644000000000000000000000261112674201751027630 0ustar /** * */ package de.saumya.mojo.ruby; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.net.URL; public class ScriptUtils { // do no initialize this private ScriptUtils() { } public static InputStream getScriptAsStream(final String name) throws IOException { final InputStream stream = Thread.currentThread() .getContextClassLoader() .getResourceAsStream(name); if (stream == null) { throw new FileNotFoundException("loading resource from classloader failed: " + name); } return stream; } public static InputStream getScriptAsStream(final String name, final Class clazz) throws IOException { final InputStream stream = clazz.getResourceAsStream(name); if (stream == null) { return getScriptAsStream(name); } else { return stream; } } public static URL getScriptFromResource(final String name) throws IOException { final URL url = Thread.currentThread() .getContextClassLoader() .getResource(name); if (url == null) { throw new FileNotFoundException("loading resource from classloader failed: " + name); } return url; } }./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/ruby/NoopLogger.java0000644000000000000000000000063012674201751027415 0ustar /** * */ package de.saumya.mojo.ruby; public class NoopLogger implements Logger { public NoopLogger() { } public NoopLogger(final boolean verbose) { } public void debug(final CharSequence content) { } public void info(final CharSequence content) { } public void warn(final CharSequence content) { } public void error(final CharSequence content) { } }./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/ruby/SystemLogger.java0000644000000000000000000000126012674201751027766 0ustar /** * */ package de.saumya.mojo.ruby; public class SystemLogger implements Logger { private final boolean verbose; public SystemLogger() { this(true); } public SystemLogger(final boolean verbose) { this.verbose = verbose; } public void debug(final CharSequence content) { if (this.verbose) { System.out.append(content); } } public void info(final CharSequence content) { System.out.append(content); } public void warn(final CharSequence content) { System.err.append(content); } public void error(final CharSequence content) { System.err.append(content); } }./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/ruby/script/0000755000000000000000000000000012674201751026004 5ustar ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/ruby/script/EmbeddedLauncher.java./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/ruby/script/EmbeddedLau0000644000000000000000000002001712674201751030062 0ustar /** * */ package de.saumya.mojo.ruby.script; import java.io.File; import java.io.IOException; import java.io.PrintStream; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.net.MalformedURLException; import java.util.List; import java.util.Map; import org.codehaus.classworlds.ClassRealm; import org.codehaus.classworlds.DuplicateRealmException; import org.codehaus.classworlds.NoSuchRealmException; import de.saumya.mojo.ruby.Logger; class EmbeddedLauncher extends AbstractLauncher { private static final Class[] No_ARG_TYPES = new Class[0]; private static final Object[] NO_ARGS = new Object[0]; private final ClassRealm classRealm; private final ScriptFactory factory; private final Logger logger; public EmbeddedLauncher(final Logger logger, final ScriptFactory factory) throws ScriptException { this.logger = logger; this.factory = factory; if (factory.classRealm != null) { this.classRealm = cloneClassRealm(factory.jrubyJar, factory.classpathElements, factory.classRealm); } else { this.classRealm = null; } } private ClassRealm cloneClassRealm(final File jrubyJar, final List classpathElements, final ClassRealm classRealm) throws ScriptException { // TODO how to reuse the plugin realm ? // for (final String classpath : classpathElements) { // if (classpath.equals(jrubyJar.getAbsolutePath())) { // return null; // } // } ClassRealm newClassRealm; try { ClassRealm jruby; try { jruby = classRealm.getWorld().getRealm("jruby"); } catch (final NoSuchRealmException e) { jruby = classRealm.getWorld().newRealm("jruby"); if(jrubyJar != null){ jruby.addConstituent(jrubyJar.toURI().toURL()); } } try { jruby.getWorld().disposeRealm("pom"); } catch (final NoSuchRealmException e) { // ignored } newClassRealm = jruby.createChildRealm("pom"); for (final String classpath : classpathElements) { if (!classpath.contains("jruby-complete") || factory.jrubyJar == null) { newClassRealm.addConstituent(new File(classpath).toURI() .toURL()); } } } catch (final DuplicateRealmException e) { throw new ScriptException("error in naming realms", e); } catch (final MalformedURLException e) { throw new ScriptException("hmm. found some malformed URL", e); } return newClassRealm; } @Override protected void doExecute(final File launchDirectory, final List args, final File outputFile) throws ScriptException, IOException { doExecute(launchDirectory, outputFile, args, true); } private void doExecute(final File launchDirectory, final File outputFile, final List args, final boolean warn) throws ScriptException, IOException { final String currentDir; if (launchDirectory != null) { currentDir = System.getProperty("user.dir"); logger.debug("launch directory: " + launchDirectory.getAbsolutePath()); System.setProperty("user.dir", launchDirectory.getAbsolutePath()); } else { currentDir = null; } args.addAll(0, this.factory.switches.list); if (warn) { if (this.factory.jvmArgs.list.size() > 0) { this.logger.warn("have to ignore jvm arguments and properties in the current setup"); } if (this.factory.environment().size() > 0) { this.logger.warn("have to ignore environment settings in the current setup"); } } final PrintStream output = System.out; ClassLoader current = null; try { if (outputFile != null) { final PrintStream writer = new PrintStream(outputFile); System.setOut(writer); this.logger.debug("output file: " + outputFile); } this.logger.debug("args: " + args); if (this.classRealm != null) { current = Thread.currentThread().getContextClassLoader(); Thread.currentThread() .setContextClassLoader(this.classRealm.getClassLoader()); } // use reflection to avoid having jruby as plugin dependency final Class clazz = Thread.currentThread() .getContextClassLoader() .loadClass("org.jruby.Main"); final Object main = clazz.newInstance(); final Method m = clazz.getMethod("run", String[].class); final long start = System.currentTimeMillis(); final Object result = m.invoke(main, (Object) args.toArray(new String[args.size()])); final long end = System.currentTimeMillis(); this.logger.debug("time " + (end - start)); final int status; if (result instanceof Integer) { // jruby before version 1.5 status = ((Integer) result); } else { // jruby from version 1.5 onwards // TODO better error handling like error messages and . . . // TODO see org.jruby.Main final Method statusMethod = result.getClass() .getMethod("getStatus", No_ARG_TYPES); status = (Integer) statusMethod.invoke(result, NO_ARGS); } if (status != 0) { throw new ScriptException("some error in script " + args + ": " + status); } } catch (final InstantiationException e) { throw new ScriptException(e); } catch (final IllegalAccessException e) { throw new ScriptException(e); } catch (final ClassNotFoundException e) { throw new ScriptException(e); } catch (final NoSuchMethodException e) { throw new ScriptException(e); } catch (final InvocationTargetException e) { throw new ScriptException(e); } finally { if (current != null) { Thread.currentThread().setContextClassLoader(current); } System.setOut(output); if (currentDir != null) { System.setProperty("user.dir", currentDir); } if (this.classRealm != null) { try { this.classRealm.getWorld().disposeRealm("pom"); // jrubyClassRealm.setParent(null); } catch (final NoSuchRealmException e) { // ignore } } } } public void executeScript(final File launchDirectory, final String script, final List args, final File outputFile) throws ScriptException, IOException { final StringBuilder buf = new StringBuilder(); for (final Map.Entry entry : this.factory.environment().entrySet()) { if (entry.getValue() != null) { buf.append("ENV['") .append(entry.getKey()) .append("']='") .append(entry.getValue()) .append("';"); } } buf.append(script); args.add(0, "-e"); args.add(1, buf.toString()); args.add(2, "--"); doExecute(launchDirectory, outputFile, args, false); } } ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/ruby/script/ScriptException.java./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/ruby/script/ScriptExcep0000644000000000000000000000062212674201751030160 0ustar package de.saumya.mojo.ruby.script; public class ScriptException extends Exception { private static final long serialVersionUID = 740727357226540997L; public ScriptException(final Exception e) { super(e); } public ScriptException(final String msg, final Exception e) { super(msg, e); } public ScriptException(final String msg) { super(msg); } } ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/ruby/script/Script.java0000644000000000000000000000773012674201751030122 0ustar /** * */ package de.saumya.mojo.ruby.script; import java.io.File; import java.io.IOException; import java.net.URL; public class Script extends Arguments { private final ScriptFactory scriptFactory; private final String script; Script(final ScriptFactory scriptFactory) { this.scriptFactory = scriptFactory; this.script = null; } Script(final ScriptFactory scriptFactory, final String script) { this.scriptFactory = scriptFactory; this.script = script; } Script(final ScriptFactory scriptFactory, final URL url) { this(scriptFactory, url.toString(), false); } Script(final ScriptFactory scriptFactory, final File file) { this(scriptFactory, file.getAbsolutePath(), false); } Script(final ScriptFactory scriptFactory, final String file, final boolean search) { this.scriptFactory = scriptFactory; if (search) { add("-S"); add(file); this.script = null; } else { this.script = "load('" + file + "')"; } } public boolean isValid() { return this.list.size() > 0 || this.script != null; } public Script addArg(final File name) { super.add(name.getAbsolutePath()); return this; } public Script addArg(final String name) { super.add(name); return this; } public Script addArg(final String name, final String value) { if (value != null) { super.add(name, value); } return this; } public Script addArg(final String name, final File value) { if (value != null) { super.add(name, value.getAbsolutePath()); } return this; } public Script addArgs(final String line) { super.parseAndAdd(line); return this; } public void execute() throws ScriptException, IOException { if (this.script != null) { this.scriptFactory.launcher.executeScript(this.script, this.list); } else { this.scriptFactory.launcher.execute(this.list); } } public void execute(final File output) throws ScriptException, IOException { if (this.script != null) { this.scriptFactory.launcher.executeScript(this.script, this.list, output); } else { this.scriptFactory.launcher.execute(this.list, output); } } public void executeIn(final File launchDirectory) throws ScriptException, IOException { if (this.script != null) { this.scriptFactory.launcher.executeScript(launchDirectory, this.script, this.list); } else { this.scriptFactory.launcher.executeIn(launchDirectory, this.list); } } public void executeIn(final File launchDirectory, final File output) throws ScriptException, IOException { if (this.script != null) { this.scriptFactory.launcher.executeScript(launchDirectory, this.script, this.list, output); } else { this.scriptFactory.launcher.executeIn(launchDirectory, this.list, output); } } @Override public String toString() { final StringBuilder buf = new StringBuilder(); if (this.script != null) { buf.append(this.script).append(" "); } for (final String arg : this.list) { buf.append(arg).append(" "); } return buf.toString().trim(); } }././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/ruby/script/AbstractLauncher.java./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/ruby/script/AbstractLau0000644000000000000000000000317612674201751030143 0ustar package de.saumya.mojo.ruby.script; import java.io.File; import java.io.IOException; import java.util.List; abstract class AbstractLauncher implements Launcher { protected abstract void doExecute(final File launchDirectory, final List args, final File outputFile) throws ScriptException, IOException; public void execute(final List args) throws ScriptException, IOException { doExecute(null, args, null); } public void execute(final List args, final File outputFile) throws ScriptException, IOException { doExecute(null, args, outputFile); } public void executeIn(final File launchDirectory, final List args) throws ScriptException, IOException { doExecute(launchDirectory, args, null); } public void executeIn(final File launchDirectory, final List args, final File outputFile) throws ScriptException, IOException { doExecute(launchDirectory, args, outputFile); } public void executeScript(final String script, final List args) throws ScriptException, IOException { executeScript(script, args, null); } public void executeScript(final String script, final List args, final File outputFile) throws ScriptException, IOException { executeScript(null, script, args, outputFile); } public void executeScript(final File launchDirectory, final String script, final List args) throws ScriptException, IOException { executeScript(launchDirectory, script, args, null); } } ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/ruby/script/AntLauncher.java./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/ruby/script/AntLauncher0000644000000000000000000001405212674201751030135 0ustar /** * */ package de.saumya.mojo.ruby.script; import java.io.File; import java.io.IOException; import java.util.List; import java.util.Map; import org.apache.tools.ant.Project; import org.apache.tools.ant.taskdefs.Java; import org.apache.tools.ant.types.Path; import org.apache.tools.ant.types.Environment.Variable; import de.saumya.mojo.ruby.Logger; class AntLauncher extends AbstractLauncher { private static final String MAVEN_CLASSPATH = "maven.classpath"; private static final String DEFAULT_XMX = "-Xmx384m"; private final Logger logger; private final ScriptFactory factory; private final Project project; AntLauncher(final Logger logger, final ScriptFactory factory) { this.logger = logger; this.factory = factory; this.project = createAntProject(); } @Override protected void doExecute(final File launchDirectory, final List args, final File outputFile) { final Java java = new Java(); java.setProject(this.project); java.setClassname("org.jruby.Main"); java.setFailonerror(true); java.setFork(true); java.setDir(launchDirectory); for (final Map.Entry entry : this.factory.environment().entrySet()) { Variable v = new Variable(); v.setKey(entry.getKey()); v.setValue(entry.getValue()); java.addEnv(v); } // TODO add isDebugable to the logger and log only when debug is needed this.logger.debug("java classpath : " + this.project.getReference(MAVEN_CLASSPATH)); if (this.factory.environment().size() > 0) { this.logger.debug("environment :"); for (final Map.Entry entry : this.factory.environment().entrySet()) { this.logger.debug("\t\t" + entry.getKey() + " => " + entry.getValue()); } } for (final String arg : factory.switches.list) { java.createArg().setValue(arg); } for (final String arg : args) { java.createArg().setValue(arg); } Path temp = (Path) this.project.getReference(MAVEN_CLASSPATH); if (this.factory.jrubyJar != null) { temp.add(new Path(project, this.factory.jrubyJar.getAbsolutePath())); } java.createJvmarg().setValue("-cp"); java.createJvmarg().setPath(temp); // Does not work on all JVMs // if (!factory.jvmArgs.matches("(-client|-server)")) { // java.createJvmarg().setValue("-client"); // } for (String arg : factory.jvmArgs.list) { java.createJvmarg().setValue(arg); } // hack to avoid jruby-core in bootclassloader where as the dependent jars are in system classloader if (this.factory.jrubyJar != null && this.factory.jrubyJar.equals(this.factory.jrubyStdlibJar)){ java.createJvmarg().setValue("-Xbootclasspath/a:" + this.factory.jrubyJar.getAbsolutePath()); } if ( this.factory.jrubyJar == null && System.getProperty( "jruby.home" ) != null ){ Variable v = new Variable(); v.setKey( "jruby.home" ); v.setValue( System.getProperty( "jruby.home" ) ); java.addSysproperty( v ); File lib = System.getProperty("jruby.lib") != null ? new File( System.getProperty("jruby.lib") ) : new File( System.getProperty("jruby.home"), "lib" ); File jrubyJar = new File( lib, "jruby.jar" ); java.createJvmarg().setValue("-Xbootclasspath/a:" + jrubyJar.getAbsolutePath()); } if (outputFile != null) { java.setOutput(outputFile); } java.execute(); } private Project createAntProject() { final Project project = new Project(); // setup maven.plugin.classpath final Path classPath = new Path(project); for (final String path : this.factory.classpathElements) { if (!path.contains("jruby-complete") || factory.jrubyJar == null) { classPath.add(new Path(project, path)); } } project.addReference(MAVEN_CLASSPATH, classPath); project.addBuildListener(new AntLogAdapter(this.logger)); return project; } @Override public void execute(final List args) throws ScriptException, IOException { doExecute(null, args, null); } @Override public void execute(final List args, final File outputFile) throws ScriptException, IOException { doExecute(null, args, outputFile); } @Override public void executeIn(final File launchDirectory, final List args) throws ScriptException, IOException { doExecute(launchDirectory, args, null); } @Override public void executeIn(final File launchDirectory, final List args, final File outputFile) throws ScriptException, IOException { doExecute(launchDirectory, args, outputFile); } @Override public void executeScript(final String script, final List args) throws ScriptException, IOException { executeScript(script, args, null); } @Override public void executeScript(final String script, final List args, final File outputFile) throws ScriptException, IOException { executeScript(null, script, args, outputFile); } @Override public void executeScript(final File launchDirectory, final String script, final List args) throws ScriptException, IOException { executeScript(launchDirectory, script, args, null); } public void executeScript(final File launchDirectory, final String script, final List args, final File outputFile) throws ScriptException, IOException { args.add(0, "-e"); args.add(1, script); args.add(2, "--"); doExecute(launchDirectory, args, outputFile); } } ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/ruby/script/Arguments.java./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/ruby/script/Arguments.j0000644000000000000000000000160412674201751030125 0ustar /** * */ package de.saumya.mojo.ruby.script; import java.util.LinkedList; import java.util.List; class Arguments { final List list = new LinkedList(); Arguments add(final String name) { if (name != null) { this.list.add(name); } return this; } Arguments add(final String name, final String value) { this.list.add(name); this.list.add(value); return this; } Arguments parseAndAdd(final String line) { if (line != null) { for (final String arg : line.trim().split("\\s+")) { this.list.add(arg); } } return this; } boolean matches(final String regex) { boolean matches = false; for (String arg : list) { if (arg.matches(regex)) { matches = true; break; } } return matches; } }././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/ruby/script/GemScriptFactory.java./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/ruby/script/GemScriptFa0000644000000000000000000000506212674201751030076 0ustar /** * */ package de.saumya.mojo.ruby.script; import java.io.File; import java.io.IOException; import java.util.HashMap; import java.util.List; import java.util.Map; import org.codehaus.classworlds.ClassRealm; import de.saumya.mojo.ruby.Logger; import de.saumya.mojo.ruby.gems.GemsConfig; public class GemScriptFactory extends ScriptFactory { public static final String GEM_HOME = "GEM_HOME"; public static final String GEM_PATH = "GEM_PATH"; private final GemsConfig gemsConfig; public GemScriptFactory(final Logger logger, final ClassRealm classRealm, final File jrubyJar, final List classpathElements, final boolean fork, final GemsConfig config) throws ScriptException, IOException { this(logger, classRealm, jrubyJar, jrubyJar, classpathElements, fork, config); } public GemScriptFactory(final Logger logger, final ClassRealm classRealm, final File jrubyJar, File stdlibJar, final List classpathElements, final boolean fork, final GemsConfig config) throws ScriptException, IOException { super(logger, classRealm, jrubyJar, stdlibJar, classpathElements, fork); this.gemsConfig = config; } @Override public Map environment() { Map result = new HashMap(super.environment()); if (this.gemsConfig.getGemHome() != null) { result.put(GEM_HOME, this.gemsConfig.getGemHome() .getAbsolutePath() .replaceFirst("/[$][{]project.basedir[}]/", "/")); } if (this.gemsConfig.getGemPath().length > 0) { StringBuilder paths = new StringBuilder(); for (File path : this.gemsConfig.getGemPath()) { if (paths.length() > 0) { paths.append(System.getProperty("path.separator")); } paths.append(path.getAbsolutePath() .replaceFirst("/[$][{]project.basedir[}]/", "/")); } result.put(GEM_PATH, paths.toString()); } return result; } @Override public Script newScriptFromSearchPath(final String scriptName) throws IOException { final File script = new File(gemsConfig.getBinDirectory(), scriptName); if (script.exists()) { Script s = new Script(this); s.add(script.getAbsolutePath()); return s; } else { return super.newScriptFromSearchPath(scriptName); } } }././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/ruby/script/AntLogAdapter.java./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/ruby/script/AntLogAdapt0000644000000000000000000000323212674201751030065 0ustar /** * */ package de.saumya.mojo.ruby.script; import org.apache.tools.ant.BuildEvent; import org.apache.tools.ant.BuildListener; import org.apache.tools.ant.Project; import de.saumya.mojo.ruby.Logger; class AntLogAdapter implements BuildListener { private final Logger logger; public AntLogAdapter(final Logger logger) { this.logger = logger; } public void buildStarted(final BuildEvent event) { log(event); } public void buildFinished(final BuildEvent event) { log(event); } public void targetStarted(final BuildEvent event) { log(event); } public void targetFinished(final BuildEvent event) { log(event); } public void taskStarted(final BuildEvent event) { log(event); } public void taskFinished(final BuildEvent event) { log(event); } public void messageLogged(final BuildEvent event) { log(event); } private void log(final BuildEvent event) { final int priority = event.getPriority(); switch (priority) { case Project.MSG_ERR: this.logger.error(event.getMessage()); break; case Project.MSG_WARN: this.logger.warn(event.getMessage()); break; case Project.MSG_INFO: this.logger.info(event.getMessage()); break; case Project.MSG_VERBOSE: this.logger.debug(event.getMessage()); break; case Project.MSG_DEBUG: this.logger.debug(event.getMessage()); break; default: this.logger.info(event.getMessage()); break; } } } ././@LongLink0000644000000000000000000000015400000000000011603 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/ruby/script/ScriptFactory.java./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/ruby/script/ScriptFacto0000644000000000000000000001572512674201751030162 0ustar /** * */ package de.saumya.mojo.ruby.script; import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import org.codehaus.classworlds.ClassRealm; import org.codehaus.classworlds.DuplicateRealmException; import org.codehaus.classworlds.NoSuchRealmException; import de.saumya.mojo.ruby.Logger; import de.saumya.mojo.ruby.ScriptUtils; public class ScriptFactory { public static List NO_CLASSPATH = Collections.emptyList(); final Arguments switches = new Arguments(); final Arguments jvmArgs = new Arguments(); private final Map env = new HashMap(); final File jrubyStdlibJar; final Logger logger; final ClassRealm classRealm; final File jrubyJar; final List classpathElements; final boolean fork; final Launcher launcher; public ScriptFactory(final Logger logger, final ClassRealm classRealm, final File jrubyJar, final List classpathElements, final boolean fork) throws ScriptException, IOException { this(logger, classRealm, jrubyJar, jrubyJar, classpathElements, fork); } public ScriptFactory(final Logger logger, final ClassRealm classRealm, final File jrubyJar, File stdlibJar, final List classpathElements, final boolean fork) throws ScriptException, IOException { this.logger = logger; this.jrubyStdlibJar = stdlibJar; this.jrubyJar = jrubyJar; if(this.jrubyJar != null){ this.logger.debug("script uses jruby jar:" + this.jrubyJar.getAbsolutePath()); } this.classpathElements = classpathElements == null ? NO_CLASSPATH : Collections.unmodifiableList(classpathElements); this.fork = fork; if (classRealm != null && jrubyJar != null) { this.classRealm = getOrCreateClassRealm(classRealm, jrubyJar); } else { this.classRealm = classRealm; } if (fork) { this.launcher = new AntLauncher(logger, this); } else { this.launcher = new EmbeddedLauncher(logger, this); } } private static synchronized ClassRealm getOrCreateClassRealm(final ClassRealm classRealm, final File jrubyJar) throws MalformedURLException, ScriptException { ClassRealm jruby; try { jruby = classRealm.getWorld().getRealm("jruby"); } catch (final NoSuchRealmException e) { try { jruby = classRealm.getWorld().newRealm("jruby"); if(jrubyJar != null){ jruby.addConstituent(jrubyJar.toURI().toURL()); } } catch (final DuplicateRealmException ee) { throw new ScriptException("could not setup classrealm for jruby", ee); } } return jruby; } public Script newScriptFromSearchPath(final String scriptName) throws IOException { return new Script(this, scriptName, true); } public Script newScriptFromJRubyJar(final String scriptName) throws IOException { try { // the first part only works on jruby-complete.jar URL url = new URL("jar:file:" + this.jrubyStdlibJar.getAbsolutePath() + "!/META-INF/jruby.home/bin/" + scriptName); url.openConnection().getContent(); return new Script(this, url); } catch (Exception e) { try { // fallback on classloader return newScriptFromResource("META-INF/jruby.home/bin/" + scriptName); } catch (FileNotFoundException ee) { // find jruby-home String base = "."; if ( this.env.containsKey( "JRUBY_HOME" ) ) { base = this.env.get( "JRUBY_HOME" ); } else if ( System.getProperty( "jruby.home" ) != null ) { base = System.getProperty( "jruby.home" ); } else { for( String arg : this.jvmArgs.list ){ if (arg.startsWith("-Djruby.home=")){ base = arg.substring("-Djruby.home=".length()); break; } } } File f = new File( base, new File( "bin", scriptName ).getPath() ); if ( f.exists() ){ return new Script(this, f); } else { throw ee; } } } } public Script newScriptFromResource(final String scriptName) throws IOException { URL url = this.classRealm != null ? this.classRealm.getClassLoader() .getResource(scriptName) : null; if (url == null) { url = ScriptUtils.getScriptFromResource(scriptName); } if (url.getProtocol().equals("file")) { return new Script(this, url.getPath(), false); } else { return new Script(this, url); } } public Script newArguments() { return new Script(this); } public Script newScript(final String script) throws IOException { return new Script(this, script); } public Script newScript(final File file) { return new Script(this, file); } public void addJvmArgs(final String args) { this.jvmArgs.parseAndAdd(args); } public void addSwitch(final String name) { this.switches.add(name); } public void addSwitch(final String name, final String value) { this.switches.add(name, value); } public void addSwitches(final String switches) { this.switches.parseAndAdd(switches); } public void addEnv(final String name, final File value) { if (value != null) { this.env.put(name, value.getAbsolutePath()); } else { this.env.put(name, null); } } public Map environment(){ return env; } public void addEnv(final String name, final String value) { this.env.put(name, value); } public void addEnvs(final String environmentVars) { for (final String var : environmentVars.split("\\s+")) { final int index = var.indexOf("="); if (index > -1) { this.env.put(var.substring(0, index), var.substring(index + 1)); } } } @Override public String toString() { // TODO final StringBuilder buf = new StringBuilder(getClass().getName()); // for (final String arg : this.switches) { // buf.append(arg).append(" "); // } return buf.toString().trim(); } }././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/ruby/script/Launcher.java./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/ruby/script/Launcher.ja0000644000000000000000000000253512674201751030066 0ustar /** * */ package de.saumya.mojo.ruby.script; import java.io.File; import java.io.IOException; import java.util.List; interface Launcher { public abstract void execute(final List args) throws ScriptException, IOException; public abstract void execute(final List args, final File outputFile) throws ScriptException, IOException; public abstract void executeIn(final File launchDirectory, final List args) throws ScriptException, IOException; public abstract void executeIn(final File launchDirectory, final List args, final File outputFile) throws ScriptException, IOException; public abstract void executeScript(final String script, final List args) throws ScriptException, IOException; public abstract void executeScript(final String script, final List args, final File outputFile) throws ScriptException, IOException; public abstract void executeScript(final File launchDirectory, final String script, final List args) throws ScriptException, IOException; public abstract void executeScript(final File launchDirectory, final String script, final List args, final File outputFile) throws ScriptException, IOException; }././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/ruby/GemScriptingContainer.java./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/ruby/GemScriptingContai0000644000000000000000000000561412674201751030162 0ustar /** * */ package de.saumya.mojo.ruby; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URL; import java.util.HashMap; import java.util.Map; import org.jruby.embed.LocalContextScope; import org.jruby.embed.LocalVariableBehavior; import org.jruby.embed.ScriptingContainer; public class GemScriptingContainer extends ScriptingContainer { public GemScriptingContainer() { this(LocalContextScope.SINGLETON, LocalVariableBehavior.PERSISTENT, null, null); } public GemScriptingContainer(final File gemHome, final File gemPath) { this(LocalContextScope.SINGLETON, LocalVariableBehavior.PERSISTENT, gemHome, gemPath); } public GemScriptingContainer(LocalContextScope scope, LocalVariableBehavior behavior) { this(scope, behavior, null, null); } public GemScriptingContainer(LocalContextScope scope, LocalVariableBehavior behavior, final File gemHome, final File gemPath) { super(scope, behavior); final Map env = new HashMap(); if (gemHome != null && gemHome.exists()) { env.put("GEM_HOME", gemHome.getAbsolutePath()); } if (gemPath != null && gemPath.exists()) { env.put("GEM_PATH", gemPath.getAbsolutePath()); } getProvider().getRubyInstanceConfig().setEnvironment(env); // setting the JRUBY_HOME to the one from the jruby jar - ignoring // the environment setting ! // use lib otherwise the classloader finds META-INF/jruby.home from ruby-tools where there is a bin/rake // as fix for an older jruby jar URL jrubyHome = Thread.currentThread().getContextClassLoader() .getResource("META-INF/jruby.home/lib"); if ( jrubyHome != null ){ getProvider().getRubyInstanceConfig() .setJRubyHome( jrubyHome .toString() .replaceFirst("^jar:", "") .replaceFirst( "/lib$", "" ) ); } } public Object runScriptletFromClassloader(final String name, final Class clazz) throws IOException { InputStream script = ScriptUtils.getScriptAsStream(name, clazz); try { return runScriptlet(script, name); } finally { if (script != null) { script.close(); } } } public Object runScriptletFromClassloader(final String name) throws IOException { InputStream script = ScriptUtils.getScriptAsStream(name); try { return runScriptlet(ScriptUtils.getScriptAsStream(name), name); } finally { if (script != null) { script.close(); } } } }./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/ruby/gems/0000755000000000000000000000000012674201751025433 5ustar ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/ruby/gems/GemManager.java./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/ruby/gems/GemManager.ja0000644000000000000000000000764312674201751027764 0ustar package de.saumya.mojo.ruby.gems; import java.util.List; import java.util.Set; import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.project.MavenProject; import org.apache.maven.project.ProjectBuildingRequest; public interface GemManager { public static final String GROUP_ID_ARTIFACT_ID_SEPARATOR = ":"; // GEM artifact factory methods public abstract Artifact createGemArtifact(final String gemname) throws GemException; public abstract Artifact createGemArtifact(final String gemname, final String version) throws GemException; public abstract Artifact createGemArtifactWithLatestVersion( final String gemname, final ArtifactRepository localRepository, final List remoteRepositories) throws GemException; // GEM repositories public abstract ArtifactRepository defaultGemArtifactRepository(); public ArtifactRepository defaultGemArtifactRepositoryForVersion( final String artifactVersion); @Deprecated public void addDefaultGemRepository(final List repos); public void addDefaultGemRepositories(final List repos); @Deprecated public void addDefaultGemRepositoryForVersion(final String artifactVersion, final List repos); // jar artifacts for GEMNAME (maven-gems) public abstract Artifact createJarArtifactForGemname(final String gemName) throws GemException; public abstract Artifact createPomArtifactForGemname(final String gemName) throws GemException; public abstract Artifact createJarArtifactForGemname(final String gemName, final String version) throws GemException; public abstract Artifact createJarArtifactForGemnameWithLatestVersion( final String gemName, final ArtifactRepository localRepository, final List remoteRepositories) throws GemException; // convenience methods for artifacts public Set resolve(final Artifact artifact, final ArtifactRepository localRepository, final List remoteRepositories) throws GemException; public Set resolve(final Artifact artifact, final ArtifactRepository localRepository, final List remoteRepositories, boolean transitively) throws GemException; public Artifact createArtifact(final String groupId, final String artifactId, final String version, final String type); public Artifact createArtifact(final String groupId, final String artifactId, final String version, final String classifier, final String type); public MavenProject buildModel(Artifact artifact, final Object repositorySystemSession, final ArtifactRepository localRepository, final List remoteRepositories, boolean resolve) throws GemException; public void setRepositorySession( ProjectBuildingRequest pomRequest, Object repositorySystemSession ) throws GemException; public MavenProject buildPom(Artifact artifact, final Object repositorySystemSession, final ArtifactRepository localRepository, final List remoteRepositories) throws GemException; // versions public List availableVersions(final Artifact artifact, final ArtifactRepository localRepository, final List remoteRepositories) throws GemException; public String latestVersion(final Artifact artifact, final ArtifactRepository localRepository, final List remoteRepositories) throws GemException; }././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/ruby/gems/DefaultGemManager.java./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/ruby/gems/DefaultGemMan0000644000000000000000000003715112674201751030036 0ustar /** * */ package de.saumya.mojo.ruby.gems; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.lang.reflect.Method; import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Set; import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy; import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout; import org.apache.maven.artifact.repository.metadata.ArtifactRepositoryMetadata; import org.apache.maven.artifact.repository.metadata.RepositoryMetadata; import org.apache.maven.artifact.repository.metadata.RepositoryMetadataManager; import org.apache.maven.artifact.repository.metadata.RepositoryMetadataResolutionException; import org.apache.maven.artifact.resolver.ArtifactResolutionRequest; import org.apache.maven.model.Dependency; import org.apache.maven.model.building.ModelBuildingRequest; import org.apache.maven.project.DefaultProjectBuildingRequest; import org.apache.maven.project.MavenProject; import org.apache.maven.project.ProjectBuilder; import org.apache.maven.project.ProjectBuildingException; import org.apache.maven.project.ProjectBuildingRequest; import org.apache.maven.repository.RepositorySystem; import org.apache.maven.repository.legacy.metadata.DefaultMetadataResolutionRequest; import org.apache.maven.repository.legacy.metadata.MetadataResolutionRequest; import org.codehaus.plexus.component.annotations.Component; import org.codehaus.plexus.component.annotations.Requirement; import org.codehaus.plexus.util.IOUtil; @Component(role = GemManager.class) public class DefaultGemManager implements GemManager { public static final String DEFAULT_GEMS_REPOSITORY_BASE_URL = "http://rubygems-proxy.torquebox.org/"; @Requirement private RepositorySystem repositorySystem; @Requirement private RepositoryMetadataManager repositoryMetadataManager; @Requirement private ProjectBuilder builder; private Artifact setLatestVersionIfMissing(final Artifact artifact, final ArtifactRepository localRepository, final List remoteRepositories) throws GemException { if (artifact.getVersion() == null) { final List versions = availableVersions(artifact, localRepository, remoteRepositories); artifact.setVersionRange(null); artifact.setVersion(versions.get(versions.size() - 1)); } return artifact; } public Artifact createGemArtifact(final String gemname) throws GemException { return createGemArtifact(gemname, null); } public Artifact createGemArtifact(final String gemname, final String version) throws GemException { return createArtifact("rubygems", gemname, version, "gem"); } public Artifact createGemArtifactWithLatestVersion(final String gemname, final ArtifactRepository localRepository, final List remoteRepositories) throws GemException { final Artifact gem = createGemArtifact(gemname, null); setLatestVersionIfMissing(gem, localRepository, remoteRepositories); return gem; } // gem repositories public ArtifactRepository defaultGemArtifactRepository() { return defaultGemArtifactRepositoryForVersion("0.0.0"); } public ArtifactRepository defaultGemArtifactRepositoryForVersion( final String artifactVersion) { final String preRelease = artifactVersion != null && artifactVersion.matches(".*[a-zA-Z].*") ? "pre" : ""; return this.repositorySystem.createArtifactRepository("rubygems-" + preRelease + "releases", DEFAULT_GEMS_REPOSITORY_BASE_URL + preRelease + "releases", new DefaultRepositoryLayout(), new ArtifactRepositoryPolicy(), new ArtifactRepositoryPolicy()); } public void addDefaultGemRepository(final List repos) { addDefaultGemRepositories(repos); } public void addDefaultGemRepositories(final List repos) { ArtifactRepositoryPolicy enabled = new ArtifactRepositoryPolicy(true, "never", "strict"); ArtifactRepositoryPolicy disabled = new ArtifactRepositoryPolicy(false, "never", "strict"); ArtifactRepository repo = this.repositorySystem.createArtifactRepository("rubygems-releases", DEFAULT_GEMS_REPOSITORY_BASE_URL + "releases", new DefaultRepositoryLayout(), enabled, disabled); repos.add(repo); // repo = this.repositorySystem.createArtifactRepository("rubygems-prereleases", // DEFAULT_GEMS_REPOSITORY_BASE_URL + "prereleases", // new DefaultRepositoryLayout(), // disabled, enabled); //repos.add(repo); } public void addDefaultGemRepositoryForVersion(final String artifactVersion, final List repos) { final ArtifactRepository repo = defaultGemArtifactRepositoryForVersion(artifactVersion); for (final ArtifactRepository ar : repos) { if (ar.getUrl().equals(repo.getUrl())) { return; } } repos.add(repo); } // maven-gem artifacts public Artifact createJarArtifactForGemname(final String gemName) throws GemException { return createJarArtifactForGemname(gemName, null); } public Artifact createPomArtifactForGemname(final String gemName) throws GemException { final int index = gemName.lastIndexOf(GROUP_ID_ARTIFACT_ID_SEPARATOR); final String groupId = gemName.substring(0, index); final String artifactId = gemName.substring(index + 1); return createArtifact(groupId, artifactId, null, "pom"); } public Artifact createJarArtifactForGemname(final String gemName, final String version) throws GemException { final int index = gemName.lastIndexOf(GROUP_ID_ARTIFACT_ID_SEPARATOR); final String groupId = gemName.substring(0, index); final String artifactId = gemName.substring(index + 1); return createArtifact(groupId, artifactId, version, "jar"); } public Artifact createJarArtifactForGemnameWithLatestVersion( final String gemName, final ArtifactRepository localRepository, final List remoteRepositories) throws GemException { final Artifact artifact = createJarArtifactForGemname(gemName, null); setLatestVersionIfMissing(artifact, localRepository, remoteRepositories); return artifact; } // convenience methods public Artifact createArtifact(final String groupId, final String artifactId, final String version, final String type) { return createArtifact(groupId, artifactId, version, null, type); } public Artifact createArtifact(final String groupId, final String artifactId, final String version, final String classifier, final String type) { final Dependency dep = new Dependency(); dep.setGroupId(groupId); dep.setArtifactId(artifactId); dep.setType(type); if(classifier != null){ dep.setClassifier(classifier); } dep.setVersion(version == null ? "[0,)" : version); return this.repositorySystem.createDependencyArtifact(dep); } public Set resolve(final Artifact artifact, final ArtifactRepository localRepository, final List remoteRepositories) throws GemException{ return resolve(artifact, localRepository, remoteRepositories, false); } public Set resolve(final Artifact artifact, final ArtifactRepository localRepository, final List remoteRepositories, boolean transitively) throws GemException { if (artifact.getFile() == null || !artifact.getFile().exists()) { ArtifactResolutionRequest req = new ArtifactResolutionRequest() .setArtifact(artifact) .setResolveTransitively(transitively) .setLocalRepository(localRepository) .setRemoteRepositories(remoteRepositories); final Set artifacts = this.repositorySystem.resolve(req).getArtifacts(); if (artifacts.size() == 0) { throw new GemException("could not resolve artifact: " + artifact); } artifact.setFile(artifacts.iterator().next().getFile()); return artifacts; } else { return Collections.emptySet(); } } public MavenProject buildModel(final Artifact artifact, final Object repositorySystemSession, final ArtifactRepository localRepository, final List remoteRepositories, boolean resolve) throws GemException { // build a POM and resolve all artifacts final ProjectBuildingRequest pomRequest = new DefaultProjectBuildingRequest() .setLocalRepository(localRepository) .setRemoteRepositories(remoteRepositories) .setValidationLevel(ModelBuildingRequest.VALIDATION_LEVEL_STRICT) .setResolveDependencies(resolve); setRepositorySession(pomRequest, repositorySystemSession); try { return this.builder.build(artifact, pomRequest).getProject(); } catch (final ProjectBuildingException e) { throw new GemException("error building POM", e); } } public void setRepositorySession( ProjectBuildingRequest pomRequest, Object repositorySystemSession ) throws GemException { Class clazz; try { try { clazz = Thread.currentThread().getContextClassLoader().loadClass( "org.sonatype.aether.RepositorySystemSession" ); } catch (ClassNotFoundException e1) { // TODO use eclipse aether here clazz = Thread.currentThread().getContextClassLoader().loadClass( "org.eclipse.aether.RepositorySystemSession" ); } Method m = pomRequest.getClass().getMethod("setRepositorySession", clazz ); m.invoke( pomRequest, repositorySystemSession ); } catch ( Exception e ) { throw new GemException("error building POM", e); } } public MavenProject buildPom(final Artifact artifact, final Object repositorySystemSession, final ArtifactRepository localRepository, final List remoteRepositories) throws GemException { MavenProject pom = buildModel(artifact, repositorySystemSession, localRepository, remoteRepositories, true); resolve(pom.getArtifact(), localRepository, remoteRepositories); return pom; } // versions public String latestVersion(final Artifact artifact, final ArtifactRepository localRepository, final List remoteRepositories) throws GemException { final List versions = availableVersions(artifact, localRepository, remoteRepositories); return versions.get(versions.size() - 1); } public List availableVersions(final Artifact artifact, final ArtifactRepository localRepository, final List remoteRepositories) throws GemException { final MetadataResolutionRequest request = new DefaultMetadataResolutionRequest(); request.setArtifact(artifact); request.setLocalRepository(localRepository); request.setRemoteRepositories(remoteRepositories); final RepositoryMetadata metadata = new ArtifactRepositoryMetadata(request.getArtifact()); try { this.repositoryMetadataManager.resolve(metadata, request); } catch (final RepositoryMetadataResolutionException e) { throw new GemException("error updateding versions of artifact: " + artifact, e); } final List versions; if (metadata.getMetadata().getVersioning() == null) { if(remoteRepositories.size() == 0){ throw new GemException("no version found - maybe system is offline or wrong : " + artifact.getGroupId() + GROUP_ID_ARTIFACT_ID_SEPARATOR + artifact.getArtifactId()); } versions = new ArrayList(); } else { versions= metadata.getMetadata() .getVersioning() .getVersions(); } for(ArtifactRepository repo : remoteRepositories){ BufferedReader reader = null; try { URL url = new URL(repo.getUrl() + "/" + artifact.getGroupId().replace(".", "/") + "/" + artifact.getArtifactId() + "/"); reader = new BufferedReader(new InputStreamReader(url.openStream(), "UTF-8")); String line = reader.readLine(); while (line != null) { //TODO maybe try to be more relax on how the version is embedded if (line.contains(".*", "") .replaceFirst(".*", ""); if(version.endsWith("/")){ version = version.substring(0, version.length() - 1); if (!versions.contains(version)) { versions.add(version); } } } line = reader.readLine(); } } catch (MalformedURLException e) { // should never happen throw new RuntimeException("error scraping versions from html page", e); } catch (IOException e) { // TODO // System.err.println("error scraping versions from html index page: " + e.getMessage()); // e.printStackTrace(); } finally { IOUtil.close(reader); } } Collections.sort(versions); return versions; } } ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/ruby/gems/GemsInstaller.java./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/ruby/gems/GemsInstaller0000644000000000000000000002606412674201751030137 0ustar /** * */ package de.saumya.mojo.ruby.gems; import java.io.File; import java.io.FileFilter; import java.io.IOException; import java.util.Collection; import java.util.List; import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.plugin.descriptor.PluginDescriptor; import org.apache.maven.project.MavenProject; import org.codehaus.plexus.util.FileUtils; import de.saumya.mojo.ruby.script.Script; import de.saumya.mojo.ruby.script.ScriptException; import de.saumya.mojo.ruby.script.ScriptFactory; public class GemsInstaller { private static final String OPENSSL_VERSION = "0.8.2"; private static final String OPENSSL = "jruby-openssl"; private static final FileFilter FILTER = new FileFilter() { public boolean accept(File f) { return f.getName().endsWith(".gemspec"); } }; public final GemsConfig config; public final ScriptFactory factory; public final GemManager manager; public GemsInstaller(final GemsConfig config, final ScriptFactory factory, final GemManager manager) { this.config = config; this.factory = factory; this.manager = manager; } public void installPom(final MavenProject pom) throws IOException, ScriptException, GemException { installGems(pom, null); } public void installPom(final MavenProject pom, final ArtifactRepository localRepository) throws IOException, ScriptException, GemException { installPom(pom, localRepository, null); } public void installPom(final MavenProject pom, final ArtifactRepository localRepository, String scope) throws IOException, ScriptException, GemException { installGems(pom, localRepository, scope); } public MavenProject installOpenSSLGem(final Object repositorySystemSession, final ArtifactRepository localRepository, List remotes) throws GemException, IOException, ScriptException { return installGem(OPENSSL, OPENSSL_VERSION, repositorySystemSession, localRepository, remotes); } public MavenProject installGem(final String name, final String version, final Object repositorySystemSession, final ArtifactRepository localRepository, List remoteRepositories) throws GemException, IOException, ScriptException { final Artifact artifact; if (version == null) { artifact = this.manager.createGemArtifactWithLatestVersion(name, localRepository, remoteRepositories); } else { artifact = this.manager.createGemArtifact(name, version); } final MavenProject pom = this.manager.buildPom(artifact, repositorySystemSession, localRepository, remoteRepositories); installPom(pom); return pom; } public void installGems(final MavenProject pom, final ArtifactRepository localRepository) throws IOException, ScriptException, GemException { installGems(pom, localRepository, null); } public void installGems(final MavenProject pom, final ArtifactRepository localRepository, String scope ) throws IOException, ScriptException, GemException { installGems(pom, (Collection)null, localRepository, scope); } public void installGems(final MavenProject pom, PluginDescriptor plugin, final ArtifactRepository localRepository) throws IOException, ScriptException, GemException { installGems(pom, plugin.getArtifacts(), localRepository, (String) null); } public void installGems(final MavenProject pom, final Collection artifacts, final ArtifactRepository localRepository, String scope) throws IOException, ScriptException, GemException { installGems(pom, artifacts, localRepository, pom.getRemoteArtifactRepositories(), scope); } public void installGems(final MavenProject pom, final Collection artifacts, final ArtifactRepository localRepository, List remoteRepos) throws IOException, ScriptException, GemException { installGems( pom, artifacts, localRepository, remoteRepos, null ); } public void installGems(final MavenProject pom, final Collection artifacts, final ArtifactRepository localRepository, List remoteRepos, String scope ) throws IOException, ScriptException, GemException { // start without script object. // script object will be created when first un-installed gem is found Script script = null; if (pom != null) { boolean hasAlreadyOpenSSL = false; for (final Artifact artifact : pom.getArtifacts()) { // assume pom.getBasedir() != null indicates the project pom if ( ( "compile".equals(artifact.getScope()) || "runtime".equals(artifact.getScope()) || pom.getBasedir() != null ) && ( scope == null || scope.equals(artifact.getScope()) ) ) { if (!artifact.getFile().exists()) { this.manager.resolve(artifact, localRepository, remoteRepos); } script = maybeAddArtifact(script, artifact); hasAlreadyOpenSSL = hasAlreadyOpenSSL || artifact.getArtifactId().equals(OPENSSL); } } if (artifacts != null) { for (final Artifact artifact : artifacts) { if (!artifact.getFile().exists()) { this.manager.resolve(artifact, localRepository, remoteRepos); } script = maybeAddArtifact(script, artifact); hasAlreadyOpenSSL = hasAlreadyOpenSSL || artifact.getArtifactId().equals(OPENSSL); } } if ( pom.getArtifact().getFile() != null // to filter out target/classes && pom.getArtifact().getFile().isFile() // have only gem files && pom.getArtifact().getFile().getName().endsWith(".gem") ) { script = maybeAddArtifact(script, pom.getArtifact()); } if (!this.config.skipJRubyOpenSSL() && !hasAlreadyOpenSSL && script != null) { // keep the version hard-coded to stay reproducible final Artifact openssl = this.manager.createGemArtifact(OPENSSL, OPENSSL_VERSION); if (pom.getFile() == null) { // we do not have a pom so we need the default gems repo this.manager.addDefaultGemRepositories(remoteRepos); } for(Artifact a : this.manager.resolve(openssl, localRepository, remoteRepos, true) ) { if (a.getFile() == null || !a.getFile().exists()) { this.manager.resolve(a, localRepository, remoteRepos); } script = maybeAddArtifact(script, a); } } } if (script != null) { script.addArg("--bindir", this.config.getBinDirectory()); if(this.config.getBinDirectory() != null && !this.config.getBinDirectory().exists()){ this.config.getBinDirectory().mkdirs(); } script.execute(); if (this.config.getGemHome() != null){ // workaround for unpatched: https://github.com/rubygems/rubygems/commit/21cccd55b823848c5e941093a615b0fdd6cd8bc7 for(File spec : new File(this.config.getGemHome(), "specifications").listFiles(FILTER)){ String content = FileUtils.fileRead(spec); FileUtils.fileWrite(spec.getAbsolutePath(), content.replaceFirst(" 00:00:00.000000000Z", "")); } } this.factory.newScript( "require 'jruby/commands'; JRuby::Commands.generate_dir_info '" + this.config.getGemHome() + "' if JRuby::Commands.respond_to? :generate_dir_info" ).execute(); } } private boolean exists(Artifact artifact) { // check if the specifications exists String basename = artifact.getArtifactId() + "-" + artifact.getVersion().replaceFirst("-SNAPSHOT$", ""); String universalJavaBasename = basename + "-universal-java.gemspec"; String javaBasename = basename + "-java.gemspec"; String rubyBasename = basename + ".gemspec"; for (File dir : this.config.getGemsDirectory()) { File specs = new File( dir.getParentFile(), "specifications" ); if (new File(specs, rubyBasename).exists() || new File(specs, javaBasename).exists() || new File(specs, universalJavaBasename).exists()) { return true; } } return false; } private Script maybeAddArtifact(Script script, final Artifact artifact) throws IOException, GemException { if (artifact.getType().contains("gem")) { if (!exists(artifact)) { if (script == null) { script = this.factory.newScriptFromJRubyJar("gem") .addArg("install") .addArg("--ignore-dependencies") .addArg(booleanArg(this.config.isAddRdoc(), "rdoc")) .addArg(booleanArg(this.config.isAddRI(), "ri")) .addArg(booleanArg(this.config.isUserInstall(), "user-install")) .addArg(booleanArg(this.config.isVerbose(), "verbose")); } if (artifact.getFile() != null) { script.addArg(artifact.getFile()); } } } return script; } private String booleanArg(final boolean flag, final String name) { return "--" + (flag ? "" : "no-") + name; } } ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/ruby/gems/GemsConfig.java./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/ruby/gems/GemsConfig.ja0000644000000000000000000001251012674201751027767 0ustar /** * */ package de.saumya.mojo.ruby.gems; import java.io.File; import java.util.ArrayList; import java.util.List; public class GemsConfig { private static final String GEM_PATH = "GEM_PATH"; private static final String GEM_HOME = "GEM_HOME"; private String env; private File gemBase; private File gemHome; private List gemPaths = new ArrayList(); private File[] gemsDirectory; private File binDirectory; private boolean addRI = false; private boolean addRdoc = false; private boolean verbose = false; private boolean userInstall = false; private boolean systemInstall = false; private boolean skipJRubyOpenSSL = false; public void setSkipJRubyOpenSSL(final boolean skip) { this.skipJRubyOpenSSL = skip; } public boolean skipJRubyOpenSSL() { return this.skipJRubyOpenSSL; } public void setAddRI(final boolean addRI) { this.addRI = addRI; } public boolean isAddRI() { return this.addRI; } public void setAddRdoc(final boolean addRdoc) { this.addRdoc = addRdoc; } public boolean isAddRdoc() { return this.addRdoc; } public void setVerbose(final boolean verbose) { this.verbose = verbose; } public boolean isVerbose() { return this.verbose; } public void setUserInstall(final boolean userInstall) { this.userInstall = userInstall; } public void setSystemInstall(final boolean systemInstall) { this.systemInstall = systemInstall; } public boolean isUserInstall() { return this.userInstall; } public boolean isSystemInstall() { return this.systemInstall; } public File[] getGemsDirectory() { if (this.gemsDirectory == null) { File[] paths = getGemPath(); this.gemsDirectory = new File[paths.length]; int index = 0; for(File path: paths){ this.gemsDirectory[index++] = new File(path, "gems"); } } return this.gemsDirectory; } public void setBinDirectory(File binDirectory) { this.binDirectory = binDirectory; } public File getBinDirectory() { if (this.binDirectory == null) { if(getGemHome() != null){ return new File(getGemHome(), "bin"); } else { return null; } } return this.binDirectory; } public File binScriptFile(final String scriptName) { if (getBinDirectory() == null){ // TODO something better return new File(scriptName); } else { return new File(getBinDirectory(), scriptName); } } public String getEnvironment() { return this.env; } public void setEnvironment(final String env) { this.env = env; setGemBase(this.gemBase); } public void setGemBase(final File base) { this.gemBase = base; if (this.gemBase != null) { final String postfix = this.env == null ? "" : "-" + this.env; this.gemHome = new File(this.gemBase.getPath() + postfix); this.gemPaths.set(0, new File(this.gemBase.getPath() + postfix)); } } public boolean hasGemBase() { return this.gemBase != null; } public void setGemHome(final File home) { this.gemHome = home; this.gemBase = null; } public void addGemPath(final File path) { if( path != null ){ this.gemPaths.add(path); this.gemBase = null; this.gemsDirectory = null; } } public File getGemHome() { if (this.gemHome == null || systemInstall) { if (System.getenv(GEM_HOME) == null) { return null; } else { return new File(System.getenv(GEM_HOME)); } } else { return this.gemHome; } } public File[] getGemPath() { if (this.gemPaths.size() == 0 || systemInstall) { if (System.getenv(GEM_PATH) == null) { return new File[0]; } else { return new File[] {new File(System.getenv(GEM_PATH))}; } } else { return this.gemPaths.toArray(new File[this.gemPaths.size()]); } } @Override public GemsConfig clone() { final GemsConfig clone = new GemsConfig(); clone.setEnvironment(this.env); if (this.gemBase != null) { clone.setGemBase(this.gemBase); } else { clone.setGemHome(this.gemHome); for(File path: this.gemPaths){ clone.addGemPath(path); } } clone.addRdoc = this.addRdoc; clone.addRI = this.addRI; clone.userInstall = this.userInstall; clone.systemInstall = this.systemInstall; clone.verbose = this.verbose; clone.skipJRubyOpenSSL = this.skipJRubyOpenSSL; clone.binDirectory = this.binDirectory; return clone; } }././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/ruby/gems/GemException.java./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/ruby/gems/GemException.0000644000000000000000000000060412674201751030023 0ustar package de.saumya.mojo.ruby.gems; public class GemException extends Exception { private static final long serialVersionUID = 740727357226540997L; public GemException(final Exception e) { super(e); } public GemException(final String msg, final Exception e) { super(msg, e); } public GemException(final String msg) { super(msg); } } ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/ruby/Logger.java0000644000000000000000000000120712674201751026562 0ustar /** * */ package de.saumya.mojo.ruby; public interface Logger { /** * Send a message to the user in the debug level. * * @param content */ void debug(CharSequence content); /** * Send a message to the user in the info level. * * @param content */ void info(CharSequence content); /** * Send a message to the user in the warn level. * * @param content */ void warn(CharSequence string); /** * Send a message to the user in the error level. * * @param content */ void error(CharSequence string); }./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/gems/0000755000000000000000000000000012674201751024452 5ustar ././@LongLink0000644000000000000000000000016100000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/gems/Maven2GemVersionConverter.java./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/gems/Maven2GemVersionCo0000644000000000000000000001033312674201751030006 0ustar package de.saumya.mojo.gems; import java.util.regex.Pattern; /** * Class doing conversion from Maven "versioning space" into Ruby Gems "versioning space". The job is not trivial, since * Maven is much more liberal in accepting versions then Gems are. * * @author cstamas * @author mkristian */ public class Maven2GemVersionConverter { public static final String DUMMY_VERSION = "999.0.0"; public static final String DUMMY_PREFIX = "0.0.1-"; /** * This is the pattern we match against. This is actually x.y.z... version format, that RubyGems 1.3.5 support. * {@link http://github.com/jbarnette/rubygems/blob/REL_1_3_5/lib/rubygems/version.rb} and {@link http * ://github.com/jbarnette/rubygems/blob/REL_1_3_6/lib/rubygems/version.rb} */ public static final Pattern gemVersionPattern = Pattern.compile( "[0-9]+(\\.[0-9a-z]+)*" ); private static final Pattern goodVersionPattern = Pattern.compile( "[0-9a-zA-Z-_.]+" ); private static final Pattern numbersOnlyGemVersionPattern = Pattern.compile( "[0-9]+(\\.[0-9]+){2}(\\.[0-9]+)*" ); private static final Pattern dummyGemVersionPattern = Pattern.compile( "^[^0-9].*" ); private static final Pattern majorOnlyPattern = Pattern.compile( "^[0-9]+$" ); private static final Pattern majorMinorOnlyPattern = Pattern.compile( "^[0-9]+\\.[0-9]+$" ); /** * Creates valid GEM version out of Maven2 version. Gem versions are "stricter" than Maven versions: they are in * form of "x.y.z...". They have to start with integer, and be followed by a '.'. You can have as many like these * you want, but Maven version like "1.0-alpha-2" is invalid Gem version. Hence, some trickery has to be applied. * * @param mavenVersion * @return */ public String createGemVersion( String mavenVersion ) throws NullPointerException { if ( mavenVersion == null || mavenVersion.trim().length() == 0 ) { throw new NullPointerException( "The passed in mavenVersion cannot be empty!" ); } if ( dummyGemVersionPattern.matcher( mavenVersion ).matches() ) { if ( goodVersionPattern.matcher( mavenVersion ).matches() ) { return createGemVersion( DUMMY_PREFIX + mavenVersion ); } else { return DUMMY_VERSION; } } else if ( numbersOnlyGemVersionPattern.matcher( mavenVersion ).matches() ) { // has at least two dots !!! return mavenVersion; } // make all lowercase for rubygems 1.3.5 mavenVersion = mavenVersion.toLowerCase(); // first transform the main part (everything before the first '-' or '_' // to follow the pattern "major.minor.build" // motivation: 1.0-2 should be lower then 1.0.1, i.e. the first one is variant of 1.0.0 String mainPart = mavenVersion.replaceAll( "[\\-_].*", "" ); String extraPart = mavenVersion.substring( mainPart.length() ).replaceAll( "[_-][_-]", "-" ); StringBuilder version = new StringBuilder( mainPart ); // TODO maybe it is better to stick to what is given instead of padding it to three parts if ( majorOnlyPattern.matcher( mainPart ).matches() ) { version.append( ".0.0" ); } else if ( majorMinorOnlyPattern.matcher( mainPart ).matches() ) { version.append( ".0" ); } version.append( extraPart ); // now the remaining transformations return version.toString() // split alphanumeric parts in numeric parts and alphabetic parts .replaceAll( "([0-9]+)([a-z]+)", "$1.$2" ).replaceAll( "([a-z]+)([0-9]+)", "$1.$2" ) // "-"/"_" to "." .replaceAll( "-|_", "." ) // shorten predefined qualifiers or replace aliases // TODO SNAPSHOT", "final", "ga" are missing and do not sort correctly .replaceAll( "alpha", "a" ).replaceAll( "beta", "b" ).replaceAll( "gamma", "g" ).replaceAll( "cr", "r" ).replaceAll( "rc", "r" ).replaceAll( "sp", "s" ).replaceAll( "milestone", "m" ); } } ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/gems/MavenArtifactConverter.java./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/gems/MavenArtifactConve0000644000000000000000000000406412674201751030120 0ustar package de.saumya.mojo.gems; import java.io.File; import java.io.IOException; import de.saumya.mojo.gems.spec.GemSpecification; /** * This is the single entry point into the Maven artifact to Ruby Gem converter. * * @author cstamas */ public interface MavenArtifactConverter { public static final String GEMNAME_PREFIX = "mvn:"; /** * Returns is the artifact convertable safely into Gem. * * @param pom * @return true if yes. */ boolean canConvert(MavenArtifact artifact); /** * Returns the "regular" gem filename, as it is expected this artifact to be * called as Gem. * * @param pom * @return */ String getGemFileName(MavenArtifact artifact); /** * Creates a Gem::Specification (the equivalent JavaBeans actually) filled * up properly based on informaton from POM. The "better" POM is, the getter * is gemspec. For best results, fed in interpolated POMs! * * @param artifact * @return */ GemSpecification createSpecification(MavenArtifact artifact); File createGemspecFromArtifact(MavenArtifact artifact, File target) throws IOException; /** * Creates a valid Ruby Gem, and returns File pointing to the result. * * @param artifact * the artifact to gemize (without data only gemspec) * @param target * where to save Gem file. If null, it will be created next to * artifact * @return * @throws IOException */ GemArtifact createGemStubFromArtifact(MavenArtifact artifact, File target) throws IOException; /** * Creates a valid Ruby Gem, and returns File pointing to the result. * * @param artifact * the artifact to gemize * @param target * where to save Gem file. If null, it will be created next to * artifact * @return * @throws IOException */ GemArtifact createGemFromArtifact(MavenArtifact artifact, File target) throws IOException; } ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/gems/gem/0000755000000000000000000000000012674201751025222 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/gems/gem/Gem.java0000644000000000000000000000443212674201751026600 0ustar package de.saumya.mojo.gems.gem; import java.io.File; import java.util.ArrayList; import java.util.List; import de.saumya.mojo.gems.spec.GemSpecification; /** * A Gem with specification and list of files. * * @author mkristian */ public class Gem { private final List files = new ArrayList(); private final GemSpecification spec; public Gem(final GemSpecification spec) { this.spec = spec; } public static String constructGemFileName(final String gemName, final String gemVersion, final String platform) { final StringBuilder sb = new StringBuilder(); // gemspec.name - gemspec.version - gemspec.platform ".gem" sb.append(gemName).append("-").append(gemVersion); if (platform != null && !"ruby".equals(platform)) { // only non Ruby platform should be appended sb.append("-").append(platform); } // extension sb.append(".gem"); return sb.toString(); } private String add(final File source, final String path) { if (!source.isFile()) { throw new RuntimeException("only files are implemented: " + source); } this.files.add(new GemFileEntry(source, path)); return path; } public List getGemFiles() { return this.files; } public void addFile(final File source) { addFile(source, source.getPath()); } public void addFile(final File source, final String path) { this.spec.addFile(add(source, path)); } public void addTestFile(final File source) { addTestFile(source, source.getPath()); } public void addTestFile(final File source, final String path) { this.spec.addTestFile(add(source, path)); } public void addExtraRdocFile(final File source) { addExtraRdocFile(source, source.getPath()); } public void addExtraRdocFile(final File source, final String path) { this.spec.addExtraRdocFile(add(source, path)); } public GemSpecification getSpecification() { return this.spec; } public String getGemFilename() { return constructGemFileName(this.spec.getName(), this.spec.getVersion() .toString(), this.spec.getPlatform()); } } ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/gems/gem/GemPackager.java./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/gems/gem/GemPackager.ja0000644000000000000000000000254512674201751027712 0ustar package de.saumya.mojo.gems.gem; import java.io.File; import java.io.IOException; import de.saumya.mojo.gems.spec.GemSpecification; /** * A low level component that manufactures the actual Gem file. * * @author cstamas * @author mkristian */ public interface GemPackager { /** * This method will create the GEM stub with only gemspec and not data. It * will do NO validation at all, just blindly create the Gem using supplied * stuff. * * @param gemspec * The Gem::Specification to embed into Gem. * @param targetDirectory * The directory where the manufactured Gem should be saved. * @return gemFile The File location of the manufactured Gem. * @throws IOException */ File createGemStub(GemSpecification gemspec, File targetDirectory) throws IOException; /** * This method will create the GEM. It will do NO validation at all, just * blindly create the Gem using supplied stuff. * * @param gem * The Gem::Specification and the files to embed into Gem. * @param targetDirectory * The directory where the manufactured Gem should be saved. * @return gemFile The File location of the manufactured Gem. * @throws IOException */ File createGem(Gem gem, File targetDirectory) throws IOException; } ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/gems/gem/DefaultGemPackager.java./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/gems/gem/DefaultGemPack0000644000000000000000000001145512674201751027767 0ustar package de.saumya.mojo.gems.gem; import java.io.File; import java.io.IOException; import org.codehaus.plexus.archiver.ArchiverException; import org.codehaus.plexus.archiver.gzip.GZipArchiver; import org.codehaus.plexus.archiver.tar.TarArchiver; import org.codehaus.plexus.archiver.tar.TarArchiver.TarCompressionMethod; import org.codehaus.plexus.component.annotations.Component; import org.codehaus.plexus.component.annotations.Requirement; import org.codehaus.plexus.logging.AbstractLogger; import org.codehaus.plexus.logging.Logger; import org.codehaus.plexus.util.FileUtils; import de.saumya.mojo.gems.spec.GemSpecification; import de.saumya.mojo.gems.spec.GemSpecificationIO; @Component(role = GemPackager.class) public class DefaultGemPackager implements GemPackager { @Requirement(hints = { "yaml" }) private GemSpecificationIO gemSpecificationIO; public File createGemStub(final GemSpecification gemspec, final File target) throws IOException { return createGem(new Gem(gemspec), target); } public File createGem(final Gem gem, final File target) throws IOException { final File gemWorkdir = new File(File.createTempFile("nexus-gem-work", ".tmp") .getParentFile(), "wd-" + System.currentTimeMillis()); gemWorkdir.mkdirs(); if (!gem.getGemFiles().isEmpty()) { for (final GemFileEntry entry : gem.getGemFiles()) { if (!entry.getSource().isFile()) { throw new IOException("The GEM entry must be a file!"); } } } // get YAML final String gemspecString = this.gemSpecificationIO.write(gem.getSpecification()); // DEBUG // FileUtils.fileWrite( gemFile.getAbsolutePath(), gemspecString ); // DEBUG try { // write file "metadata" (YAML of gemspec) final File metadata = new File(gemWorkdir, "metadata"); final File metadataGz = new File(gemWorkdir, "metadata.gz"); FileUtils.fileWrite(metadata.getAbsolutePath(), "UTF-8", gemspecString); // gzip it into metadata.gz final GZipArchiver gzip = new GZipArchiver(); gzip.setDestFile(metadataGz); gzip.addFile(metadata, "metadata.gz"); gzip.createArchive(); final TarArchiver tar = new TarArchiver(); // turn off logging tar.enableLogging(new AbstractLogger(0, "nologging") { public void warn(final String message, final Throwable throwable) { } public void info(final String message, final Throwable throwable) { } public Logger getChildLogger(final String name) { return null; } public void fatalError(final String message, final Throwable throwable) { } public void error(final String message, final Throwable throwable) { } public void debug(final String message, final Throwable throwable) { } }); File dataTarGz = null; if (!gem.getGemFiles().isEmpty()) { // tar.gz the content into data.tar.gz dataTarGz = new File(gemWorkdir, "data.tar.gz"); tar.setCompression(TarCompressionMethod.gzip); tar.setDestFile(dataTarGz); for (final GemFileEntry entry : gem.getGemFiles()) { if (entry.getSource().isFile()) { tar.addFile(entry.getSource(), entry.getPathInGem()); } else if (entry.getSource().isDirectory()) { tar.addDirectory(entry.getSource(), entry.getPathInGem()); } } tar.createArchive(); } // and finally create gem by tar.gz-ing data.tar.gz and metadata.gz final File gemFile = new File(target, gem.getGemFilename()); tar.setDestFile(gemFile); tar.setCompression(TarCompressionMethod.none); if (dataTarGz != null) { tar.addFile(dataTarGz, dataTarGz.getName()); } tar.addFile(metadataGz, metadataGz.getName()); tar.createArchive(); return gemFile; } catch (final ArchiverException e) { final IOException ioe = new IOException(e.getMessage()); ioe.initCause(e); throw ioe; } finally { FileUtils.forceDelete(gemWorkdir); } } } ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/gems/gem/GemFileEntry.java./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/gems/gem/GemFileEntry.j0000644000000000000000000000164512674201751027735 0ustar package de.saumya.mojo.gems.gem; import java.io.File; /** * A Gem file entry. It is sourced from a plain File and tells about where it * wants to be in Gem. * * @author cstamas */ public class GemFileEntry { /** * The path where the file should be within Gem. Usually it is * "lib/theFileName.ext", but it may be overridden. */ private String pathInGem; /** * The actual source of the file. */ private File source; public GemFileEntry(final File source, final String pathInGem) { this.source = source; this.pathInGem = pathInGem; } public String getPathInGem() { return this.pathInGem; } public void setPathInGem(final String pathInGem) { this.pathInGem = pathInGem; } public File getSource() { return this.source; } public void setSource(final File source) { this.source = source; } } ././@LongLink0000644000000000000000000000016500000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/gems/DefaultMavenArtifactConverter.java./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/gems/DefaultMavenArtifa0000644000000000000000000005312112674201751030101 0ustar package de.saumya.mojo.gems; import java.io.File; import java.io.FileNotFoundException; import java.io.FileWriter; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.Date; import java.util.List; import org.apache.maven.model.Dependency; import org.apache.maven.model.Developer; import org.apache.maven.model.Exclusion; import org.apache.maven.model.License; import org.apache.maven.model.Model; import org.apache.maven.model.Relocation; import org.apache.velocity.VelocityContext; import org.apache.velocity.context.Context; import org.codehaus.plexus.component.annotations.Component; import org.codehaus.plexus.component.annotations.Requirement; import org.codehaus.plexus.util.IOUtil; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.velocity.VelocityComponent; import de.saumya.mojo.gems.gem.Gem; import de.saumya.mojo.gems.gem.GemPackager; import de.saumya.mojo.gems.spec.GemDependency; import de.saumya.mojo.gems.spec.GemRequirement; import de.saumya.mojo.gems.spec.GemSpecification; import de.saumya.mojo.gems.spec.GemSpecificationIO; import de.saumya.mojo.gems.spec.GemVersion; import de.saumya.mojo.ruby.gems.GemManager; /** * This is full of "workarounds" here, since for true artifact2gem conversion I * would need interpolated POM! * * @author cstamas * @author mkristian */ @Component(role = MavenArtifactConverter.class) public class DefaultMavenArtifactConverter implements MavenArtifactConverter { private static final String LIB_PATH = "lib/"; private static final String LIB_MAVEN_PATH = LIB_PATH + "maven/"; enum RubyDependencyType { RUNTIME, DEVELOPMENT; @Override public String toString() { return ":" + name().toLowerCase(); } public static RubyDependencyType toRubyDependencyType( final String dependencyScope) { // ruby scopes // :development // :runtime if ("provided".equals(dependencyScope) || "test".equals(dependencyScope)) { return DEVELOPMENT; } else if ("compile".equals(dependencyScope) || "runtime".equals(dependencyScope)) { return RUNTIME; } else // dependencyScope: "system" { // TODO better throw an exception since there will be no gem for // such a dependency or something else return RUNTIME; } } } /** * The Java platform key. */ String PLATFORM_JAVA = "java"; @Requirement private GemPackager gemPackager; @Requirement private VelocityComponent velocityComponent; @Requirement(hints = { "yaml" }) private GemSpecificationIO gemSpecificationIO; private final Maven2GemVersionConverter maven2GemVersionConverter = new Maven2GemVersionConverter(); public boolean canConvert(final MavenArtifact artifact) { // TODO: this is where we filter currently what to convert. // for now, we convert only POMs with packaging "pom", or "jar" (but we // ensure there is the primary artifact JAR // also // RELAXING: doing "pom" packagings but also anything that has primary // artifact ending with ".jar". if (canConvert(artifact, "pom", null)) { return true; } if (canConvert(artifact, artifact.getPom().getPackaging(), "jar")) { return true; } return false; } private boolean canConvert(final MavenArtifact artifact, final String packaging, final String extension) { String fixedExtension = null; if (extension != null) { fixedExtension = extension.startsWith(".") ? extension : "." + extension; } return StringUtils.equals(packaging, artifact.getPom().getPackaging()) && ((extension == null && artifact.getArtifactFile() == null) || (extension != null && artifact.getArtifactFile() != null && artifact.getArtifactFile() .getName() .endsWith(fixedExtension))); } public String getGemFileName(final MavenArtifact artifact) { return getGemFileName(artifact.getCoordinates().getGroupId(), artifact.getCoordinates().getArtifactId(), artifact.getCoordinates().getVersion(), this.PLATFORM_JAVA); } public GemSpecification createSpecification(final MavenArtifact artifact) { final GemSpecification result = new GemSpecification(); if( relocateIfNeeded(artifact)){ Dependency dep = artifact.getPom().getDependencies().get(0); result.setPost_install_message("this gem has a new name: " + createGemName(dep.getGroupId(), dep.getArtifactId(), dep.getVersion()) + " version: " + dep.getVersion()); } // this is fix result.setPlatform(this.PLATFORM_JAVA); // the must ones result.setName(createGemName(artifact.getCoordinates().getGroupId(), artifact.getCoordinates().getArtifactId(), artifact.getCoordinates().getVersion())); result.setVersion(new GemVersion(createGemVersion(artifact.getCoordinates() .getVersion()))); // dependencies if (artifact.getPom().getDependencies().size() > 0) { for (final Dependency dependency : artifact.getPom() .getDependencies()) { if (!dependency.isOptional()) { result.getDependencies().add(convertDependency(artifact, dependency)); } } } // and other stuff "nice to have" result.setDate(new Date()); // now result.setDescription(sanitizeStringValue(artifact.getPom() .getDescription() != null ? artifact.getPom().getDescription() : artifact.getPom().getName())); result.setSummary(sanitizeStringValue(artifact.getPom().getName())); result.setHomepage(sanitizeStringValue(artifact.getPom().getUrl())); if (artifact.getPom().getLicenses().size() > 0) { for (final License license : artifact.getPom().getLicenses()) { result.getLicenses().add(sanitizeStringValue(license.getName() + " (" + license.getUrl() + ")")); } } if (artifact.getPom().getDevelopers().size() > 0) { for (final Developer developer : artifact.getPom().getDevelopers()) { result.getAuthors().add(sanitizeStringValue(developer.getName() + " (" + developer.getEmail() + ")")); } } // by default, we pack into lib/ inside gem (where is the jar and the // stub ruby) result.getRequire_paths().add("lib"); return result; } public GemArtifact createGemStubFromArtifact(final MavenArtifact artifact, final File target) throws IOException { final GemSpecification gemspec = createSpecification(artifact); if (target == null || (target.exists() && !target.isDirectory())) { throw new IOException("Must specify target file, where to generate Gem!"); } // write file final File gemfile = this.gemPackager.createGemStub(gemspec, target); return new GemArtifact(gemspec, gemfile); } private boolean relocateIfNeeded(final MavenArtifact mart){ Model model = mart.getPom(); if (model.getDistributionManagement() != null) { final Relocation relocation = model.getDistributionManagement() .getRelocation(); if (relocation != null) { String newGroupId = relocation.getGroupId() == null ? mart.getCoordinates().getGroupId() : relocation.getGroupId(); String newArtifactId = relocation.getArtifactId() == null ? mart.getCoordinates().getArtifactId() : relocation.getArtifactId(); String newVersion = relocation.getVersion() == null ? mart.getCoordinates().getVersion() : relocation.getVersion(); Dependency dep = new Dependency(); dep.setArtifactId(newArtifactId); dep.setGroupId(newGroupId); dep.setVersion(newVersion); dep.setType(model.getPackaging()); model.getDependencies().clear(); model.addDependency(dep); model.setPackaging("pom"); return true; } } return false; } public GemArtifact createGemFromArtifact(final MavenArtifact artifact, final File target) throws IOException { final GemSpecification gemspec = createSpecification(artifact); if (target == null || (target.exists() && !target.isDirectory())) { throw new IOException("Must specify target directory, where to generate Gem!"); } final Gem gem = new Gem(gemspec); if (artifact.getArtifactFile() != null) { gem.addFile(artifact.getArtifactFile(), createLibFileName(artifact, ".jar")); } // create "meta" ruby file final String rubyStubMetaPath = createLibFileName(artifact, "-maven.rb"); final File rubyStubMetaFile = generateRubyMetaStub(gemspec, artifact); gem.addFile(rubyStubMetaFile, rubyStubMetaPath); // create runtime ruby file final String rubyStubPath = createLibFileName(artifact, ".rb"); // System.err.println( rubyStubPath ); final File rubyStubFile = generateRubyStub(gemspec, artifact, RubyDependencyType.RUNTIME); gem.addFile(rubyStubFile, rubyStubPath); // create development ruby file final String rubyDevelopmentStubPath = createLibFileName(artifact, "-dev.rb"); final File rubyDevelopmentStubFile = generateRubyStub(gemspec, artifact, RubyDependencyType.DEVELOPMENT); gem.addFile(rubyDevelopmentStubFile, rubyDevelopmentStubPath); final File rubyMainStubFile = generateMainStub(artifact); gem.addFile(rubyMainStubFile, LIB_PATH + gemspec.getName() + ".rb" ); // write file final File gemfile = this.gemPackager.createGem(gem, target); return new GemArtifact(gemspec, gemfile); } // == protected String sanitizeStringValue(final String val) { if (val == null) { return null; } // for now, just to overcome the JRuby 1.4 Yaml parse but revealed by // this POM: // http://repo1.maven.org/maven2/org/easytesting/fest-assert/1.0/fest-assert-1.0.pom return val.replaceAll("'", "").replaceAll("\"", "").replace('\n', ' '); } protected String createLibFileName(final MavenArtifact artifact, final String postfix) { return LIB_MAVEN_PATH + createRequireName(artifact.getCoordinates().getGroupId(), artifact.getCoordinates().getArtifactId(), artifact.getCoordinates().getVersion()) + postfix; } protected String createRequireName(final String groupId, final String artifactId, final String version) { return groupId + "/" + artifactId; } protected String createJarfileName(final String groupId, final String artifactId, final String version) { return artifactId + ".jar"; } protected String createGemName(final String groupId, final String artifactId, final String version) { // TODO: think about this // return ( GEMNAME_PREFIX + groupId + GemManager.GROUP_ID_ARTIFACT_ID_SEPARATOR + artifactId ).replace( ':', '.' ); // TODO think about this harder ;-) return ( GEMNAME_PREFIX + groupId + GemManager.GROUP_ID_ARTIFACT_ID_SEPARATOR + artifactId ); } protected String getGemFileName(final String groupId, final String artifactId, final String version, final String platform) { final String gemName = createGemName(groupId, artifactId, version); final String gemVersion = createGemVersion(version); return Gem.constructGemFileName(gemName, gemVersion, platform); } protected String getGemFileName(final GemSpecification gemspec) { return Gem.constructGemFileName(gemspec.getName(), gemspec.getVersion() .getVersion(), gemspec.getPlatform()); } protected String createGemVersion(final String mavenVersion) throws NullPointerException { return this.maven2GemVersionConverter.createGemVersion(mavenVersion); } // == private File generateMainStub(MavenArtifact artifact) throws IOException { final VelocityContext context = new VelocityContext(); context.put("groupId", artifact.getCoordinates().getGroupId()); context.put("artifactId", artifact.getCoordinates().getArtifactId()); return generateRubyFile("main", context, "rubyMainStub"); } private File generateRubyMetaStub(final GemSpecification gemspec, final MavenArtifact artifact) throws IOException { final VelocityContext context = new VelocityContext(); context.put("gemVersion", gemspec.getVersion().getVersion()); context.put("groupId", artifact.getCoordinates().getGroupId()); context.put("artifactId", artifact.getCoordinates().getArtifactId()); context.put("type", artifact.getPom().getPackaging()); context.put("version", artifact.getCoordinates().getVersion()); if (artifact.getArtifactFile() != null) { context.put("filename", createJarfileName(artifact.getCoordinates() .getGroupId(), artifact.getCoordinates() .getArtifactId(), artifact.getCoordinates() .getVersion())); } final List packageParts = new ArrayList(); for (final String part : artifact.getCoordinates() .getGroupId() .split("\\.")) { packageParts.add(titleize(part)); } packageParts.add(titleize(artifact.getCoordinates().getArtifactId())); context.put("packageParts", packageParts); return generateRubyFile("metafile", context, "rubyMetaStub"); } public static class MavenDependency { public String name; public List exclusions = new ArrayList(); public String getName() { return this.name; } public String getExclusions() { final StringBuilder buf = new StringBuilder(); for (final String ex : this.exclusions) { buf.append(",'").append(ex).append("'"); } return this.exclusions.size() > 0 ? buf.substring(1) : ""; } } private File generateRubyStub(final GemSpecification gemspec, final MavenArtifact artifact, final RubyDependencyType type) throws IOException { final VelocityContext context = new VelocityContext(); switch (type) { case RUNTIME: if (artifact.getArtifactFile() != null) { context.put("jarfile", createJarfileName(artifact.getCoordinates() .getGroupId(), artifact.getCoordinates() .getArtifactId(), artifact.getCoordinates() .getVersion())); } break; case DEVELOPMENT: context.put("filename", artifact.getCoordinates().getArtifactId() + ".rb"); break; } final List deps = new ArrayList(); for (final Dependency dependency : artifact.getPom().getDependencies()) { if (RubyDependencyType.toRubyDependencyType(dependency.getScope()) == type && !dependency.isOptional()) { final MavenDependency mavenDependency = new MavenDependency(); mavenDependency.name = createRequireName(dependency.getGroupId(), dependency.getArtifactId(), dependency.getVersion()); for (final Exclusion exclusion : dependency.getExclusions()) { mavenDependency.exclusions.add(exclusion.getGroupId() + "/" + exclusion.getArtifactId()); } deps.add(mavenDependency); } } context.put("dependencies", deps); return generateRubyFile("require" + type.name(), context, "rubyStub" + type.name()); } private File generateRubyFile(final String templateName, final Context context, final String stubFilename) throws IOException { final InputStream input = getClass().getResourceAsStream("/" + templateName + ".rb.vm"); if (input == null) { throw new FileNotFoundException(templateName + ".rb.vm"); } final String rubyTemplate = IOUtil.toString(input); final File rubyFile = File.createTempFile(stubFilename, ".rb.tmp"); final FileWriter fw = new FileWriter(rubyFile); this.velocityComponent.getEngine().evaluate(context, fw, "ruby", rubyTemplate); fw.flush(); fw.close(); return rubyFile; } private String titleize(final String string) { final String[] titleParts = string.split("[-._]"); final StringBuilder titleizedString = new StringBuilder(); for (final String part : titleParts) { if (part != null && part.length() != 0) { titleizedString.append(StringUtils.capitalise(part)); } } return titleizedString.toString(); } private GemDependency convertDependency(final MavenArtifact artifact, final Dependency dependency) { final GemDependency result = new GemDependency(); result.setName(createGemName(dependency.getGroupId(), dependency.getArtifactId(), dependency.getVersion())); result.setType(RubyDependencyType.toRubyDependencyType(dependency.getScope()) .toString()); final GemRequirement requirement = new GemRequirement(); // TODO: we are adding "hard" dependencies here, but we should maybe // support Maven ranges too // based on // http://blog.zenspider.com/2008/10/rubygems-howto-preventing-cata.html final String version = createGemVersion(getDependencyVersion(artifact, dependency)); final GemVersion gemVersion; if (version.matches("^[^.]+\\.[^.]+\\..*")) { // TODO maybe just takethe first two parts gemVersion = new GemVersion(version.substring(0, version.indexOf('.')) + ".0.a"); } else { gemVersion = new GemVersion(version); } requirement.addRequirement("~>", gemVersion); result.setVersion_requirement(requirement); return result; } private String getDependencyVersion(final MavenArtifact artifact, final Dependency dependency) { if (dependency.getVersion() != null) { return dependency.getVersion(); } else if (StringUtils.equals(artifact.getCoordinates().getGroupId(), dependency.getGroupId())) { // hm, this is same groupId, let's suppose they have same // dependency! return artifact.getCoordinates().getVersion(); } else { // no help here, just interpolated POM return "unknown"; } } public File createGemspecFromArtifact(final MavenArtifact artifact, final File target) throws IOException { final GemSpecification gemspec = createSpecification(artifact); final File targetFile = new File(target, getGemFileName(gemspec) + "spec"); FileWriter writer = null; try { writer = new FileWriter(targetFile); writer.append(this.gemSpecificationIO.write(gemspec)); } finally { IOUtil.close(writer); } return targetFile; } } ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/gems/ArtifactCoordinates.java./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/gems/ArtifactCoordinate0000644000000000000000000000310112674201751030135 0ustar package de.saumya.mojo.gems; /** * This class does NOT represent full Maven2 coordinates. This is only about "primary" artifacts, that does not have * classifiers. * * @author cstamas */ public class ArtifactCoordinates { private String groupId; private String artifactId; private String version; private String extension; public ArtifactCoordinates( String groupId, String artifactId, String version ) { this( groupId, artifactId, version, "jar" ); } public ArtifactCoordinates( String groupId, String artifactId, String version, String extension ) { this.groupId = groupId; this.artifactId = artifactId; this.version = version; this.extension = extension; } protected String getGroupId() { return groupId; } protected void setGroupId( String groupId ) { this.groupId = groupId; } protected String getArtifactId() { return artifactId; } protected void setArtifactId( String artifactId ) { this.artifactId = artifactId; } protected String getVersion() { return version; } protected void setVersion( String version ) { this.version = version; } protected String getExtension() { return extension; } protected void setExtension( String extension ) { this.extension = extension; } // == public String toString() { return getGroupId() + ":" + getArtifactId() + ":" + getVersion() + ":(" + getExtension() + ")"; } } ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/gems/spec/0000755000000000000000000000000012674201751025404 5ustar ././@LongLink0000644000000000000000000000015700000000000011606 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/gems/spec/GemSpecificationIO.java./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/gems/spec/GemSpecificat0000644000000000000000000000037112674201751030033 0ustar package de.saumya.mojo.gems.spec; import java.io.IOException; public interface GemSpecificationIO { GemSpecification read( String string ) throws IOException; String write( GemSpecification gemspec ) throws IOException; } ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/gems/spec/yaml/0000755000000000000000000000000012674201751026346 5ustar ././@LongLink0000644000000000000000000000017000000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/gems/spec/yaml/YamlGemSpecificationIO.java./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/gems/spec/yaml/YamlGemS0000644000000000000000000000551712674201751027757 0ustar package de.saumya.mojo.gems.spec.yaml; import java.io.IOException; import org.codehaus.plexus.component.annotations.Component; import org.yaml.snakeyaml.Dumper; import org.yaml.snakeyaml.DumperOptions; import org.yaml.snakeyaml.Loader; import org.yaml.snakeyaml.Yaml; import org.yaml.snakeyaml.constructor.Constructor; import de.saumya.mojo.gems.spec.GemSpecification; import de.saumya.mojo.gems.spec.GemSpecificationIO; /** * This is here just be able to quickly switch between snakeYaml and YamlBeans, * since they are both good, with their own quirks. SnakeYaml won ;) So we can * clear up this later. * * @author cstamas */ @SuppressWarnings("deprecation") @Component(role = GemSpecificationIO.class, hint = "yaml") public class YamlGemSpecificationIO implements GemSpecificationIO { protected Yaml _yaml; public GemSpecification read(final String string) throws IOException { return readGemSpecfromYaml(string); } public String write(final GemSpecification gemspec) throws IOException { return writeGemSpectoYaml(gemspec); } // == protected Yaml getYaml() { if (this._yaml == null) { final Constructor constructor = new MappingConstructor(); final Loader loader = new Loader(constructor); final DumperOptions dumperOptions = new DumperOptions(); dumperOptions.setExplicitStart(true); dumperOptions.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK); dumperOptions.setDefaultScalarStyle(DumperOptions.ScalarStyle.PLAIN); final MappingRepresenter representer = new MappingRepresenter(); final Dumper dumper = new Dumper(representer, dumperOptions); this._yaml = new Yaml(loader, dumper); } return this._yaml; } protected GemSpecification readGemSpecfromYaml(final String gemspecString) throws IOException { // snake has some problems i could not overcome // return readGemSpecfromYamlWithSnakeYaml( gemspec ); // yamlbeans makes better yaml at 1st glance return readGemSpecfromYamlWithSnakeYaml(gemspecString); } protected String writeGemSpectoYaml(final GemSpecification gemspec) throws IOException { // snake has some problems i could not overcome // return writeGemSpectoYamlWithSnakeYaml( gemspec ); // yamlbeans makes better yaml at 1st glance return writeGemSpectoYamlWithSnakeYaml(gemspec); } // == SnakeYaml protected GemSpecification readGemSpecfromYamlWithSnakeYaml( final String gemspecString) throws IOException { return (GemSpecification) getYaml().load(gemspecString); } protected String writeGemSpectoYamlWithSnakeYaml( final GemSpecification gemspec) throws IOException { return getYaml().dump(gemspec); } } ././@LongLink0000644000000000000000000000016400000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/gems/spec/yaml/MappingRepresenter.java./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/gems/spec/yaml/MappingR0000644000000000000000000000233112674201751030005 0ustar package de.saumya.mojo.gems.spec.yaml; import org.yaml.snakeyaml.nodes.Node; import org.yaml.snakeyaml.nodes.Tag; import org.yaml.snakeyaml.representer.Represent; import org.yaml.snakeyaml.representer.Representer; import de.saumya.mojo.gems.spec.GemDependency; import de.saumya.mojo.gems.spec.GemRequirement; import de.saumya.mojo.gems.spec.GemSpecification; import de.saumya.mojo.gems.spec.GemVersion; /** * A helper for snakeYaml. * * @author cstamas */ public class MappingRepresenter extends Representer { public MappingRepresenter() { super(); this.nullRepresenter = new RepresentNull(); this.addClassTag(GemSpecification.class, new Tag("!ruby/object:Gem::Specification")); this.addClassTag(GemDependency.class, new Tag("!ruby/object:Gem::Dependency")); this.addClassTag(GemRequirement.class, new Tag("!ruby/object:Gem::Requirement")); this.addClassTag(GemVersion.class, new Tag("!ruby/object:Gem::Version")); } private class RepresentNull implements Represent { public Node representData(final Object data) { return representScalar(Tag.NULL, "null"); } } } ././@LongLink0000644000000000000000000000016400000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/gems/spec/yaml/MappingConstructor.java./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/gems/spec/yaml/MappingC0000644000000000000000000000205012674201751027764 0ustar package de.saumya.mojo.gems.spec.yaml; import org.yaml.snakeyaml.TypeDescription; import org.yaml.snakeyaml.constructor.Constructor; import org.yaml.snakeyaml.nodes.Tag; import de.saumya.mojo.gems.spec.GemDependency; import de.saumya.mojo.gems.spec.GemRequirement; import de.saumya.mojo.gems.spec.GemSpecification; import de.saumya.mojo.gems.spec.GemVersion; /** * A helper for snakeYaml. * * @author cstamas */ public class MappingConstructor extends Constructor { public MappingConstructor() { super(); this.addTypeDescription(new TypeDescription(GemSpecification.class, new Tag("!ruby/object:Gem::Specification"))); this.addTypeDescription(new TypeDescription(GemDependency.class, new Tag("!ruby/object:Gem::Dependency"))); this.addTypeDescription(new TypeDescription(GemRequirement.class, new Tag("!ruby/object:Gem::Requirement"))); this.addTypeDescription(new TypeDescription(GemVersion.class, new Tag("!ruby/object:Gem::Version"))); } } ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/gems/spec/GemSpecification.java./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/gems/spec/GemSpecificat0000644000000000000000000002164012674201751030035 0ustar package de.saumya.mojo.gems.spec; import java.util.ArrayList; import java.util.Date; import java.util.List; /** * Gem::Specification * * @author cstamas */ public class GemSpecification { private List authors; @Deprecated private String autorequire; private String bindir; private List cert_chain; private Date date; private String default_executable; private List dependencies; private String description; private String email; private List executables; private List extensions; private List extra_rdoc_files; private List files; private boolean has_rdoc; private String homepage; private String name; private String platform; private List rdoc_options; private List require_paths; private GemRequirement required_ruby_version; private GemRequirement required_rubygems_version; private List requirements; private String rubyforge_project; private String rubygems_version; private String specification_version; private String summary; private List test_files; private GemVersion version; private List licenses; private String post_install_message; private String signing_key; public void setAuthor(final String author) { getAuthors().add(author); } public List getAuthors() { if (this.authors == null) { this.authors = new ArrayList(); } return this.authors; } public void setAuthors(final List authors) { this.authors = authors; } @Deprecated public String getAutorequire() { return this.autorequire; } @Deprecated public void setAutorequire(final String autorequire) { this.autorequire = autorequire; } public String getBindir() { return this.bindir; } public void setBindir(final String bindir) { this.bindir = bindir; } public List getCert_chain() { if (this.cert_chain == null) { this.cert_chain = new ArrayList(); } return this.cert_chain; } public void setCert_chain(final List certChain) { this.cert_chain = certChain; } public Date getDate() { return this.date; } public void setDate(final Date date) { this.date = date; } public String getDefault_executable() { return this.default_executable; } public void setDefault_executable(final String defaultExecutable) { this.default_executable = defaultExecutable; } public List getDependencies() { if (this.dependencies == null) { this.dependencies = new ArrayList(); } return this.dependencies; } public void setDependencies(final List dependencies) { getDependencies().addAll(dependencies); } public String getDescription() { return this.description; } public void setDescription(final String description) { this.description = description; } public String getEmail() { return this.email; } public void setEmail(final String email) { this.email = email; } public List getExecutables() { if (this.executables == null) { this.executables = new ArrayList(); } return this.executables; } public void setExecutables(final List executables) { this.executables = executables; } public List getExtensions() { if (this.extensions == null) { this.extensions = new ArrayList(); } return this.extensions; } public void setExtensions(final List extensions) { this.extensions = extensions; } public List getExtra_rdoc_files() { if (this.extra_rdoc_files == null) { this.extra_rdoc_files = new ArrayList(); } return this.extra_rdoc_files; } public void setExtra_rdoc_files(final List extraRdocFiles) { this.extra_rdoc_files = extraRdocFiles; } public void addExtraRdocFile(final String extraRdocFile) { getExtra_rdoc_files().add(extraRdocFile); } public List getFiles() { if (this.files == null) { this.files = new ArrayList(); } return this.files; } public void addFile(final String file) { getFiles().add(file); } public void setFiles(final List files) { this.files = files; } public boolean isHas_rdoc() { return this.has_rdoc; } public void setHas_rdoc(final boolean hasRdoc) { this.has_rdoc = hasRdoc; } public String getHomepage() { return this.homepage; } public void setHomepage(final String homepage) { this.homepage = homepage; } public String getName() { return this.name; } public void setName(final String name) { this.name = name; } public String getPlatform() { return this.platform; } public void setPlatform(final String platform) { this.platform = platform; } public List getRdoc_options() { if (this.rdoc_options == null) { this.rdoc_options = new ArrayList(); } return this.rdoc_options; } public void setRdoc_options(final List rdocOptions) { this.rdoc_options = rdocOptions; } public List getRequire_paths() { if (this.require_paths == null) { this.require_paths = new ArrayList(); } return this.require_paths; } public void setRequire_paths(final List requirePaths) { this.require_paths = requirePaths; } public GemRequirement getRequired_ruby_version() { return this.required_ruby_version; } public void setRequired_ruby_version( final GemRequirement requiredRubyVersion) { this.required_ruby_version = requiredRubyVersion; } public GemRequirement getRequired_rubygems_version() { return this.required_rubygems_version; } public void setRequired_rubygems_version( final GemRequirement requiredRubygemsVersion) { this.required_rubygems_version = requiredRubygemsVersion; } public List getRequirements() { if (this.requirements == null) { this.requirements = new ArrayList(); } return this.requirements; } public void setRequirements(final List requirements) { this.requirements = requirements; } public String getRubyforge_project() { return this.rubyforge_project; } public void setRubyforge_project(final String rubyforgeProject) { this.rubyforge_project = rubyforgeProject; } public String getRubygems_version() { return this.rubygems_version; } public void setRubygems_version(final String rubygemsVersion) { this.rubygems_version = rubygemsVersion; } public String getSpecification_version() { return this.specification_version; } public void setSpecification_version(final String specificationVersion) { this.specification_version = specificationVersion; } public String getSummary() { return this.summary; } public void setSummary(final String summary) { this.summary = summary; } public void addTestFile(final String testFile) { getTest_files().add(testFile); } public List getTest_files() { if (this.test_files == null) { this.test_files = new ArrayList(); } return this.test_files; } public void setTest_files(final List testFiles) { this.test_files = testFiles; } public GemVersion getVersion() { return this.version; } public void setVersion(final GemVersion version) { this.version = version; } public List getLicenses() { if (this.licenses == null) { this.licenses = new ArrayList(); } return this.licenses; } public void setLicenses(final List licenses) { this.licenses = licenses; } public String getPost_install_message() { return this.post_install_message; } public void setPost_install_message(final String postInstallMessage) { this.post_install_message = postInstallMessage; } public String getSigning_key() { return this.signing_key; } public void setSigning_key(final String signingKey) { this.signing_key = signingKey; } } ././@LongLink0000644000000000000000000000015200000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/gems/spec/GemDependency.java./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/gems/spec/GemDependency0000644000000000000000000000171312674201751030040 0ustar package de.saumya.mojo.gems.spec; /** * Gem::Dependency * * @author cstamas */ public class GemDependency { private String name; private String type; private GemRequirement version_requirements; public String getName() { return name; } public void setName( String name ) { this.name = name; } public String getType() { return type; } public void setType( String type ) { this.type = type; } public GemRequirement getVersion_requirement() { return null; } public void setVersion_requirement( GemRequirement versionRequirement ) { setVersion_requirements( versionRequirement ); } public GemRequirement getVersion_requirements() { return version_requirements; } public void setVersion_requirements( GemRequirement versionRequirements ) { version_requirements = versionRequirements; } } ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/gems/spec/GemVersion.java./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/gems/spec/GemVersion.ja0000644000000000000000000000076012674201751030001 0ustar package de.saumya.mojo.gems.spec; /** * Gem::Version * * @author cstamas */ public class GemVersion { private String version; public GemVersion() { } public GemVersion(final String version) { this.version = version; } public String getVersion() { return this.version; } public void setVersion(final String version) { this.version = version; } @Override public String toString() { return this.version; } } ././@LongLink0000644000000000000000000000015300000000000011602 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/gems/spec/GemRequirement.java./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/gems/spec/GemRequiremen0000644000000000000000000000167612674201751030106 0ustar package de.saumya.mojo.gems.spec; import java.util.ArrayList; import java.util.List; /** * Gem::Requirement * * @author cstamas */ public class GemRequirement { private List requirements; private String version; public List getRequirements() { if ( requirements == null ) { requirements = new ArrayList(); } return requirements; } public void setRequirements( List requirements ) { this.requirements = requirements; } public void addRequirement( String relation, GemVersion version ) { ArrayList tupple = new ArrayList( 2 ); tupple.add( relation ); tupple.add( version ); getRequirements().add( tupple ); } public String getVersion() { return version; } public void setVersion( String version ) { this.version = version; } } ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/gems/GemArtifact.java0000644000000000000000000000117612674201751027510 0ustar package de.saumya.mojo.gems; import java.io.File; import de.saumya.mojo.gems.spec.GemSpecification; /** * The response of the converter: gempsec file and the actual File where Gem is * saved. * * @author cstamas */ public class GemArtifact { private final GemSpecification gemspec; private final File gemFile; public GemArtifact(final GemSpecification gemspec, final File gemFile) { this.gemspec = gemspec; this.gemFile = gemFile; } public GemSpecification getGemspec() { return this.gemspec; } public File getGemFile() { return this.gemFile; } } ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/gems/MavenArtifact.java0000644000000000000000000000163612674201751030047 0ustar package de.saumya.mojo.gems; import java.io.File; import org.apache.maven.model.Model; /** * This bean holds the artifact to be converted. Model should be already loaded up, to support different loading * strategies (ie. from pom.xml, from JAR itself, or using something like Maven2 support in Nexus or having real * interpolated POM). */ public class MavenArtifact { private final Model pom; private final ArtifactCoordinates coordinates; private final File artifactFile; public MavenArtifact( Model pom, ArtifactCoordinates coordinates, File artifact ) { this.pom = pom; this.coordinates = coordinates; this.artifactFile = artifact; } public Model getPom() { return pom; } protected ArtifactCoordinates getCoordinates() { return coordinates; } public File getArtifactFile() { return artifactFile; } } ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/gems/GemspecConverter.java./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/java/de/saumya/mojo/gems/GemspecConverter.j0000644000000000000000000000363112674201751030103 0ustar /** * */ package de.saumya.mojo.gems; import java.io.File; import java.io.IOException; import java.util.List; import de.saumya.mojo.ruby.Logger; import de.saumya.mojo.ruby.script.ScriptException; import de.saumya.mojo.ruby.script.ScriptFactory; public class GemspecConverter { private final ScriptFactory factory; private final Logger log; public GemspecConverter(final Logger log, final ScriptFactory factory) { this.factory = factory; this.log = log; } public void createPom(final File gemspec, final String jrubyMavenPluginsVersion, final File pom) throws ScriptException, IOException { this.factory.newScriptFromResource("gem2pom.rb") .addArg(gemspec.getAbsolutePath()) .addArg(jrubyMavenPluginsVersion) .execute(pom); } /* * this method is very problematic since you end up with metadata (version * list of an groupId-artifactId pair) on your local repository where you * might not be able to download pom/gem for the calculated version. so it * would only make sense if the all the poms are generated as well and the * gem download just passes the request on to rubygems.org. BUT the latter * is difficult since there is not a proper "file not found" coming from the * rubygems server. . . . */ public void updateMetadata(final List remoteRepositoryIds, final String localRepositoryBasedir) throws ScriptException, IOException { for (final String id : remoteRepositoryIds) { if (id.startsWith("rubygems")) { this.log.info("updating metadata for " + id); this.factory.newScriptFromResource("update_metadata.rb") .addArg(id) .addArg(localRepositoryBasedir) .execute(); } } } }./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/resources/0000755000000000000000000000000012674201751021755 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/resources/requireRUNTIME.rb.vm0000644000000000000000000000056212674201751025446 0ustar #if( $jarfile ) require File.dirname(__FILE__) + '/$jarfile' #end CHILD_EXCLUSIONS = [] unless defined? CHILD_EXCLUSIONS THIS_EXCLUSIONS = [] unless defined? THIS_EXCLUSIONS THIS_EXCLUSIONS.replace(CHILD_EXCLUSIONS) #foreach( $dep in $dependencies ) CHILD_EXCLUSIONS.replace([$dep.Exclusions]) require 'maven/$dep.Name' unless THIS_EXCLUSIONS.member?('$dep.Name') #end./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/resources/main.rb.vm0000644000000000000000000000004512674201751023646 0ustar require 'maven/$groupId/$artifactId' ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/resources/rails-resources/0000755000000000000000000000000012674201751025077 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/resources/rails-resources/config/0000755000000000000000000000000012674201751026344 5ustar ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/resources/rails-resources/config/initializers/./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/resources/rails-resources/config/initialize0000755000000000000000000000000012674201751030426 5ustar ././@LongLink0000644000000000000000000000020600000000000011601 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/resources/rails-resources/config/initializers/java_throwable_monkey_patch.rb./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/resources/rails-resources/config/initialize0000644000000000000000000000046312674201751030433 0ustar if RUBY_PLATFORM =~ /java/ class Java::JavaLang::Throwable def application_backtrace backtrace end def framework_backtrace backtrace end def clean_backtrace backtrace end def clean_message message end def blamed_files [] end end end ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/resources/rails-resources/config/web.xml0000644000000000000000000000207312674201751027645 0ustar #set( $symbol_pound = '#' ) #set( $symbol_dollar = '$' ) #set( $symbol_escape = '\' ) /index.html jruby.max.runtimes 1 jruby.min.runtimes 1 RackFilter org.jruby.rack.RackFilter RackFilter /* org.jruby.rack.rails.RailsServletContextListener ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/resources/rails-resources/src/0000755000000000000000000000000012674201751025666 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/resources/rails-resources/src/test/0000755000000000000000000000000012674201751026645 5ustar ././@LongLink0000644000000000000000000000014700000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/resources/rails-resources/src/test/resources/./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/resources/rails-resources/src/test/resource0000755000000000000000000000000012674201751030415 5ustar ././@LongLink0000644000000000000000000000016600000000000011606 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/resources/rails-resources/src/test/resources/server.keystore./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/resources/rails-resources/src/test/resource0000644000000000000000000000253112674201751030420 0ustar jetty+|(Y~%WgxבJ ۘ*qB3Fȱ,llEA@/`>(NWZ盵Mof j$x>(\b =7 ]OO$"Q(^#R5^ _*.|51 tT3"n4P9 9dIg帯0ʇݱ^%ACe$B[Q/@$q2_z~zt<u.Ğ!^aSaAٛ$:Ui~GXbc$&v̓f|t*ؗ$7Vb ϋ11g׿^gL2Mz?jF?06G|Z5%oLDo,Sd,hUӈv6SZfڳX/zع^mG.br\M3:X-}_{gX2IpyGE'ڪJtRSdW{MCuYin4aR" Bq-݊s_nG٢.:6t;m1g$#)-gR>^ἨtzExm~1*2M5JN em6xYէ&Hd4%;N X.509W0S0L0  *H 0n10UUnknown10UUnknown10UUnknown10U Unknown10U Unknown10U localhost0 101028210538Z 110126210538Z0n10UUnknown10UUnknown10UUnknown10U Unknown10U Unknown10U localhost00  *H 0 i]^f2s'O?:v·zKBOg@Z>o $wS)]Y LKq^[;A=rI ߏΉ.65h 0  *H PaPQ@EEϾ*$u߰tR.P'{Wz:打bCC{脱Iܒ8W<<{{1[NH0w9Ci./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/resources/rails-resources/src/main/0000755000000000000000000000000012674201751026612 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/resources/rails-resources/src/main/webapp/0000755000000000000000000000000012674201751030070 5ustar ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/resources/rails-resources/src/main/webapp/index.html./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/resources/rails-resources/src/main/webapp/i0000644000000000000000000002214212674201751030244 0ustar #set( $symbol_dollar = '$' ) Ruby on Rails: Welcome aboard

    Getting started

    Here’s how to get rolling:

    1. Use mvn rails${railsVersion.substring(0,1)}:generate to create your models and controllers

      To see all available options, run it without parameters.

      example:
      mvn rails${railsVersion.substring(0,1)}:generate -Dargs="scaffold user name:string"

    2. Set up a default route and remove or rename this file

      Routes are set up in config/routes.rb.

    3. Create your database

      mvn rails${railsVersion.substring(0,1)}:rake -Dargs="db:create db:migrate"
      will to create your database. If you're not using SQLite (the default), edit config/database.yml with your username and password.

      For production use mvn rails${railsVersion.substring(0,1)}:rake -Dargs="db:create db:migrate" -Drails.env=production

    4. Start embedded servlet-engine

      Run mvn jetty:run and find the generated users resource here - jetty runs on port 8080 !

      For production mvn jetty:run -Drails.env=production

    5. Start default ruby server (webrick)

      mvn rails${railsVersion.substring(0,1)}:server

      Find the users resource here - webrick runs on port 3000 !

      For production mvn rails${railsVersion.substring(0,1)}:server -Drails.env=production

    6. Package your war file

      mvn package -Drails.env=production will produce a war file for production in the directory target.

      run jetty with the production warfile
      mvn jetty:run-war -Drails.env=production

    7. Running the tests or specs

      mvn -Drails.env=test

      after migrating the new tables with
      mvn rails3:rake -Dargs=db:migrate -Drails.env=test

    8. More help for maven goals

      mvn rails${railsVersion.substring(0,1)}:help for rails specific goals.

      mvn gem:help for rubygems specific goals.

    ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/resources/rails-resources/public/0000755000000000000000000000000012674201751026355 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/resources/rails-resources/public/maven.html0000644000000000000000000002214212674201751030352 0ustar #set( $symbol_dollar = '$' ) Ruby on Rails: Welcome aboard

    Getting started

    Here’s how to get rolling:

    1. Use mvn rails${railsVersion.substring(0,1)}:generate to create your models and controllers

      To see all available options, run it without parameters.

      example:
      mvn rails${railsVersion.substring(0,1)}:generate -Dargs="scaffold user name:string"

    2. Set up a default route and remove or rename this file

      Routes are set up in config/routes.rb.

    3. Create your database

      mvn rails${railsVersion.substring(0,1)}:rake -Dargs="db:create db:migrate"
      will to create your database. If you're not using SQLite (the default), edit config/database.yml with your username and password.

      For production use mvn rails${railsVersion.substring(0,1)}:rake -Dargs="db:create db:migrate" -Drails.env=production

    4. Start embedded servlet-engine

      Run mvn jetty:run and find the generated users resource here - jetty runs on port 8080 !

      For production mvn jetty:run -Drails.env=production

    5. Start default ruby server (webrick)

      mvn rails${railsVersion.substring(0,1)}:server

      Find the users resource here - webrick runs on port 3000 !

      For production mvn rails${railsVersion.substring(0,1)}:server -Drails.env=production

    6. Package your war file

      mvn package -Drails.env=production will produce a war file for production in the directory target.

      run jetty with the production warfile
      mvn jetty:run-war -Drails.env=production

    7. Running the tests or specs

      mvn -Drails.env=test

      after migrating the new tables with
      mvn rails3:rake -Dargs=db:migrate -Drails.env=test

    8. More help for maven goals

      mvn rails${railsVersion.substring(0,1)}:help for rails specific goals.

      mvn gem:help for rubygems specific goals.

    ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/resources/metafile.rb.vm0000644000000000000000000000055212674201751024513 0ustar module Maven #foreach( $part in $packageParts ) module $part #end VERSION = '$gemVersion' MAVEN_VERSION = '$version' MAVEN_ARTIFACT_ID = '$artifactId' MAVEN_GROUP_ID = '$groupId' MAVEN_TYPE = '$type' MAVEN_CLASSIFIER = nil #if( $filename ) JAR_FILE = File.dirname(__FILE__) + '/$filename' #else JAR_FILE = nil #end #foreach( $part in $packageParts ) end #end end./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/resources/META-INF/0000755000000000000000000000000012674201751023115 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/resources/META-INF/plexus/0000755000000000000000000000000012674201751024435 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/resources/META-INF/plexus/components.xml0000644000000000000000000000747512674201751027361 0ustar de.saumya.mojo.ruby.gems.GemManager de.saumya.mojo.ruby.gems.DefaultGemManager org.apache.maven.repository.RepositorySystem default repositorySystem org.apache.maven.artifact.repository.metadata.RepositoryMetadataManager default repositoryMetadataManager org.apache.maven.project.ProjectBuilder default builder de.saumya.mojo.ruby.rails.RailsManager de.saumya.mojo.ruby.rails.DefaultRailsManager org.apache.maven.repository.RepositorySystem default repositorySystem org.apache.maven.project.ProjectBuilder default builder org.codehaus.plexus.velocity.VelocityComponent default velocityComponent org.codehaus.plexus.logging.Logger default logger de.saumya.mojo.gems.MavenArtifactConverter de.saumya.mojo.gems.DefaultMavenArtifactConverter org.codehaus.plexus.velocity.VelocityComponent default velocityComponent de.saumya.mojo.gems.gem.GemPackager default gemPackager de.saumya.mojo.gems.spec.GemSpecificationIO yaml gemSpecificationIO de.saumya.mojo.gems.spec.GemSpecificationIO yaml de.saumya.mojo.gems.spec.yaml.YamlGemSpecificationIO de.saumya.mojo.gems.gem.GemPackager de.saumya.mojo.gems.gem.DefaultGemPackager de.saumya.mojo.gems.spec.GemSpecificationIO yaml gemSpecificationIO org.codehaus.plexus.velocity.VelocityComponent org.codehaus.plexus.velocity.DefaultVelocityComponent runtime.log.logsystem.class org.codehaus.plexus.velocity.Log4JLoggingSystem runtime.log.logsystem.log4j.category org.codehaus.plexus.velocity.DefaultVelocityComponent resource.loader classpath classpath.resource.loader.class org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/resources/META-INF/jruby.home/0000755000000000000000000000000012674201751025177 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/resources/META-INF/jruby.home/bin/0000755000000000000000000000000012674201751025747 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/resources/META-INF/jruby.home/bin/rake0000644000000000000000000000056112674201751026616 0ustar #!/usr/bin/env jruby # # This file was generated by RubyGems. # # The application 'rake' is installed as part of a gem, and # this file is here to facilitate running it. # require 'rubygems' version = ">= 0" if ARGV.first =~ /^_(.*)_$/ and Gem::Version.correct? $1 then version = $1 ARGV.shift end gem 'rake', version load Gem.bin_path('rake', 'rake', version) ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/resources/requireDEVELOPMENT.rb.vm0000644000000000000000000000053612674201751026106 0ustar require File.dirname(__FILE__) + '/$filename' CHILD_EXCLUSIONS = [] unless defined? CHILD_EXCLUSIONS THIS_EXCLUSIONS = [] unless defined? THIS_EXCLUSIONS THIS_EXCLUSIONS.replace(CHILD_EXCLUSIONS) #foreach( $dep in $dependencies ) CHILD_EXCLUSIONS.replace([$dep.Exclusions]) require 'maven/$dep.Name' unless THIS_EXCLUSIONS.member?('$dep.Name') #end./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/resources/rails-templates/0000755000000000000000000000000012674201751025063 5ustar ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/resources/rails-templates/datamapper/0000755000000000000000000000000012674201751027201 5ustar ././@LongLink0000644000000000000000000000015000000000000011577 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/resources/rails-templates/datamapper/config.rb./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/resources/rails-templates/datamapper/config0000644000000000000000000000123212674201751030367 0ustar # original file from https://github.com/datamapper/datamapper.github.com gsub_file 'config/application.rb', /require 'rails\/all'/ do <<-RUBY # Pick the frameworks you want: require 'action_controller/railtie' require 'dm-rails/railtie' # require 'action_mailer/railtie' # require 'active_resource/railtie' # require 'rails/test_unit/railtie' RUBY end gsub_file 'config/environments/development.rb', /config.action_mailer.raise_delivery_errors = false/ do "# config.action_mailer.raise_delivery_errors = false" end gsub_file 'config/environments/test.rb', /config.action_mailer.delivery_method = :test/ do "# config.action_mailer.delivery_method = :test" end ././@LongLink0000644000000000000000000000015100000000000011600 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/resources/rails-templates/datamapper/gemfile.rb./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/resources/rails-templates/datamapper/gemfil0000644000000000000000000000472212674201751030374 0ustar # original file from https://github.com/datamapper/datamapper.github.com # workaround <<-GEMFILE wanting to # execute the string subsitution DATAMAPPER = '#{DATAMAPPER}' RSPEC = '#{RSPEC}' database = options[:database].sub(/jdbc/, '') database = 'postgres' if database == 'postgresql' database = 'sqlite' if database == 'sqlite3' if Rails::VERSION::MAJOR > 3 || Rails::VERSION::MINOR > 0 rhino_gem_line = < 'active_support' gem 'actionpack', RAILS_VERSION, :require => 'action_pack' gem 'actionmailer', RAILS_VERSION, :require => 'action_mailer' gem 'railties', RAILS_VERSION, :require => 'rails' gem 'dm-rails', '~> 1.1.0' gem 'dm-#{database}-adapter', DM_VERSION # You can use any of the other available database adapters. # This is only a small excerpt of the list of all available adapters # Have a look at # # http://wiki.github.com/datamapper/dm-core/adapters # http://wiki.github.com/datamapper/dm-core/community-plugins # # for a rather complete list of available datamapper adapters and plugins # gem 'dm-sqlite-adapter', DM_VERSION # gem 'dm-mysql-adapter', DM_VERSION # gem 'dm-postgres-adapter', DM_VERSION # gem 'dm-oracle-adapter', DM_VERSION # gem 'dm-sqlserver-adapter', DM_VERSION gem 'dm-migrations', DM_VERSION gem 'dm-types', DM_VERSION gem 'dm-validations', DM_VERSION gem 'dm-constraints', DM_VERSION gem 'dm-transactions', DM_VERSION gem 'dm-aggregates', DM_VERSION gem 'dm-timestamps', DM_VERSION gem 'dm-observer', DM_VERSION group(:development, :test) do # Uncomment this if you want to use rspec for testing your application # gem 'rspec-rails', '~> 2.0.1' # To get a detailed overview about what queries get issued and how long they take # have a look at rails_metrics. Once you bundled it, you can run # # rails g rails_metrics Metric # rake db:automigrate # # to generate a model that stores the metrics. You can access them by visiting # # /rails_metrics # # in your rails application. # gem 'rails_metrics', '~> 0.1', :git => 'git://github.com/engineyard/rails_metrics' end #{rhino_gem_line} GEMFILE end ././@LongLink0000644000000000000000000000015600000000000011605 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/resources/rails-templates/datamapper/database.yml.rb./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/resources/rails-templates/datamapper/databa0000644000000000000000000000173712674201751030350 0ustar # original file from https://github.com/datamapper/datamapper.github.com # TODO think about a better way db_name = app_path.split('/').last database = options[:database].sub(/jdbc/, '') database = 'postgres' if database == 'postgresql' database = 'sqlite' if database == 'sqlite3' prefix = '' postfix = '' prefix = 'db/' if database == 'sqlite' postfix = '.db' if database == 'sqlite' remove_file 'config/database.yml' create_file 'config/database.yml' do <<-YAML defaults: &defaults adapter: #{database} development: database: #{prefix}#{db_name}_development#{postfix} <<: *defaults # Add more repositories # repositories: # repo1: # adapter: postgres # database: sample_development # username: the_user # password: secrets # host: localhost # repo2: # ... test: database: #{prefix}#{db_name}_test#{postfix} <<: *defaults production: database: #{prefix}#{db_name}_production#{postfix} <<: *defaults YAML end ././@LongLink0000644000000000000000000000015500000000000011604 Lustar rootroot./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/resources/rails-templates/datamapper/application.rb./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/resources/rails-templates/datamapper/applic0000644000000000000000000000501212674201751030372 0ustar # original file from https://github.com/datamapper/datamapper.github.com # This needs to be called after one of the gemfile templates path = File.dirname(__FILE__) apply "#{path}/config.rb" apply "#{path}/database.yml.rb" inject_into_file 'app/controllers/application_controller.rb', "require 'dm-rails/middleware/identity_map'\n", :before => 'class ApplicationController' inject_into_class 'app/controllers/application_controller.rb', 'ApplicationController', " use Rails::DataMapper::Middleware::IdentityMap\n" initializer 'jruby_monkey_patch.rb', <<-CODE if RUBY_PLATFORM =~ /java/ # ignore the anchor to allow this to work with jruby: # http://jira.codehaus.org/browse/JRUBY-4649 class Rack::Mount::Strexp class << self alias :compile_old :compile def compile(str, requirements, separators, anchor) self.compile_old(str, requirements, separators) end end end end CODE say '' say '---------------------------------------------------------------------------' say "Edit your Gemfile (do not forget to run 'bundle install' after doing that)" say "Some of the following commands assume that you passed the --binstubs option" say "to bundle install. If you haven't done so, use 'bundle exec rake' where the" say "examples below use './bin/rake'" say '---------------------------------------------------------------------------' say 'If you want to use rspec for testing, you first need to uncomment the line' say "that declares it in the Gemfile. The you need to run 'bundle install' again" say "Once that's done, you need to actually install it into your app and update" say "your spec_helper as shown in the dm-rails README" say '---------------------------------------------------------------------------' say 'Install rspec (optional): rails g rspec:install' say 'Have a look at the dm-rails README: http://github.com/datamapper/dm-rails' say '---------------------------------------------------------------------------' say 'Have a look at available rake tasks: ./bin/rake -T' say 'Generate a simple scaffold: rails g scaffold Person name:string' say 'Create, automigrate and seed the DB: ./bin/rake db:setup' say 'Start the server: rails server' say '---------------------------------------------------------------------------' say 'After the sever booted, point your browser at http://localhost:3000/people' say '---------------------------------------------------------------------------' say '' ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/resources/rails-templates/datamapper.rb0000644000000000000000000000027212674201751027527 0ustar # original file from https://github.com/datamapper/datamapper.github.com path = File.join(File.dirname(__FILE__), 'datamapper') apply "#{path}/gemfile.rb" apply "#{path}/application.rb" ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/resources/rails-templates/templates.rb0000644000000000000000000000042112674201751027403 0ustar base = java.lang.System.getProperty('maven.rails.basetemplate') extra = java.lang.System.getProperty('maven.rails.extratemplate') apply "#{base}" if base if gwt = java.lang.System.getProperty('maven.rails.gwt') gem 'resty-generators' end apply "#{extra}" if extra ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/src/main/resources/rails-templates/activerecord.rb0000644000000000000000000000464112674201751030067 0ustar db_gem_line = "gem '#{gem_for_database}'" db_gem_regexp = Regexp::quote(db_gem_line).gsub("'", "['\"]") jdbc_db = case options[:database] when /postgresql/ "postgres" when /mysql2/ "mysql" when /mysql|sqlite3/ options[:database] end jdbc_gem_line = jdbc_db != 'sqlite3' ? "\n gem 'jdbc-#{jdbc_db}', :require => false" : < false # Derby JDBC adapter #gem 'activerecord-jdbcderby-adapter' # HSQL JDBC adapter #gem 'activerecord-jdbchsqldb-adapter' # H2 JDBC adapter #gem 'activerecord-jdbch2-adapter' # SQL Server JDBC adapter #gem 'activerecord-jdbcmssql-adapter' JDBC if Rails::VERSION::MINOR > 0 rhino_gem_line = < # password: # hostname: localhost # database: dummy # If you are using oracle, db2, sybase, informix or prefer to use the plain # JDBC adapter, configure your database setting as the example below (requires # you to download and manually install the database vendor's JDBC driver .jar # file). See your driver documentation for the apropriate driver class and # connection string: # #development: # adapter: jdbc # username: # password: # driver: com.ibm.db2.jcc.DB2Driver # url: jdbc:db2://localhost:5021/dummy COMMENTS temp = IO.read(file) open(file, "w") { |f| f << comment << temp } ./jruby-maven-plugins-1.1.5.ds1.orig/ruby-tools/pom.xml0000644000000000000000000001463112674201751017552 0ustar 4.0.0 jruby-maven-plugins de.saumya.mojo 1.1.5 ruby-tools 1.1.5 Ruby Tools org.jruby jruby-complete ${jruby.version} true org.apache.ant ant 1.9.4 org.codehaus.plexus plexus-velocity 1.1.8 org.codehaus.plexus plexus-component-annotations ${plexus.version} org.codehaus.plexus plexus-container-default ${plexus.version} test org.codehaus.plexus plexus-classworlds 2.2.3 org.codehaus.plexus plexus-utils 2.0.5 org.apache.maven maven-model ${maven.version} org.codehaus.plexus plexus-archiver 3.0 org.yaml snakeyaml 1.14 org.apache.maven maven-core ${maven.version} true 1.5.6,1.6.5.1,1.6.7.2,1.7.0.preview1 true 1.5.4 ${basedir}/.. ${root.dir}/target/rubygems ${root.dir}/target/rubygems ${basedir}/src/main/resources maven-dependency-plugin 2.8 copy jruby generate-resources copy org.jruby jruby-complete ${jruby.version} false ${project.build.directory} copy gems generate-resources copy-dependencies gem org.codehaus.mojo exec-maven-plugin 1.2 install gems process-resources exec java -jar ${project.build.directory}/jruby-complete-${jruby.version}.jar ${basedir}/src/main/scripts/install_gems.rb org.eclipse.m2e lifecycle-mapping 1.0.0 org.codehaus.mojo exec-maven-plugin [1.2,) exec build ../jruby-maven-plugin rubygems-releases http://rubygems-proxy.torquebox.org/releases rubygems maven-tools 1.0.9 gem provided