Ruby obfuscator

Is there a ruby obfuscator or “compiler”?

Is Nokogiri platform specific?

I am using windows 7. I have installed nokogiri gem and checked out the gem specification. In the gemfile, it says nokogiri is platform specific. s.platform = “x86-mingw32” Does it mean that nokogiri can be installed only on windows? Or Am I just getting line in the gemspec just because I am using windows 7?? […]

what's different between each and collect method in Ruby

This question already has an answer here: Array#each vs. Array#map 5 answers

Is there a reason that we cannot iterate on “reverse Range” in ruby?

I tried to iterate backwards with using a Range and each: (4..0).each do |i| puts i end ==> 4..0 Iteration through 0..4 writes the numbers. On the other Range r = 4..0 seems to be ok, r.first == 4, r.last == 0. It seems to be strange to me that the construct above does not […]

Syntax Error When Writing a Multi-Dimensional Array to Excel File

I am attempting to write a multi-dimensional array to an Excel file (extension .xls) using the WriteExcel Ruby gem on El Capitan. My attempt: # -*- coding:utf-8 -*- require ‘writeexcel’ # Create a new Excel workbook workbook =‘ruby.xls’) # Add a worksheet worksheet = workbook.add_worksheet eec = [ [‘maggie’, ‘milly’, ‘molly’, ‘may’ ], [13, […]

Execute a command line binary with Node.js

I am in the process of porting a CLI library from Ruby over to Node.js. In my code I execute several third party binaries when necessary. I am not sure how best to accomplish this in Node. Here’s an example in Ruby where I call PrinceXML to convert a file to a PDF: cmd = […]

Ruby: How to find and return a duplicate value in array?

arr is array of strings, e.g.: [“hello”, “world”, “stack”, “overflow”, “hello”, “again”]. What would be easy and elegant way to check if arr has duplicates, and if yes, return one of them (no matter which). Examples: [“A”, “B”, “C”, “B”, “A”] # => “A” or “B” [“A”, “B”, “C”] # => nil

What is Ruby's double-colon `::`?

What is this double-colon ::? E.g. Foo::Bar. I found a definition: The :: is a unary operator that allows: constants, instance methods and class methods defined within a class or module, to be accessed from anywhere outside the class or module. What good is scope (private, protected) if you can just use :: to expose […]

RVM installation ruby 1.8.7 and rails 2.3.4 Could not find gem 'rails (= 1.8.7) ruby' in the gems available on this machine. (Bundler::GemNotFound)

I need to install ruby 1.8.7 and rails 2.3.4 because I need to modify an old application. (latest ruby and gems in RVM working for me fine, but I need to use this old gems and ruby) //runing ubuntu 12.04 problem is when i try to run rake gems:install (and I cannot do rails new […]

What is this &:last Ruby construct called?

Possible Duplicate: What does map(&:name) mean in Ruby? What are things like called, so I can find more information about them :). What problems does that &: solve, or what is it doing exactly? Is it used in other languages?

Ruby is the best programming language in the world - Ruby on Rails.