# Jumpup

![Build Status]][travis
![RubyGems]][ruby_gems

Jumpup is a gem that provides a set of tasks to automate all steps of a [synchronous continuous integration] process for [Ruby on Rails] apps, that is, [continuous integration] without a server such as [Travis].

## Why?

Because that’s the way [we] like it!

## Installation

Add the gem to the ‘development` section of your `Gemfile` and run `bundle install`:

“‘ruby group :development do

gem 'jumpup'

end “‘

## Usage

After installing the gem, you’ll need to configure the set of tasks you’ll want to run as part of your integration process before using it. The configuration is done by setting an array of Rake task names as the ‘INTEGRATION_TASKS` constant on your `lib/tasks/jumpup.rake`. For example:

“‘ruby INTEGRATION_TASKS = %w(

jumpup:start
jumpup:bundle_install
db:migrate
spec
jumpup:finish

) “‘

With that in place, you can execute a single task in order to integrate your code safely:

“‘ rake integrate “`

For more information, please have a look at the “[Integration Steps](#integration-steps)” section below.

## Plugins

  • jumpup-heroku][jumpup-heroku
  • jumpup-hipchat][jumpup-hipchat

## Dependencies

  • Git

  • Rcov][rc

    (Ruby 1.8) or [Simplecov] (Ruby 1.9+) (optional)

## [ProTip] Using Simplecov

Using Simplecov on your test suite will make your tests run slower. You can fix it using an environment variable called ‘coverage` on your test / spec helper files to enable Simplecov when needed like:

“‘ruby # On your spec_helper.rb / test_helper.rb if ENV == ’on’

require 'simplecov'
SimpleCov.start 'rails'

end “‘

The ‘coverage` variable is set to “on” automatically by the integration process. When running tests while you’re developing, Simplecov will not run unless you set the ‘coverage` environment variable yourself.

## Integration Steps

The integration process is composed of several Rake tasks that are explained below. It’s possible to skip one or more steps and add other steps of your own. The complete set of tasks we normally use are:

| Rake Task | Description | | ——— | ———– | | ‘jumpup:integration:check` | Check if other user is already integrating, to avoid reject message from git after runing all tests. | | `jumpup:integration:lock` | Lock the integration to current user. | | `git:status_check` | Check if all local files have been commited to the local git repository. | | `log:clear` | Remove log files. | | `tmp:clear` | Remove temporary files. | | `git:pull` | Update local files from the remote git repository. | | `jumpup:start` | Run all the previous tasks on this order | | `jumpup:bundle_install` | Run `bundle install` on quiet mode | | `db:migrate` | Execute any new database migration created by other team members since the last integration. | | `test` or `spec` | Set the rake task your test/spec suite needs to run. Use a command that generate the coverage files. | | `git:push` | Push your changes. If any of the previous tasks break, because one test failed, for instance, the script won’t push. Actually this task runs only if every checking done before work well. | | ‘jumpup:integration:unlock` | Unlock the integration to current user. | | `jumpup:finish` | Run tasks: `git:push` and `jumpup:integration:unlock` |

Using this almost paranoid sequence of steps it will be hard to check in bad code in your repository, which is good, very good. The idea is that you should treat your repository as a sacred place, where only good code should ever enter.

### More examples

#### Reckless programmer

Let’s say your project don’t have tests but you still want to use jumpup. You might get away with this ‘lib/tasks/jumpup.rake`:

“‘ruby INTEGRATION_TASKS = %w(

jumpup:start
jumpup:bundle_install
db:migrate
jumpup:finish

) “‘

The fact that you can get away with this doesn’t mean you should. Don’t you think it’s already time to grow up and become more professional about software development? I know you believe you have a great excuse to avoid writing those tests. Still it’s just an excuse. Write tests and make a better world!

#### Test conscious programmer

You haven’t jumped on the [BDD] bandwagon yet. Instead, you write tests, which is good, but they don’t cover all of your code yet, which is bad. We believe you will improve it and make sure your tests cover 100% of your code. In the meantime you might need to skip coverage checkings. Try this:

“‘ruby INTEGRATION_TASKS = %w(

jumpup:start
jumpup:bundle_install
db:migrate
spec
jumpup:finish

) “‘

#### Spec infected programmer

So you used to [TDD] all around but then someone told you that this is for gramma. The new wave has a name on it: [BDD]. So, of course, you now have specs covering 100% of your code and doesn’t have any more tests. Great! Just change your test_helper.rb/spec_helper.rb with:

“‘ruby require ’simplecov’ SimpleCov.start ‘rails’ do

minimum_coverage 100

end “‘

## Versioning

Jumpup follows the [Semantic Versioning](semver.org/).

## Issues

If you have problems, please create a [Github Issue](github.com/Helabs/jumpup/issues).

## Contributing

Please see [CONTRIBUTING.md](github.com/Helabs/jumpup/blob/master/CONTRIBUTING.md) for details.

## Release

Follow this steps to release a new version of the gem.

  1. Test if everything is running ok;

  2. Change version of the gem on ‘VERSION` constant;

  3. Add the release date on the ‘CHANGELOG`;

  4. Do a commit “Bump version x.x.x”, follow the semantic version;

  5. Run ‘$ rake release`, this will send the gem to the rubygems;

  6. Check if the gem is on the rubygems and the tags are correct on the github;

## License

This code is free to be used under the terms of the [MIT license].

## Contact

Comments are welcome.

## Maintainers

## Authors

Jumpup came from the idea of [integration](github.com/tapajos/integration). Thanks to [Improve It] and the original authors:

  • Marcos Tapajós][mt
  • Sylvestre Mergulhão][sm
  • Vinícius Teles][vt

## Made with love by HE:labs

![HE:labs]()

This gem was created and is maintained by [HE:labs](github.com/Helabs).

[gem_version_badge]: [ruby_gems]: rubygems.org/gems/jumpup [mt]: github.com/tapajos [sm]: github.com/mergulhao [vt]: www.improveit.com.br/vinicius [rc]: eigenclass.org/hiki.rb?rcov [sc]: github.com/colszowka/simplecov [rs]: rspec.info [ror]: www.rubyonrails.org [sci]: jamesshore.com/Blog/Why%20I%20Dont%20Like%20CruiseControl.html [mit]: www.opensource.org/licenses/mit-license.php [ci]: martinfowler.com/articles/continuousIntegration.html [travis]: travis-ci.org [BDD]: en.wikipedia.org/wiki/Behavior_driven_development [TDD]: en.wikipedia.org/wiki/Test-driven_development [ii]: www.improveit.com.br [helabs]: helabs.com.br/en/ [jumpup-heroku]: github.com/Helabs/jumpup-heroku [jumpup-hipchat]: github.com/Helabs/jumpup-hipchat [travis]: travis-ci.org/Helabs/jumpup [travis_badge]: travis-ci.org/Helabs/jumpup.svg?branch=master