repo
stringlengths
5
92
file_url
stringlengths
80
287
file_path
stringlengths
5
197
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:37:27
2026-01-04 17:58:21
truncated
bool
2 classes
fnando/browser
https://github.com/fnando/browser/blob/dd8893395248594ca0e4b6a3fbd221f36989b15b/lib/browser/middleware/context/url_methods.rb
lib/browser/middleware/context/url_methods.rb
# frozen_string_literal: true module Browser class Middleware class Context module UrlMethods def default_url_options Rails.configuration.browser.default_url_options || Rails.configuration.action_mailer.default_url_options || {} end end end end ...
ruby
MIT
dd8893395248594ca0e4b6a3fbd221f36989b15b
2026-01-04T15:55:13.685426Z
false
fnando/browser
https://github.com/fnando/browser/blob/dd8893395248594ca0e4b6a3fbd221f36989b15b/lib/browser/bot/keyword_matcher.rb
lib/browser/bot/keyword_matcher.rb
# frozen_string_literal: true module Browser class Bot class KeywordMatcher def self.call(ua, _browser) ua.match?(/crawl|fetch|search|monitoring|spider|bot/) end end end end
ruby
MIT
dd8893395248594ca0e4b6a3fbd221f36989b15b
2026-01-04T15:55:13.685426Z
false
fnando/browser
https://github.com/fnando/browser/blob/dd8893395248594ca0e4b6a3fbd221f36989b15b/lib/browser/bot/known_bots_matcher.rb
lib/browser/bot/known_bots_matcher.rb
# frozen_string_literal: true module Browser class Bot class KnownBotsMatcher def self.call(ua, _browser) Browser::Bot.bots.any? {|key, _| ua.include?(key) } end end end end
ruby
MIT
dd8893395248594ca0e4b6a3fbd221f36989b15b
2026-01-04T15:55:13.685426Z
false
fnando/browser
https://github.com/fnando/browser/blob/dd8893395248594ca0e4b6a3fbd221f36989b15b/lib/browser/bot/empty_user_agent_matcher.rb
lib/browser/bot/empty_user_agent_matcher.rb
# frozen_string_literal: true module Browser class Bot class EmptyUserAgentMatcher def self.call(ua, _browser) ua == "" end end end end
ruby
MIT
dd8893395248594ca0e4b6a3fbd221f36989b15b
2026-01-04T15:55:13.685426Z
false
fnando/browser
https://github.com/fnando/browser/blob/dd8893395248594ca0e4b6a3fbd221f36989b15b/lib/browser/platform/firefox_os.rb
lib/browser/platform/firefox_os.rb
# frozen_string_literal: true module Browser class Platform class FirefoxOS < Base def version "0" end def name "Firefox OS" end def id :firefox_os end def match? ua !~ /(Android|Linux|BlackBerry|Windows|Mac)/ && ua.include?("Firefox") ...
ruby
MIT
dd8893395248594ca0e4b6a3fbd221f36989b15b
2026-01-04T15:55:13.685426Z
false
fnando/browser
https://github.com/fnando/browser/blob/dd8893395248594ca0e4b6a3fbd221f36989b15b/lib/browser/platform/chrome_os.rb
lib/browser/platform/chrome_os.rb
# frozen_string_literal: true module Browser class Platform class ChromeOS < Base def match? ua.include?("CrOS") end def name "Chrome OS" end def id :chrome_os end def version ua[/CrOS(?: x86_64)? ([\d.]+)/, 1] end end end e...
ruby
MIT
dd8893395248594ca0e4b6a3fbd221f36989b15b
2026-01-04T15:55:13.685426Z
false
fnando/browser
https://github.com/fnando/browser/blob/dd8893395248594ca0e4b6a3fbd221f36989b15b/lib/browser/platform/unknown.rb
lib/browser/platform/unknown.rb
# frozen_string_literal: true module Browser class Platform class Unknown < Base def version "0" end def name "Unknown" end def id :unknown_platform end def match? true end end end end
ruby
MIT
dd8893395248594ca0e4b6a3fbd221f36989b15b
2026-01-04T15:55:13.685426Z
false
fnando/browser
https://github.com/fnando/browser/blob/dd8893395248594ca0e4b6a3fbd221f36989b15b/lib/browser/platform/adobe_air.rb
lib/browser/platform/adobe_air.rb
# frozen_string_literal: true module Browser class Platform class AdobeAir < Base def match? ua.include?("AdobeAIR") end def version ua[%r{AdobeAIR/([\d.]+)}, 1] end def name "Adobe AIR" end def id :adobe_air end end end end...
ruby
MIT
dd8893395248594ca0e4b6a3fbd221f36989b15b
2026-01-04T15:55:13.685426Z
false
fnando/browser
https://github.com/fnando/browser/blob/dd8893395248594ca0e4b6a3fbd221f36989b15b/lib/browser/platform/windows_mobile.rb
lib/browser/platform/windows_mobile.rb
# frozen_string_literal: true module Browser class Platform class WindowsMobile < Base def version "0" end def name "Windows Mobile" end def id :windows_mobile end def match? ua.include?("Windows CE") end end end end
ruby
MIT
dd8893395248594ca0e4b6a3fbd221f36989b15b
2026-01-04T15:55:13.685426Z
false
fnando/browser
https://github.com/fnando/browser/blob/dd8893395248594ca0e4b6a3fbd221f36989b15b/lib/browser/platform/blackberry.rb
lib/browser/platform/blackberry.rb
# frozen_string_literal: true module Browser class Platform class BlackBerry < Base def match? ua.match?(/BB10|BlackBerry/) end def name "BlackBerry" end def id :blackberry end def version ua[%r{(?:Version|BlackBerry[\da-z]+)/([\d.]+)},...
ruby
MIT
dd8893395248594ca0e4b6a3fbd221f36989b15b
2026-01-04T15:55:13.685426Z
false
fnando/browser
https://github.com/fnando/browser/blob/dd8893395248594ca0e4b6a3fbd221f36989b15b/lib/browser/platform/base.rb
lib/browser/platform/base.rb
# frozen_string_literal: true module Browser class Platform class Base attr_reader :ua, :platform def initialize(ua, platform = nil) @ua = ua @platform = platform end def match? false end end end end
ruby
MIT
dd8893395248594ca0e4b6a3fbd221f36989b15b
2026-01-04T15:55:13.685426Z
false
fnando/browser
https://github.com/fnando/browser/blob/dd8893395248594ca0e4b6a3fbd221f36989b15b/lib/browser/platform/ios.rb
lib/browser/platform/ios.rb
# frozen_string_literal: true module Browser class Platform class IOS < Base MATCHER = /(iPhone|iPad|iPod|CriOS)/.freeze VERSION_MATCHER = /OS (?<major>\d+)_(?<minor>\d+)_?(?<patch>\d+)?/.freeze def version matches = VERSION_MATCHER.match(ua) return "0" unless matches ...
ruby
MIT
dd8893395248594ca0e4b6a3fbd221f36989b15b
2026-01-04T15:55:13.685426Z
false
fnando/browser
https://github.com/fnando/browser/blob/dd8893395248594ca0e4b6a3fbd221f36989b15b/lib/browser/platform/windows_phone.rb
lib/browser/platform/windows_phone.rb
# frozen_string_literal: true module Browser class Platform class WindowsPhone < Base def version ua[/Windows Phone ([\d.]+)/, 1] end def name "Windows Phone" end def id :windows_phone end def match? ua.include?("Windows Phone") e...
ruby
MIT
dd8893395248594ca0e4b6a3fbd221f36989b15b
2026-01-04T15:55:13.685426Z
false
fnando/browser
https://github.com/fnando/browser/blob/dd8893395248594ca0e4b6a3fbd221f36989b15b/lib/browser/platform/linux.rb
lib/browser/platform/linux.rb
# frozen_string_literal: true module Browser class Platform class Linux < Base def version "0" end def name "Generic Linux" end def id :linux end def match? ua.include?("Linux") end end end end
ruby
MIT
dd8893395248594ca0e4b6a3fbd221f36989b15b
2026-01-04T15:55:13.685426Z
false
fnando/browser
https://github.com/fnando/browser/blob/dd8893395248594ca0e4b6a3fbd221f36989b15b/lib/browser/platform/mac.rb
lib/browser/platform/mac.rb
# frozen_string_literal: true module Browser class Platform class Mac < Base def version (ua[/Mac OS X\s*([0-9_.]+)?/, 1] || "0").tr("_", ".") end def name return "macOS" if platform.mac?(">= 10.12") "Mac OS X" end def id :mac end def ...
ruby
MIT
dd8893395248594ca0e4b6a3fbd221f36989b15b
2026-01-04T15:55:13.685426Z
false
fnando/browser
https://github.com/fnando/browser/blob/dd8893395248594ca0e4b6a3fbd221f36989b15b/lib/browser/platform/kai_os.rb
lib/browser/platform/kai_os.rb
# frozen_string_literal: true module Browser class Platform class KaiOS < Base def version ua[%r{KAIOS/([\d.]+)}, 1] end def name "KaiOS" end def id :kai_os end def match? ua.include?("KAIOS") end end end end
ruby
MIT
dd8893395248594ca0e4b6a3fbd221f36989b15b
2026-01-04T15:55:13.685426Z
false
fnando/browser
https://github.com/fnando/browser/blob/dd8893395248594ca0e4b6a3fbd221f36989b15b/lib/browser/platform/windows.rb
lib/browser/platform/windows.rb
# frozen_string_literal: true module Browser class Platform class Windows < Base def version ua[/Windows NT\s*([0-9_.]+)?/, 1] || "0" end def name "Windows" end def id :windows end def match? ua.include?("Windows") end end e...
ruby
MIT
dd8893395248594ca0e4b6a3fbd221f36989b15b
2026-01-04T15:55:13.685426Z
false
fnando/browser
https://github.com/fnando/browser/blob/dd8893395248594ca0e4b6a3fbd221f36989b15b/lib/browser/platform/android.rb
lib/browser/platform/android.rb
# frozen_string_literal: true module Browser class Platform class Android < Base def match? ua.include?("Android") && !ua.include?("KAIOS") end def name "Android" end def id :android end def version ua[/Android ([\d.]+)/, 1] end ...
ruby
MIT
dd8893395248594ca0e4b6a3fbd221f36989b15b
2026-01-04T15:55:13.685426Z
false
fnando/browser
https://github.com/fnando/browser/blob/dd8893395248594ca0e4b6a3fbd221f36989b15b/lib/browser/meta/platform.rb
lib/browser/meta/platform.rb
# frozen_string_literal: true module Browser module Meta class Platform < Base def meta browser.platform.id end end end end
ruby
MIT
dd8893395248594ca0e4b6a3fbd221f36989b15b
2026-01-04T15:55:13.685426Z
false
fnando/browser
https://github.com/fnando/browser/blob/dd8893395248594ca0e4b6a3fbd221f36989b15b/lib/browser/meta/tablet.rb
lib/browser/meta/tablet.rb
# frozen_string_literal: true module Browser module Meta class Tablet < Base def meta "tablet" if browser.device.tablet? end end end end
ruby
MIT
dd8893395248594ca0e4b6a3fbd221f36989b15b
2026-01-04T15:55:13.685426Z
false
fnando/browser
https://github.com/fnando/browser/blob/dd8893395248594ca0e4b6a3fbd221f36989b15b/lib/browser/meta/id.rb
lib/browser/meta/id.rb
# frozen_string_literal: true module Browser module Meta class Id < Base def meta browser.id end end end end
ruby
MIT
dd8893395248594ca0e4b6a3fbd221f36989b15b
2026-01-04T15:55:13.685426Z
false
fnando/browser
https://github.com/fnando/browser/blob/dd8893395248594ca0e4b6a3fbd221f36989b15b/lib/browser/meta/proxy.rb
lib/browser/meta/proxy.rb
# frozen_string_literal: true module Browser module Meta class Proxy < Base def meta "proxy" if browser.proxy? end end end end
ruby
MIT
dd8893395248594ca0e4b6a3fbd221f36989b15b
2026-01-04T15:55:13.685426Z
false
fnando/browser
https://github.com/fnando/browser/blob/dd8893395248594ca0e4b6a3fbd221f36989b15b/lib/browser/meta/ie.rb
lib/browser/meta/ie.rb
# frozen_string_literal: true module Browser module Meta class IE < Base def version @version ||= browser.version.to_i end def meta return unless browser.ie? meta = [] meta << "oldie lt-ie8 lt-ie9" if version < 8 meta << "lt-ie9" if version == 8 ...
ruby
MIT
dd8893395248594ca0e4b6a3fbd221f36989b15b
2026-01-04T15:55:13.685426Z
false
fnando/browser
https://github.com/fnando/browser/blob/dd8893395248594ca0e4b6a3fbd221f36989b15b/lib/browser/meta/base.rb
lib/browser/meta/base.rb
# frozen_string_literal: true module Browser module Meta def self.rules @rules ||= [ Device, GenericBrowser, Id, IE, IOS, Mobile, Platform, Proxy, Safari, Tablet, Webkit ] end def self.get(browser) ...
ruby
MIT
dd8893395248594ca0e4b6a3fbd221f36989b15b
2026-01-04T15:55:13.685426Z
false
fnando/browser
https://github.com/fnando/browser/blob/dd8893395248594ca0e4b6a3fbd221f36989b15b/lib/browser/meta/safari.rb
lib/browser/meta/safari.rb
# frozen_string_literal: true module Browser module Meta class Safari < Base def meta "safari safari#{browser.version}" if browser.safari? end end end end
ruby
MIT
dd8893395248594ca0e4b6a3fbd221f36989b15b
2026-01-04T15:55:13.685426Z
false
fnando/browser
https://github.com/fnando/browser/blob/dd8893395248594ca0e4b6a3fbd221f36989b15b/lib/browser/meta/ios.rb
lib/browser/meta/ios.rb
# frozen_string_literal: true module Browser module Meta class IOS < Base def meta "ios" if browser.platform.ios? end end end end
ruby
MIT
dd8893395248594ca0e4b6a3fbd221f36989b15b
2026-01-04T15:55:13.685426Z
false
fnando/browser
https://github.com/fnando/browser/blob/dd8893395248594ca0e4b6a3fbd221f36989b15b/lib/browser/meta/generic_browser.rb
lib/browser/meta/generic_browser.rb
# frozen_string_literal: true module Browser module Meta class GenericBrowser < Base def meta "#{browser.id} #{browser.id}#{browser.version}" if generic? end private def generic? !browser.safari? && !browser.chrome? end end end end
ruby
MIT
dd8893395248594ca0e4b6a3fbd221f36989b15b
2026-01-04T15:55:13.685426Z
false
fnando/browser
https://github.com/fnando/browser/blob/dd8893395248594ca0e4b6a3fbd221f36989b15b/lib/browser/meta/mobile.rb
lib/browser/meta/mobile.rb
# frozen_string_literal: true module Browser module Meta class Mobile < Base def meta "mobile" if browser.device.mobile? end end end end
ruby
MIT
dd8893395248594ca0e4b6a3fbd221f36989b15b
2026-01-04T15:55:13.685426Z
false
fnando/browser
https://github.com/fnando/browser/blob/dd8893395248594ca0e4b6a3fbd221f36989b15b/lib/browser/meta/webkit.rb
lib/browser/meta/webkit.rb
# frozen_string_literal: true module Browser module Meta class Webkit < Base def meta "webkit" if browser.webkit? end end end end
ruby
MIT
dd8893395248594ca0e4b6a3fbd221f36989b15b
2026-01-04T15:55:13.685426Z
false
fnando/browser
https://github.com/fnando/browser/blob/dd8893395248594ca0e4b6a3fbd221f36989b15b/lib/browser/meta/device.rb
lib/browser/meta/device.rb
# frozen_string_literal: true module Browser module Meta class Device < Base def meta browser.device.id end end end end
ruby
MIT
dd8893395248594ca0e4b6a3fbd221f36989b15b
2026-01-04T15:55:13.685426Z
false
Chris911/iStats
https://github.com/Chris911/iStats/blob/15813fe211e31425f7d0ad0e1018ef3102d16664/ext/osx_stats/extconf.rb
ext/osx_stats/extconf.rb
require 'mkmf' extension_name = 'osx_stats' CONFIG['LDSHARED'] << ' -framework IOKit -framework CoreFoundation ' # The destination dir_config(extension_name) # Do the work create_makefile(extension_name)
ruby
MIT
15813fe211e31425f7d0ad0e1018ef3102d16664
2026-01-04T15:55:15.441190Z
false
Chris911/iStats
https://github.com/Chris911/iStats/blob/15813fe211e31425f7d0ad0e1018ef3102d16664/lib/iStats.rb
lib/iStats.rb
# Extensions (C libs) require 'osx_stats' # Gems require 'optparse' require 'sparkr' # Internal require 'iStats/version' require 'iStats/color' require 'iStats/symbols' require 'iStats/printer' require 'iStats/command' require 'iStats/cpu' require 'iStats/fan' require 'iStats/battery' require 'iStats/extra' require '...
ruby
MIT
15813fe211e31425f7d0ad0e1018ef3102d16664
2026-01-04T15:55:15.441190Z
false
Chris911/iStats
https://github.com/Chris911/iStats/blob/15813fe211e31425f7d0ad0e1018ef3102d16664/lib/iStats/command.rb
lib/iStats/command.rb
module IStats # Main point of entry for `istats` command-line tool class Command class << self include IStats::Color # Executes a command # def execute Settings.load options = parse_options # Default command is 'all' category = ARGV.empty? ? 'all' : ARG...
ruby
MIT
15813fe211e31425f7d0ad0e1018ef3102d16664
2026-01-04T15:55:15.441190Z
false
Chris911/iStats
https://github.com/Chris911/iStats/blob/15813fe211e31425f7d0ad0e1018ef3102d16664/lib/iStats/symbols.rb
lib/iStats/symbols.rb
module IStats class Symbols class << self # Degree symbol # This adds support for ruby 1.9 and below # def degree 176.chr(Encoding::UTF_8) end end end end
ruby
MIT
15813fe211e31425f7d0ad0e1018ef3102d16664
2026-01-04T15:55:15.441190Z
false
Chris911/iStats
https://github.com/Chris911/iStats/blob/15813fe211e31425f7d0ad0e1018ef3102d16664/lib/iStats/version.rb
lib/iStats/version.rb
module IStats VERSION = '1.6.2' end
ruby
MIT
15813fe211e31425f7d0ad0e1018ef3102d16664
2026-01-04T15:55:15.441190Z
false
Chris911/iStats
https://github.com/Chris911/iStats/blob/15813fe211e31425f7d0ad0e1018ef3102d16664/lib/iStats/utils.rb
lib/iStats/utils.rb
module IStats module Utils extend self # Converts a temperature value in celcius to fahrenheit. # # Returns the temperature in fahrenheit. def to_fahrenheit(temperature) (temperature * (9.0 / 5.0)) + 32 end # Produce a thresholds array containing absolute values based on suppli...
ruby
MIT
15813fe211e31425f7d0ad0e1018ef3102d16664
2026-01-04T15:55:15.441190Z
false
Chris911/iStats
https://github.com/Chris911/iStats/blob/15813fe211e31425f7d0ad0e1018ef3102d16664/lib/iStats/cpu.rb
lib/iStats/cpu.rb
# CPU Stats # Extend CPU_STATS C module (ext/osx_stats/smc.c) # module IStats class Cpu extend CPU_STATS class << self # Delegate CLI command to function # def delegate(stat) case stat when 'all' all when 'temp', 'temperature' cpu_temperature ...
ruby
MIT
15813fe211e31425f7d0ad0e1018ef3102d16664
2026-01-04T15:55:15.441190Z
false
Chris911/iStats
https://github.com/Chris911/iStats/blob/15813fe211e31425f7d0ad0e1018ef3102d16664/lib/iStats/color.rb
lib/iStats/color.rb
module IStats # Color collects some methods for colorizing terminal output. # Thanks to https://github.com/holman module Color extend self CODES = { :reset => "\e[0m", :green => "\e[32m", :light_yellow => "\e[93m", :yellow => "\e[33m", :red => "\e[31m", :fla...
ruby
MIT
15813fe211e31425f7d0ad0e1018ef3102d16664
2026-01-04T15:55:15.441190Z
false
Chris911/iStats
https://github.com/Chris911/iStats/blob/15813fe211e31425f7d0ad0e1018ef3102d16664/lib/iStats/settings.rb
lib/iStats/settings.rb
module IStats class Settings require 'parseconfig' @configFile = "sensors.conf" @configDir = File.expand_path("~/.iStats") + "/" class << self def delegate(stat) case stat[0] when 'enable' if (stat[1] == 'all') toggleAll("1") else set...
ruby
MIT
15813fe211e31425f7d0ad0e1018ef3102d16664
2026-01-04T15:55:15.441190Z
false
Chris911/iStats
https://github.com/Chris911/iStats/blob/15813fe211e31425f7d0ad0e1018ef3102d16664/lib/iStats/battery.rb
lib/iStats/battery.rb
# Fan Stats # Extend BATTERY_STATS C module (ext/osx_stats/smc.c) # module IStats class Battery extend BATTERY_STATS class << self # Delegate CLI command to function # def delegate(stat) # Before we deletage check if there's a battery on system return unless validate_battery...
ruby
MIT
15813fe211e31425f7d0ad0e1018ef3102d16664
2026-01-04T15:55:15.441190Z
false
Chris911/iStats
https://github.com/Chris911/iStats/blob/15813fe211e31425f7d0ad0e1018ef3102d16664/lib/iStats/extra.rb
lib/iStats/extra.rb
# Extra Stats # Displays any extra sensors enabled in config # module IStats class Extra extend SMC_INFO class << self # Delegate CLI command to function # def delegate(stat) if stat == 'all' all else sensor_temperature stat end end #...
ruby
MIT
15813fe211e31425f7d0ad0e1018ef3102d16664
2026-01-04T15:55:15.441190Z
false
Chris911/iStats
https://github.com/Chris911/iStats/blob/15813fe211e31425f7d0ad0e1018ef3102d16664/lib/iStats/smc.rb
lib/iStats/smc.rb
# SMC # Extend CPU_STATS C module (ext/osx_stats/smc.c) # module IStats class SMC require 'json' extend SMC_INFO class << self # Delegate CLI command to function # def delegate(stat) case stat when 'all' all when 'zabbix' zabbix_discover ...
ruby
MIT
15813fe211e31425f7d0ad0e1018ef3102d16664
2026-01-04T15:55:15.441190Z
false
Chris911/iStats
https://github.com/Chris911/iStats/blob/15813fe211e31425f7d0ad0e1018ef3102d16664/lib/iStats/fan.rb
lib/iStats/fan.rb
# Fan Stats # Extend FAN_STATS C module (ext/osx_stats/smc.c) # module IStats class Fan extend FAN_STATS class << self # Delegate CLI command to function # def delegate(stat) case stat when 'all' all when 'number', 'num' print_fan_number w...
ruby
MIT
15813fe211e31425f7d0ad0e1018ef3102d16664
2026-01-04T15:55:15.441190Z
false
Chris911/iStats
https://github.com/Chris911/iStats/blob/15813fe211e31425f7d0ad0e1018ef3102d16664/lib/iStats/printer.rb
lib/iStats/printer.rb
module IStats class Printer @display_graphs = true @display_labels = true @display_scale = true @temperature_scale = 'celcius' LABEL_WIDTH = 24 VALUE_WIDTH = 8 SCALE_WIDTH = 4 class << self include IStats::Color def disable_graphs @display_graphs = false en...
ruby
MIT
15813fe211e31425f7d0ad0e1018ef3102d16664
2026-01-04T15:55:15.441190Z
false
technicalpickles/homesick
https://github.com/technicalpickles/homesick/blob/ee4388b0f437f303e47b36da8b2ae45c50defdf7/spec/homesick_cli_spec.rb
spec/homesick_cli_spec.rb
require 'spec_helper' require 'capture-output' require 'pathname' describe Homesick::CLI do let(:home) { create_construct } after { home.destroy! } let(:castles) { home.directory('.homesick/repos') } let(:homesick) { Homesick::CLI.new } before { allow(homesick).to receive(:repos_dir).and_return(castles) }...
ruby
MIT
ee4388b0f437f303e47b36da8b2ae45c50defdf7
2026-01-04T15:55:05.379068Z
false
technicalpickles/homesick
https://github.com/technicalpickles/homesick/blob/ee4388b0f437f303e47b36da8b2ae45c50defdf7/spec/spec_helper.rb
spec/spec_helper.rb
require 'coveralls' Coveralls.wear! $LOAD_PATH.unshift(File.dirname(__FILE__)) $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) require 'homesick' require 'rspec' require 'test_construct' require 'tempfile' RSpec.configure do |config| config.include TestConstruct::Helpers config.expect_with(:rs...
ruby
MIT
ee4388b0f437f303e47b36da8b2ae45c50defdf7
2026-01-04T15:55:05.379068Z
false
technicalpickles/homesick
https://github.com/technicalpickles/homesick/blob/ee4388b0f437f303e47b36da8b2ae45c50defdf7/lib/homesick.rb
lib/homesick.rb
require 'homesick/actions/file_actions' require 'homesick/actions/git_actions' require 'homesick/version' require 'homesick/utils' require 'homesick/cli' require 'fileutils' # Homesick's top-level module module Homesick GITHUB_NAME_REPO_PATTERN = %r{\A([A-Za-z0-9_-]+/[A-Za-z0-9_-]+)\Z}.freeze SUBDIR_FILENAME = '.h...
ruby
MIT
ee4388b0f437f303e47b36da8b2ae45c50defdf7
2026-01-04T15:55:05.379068Z
false
technicalpickles/homesick
https://github.com/technicalpickles/homesick/blob/ee4388b0f437f303e47b36da8b2ae45c50defdf7/lib/homesick/version.rb
lib/homesick/version.rb
module Homesick # A representation of Homesick's version number in constants, including a # String of the entire version number module Version MAJOR = 1 MINOR = 1 PATCH = 6 STRING = [MAJOR, MINOR, PATCH].compact.join('.') end end
ruby
MIT
ee4388b0f437f303e47b36da8b2ae45c50defdf7
2026-01-04T15:55:05.379068Z
false
technicalpickles/homesick
https://github.com/technicalpickles/homesick/blob/ee4388b0f437f303e47b36da8b2ae45c50defdf7/lib/homesick/utils.rb
lib/homesick/utils.rb
require 'pathname' module Homesick # Various utility methods that are used by Homesick module Utils protected def home_dir @home_dir ||= Pathname.new(ENV['HOME'] || '~').realpath end def repos_dir @repos_dir ||= home_dir.join('.homesick', 'repos').expand_path end def castle_d...
ruby
MIT
ee4388b0f437f303e47b36da8b2ae45c50defdf7
2026-01-04T15:55:05.379068Z
false
technicalpickles/homesick
https://github.com/technicalpickles/homesick/blob/ee4388b0f437f303e47b36da8b2ae45c50defdf7/lib/homesick/cli.rb
lib/homesick/cli.rb
require 'fileutils' require 'thor' module Homesick # Homesick's command line interface class CLI < Thor include Thor::Actions include Homesick::Actions::FileActions include Homesick::Actions::GitActions include Homesick::Version include Homesick::Utils add_runtime_options! map '-v' =>...
ruby
MIT
ee4388b0f437f303e47b36da8b2ae45c50defdf7
2026-01-04T15:55:05.379068Z
false
technicalpickles/homesick
https://github.com/technicalpickles/homesick/blob/ee4388b0f437f303e47b36da8b2ae45c50defdf7/lib/homesick/actions/git_actions.rb
lib/homesick/actions/git_actions.rb
module Homesick module Actions # Git-related helper methods for Homesick module GitActions # Information on the minimum git version required for Homesick MIN_VERSION = { major: 1, minor: 8, patch: 0 }.freeze STRING = MIN_VERSION.values.join('.') def git_v...
ruby
MIT
ee4388b0f437f303e47b36da8b2ae45c50defdf7
2026-01-04T15:55:05.379068Z
false
technicalpickles/homesick
https://github.com/technicalpickles/homesick/blob/ee4388b0f437f303e47b36da8b2ae45c50defdf7/lib/homesick/actions/file_actions.rb
lib/homesick/actions/file_actions.rb
module Homesick module Actions # File-related helper methods for Homesick module FileActions protected def mv(source, destination) source = Pathname.new(source) destination = Pathname.new(destination + source.basename) say_status :conflict, "#{destination} exists", :red if...
ruby
MIT
ee4388b0f437f303e47b36da8b2ae45c50defdf7
2026-01-04T15:55:05.379068Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/spec/spec_helper.rb
spec/spec_helper.rb
require "bundler/setup" require "ice_cube" require "timeout" begin require "simplecov" SimpleCov.start rescue LoadError # okay end IceCube.compatibility = 12 DAY = Time.utc(2010, 3, 1) WEDNESDAY = Time.utc(2010, 6, 23, 5, 0, 0) WORLD_TIME_ZONES = [ "America/Anchorage", # -1000 / -0900 "Europe/London", # +...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/spec/support/warning_helpers.rb
spec/support/warning_helpers.rb
module WarningHelpers def capture_warnings StringIO.open("") do |stderr| stderr, $stderr = $stderr, stderr yield stderr, $stderr = $stderr, stderr stderr.string end end end
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/spec/rules/monthly_rule_spec.rb
spec/rules/monthly_rule_spec.rb
require File.dirname(__FILE__) + "/../spec_helper" module IceCube describe MonthlyRule, "interval validation" do it "converts a string integer to an actual int when using the interval method" do rule = Rule.monthly.interval("2") expect(rule.validations_for(:interval).first.interval).to eq(2) end ...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/spec/rules/daily_rule_spec.rb
spec/rules/daily_rule_spec.rb
require File.dirname(__FILE__) + "/../spec_helper" module IceCube describe DailyRule, "interval validation" do it "converts a string integer to an actual int when using the interval method" do rule = Rule.daily.interval("2") expect(rule.validations_for(:interval).first.interval).to eq(2) end ...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/spec/rules/secondly_rule_spec.rb
spec/rules/secondly_rule_spec.rb
require File.dirname(__FILE__) + "/../spec_helper" module IceCube describe SecondlyRule, "interval validation" do it "converts a string integer to an actual int when using the interval method" do rule = Rule.secondly.interval("2") expect(rule.validations_for(:interval).first.interval).to eq(2) en...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/spec/rules/minutely_rule_spec.rb
spec/rules/minutely_rule_spec.rb
require File.dirname(__FILE__) + "/../spec_helper" describe IceCube::MinutelyRule do describe "interval validation" do it "converts a string integer to an actual int when using the interval method" do rule = Rule.minutely.interval("2") expect(rule.validations_for(:interval).first.interval).to eq(2) ...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/spec/rules/hourly_rule_spec.rb
spec/rules/hourly_rule_spec.rb
require File.dirname(__FILE__) + "/../spec_helper" module IceCube describe HourlyRule do describe "interval validation" do it "converts a string integer to an actual int when using the interval method" do rule = Rule.hourly.interval("2") expect(rule.validations_for(:interval).first.interval...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/spec/rules/yearly_rule_spec.rb
spec/rules/yearly_rule_spec.rb
require File.dirname(__FILE__) + "/../spec_helper" describe IceCube::YearlyRule, "interval validation" do it "converts a string integer to an actual int when using the interval method" do rule = IceCube::Rule.yearly.interval("2") expect(rule.validations_for(:interval).first.interval).to eq(2) end it "co...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/spec/rules/weekly_rule_spec.rb
spec/rules/weekly_rule_spec.rb
require File.dirname(__FILE__) + "/../spec_helper" module IceCube describe WeeklyRule, "interval validation" do it "converts a string integer to an actual int when using the interval method" do rule = Rule.weekly.interval("2") expect(rule.validations_for(:interval).first.interval).to eq(2) end ...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/spec/i18n/to_s_en_spec.rb
spec/i18n/to_s_en_spec.rb
require File.dirname(__FILE__) + "/../spec_helper" describe IceCube::Schedule, "to_s" do shared_examples "to_s in English" do it "should represent its start time by default" do t0 = Time.local(2013, 2, 14) expect(IceCube::Schedule.new(t0).to_s).to eq("February 14, 2013") end it "should have ...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/spec/i18n/to_s_id_spec.rb
spec/i18n/to_s_id_spec.rb
require File.dirname(__FILE__) + "/../spec_helper" describe IceCube::Schedule, "to_s" do before :each do I18n.locale = :id end after :all do I18n.locale = :en end it "should represent its start time by default" do t0 = Time.local(2013, 2, 14) expect(IceCube::Schedule.new(t0).to_s).to eq("14...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/spec/i18n/to_s_es_spec.rb
spec/i18n/to_s_es_spec.rb
require File.dirname(__FILE__) + "/../spec_helper" describe IceCube::Schedule, "to_s" do before :each do I18n.locale = :es end after :all do I18n.locale = :en end it "should represent its start time by default" do t0 = Time.local(2013, 2, 14) expect(IceCube::Schedule.new(t0).to_s).to eq("14...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/spec/i18n/to_s_ja_spec.rb
spec/i18n/to_s_ja_spec.rb
require File.dirname(__FILE__) + "/../spec_helper" describe IceCube::Schedule, "to_s", locale: "ja" do it "should represent its start time by default" do t0 = Time.local(2013, 2, 14) expect(IceCube::Schedule.new(t0).to_s).to eq("2013年02月14日") end it "should have a useful base to_s representation for a s...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/spec/i18n/to_s_de_spec.rb
spec/i18n/to_s_de_spec.rb
require File.dirname(__FILE__) + "/../spec_helper" describe IceCube::Schedule, "to_s" do before :each do I18n.locale = :de end after :all do I18n.locale = :en end it "should represent its start time by default" do t0 = Time.local(2013, 2, 14) expect(IceCube::Schedule.new(t0).to_s).to eq("14...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/spec/examples/regression_spec.rb
spec/examples/regression_spec.rb
require File.dirname(__FILE__) + "/../spec_helper" module IceCube describe Schedule do WORLD_TIME_ZONES.each do |zone| context "in #{zone}", system_time_zone: zone do it "should produce the correct result for every day in may [#31]" do schedule = Schedule.new { |s| s.add_recurrence_rule R...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/spec/examples/recur_spec.rb
spec/examples/recur_spec.rb
require File.dirname(__FILE__) + "/../spec_helper" describe :remaining_occurrences do it "should get the proper remaining occurrences from now" do start_time = Time.now end_time = Time.local(start_time.year, start_time.month, start_time.day, 23, 59, 59) schedule = Schedule.new(start_time) schedule.ad...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/spec/examples/to_yaml_spec.rb
spec/examples/to_yaml_spec.rb
require File.dirname(__FILE__) + "/../spec_helper" module IceCube describe Schedule, "to_yaml" do before do require "active_support/time" Time.zone = "Eastern Time (US & Canada)" end [:yearly, :monthly, :weekly, :daily, :hourly, :minutely, :secondly].each do |type| it "should make a #{...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/spec/examples/string_builder_spec.rb
spec/examples/string_builder_spec.rb
require File.dirname(__FILE__) + "/../spec_helper" describe IceCube::StringBuilder do describe :sentence do it "should return empty string when none" do expect(IceCube::StringBuilder.sentence([])).to eq("") end it "should return sole when one" do expect(IceCube::StringBuilder.sentence(["1"])...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/spec/examples/to_ical_spec.rb
spec/examples/to_ical_spec.rb
require File.dirname(__FILE__) + "/../spec_helper" require "active_support" require "active_support/time" describe IceCube, "to_ical" do it "should return a proper ical representation for a basic daily rule" do rule = IceCube::Rule.daily expect(rule.to_ical).to eq("FREQ=DAILY") end it "should return a p...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/spec/examples/schedule_spec.rb
spec/examples/schedule_spec.rb
require File.dirname(__FILE__) + "/../spec_helper" require "benchmark" describe IceCube::Schedule do include IceCube it "yields itself for configuration" do t1 = Time.utc(2013, 2, 12, 12, 34, 56) schedule = IceCube::Schedule.new do |s| s.start_time = t1 end expect(schedule.start_time).to eq(...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
true
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/spec/examples/active_support_spec.rb
spec/examples/active_support_spec.rb
require File.dirname(__FILE__) + "/../spec_helper" require "active_support" require "active_support/time" require "active_support/version" require "tzinfo" if ActiveSupport::VERSION::MAJOR == 3 module IceCube describe Schedule, "using ActiveSupport" do before(:all) { Time.zone = "Eastern Time (US & Canada)" } ...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/spec/examples/from_ical_spec.rb
spec/examples/from_ical_spec.rb
require File.dirname(__FILE__) + "/../spec_helper" require "active_support/time" module IceCube describe Rule, "from_ical" do it "should return a IceCube DailyRule class for a basic daily rule" do rule = IceCube::Rule.from_ical "FREQ=DAILY" expect(rule.class).to eq(IceCube::DailyRule) end it...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/spec/examples/hash_parser_spec.rb
spec/examples/hash_parser_spec.rb
require File.dirname(__FILE__) + "/../spec_helper" module IceCube describe HashParser do let(:t) { Time.utc(2014, 3, 22) } describe "#to_schedule" do subject(:schedule) { HashParser.new(hash).to_schedule } let(:hash) { {start_time: t, duration: 3600} } describe "#start_time" do s...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/spec/examples/rfc_spec.rb
spec/examples/rfc_spec.rb
require File.dirname(__FILE__) + "/../spec_helper" describe IceCube::Schedule do it "should ~ daily for 10 occurrences" do schedule = IceCube::Schedule.new(Time.utc(2010, 9, 2)) schedule.add_recurrence_rule IceCube::Rule.daily.count(10) test_expectations(schedule, {2010 => {9 => [2, 3, 4, 5, 6, 7, 8, 9, ...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/spec/examples/flexible_hash_spec.rb
spec/examples/flexible_hash_spec.rb
require File.dirname(__FILE__) + "/../spec_helper" module IceCube describe FlexibleHash do subject(:hash) { described_class.new(:sym => true, "str" => true, 1 => true) } describe "#[]" do specify ":sym => :sym is found" do expect(hash[:sym]).to be true end specify "'sym' => :sym i...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/spec/examples/from_hash_spec.rb
spec/examples/from_hash_spec.rb
require File.dirname(__FILE__) + "/../spec_helper" module IceCube describe Rule, "from_hash" do describe "rule_type validations" do it "should raise an ArgumentError when the hash is empty" do expect { Rule.from_hash({}) } .to raise_error ArgumentError, "Invalid rule type" end ...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/spec/examples/occurrence_spec.rb
spec/examples/occurrence_spec.rb
require File.dirname(__FILE__) + "/../spec_helper" describe Occurrence do it "reports as a Time" do occurrence = Occurrence.new(t0 = Time.now, t0 + 3600) expect(occurrence.class.name).to eq("Time") expect(occurrence.is_a?(Time)).to be_truthy expect(occurrence.is_a?(Time)).to be_truthy end descri...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/spec/examples/_no_active_support_spec.rb
spec/examples/_no_active_support_spec.rb
require File.dirname(__FILE__) + "/../spec_helper" # This file is loaded and run alphabetically first in the suite, before # ActiveSupport gets loaded by other specs. module IceCube describe TimeUtil do before do raise "ActiveSupport should not be loaded" if defined?(ActiveSuppport) end WORLD_TIM...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/spec/examples/dst_spec.rb
spec/examples/dst_spec.rb
require File.dirname(__FILE__) + "/../spec_helper" module IceCube describe Schedule do # DST in 2010 is March 14th at 2am it "crosses a daylight savings time boundary with a recurrence rule in local time, by utc conversion" do start_time = Time.local(2010, 3, 13, 5, 0, 0) schedule = Schedule.new(...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/spec/examples/serialization_spec.rb
spec/examples/serialization_spec.rb
require "active_support/time" require File.dirname(__FILE__) + "/../spec_helper" describe IceCube::Schedule do let(:start_time) { Time.now } let(:schedule) { IceCube::Schedule.new(start_time) } let(:yaml) { described_class.dump(schedule) } describe "::dump(schedule)" do it "serializes a Schedule object as...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/spec/examples/ice_cube_spec.rb
spec/examples/ice_cube_spec.rb
require "active_support/time" require File.dirname(__FILE__) + "/../spec_helper" describe IceCube::Schedule do it "should work with a simple schedule" do rule = IceCube::Rule.daily.day(:monday) schedule = IceCube::Schedule.new(Time.now) schedule.add_recurrence_rule rule expect { schedule.first(3) }.n...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/spec/examples/time_util_spec.rb
spec/examples/time_util_spec.rb
require File.dirname(__FILE__) + "/../spec_helper" module IceCube describe TimeUtil do describe :beginning_of_date do let(:utc_time) { Time.utc(2014, 7, 8, 12, 34, 56) } let(:dst_time) { Time.local(2014, 7, 8, 12, 34, 56) } let(:std_time) { Time.local(2014, 1, 1, 12, 34, 56) } it "return...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/spec/examples/schedule_equality_spec.rb
spec/examples/schedule_equality_spec.rb
require "spec_helper" module IceCube describe Schedule do let(:t0) { Time.utc(2017, 1, 1, 12, 34, 56) } let(:s1) { IceCube::Schedule.new(t0) } let(:s2) { IceCube::Schedule.new(t0) } describe :eql? do subject(:equality) { s1 == s2 } it "should be true for same start time" do shou...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/spec/examples/validated_rule_spec.rb
spec/examples/validated_rule_spec.rb
require "active_support/time" require File.dirname(__FILE__) + "/../spec_helper" describe IceCube, "::ValidatedRule" do describe "#next_time" do context "monthly" do let(:rule) { IceCube::Rule.monthly } it "Should return current day when starting on same day" do t0 = Time.new(2013, 2, 25, 0,...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/lib/ice_cube.rb
lib/ice_cube.rb
require "date" require "ice_cube/deprecated" module IceCube autoload :VERSION, "ice_cube/version" autoload :TimeUtil, "ice_cube/time_util" autoload :FlexibleHash, "ice_cube/flexible_hash" require "ice_cube/i18n" autoload :Rule, "ice_cube/rule" autoload :Schedule, "ice_cube/schedule" autoload :Occurren...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/lib/ice_cube/deprecated.rb
lib/ice_cube/deprecated.rb
module IceCube module Deprecated # Define a deprecated alias for a method # @param [Symbol] name - name of method to define # @param [Symbol] replacement - name of method to replace (alias) def deprecated_alias(name, replacement) # Create a wrapped version define_method(name) do |*args, &b...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/lib/ice_cube/null_i18n.rb
lib/ice_cube/null_i18n.rb
require "yaml" module IceCube module NullI18n def self.t(key, options = {}) base = key.to_s.split(".").reduce(config) { |hash, current_key| hash[current_key] } base = base[(options[:count] == 1) ? "one" : "other"] if options[:count] case base when Hash base.each_with_object({}) ...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/lib/ice_cube/version.rb
lib/ice_cube/version.rb
module IceCube VERSION = "0.17.0" end
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/lib/ice_cube/time_util.rb
lib/ice_cube/time_util.rb
require "date" require "time" module IceCube module TimeUtil extend Deprecated DAYS = { sunday: 0, monday: 1, tuesday: 2, wednesday: 3, thursday: 4, friday: 5, saturday: 6 } ICAL_DAYS = { "SU" => :sunday, "MO" => :monday, "TU" => :tuesday, "WE" => :wednesday, "TH" => :thursd...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/lib/ice_cube/validated_rule.rb
lib/ice_cube/validated_rule.rb
require "ice_cube/input_alignment" module IceCube class ValidatedRule < Rule include Validations::ScheduleLock include Validations::Count include Validations::Until # Validations ordered for efficiency in sequence of: # * descending intervals # * boundary limits # * base values by cardi...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/lib/ice_cube/i18n.rb
lib/ice_cube/i18n.rb
require "ice_cube/null_i18n" module IceCube LOCALES_PATH = File.expand_path(File.join("..", "..", "config", "locales"), __dir__) # rubocop:disable Naming/ConstantName I18n = begin require "i18n" ::I18n.load_path += Dir[File.join(LOCALES_PATH, "*.yml")] ::I18n rescue LoadError NullI18n end ...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/lib/ice_cube/occurrence.rb
lib/ice_cube/occurrence.rb
require "delegate" module IceCube # Wraps start_time and end_time in a single concept concerning the duration. # This delegates to the enclosed start_time so it behaves like a normal Time # in almost all situations, however: # # Without ActiveSupport, it's necessary to cast the occurrence using # +#to_time...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/lib/ice_cube/rule.rb
lib/ice_cube/rule.rb
require "yaml" module IceCube class Rule INTERVAL_TYPES = [ :secondly, :minutely, :hourly, :daily, :weekly, :monthly, :yearly ] attr_reader :uses def reset end # Is this a terminating schedule? def terminating? until_time || occurrence_count end def ==(other)...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/lib/ice_cube/input_alignment.rb
lib/ice_cube/input_alignment.rb
module IceCube class InputAlignment def initialize(rule, value, rule_part) @rule = rule @value = value @rule_part = rule_part end attr_reader :rule, :value, :rule_part def verify(freq, options = {}, &) @rule.validations[:interval] or return case @rule when DailyR...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/lib/ice_cube/single_occurrence_rule.rb
lib/ice_cube/single_occurrence_rule.rb
module IceCube class SingleOccurrenceRule < Rule attr_reader :time def initialize(time) @time = TimeUtil.ensure_time time end # Always terminating def terminating? true end def next_time(t, _, closing_time) unless closing_time && closing_time < t time if time.t...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/lib/ice_cube/flexible_hash.rb
lib/ice_cube/flexible_hash.rb
require "delegate" module IceCube # Find keys by symbol or string without symbolizing user input # Due to the serialization format of ice_cube, this limited implementation # is entirely sufficient class FlexibleHash < SimpleDelegator def [](key) key = _match_key(key) super end def fet...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/lib/ice_cube/schedule.rb
lib/ice_cube/schedule.rb
require "yaml" module IceCube class Schedule extend Deprecated # Get the start time attr_reader :start_time deprecated_alias :start_date, :start_time # Get the end time attr_reader :end_time deprecated_alias :end_date, :end_time # Create a new schedule def initialize(start_time...
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false
ice-cube-ruby/ice_cube
https://github.com/ice-cube-ruby/ice_cube/blob/ee21ea6772bf7cf5a80c63e2f880046e30839744/lib/ice_cube/errors/until_exceeded.rb
lib/ice_cube/errors/until_exceeded.rb
module IceCube # An exception for when an until date on a Rule is passed class UntilExceeded < StopIteration end end
ruby
MIT
ee21ea6772bf7cf5a80c63e2f880046e30839744
2026-01-04T15:55:14.552710Z
false