Tag:ruby

  • An example of interactive program developed by ruby

    Time:2020-2-18

    To realize the interaction functions of pry, ronin and MSF under the terminal, ripl gem is mainly used here: 1. Be able to call defined methods, such as help2. Be able to execute system commands3. Be able to parse Ruby like IRB / pry Installation: gem install ripl gem install ripl-shell_commands Example Ripl is a […]

  • An asynchronous file download instance of httpserver implemented by ruby

    Time:2020-2-16

    1. Use ruby eventmachine and EM HTTP server gem to complete a simple httpserver that provides file download function 2. uses EM’s FileStreamer to send files asynchronously. When sending files, it first assembles header and then calls FileStreamer. require ‘rubygems’ require ‘eventmachine’ require ’em-http-server’ class HTTPHandler < EM::HttpServer::Server attr_accessor :filename, :filesize, :path def process_http_request #send […]

  • Fast and correct installation of ruby and rails running environment

    Time:2020-2-13

    How to install Ruby and rails running environment quickly and correctly For new developers, how to install ruby, the running environment of ruby gems and rails may be a problem. This page mainly introduces how to use a reliable way to quickly install Ruby development environment.The secondary installation method is also applicable to the product […]

  • Install and deploy Ruby on rails application on Ubuntu 12.04 server

    Time:2020-2-12

    This tutorial is only suitable for Ubuntu server to deploy projects online. It is recommended to use the same Ubuntu version to avoid problems caused by different versions. This tutorial is suitable for beginners to deploy rails applications for the first time; This article tests the passing environment Ubuntu 12.04 Server, The server installation is […]

  • Ruby learning note 1

    Time:2020-2-11

    Notes: Ruby returns the last value in the method by default.If you need to return more than one value, you can use an array.You can return a value by forcing a return declaration.The basic output method is to use puts (output one line), print (direct printing).The basic input method is gets (read in a line, […]

  • Ruby learning note 2 helps generate code for VIM to add code headers

    Time:2020-2-10

    The scripting language is so strong. My goal is to add my default dock generation function to vim. /****************************************************************************** * COPYRIGHT NOTICE * Copyright (c) 2014 All rights reserved * —-Stay Hungry Stay Foolish—- * * @author : Shen * @name : * @file : G:\My Source Code\DefaultCode.cpp * @date : 2014/06/14 02:44 * @algorithm […]

  • Simple comparative analysis of Ruby on rails and laravel

    Time:2020-2-8

    At present, there are many popular frameworks for online web application development. There are also many different types of frameworks, such as those with a large number of plug-ins, which can let you iterate more quickly (such as rails), or other very simple and low-level (such as flask)Two relatively more popular frameworks in web application […]

  • Solution to the problem of using pod after upgrading to MAC 10.10

    Time:2020-2-7

    Recently, I was curious about the powerful functions of MAC 10.10, so I upgraded the system to 10.10, and found that the following problems occurred when using Pod: /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require’: cannot load such file — xcodeproj/prebuilt/universal.x86_64-darwin14-2.0.0/xcodeproj_ext (LoadError) from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require’ from /Library/Ruby/Gems/2.0.0/gems/xcodeproj-0.17.0/lib/xcodeproj/ext.rb:6:in `rescue in <top (required)>’ from /Library/Ruby/Gems/2.0.0/gems/xcodeproj-0.17.0/lib/xcodeproj/ext.rb:3:in `<top (required)>’ from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require’ from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in […]

  • Win7 install Ruby on rails development environment

    Time:2020-2-6

    PrefaceMany articles have said that Ruby environment is very difficult to build on windows, and there will be a variety of strange problems, so it is recommended to install and develop on Linux and MAC. But I followed the tutorial, and the problem was not too much. It took about two and a half hours […]

  • A summary of the differences among public, private and protected in Ruby

    Time:2020-2-4

    Focus on private and protected public The default is public, which can be accessed globally. This does not explain private C + +, “private” means “private to this class”, but Ruby means “private to this instance”In C + +, for class A, as long as you can access class A, you can access the private […]

  • Java version of ruby interpreter jruby 1.7.14 released

    Time:2020-2-3

    Jruby 1.7.14 is released, which is now available for download: http://www.jruby.org/download Jruby 1.7 is mainly for compatibility with ruby 1.9.3. The improvement records are as follows: 30 issues solved Fixed potential memory leak in jar file source Invokedynamic is disabled by default because it starts slowly in rails applications Load / require internal refactoring and […]

  • Annotation, variable declaration and array operation of ruby tutorial

    Time:2020-2-1

    I read an article “PHP basic tutorial” in the “blog Park” two days ago. It’s very good to introduce PHP. D guage is learning ruby, and he just wrote an “Introduction to ruby”. It should be noted that this article is suitable for beginners who have a programming foundation but have not been exposed to […]