Rails 5 recompiles templates on every request in test env. Fix will be released only in 5.0.2.
Add this lines to test helper to get the performance now (I've got x2 improvement):
class << ActionView::LookupContext::DetailsKey
def clear| class RedisStats | |
| attr_reader :redis, :pattern | |
| def initialize(redis, pattern = '*') | |
| @redis = redis | |
| @pattern = pattern | |
| end | |
| def all_keys | |
| @all_keys ||= [].tap do |result| |
| # Simple policy implementation. Like a mixin of Pundit and CanCan. | |
| module Policy | |
| ACTIONS_MAP = { | |
| index: :read, | |
| show: :read, | |
| new: :create, | |
| edit: :update, | |
| }.freeze | |
| class Error < StandardError; end |
| # Copyright (c) Maxim Melentiev. | |
| # This source code is licensed under the MIT license. | |
| # | |
| # Inspired by | |
| # https://github.com/jeffreyguenther/vue-turbolinks/blob/master/index.js | |
| # but changed to support going back to cached page with vue instance. | |
| # Original version will keep instance created from cache along with new one. | |
| plugin = | |
| instances: [] |
| # lib/capistrano/tasks/telegram_bot.rake | |
| namespace :telegram do | |
| namespace :bot do | |
| namespace :poller do | |
| { | |
| start: 'start an instance of the application', | |
| stop: 'stop all instances of the application', | |
| restart: 'stop all instances and restart them afterwards', | |
| reload: 'send a SIGHUP to all instances of the application', |
| #!/usr/bin/env ruby | |
| # | |
| # For some/file.svg run: | |
| # | |
| # script some/file | |
| # | |
| # Requirement for mac os: | |
| # | |
| # brew cask install inkscape |
First we’ll configure Rails, assuming you already have a copy of google-maps-utility-library-v3 in your repo. If you don’t have it yet, there are instructions in the bottom.
Most likely, you already have added utility folder to the assets pipeline:
# config/initializer/assets.rb
Rails.application.config.assets.paths += %W(
#{Rails.root}/vendor/assets/google-maps-utility-library-v3
| 2.2.1 (main):0[1] > Money.new(100, :RUB).currency.symbol | |
| => "₽" | |
| 2.2.1 (main):0[2] > show-method Money.new(100, :RUB).currency.symbol | |
| From: /Users/max/.rvm/gems/ruby-2.2.1/gems/money-6.5.1/lib/money/currency.rb @ line 211: | |
| Owner: Money::Currency | |
| Visibility: public | |
| Number of lines: 3 | |
| attr_reader :id, :priority, :iso_code, :iso_numeric, :name, :symbol, |
| <?php | |
| class SqlAdapter | |
| { | |
| protected $pdo; | |
| protected $query; | |
| protected $sth; | |
| protected $params; | |
| protected $lastMethod; | |
| require 'benchmark' | |
| require 'active_support/all' | |
| class Class | |
| def class_attribute2(*attrs) | |
| options = attrs.extract_options! | |
| instance_reader = options.fetch(:instance_accessor, true) && options.fetch(:instance_reader, true) | |
| instance_writer = options.fetch(:instance_accessor, true) && options.fetch(:instance_writer, true) | |
| instance_predicate = options.fetch(:instance_predicate, true) |