Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mguymon committed Sep 2, 2012
1 parent 4dd8a03 commit 3c7fb2e
Show file tree
Hide file tree
Showing 6 changed files with 136 additions and 69 deletions.
2 changes: 1 addition & 1 deletion README.md
@@ -1,6 +1,6 @@
# Solr Sail

Solr Search fresh from the can
From zero to search in the flash of a gem.

## Install

Expand Down
6 changes: 3 additions & 3 deletions Rakefile
Expand Up @@ -49,7 +49,7 @@ namespace :solr_sail do
FileUtils.copy( 'VERSION', "target/gem/VERSION" )

version = IO.read('VERSION').strip
FileUtils.copy( "target/solrsail-#{version}.jar", "target/gem/solrsail-#{version}.jar" )
FileUtils.copy( "target/solr_sail-#{version}.jar", "target/gem/solr_sail-#{version}.jar" )

# Change dir so relevant files have the correct paths
Dir.chdir( "target/gem" )
Expand Down Expand Up @@ -86,8 +86,8 @@ Jeweler::Tasks.new do |gem|
gem.platform = "java"
gem.homepage = "http://github.com/mguymon/solr_sail"
gem.license = "MIT"
gem.summary = %Q{Solr Server for JRuby}
gem.description = %Q{Solr Server for JRuby}
gem.summary = %Q{From zero to search in the flash of a gem.}
gem.description = %Q{From zero to search in the flash of a gem.}
gem.email = "michael@tobedevoured.com"
gem.authors = ["Michael Guymon"]
gem.require_paths = %w[lib]
Expand Down
148 changes: 84 additions & 64 deletions pom.xml
Expand Up @@ -3,12 +3,41 @@
<modelVersion>4.0.0</modelVersion>

<groupId>com.tobedevoured</groupId>
<artifactId>solrsail</artifactId>
<artifactId>solr_sail</artifactId>
<version>0.0.1</version>
<packaging>jar</packaging>

<name>Solr Sail</name>
<url>https://github.com/mguymon/solr_sail</url>
<description>
Solr Search fresh from the can
</description>
<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<url>scm:git:git@github.com/mguymon/by_your_command.git</url>
<developerConnection>scm:git:git@github.com/mguymon/by_your_command.git</developerConnection>
<connection>git@github.com/mguymon/by_your_command.git</connection>
</scm>
<developers>
<developer>
<id>mguymon</id>
<name>Michael Guymon</name>
<email>michael@tobedevoured.com</email>
</developer>
</developers>
<distributionManagement>
<repository>
<id>nexus-releases</id>
<name>Nexus Release Repository</name>
<url>http://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>

<repositories>
<repository>
Expand All @@ -27,7 +56,7 @@
<dependency>
<groupId>com.tobedevoured.command</groupId>
<artifactId>core</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>0.0.1</version>
</dependency>

<!-- Jetty -->
Expand Down Expand Up @@ -83,6 +112,8 @@
<version>1.0.6</version>
</dependency>



<!-- Testing -->
<dependency>
<groupId>junit</groupId>
Expand All @@ -91,66 +122,55 @@
<scope>test</scope>
</dependency>
</dependencies>


<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>false</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>


<build>
<plugins>
<!-- <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId>
<version>1.7.1</version> <executions> <execution> <phase>package</phase>
<goals> <goal>shade</goal> </goals> <configuration> <filters> <filter> <artifact>*:*</artifact>
<excludes> <exclude>META-INF/*.SF</exclude> <exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude> </excludes> </filter> </filters> <transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>com.tobedevoured.command.Runner</mainClass> </transformer> </transformers>
</configuration> </execution> </executions> </plugin> -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
9 changes: 9 additions & 0 deletions src/main/java/com/tobedevoured/solrsail/JettyServer.java
Expand Up @@ -19,6 +19,7 @@
/**
* Jetty Server
*
* @author Michael Guymon
*/
@ByYourCommand
public class JettyServer {
Expand All @@ -28,13 +29,21 @@ public class JettyServer {
private String contextPath;
private int port;

/**
* Create new instance
*/
public JettyServer() {
Config config = ConfigFactory.load();
solrHome = config.getString("solrsail.solr.home");
port = config.getInt("solrsail.solr.port");
contextPath = config.getString("solrsail.solr.contextpath");
}

/**
* Start Jetty
*
* @throws Exception
*/
@Command
public void start() throws Exception {

Expand Down
38 changes: 38 additions & 0 deletions src/main/java/com/tobedevoured/solrsail/SolrConfig.java
Expand Up @@ -26,16 +26,30 @@
import com.typesafe.config.Config;
import com.typesafe.config.ConfigFactory;

/**
* Solr Config Helper
*
* @author Michael Guymon
*
*/
@ByYourCommand
public class SolrConfig {
private static Logger logger = LoggerFactory.getLogger( SolrConfig.class );

private String solrHome;

/**
* Create new instance
*/
public SolrConfig() {
loadDefaultConfig();
}

/**
* Create new instance
*
* @param solrHome String path
*/
public SolrConfig( String solrHome ) {
if ( solrHome != null ) {
this.solrHome = solrHome;
Expand All @@ -44,6 +58,9 @@ public SolrConfig( String solrHome ) {
}
}

/**
* Load config from TypeSafe {@link ConfigFactory#load()}
*/
public void loadDefaultConfig() {
Config config = ConfigFactory.load();
solrHome = config.getString("solrsail.solr.home");
Expand Down Expand Up @@ -101,6 +118,12 @@ public Set<String> findSolrInClasspath() throws IOException {
return scanner.scan( "solr" );
}

/**
* Install Solr Config to the local file system
*
* @throws IOException
* @throws URISyntaxException
*/
@Command
public void install() throws IOException, URISyntaxException {
File jar = new File( this.getClass().getProtectionDomain().getCodeSource().getLocation().toURI() );
Expand All @@ -112,12 +135,27 @@ public void install() throws IOException, URISyntaxException {
}
}

/**
* Install Solr Config t the local file system by extracting from the
* SolrSail jar
*
* @param jar String path
* @throws IOException
* @throws URISyntaxException
*/
@Command
@CommandParam(name = "jar", type = String.class)
public void installFromJar( String jar ) throws IOException, URISyntaxException {
installFromJar( new File( jar ) );
}

/**
* Install Solr Config t the local file system by extracting from the
* SolrSail jar
*
* @param jar File
* @throws IOException
*/
public void installFromJar( File jar ) throws IOException {
logger.info( "Installing config from Jar to {}", this.getSolrHome() );
logger.debug( "Opening Jar {}", jar.toString() );
Expand Down
2 changes: 1 addition & 1 deletion src/main/ruby/solr_sail.rb
Expand Up @@ -4,7 +4,7 @@

module SolrSail
@@version = IO.read("VERSION").strip
@@jar = File.expand_path("#{File.dirname(__FILE__)}/../solrsail-#{@@version}.jar")
@@jar = File.expand_path("#{File.dirname(__FILE__)}/../solr_sail-#{@@version}.jar")
@@lockfile = File.expand_path("#{File.dirname(__FILE__)}/../Jarfile.lock")

def self.version
Expand Down

0 comments on commit 3c7fb2e

Please sign in to comment.