`

Enabling Pry with reload

阅读更多

For anyone coming to this question recently: the answer has changed in Rails 3.2, because they've changed how they implement reload! Where in earlier version the irb commands were added as methods to Object, now they are added to IRB::ExtendCommandBundle to avoid polluting the global namespace.

What I do now is (1) in development.rb

silence_warnings do
  begin
    require 'pry'
    IRB = Pry
    module Pry::RailsCommands ;end
    IRB::ExtendCommandBundle = Pry::RailsCommands
  rescue LoadError
  end
end

and (2) in .pryrc

if Kernel.const_defined?("Rails") then
  require File.join(Rails.root,"config","environment")
  require 'rails/console/app'
  require 'rails/console/helpers'
  Pry::RailsCommands.instance_methods.each do |name| 
    Pry::Commands.command name.to_s do 
      Class.new.extend(Pry::RailsCommands).send(name)
    end
  end
end

Here's the link to the Rails pull request where the change was introduced -https://github.com/rails/rails/pull/3509

分享到:
评论

相关推荐

    嵌入推理在ARM架构的实现案例分析Enabling Embedded Inference Engine with the ARM

    在嵌入式系统中实现深度学习推理一直是一个挑战性话题。随着物联网(IoT)设备对智能功能需求的增长,对于能够在资源受限的嵌入式系统上高效运行的深度学习模型的需求也日益增长。ARM架构作为一种广泛应用于嵌入式系统...

    Austin Gibbons:Enabling Data Science Teams with Laburnum

    Such a framework allows us to present a unified workflow to our end users through a web interface, enabling ad-hoc queries over large data sets without having to learn Spark for themselves.

    Enabling Confidential Computing in Cloud with Intel SGX and Libr

    "Enabling Confidential Computing in Cloud with Intel SGX and Library OSes"这个主题探讨了如何利用Intel Software Guard Extensions (SGX)技术和Library Operating Systems(库操作系统)来提升云环境中的数据...

    Application link enabling

    **应用链接启用 (Application Link Enabling, ALE)** ALE 是 SAP 系统中的一个关键技术,用于在不同组件、模块或系统之间实现数据的实时、自动传输。在本例中,ALE 被用于在一个 SAP 系统内连接两个公司(A 和 B)...

    COBIT5 enabling 过程

    COBIT 5是全球公认的IT治理和管理框架,旨在帮助IT专业人员和企业领导在确保信息系统(IS)的可信度、安全性、风险和控制等方面履行其职责,并向业务交付价值。ISACA,即信息系统审计与控制协会,是一个拥有95,000名...

    Enabling 6.4-Gbps pin LPDDR5 using bandwidth Improvement Techniques

    PAPER_07_Enabling 6.4-Gbps pin LPDDR5 using bandwidth Improvement Techniques.pdf

    Practical Machine Learning with Python.pdf

    The availability of affordable compute power enabled by Moore’s law has been enabling rapid advances in Machine Learning solutions and driving adoption across diverse segments of the industry. The ...

    Towards A Novel Architecture for Enabling Interoperability Amongst Multiple Bloc

    区块链技术是一种分布式账本技术,它通过智能地融合对等网络(P2P)、密码学、分布式共识协议和智能合约等技术,构建了一个可在不信任的网络节点之间建立信任的环境。随着其不可变性、透明性和共识的特性,区块链技术...

    Beginning Cryptography With Java 带源码

    Building on that foundation, the second half of the book takes you into higher-level topics, enabling you to create and implement secure Java applications and make use of standard protocols such as ...

    Applied Text Analysis with Python Language-Aware Data Products Machine Learning

    You’ll learn robust, repeatable, and scalable techniques for text analysis with Python, including contextual and linguistic feature engineering, vectorization, classification, topic modeling, entity ...

    Enabling Large-Scale Storage in Sensor Networks with the Coffee File System

    ### 大规模传感器网络中的Coffee文件系统:实现与优化 #### 概述 在当今的物联网(IoT)时代,传感器网络已经成为收集环境数据、监控工业过程和促进智能家居的重要手段。随着传感器网络规模的不断扩大,如何高效地...

    COBIT5-Enabling-Chinese.pdf

    COBIT是ControlledObjectives for Information and Related Technology的缩写,即信息及相关技术的控制目标。COBIT是 ISACA(信息系统审计和控制联合会)制订的面向过程的信息系统审计和评价的标准。...

    Prentice.Hall.C++.GUI.Programming.with.Qt.4.2nd.Edition.2008.chm

    Enabling Drag and Drop Supporting Custom Drag Types Clipboard Handling Chapter 10. Item View Classes Using the Item View Convenience Classes Using Predefined Models Implementing Custom ...

    Beginning.Amazon.Web.Services.with.Node.js.1484206541

    Beginning Amazon Web Services with Node.js teaches any novice Node.js developer to configure, deploy, and maintain scalable small to large scale Node.js applications in Amazon Web Services. Hosting a ...

    GeoCrowd-Prasentation

    在参考资料方面,Leyla Kazemi和Cyrus Shahabi发表的《GeoCrowd: Enabling Query Answering with Spatial Crowdsourcing》是一篇关于如何利用空间众包回答查询问题的研究文章,而Ford和Fulkerson在1956年发表的...

    Mastering.Geospatial.Analysis.with.Python

    Chapter 14, Cloud Geodatabase Analysis and Visualization, introduces the readers to the CARTOframes Python package, enabling the integration of Carto maps, analysis, and data services into data ...

Global site tag (gtag.js) - Google Analytics