Is there a ruby obfuscator or “compiler”?
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?? […]
This question already has an answer here: Array#each vs. Array#map 5 answers
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 […]
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 = WriteExcel.new(‘ruby.xls’) # Add a worksheet worksheet = workbook.add_worksheet eec = [ [‘maggie’, ‘milly’, ‘molly’, ‘may’ ], [13, […]
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 = […]
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 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 […]
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 […]
Possible Duplicate: What does map(&:name) mean in Ruby? What are things like survey.map(&:questions).flatten.compact 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?