new

install
gem install new
new init
Create a new project
new [TEMPLATE] [NAME]
Release a new version
new release

Templates

Templates represent a boilerplate directory & file structure preconfigured for a given project type. (eg js, ruby, gem, rails, etc.)

Tasks

Tasks represent a process associated with releasing new code. Tasks are run in order they are listed in the project .new configuration file.

Local Config/Templates/Tasks

After running new init, you will have .new folder in your home directory. This directory contains:

Copy or create custom templates & tasks in these folders. They will take precendence over the default templates included with the gem.

Make sure to edit your local configuration file!

# ~/.new/.new

license: MIT
developer:
  name: Foo Bar
  email: foo@bar.com
templates:
  foo_template:
    custom: option
tasks:
  github:
    username: foouser

Custom Templates

# ~/.new/templates/foo_template/.new

foo: bar
tasks:
  foo_task:
  bar_task:
    baz: 'baz'

Note: the tasks are followed by a colon : whether they have options or not.

Interpolation

Use ERB template syntax in your files to interpolate template options. Make sure to add .erb to the end of the filename.

You can also access any custom values set in your local configuration file.

<%# ~/.new/templates/foo_template/foo.txt.erb %>

<%= license %>
<%= developer.name %>
<%= developer.email %>
<%= type %>
<%= project_name %>
<%= foo %>
<%= tasks.bar_task.baz %>

You can also interpolate directory and filenames using the syntax foo_[DEVELOPER.NAME].txt

Note using the dot notation to access nested attributes.

Custom Tasks

# ~/.new/tasks/foo_task/foo_task.rb

class New::Task::FooTask < New::Test
  include New::Interpolate  # if you need to interpolate files
  include New::version      # if you need to set & manage a semantic version

  # defaults for required options
  OPTION = {
    foo: 'bar'
  }

  # required `run` method
  def run
    # do task stuff here

    access
    # access task options from the `options` object
    # access all project options from the `project_options` object
  end
end

TODO

Contributing

  1. Fork it ( github.com/brewster1134/new/fork )

  2. Create your feature branch (git checkout -b my-new-feature)

  3. Commit your changes (git commit -am 'Add some feature')

  4. Push to the branch (git push origin my-new-feature)

  5. Create new Pull Request