Skip to content

Commit

Permalink
railsbricks 3.2.6 cached in my system
Browse files Browse the repository at this point in the history
  • Loading branch information
Karthikeyan A K committed Dec 11, 2015
0 parents commit 6c482ba
Show file tree
Hide file tree
Showing 153 changed files with 6,575 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
*.gem
.bundle
.idea
*.DS_Store
*.tmp
Gemfile.lock
gemfiles/*.lock
doc
log
7 changes: 7 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# (Empty) Gemfile, helps development with bundler.
# Allows to call `bundle exec bin/rbricks` which loads the
# source you are currently working on.

# This eases development with bundler, e.g. call
# `bundle exec bin/rbricks`
# to execute current ('local,' vs. gem-installed) version of railsbricks.
674 changes: 674 additions & 0 deletions LICENSE.txt

Large diffs are not rendered by default.

85 changes: 85 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# RailsBricks

_Create **Rails** apps. **Faster**._

---
- Title: RailsBricks
- Version: 3.2.6
- Author: Nico Schuele (www.nicoschuele.com)
- Contact: [contact page](http://railsbricks.net/contact)
- Homepage: http://www.railsbricks.net
- Github: https://github.com/nicoschuele/railsbricks
- Twitter: @railsbricks

---

## Features

* replaces the `rails new` command with `rbricks -n`
* includes useful gems and sets them up for you
* offers different UI choices for your web app
* creates and configures a Devise authentication scheme
* adds the necessary resources for a blog, contact form, and more
* builds an admin zone
* configures your mailers
* inits local and remote git repositories
* ...and much more to boost your productivity!

## Prerequisites

In order to use RailsBricks, you need the following:

* A nix-based OS. That can be any flavour of Linux or OS X
* Ruby (version 2.0+)
* Some knowledge of Rails (!)

## What about Windows?

**RailsBricks doesn't run out of the box on Windows**. Read the [Windows Installation Guide](http://railsbricks.net/windows) to know what to do. You will first need to install the [DevKit](http://rubyinstaller.org/downloads/) as well as the [tzinfo-data](https://github.com/tzinfo/tzinfo-data) gem.

## Ruby support

RailsBricks generates Rails apps with support for the current major Ruby release (currently, 2.0.0) + the current point release and the previous one, for example 2.1.4 & 2.2.0. If you need to use another version of Ruby, you will have to manually edit the Gemfile after the app gets created and update the following line with your chosen version number:

`ruby '2.1.5'`

## Install

Like any other gem, you simply issue `gem install railsbricks`

**Notice:** If you still have RailsBricks 1.x installed, remove it manually *before* installing RailsBricks 3.x

## Usage

To create a new app, just type `rbricks --new` and follow the wizard.

You can read the documentation, see a video and go through the *Get Started* tutorial at [railsbricks.net](http://www.railsbricks.net)

## Contribute

You like RailsBricks and want to contribute to its development? Cool! You can do it in 2 ways:

* Fork the code and implement an awesome feature
* Found a bug or a quirk? Fix it!

**Important**: before working on a new feature, [contact me](http://railsbricks.net/contact) or [open an issue](https://github.com/nicoschuele/railsbricks/issues) on Github explaining what you'd like to implement. I'm trying to keep the maintenance of RailsBricks as easy and fast as possible so before accepting a feature or a PR, we need to make sure it will be maintained properly and within an appropriate timeframe.

## Questions, Feedback

If you have any question or feedback, [drop me a line](http://railsbricks.net/contact) or tweet at @railsbricks

## Acknowledgements

* [Nikkau](https://github.com/Nikkau), for showing me how to segregate gems without using RVM
* [Joelle Gobbo](http://ch.linkedin.com/pub/joelle-gobbo/32/4b5/a9b), for the elegant snippet used to generate a valid Rails app name
* [Jim Meyer](https://github.com/purp), for forking RailsBricks and creating an alternative version I also use
* [David Hsu](https://github.com/dvdhsu), for adding a new Brick: Devise authentication using only an email address
* the authors of the many gems used by RailsBricks
* the [Geneva.rb](http://www.meetup.com/genevarb/) Meetup Group for the beer!
* David Camarena for producing a [fork](https://github.com/athalas/railsbricks) with support for MySQL
* [Felix Wolfsteller](https://github.com/fwolfst) for doing a bit of cleanup
* everyone who emailed me, gave feedback, opened an issue on Github, submitted a pull request, tweeted, etc. I truly love the Rails community.

## License

Released under GNU GPL-3. Copyright (c) 2014-2015 Nico Schuele. See LICENSE.txt for further details.
5 changes: 5 additions & 0 deletions bin/rbricks
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env ruby

require_relative "../lib/railsbricks"

Railsbricks::main ARGV
115 changes: 115 additions & 0 deletions lib/railsbricks.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
require_relative "railsbricks/version"
require_relative "railsbricks/string_helpers"
require_relative "railsbricks/errors"
require_relative "railsbricks/menu"
require_relative "railsbricks/app_generator"
require_relative "railsbricks/config_helpers"

class Railsbricks

def self.main(args)
# new app
if args[0] == '-n' || args[0] == '--new'
new_app
elsif args[0] == '-r' || args[0] == '--recreate-db'
recreate_db
elsif args[0] == '-a' || args[0] == '--annotate'
annotate
elsif args[0] == '--robocop'
prime_directives
elsif args[0] == '-v' || args[0] == '--version'
display_version
elsif args[0] == '--config'
display_config
else
display_help
end
end

def self.new_app
menu = Menu.new
@options = menu.new_app_menu
generator = AppGenerator.new(@options)
generator.generate_app
end

def self.recreate_db
options = ConfigHelpers.load_config
puts
StringHelpers.wputs "----> Recreating the database ...", :info
system "#{options["rake_command"]} db:drop"
system "#{options["rake_command"]} db:create:all"
system "#{options["rake_command"]} db:migrate"
system "#{options["rake_command"]} db:seed"
puts
StringHelpers.wputs "----> Database recreated.", :info
puts
end

def self.annotate
puts
StringHelpers.wputs "----> Annotating models and routes ...", :info
puts
system "bundle exec annotate"
system "bundle exec annotate --routes"
puts
StringHelpers.wputs "----> Models and routes annotated.", :info
puts
end

def self.prime_directives
Errors.display_error "1. Serve the public trust"
Errors.display_error "2. Protect the innocent"
Errors.display_error "3. Uphold the law"
Errors.display_error "4. Classified"
end

def self.display_version
puts
StringHelpers.wputs "RailsBricks #{Version.current} (#{Version.current_date})", :info
StringHelpers.wputs "www.railsbricks.net", :info
StringHelpers.wputs "source: https://github.com/nicoschuele/railsbricks", :help
StringHelpers.wputs "by Nico Schuele (www.nicoschuele.com)", :help
puts
end

def self.display_config
puts
StringHelpers.wputs "----> Retrieving your app's RailsBricks config values ...", :info
options = ConfigHelpers.load_config
puts
if options.count > 1
options.each do |k,v|
StringHelpers.wputs "#{k}: #{v}"
end
else
Errors.display_error "Config values couldn't be found. In most cases, this is because '#{ConfigHelpers::CONFIG_PATH}/config' is not within your app.", true
end
puts
StringHelpers.wputs "----> App config values retrieved.", :info
rescue
Errors.display_error "Config values couldn't be found. In most cases, this is because '#{ConfigHelpers::CONFIG_PATH}/config' is not within your app.", true
end

def self.display_help
puts
StringHelpers.wputs "RailsBricks usage:", :info
StringHelpers.wputs "------------------", :info
puts
puts "rbricks --new (or -n) :"
puts " --> create a new RailsBricks app."
puts
puts "rbricks --recreate-db (or -r) :"
puts " --> drop, create, migrate & seed the DB"
puts
puts "rbricks --config"
puts " --> display your app config"
puts
puts "rbricks --version (or -v) :"
puts " --> display the RailsBricks version"
puts
StringHelpers.wputs "More help, tutorials and documentation at http://www.railsbricks.net/get-started", :info
puts
end

end
Loading

0 comments on commit 6c482ba

Please sign in to comment.