• Stars
    star
    211
  • Rank 186,867 (Top 4 %)
  • Language
    Ruby
  • License
    MIT License
  • Created about 12 years ago
  • Updated 9 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Rails application generator that builds applications with the common customization stuff already done.

Gem Version

Raygun

Rails application generator that builds a new project skeleton configured with Carbon Five preferences and best practices baked right in. Spend less time configuring and more building cool features.

Raygun generates Rails projects by copying this sample app and massaging it gently into shape.

Alternatively, Raygun allows you to specify your own prototype instead of the default sample app. See below for details.

Major tools/libraries:

  • Rails
  • PostgreSQL
  • Slim
  • Sass
  • RSpec and Capybara
  • Factory Bot
  • SimpleCov
  • And many tweaks, patterns and common recipes (see raygun-rails for all the details).

Raygun includes generator templates for controllers, views, and specs so that generated code follows best practices. For example, rspec specs use factory bot when appropriate.

Inspired by Xavier Shay work at Square and ThoughtBot's Suspenders. Thanks!

Projects Goals

Raygun...

  • Generates a new rails application that's ready for immediate feature development.
  • Generates an application that has best practices that apply to most projects baked in.
  • Generates an application that includes specs for all built in functionality.
  • Is a forum for discussing what should or should not be included as part of a standard stack.

Installation

$ gem install raygun

Prerequisites

To generate an application, you only need the Raygun gem and network connectivity.

To run your new application's specs or fire up its server, you'll need to meet these requirements.

  • PostgreSQL with superuser 'postgres' with no password (createuser -s postgres)

The generated app will be configured to use the ruby version that was used to invoke Raygun. If you're using another ruby, just change the Gemfile and .ruby-version as necessary.

Usage

$ raygun your-project

Once your project is baked out, you can easily kick the wheels. Be sure that you have the prerequisites covered (see above).

$ cd your-project
$ bin/setup

# Run the specs, they should all pass
$ bin/rake

# Fire up the app and open it in a browser
$ yarn start
$ open http://localhost:3000

Next Steps

React

To add React, just run this generator:

$ bundle exec rails webpacker:install:react

You can use JSX in your app/javascript sources and the react_component helper in your Rails views. Your React code will be packaged and deployed automatically with the rest of your app, and you can test it end-to-end with Capybara, just like other Rails apps. See the webpacker-react README for more information.

💡 Check out spraygun-react for eslint and stylelint configurations that can work for React projects.

React with Typescript

To add React with Typescript, run the React generator listed above, and then add Typescript:

$ bundle exec rails webpacker:install:typescript

Don't forget to rename any files containing JSX to .tsx.

For more information, see the webpacker Typescript docs.

Bootstrap

As you'll notice, the project comes with enough CSS (SCSS, actually) to establish some patterns. If you need more of a framework, here are instructions on how to add Bootstrap to your new project.

$ yarn add bootstrap
$ rails generate simple_form:install --bootstrap

# Answer Yes to the question about overwriting your existing `config/initializers/simple_form.rb`

This generates an initializer and scaffold files for Rails view scaffolding.

Add Bootstrap imports to the top your application.scss

// application.scss
@import "~bootstrap/scss/_functions";
@import "~bootstrap/scss/_variables";

...

Now you've got Bootstrap in the application.

We include simple_form in the project by default. For more information about using Bootstrap styling on simple_form forms, check out the documentation here http://simple-form-bootstrap.plataformatec.com.br/documentation

Using a Custom Project Template

The default is to use the project at carbonfive/raygun-rails as a starting point. You can use another repo as the project template with the -p command line option.

If you invoke raygun with the -p option, you can specify your own github repository.

$ raygun -p githubid/repo your-project

Or

$ raygun -p githubid/repo#some-template-branch your-project

The repository must:

Not have any binary files. Raygun runs a 'sed' command on all files, which will fail on binaries, such as jar files.

If you are not planning to pull the prototype repository by branch, it must also have a tag. Raygun will choose the "greatest" tag and downloads the repository as of that tag.

If your project template requires a minimum version of Raygun, include the version in a file called .raygun-version at the root. Raygun will make sure it's new enough for your repo.

Internal Mechanics

Raygun fetches the greatest tag from the carbonfive/raygun-rails repo, unless it already has it cached in ~/.raygun, extracts the contents of the tarball, and runs a series of search-and-replaces on the code to customize it accordingly.

This approach is fast, simple, and makes developmentn on Raygun very easy: make changes to the application prototype (which is a valid rails app) and tag them when they should be used for new applications.

Contributing

  1. Fork it
  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

Development

To set up your local environment, run:

$ bin/setup

To run tests and rubocop checks:

$ bundle exec rake

To generate an example app using your local development version of Raygun:

$ bin/raygun tmp/example_app

Changes

View the Change Log

More Repositories

1

vimtronner

A multi-player Vim trainer.
CoffeeScript
317
star
2

razor

Phoenix application generator that builds applications with the common C5 customization stuff already done.
Elixir
80
star
3

active_column

ActiveColumn is a data management framework for Cassandra. It includes data migrations similar to ActiveRecord, and a data mapping framework for "time line" modeled data.
Ruby
54
star
4

raygun-rails

Rails 7 application template for Raygun, the Carbon Five Rails application generator.
Ruby
51
star
5

