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
| module ActivityLogger | |
| include ActiveSupport | |
| def self.included(base) | |
| base.extend ClassMethods | |
| end | |
| module ClassMethods | |
| def log_with(model_name, options = {}) |
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
| class Foo | |
| include DataMapper::Resource | |
| include ActivityLogger | |
| log_with :foo_activity_log | |
| # ...snip ... | |
| end |
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
| class ActivityLog | |
| include DataMapper::Resource | |
| property :id, Serial | |
| property :type, Discriminator | |
| property :model_id, Integer | |
| property :event, String |
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
| class TripBooker | |
| # Given a trip and a list of vendors, this class makes bookings for all the vendors | |
| def initialize(trip, vendors = :all) | |
| @trip = trip | |
| @vendors = VendorSelector.new(vendors).all | |
| @credentials = CredentialSelector.get_available_credentials | |
| end |
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
| class VendorBooker | |
| # This class is responsible for calling the appropriate translation mechanism to convert a CRM Trip | |
| # into the appropriate format to book | |
| # | |
| # It also translates the response into a CRM Booking object to persist to the database | |
| def initialize(trip, vendor, credentials) | |
| @trip = trip | |
| @vendor = vendor |
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
| Grzegorz Witek = 104 | |
| Dirkjan Bussink = 84 | |
| Konstantin Tennhard = 74 | |
| Pat Shaughnessy = 74 | |
| Benjamin Smith = 72 | |
| Daniel Lobato García = 59 | |
| Josep M. Bach = 56 | |
| Javier Ramírez = 56 | |
| Alexandre de Oliveira = 52 | |
| Alexey Vasiliev = 49 |
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
| require 'mechanize' | |
| a = Mechanize.new | |
| results = {} | |
| last_id = 647 | |
| (1..last_id).map do |id| | |
| begin | |
| page = a.get("http://cfp.euruko2013.org/users/#{id}/selections") | |
| d = page. |
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
| $ wc -l **/*.rb | sort -r | head -10 | |
| 7104 total | |
| 720 models/question.rb | |
| 468 controllers/god_controller.rb | |
| 407 controllers/analytics_controller.rb | |
| 382 controllers/admin/god_controller.rb | |
| 258 models/user.rb | |
| 252 controllers/mobile/api_controller.rb | |
| 167 controllers/admin/foo_controller.rb | |
| 140 models/quux.rb |
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
| $ wc -l spec/**/*.rb | sort -r | head -10 | |
| zsh: no matches found: spec/**/*.rb |
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
| flog app/controllers | head -10 rvm:ruby-2.0.0-p195 | |
| 6097.5: flog total | |
| 23.8: flog/method average | |
| 438.8: AController#overall | |
| 311.8: Ad::IQController#create | |
| 226.7: AController#level_meter | |
| 204.9: QController#topic_level_selector | |
| 168.2: M::ApiController#flip | |
| 140.2: TController#index |