one-time-use rugs
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.atomist
.atomist.yml
.gitignore
LICENSE
README.md
pom.xml

README.md

scattered-rugs

an assortment of rugs I at-least-once found useful locally

These rugs aren't published; I use them in local mode. (instructions here)

Make your own repo like this

I created this repository by clicking a button on this rug archive page. This button: Get Started with Atomist

I also used a few common editors on this archive, like so:

rug edit atomist-rugs:common-editors:AddReadme project_name=scattered-rugs description="an assortment of rugs I at-least-once found useful locally"

rug edit atomist-rugs:common-editors:AddApacheSoftwareLicense20

Or you can clone this one, whatever.

Run the editors in local mode

You'll need the rug cli:

brew tap atomist/tap
brew install rug-cli

And then I go to this project directory (on my local computer, and run editors like this:

rug edit -lRC ~/code/target-project-dir MakeExecutableJar main_class=com.jessitron.target_project.Main

Here, the -l says "use the local files in this local rug archive I'm sitting in". You can be in the .atomist directory, or the project directory that contains .atomist, or anywhere underneath.

The -R says "make a commit" in the target project. Saves me the trouble, and keeps my automated changes separate from handcrafted ones.

The -C says "here comes the path to the target project" so the next argument is the path to the project to change.

Then MakeExecutableJar is the name of my editor. Since I'm in local mode I don't have to specify its org or repo.

Finally, parameter=value gives my editor the info it needs.

Available editors

AddScalaPom

bring a toy Scala project into the big-time by adding a pom.xml. Then you can build it using mvn, and do even more amazing things by running other editors, like MakeExecutableJar.

This editor creates the simplest Pom that will compile Scala.

Give it a group_id (like com.jessitron) and an artifact_id (like org-dep-graph).

Code

from a clone of this repo: rug edit -lRC ~/code/target-project-dir AddScalaPom group_id=com.you artifact_id=toy-program

BringInScalatest

Add the POM dependencies for scalatest, along with the build plugin to run them and the build plugin to skip the Java test phase.

from a clone of this repo: rug edit -lRC ~/code/target-project-dir BringInScalatest

MakeExecutableJar

turn a JVM + maven project into one I can run from a shell command line. (For Windows you'd need a different script, sorry.)

parameters: main class to run

rug edit -lRC ~/code/target-project-dir MakeExecutableJar main_class=com.jessitron.target_project.Main

After running this editor, I make the newly-created script executable: in my project directory: chmod u+x bin/run and then I link it into my path: in my local ~/bin (or anywhere in $PATH): ln -s ~/path/to/target-project-dir/bin/run target-project-name