-
-
Save xavierRiley/1761898 to your computer and use it in GitHub Desktop.
Kyan Custom Admin Template for Padrino
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
project :test => :rspec, :orm => :activerecord, :adapter => :postgres, :mock => :none, :script => :jquery, :renderer => :erb, :stylesheet => :none, :admin_renderer => :erb | |
# include additional generators | |
inject_into_file destination_root('config/boot.rb'), "\# include additional generators\nPadrino::Generators.load_paths << Padrino.root('generators', 'kyan_admin_page_generator.rb')\nPadrino::Generators.load_paths << Padrino.root('generators', 'kyan_admin_generator.rb')\n\n", :before => "Padrino.load!" | |
say "Cloning custom generators from [email protected]:xavierRiley/Kyan-Padrino-Admin-Generators.git", :red | |
remove_dir destination_root('generators') | |
run "git clone [email protected]:xavierRiley/Kyan-Padrino-Admin-Generators.git " + destination_root('generators') | |
#generate :model, "account username:string password:string" | |
#generate :model, "post title:string body:text" | |
#generate :controller, "posts get:index get:new post:new" | |
#generate :migration, "AddEmailToAccount email:string" | |
#require_dependencies 'nokogiri' | |
require_dependencies 'carrierwave' | |
require_dependencies 'mini_magick' | |
inject_into_file destination_root('Gemfile'), "gem 'acts_as_list', '0.1.4'\n", :after => "gem 'activerecord', :require => \"active_record\"\n" | |
#add in magickly | |
require_dependencies 'thin' | |
require_dependencies 'rack-cache', :require => "rack/cache" | |
inject_into_file destination_root('Gemfile'), "gem 'magickly', '~> 1.4'\n", :after => "gem 'thin'\n" | |
inject_into_file destination_root('config.ru'), "map '/' do\n ", :before => "run Padrino.application" | |
inject_into_file destination_root('config.ru'), "end\n ", :after => "run Padrino.application\n" | |
inject_into_file destination_root('config.ru'), "require 'rack/cache'\n\nuse Rack::Cache\n\nmap '/magickly' do\n run Magickly::App\nend\n\n", :before => "map '/' do" | |
#add in heroku gems | |
require_dependencies 'heroku' | |
inject_into_file destination_root('Gemfile'), "\ngem 'padrino-rpm', :git => 'git://github.com/Asquera/padrino-rpm.git', :group => 'production'\ngem 'newrelic_rpm', :group => 'production'", :after => /\ngem 'padrino'.*/ | |
#add in Kaminari for pagination | |
require_dependencies 'kaminari', :require => 'kaminari/sinatra' | |
git :init | |
git :add, "." | |
git :commit, '-m "initial commit"' | |
pg_user = ask("What is your localhost postgres username? (root)", :root, :red) | |
gsub_file(destination_root('config/database.rb'), /\'root\'/, "'" + pg_user + "'") unless pg_user == 'root' | |
inside destination_root(), {:verbose => true}, do | |
#run 'rvm --rvmrc --create 1.9.2@' + "#{name}" | |
#run 'rvm use 1.9.2@' + "#{name}" | |
#run 'echo \'alias "pads"="bundle exec thin start"\' >> .rvmrc' | |
#run 'echo \'alias "padrino"="bundle exec padrino"\' >> .rvmrc' | |
#run 'gem install bundler --pre' | |
run 'bundle install' | |
run 'bundle exec padrino rake ar:create' | |
run 'bundle exec padrino g kyan_admin --theme kyan-default' | |
run 'bundle exec padrino rake ar:migrate' | |
run 'bundle exec padrino rake seed' | |
run "mv admin/helpers/image_helpers.rb app/helpers/image_helpers.rb" | |
end | |
#inject_into_file "app/models/post.rb","#Hello", :after => "end\n" | |
#initializer :test, "# Example" | |
#app :testapp do | |
# generate :controller, "users get:index" | |
#end | |
#git :add, "." | |
#git :commit, "second commit" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment