M = [["a", "b"], ["c", "d"], ["e", "f"]]

x = []
...

Ruby Array parsing in a block

by https://www.google.com/accounts/o8/id?id=AItOawmWMRp7fAci9domcwhxD3fNikoTak9bkYc, January 26, 2012 05:59, 1 refactoring, tagged with arrays, blocks, loops, array syntax

x should be ["a","c","e"] i...

55502f40dc8b7c769880b10874abc9d0 Talk
ALPHA = ('a'..'z').to_a

def nextAlpha letter
...

Ruby String Incrementing

by caustic-interface.myopenid.com, December 20, 2011 18:24, 11 refactorings

It's intended to increment ...

55502f40dc8b7c769880b10874abc9d0 Talk
#more elegante way? 
sector = Sector.create(:name => name) unless sector = Sector.find_by_name(sector)

Ruby more elegant way

by RoadHouse, December 01, 2011 09:52, 5 refactorings, tagged with ruby, activerecord, rails3

no ideas about it, rails 3....

70089e712ed13abb99bec89bd5bfba77 Talk
def battle
  # do something 
  if result=self.save
...

Ruby Unnecessary assignment near...

by https://www.google.com/accounts/o8/id?id=AItOawldXGtOvAVQC5k5Z7Y71zO75UzIQ98K5a0, December 12, 2011 07:36, 5 refactorings, tagged with return, observers

It feels like the assignmen...

55502f40dc8b7c769880b10874abc9d0 Talk
>> %w(Pending Processing Executed Canceled).each_with_index.map {|v, i| i}
=> [0, 1, 2, 3]

Ruby Get array of indexes from g...

by jibiel, December 08, 2011 00:18, 5 refactorings, tagged with rails, dry, ruby-1.9.2

Using it :in validates_incl...

4b3896c9b63e756621efa3746c32e91b Talk
# Start of file, showing the name of the application
# Size, and all relevent parts of the title

...

Ruby Address Book

by https://www.google.com/accounts/o8/id?id=AItOawkiJON4MFJ9bopD8IvwQ1pbpH3ag7yrtnI, December 28, 2011 07:36, 5 refactorings, tagged with ruby, methods, regexp, regular expression

This is a fairly simple add...

55502f40dc8b7c769880b10874abc9d0 Talk
def self.generate_required_data(orders)
      all_the_orders = []
      orders.each do |order|
...

Ruby Building an array from data...

by juo100@gmail.com, December 05, 2011 02:36, 4 refactorings, tagged with shorten

Just interested to see how ...

B543a43dc8cb0aae562278484db60d25 Talk
#!/usr/bin/env ruby
# encoding: utf-8

...

Ruby Tasks list

by Aziz Light, November 16, 2011 20:02, 6 refactorings, tagged with command line, ruby

This script takes one argum...

D69bd6b89f0c9204eed89de9d7ee4632 Talk
Best Seller SkinB5 Acne Treatment! Powerful Vitamin B5 fast acne cure normalizes skin oil production. Best natural acne products that cures & prevents acne, whiteheads, blackheads and oily skin.
http://www.skinb5.com/acne-products.asp

Ruby Acne Products, Acne Product

by https://www.google.com/accounts/o8/id?id=AItOawmmt5yWC8Y3fZd7Y3mAVyx_I3ASnzslJBw, November 12, 2011 03:17, 6 refactorings, tagged with Acne Product, Acne Products, Body Acne

Best Seller SkinB5 Acne Tre...

55502f40dc8b7c769880b10874abc9d0 Talk
@topic = if (defined? @parent.topic) then
                 @parent.topic
               else
...

Ruby Ugly ruby if statement.

by acreek.myopenid.com, November 29, 2011 11:51, 5 refactorings, tagged with ruby1.9, rails3

I know there has to be a be...

55502f40dc8b7c769880b10874abc9d0 Talk
cachedResults = {}

expensiveFunction.__index = 
...

Ruby In Lua, why does t.k not wo...

by https://www.google.com/accounts/o8/id?id=AItOawmSrR_IfFuPDvqWETu3W8vcWWo1-md_RZA, November 10, 2011 21:54, 5 refactorings, tagged with lua

Consider the below code. Wh...

55502f40dc8b7c769880b10874abc9d0 Talk
"\none\n two\n  three".scan(/^( *)\w+/).flatten #=> ["", " ", "  "]

Ruby Get rid of useless `flatten`

by Shamaoke, November 06, 2011 02:11, 5 refactorings, tagged with ruby, array, scan

Hi.

I want to get the ar...

E4c1e34040468dff738dda2a3349a36a Talk
#MM-YYYY
"2011-10".split("-").reverse.join("/") => "10/2011"

Ruby parsing date

by RoadHouse, November 24, 2011 12:40, 3 refactorings, tagged with ruby, date

anyone has the better solut...

