﻿<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>Ruby教程</title>
    <link>https://www.herecours.com//www.herecours.com/list-45-0.html</link>
    <description>Latest 50 infos of Ruby教程</description>
    <copyright>Copyright(C) Empire CMS</copyright>
    <generator>Empire CMS by Empire Studio.</generator>
    <lastBuildDate>Mon, 03 Aug 2026 05:32:41 +0000</lastBuildDate>
    <ttl>60</ttl>
    <image>
      <url>https://www.herecours.com//www.herecours.com/e/data/images/rss.gif</url>
      <title>帝国网站管理系统</title>
      <link>https://www.herecours.com//www.herecours.com/</link>
    </image>
    <item>
      <title><![CDATA[一站式解决mysql深分页问题]]></title>
      <description><![CDATA[ 引言什么是深分页问题????解决深分页问题????1.优化SQL语句（必做）2.子查询优化3.游标分页法优化闲谈????总结❤️引言在后端开发或者面试中，常常会遇到深分页的问题。在处理电商平台海量商品数据、社交媒体时间线等场景时，深分页问题会导致用户体验急剧下降，甚至造成服务器崩溃。接下来让我们解析一下深分页问题。什么是深分页问题? ]]></description>
      <link>https://www.herecours.com/backend/2026/02-28/94820.html</link>
      <guid>https://www.herecours.com/backend/2026/02-28/94820.html</guid>
      <category>Ruby教程</category>
      <author><![CDATA[]]></author>
      <pubDate>Sat, 28 Feb 2026 07:12:15 +0000</pubDate>
    </item>
    <item>
      <title><![CDATA[一文解读SQL生成工具]]></title>
      <description><![CDATA[ 01 工具使用语法文件预处理SQL 语句生成02 工具实现产生式的表示方法Token 解析SQL 生成SQL 生成工具可用于测试Parser与其他数据库产品的兼容性，通过解析YACC语法文件中的产生式，生成对应的SQL语句，再使用数据库执行该SQL，根据结果判断语句是否与其他数据库语法兼容。01 工具使用语法文件预处理预处理目的是将语法文件中无关的 ]]></description>
      <link>https://www.herecours.com/backend/2026/02-16/14900.html</link>
      <guid>https://www.herecours.com/backend/2026/02-16/14900.html</guid>
      <category>Ruby教程</category>
      <author><![CDATA[]]></author>
      <pubDate>Mon, 16 Feb 2026 05:12:02 +0000</pubDate>
    </item>
    <item>
      <title><![CDATA[Ruby的面向对象方式编程学习杂记]]></title>
      <description><![CDATA[ 打开类可以重新打开已经存在的类并对之进行动态修改，即使像String或者Array这样标准库的类也不例外。这种行为方式称之为打开类(open class)猴子补丁如果你粗心地为某个类添加了新功能，同时覆盖了类原来的功能，进而影响到其他部分的代码，这样的patch称之为猴子补丁(Monkeypatch)类与模块Ruby的class关键字更像是一个作用域操作符 ]]></description>
      <link>https://www.herecours.com/backend/2026/02-16/12692.html</link>
      <guid>https://www.herecours.com/backend/2026/02-16/12692.html</guid>
      <category>Ruby教程</category>
      <author><![CDATA[]]></author>
      <pubDate>Mon, 16 Feb 2026 03:19:34 +0000</pubDate>
    </item>
    <item>
      <title><![CDATA[Jekyll静态网站后台引擎使用教程]]></title>
      <description><![CDATA[ 以前总想搭建一个自己的个人网站，由于不懂php后台，所以在点点网开过自己的博客，后来慢慢向程序员转变，点点网的博客已经不能满足这个职业特定的需求，于是用worldpress搭建了自己的第一个网站，鼓捣过几天worldpress，从购买域名空间，修改空间域名解析，添加模板，修改模板，了解了worldpress的强大之处，但是鼓捣玩了worldpress之后，没有了写文 ]]></description>
      <link>https://www.herecours.com/backend/2026/02-16/12689.html</link>
      <guid>https://www.herecours.com/backend/2026/02-16/12689.html</guid>
      <category>Ruby教程</category>
      <author><![CDATA[]]></author>
      <pubDate>Mon, 16 Feb 2026 03:19:32 +0000</pubDate>
    </item>
    <item>
      <title><![CDATA[Ruby中gem包管理器的用法及用bundler来管理多版本的gem]]></title>
      <description><![CDATA[ gem常用命令gem -v # 查看RubyGems软件的版本gem help #显示RubyGem使用帮助gem help example #列出RubyGem命令一些使用范例gem install gemname # 安装指定gem包，程序先从本机查找gem包并安装，如果本地没有，则从远程gem安装。gem install -l gemname # 仅从本机安装gem包gem inst ]]></description>
      <link>https://www.herecours.com/backend/2026/02-16/12690.html</link>
      <guid>https://www.herecours.com/backend/2026/02-16/12690.html</guid>
      <category>Ruby教程</category>
      <author><![CDATA[]]></author>
      <pubDate>Mon, 16 Feb 2026 03:19:32 +0000</pubDate>
    </item>
    <item>
      <title><![CDATA[Ruby on Rails中Rack中间件的基础学习教程]]></title>
      <description><![CDATA[ rack是ruby服务器和rack应用程序之间的一个框架，rails,sinatra都是基于rack构建的，都属于rack应用程序。rack提供了一个标准的接口，用于与服务器进行交互。标准的rack程序是一个可以响应call的对象，可以是对象、Proc、lambda甚至是method，它接收env参数（环境对象），返回一个数组，数组包括：  状态(status)，http响应状态码  可以是has ]]></description>
      <link>https://www.herecours.com/backend/2026/02-16/12691.html</link>
      <guid>https://www.herecours.com/backend/2026/02-16/12691.html</guid>
      <category>Ruby教程</category>
      <author><![CDATA[]]></author>
      <pubDate>Mon, 16 Feb 2026 03:19:32 +0000</pubDate>
    </item>
    <item>
      <title><![CDATA[Ruby程序中正则表达式的基本使用教程]]></title>
      <description><![CDATA[ Ruby大部分的内置类型都和其它的编程语言很相似。主要有strings，integers，floats，arrays等等。然而，只有脚本语言，如Ruby，Perl，和awk等提供了内置表达式类型的支持。正则表达式尽管比较隐蔽，但却是一个很强大的文本处理工具。正则表达式是使用指定的模式匹配字符串的一种简单的方法。在Ruby中，创建正则表达式的典型方式是把模式写在两 ]]></description>
      <link>https://www.herecours.com/backend/2026/02-16/12685.html</link>
      <guid>https://www.herecours.com/backend/2026/02-16/12685.html</guid>
      <category>Ruby教程</category>
      <author><![CDATA[]]></author>
      <pubDate>Mon, 16 Feb 2026 03:19:31 +0000</pubDate>
    </item>
    <item>
      <title><![CDATA[Ruby on Rails所构建的应用程序基本目录结构总结]]></title>
      <description><![CDATA[ 当使用rails new appname生成Rails应用后，我们可以通过tree来查看Rails应用的目录结构：目录结构应用程序目录下会有app、config、db、doc、lib、log、public、script、test、tmp和vendor等11个目录和config.ru、Gemfile、Gemfile.lock、Rakefile、README.rdoc等5个文件。目录在稍后会一一解释， ]]></description>
      <link>https://www.herecours.com/backend/2026/02-16/12686.html</link>
      <guid>https://www.herecours.com/backend/2026/02-16/12686.html</guid>
      <category>Ruby教程</category>
      <author><![CDATA[]]></author>
      <pubDate>Mon, 16 Feb 2026 03:19:31 +0000</pubDate>
    </item>
    <item>
      <title><![CDATA[简要解读Ruby面向对象编程中的作用域]]></title>
      <description><![CDATA[ 作用域Ruby中不具备嵌套作用域(即在内部作用域，可以看到外部作用域的)的特点，它的作用域是截然分开的，一旦进入一个新的作用域，原先的绑定会被替换为一组新的绑定。程序会在三个地方关闭前一个作用域，同时打开一个新的作用域，它们是:  类定义class  模块定义 module  方法定义 def上面三个关键字，每个关键字对应一个作用域门(进入)， ]]></description>
      <link>https://www.herecours.com/backend/2026/02-16/12687.html</link>
      <guid>https://www.herecours.com/backend/2026/02-16/12687.html</guid>
      <category>Ruby教程</category>
      <author><![CDATA[]]></author>
      <pubDate>Mon, 16 Feb 2026 03:19:31 +0000</pubDate>
    </item>
    <item>
      <title><![CDATA[详解Ruby中的instance_eval方法及其与class_eval的对比]]></title>
      <description><![CDATA[ instance_eval方法这个BasicObject#instance_eval有点类似JS中的bind方法，不同的时，bind是将this传入到对象中，而instance_eval则是将代码块(上下文探针Context Probe)传入到指定的对象中，一个是传对象，一个是传执行体。通过这种方式就可以在instance_eval中的代码块里访问到调用者对象中的变量。示例代码class MyCl ]]></description>
      <link>https://www.herecours.com/backend/2026/02-16/12688.html</link>
      <guid>https://www.herecours.com/backend/2026/02-16/12688.html</guid>
      <category>Ruby教程</category>
      <author><![CDATA[]]></author>
      <pubDate>Mon, 16 Feb 2026 03:19:31 +0000</pubDate>
    </item>
    <item>
      <title><![CDATA[Ruby编写HTML脚本替换小程序的实例分享]]></title>
      <description><![CDATA[ 在一个文件里有很多以下内容：此题选D。............而本人要实现的功能是将它替换成：此题选D。...............这个东西看起来有点简单，但本人整整花了半天才实现此功能，主要是很久没写RUBY程序了，所以对API比较陌生； ]]></description>
      <link>https://www.herecours.com/backend/2026/02-16/12681.html</link>
      <guid>https://www.herecours.com/backend/2026/02-16/12681.html</guid>
      <category>Ruby教程</category>
      <author><![CDATA[]]></author>
      <pubDate>Mon, 16 Feb 2026 03:19:30 +0000</pubDate>
    </item>
    <item>
      <title><![CDATA[Ruby与Ruby on Rails框架环境搭建的简明教程]]></title>
      <description><![CDATA[ 安装Ruby与升级RubyGems提示：在Ubuntu环境下安装过程中，如果提示权限问题，可以使用sudo make和sudo make install。1.Ruby安装wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p125.tar.gz \&amp;&amp; tar -xzvf ruby-1.9.3-p125.tar.gz \&amp;&amp; cd ruby- ]]></description>
      <link>https://www.herecours.com/backend/2026/02-16/12682.html</link>
      <guid>https://www.herecours.com/backend/2026/02-16/12682.html</guid>
      <category>Ruby教程</category>
      <author><![CDATA[]]></author>
      <pubDate>Mon, 16 Feb 2026 03:19:30 +0000</pubDate>
    </item>
    <item>
      <title><![CDATA[Ruby中的gem包管理的使用及gem源搭建教程]]></title>
      <description><![CDATA[ 熟练使用RubyGemsRubyGems是Ruby的插件管理系统，可以轻松安装及管理Ruby函式库。可以在RubyGems上找到所有开源套件。###常见指令  gem -v 查看RubyGems的版本  gem update --system 升级RubyGems的版本  gem install gem_name 安装某个插件  gem install -v x.x.x gem_name 安装指定 ]]></description>
      <link>https://www.herecours.com/backend/2026/02-16/12683.html</link>
      <guid>https://www.herecours.com/backend/2026/02-16/12683.html</guid>
      <category>Ruby教程</category>
      <author><![CDATA[]]></author>
      <pubDate>Mon, 16 Feb 2026 03:19:30 +0000</pubDate>
    </item>
    <item>
      <title><![CDATA[Linux下Redis数据库的安装方法与自动启动脚本分享]]></title>
      <description><![CDATA[ 安装Redis(1) 下载Rediswget http://redis.googlecode.com/files/redis-2.2.11.tar.gztar xzvf redis-2.2.11.tar.gz(2) 编译并安装Redismake &amp;&amp; make install(3) 复制并修改配置文件cp redis.conf /etc/redis.confvi /etc/redis.conf注意 ]]></description>
      <link>https://www.herecours.com/backend/2026/02-16/12684.html</link>
      <guid>https://www.herecours.com/backend/2026/02-16/12684.html</guid>
      <category>Ruby教程</category>
      <author><![CDATA[]]></author>
      <pubDate>Mon, 16 Feb 2026 03:19:30 +0000</pubDate>
    </item>
    <item>
      <title><![CDATA[深入理解Ruby中的代码块block特性]]></title>
      <description><![CDATA[ block是什么？在Ruby中，block并不罕见。官方对block的定义是“一段被包裹着的代码”。当然，我觉得这样的解释不会让你变的更明白。对block的一种更简单的描述是“一个block就是一段存储在一个变量中的代码，它和其他的对象一样，可以被随时的运行”然后，咱们通过看一些代码，之后再把这些代码重构成Ruby中的block形式。通过代码来实际的 ]]></description>
      <link>https://www.herecours.com/backend/2026/02-16/12677.html</link>
      <guid>https://www.herecours.com/backend/2026/02-16/12677.html</guid>
      <category>Ruby教程</category>
      <author><![CDATA[]]></author>
      <pubDate>Mon, 16 Feb 2026 03:19:29 +0000</pubDate>
    </item>
    <item>
      <title><![CDATA[Ruby中的block代码块学习教程]]></title>
      <description><![CDATA[ 1、什么是代码块在Ruby中，{}或do...end之间的代码是一个代码块。代码块只能出现在一个方法的后边，它紧接在方法最后一个参数的同一行上，由yield关键字调用。例如：1,2,3,4,5.each { |i| puts i }1,2,3,4,5.each do |i| puts iend块变量：以yield关键字调用block也可以传递参数，block中竖线(|)之间给出的参数名用于 ]]></description>
      <link>https://www.herecours.com/backend/2026/02-16/12678.html</link>
      <guid>https://www.herecours.com/backend/2026/02-16/12678.html</guid>
      <category>Ruby教程</category>
      <author><![CDATA[]]></author>
      <pubDate>Mon, 16 Feb 2026 03:19:29 +0000</pubDate>
    </item>
    <item>
      <title><![CDATA[Ruby中的Proc类及Proc的类方法Proc.new的使用解析]]></title>
      <description><![CDATA[ Proc是对块及其context(局部变量的作用域以及栈框架)进行对象化处理之后得到的过程对象。您可以像使用无名函数那样来使用Proc，但它不会导入局部变量的作用域(可以把动态局部变量用作Proc局部变量)。在下例中，正因为Proc一直保持着局部变量的作用域，所以才能调用var变量。var = 1$foo = Proc.new { var }var = 2def foo $foo.ca ]]></description>
      <link>https://www.herecours.com/backend/2026/02-16/12679.html</link>
      <guid>https://www.herecours.com/backend/2026/02-16/12679.html</guid>
      <category>Ruby教程</category>
      <author><![CDATA[]]></author>
      <pubDate>Mon, 16 Feb 2026 03:19:29 +0000</pubDate>
    </item>
    <item>
      <title><![CDATA[详解Ruby中的代码块对象Proc]]></title>
      <description><![CDATA[ Proc对象Proc是由块转换来的对象。创建一个Proc共有四种方法,分别是:示例代码# 法一inc = Proc.new { | x | x + 1}inc.call(2) #=&gt; 3# 法二inc = lambda {| x | x + 1 }inc.call(2) #=&gt; 3# 法三inc = -&gt;(x) { x + 1}inc.call(2) #=&gt; 3# 法四inc = proc {|x ]]></description>
      <link>https://www.herecours.com/backend/2026/02-16/12680.html</link>
      <guid>https://www.herecours.com/backend/2026/02-16/12680.html</guid>
      <category>Ruby教程</category>
      <author><![CDATA[]]></author>
      <pubDate>Mon, 16 Feb 2026 03:19:29 +0000</pubDate>
    </item>
    <item>
      <title><![CDATA[详解Ruby中的代码块及其参数传递]]></title>
      <description><![CDATA[ 一，块的声明 块的声明在函数调用之后，用{..}括起来，或do..end封装。{}一般用在单行语句上，do..end用在多行语句上。(1..4).each{|v| print &amp;quot;#{v} &amp;quot;} #输出1 2 3 4  块可以带参数，与函数参数不同，块参数用||封装，当然，可以带多个参数。这些参数怎么定义，实际上是在函数内部定义好的，后面会讲到。二，块内变量的访问 块内可以访问块外的 ]]></description>
      <link>https://www.herecours.com/backend/2026/02-16/12674.html</link>
      <guid>https://www.herecours.com/backend/2026/02-16/12674.html</guid>
      <category>Ruby教程</category>
      <author><![CDATA[]]></author>
      <pubDate>Mon, 16 Feb 2026 03:19:28 +0000</pubDate>
    </item>
    <item>
      <title><![CDATA[借助RubyGnome2库进行GTK下的Ruby GUI编程的基本方法]]></title>
      <description><![CDATA[ 前言随着RubyGnome2库越来越完善，以及ruby1.9的性能提升，用Ruby编写GUI程序渐渐从我的业余爱好转为我工作的一个重要部分。用Ruby写程序确实很有乐趣，它可以让你的想法快速地以一种优雅的方式实现。本文介绍的一个gem就是一个例子，用很少的代码，实现很有趣的功能，让编写Ruby GUI程序变得轻松愉快。RubyGnome2介绍虽然我以前也曾经 ]]></description>
      <link>https://www.herecours.com/backend/2026/02-16/12675.html</link>
      <guid>https://www.herecours.com/backend/2026/02-16/12675.html</guid>
      <category>Ruby教程</category>
      <author><![CDATA[]]></author>
      <pubDate>Mon, 16 Feb 2026 03:19:28 +0000</pubDate>
    </item>
    <item>
      <title><![CDATA[Luhn算法学习及其Ruby版实现代码示例]]></title>
      <description><![CDATA[ 关于LUHN算法LUHN算法，主要用来计算信用卡等证件号码的合法性。1、从卡号最后一位数字开始,偶数位乘以2,如果乘以2的结果是两位数，将两个位上数字相加保存。2、把所有数字相加,得到总和。3、如果信用卡号码是合法的，总和可以被10整除。Luhn 算法或是Luhn 公式，也被称作“模10算法”。它是一种简单的校验公式，一般会被用于身份证号 ]]></description>
      <link>https://www.herecours.com/backend/2026/02-16/12676.html</link>
      <guid>https://www.herecours.com/backend/2026/02-16/12676.html</guid>
      <category>Ruby教程</category>
      <author><![CDATA[]]></author>
      <pubDate>Mon, 16 Feb 2026 03:19:28 +0000</pubDate>
    </item>
    <item>
      <title><![CDATA[Monkey Patch猴子补丁编程方式及其在Ruby中的运用]]></title>
      <description><![CDATA[ 何谓猴子补丁（Monkey Patch）？在动态语言中，不修改源代码而对功能进行追加和变更。使用猴子补丁的目的： 1、追加功能 2、功能变更 3、修正程序错误 4、增加钩子，在执行某个方法的同时执行一些其他的处理，如打印日志，实现AOP等， 5、缓存，在计算量很大，结算之后的结果可以反复使用的情况下，在一次计算完成之后，对方法进行替换可以提高处理速 ]]></description>
      <link>https://www.herecours.com/backend/2026/02-16/12672.html</link>
      <guid>https://www.herecours.com/backend/2026/02-16/12672.html</guid>
      <category>Ruby教程</category>
      <author><![CDATA[]]></author>
      <pubDate>Mon, 16 Feb 2026 03:19:27 +0000</pubDate>
    </item>
    <item>
      <title><![CDATA[Ruby面向对象编程中类与方法的基础学习]]></title>
      <description><![CDATA[ 打开类和猴子补丁 在Ruby中，类定义的方法和其他的语句没有任何区别，都是一行一行的执行下去的。如下例子：class Example  def method_1   puts &amp;quot;method 1&amp;quot;  end end class Example  def method_2   puts &amp;quot;method 2&amp;quot;  end end 本例中，当第一次定义Class Example的时候，还没有一个叫做Exa ]]></description>
      <link>https://www.herecours.com/backend/2026/02-16/12673.html</link>
      <guid>https://www.herecours.com/backend/2026/02-16/12673.html</guid>
      <category>Ruby教程</category>
      <author><![CDATA[]]></author>
      <pubDate>Mon, 16 Feb 2026 03:19:27 +0000</pubDate>
    </item>
    <item>
      <title><![CDATA[以MVC的思维方式来理解Ruby on Rails框架的设计结构]]></title>
      <description><![CDATA[ 在rails中，发送一个请求（/users)的处理全过程如下： 1）、浏览器发送请求（/users） 2）、Rails的 routes会把请求路由给users_controller的index方法 3）、users_controller回调用User Model获取所有的user 4）、User Model会从数据库中把所有的user读取出来， 5）、User Model把从数据库读取出来的所有u ]]></description>
      <link>https://www.herecours.com/backend/2026/02-16/12668.html</link>
      <guid>https://www.herecours.com/backend/2026/02-16/12668.html</guid>
      <category>Ruby教程</category>
      <author><![CDATA[]]></author>
      <pubDate>Mon, 16 Feb 2026 03:19:26 +0000</pubDate>
    </item>
    <item>
      <title><![CDATA[冒泡排序算法及Ruby版的简单实现]]></title>
      <description><![CDATA[ 算法原理：比较相邻的元素。如果第一个比第二个大，就交换他们两个。对每一对相邻元素作同样的工作，从开始第一对到结尾的最后一对。在这一点，最后的元素应该会是最大的数。针对所有的元素重复以上的步骤，除了最后一个。持续每次对越来越少的元素重复上面的步骤，直到没有任何一对数字需要比较。实现假设有这样一个数组: 4, 1, 3, 2 ]]></description>
      <link>https://www.herecours.com/backend/2026/02-16/12669.html</link>
      <guid>https://www.herecours.com/backend/2026/02-16/12669.html</guid>
      <category>Ruby教程</category>
      <author><![CDATA[]]></author>
      <pubDate>Mon, 16 Feb 2026 03:19:26 +0000</pubDate>
    </item>
    <item>
      <title><![CDATA[GitHub倡导的Ruby代码编写风格总结]]></title>
      <description><![CDATA[ 源代码布局方面： 1、所有源文件以UTF-8编码 2、使用2个空格的缩进 3、使用Unix风格的换行符（\n)，windows(\r\n)。可使用git config --global core.autocrlf true 防止产生windows风格的换行符。 4、在‘，&amp;#039;，‘；&amp;#039;后，操作符（除指数操作之外），‘{&amp;#039;，‘}&amp;#039;的前后增加空格，增加代码的可读性。 5、在‘（&amp;#039;，‘）&amp;#039;，‘&amp;#039;，‘&amp;#039;符 ]]></description>
      <link>https://www.herecours.com/backend/2026/02-16/12670.html</link>
      <guid>https://www.herecours.com/backend/2026/02-16/12670.html</guid>
      <category>Ruby教程</category>
      <author><![CDATA[]]></author>
      <pubDate>Mon, 16 Feb 2026 03:19:26 +0000</pubDate>
    </item>
    <item>
      <title><![CDATA[Ruby使用Monkey Patch猴子补丁方式进行程序开发的示例]]></title>
      <description><![CDATA[ 猴子补丁（Monkey Patch）是一种特殊的编程技巧。Monkey patch 可以用来在运行时动态地修改（扩展）类或模块。我们可以通过添加 Monkey Patch 来修改不满足自己需求的第三方库，也可以添加 Monkey Patch 零时修改代码中的错误。词源Monkey patch 最早被称作 Guerrilla patch，形容这种补丁像游击队员一样狡猾。后来因为发音相似，被称为 G ]]></description>
      <link>https://www.herecours.com/backend/2026/02-16/12671.html</link>
      <guid>https://www.herecours.com/backend/2026/02-16/12671.html</guid>
      <category>Ruby教程</category>
      <author><![CDATA[]]></author>
      <pubDate>Mon, 16 Feb 2026 03:19:26 +0000</pubDate>
    </item>
    <item>
      <title><![CDATA[详解Ruby中的单件方法和单件类]]></title>
      <description><![CDATA[ 单件方法Ruby允许给单个对象增加方法,这种只针对单个对象生效的方法，称为单件方法示例代码str = “just a regular string”def str.title  self.upcase == selfendstr.title # =&gt; falsestr.methods.grep(/title/) # =&gt; :titlestr.singleton_methods  #=&gt; :t ]]></description>
      <link>https://www.herecours.com/backend/2026/02-16/12664.html</link>
      <guid>https://www.herecours.com/backend/2026/02-16/12664.html</guid>
      <category>Ruby教程</category>
      <author><![CDATA[]]></author>
      <pubDate>Mon, 16 Feb 2026 03:19:25 +0000</pubDate>
    </item>
    <item>
      <title><![CDATA[Ruby的语法和语言特性总结]]></title>
      <description><![CDATA[ Ruby是一种解释型、面向对象、动态类型的语言。Ruby采取的策略是在灵活性和运行时安全之间寻找平衡点。随着Rails框架的出现，Ruby也在2006年前后一鸣惊人，同时也指引人们重新找回编程乐趣。尽管从执行速度上说，Ruby谈不上有多高效，但它却能让程序员的编程效率大幅提高。本文将讲述Ruby语言的基础语言特性，包括基本的语法及代码块 ]]></description>
      <link>https://www.herecours.com/backend/2026/02-16/12665.html</link>
      <guid>https://www.herecours.com/backend/2026/02-16/12665.html</guid>
      <category>Ruby教程</category>
      <author><![CDATA[]]></author>
      <pubDate>Mon, 16 Feb 2026 03:19:25 +0000</pubDate>
    </item>
    <item>
      <title><![CDATA[Ruby环境下安装使用bundler来管理多版本的gem]]></title>
      <description><![CDATA[ 有了rbenv来管理多版本的ruby环境，我们还需要一个能管理多版本gem(比如rails)的工具，那就是bundler了，项目背景不细说了，需要了解的直接到官网http://bundler.io/,这里只讲一些实际使用经验。安装gem install bundler使用mkdir app1; cd app1;echo &amp;quot;source &amp;#039;https://ruby.taobao.org/&amp;#039;&amp;quot; &amp;gt; G ]]></description>
      <link>https://www.herecours.com/backend/2026/02-16/12666.html</link>
      <guid>https://www.herecours.com/backend/2026/02-16/12666.html</guid>
      <category>Ruby教程</category>
      <author><![CDATA[]]></author>
      <pubDate>Mon, 16 Feb 2026 03:19:25 +0000</pubDate>
    </item>
    <item>
      <title><![CDATA[浅谈Ruby on Rails下的rake与数据库数据迁移操作]]></title>
      <description><![CDATA[ 不知道你有没有把数据迁移写入Migration文件的经历，相信无论是老鸟还是新手都这样干过吧。事实上，这样做并不是行不通，只不过这样的实践慢慢会给你引入一些不必要的麻烦。一般认为db/migrate文件夹里的内容是关于你数据库Schema的演变过程，每个新的开发或线上环境都要通过这些Migration来构建可用的数据库。但如果这里装入了，负责 ]]></description>
      <link>https://www.herecours.com/backend/2026/02-16/12667.html</link>
      <guid>https://www.herecours.com/backend/2026/02-16/12667.html</guid>
      <category>Ruby教程</category>
      <author><![CDATA[]]></author>
      <pubDate>Mon, 16 Feb 2026 03:19:25 +0000</pubDate>
    </item>
    <item>
      <title><![CDATA[实例讲解Ruby中的钩子方法及对方法调用添加钩子]]></title>
      <description><![CDATA[ 钩子方法有些类似事件驱动装置，可以在特定的事件发生后执行特定的回调函数，这个回调函数就是钩子方法(更形象的描述: 钩子方法可以像钩子一样，勾住一个特定的事件。)，在Rails中before\after函数就是最常见的钩子方法。Class#inherited方法也是这样一个钩子方法，当一个类被继承时，Ruby会调用该方法。默认情况下，Class#inherited什么 ]]></description>
      <link>https://www.herecours.com/backend/2026/02-16/12662.html</link>
      <guid>https://www.herecours.com/backend/2026/02-16/12662.html</guid>
      <category>Ruby教程</category>
      <author><![CDATA[]]></author>
      <pubDate>Mon, 16 Feb 2026 03:19:24 +0000</pubDate>
    </item>
    <item>
      <title><![CDATA[Ruby面向对象编程中类的方法与类的扩展]]></title>
      <description><![CDATA[ 类方法类方法其实质是生活在该类的单件类中的单件方法。其定义方法有三种，分别是:# 法一def MyClass.a_class_method; end# 法二class MyClass  def self.anther_class_method; endend# 法三*class MyClass  class  ]]></description>
      <link>https://www.herecours.com/backend/2026/02-16/12663.html</link>
      <guid>https://www.herecours.com/backend/2026/02-16/12663.html</guid>
      <category>Ruby教程</category>
      <author><![CDATA[]]></author>
      <pubDate>Mon, 16 Feb 2026 03:19:24 +0000</pubDate>
    </item>
    <item>
      <title><![CDATA[Ruby实现二分搜索(二分查找)算法的简单示例]]></title>
      <description><![CDATA[ 在计算机科学中，二分搜索（英语：binary search），也称折半搜索（英语：half-interval search）、对数搜索（英语：logarithmic search），是一种在有序数组中查找某一特定元素的搜索算法。搜索过程从数组的中间元素开始，如果中间元素正好是要查找的元素，则搜索过程结束；如果某一特定元素大于或者小于中间元素，则在数组大于或小于中间元素的那一半中查 ]]></description>
      <link>https://www.herecours.com/backend/2026/02-16/12660.html</link>
      <guid>https://www.herecours.com/backend/2026/02-16/12660.html</guid>
      <category>Ruby教程</category>
      <author><![CDATA[]]></author>
      <pubDate>Mon, 16 Feb 2026 03:19:23 +0000</pubDate>
    </item>
    <item>
      <title><![CDATA[Ruby中钩子方法的运用实例解析]]></title>
      <description><![CDATA[ 通过使用钩子方法，可以让我们在Ruby的类或模块的生命周期中进行干预，可以极大的提高编程的灵活性。与生命周期相关的钩子方法有下面这些:类与模块相关  Class#inherited  Module#include  Module#prepended  Module#extend_object  Module#method_added  Module#method_removed  Module#m ]]></description>
      <link>https://www.herecours.com/backend/2026/02-16/12661.html</link>
      <guid>https://www.herecours.com/backend/2026/02-16/12661.html</guid>
      <category>Ruby教程</category>
      <author><![CDATA[]]></author>
      <pubDate>Mon, 16 Feb 2026 03:19:23 +0000</pubDate>
    </item>
    <item>
      <title><![CDATA[Ruby中的Hash哈希类型基本操作方法小结]]></title>
      <description><![CDATA[ 1.创建哈希：就像创建数组一样，我们可以通过Hash类来创建一个Hash实例:h1 = Hash.new             #默认值为nilh2 = Hash.new(“This is my first hash instance”) #默认值为” This is my first hash instance”:上面两个例子都创建了一个空的Hash实例。一个Hash对象总是有一个默认的值—— ]]></description>
      <link>https://www.herecours.com/backend/2026/02-16/12658.html</link>
      <guid>https://www.herecours.com/backend/2026/02-16/12658.html</guid>
      <category>Ruby教程</category>
      <author><![CDATA[]]></author>
      <pubDate>Mon, 16 Feb 2026 03:19:14 +0000</pubDate>
    </item>
    <item>
      <title><![CDATA[Ruby实现插入排序算法及进阶的二路插入排序代码示例]]></title>
      <description><![CDATA[ 基础将一个记录插入到一个已经排序好的表中，以得到一个记录增一的有序表。并且最关键的一点就是它把比当前元素大的记录都往后移动，用以空出“自己”该插入的位置。当n-1趟插入完成后该记录就是有序序列。def insertSort(tarray)  i=1  while(i &amp;lt; tarray.size) do   if tarrayi &amp;lt; tarrayi-1     j=i-1     x=tar ]]></description>
      <link>https://www.herecours.com/backend/2026/02-16/12659.html</link>
      <guid>https://www.herecours.com/backend/2026/02-16/12659.html</guid>
      <category>Ruby教程</category>
      <author><![CDATA[]]></author>
      <pubDate>Mon, 16 Feb 2026 03:19:14 +0000</pubDate>
    </item>
    <item>
      <title><![CDATA[redis集群搭建教程及遇到的问题处理]]></title>
      <description><![CDATA[ 这里，在一个Linux虚拟机上搭建6个节点的redis伪集群，思路很简单，一台虚拟机上开启6个redis实例，每个redis实例有自己的端口。这样的话，相当于模拟出了6台机器了，然后在以这6个实例组建redis集群就可以了。前提:redis已经安装，目录为/usr/local/redis-4.0.1 如不会，可以参考一下文章 windows下安装redis Linux下安装redisredis集群 ]]></description>
      <link>https://www.herecours.com/backend/2026/02-16/12657.html</link>
      <guid>https://www.herecours.com/backend/2026/02-16/12657.html</guid>
      <category>Ruby教程</category>
      <author><![CDATA[]]></author>
      <pubDate>Mon, 16 Feb 2026 03:19:13 +0000</pubDate>
    </item>
    <item>
      <title><![CDATA[Python的Flask框架中SERVER_NAME域名项的配置教程]]></title>
      <description><![CDATA[ Flask中的SERVER_NAME主要做两件事：  协助Flask在活动的请求（request）之外生成绝对URL（比如邮件中嵌入网站URL）  用于子域名支持很多人误以为它可以做这两件事之外的其它事情。一、第一件事：绝对URL我们知道，url_for默认情况下是生成相对URL，它有个参数_external，如果设置为真，则会生成一个绝对URL（就是HTTP开头带域名等信息的）。若不指 ]]></description>
      <link>https://www.herecours.com/backend/2026/02-16/12656.html</link>
      <guid>https://www.herecours.com/backend/2026/02-16/12656.html</guid>
      <category>Ruby教程</category>
      <author><![CDATA[]]></author>
      <pubDate>Mon, 16 Feb 2026 03:19:11 +0000</pubDate>
    </item>
    <item>
      <title><![CDATA[Ruby on Rails框架程序连接MongoDB的教程]]></title>
      <description><![CDATA[ 前边有介绍mongodb的安装以及ror项目的搭建，现在进行一下整合。1.创建项目创建项目时不再使用rails active_record支持rails new todo -O2.我们将要使用MongoMapper来驱动MongoDB到Rails编辑GemFile，增加下面的内容gem&amp;quot;mongo_mapper&amp;quot;然后 执行 bundle install 安装gembundle install3.添 ]]></description>
      <link>https://www.herecours.com/backend/2026/02-16/12651.html</link>
      <guid>https://www.herecours.com/backend/2026/02-16/12651.html</guid>
      <category>Ruby教程</category>
      <author><![CDATA[]]></author>
      <pubDate>Mon, 16 Feb 2026 03:19:10 +0000</pubDate>
    </item>
    <item>
      <title><![CDATA[对优化Ruby on Rails性能的一些办法的探究]]></title>
      <description><![CDATA[ 1.导致你的 Rails 应用变慢无非以下两个原因：  在不应该将 Ruby and Rails 作为首选的地方使用 Ruby and Rails。（用 Ruby and Rails 做了不擅长做的工作）  过度的消耗内存导致需要利用大量的时间进行垃圾回收。Rails 是个令人愉快的框架，而且 Ruby 也是一个简洁而优雅的语言。但是如果它被滥用，那会相当的影响性能。有很多工作并 ]]></description>
      <link>https://www.herecours.com/backend/2026/02-16/12652.html</link>
      <guid>https://www.herecours.com/backend/2026/02-16/12652.html</guid>
      <category>Ruby教程</category>
      <author><![CDATA[]]></author>
      <pubDate>Mon, 16 Feb 2026 03:19:10 +0000</pubDate>
    </item>
    <item>
      <title><![CDATA[Ruby on Rails实现最基本的用户注册和登录功能的教程]]></title>
      <description><![CDATA[ 在 Rails 实现用户注册和登录功能是非常方便的，比如可以使用 Devise 这类实现了完整功能的 gem 扩展包。也可以使用 Rails 自带的 has_secure_password 来自已打造。下面就是尝试使用 has_secure_password 来实现用户注册和登录功能。准备工作创建项目:rails new user_loginhas_secure_password 中加密的功能需要 ]]></description>
      <link>https://www.herecours.com/backend/2026/02-16/12653.html</link>
      <guid>https://www.herecours.com/backend/2026/02-16/12653.html</guid>
      <category>Ruby教程</category>
      <author><![CDATA[]]></author>
      <pubDate>Mon, 16 Feb 2026 03:19:10 +0000</pubDate>
    </item>
    <item>
      <title><![CDATA[Ruby on Rails网站项目构建简单指南]]></title>
      <description><![CDATA[ 创建 Rails 项目创建一个普通的 Rails 项目，可以直接使用以下命令:rails new blog但在国内因为连接 RubyGems 的速度太慢，而 Rails 默认在构建完项目结构后，会使用 bundle 命令从 RubyGems 下载安装依赖包。最后会因为网络问题而卡死。所以需要使用 --skip-bundle 参数跳过执行 bundle 这一步。然后使用国内的 Gems 镜像源来完 ]]></description>
      <link>https://www.herecours.com/backend/2026/02-16/12654.html</link>
      <guid>https://www.herecours.com/backend/2026/02-16/12654.html</guid>
      <category>Ruby教程</category>
      <author><![CDATA[]]></author>
      <pubDate>Mon, 16 Feb 2026 03:19:10 +0000</pubDate>
    </item>
    <item>
      <title><![CDATA[Ruby中Hash哈希结构的基本操作方法小结]]></title>
      <description><![CDATA[ 关于哈希先来了解一下Hash的基本思路：设要存储对象的个数为num, 那么我们就用len个内存单元来存储它们(len&amp;gt;=num); 以每个对象ki的关键字为自变量，用一个函数h(ki)来映射出ki的内存地址，也就是ki的下标，将ki对象的元素内容全部存入这个地址中就行了。这个就是Hash的基本思路。为什么要用一个函数来映射出它们的地址单元呢？假设现 ]]></description>
      <link>https://www.herecours.com/backend/2026/02-16/12655.html</link>
      <guid>https://www.herecours.com/backend/2026/02-16/12655.html</guid>
      <category>Ruby教程</category>
      <author><![CDATA[]]></author>
      <pubDate>Mon, 16 Feb 2026 03:19:10 +0000</pubDate>
    </item>
    <item>
      <title><![CDATA[ruby中的双等号==问题详解]]></title>
      <description><![CDATA[ 前两天在写代码的时候，突然收到警告说项目代码中存在 XSS 漏洞，遂立即根据报告的 URL 排查页面代码，虽然很快就修复了，而且同样问题的讨论两年前就有了，一般来说相对有经验的同学也应该都知道这个点，但是还是觉得有必要写出来，再次提醒一下其他小伙伴，避免踩坑。问题根源其中，在找到的漏洞出现的地方，都存在类似以下这样的 slim 代码：in ]]></description>
      <link>https://www.herecours.com/backend/2026/02-16/12646.html</link>
      <guid>https://www.herecours.com/backend/2026/02-16/12646.html</guid>
      <category>Ruby教程</category>
      <author><![CDATA[]]></author>
      <pubDate>Mon, 16 Feb 2026 03:19:09 +0000</pubDate>
    </item>
    <item>
      <title><![CDATA[简单谈谈Ruby的private和protected]]></title>
      <description><![CDATA[ 下面这段程序让我纠结了很久，Ruby中private的概念真的很奇怪。。。class Test private def test_print  puts &#039;test&#039; endendclass Test2 &lt; Test def test_print2  # self.test_print #=&gt; 这里加上self就不能调用，private method `test_print&#039; called for ]]></description>
      <link>https://www.herecours.com/backend/2026/02-16/12647.html</link>
      <guid>https://www.herecours.com/backend/2026/02-16/12647.html</guid>
      <category>Ruby教程</category>
      <author><![CDATA[]]></author>
      <pubDate>Mon, 16 Feb 2026 03:19:09 +0000</pubDate>
    </item>
    <item>
      <title><![CDATA[Ruby程序中创建和解析XML文件的方法]]></title>
      <description><![CDATA[ 使用builder创建XMLbuilder安装方法：gem install builderrequire &#039;builder&#039;   x = Builder::XmlMarkup.new(:target =&gt; $stdout, :indent =&gt; 1) #&quot;:target =＞$stdout&quot;参数：指示输出内容将被写向标准输出控制台 #&quot;:indent =＞1&quot;参数：XML输出形式将被缩进一个空格字 ]]></description>
      <link>https://www.herecours.com/backend/2026/02-16/12648.html</link>
      <guid>https://www.herecours.com/backend/2026/02-16/12648.html</guid>
      <category>Ruby教程</category>
      <author><![CDATA[]]></author>
      <pubDate>Mon, 16 Feb 2026 03:19:09 +0000</pubDate>
    </item>
    <item>
      <title><![CDATA[Ruby在cmd下中文显示乱码以及不支持OpenSSL的问题解决]]></title>
      <description><![CDATA[ 中文乱码解决办法cmd下中文不能输入将cmd代码页改成936：chcp 936ruby 读取中文强制设置为utf-8可以在文件中加一个注释语句 # encoding: UTF-8，ruby就会用utf-8格式载入cmd输出乱码这个解决不掉， 我看到有人用了一个第三方库来解决输出require &amp;#039;iconv&amp;#039; cov = Iconv.new( &amp;#039;gbk&amp;#039;, &amp;#039;utf-8&amp;#039;)   puts cov.i ]]></description>
      <link>https://www.herecours.com/backend/2026/02-16/12649.html</link>
      <guid>https://www.herecours.com/backend/2026/02-16/12649.html</guid>
      <category>Ruby教程</category>
      <author><![CDATA[]]></author>
      <pubDate>Mon, 16 Feb 2026 03:19:09 +0000</pubDate>
    </item>
    <item>
      <title><![CDATA[Ubuntu上配置Ruby on Rails框架及RubyMine IDE开发环境]]></title>
      <description><![CDATA[ 准备阶段的碎碎念在virtualbox安装过程中由于这样那样的原因，产生许多坑。坑1、关于终端，一定要使用启动器打开安装完虚拟机，进入系统，我们便会遇到第一个坑,终端软件，建议大家都使用启动器打开终端，千万不要使用文件管理器，进入文件夹，再右键“在终端中打开”，这个时候，环境变量加载不上，尤其在非桌面文件夹进入时。终端加载不上环境变 ]]></description>
      <link>https://www.herecours.com/backend/2026/02-16/12650.html</link>
      <guid>https://www.herecours.com/backend/2026/02-16/12650.html</guid>
      <category>Ruby教程</category>
      <author><![CDATA[]]></author>
      <pubDate>Mon, 16 Feb 2026 03:19:09 +0000</pubDate>
    </item>
    <item>
      <title><![CDATA[Ruby on Rails基础之新建项目]]></title>
      <description><![CDATA[ Ruby on Rails 目录结构+ app/ #控制器、模型、视图、帮助方法、邮件、静态资源+ bin/ #rails脚本+ config/ #路由、数据库等+ db/   #数据库模式、迁移文件+ lib/  #扩展模块+ log/  #日志+ public/ #公共资源+ test/  #单元测试- config.ru #Rack服务器的程序设置、用于启动程序- Gemfile,Gemfi ]]></description>
      <link>https://www.herecours.com/backend/2026/02-16/12643.html</link>
      <guid>https://www.herecours.com/backend/2026/02-16/12643.html</guid>
      <category>Ruby教程</category>
      <author><![CDATA[]]></author>
      <pubDate>Mon, 16 Feb 2026 03:19:08 +0000</pubDate>
    </item>
  </channel>
</rss>