Skip to content

Instantly share code, notes, and snippets.

View PragTob's full-sized avatar

Tobias Pfeiffer PragTob

View GitHub Profile
@PragTob
PragTob / RBP - false positive
Created February 19, 2012 01:00
Rails best practices - too many remove unused methods
./app/models/user.rb:75 - remove unused methods (User#make_salt)
./app/models/project.rb:69 - remove unused methods (Project#completed_story_points_per_sprint)
./app/models/sprint.rb:14 - remove unused methods (SprintDatesValidator#check_start_before_end)
./app/models/sprint.rb:65 - remove unused methods (Sprint#user_stories_completed)
./app/models/sprint.rb:93 - remove unused methods (Sprint#expired?)
./app/models/sprint.rb:103 - remove unused methods (Sprint#completed_story_points_per_day)
./app/models/sprint.rb:133 - remove unused methods (Sprint#all_story_points_per_day)
./app/models/user_story.rb:70 - remove unused methods (UserStory#set_new_work_effort)
./app/controllers/sprints_controller.rb:56 - remove unused methods (SprintsController#stop)
./app/controllers/users_controller.rb:62 - remove unused methods (UsersController#accept_user)
@PragTob
PragTob / tbp-unused_methods
Created February 25, 2012 12:33
rails best practices still to many used unused methods
tobi@business ~/github/TracketyTrack $ rails_best_practices .
Source Codes: 100% |ooooooooooooooooooooooooooooooooooooooooo| Time: 0:00:01
./app/controllers/sprints_controller.rb:13,21,38,48 - use before_filter for show,edit,update,destroy
./app/controllers/users_controller.rb:16,24,40,62,70 - use before_filter for show,edit,update,accept_user,reject_user
./app/controllers/projects_controller.rb:4,12,27,38 - use before_filter for show,edit,update,destroy
./app/controllers/user_stories_controller.rb:54,64,87,104,112,120,128,140,147,153 - use before_filter for show,edit,update,destroy,resurrect,start,pause,complete,request_feedback,stop_requesting_feedback
./app/views/sprints/current_sprint_overview.html.erb:16 - simplify render in views
./app/helpers/comments_helper.rb:1 - remove empty helpers
./config/routes.rb:4 - restrict auto-generated routes (:only => [:create, :destroy])
./config/routes.rb:50 - restrict auto-generated routes (:only => [:show, :new, :create, :edit, :update, :destroy])
@PragTob
PragTob / RBP unused methods false positives
Created February 26, 2012 01:44
Rails best practices on TracketyTrack with positives removed for unused methods
tobi@business ~/github/TracketyTrack $ rails_best_practices -v
1.8.0
tobi@business ~/github/TracketyTrack $ rails_best_practices .
Source Codes: 100% |oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo| Time: 0:00:01
./app/controllers/sprints_controller.rb:13,21,38,48 - use before_filter for show,edit,update,destroy
./app/controllers/users_controller.rb:16,24,40,62,70 - use before_filter for show,edit,update,accept_user,reject_user
./app/controllers/projects_controller.rb:4,12,27,38 - use before_filter for show,edit,update,destroy
./app/controllers/user_stories_controller.rb:54,64,87,104,112,120,128,140,147,153 - use before_filter for show,edit,update,destroy,resurrect,start,pause,complete,request_feedback,stop_requesting_feedback
./app/views/sprints/current_sprint_overview.html.erb:16 - simplify render in views
./app/helpers/comments_helper.rb:1 - remove empty helpers
@PragTob
PragTob / RBP 1.9.2
Created February 26, 2012 11:05
1.9.2 Rails best practices TracketyTrack
tobi@business ~/github/TracketyTrack $ rails_best_practices .
Source Codes: 100% |ooooooooooooooooooooooooooooooooooooooooo| Time: 0:00:01
./app/views/comments/_comment_entry.html.erb:8 - law of demeter
./app/controllers/sprints_controller.rb:13,21,38,48 - use before_filter for show,edit,update,destroy
./app/controllers/users_controller.rb:16,24,40,62,70 - use before_filter for show,edit,update,accept_user,reject_user
./app/controllers/projects_controller.rb:4,12,27,38 - use before_filter for show,edit,update,destroy
./app/controllers/user_stories_controller.rb:54,64,87,104,112,120,128,140,147,153 - use before_filter for show,edit,update,destroy,resurrect,start,pause,complete,request_feedback,stop_requesting_feedback
./app/views/sprints/current_sprint_overview.html.erb:16 - simplify render in views
./app/helpers/comments_helper.rb:1 - remove empty helpers
./config/routes.rb:4 - restrict auto-generated routes (:only => [:create, :destroy])
@PragTob
PragTob / jruby-head_simplecov
Created August 24, 2012 17:46
Error with jruby-head and simplecov on shoes4
tobi@speedy ~/github/shoes4 $ rake spec
jruby --debug --1.9 -Ispec -S ./bin/rspec --tty spec/shoes/list_box_spec.rb spec/shoes/sound_spec.rb spec/shoes/flow_spec.rb spec/shoes/border_spec.rb spec/shoes/app_spec.rb spec/shoes/button_spec.rb spec/shoes/edit_box_spec.rb spec/shoes/check_spec.rb spec/shoes/shape_spec.rb spec/shoes/animation_spec.rb spec/shoes/text_block_spec.rb spec/shoes/line_spec.rb spec/shoes/radio_spec.rb spec/shoes/framework_learning_spec.rb spec/shoes/progress_spec.rb spec/shoes/image_spec.rb spec/shoes/configuration_spec.rb spec/shoes/color_spec.rb spec/shoes/edit_line_spec.rb spec/shoes/logger_spec.rb spec/shoes/oval_spec.rb spec/shoes/background_spec.rb spec/shoes/logger/log4j_spec.rb spec/shoes/logger/ruby_spec.rb
LoadError: load error: pp -- java.lang.ArrayIndexOutOfBoundsException: -1
require at org/jruby/RubyKernel.java:1018
(root) at /home/tobi/.rvm/gems/jruby-head@shoes/gems/rspec-expectations-2.11.2/lib/rspec/expectations/differ.rb:3
require at org/jruby/RubyKernel.java:
@PragTob
PragTob / error_require_tmpdir
Created August 24, 2012 17:54
error rquiring tmpdir with jruby-head and simplecov
tobi@speedy ~/github/shoes4 $ rake spec
jruby --debug --1.9 -Ispec -S ./bin/rspec --tty spec/shoes/list_box_spec.rb spec/shoes/sound_spec.rb spec/shoes/flow_spec.rb spec/shoes/border_spec.rb spec/shoes/app_spec.rb spec/shoes/button_spec.rb spec/shoes/edit_box_spec.rb spec/shoes/check_spec.rb spec/shoes/shape_spec.rb spec/shoes/animation_spec.rb spec/shoes/text_block_spec.rb spec/shoes/line_spec.rb spec/shoes/radio_spec.rb spec/shoes/framework_learning_spec.rb spec/shoes/progress_spec.rb spec/shoes/image_spec.rb spec/shoes/configuration_spec.rb spec/shoes/color_spec.rb spec/shoes/edit_line_spec.rb spec/shoes/logger_spec.rb spec/shoes/oval_spec.rb spec/shoes/background_spec.rb spec/shoes/logger/log4j_spec.rb spec/shoes/logger/ruby_spec.rb
LoadError: load error: tmpdir -- java.lang.ArrayIndexOutOfBoundsException: -1
require at org/jruby/RubyKernel.java:1009
require at org/jruby/RubyKernel.java:1018
(root) at /home/tobi/.rvm/gems/jruby-head@shoes/gems/pry-0.9.10-java/lib/pry/default_commands/input_and_o
@PragTob
PragTob / console_console_log
Created March 19, 2013 20:12
Rails Girls Berlin Project group Thursdays tryruby console log
Interactive ruby ready.
> help
> 2 + 6
=> 8
Success!
> 4 *10
=> 40
> 4*10
=> 40
> 4 * 10
@PragTob
PragTob / shoes-help-graph-profile
Created June 27, 2013 15:25
Shoes profiling log with --profile.graph
This file has been truncated, but you can view the full file.
Profiling enabled; ^C shutdown will now dump profile info
/home/tobi/github/shoes4/lib/shoes/slot.rb:101 warning: method count exceeds max of 100000; no new methods will be profiled
^C
SIGINT handler profile results:
Total time: 0.00
%total %self total self children calls name
---------------------------------------------------------------------------------------------------------
0.02 0.00 0.02 1/1 Proc#call
100% 100% 0.02 0.00 0.02 1 JRuby.runtime
@PragTob
PragTob / jruby-profile
Created June 28, 2013 12:28
A current profile generated by running jRuby and loading the shoes4 mmenu.
This file has been truncated, but you can view the full file.
tobi@big-one:~/github/shoes4$ jruby --profile.graph bin/ruby-shoes samples/sample99.rb
Profiling enabled; ^C shutdown will now dump profile info
/home/tobi/github/shoes4/lib/shoes/slot.rb:101 warning: method count exceeds max of 100000; no new methods will be profiled
D, [2013-06-28T14:22:15.631000 #10865] DEBUG -- : main_window on_close block begin... disposing ::Swt.display
D, [2013-06-28T14:22:15.635000 #10865] DEBUG -- : ::Swt.display disposed
main profile results:
Total time: 51.62
%total %self total self children calls name
@PragTob
PragTob / RVMgetheadfails
Created August 4, 2013 13:04
RVM get head fails
tobi@speedy:~/github/hackety-hack.com$ rvm get head --debug
Running(6): curl --fail --location --max-redirs 10 https://get.rvm.io
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 184 100 184 0 0 141 0 0:00:01 0:00:01 --:--:-- 179
100 13784 100 13784 0 0 8981 0 0:00:01 0:00:01 --:--:-- 8981
Downloading RVM from wayneeseguin branch master
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 124 100 124 0 0 162 0 --:--:-- --:--:-- --:--:-- 240