Skip to content

Instantly share code, notes, and snippets.

@shageman
shageman / resources
Created Apr 23, 2014
#cbra resources from @shageman #railsconf talk
View resources
#Rails sample app
github.com/shageman/the_next_big_thing
# Pivotal Labs blog posts on #cbra
http://pivotallabs.com/tag/rails-application-suites/
#Past presentations by Ben Smith and me(mostly on this topic)
confreaks.com/presenters/790-stephan-hagemann
confreaks.com/presenters/784-ben-smith
@shageman
shageman / setup
Last active Aug 29, 2015
owncloud setup
View setup
# Run by hand:
# apt-get update
# apt-get upgrade
# apt-get install git
apt-get install postgresql postgresql-contrib
#set postgres user password: https://help.ubuntu.com/community/PostgreSQL#Basic_Server_Setup
wget http://download.opensuse.org/repositories/isv:ownCloud:community/xUbuntu_14.04/Release.key
sudo apt-key add - < Release.key
View gist:edfe235aad45992bad9b
### Keybase proof
I hereby claim:
* I am shageman on github.
* I am shageman (https://keybase.io/shageman) on keybase.
* I have a public key whose fingerprint is 437F 3BB7 1B58 42EA 4683 D133 2810 04E8 B35D 3D8A
To claim this, I am signing this object:
@shageman
shageman / admin_routes.rb
Created Jan 27, 2015
Admin routes using components #cobra #cbra (with admin per engine, unique engine paths, and meta admin engine)
View admin_routes.rb
#routes.rb
mount Settings::Engine => "/settings"
mount Profile::Engine => "/profile"
mount MetaAdmin::Engine => "/admin"
# admin_settings/config/routes.rb
Settings::Engine.routes.draw do
resources :admin
#add other settings routes
end
@shageman
shageman / CBRA Apps on Heroku
Last active Aug 29, 2015
Supporting non-root folders in Ruby Buildpack
View CBRA Apps on Heroku
I am trying to make the Ruby buildpack for a Rails application that does not have the app in the root folder. `git subtree` does not work, because code outside of the app folder is needed for the application.
Modified Ruby buildpack: https://github.com/shageman/heroku-buildpack-ruby
App to deploy: https://github.com/shageman/sportsball/tree/web_container_dir
2015-04-01T14:06:14.478874+00:00 heroku[api]: Deploy 4d4520e by stephan.hagemann@gmail.com
2015-04-01T14:06:14.478874+00:00 heroku[api]: Release v70 created by stephan.hagemann@gmail.com
View Gemfile
source 'http://gemcutter.org'
gem 'mysql', '2.8.1'
# gem 'tmail', '1.2.6' #dependency of rails, not caught by bundler
gem 'rails', '2.3.5'
gem 'capistrano', '2.5.14'
gem 'youtube-g', '0.5.0', :require => 'youtube_g'
gem 'i18n', '0.3.3'
View Part of my translate_routes.rb
def self.translate_route(route, route_name = nil)
new_routes = []
new_named_routes = {}
# if root_route?(route) && prefix_on_default_locale
# add the root route "as is" in addition to the translated versions
new_routes << route
new_named_routes[route_name] = route
# end
View part_of_gemspec_for_translator
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
s.add_runtime_dependency(%q<rails>, [">= 2.2"])
else
s.add_dependency(%q<rails>, [">= 2.2"])
end
else
s.add_dependency(%q<rails>, [">= 2.2"])
end
View using_bundler_with_rails_patch
diff --git a/Gemfile b/Gemfile
index e69de29..4da2bc8 100644
--- a/Gemfile
+++ b/Gemfile
@@ -0,0 +1,43 @@
+source 'http://gemcutter.org'
+
+gem 'builder', '2.1.2'
+gem 'mysql', '2.8.1'
+
View rcov task for cucumber
Cucumber::Rake::Task.new(:rcov) do |t|
t.rcov = true
t.rcov_opts = %w{--rails --exclude osx\/objc,gems\/,spec\/}
t.rcov_opts << %[-o "features_rcov"]
end