Created
March 22, 2012 20:10
-
-
Save granolocks/2163048 to your computer and use it in GitHub Desktop.
How Many Lines of Ruby in a New Rails app?
This file contains 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
#!/usr/bin/bash | |
# counts all lines in all ruby files in a directory | |
find . -type f -name *.rb -exec cat {} \; | grep -vE "^([[:space:]]+)?\#" | grep -vE "^([[:space:]]+)?$" | wc -l |
This file contains 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
#!/usr/bin/bash | |
# counts all lines in all ruby files in a directory | |
find . -type f -name *.rb -print -exec cat {} \; | grep -vE "^([[:space:]]+)?\#" | grep -vE "^([[:space:]]+)?$" |less |
This file contains 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
# note, this isn't really a ruby file | |
# ./config/application.rb | |
require File.expand_path('.# ./boot', __FILE__) | |
require 'rails/all' | |
if defined?(Bundler) | |
Bundler.require(*Rails.groups(:assets => %w(development test))) | |
end | |
module HowManyLinesAmI | |
class Application < Rails::Application | |
config.encoding = "utf-8" | |
config.filter_parameters += [:password] | |
config.assets.enabled = true | |
config.assets.version = '1.0' | |
end | |
end | |
# ./config/environment.rb | |
require File.expand_path('.# ./application', __FILE__) | |
HowManyLinesAmI::Application.initialize! | |
# ./config/routes.rb | |
HowManyLinesAmI::Application.routes.draw do | |
end | |
# ./config/initializers/session_store.rb | |
HowManyLinesAmI::Application.config.session_store :cookie_store, key: '_how_many_lines_am_i_session' | |
# ./config/initializers/backtrace_silencers.rb | |
# ./config/initializers/mime_types.rb | |
# ./config/initializers/wrap_parameters.rb | |
ActiveSupport.on_load(:action_controller) do | |
wrap_parameters format: [:json] | |
end | |
ActiveSupport.on_load(:active_record) do | |
self.include_root_in_json = false | |
end | |
# ./config/initializers/secret_token.rb | |
HowManyLinesAmI::Application.config.secret_token = '457c3569fd55a3a6b636b89335d51828e420db6500860974e3c027781740784f81a71da2ae989113d88ca352afda933b8daa113891ffab84cba11550e73f13a7' | |
# ./config/initializers/inflections.rb | |
# ./config/environments/production.rb | |
HowManyLinesAmI::Application.configure do | |
config.cache_classes = true | |
config.consider_all_requests_local = false | |
config.action_controller.perform_caching = true | |
config.serve_static_assets = false | |
config.assets.compress = true | |
config.assets.compile = false | |
config.assets.digest = true | |
config.i18n.fallbacks = true | |
config.active_support.deprecation = :notify | |
end | |
# ./config/environments/test.rb | |
HowManyLinesAmI::Application.configure do | |
config.cache_classes = true | |
config.serve_static_assets = true | |
config.static_cache_control = "public, max-age=3600" | |
config.whiny_nils = true | |
config.consider_all_requests_local = true | |
config.action_controller.perform_caching = false | |
config.action_dispatch.show_exceptions = false | |
config.action_controller.allow_forgery_protection = false | |
config.action_mailer.delivery_method = :test | |
config.active_record.mass_assignment_sanitizer = :strict | |
config.active_support.deprecation = :stderr | |
end | |
# ./config/environments/development.rb | |
HowManyLinesAmI::Application.configure do | |
config.cache_classes = false | |
config.whiny_nils = true | |
config.consider_all_requests_local = true | |
config.action_controller.perform_caching = false | |
config.action_mailer.raise_delivery_errors = false | |
config.active_support.deprecation = :log | |
config.action_dispatch.best_standards_support = :builtin | |
config.active_record.mass_assignment_sanitizer = :strict | |
config.active_record.auto_explain_threshold_in_seconds = 0.5 | |
config.assets.compress = false | |
config.assets.debug = true | |
end | |
# ./config/boot.rb | |
require 'rubygems' | |
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('.# ./.# ./Gemfile', __FILE__) | |
require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE']) | |
# ./db/seeds.rb | |
# ./app/controllers/application_controller.rb | |
class ApplicationController < ActionController::Base | |
protect_from_forgery | |
end | |
# ./app/helpers/application_helper.rb | |
module ApplicationHelper | |
end | |
# ./test/test_helper.rb | |
ENV["RAILS_ENV"] = "test" | |
require File.expand_path('.# ./.# ./config/environment', __FILE__) | |
require 'rails/test_help' | |
class ActiveSupport::TestCase | |
fixtures :all | |
end | |
# ./test/performance/browsing_test.rb | |
require 'test_helper' | |
require 'rails/performance_test_help' | |
class BrowsingTest < ActionDispatch::PerformanceTest | |
def test_homepage | |
get '/' | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment