Skip to content

Instantly share code, notes, and snippets.

View jesjos's full-sized avatar

Jesper Josefsson jesjos

  • Mariehamn, Åland
View GitHub Profile
@jesjos
jesjos / gist:1260048
Created October 3, 2011 19:51 — forked from Tarrasch/gist:1259193
Projektbeskrivning: Water

Water: en ersättning för Fire, baserad på versionshantering

Bakgrund:

Arbetsflöden som används på Chalmers bör spegla dem som används på hög nivå i branschen. Där ingår modern versionhantering. Genom att införliva versionhantering i arbetet med inlämningsuppgifter läggs en stabil grund inför arbetslivet. Fire, det nuvarande systemet för hantering av inlämningsuppgifter, uppmuntrar inte till ett strukturerat arbetssätt och brister även av följande anledningar:

  • Nya användaridentiteter för varje kurs
Started GET "/projects/testproject/repositories/new" for 127.0.0.1 at 2012-02-13 22:34:18 +0100
SQL (1.1ms) SHOW TABLES
SQL (1.1ms) SHOW TABLES
Processing by RepositoriesController#new as HTML
Parameters: {"project_id"=>"projects/testproject"}
User Load (0.4ms) SELECT `users`.* FROM `users` WHERE `users`.`id` = 1 LIMIT 1
Project Load (0.4ms) SELECT `projects`.* FROM `projects` WHERE `projects`.`slug` = 'projects/testproject' LIMIT 1
WARNING: Can't mass-assign protected attributes: subdomain
WARNING: Can't mass-assign protected attributes: subdomain
WARNING: Can't mass-assign protected attributes: subdomain
@jesjos
jesjos / gist:1825356
Created February 14, 2012 09:38
rake routes
ActiveMessaging: Loading /Users/jesper/Documents/water/mainline/app/processors/merge_request_git_backend_processor.rb
ActiveMessaging: Loading /Users/jesper/Documents/water/mainline/app/processors/merge_request_processor.rb
ActiveMessaging: Loading /Users/jesper/Documents/water/mainline/app/processors/merge_request_version_processor.rb
ActiveMessaging: Loading /Users/jesper/Documents/water/mainline/app/processors/message_forwarding_processor.rb
ActiveMessaging: Loading /Users/jesper/Documents/water/mainline/app/processors/push_event_processor.rb
ActiveMessaging: Loading /Users/jesper/Documents/water/mainline/app/processors/repository_archiving_processor.rb
ActiveMessaging: Loading /Users/jesper/Documents/water/mainline/app/processors/repository_creation_processor.rb
ActiveMessaging: Loading /Users/jesper/Documents/water/mainline/app/processors/repository_deletion_processor.rb
ActiveMessaging: Loading /Users/jesper/Documents/water/mainline/app/processors/ssh_key_processor.rb
ActiveMessaging: Loading /Users/jes
@jesjos
jesjos / gist:1825416
Created February 14, 2012 09:52
Major fuckup
citier -> Root Class
citier -> table_name -> users
/Users/jesper/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.10/lib/active_support/callbacks.rb:401: [BUG] Segmentation fault
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-darwin10.6.0]
-- control frame ----------
c:0074 p:---- s:0341 b:0341 l:000340 d:000340 CFUNC :class_eval
c:0073 p:0090 s:0335 b:0335 l:000322 d:000334 BLOCK /Users/jesper/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.10/lib/active_support/callbacks.rb:401
c:0072 p:0005 s:0333 b:0333 l:000325 d:000332 BLOCK /Users/jesper/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.10/lib/active_support/core_ext/kernel/reporting.rb:11
c:0071 p:0022 s:0331 b:0331 l:000330 d:000330 METHOD /Users/jesper/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.10/lib/active_support/core_ext/kernel/reporting.rb:22
Started POST "/uploads/new" for 127.0.0.1 at 2012-02-19 21:03:38 +0100
Processing by UploadsController#new as JSON
Parameters: {"files"=>[#<ActionDispatch::Http::UploadedFile:0x00000103cffdb0 @original_filename="Plan_12_11.pdf", @content_type="application/pdf", @headers="Content-Disposition: form-data; name=\"files[]\"; filename=\"Plan_12_11.pdf\"\r\nContent-Type: application/pdf\r\n", @tempfile=#<File:/var/folders/cx/vtstdwkd37g97t2r24zkyrkr0000gn/T/RackMultipart20120219-10851-67drxj>>]}
Completed 200 OK in 339ms (Views: 0.4ms | ActiveRecord: 0.0ms)
../mainline/script/git-daemon
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/01/04/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /Users/jesper/Documents/water/mainline/config/environment.rb:5)
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/01/04/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /Users/jesper/Documents/water/mainline/config/environment.rb:5)
DEPRECATION WARNING: You have Rails 2.3-style plug
@jesjos
jesjos / gist:1959485
Created March 2, 2012 16:29
DoubleRenderError
AbstractController::DoubleRenderError (Render and/or redirect were called multiple times in this action. Please note that you may only call render OR redirect, and at most once per action. Also note that neither redirect nor render terminate execution of the action, so if you want to exit an action after redirecting, you need to do something like "redirect_to(...) and return".):
@jesjos
jesjos / gist:1960984
Created March 2, 2012 20:14
Stack trace for DoubleRenderError
AbstractController::DoubleRenderError (Render and/or redirect were called multiple times in this action. Please note that you may only call render OR redirect, and at most once per action. Also note that neither redirect nor render terminate execution of the action, so if you want to exit an action after redirecting, you need to do something like "redirect_to(...) and return".):
actionpack (3.2.1) lib/action_controller/metal/rendering.rb:15:in `render'
actionpack (3.2.1) lib/action_controller/metal/instrumentation.rb:40:in `block (2 levels) in render'
activesupport (3.2.1) lib/active_support/core_ext/benchmark.rb:5:in `block in ms'
/Users/jesper/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/benchmark.rb:309:in `realtime'
activesupport (3.2.1) lib/active_support/core_ext/benchmark.rb:5:in `ms'
actionpack (3.2.1) lib/action_controller/metal/instrumentation.rb:40:in `block in render'
actionpack (3.2.1) lib/action_controller/metal/instrumentation.rb:83:in `cleanup_view_runtime'
activerecord (3.2.1) l
@jesjos
jesjos / gist:2006636
Created March 9, 2012 14:05
Seed script error
(0.6ms) COMMIT
(0.2ms) BEGIN
Repository Exists (0.3ms) SELECT 1 FROM `repositories` WHERE `repositories`.`hashed_path` = '' LIMIT 1
SQL (0.4ms) INSERT INTO `repositories` (`created_at`, `hashed_path`, `kind`, `mainline`, `name`, `owner_id`, `owner_type`, `parent_id`, `project_id`, `ready`, `updated_at`, `user_id`) VALUES ('2012-03-09 14:04:31', '9b8/ed5/fb97394af9de3afe7573aafa4246065e04', 0, 0, 'repo1', 1, 'User', NULL, NULL, 0, '2012-03-09 14:04:31', 1)
Mysql2::Error: Unknown column 'mainline' in 'field list': INSERT INTO `repositories` (`created_at`, `hashed_path`, `kind`, `mainline`, `name`, `owner_id`, `owner_type`, `parent_id`, `project_id`, `ready`, `updated_at`, `user_id`) VALUES ('2012-03-09 14:04:31', '9b8/ed5/fb97394af9de3afe7573aafa4246065e04', 0, 0, 'repo1', 1, 'User', NULL, NULL, 0, '2012-03-09 14:04:31', 1)
(0.2ms) ROLLBACK
rake aborted!
Mysql2::Error: Unknown column 'mainline' in 'field list': INSERT INTO `repositories` (`created_at`, `hashed_path`, `kind`, `mainline`, `name`
@jesjos
jesjos / gist:2007079
Created March 9, 2012 15:38
Upload error
Started POST "/upload" for 127.0.0.1 at 2012-03-09 16:37:43 +0100
RailsDevTweaks: Skipping ActionDispatch::Reloader hooks for this request.
Processing by UploadsController#upload as JSON
Parameters: {"files"=>[#<ActionDispatch::Http::UploadedFile:0x0000012f189e28 @original_filename="P3040167.JPG", @content_type="image/jpeg", @headers="Content-Disposition: form-data; name=\"files[]\"; filename=\"P3040167.JPG\"\r\nContent-Type: image/jpeg\r\n", @tempfile=#<File:/var/folders/cx/vtstdwkd37g97t2r24zkyrkr0000gn/T/RackMultipart20120309-28216-4jckcv>>, #<ActionDispatch::Http::UploadedFile:0x0000012f189d60 @original_filename="P3040170.JPG", @content_type="image/jpeg", @headers="Content-Disposition: form-data; name=\"files[]\"; filename=\"P3040170.JPG\"\r\nContent-Type: image/jpeg\r\n", @tempfile=#<File:/var/folders/cx/vtstdwkd37g97t2r24zkyrkr0000gn/T/RackMultipart20120309-28216-14zq9wc>>]}
Completed 500 Internal Server Error in 177ms
NoMethodError (undefined method `path' for #<Upload:0x0000012f15c450>):
app/cont