*plus some cat crazyness
..and we make... oh.... that's the old logo ;)
*sth didn't work out
..and we make internetZ using: Ruby, Rails, Angular, CoffeeScript, HAML/Slim, SCSS etc...
Find us @ http://www.amberbit.com
$ rails plugin new brug --mountable
create
create README.rdoc
create Rakefile
create brug.gemspec
create MIT-LICENSE
create .gitignore
create Gemfile
create app
create app/controllers/brug/application_controller.rb
create app/helpers/brug/application_helper.rb
create app/mailers
create app/models
create app/views/layouts/brug/application.html.erb
create app/assets/images/brug
create app/assets/images/brug/.keep
create config/routes.rb
create lib/brug.rb
create lib/tasks/brug_tasks.rake
create lib/brug/version.rb
create lib/brug/engine.rb
create app/assets/stylesheets/brug/application.css
create app/assets/javascripts/brug/application.js
create bin
create bin/rails
create test/test_helper.rb
create test/brug_test.rb
append Rakefile
create test/integration/navigation_test.rb
vendor_app test/dummy
run bundle install
module Brug
class ApplicationController < ActionController::Base
end
end
#also assets
module Brug
class Engine < ::Rails::Engine
isolate_namespace Brug
end
end
*Inception FTW!
$ rails plugin new brug -T --mountable --full --dummy-path=spec/test_app
#T - skip Test::Unit
#--full tells the generator that you want app and config directories
#Gemfile
source "http://rubygems.org"
gemspec
gem "rspec-rails", "~> 2.12.2"
gem "factory_girl_rails", "~> 4.0"
#engine.rb
module Brug
class Engine < ::Rails::Engine
isolate_namespace GemName
config.generators do |g|
g.test_framework :rspec
g.fixture_replacement :factory_girl, :dir => 'spec/factories'
end
end
end
$rails generate rspec:install
#brug/test/dummy/config/routes.rb
Rails.application.routes.draw do
mount Brug::Engine => "/brug" #any path here
#add this line to README of your engine/gem
end
$ rake db:migrate
#migrations are copied to the app
$ rake brug:install:migrations
Brug::Engine.load_seed
#engine path
root_url
#mounting app path
main_app.root_url
#config/routes.rb
mount Brug::Engine => "/brug", as: 'brug_engine'
brug_engine.root_url
Locally
#Gemfile
gem 'brug', path: "/workspace/.../hidden_porn_dir/.../brug
#run bundle install
#routes.rb
mount Brug::Engine => "/brug"
#engine.rb
config.generators.do |g|
g.template_engine :haml
end
module MyEngine
class Engine < Rails::Engine
middleware.use SomeMiddleware
end
end
class ApplicationController < ActionController::Base
#1 selected
helper MyEngine::SharedEngineHelper
#all of them
helper MyEngine::Engine.helpers
end