code
stringlengths
1
1.73M
language
stringclasses
1 value
require 'google/api_client' require 'google/api_client/client_secrets' require 'json' require 'launchy' require 'thin' RESPONSE_HTML = <<stop <html> <head> <title>OAuth 2 Flow Complete</title> </head> <body> You have successfully completed the OAuth 2 flow. Please close this browser window and return to ...
Ruby
#!/usr/bin/ruby require 'rubygems' require 'google/api_client' require 'trollop' # Set DEVELOPER_KEY to the "API key" value from the "Access" tab of the # Google APIs Console <http://code.google.com/apis/console#access> # Please ensure that you have enabled the YouTube Data API for your project. DEVELOPER_KEY = "REP...
Ruby
#!/usr/bin/ruby require 'rubygems' require 'google/api_client' # oauth/oauth_util is not part of the official Ruby client library. # Get it at http://samples.google-api-ruby-client.googlecode.com/git/oauth/oauth_util.rb require 'oauth/oauth_util' # An OAuth 2 access scope that allows for full read/write access. YOU...
Ruby
#!/usr/bin/ruby # Copyright 2011 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required ...
Ruby
require 'google/api_client' require 'google/api_client/client_secrets' require 'json' require 'launchy' require 'thin' RESPONSE_HTML = <<stop <html> <head> <title>OAuth 2 Flow Complete</title> </head> <body> You have successfully completed the OAuth 2 flow. Please close this browser window and return to ...
Ruby
#!/usr/bin/ruby require 'benchmark' Benchmark.bm do |x| [1, 2, 5, 10, 20].each do |thread_count| x.report("#{thread_count} threads:") do system('./analyticsdump.rb', '--threads', thread_count.to_s) end sleep(60) end end
Ruby
#!/usr/bin/ruby require 'rubygems' require 'google/api_client' require 'logger' require 'oauth/oauth_util' require 'sqlite3' require 'thread' require 'trollop' YOUTUBE_API_READONLY_SCOPE = 'https://www.googleapis.com/auth/youtube.readonly' YOUTUBE_ANALYTICS_API_SCOPE = 'https://www.googleapis.com/auth/yt-analytics.re...
Ruby
require 'google/api_client' require 'google/api_client/client_secrets' require 'json' require 'launchy' require 'thin' RESPONSE_HTML = <<stop <html> <head> <title>OAuth 2 Flow Complete</title> </head> <body> You have successfully completed the OAuth 2 flow. Please close this browser window and return to ...
Ruby
#!/usr/bin/ruby # Copyright 2013 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required ...
Ruby
# Copyright 2013 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
Ruby
source :gemcutter gem 'sinatra', :require => 'sinatra/base' gem 'thin', '~> 1.3' gem 'pg' gem 'data_mapper', '~> 1.2' gem 'dm-postgres-adapter' gem 'google-api-client', '>= 0.4.3' group :development do gem 'dm-sqlite-adapter', '~> 1.2' gem 'do_sqlite3', '~> 0.10' end
Ruby
# Copyright (C) 2012 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
Ruby
# EZ Bundle for file in ["/lib/bundle_fu.rb", "/lib/js_minimizer.rb", "/lib/bundle_fu/file_list.rb"] end require File.expand_path(File.join(File.dirname(__FILE__), "environment.rb")) ActionView::Base.send(:include, BundleFu::InstanceMethods)
Ruby
# load all files for file in ["/lib/bundle_fu.rb", "/lib/bundle_fu/js_minimizer.rb", "/lib/bundle_fu/css_url_rewriter.rb", "/lib/bundle_fu/file_list.rb"] require File.expand_path(File.join(File.dirname(__FILE__), file)) end
Ruby
#!/usr/bin/ruby # jsmin.rb 2007-07-20 # Author: Uladzislau Latynski # This work is a translation from C to Ruby of jsmin.c published by # Douglas Crockford. Permission is hereby granted to use the Ruby # version under the same conditions as the jsmin.c on which it is # based. # # /* jsmin.c # 2003-04-21 # # Copyrig...
Ruby
#!/usr/bin/ruby # jsmin.rb 2007-07-20 # Author: Uladzislau Latynski # This work is a translation from C to Ruby of jsmin.c published by # Douglas Crockford. Permission is hereby granted to use the Ruby # version under the same conditions as the jsmin.c on which it is # based. # # /* jsmin.c # 2003-04-21 # # Copyrig...
Ruby
require 'fileutils.rb' class BundleFu::FileList attr_accessor :filelist def initialize(filenames=[]) self.filelist = [] self.add_files(filenames) end def initialize_copy(from) self.filelist = from.filelist.collect{|entry| entry.clone} end def filenames self.fil...
Ruby
class BundleFu::CSSUrlRewriter class << self # rewrites a relative path to an absolute path, removing excess "../" and "./" # rewrite_relative_path("stylesheets/default/global.css", "../image.gif") => "/stylesheets/image.gif" def rewrite_relative_path(source_filename, relative_url) relative_url = re...
Ruby
class BundleFu class << self attr_accessor :content_store def init @content_store = {} end def bundle_files(filenames=[]) output = "" filenames.each{ |filename| output << "/* --------- #{filename} --------- */ " output << "\n" begin ...
Ruby
Dir[File.join(File.dirname(__FILE__), "functional/*.rb")].each{|filename| require filename }
Ruby
require 'test/unit' require "rubygems" require 'active_support' for file in ["../environment.rb", "mock_view.rb"] require File.expand_path(File.join(File.dirname(__FILE__), file)) end def dbg require 'ruby-debug' Debugger.start debugger end class Object def to_regexp is_a?(Regexp) ? sel...
Ruby
class MockView # set RAILS_ROOT to fixtures dir so we use those files include BundleFu::InstanceMethods ::RAILS_ROOT = File.join(File.dirname(__FILE__), 'fixtures') attr_accessor :output attr_accessor :session attr_accessor :params def initialize @output = "" @session = {} @param...
Ruby
# EZ Bundle for file in ["/lib/bundle_fu.rb", "/lib/js_minimizer.rb", "/lib/bundle_fu/file_list.rb"] end require File.expand_path(File.join(File.dirname(__FILE__), "environment.rb")) ActionView::Base.send(:include, BundleFu::InstanceMethods)
Ruby
# load all files for file in ["/lib/bundle_fu.rb", "/lib/bundle_fu/js_minimizer.rb", "/lib/bundle_fu/css_url_rewriter.rb", "/lib/bundle_fu/file_list.rb"] require File.expand_path(File.join(File.dirname(__FILE__), file)) end
Ruby
#!/usr/bin/ruby # jsmin.rb 2007-07-20 # Author: Uladzislau Latynski # This work is a translation from C to Ruby of jsmin.c published by # Douglas Crockford. Permission is hereby granted to use the Ruby # version under the same conditions as the jsmin.c on which it is # based. # # /* jsmin.c # 2003-04-21 # # Copyrig...
Ruby
#!/usr/bin/ruby # jsmin.rb 2007-07-20 # Author: Uladzislau Latynski # This work is a translation from C to Ruby of jsmin.c published by # Douglas Crockford. Permission is hereby granted to use the Ruby # version under the same conditions as the jsmin.c on which it is # based. # # /* jsmin.c # 2003-04-21 # # Copyrig...
Ruby
require 'fileutils.rb' class BundleFu::FileList attr_accessor :filelist def initialize(filenames=[]) self.filelist = [] self.add_files(filenames) end def initialize_copy(from) self.filelist = from.filelist.collect{|entry| entry.clone} end def filenames self.fil...
Ruby
class BundleFu::CSSUrlRewriter class << self # rewrites a relative path to an absolute path, removing excess "../" and "./" # rewrite_relative_path("stylesheets/default/global.css", "../image.gif") => "/stylesheets/image.gif" def rewrite_relative_path(source_filename, relative_url) relative_url = re...
Ruby
class BundleFu class << self attr_accessor :content_store def init @content_store = {} end def bundle_files(filenames=[]) output = "" filenames.each{ |filename| output << "/* --------- #{filename} --------- */ " output << "\n" begin ...
Ruby
Dir[File.join(File.dirname(__FILE__), "functional/*.rb")].each{|filename| require filename }
Ruby
require 'test/unit' require "rubygems" require 'active_support' for file in ["../environment.rb", "mock_view.rb"] require File.expand_path(File.join(File.dirname(__FILE__), file)) end def dbg require 'ruby-debug' Debugger.start debugger end class Object def to_regexp is_a?(Regexp) ? sel...
Ruby
class MockView # set RAILS_ROOT to fixtures dir so we use those files include BundleFu::InstanceMethods ::RAILS_ROOT = File.join(File.dirname(__FILE__), 'fixtures') attr_accessor :output attr_accessor :session attr_accessor :params def initialize @output = "" @session = {} @param...
Ruby
# EZ Bundle for file in ["/lib/bundle_fu.rb", "/lib/js_minimizer.rb", "/lib/bundle_fu/file_list.rb"] end require File.expand_path(File.join(File.dirname(__FILE__), "environment.rb")) ActionView::Base.send(:include, BundleFu::InstanceMethods)
Ruby
# load all files for file in ["/lib/bundle_fu.rb", "/lib/bundle_fu/js_minimizer.rb", "/lib/bundle_fu/css_url_rewriter.rb", "/lib/bundle_fu/file_list.rb"] require File.expand_path(File.join(File.dirname(__FILE__), file)) end
Ruby
#!/usr/bin/ruby # jsmin.rb 2007-07-20 # Author: Uladzislau Latynski # This work is a translation from C to Ruby of jsmin.c published by # Douglas Crockford. Permission is hereby granted to use the Ruby # version under the same conditions as the jsmin.c on which it is # based. # # /* jsmin.c # 2003-04-21 # # Copyrig...
Ruby
#!/usr/bin/ruby # jsmin.rb 2007-07-20 # Author: Uladzislau Latynski # This work is a translation from C to Ruby of jsmin.c published by # Douglas Crockford. Permission is hereby granted to use the Ruby # version under the same conditions as the jsmin.c on which it is # based. # # /* jsmin.c # 2003-04-21 # # Copyrig...
Ruby
require 'fileutils.rb' class BundleFu::FileList attr_accessor :filelist def initialize(filenames=[]) self.filelist = [] self.add_files(filenames) end def initialize_copy(from) self.filelist = from.filelist.collect{|entry| entry.clone} end def filenames self.fil...
Ruby
class BundleFu::CSSUrlRewriter class << self # rewrites a relative path to an absolute path, removing excess "../" and "./" # rewrite_relative_path("stylesheets/default/global.css", "../image.gif") => "/stylesheets/image.gif" def rewrite_relative_path(source_filename, relative_url) relative_url = re...
Ruby
class BundleFu class << self attr_accessor :content_store def init @content_store = {} end def bundle_files(filenames=[]) output = "" filenames.each{ |filename| output << "/* --------- #{filename} --------- */ " output << "\n" begin ...
Ruby
Dir[File.join(File.dirname(__FILE__), "functional/*.rb")].each{|filename| require filename }
Ruby
require 'test/unit' require "rubygems" require 'active_support' for file in ["../environment.rb", "mock_view.rb"] require File.expand_path(File.join(File.dirname(__FILE__), file)) end def dbg require 'ruby-debug' Debugger.start debugger end class Object def to_regexp is_a?(Regexp) ? sel...
Ruby
class MockView # set RAILS_ROOT to fixtures dir so we use those files include BundleFu::InstanceMethods ::RAILS_ROOT = File.join(File.dirname(__FILE__), 'fixtures') attr_accessor :output attr_accessor :session attr_accessor :params def initialize @output = "" @session = {} @param...
Ruby
# EZ Bundle for file in ["/lib/bundle_fu.rb", "/lib/js_minimizer.rb", "/lib/bundle_fu/file_list.rb"] end require File.expand_path(File.join(File.dirname(__FILE__), "environment.rb")) ActionView::Base.send(:include, BundleFu::InstanceMethods)
Ruby
# load all files for file in ["/lib/bundle_fu.rb", "/lib/bundle_fu/js_minimizer.rb", "/lib/bundle_fu/css_url_rewriter.rb", "/lib/bundle_fu/file_list.rb"] require File.expand_path(File.join(File.dirname(__FILE__), file)) end
Ruby
#!/usr/bin/ruby # jsmin.rb 2007-07-20 # Author: Uladzislau Latynski # This work is a translation from C to Ruby of jsmin.c published by # Douglas Crockford. Permission is hereby granted to use the Ruby # version under the same conditions as the jsmin.c on which it is # based. # # /* jsmin.c # 2003-04-21 # # Copyrig...
Ruby
#!/usr/bin/ruby # jsmin.rb 2007-07-20 # Author: Uladzislau Latynski # This work is a translation from C to Ruby of jsmin.c published by # Douglas Crockford. Permission is hereby granted to use the Ruby # version under the same conditions as the jsmin.c on which it is # based. # # /* jsmin.c # 2003-04-21 # # Copyrig...
Ruby
require 'fileutils.rb' class BundleFu::FileList attr_accessor :filelist def initialize(filenames=[]) self.filelist = [] self.add_files(filenames) end def initialize_copy(from) self.filelist = from.filelist.collect{|entry| entry.clone} end def filenames self.fil...
Ruby
class BundleFu::CSSUrlRewriter class << self # rewrites a relative path to an absolute path, removing excess "../" and "./" # rewrite_relative_path("stylesheets/default/global.css", "../image.gif") => "/stylesheets/image.gif" def rewrite_relative_path(source_filename, relative_url) relative_url = re...
Ruby
class BundleFu class << self attr_accessor :content_store def init @content_store = {} end def bundle_files(filenames=[]) output = "" filenames.each{ |filename| output << "/* --------- #{filename} --------- */ " output << "\n" begin ...
Ruby
Dir[File.join(File.dirname(__FILE__), "functional/*.rb")].each{|filename| require filename }
Ruby
require 'test/unit' require "rubygems" require 'active_support' for file in ["../environment.rb", "mock_view.rb"] require File.expand_path(File.join(File.dirname(__FILE__), file)) end def dbg require 'ruby-debug' Debugger.start debugger end class Object def to_regexp is_a?(Regexp) ? sel...
Ruby
class MockView # set RAILS_ROOT to fixtures dir so we use those files include BundleFu::InstanceMethods ::RAILS_ROOT = File.join(File.dirname(__FILE__), 'fixtures') attr_accessor :output attr_accessor :session attr_accessor :params def initialize @output = "" @session = {} @param...
Ruby
# EZ Bundle for file in ["/lib/bundle_fu.rb", "/lib/bundle_fu/file_list.rb"] require File.expand_path(File.join(File.dirname(__FILE__), file)) end ActionView::Base.send(:include, BundleFu::InstanceMethods)
Ruby
require 'fileutils.rb' class BundleFu::FileList attr_accessor :filelist def initialize(filenames=[]) self.filelist = [] self.add_files(filenames) end def initialize_copy(from) self.filelist = from.filelist.collect{|entry| entry.clone} end def filenames self.fil...
Ruby
class BundleFu class << self attr_accessor :content_store def init @content_store = {} end def bundle_files(filenames=[]) return nil if filenames.empty? output = "" filenames.each{|filename| output << "/* -------------- #{filename} ------------...
Ruby
require 'test/unit' require "rubygems" require 'active_support' for file in ["../lib/bundle_fu.rb", "../lib/bundle_fu/file_list.rb", "../lib/bundle_fu/file_list.rb", "mock_view.rb"] require File.expand_path(File.join(File.dirname(__FILE__), file)) end def dbg require 'ruby-debug' Debugger.start deb...
Ruby
class MockView # set RAILS_ROOT to fixtures dir so we use those files include BundleFu::InstanceMethods ::RAILS_ROOT = File.join(File.dirname(__FILE__), 'fixtures') attr_accessor :output attr_accessor :session attr_accessor :params def initialize @output = "" @session = {} @param...
Ruby
# EZ Bundle for file in ["/lib/bundle_fu.rb", "/lib/bundle_fu/file_list.rb"] require File.expand_path(File.join(File.dirname(__FILE__), file)) end ActionView::Base.send(:include, BundleFu::InstanceMethods)
Ruby
require 'fileutils.rb' class BundleFu::FileList attr_accessor :filelist def initialize(filenames=[]) self.filelist = [] self.add_files(filenames) end def initialize_copy(from) self.filelist = from.filelist.collect{|entry| entry.clone} end def filenames self.fil...
Ruby
class BundleFu class << self attr_accessor :content_store def init @content_store = {} end def each_read_file(filenames=[]) filenames.each{ |filename| output = "/* -------------- #{filename} ------------- */ " output << "\n" output << (File.read(F...
Ruby
require 'test/unit' require "rubygems" require 'active_support' for file in ["../lib/bundle_fu.rb", "../lib/bundle_fu/file_list.rb", "../lib/bundle_fu/file_list.rb", "mock_view.rb"] require File.expand_path(File.join(File.dirname(__FILE__), file)) end def dbg require 'ruby-debug' Debugger.start deb...
Ruby
class MockView # set RAILS_ROOT to fixtures dir so we use those files include BundleFu::InstanceMethods ::RAILS_ROOT = File.join(File.dirname(__FILE__), 'fixtures') attr_accessor :output attr_accessor :session attr_accessor :params def initialize @output = "" @session = {} @param...
Ruby
# EZ Bundle for file in ["/lib/bundle_fu.rb", "/lib/bundle_fu/file_list.rb"] require File.expand_path(File.join(File.dirname(__FILE__), file)) end ActionView::Base.send(:include, BundleFu::InstanceMethods)
Ruby
require 'fileutils.rb' class BundleFu::FileList attr_accessor :filelist def initialize(filenames=[]) self.filelist = [] self.add_files(filenames) end def initialize_copy(from) self.filelist = from.filelist.collect{|entry| entry.clone} end def filenames self.fil...
Ruby
class BundleFu class << self attr_accessor :content_store def init @content_store = {} end def each_read_file(filenames=[]) filenames.each{ |filename| output = "/* -------------- #{filename} ------------- */ " output << "\n" output << (File.read(F...
Ruby
require 'test/unit' require "rubygems" require 'active_support' for file in ["../lib/bundle_fu.rb", "../lib/bundle_fu/file_list.rb", "../lib/bundle_fu/file_list.rb", "mock_view.rb"] require File.expand_path(File.join(File.dirname(__FILE__), file)) end def dbg require 'ruby-debug' Debugger.start deb...
Ruby
class MockView # set RAILS_ROOT to fixtures dir so we use those files include BundleFu::InstanceMethods ::RAILS_ROOT = File.join(File.dirname(__FILE__), 'fixtures') attr_accessor :output attr_accessor :session attr_accessor :params def initialize @output = "" @session = {} @param...
Ruby
# EZ Bundle for file in ["/lib/bundle_fu.rb", "/lib/bundle_fu/file_list.rb"] require File.expand_path(File.join(File.dirname(__FILE__), file)) end ActionView::Base.send(:include, BundleFu::InstanceMethods)
Ruby
require 'fileutils.rb' class BundleFu::FileList attr_accessor :filelist def initialize(filenames=[]) self.filelist = [] self.add_files(filenames) end def initialize_copy(from) self.filelist = from.filelist.collect{|entry| entry.clone} end def filenames self.fil...
Ruby
class BundleFu class << self attr_accessor :content_store def init @content_store = {} end def each_read_file(filenames=[]) filenames.each{ |filename| output = "/* -------------- #{filename} ------------- */ " output << "\n" output << (File.read(F...
Ruby
require 'test/unit' require "rubygems" require 'active_support' for file in ["../lib/bundle_fu.rb", "../lib/bundle_fu/file_list.rb", "../lib/bundle_fu/file_list.rb", "mock_view.rb"] require File.expand_path(File.join(File.dirname(__FILE__), file)) end def dbg require 'ruby-debug' Debugger.start deb...
Ruby
class MockView # set RAILS_ROOT to fixtures dir so we use those files include BundleFu::InstanceMethods ::RAILS_ROOT = File.join(File.dirname(__FILE__), 'fixtures') attr_accessor :output attr_accessor :session attr_accessor :params def initialize @output = "" @session = {} @param...
Ruby
# EZ Bundle for file in ["/lib/bundle_fu.rb", "/lib/bundle_fu/file_list.rb"] require File.expand_path(File.join(File.dirname(__FILE__), file)) end ActionView::Base.send(:include, BundleFu::InstanceMethods)
Ruby
require 'fileutils.rb' class BundleFu::FileList attr_accessor :filelist def initialize(filenames=[]) self.filelist = [] self.add_files(filenames) end def initialize_copy(from) self.filelist = from.filelist.collect{|entry| entry.clone} end def filenames self.fil...
Ruby
class BundleFu class << self attr_accessor :content_store def init @content_store = {} end def bundle_files(filenames=[]) return nil if filenames.empty? output = "" filenames.each{|filename| output << "/* -------------- #{filename} ------------...
Ruby
require 'test/unit' require "rubygems" require 'active_support' for file in ["../lib/bundle_fu.rb", "../lib/bundle_fu/file_list.rb", "../lib/bundle_fu/file_list.rb", "mock_view.rb"] require File.expand_path(File.join(File.dirname(__FILE__), file)) end def dbg require 'ruby-debug' Debugger.start deb...
Ruby
class MockView # set RAILS_ROOT to fixtures dir so we use those files include BundleFu::InstanceMethods ::RAILS_ROOT = File.join(File.dirname(__FILE__), 'fixtures') attr_accessor :output def initialize @output = "" end def capture(&block) yield end def concat(output,...
Ruby
# EZ Bundle for file in ["/lib/bundle_fu.rb", "/lib/js_minimizer.rb", "/lib/bundle_fu/file_list.rb"] end require File.expand_path(File.join(File.dirname(__FILE__), "environment.rb")) ActionView::Base.send(:include, BundleFu::InstanceMethods)
Ruby
# load all files for file in ["/lib/bundle_fu.rb", "/lib/bundle_fu/js_minimizer.rb", "/lib/bundle_fu/css_url_rewriter.rb", "/lib/bundle_fu/file_list.rb"] require File.expand_path(File.join(File.dirname(__FILE__), file)) end
Ruby
#!/usr/bin/ruby # jsmin.rb 2007-07-20 # Author: Uladzislau Latynski # This work is a translation from C to Ruby of jsmin.c published by # Douglas Crockford. Permission is hereby granted to use the Ruby # version under the same conditions as the jsmin.c on which it is # based. # # /* jsmin.c # 2003-04-21 # # Copyrig...
Ruby
#!/usr/bin/ruby # jsmin.rb 2007-07-20 # Author: Uladzislau Latynski # This work is a translation from C to Ruby of jsmin.c published by # Douglas Crockford. Permission is hereby granted to use the Ruby # version under the same conditions as the jsmin.c on which it is # based. # # /* jsmin.c # 2003-04-21 # # Copyrig...
Ruby
require 'fileutils.rb' class BundleFu::FileList attr_accessor :filelist def initialize(filenames=[]) self.filelist = [] self.add_files(filenames) end def initialize_copy(from) self.filelist = from.filelist.collect{|entry| entry.clone} end def filenames self.fil...
Ruby
class BundleFu::CSSUrlRewriter class << self # rewrites a relative path to an absolute path, removing excess "../" and "./" # rewrite_relative_path("stylesheets/default/global.css", "../image.gif") => "/stylesheets/image.gif" def rewrite_relative_path(source_filename, relative_url) relative_url = re...
Ruby
class BundleFu include ERB::Util include ActionView::Helpers::TagHelper include ActionView::Helpers::AssetTagHelper cattr_accessor :content_store, :default_name, :js_path, :css_path self.content_store = {} def initialize(content, options = {}) @content = content @new_files = nil @...
Ruby
module ActionView module Helpers module TagHelper # stub end module AssetTagHelper def stylesheet_link_tag(*args) args.collect{|arg| "<link href=\"#{arg}?#{File.mtime(File.join(RAILS_ROOT, 'public', arg)).to_i}\" media=\"screen\" rel=\"Stylesheet\" type=\"text/css\" />" } * "\n"...
Ruby
Dir[File.join(File.dirname(__FILE__), "functional/*.rb")].each{|filename| require filename }
Ruby
require 'test/unit' require "rubygems" require 'active_support' require 'erb' for file in ["asset_tag_helper", "../environment.rb", "mock_view.rb"] require File.expand_path(File.join(File.dirname(__FILE__), file)) end def dbg require 'ruby-debug' Debugger.start debugger end class Object def t...
Ruby
class MockView # set RAILS_ROOT to fixtures dir so we use those files include BundleFu::InstanceMethods include ActionView::Helpers::AssetTagHelper ::RAILS_ROOT = File.join(File.dirname(__FILE__), 'fixtures') attr_accessor :output attr_accessor :session attr_accessor :params def initialize ...
Ruby
def fakt(x) fak = 1 (1..x).each {|x| fak = fak*x} return fak end p fakt(10)
Ruby
# Require any additional compass plugins here. # Set this to the root of your project when deployed: http_path = "/" css_dir = "stylesheets" sass_dir = "sass" images_dir = "images" javascripts_dir = "javascripts" # You can select your preferred output style here (can be overridden via the command line): # output_styl...
Ruby
# Be sure to restart your server when you modify this file. # Add new inflection rules using the following format. Inflections # are locale specific, and you may define rules for as many different # locales as you wish. All of these examples are active by default: # ActiveSupport::Inflector.inflections(:en) do |inflec...
Ruby
# Be sure to restart your server when you modify this file. # Version of your assets, change this if you want to expire all your assets. Rails.application.config.assets.version = '1.0' # Precompile additional assets. # application.js, application.css, and all non-JS/CSS in app/assets folder are already added. # Rails...
Ruby
# Be sure to restart your server when you modify this file. # Configure sensitive parameters which will be filtered from the log file. Rails.application.config.filter_parameters += [:password]
Ruby
# Be sure to restart your server when you modify this file. # Add new mime types for use in respond_to blocks: # Mime::Type.register "text/richtext", :rtf
Ruby
# Be sure to restart your server when you modify this file. # This file contains settings for ActionController::ParamsWrapper which # is enabled by default. # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. ActiveSupport.on_load(:action_controller) do wrap_parameters f...
Ruby
# Be sure to restart your server when you modify this file. Rails.application.config.session_store :cookie_store, key: '_buscapet_session'
Ruby
# Be sure to restart your server when you modify this file. Rails.application.config.action_dispatch.cookies_serializer = :json
Ruby
# Be sure to restart your server when you modify this file. # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } # You can also remove all the silencers if you're trying to debug a probl...
Ruby
Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. # Code is not reloaded between requests. config.cache_classes = true # Eager load code on boot. This eager loads most of Rails and # your application in memory, allowing both threaded web serve...
Ruby
Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. # In the development environment your application's code is reloaded on # every request. This slows down response time but is perfect for development # since you don't have to restart the web serv...
Ruby