{"id":194,"date":"2009-06-18T13:03:10","date_gmt":"2009-06-18T13:03:10","guid":{"rendered":"http:\/\/soulflyer.co.uk\/notebook\/?p=194"},"modified":"2009-06-18T13:03:10","modified_gmt":"2009-06-18T13:03:10","slug":"connectteach-site","status":"publish","type":"post","link":"https:\/\/soulflyer.co.uk\/notebook\/?p=194","title":{"rendered":"ConnectTeach site"},"content":{"rendered":"<div id=\"awppost_194\" class=\"awppost\">\n<div id=\"awppost_1_194\" class=\"awppage\" style=\"\">\n<p>Generate the rails framwork with:<br \/>\n[code]<br \/>\nrailsapp base connectteach<br \/>\n[\/code]<br \/>\nwhere railsapp is the shell function:<br \/>\n[code]<br \/>\nfunction railsapp {<br \/>\n  template=$1<br \/>\n  appname=$2<br \/>\n  shift 2<br \/>\n  rails $appname -m http:\/\/github.com\/soulflyer\/templates\/raw\/master\/$template.rb $@<br \/>\n}<br \/>\n[\/code]<br \/>\nbase.rb contains:<br \/>\n[ruby]<br \/>\nrun &#8220;echo TODO > README&#8221;<br \/>\nrun &#8220;rm public\/index.html&#8221;<br \/>\ngenerate :app_layout<\/p>\n<p># Install the test tools for the test environment only<br \/>\nfile &#8220;\/tmp\/test.rb&#8221;, <<-END\nconfig.gem \"rspec\", :lib => false<br \/>\nconfig.gem &#8220;rspec-rails&#8221;, :lib => false<br \/>\nconfig.gem &#8220;webrat&#8221;<br \/>\nconfig.gem &#8220;cucumber&#8221;<br \/>\nconfig.gem &#8220;thoughtbot-factory_girl&#8221;, :lib => &#8220;factory_girl&#8221;, :source => &#8220;http:\/\/gems.github.com\/&#8221;<br \/>\nEND<br \/>\nrun &#8220;cat tmp\/test.rb >> config\/environments\/test.rb&#8221;<br \/>\nrun &#8220;rm tmp\/test.rb&#8221;<br \/>\n# rake &#8220;gems:install&#8221;, :env => &#8216;test&#8217;, :sudo => true<br \/>\ngenerate :cucumber<\/p>\n<p># Add authentication stuff<br \/>\ngem &#8216;thoughtbot-clearance&#8217;,<br \/>\n  :lib     => &#8216;clearance&#8217;,<br \/>\n  :source  => &#8216;http:\/\/gems.github.com&#8217;<\/p>\n<p># rake &#8220;gems:install&#8221;, :sudo => true<br \/>\nrake &#8220;gems:unpack&#8221;<br \/>\ngenerate :clearance<\/p>\n<p># Add the host details to the config files for clearance<br \/>\n# All the backslashes are there to get the new lines into the text echoed into the config files<br \/>\n# This is to avoid creating a separate file and cating it on to the end as is done for the gem config<br \/>\n# stuff above<br \/>\nhost = &#8220;localhost:3000&#8221;<br \/>\nrun &#8220;echo \\\\ >> config\/environments\/test.rb&#8221;<br \/>\nrun &#8220;echo HOST=\\\\\\&#8221;#{host}\\\\\\&#8221; >> config\/environments\/test.rb&#8221;<br \/>\nrun &#8220;echo \\\\ >> config\/environments\/development.rb&#8221;<br \/>\nrun &#8220;echo HOST=\\\\\\&#8221;#{host}\\\\\\&#8221; >> config\/environments\/development.rb&#8221;<br \/>\nrun &#8220;echo \\\\ >> config\/environment.rb&#8221;<br \/>\nrun &#8220;echo DO_NOT_REPLY=\\\\\\&#8221;donotreply@example.com\\\\\\&#8221; >> config\/environment.rb&#8221;<\/p>\n<p># more clearance setup<br \/>\nroute &#8220;map.root :controller => &#8216;pages&#8217;, :id => &#8216;1&#8217;&#8221;<\/p>\n<p># Generate static pages stuff<br \/>\ngenerate :rspec_scaffold, &#8220;page name:string permalink:string content:text&#8221;<br \/>\ngem &#8216;RedCloth&#8217;, :source => &#8220;http:\/\/code.whytheluckystiff.net&#8221;<br \/>\nrun &#8220;rm app\/views\/layouts\/pages.html.erb&#8221;<\/p>\n<p>rake &#8220;db:migrate&#8221;<br \/>\n[\/ruby]<\/p>\n<p>Then run:<br \/>\n[code]<br \/>\nscript\/generate rspec_controller tutors<br \/>\n[\/code]<br \/>\nand add methods index and show to it, plus add this to routes.rb:<br \/>\n[ruby]<br \/>\nmap.resources :tutors<br \/>\n[\/ruby]<\/p>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<div id=\"awppost_194\" class=\"awppost\">\n<div id=\"awppost_1_194\" class=\"awppage\" style=\"\">\n<p>Generate the rails framwork with:<br \/>\n[code]<br \/>\nrailsapp base connectteach<br \/>\n[\/code]<br \/>\nwhere railsapp is the shell function:<br \/>\n[code]<br \/>\nfunction railsapp {<br \/>\n  template=$1<br \/>\n  appname=$2<br \/>\n  shift 2<br \/>\n  rails $appname -m http:\/\/github.com\/soulflyer\/templates\/raw\/master\/$template.rb $@<br \/>\n}<br \/>\n[\/code]<br \/>\nbase.rb contains:<br \/>\n[ruby]<br \/>\nrun &#8220;echo TODO > README&#8221;<br \/>\nrun &#8220;rm public\/index.html&#8221;<br \/>\ngenerate :app_layout<\/p>\n<p># Install the test tools for the test environment only<br \/>\nfile &#8220;\/tmp\/test.rb&#8221;, <<-END\nconfig.gem \"rspec\", :lib => false<br \/>\nconfig.gem &#8220;rspec-rails&#8221;, :lib => false<br \/>\nconfig.gem &#8220;webrat&#8221;<br \/>\nconfig.gem &#8220;cucumber&#8221;<br \/>\nconfig.gem &#8220;thoughtbot-factory_girl&#8221;, :lib => &#8220;factory_girl&#8221;, :source => &#8220;http:\/\/gems.github.com\/&#8221;<br \/>\nEND<br \/>\nrun &#8220;cat tmp\/test.rb >> config\/environments\/test.rb&#8221;<br \/>\nrun &#8220;rm tmp\/test.rb&#8221;<br \/>\n# rake &#8220;gems:install&#8221;, :env => &#8216;test&#8217;, :sudo => true<br \/>\ngenerate :cucumber<\/p>\n<p># Add authentication stuff<br \/>\ngem &#8216;thoughtbot-clearance&#8217;,<br \/>\n  :lib     => &#8216;clearance&#8217;,<br \/>\n  :source  => &#8216;http:\/\/gems.github.com&#8217;<\/p>\n<p># rake &#8220;gems:install&#8221;, :sudo => true<br \/>\nrake &#8220;gems:unpack&#8221;<br \/>\ngenerate :clearance<\/p>\n<p># Add the host details to the config files for clearance<br \/>\n# All the backslashes are there to get the new lines into the text echoed into the config files<br \/>\n# This is to avoid creating a separate file and cating it on to the end as is done for the gem config<br \/>\n# stuff above<br \/>\nhost = &#8220;localhost:3000&#8221;<br \/>\nrun &#8220;echo \\\\ >> config\/environments\/test.rb&#8221;<br \/>\nrun &#8220;echo HOST=\\\\\\&#8221;#{host}\\\\\\&#8221; >> config\/environments\/test.rb&#8221;<br \/>\nrun &#8220;echo \\\\ >> config\/environments\/development.rb&#8221;<br \/>\nrun &#8220;echo HOST=\\\\\\&#8221;#{host}\\\\\\&#8221; >> config\/environments\/development.rb&#8221;<br \/>\nrun &#8220;echo \\\\ >> config\/environment.rb&#8221;<br \/>\nrun &#8220;echo DO_NOT_REPLY=\\\\\\&#8221;donotreply@example.com\\\\\\&#8221; >> config\/environment.rb&#8221;<\/p>\n<p># more clearance setup<br \/>\nroute &#8220;map.root :controller => &#8216;pages&#8217;, :id => &#8216;1&#8217;&#8221;<\/p>\n<p># Generate static pages stuff<br \/>\ngenerate :rspec_scaffold, &#8220;page name:string permalink:string content:text&#8221;<br \/>\ngem &#8216;RedCloth&#8217;, :source => &#8220;http:\/\/code.whytheluckystiff.net&#8221;<br \/>\nrun &#8220;rm app\/views\/layouts\/pages.html.erb&#8221;<\/p>\n<p>rake &#8220;db:migrate&#8221;<br \/>\n[\/ruby]<\/p>\n<p>Then run:<br \/>\n[code]<br \/>\nscript\/generate rspec_controller tutors<br \/>\n[\/code]<br \/>\nand add methods index and show to it, plus add this to routes.rb:<br \/>\n[ruby]<br \/>\nmap.resources :tutors<br \/>\n[\/ruby]<\/p>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1,11],"tags":[],"_links":{"self":[{"href":"https:\/\/soulflyer.co.uk\/notebook\/index.php?rest_route=\/wp\/v2\/posts\/194"}],"collection":[{"href":"https:\/\/soulflyer.co.uk\/notebook\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/soulflyer.co.uk\/notebook\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/soulflyer.co.uk\/notebook\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/soulflyer.co.uk\/notebook\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=194"}],"version-history":[{"count":0,"href":"https:\/\/soulflyer.co.uk\/notebook\/index.php?rest_route=\/wp\/v2\/posts\/194\/revisions"}],"wp:attachment":[{"href":"https:\/\/soulflyer.co.uk\/notebook\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=194"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/soulflyer.co.uk\/notebook\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=194"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/soulflyer.co.uk\/notebook\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=194"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}