70089e712ed13abb99bec89bd5bfba77 Talk
Parameters: {"inventory_order"=>{
  "inventory_order_items_attributes"=>{
    "0"=>{"inventory_item_id"=>"2", "quantity"=>"1"}, 
...

Ruby Group Nested Paramaters

by https://www.google.com/accounts/o8/id?id=AItOawkqv2FztAX85ggbYpnN0soQPaUdOEPrtFM, November 02, 2011 10:36, 1 refactoring, tagged with array grouping

I have a form ( model = Inv...

55502f40dc8b7c769880b10874abc9d0 Talk
Top Selling SkinB5 Acne Treatment that ACTUALLY WORKS! Powerful Vitamin B5 fast acne cure normalizes skin oil production. Best natural acne products that cure & prevent acne, whiteheads, blackheads and oily skin.
http://www.skinb5.com/order.asp

Ruby Best Acne Products

by https://www.google.com/accounts/o8/id?id=AItOawmmt5yWC8Y3fZd7Y3mAVyx_I3ASnzslJBw, November 12, 2011 03:18, No refactoring, tagged with Best Acne Product, Best Acne Treatment, Best Acne Cure

Top Selling SkinB5 Acne Tre...

55502f40dc8b7c769880b10874abc9d0 Talk
def set_name
    deal_date = self.deal_date
    if (4..12).to_a.include?(self.deal_date.month)
...

Ruby Refactor this code

by https://www.google.com/accounts/o8/id?id=AItOawl-DJ5xgYVFKrrLOGZqwCiGLkx38LeB1cU, November 10, 2011 21:43, No refactoring, tagged with ruby, rails3

Please refactor this code.....

55502f40dc8b7c769880b10874abc9d0 Talk
Top Selling SkinB5 Acne Treatment that ACTUALLY WORKS! Powerful Vitamin B5 fast acne cure normalises skin oil production. Best natural acne products that cures & prevents acne, whiteheads, blackheads and oily skin.
http://www.skinb5.com/natural-acne-treatment.asp

Ruby Natural Acne Treatment, Nat...

by https://www.google.com/accounts/o8/id?id=AItOawmmt5yWC8Y3fZd7Y3mAVyx_I3ASnzslJBw, November 12, 2011 03:16, No refactoring, tagged with Acne Treatment, Natural Acne Treatment, Treatment for Acne

Top Selling SkinB5 Acne Tre...

55502f40dc8b7c769880b10874abc9d0 Talk
Proven Top Seller SkinB5 Acne Treatment that ACTUALLY WORKS! Powerful Vitamin B5 fast acne cure normalizes skin oil production. Best natural acne 
products for face acne and body acne. Stops pimples & oily skin.

Ruby Acne Treatment, Acne, Body ...

by https://www.google.com/accounts/o8/id?id=AItOawmmt5yWC8Y3fZd7Y3mAVyx_I3ASnzslJBw, November 12, 2011 03:10, No refactoring, tagged with Acne, Acne Control, Acne Product, Acne Products, Acne Treatment

Proven Top Seller SkinB5 Ac...

55502f40dc8b7c769880b10874abc9d0 Talk
require_relative 'nice_stuff'

class Sheet
...

Ruby strange method

by Pyro, November 24, 2011 03:10, No refactoring, tagged with ruby, constants, inheritance

I have strange feeling abou...

547616d5e4aaee90426e7051dd766a5a Talk
Top Seller SkinB5 Acne Treatment that ACTUALLY WORKS! Powerful Vitamin B5 fast acne cure normalises skin oil production. Best natural acne products that cures & prevents acne,whiteheads, blackheads and oily skin.

Ruby Treatment for Acne, Best Ac...

by https://www.google.com/accounts/o8/id?id=AItOawmmt5yWC8Y3fZd7Y3mAVyx_I3ASnzslJBw, November 12, 2011 03:12, No refactoring, tagged with Acne Product, Acne Treatment, Acne Treatments

Top Seller SkinB5 Acne Trea...

55502f40dc8b7c769880b10874abc9d0 Talk
# chip away at the bonuses play through amounts
    bet_through_credit_remaining = self.wager
    self.user.bonuses.ranked.each do |bonus|
...

Ruby apply a credit over an orde...

by philrosenstein.myopenid.com, October 21, 2011 15:14, 15 refactorings, tagged with rails, activerecord, array, 2.3.x

example: if the credit is ...

20bffe332e5534f3ea328698ecb0a938 Talk
def id_found_or_limit_reached?
  if @upload_uuid || @request_uuid || (body.size > MAX_BODY)
    @data_buffer = nil
...

Ruby If statement with true retu...

by Dombesz, October 19, 2011 08:50, 7 refactorings, tagged with if else, return

The function should return ...

D41d8cd98f00b204e9800998ecf8427e Talk
#customers
  %table#customerTable
    - @customers.each_with_index do |customer, i|
...

Ruby Refactor for table "ge...

by danielz.myopenid.com, October 02, 2011 03:51, 6 refactorings, tagged with ruby, table, haml, challenge

Hey Guys,

I'm stuck with...

51bedeb346fa52074fe8bd52d6fe3ff0 Talk
def render_tree(nodes = [])
    stack = []
    html = ""
...

Ruby Listing a large hierarchica...

by https://www.google.com/accounts/o8/id?id=AItOawkaseuodFU-uMqwQe5Ge1HNI5RNr7UAjMc, October 01, 2011 09:53, 5 refactorings, tagged with awesome_nested_set rails performance

I am listing about 700 cate...

55502f40dc8b7c769880b10874abc9d0 Talk
<%= link_to (image_tag("sign_up_button.png", :alt => "Sign up now!"), "sign_up_now!") %>

Ruby Center Image link

by https://www.google.com/accounts/o8/id?id=AItOawktXnAcZIDUDRr6WbNX-CLR0FeppJSag2k, October 23, 2011 12:08, 1 refactoring, tagged with rails, image-link

I need placed image-link on...

55502f40dc8b7c769880b10874abc9d0 Talk