Home

Awesome

<div id='page-index'></div> <img src=https://s3.eu-central-1.amazonaws.com/iboard.core/static/yarb_Pulp-O-Mizer_Cover_Image.jpg style="float: right; border: 0.25em solid #ddd; padding: 0.25em;" />

README

Alsoavailableat
YARBGITHUBIBOARD

This is a Rails4-Starter-Application.

It's made for Rails and Ruby developers. So, you should be familiar with Rails when you'll read on. Have Fun!

<div style='float: right; padding: 1em; margin-right: 1em; border: 1px solid #ddd; border-radius: 0.25em; '> <strong>Travis-CI</strong><br/> <a href='https://travis-ci.org/iboard/yarb'><img src='https://travis-ci.org/iboard/yarb.png' alt='Travis-Test-Status'/></a> </div>

Ready to be used with

It integrates:

It DOESN'T:

HOW TO START

Requirements

Start

Configuration

For development

cp config/environments/application_development_settings.rb_sample \
   config/environments/application_development_settings.rb
cp config/secrets.rb_sample config/secrets.rb

For production

cp config/environments/application_development_settings.rb_sample \
   config/environments/application_production_settings.rb

For testing

No setup is neccessary for testing. Just run

$ rake
$ rake -T

What You Can do

With the source

With the Application

Start rails server and visit http://0.0.0.0:3000. You'll see a list of "Pages" which are the html-representation of all markdown-files found in the root-path of the application.

If you create a User with admin-role on the console (see below) you'll be able to add, edit, and delete Pages.

When needs_invitation in config/environments/application_developemnt_settings.rb is enabled, you can invite other users (by sending email).

TDD

The project follows 100% TDD. Run rake to run all test. To get more response as green dots run rspec -f d. The readable list of specs will give you an idea what the app is doing so far.

Using Solid State Disks

Running the tests will write files in db/test and ./tmp over and over again. This will harm your SSD. I recommend to use a RAM-Disk for your /tmp path of the maschine and sym-link the directories db/test and ./tmp to this RAM-disk.

See this blog

Continuous Testing

The app uses Travis-CI for continuous testing the integration with different Ruby-environments. – See the list of tested rubies and the current Travis-state on top of this page.

The Starter App

APP-Features

Users

Though, you can create a new user at /sign_up. There is no way to make the first user an admin. You have to do this through the console.


rails console development

user = User.create name: "Your name", email: "your@email.cc"
user.password = "your secret word"
user.roles = [ :admin ]
user.save

Once this is done for the first user, you can sign-in with email and password. As an admin you can invite other users and modify their roles in Edit User.

For more information read USER_AND_SESSION

Deploy

There are two rake-tasks in lib/tasks/deploy.rake which alows to rsync doc/* to a web-server and the application itself to a production-server, running 'thin'.

It's planed to implement a full capistano-deploy-script when the project grows up. By now you have to change the user and hostnames for your needs.

Contribution

If you collaborate or just be interested in this project, I recommend to follow Refactoring Notes. It gives you an idea what 'Clean' means in this project. Any notice, comment, hint, and arguing is welcome!

Why use Pstore instead of ActiveRecord, MongoId, ...

If you start your application-development after you decide to use ActiveRecord, MongoId, whathever, you may find yourself developing an AR, Mongo, Whatever application. Postpone this decision as long as possible and start developing Your-Application.

PStore is a class from ruby's standard-library.

YARB implements as less as possible on the 'ORM-side' to give you a Layer/Interface to persist your data. Moving from this to a 'real' ORM should not be that challenge and should be doable by changing a few lines.

Sure, this is just a demonstration and it still depends on ActiveModel, you may argument. Anyway, if you take a look at, what is used from ActiveModel, you will see… not much.

When I decide to use ActiveModel, it was not about, “I’m using ActiveModel, so, how I have to implement validations?”. The question was, “Ok, every Store-model will have a need of validations; let’s see how easy it is to do this with ActiveModel::Validations.”

License: MIT

Copyright (C) 2013 Andreas Altendorfer

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.