hellod

HTTP performance testing
Java
44
star
6

log_weasel

Instrument Rails and Resque with shared transaction IDs to trace execution of a unit of work across applications and application instances.
Ruby
34
star
7

nock-vcr

Automate the recording and plack-back functionality provided by nock.
28
star
8

html5-playground

HTML 5 Playground
HTML
24
star
9

socrates

Socrates is a microframework for building stateful conversational interfaces for Slack in Ruby.
Ruby
19
star
10

shimmer

An experimental capybara driver for chrome
Ruby
16
star
11

functional-programming-weekly-challenge

16
star
12

razor-phoenix

Phoenix application prototype for Razor, the Carbon Five Phoenix application generator. https://github.com/carbonfive/razor
Elixir
12
star
13

mocha-server

JavaScript
8
star
14

spraygun

Quickly generate JavaScript apps from Carbon Five-flavored templates
JavaScript
8
star
15

funnel

little ci server for git hygiene
Elixir
7
star
16

c5vr

VR Demos we have whipped up
JavaScript
6
star
17

vrogger

JavaScript
5
star
18

nortonquest

Powering the C5 2015 Holiday Funtivity
JavaScript
5
star
19

db-migration

Java
4
star
20

reflectrospective

Carbon Five hackfest project
4
star
21

john

C5 LA's current bathroom status
Ruby
4
star
22

formbot-chrome-ext

An automated form-filler Chrome Extension for development and testing, and maybe demos, too.
JavaScript
4
star
23

hi-blank-node-app

Starting point for a node application
JavaScript
3
star
24

devise-api-authenticatable

API key based authentication strategy for devise
Ruby
3
star
25

spraygun-express

Express application prototype for Spraygun, the Carbon Five JavaScript application generator.
JavaScript
3
star
26

Sentimeter

Carbon Five Elixir Tech Radar
Elixir
3
star
27

duggit

Sample app for SXSW 2011
Ruby
3
star
28

seed-crystal

Opinionated workstation configuration tool -- From zero to productive
Shell
3
star
29

kablammo

Kablammo! the GoGaRuCo death match
Ruby
3
star
30

spraygun-react-ts

TypeScript React application prototype for Spraygun, the Carbon Five JavaScript application generator.
JavaScript
3
star
31

kablammo-strategy

Build your own Kablammo robot
Ruby
3
star
32

MUDder

JavaScript
2
star
33

exploring-client-side-mvc-with-backbonejs

Sample Rails 3 and Backbone.js app
Ruby
2
star
34

spraygun-react

React application prototype for Spraygun, the Carbon Five JavaScript application generator.
JavaScript
2
star
35

c5-conventions

2
star
36

ey-cloud-recipes

A starter repo for custom chef recipes on EY's cloud platform
Ruby
2
star
37

parky

Carbon Five LA parking assistant Slack Bot
Ruby
2
star
38

igpay_atinlay

adds String#to_pig_latin, and it's fantastic!
Ruby
2
star
39

sequencer

Simple Web Audio API sequencer.
JavaScript
2
star
40

nodebro.js

A sample Node.js Application
JavaScript
2
star
41

presti.js

JavaScript
2
star
42

akop

Angular Kit of Parts
CoffeeScript
2
star
43

hi-essence-of-coffeescript

Web-Based Tutorial Framework and Lessons for Learning CoffeeScript
CoffeeScript
2
star
44

capybara_race_conditions

Examples of race conditions and performance problems found in acceptance specs using Capybara
Ruby
2
star
45

booty_log_twitter

Ruby
1
star
46

cur8

1
star
47

cinqshot

Andreja Premium Automation
C
1
star
48

slacky

Carbon Five Slack bot baseline
Ruby
1
star
49

stylegun

Living la vida Style Tiles
CSS
1
star
50

specs-rails

Strategies for writing specs for ruby on rails apps
1
star
51

c5-zine

The C5 Zine #my-forthcoming-zine
HTML
1
star
52

db_reaper

Ruby
1
star
53

nag

Timesheet Nagbot
Ruby
1
star
54

skipper

Ruby
1
star
55

5050_game

50/50 East African Famine Relief Project
Ruby
1
star
56

jjbart

Template project for Carbon Five's Junior Jump Event
Ruby
1
star
57

gel-test-repo

1
star
58

cyberdyne-systems

A sample app demo-ing Twilio and WOPR
Ruby
1
star
59

circuit-lab

Circuit Lab! Fun with LEDs and BeagleBones...
JavaScript
1
star
60

spokr

Ruby client for Spoke API
JavaScript
1
star
61

smarty

Asks questions, and knows answers
Ruby
1
star
62

BoxDrop

Upload files to dropbox from the command line. Requires a dropbox app (https://www.dropbox.com/developers/apps).
Ruby
1
star
63

tempo

Elixir
1
star
64

go-filecoin-rest-api

Temporary location for Filecoin REST API implementation
Go
1
star
65

n-fold

Multiplayer Space Shooter!
JavaScript
1
star
66

rusty-drummer

A drum sequencer implemented in Rust
Rust
1
star
67

gdyup

Wakeup call service
Ruby
1
star
68

beginning-outside-in-rails-development

Sample app developed outside-in
Ruby
1
star
69

gel

Ruby
1
star