This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
C = "top level" | |
class AboutConstants < EdgeCase::Koan | |
C = "nested" | |
def test_nested_constants_may_also_be_referenced_with_relative_paths | |
assert_equal "nested", C | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sort_by { |x| [x.a, x.b] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'test/unit' | |
class TestRecursiveReverse < Test::Unit::TestCase | |
def test_o_make | |
assert_equal [3, 2, 1], RecursiveReverse.new.o_make([1, 2, 3]) | |
end | |
def test_f_make | |
assert_equal [3, 2, 1], RecursiveReverse.new.f_make([1, 2, 3]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Creature | |
def self.metaclass | |
class << self | |
self | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Year 2014 | |
# encoding: UTF-8 | |
require 'export' | |
require 'export/secure_name' | |
require 'active_support/core_ext/object/blank' | |
describe Export::SecureName do | |
subject { described_class.new('name', '.ext') } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Dog | |
def hungry? | |
true | |
end | |
def full? | |
false | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# NOTE: There are Application pages we need to calculate progress for. | |
# Every page has specific rules/conditions how to estimate progress. | |
# Rules have scores/weights and they are used to calculate progress. | |
# pages = { | |
# home_page: { home_page_rule => score }, | |
# info_page: { info_page_rule_1 => score_1, info_page_rule_2 => score_2 } | |
# } | |
module ApplicationProgress | |
module Rules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
require 'axlsx' # https://github.com/randym/axlsx | |
require 'rubyXL' # https://github.com/weshatheleopard/rubyXL | |
require 'spreadsheet' # https://github.com/zdavatz/spreadsheet | |
require 'memory_profiler' | |
rows = 1_000 | |
columns = 20 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Year 2017 | |
module Date | |
def self.difference_in_years(left_date, right_date) | |
# NOTE: xxxx.yyzz (2017.1231) | |
# | |
# xxxx stands for years | |
# yy stands for months | |
# zz stands for days | |
# |
OlderNewer