I need to use haml with sass in order to create templates. I don’t want to use rails. My main issue is haml partials including. Here is my current project structure: build source — scss — js — views — pages —- home.haml — index.haml I’ve tried to include home.haml as a partial in index.haml […]
Trying to install em-irc, got that: /usr/bin/ruby1.9.1 extconf.rb /usr/local/lib/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require’: cannot load such file — mkmf (LoadError) from /usr/local/lib/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require’ from extconf.rb:2:in `<main>’
What is the difference between Gem & Plugin?
Ruby has this handy and convenient way to share instance variables by using keys like attr_accessor :var attr_reader :var attr_writer :var Why would I choose attr_reader or attr_writer if I could simply use attr_accessor? Is there something like performance (which I doubt)? I guess there is a reason, otherwise they wouldn’t have made such keys.
I download an old code(zip) files from git. Now I want to refer the folder location as load path so that I can use the code to split the zip, but I can see Split error is coming. The code I tried was $LOAD_PATH.unshift(‘c:/rubyzip/lib/zip’) require ‘zip/zip’ part_zip_count = Zip::ZipFile.split(“C:\junk\AWS Tools.zip”, 10240, false) puts “Zip file […]
When using OpenSSL in C, we set options on the context to remove weak and wounded protocols like SSLv2 and SSLv3. From ssl.h, here is a bitmask of some of the options that are useful: #define SSL_OP_NO_SSLv2 0x01000000L #define SSL_OP_NO_SSLv3 0x02000000L #define SSL_OP_NO_TLSv1 0x04000000L #define SSL_OP_NO_TLSv1_2 0x08000000L #define SSL_OP_NO_TLSv1_1 0x10000000L However, I’m having trouble setting […]
I have a method inside of a method. The interior method depends on a variable loop that is being run. Is that a bad idea?
I am implementing the following problem in ruby. Here’s the pattern that I want : 1234, 1324, 1432, 1423, 2341 and so on i.e. the digits in the four digit number should be between [1-4] and should also be non-repetitive. to make you understand in a simple manner I take a two digit pattern and […]
I want my Ruby program to do different things on a Mac than on Windows. How can I find out on which system my program is running?
I try to develop a gem. I include it in my rails application through Gemfile with :path option for testing purpose, but there are some errors that appear when I build it and release to rubygems that does not appear when gem included from local path. How can I install gem from *gem file (made […]