post-railsconf 07
source link: https://technomancy.us/82
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
RailsConf just ended. I've got a big refactoring of RAV in the works, but until I wrap that up I'll post this to hold things over:
It may be hypocritical of me to keep harping on how it's best to avoid reliance on the mouse as much as you can, but I grudgingly admit that sometimes it is handy to be able to launch mongrel quickly with it. Below is the code for mongrel_panel.rb
:
#!/usr/bin/env ruby # Mongrel Panel # Copyright (C) 2007 Phil Hagelberg require 'gtk2' require 'gtktrayicon' RAILS_ROOT = ENV['RAILS_ROOT'] || '.' mongrel = Gtk: : TrayIcon.new("mongrel") $started = File.exist? RAILS_ROOT + '/log/mongrel.pid' button = Gtk: : Button.new("", true) button.image = Gtk: : Image.new("#{File.dirname(__FILE__)}/mong#{ \ '_mono' unless $started}.png") button.relief = Gtk: : RELIEF_NONE button.signal_connect('clicked') do if $started button.image = Gtk: : Image.new("#{File.dirname(__FILE__)}/mong_mono.png") `mongrel_rails stop -c #{RAILS_ROOT}` $started = false else button.image = Gtk: : Image.new("#{File.dirname(__FILE__)}/mong.png") `mongrel_rails start -c #{RAILS_ROOT} -d&:96; $started = true end end mongrel.add(button) mongrel.show_all Gtk.main
I feel like I keep harping on this, but man... GUI code is weird and unintuitive for me. Probably just a matter of familiarizing myself with the conventions, but still. On Ubuntu/Debian: sudo apt-get install libgnome2-ruby libgtk-trayicon-ruby1.8 then grab it.
Usage: RAILS_ROOT=~/projects/foo mongrel_panel.rb & or run it from your rails root.
This is nothing really, but it might be a nice base to adapt for other similar dæmons, I suppose. Let me know if you find it useful.
Recommend
-
13
RailsConf 2017: 5 Years of Rails Scaling to 80k RPS by Simon EskildsenRailsConf 2017: 5 Years of Rails Scaling to 80k RPS by Simon Eskildsen - YouTube ...
-
6
EventsRailsConf 2015 Recap and ThoughtsApril 25, 2015Kir: It was my first time at RailsConf — both as a speaker and as an attendee. I’ve been to many other conferences including RubyConf and even...
-
6
All the Little Things by Sandi MetzRailsConf 2014 - All the Little Things by Sandi Metz - YouTube
-
3
RailsConf 2020.2 Couch Edition Roy Tomeij on May 5, 2020 “I absolutely love AppSignal.” Discover AppSignal We’ve been a part of...
-
9
RailsConf is the world’s largest gathering of Ruby on Rails developers. As always, we’re there to enhance the conference experience for the community we’ve loved ever since attending our first RailsConf in 2008. Here’s what we’ve got planned:...
-
1
Leaving for RailsConf Europe 2008 Posted: 2008-09-01 - Last updated: 2019-06-05 Tagged
-
3
RailsConf Europe 2007! Posted: 2007-09-17 - Last updated: 2019-06-05 Tagged
-
8
Kabisa, RailsConf Europe and Ariejan.net Posted: 2007-08-20 - Last updated: 2019-06-05 Tagged
-
4
Roam Notes on “RailsConf 2017: How to Write Better Code Using Mutation Testing” by John Backus "Author::" [[John Backus]] "Source::" [[YouTube]] "Recommended By::" [[John Backus]] "Tags::" #programming...
-
4
Talk at Railsconf: 5 Years of Rails Scaling to 80K RPSApr 2017Subscribe through email, RSS or Twitter to new articles! 2,520 subsc...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK