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 |
|---|---|---|---|---|---|---|---|---|
soundcloud/lhm | https://github.com/soundcloud/lhm/blob/50907121eee514649fa944fb300d5d8a64fa873e/lib/lhm/throttler.rb | lib/lhm/throttler.rb | require 'lhm/throttler/time'
require 'lhm/throttler/slave_lag'
module Lhm
module Throttler
CLASSES = { :time_throttler => Throttler::Time, :slave_lag_throttler => Throttler::SlaveLag }
def throttler
@throttler ||= Throttler::Time.new
end
def setup_throttler(type, options = {})
@throttle... | ruby | BSD-3-Clause | 50907121eee514649fa944fb300d5d8a64fa873e | 2026-01-04T16:00:26.636526Z | false |
soundcloud/lhm | https://github.com/soundcloud/lhm/blob/50907121eee514649fa944fb300d5d8a64fa873e/lib/lhm/sql_helper.rb | lib/lhm/sql_helper.rb | # Copyright (c) 2011 - 2013, SoundCloud Ltd., Rany Keddo, Tobias Bielohlawek, Tobias
# Schmidt
module Lhm
module SqlHelper
extend self
def annotation
'/* large hadron migration */'
end
def idx_name(table_name, cols)
column_names = column_definition(cols).map(&:first)
"index_#{ tab... | ruby | BSD-3-Clause | 50907121eee514649fa944fb300d5d8a64fa873e | 2026-01-04T16:00:26.636526Z | false |
soundcloud/lhm | https://github.com/soundcloud/lhm/blob/50907121eee514649fa944fb300d5d8a64fa873e/lib/lhm/printer.rb | lib/lhm/printer.rb | module Lhm
module Printer
class Output
def write(message)
print message
end
end
class Base
def initialize
@output = Output.new
end
end
class Percentage < Base
def initialize
super
@max_length = 0
end
def notify(lowest, hi... | ruby | BSD-3-Clause | 50907121eee514649fa944fb300d5d8a64fa873e | 2026-01-04T16:00:26.636526Z | false |
soundcloud/lhm | https://github.com/soundcloud/lhm/blob/50907121eee514649fa944fb300d5d8a64fa873e/lib/lhm/migration.rb | lib/lhm/migration.rb | # Copyright (c) 2011 - 2013, SoundCloud Ltd., Rany Keddo, Tobias Bielohlawek, Tobias
# Schmidt
require 'lhm/intersection'
module Lhm
class Migration
attr_reader :origin, :destination, :conditions, :renames
def initialize(origin, destination, conditions = nil, renames = {}, time = Time.now)
@origin = ... | ruby | BSD-3-Clause | 50907121eee514649fa944fb300d5d8a64fa873e | 2026-01-04T16:00:26.636526Z | false |
soundcloud/lhm | https://github.com/soundcloud/lhm/blob/50907121eee514649fa944fb300d5d8a64fa873e/lib/lhm/invoker.rb | lib/lhm/invoker.rb | # Copyright (c) 2011 - 2013, SoundCloud Ltd., Rany Keddo, Tobias Bielohlawek, Tobias
# Schmidt
require 'lhm/chunker'
require 'lhm/entangler'
require 'lhm/atomic_switcher'
require 'lhm/locked_switcher'
require 'lhm/migrator'
module Lhm
# Copies an origin table to an altered destination table. Live activity is
# sy... | ruby | BSD-3-Clause | 50907121eee514649fa944fb300d5d8a64fa873e | 2026-01-04T16:00:26.636526Z | false |
soundcloud/lhm | https://github.com/soundcloud/lhm/blob/50907121eee514649fa944fb300d5d8a64fa873e/lib/lhm/entangler.rb | lib/lhm/entangler.rb | # Copyright (c) 2011 - 2013, SoundCloud Ltd., Rany Keddo, Tobias Bielohlawek, Tobias
# Schmidt
require 'lhm/command'
require 'lhm/sql_helper'
module Lhm
class Entangler
include Command
include SqlHelper
attr_reader :connection
# Creates entanglement between two tables. All creates, updates and del... | ruby | BSD-3-Clause | 50907121eee514649fa944fb300d5d8a64fa873e | 2026-01-04T16:00:26.636526Z | false |
soundcloud/lhm | https://github.com/soundcloud/lhm/blob/50907121eee514649fa944fb300d5d8a64fa873e/lib/lhm/intersection.rb | lib/lhm/intersection.rb | # Copyright (c) 2011 - 2013, SoundCloud Ltd., Rany Keddo, Tobias Bielohlawek, Tobias
# Schmidt
module Lhm
# Determine and format columns common to origin and destination.
class Intersection
def initialize(origin, destination, renames = {})
@origin = origin
@destination = destination
@renames... | ruby | BSD-3-Clause | 50907121eee514649fa944fb300d5d8a64fa873e | 2026-01-04T16:00:26.636526Z | false |
soundcloud/lhm | https://github.com/soundcloud/lhm/blob/50907121eee514649fa944fb300d5d8a64fa873e/lib/lhm/migrator.rb | lib/lhm/migrator.rb | # Copyright (c) 2011 - 2013, SoundCloud Ltd., Rany Keddo, Tobias Bielohlawek, Tobias
# Schmidt
require 'lhm/command'
require 'lhm/migration'
require 'lhm/sql_helper'
require 'lhm/table'
module Lhm
# Copies existing schema and applies changes using alter on the empty table.
# `run` returns a Migration which can be... | ruby | BSD-3-Clause | 50907121eee514649fa944fb300d5d8a64fa873e | 2026-01-04T16:00:26.636526Z | false |
soundcloud/lhm | https://github.com/soundcloud/lhm/blob/50907121eee514649fa944fb300d5d8a64fa873e/lib/lhm/throttler/slave_lag.rb | lib/lhm/throttler/slave_lag.rb | module Lhm
module Throttler
class SlaveLag
include Command
INITIAL_TIMEOUT = 0.1
DEFAULT_STRIDE = 40_000
DEFAULT_MAX_ALLOWED_LAG = 10
MAX_TIMEOUT = INITIAL_TIMEOUT * 1024
attr_accessor :timeout_seconds, :allowed_lag, :stride, :connection
def initialize(options = {})
... | ruby | BSD-3-Clause | 50907121eee514649fa944fb300d5d8a64fa873e | 2026-01-04T16:00:26.636526Z | false |
soundcloud/lhm | https://github.com/soundcloud/lhm/blob/50907121eee514649fa944fb300d5d8a64fa873e/lib/lhm/throttler/time.rb | lib/lhm/throttler/time.rb | module Lhm
module Throttler
class Time
include Command
DEFAULT_TIMEOUT = 0.1
DEFAULT_STRIDE = 40_000
attr_accessor :timeout_seconds
attr_accessor :stride
def initialize(options = {})
@timeout_seconds = options[:delay] || DEFAULT_TIMEOUT
@stride = options[:str... | ruby | BSD-3-Clause | 50907121eee514649fa944fb300d5d8a64fa873e | 2026-01-04T16:00:26.636526Z | false |
syxanash/awesome-web-desktops | https://github.com/syxanash/awesome-web-desktops/blob/c2a29477606f220e380df4155c3d75939bdc8f5a/tools/links_monitor.rb | tools/links_monitor.rb | require 'selenium-webdriver'
require 'json'
require 'rest-client'
require 'colorize'
require 'fuzzystringmatch'
require 'fileutils'
SIMILARITY_THRESHOLD = 70
# https://stackoverflow.com/a/10823131
def sanitize_filename(filename)
# Split the name when finding a period which is preceded by some
# character, and is ... | ruby | CC0-1.0 | c2a29477606f220e380df4155c3d75939bdc8f5a | 2026-01-04T16:00:27.662838Z | false |
syxanash/awesome-web-desktops | https://github.com/syxanash/awesome-web-desktops/blob/c2a29477606f220e380df4155c3d75939bdc8f5a/tools/readme_generator.rb | tools/readme_generator.rb | # this script generates the main README.md file
# in Awesome Web Desktops repository by fetching the web desktops json
require 'json'
require 'rest-client'
def escape_markdown(text)
text.gsub(/([\\|])/, '\\\\\1').gsub("\n", '<br>')
end
readme_file_name = '../README.md'
archived_file_name = '../archived.md'
websit... | ruby | CC0-1.0 | c2a29477606f220e380df4155c3d75939bdc8f5a | 2026-01-04T16:00:27.662838Z | false |
syxanash/awesome-web-desktops | https://github.com/syxanash/awesome-web-desktops/blob/c2a29477606f220e380df4155c3d75939bdc8f5a/tools/favicon_extractor.rb | tools/favicon_extractor.rb | # this script is a WIP...
require 'selenium-webdriver'
require 'selenium/devtools'
require 'json'
require 'rest-client'
require 'fileutils'
require 'uri'
# Load website list
websites_object = JSON.parse(RestClient.get('https://raw.githubusercontent.com/syxanash/syxanash.github.io/development/src/resources/remote-desk... | ruby | CC0-1.0 | c2a29477606f220e380df4155c3d75939bdc8f5a | 2026-01-04T16:00:27.662838Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/spec/money_spec.rb | spec/money_spec.rb | require 'spec_helper'
describe 'Money overrides' do
describe '.default_formatting_rules' do
it 'uses defauts set as individual options' do
allow(MoneyRails::Configuration).to receive(:symbol).and_return('£')
expect(Money.default_formatting_rules).to include(symbol: '£')
end
it 'ignores indi... | ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/spec/test_helpers_spec.rb | spec/test_helpers_spec.rb | require 'spec_helper'
if defined? ActiveRecord
describe 'TestHelpers' do
require "money-rails/test_helpers"
include MoneyRails::TestHelpers
let(:product) do
Product.create(price_cents: 3000, discount: 150,
bonus_cents: 200,
sale_price_amount: 1200)
en... | ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/spec/configuration_spec.rb | spec/configuration_spec.rb | require 'spec_helper'
describe "configuration" do
describe "initializer" do
it "sets default currency" do
expect(Money.default_currency).to eq(Money::Currency.new(:eur))
end
it "registers a custom currency" do
expect(Money::Currency.table).to include(:eu4)
end
it "adds exchange ra... | ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/spec/spec_helper.rb | spec/spec_helper.rb | ENV["RAILS_ENV"] = 'test'
# Require dummy Rails app
require File.expand_path("../../spec/dummy/config/environment", __FILE__)
require 'database_cleaner'
require 'rspec/rails'
# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Dir["#{File.dirname(__FILE__)... | ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/spec/support/database_cleaner.rb | spec/support/database_cleaner.rb |
RSpec.configure do |config|
config.before :suite do
if defined?(Mongoid)
DatabaseCleaner[:mongoid].clean_with :deletion
DatabaseCleaner[:mongoid].strategy = :deletion
else
DatabaseCleaner[:active_record].clean_with :truncation
DatabaseCleaner[:active_record].strategy = :transaction
... | ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/spec/helpers/action_view_extension_spec.rb | spec/helpers/action_view_extension_spec.rb | require 'spec_helper'
describe 'MoneyRails::ActionViewExtension' do
describe 'autoload' do
it 'is registered via autoload for eager loading compatibility' do
expect(MoneyRails.autoload?(:ActionViewExtension)).to eq('money-rails/helpers/action_view_extension')
end
end
end
describe 'MoneyRails::Action... | ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/spec/helpers/form_helper_spec.rb | spec/helpers/form_helper_spec.rb | require 'spec_helper'
if defined? ActiveRecord
describe "Test helper in form blocks", type: :helper do
let :product do
Product.create(price_cents: 3000, discount: 150,
bonus_cents: 200, optional_price: 100,
sale_price_amount: 1200)
end
context "textfield"... | ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/spec/mongoid/mongoid_spec.rb | spec/mongoid/mongoid_spec.rb | require 'spec_helper'
if defined?(Mongoid)
describe Money do
let!(:priceable) { Priceable.create(price: Money.new(100, 'EUR')) }
let(:priceable_from_nil) { Priceable.create(price: nil) }
let(:priceable_from_num) { Priceable.create(price: 1) }
let(:priceable_from_string) { Priceable.create(price: '1 ... | ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/spec/dummy/app/helpers/application_helper.rb | spec/dummy/app/helpers/application_helper.rb | module ApplicationHelper
end
| ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/spec/dummy/app/controllers/application_controller.rb | spec/dummy/app/controllers/application_controller.rb | class ApplicationController < ActionController::Base
protect_from_forgery
end
| ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/spec/dummy/app/models/dummy_product.rb | spec/dummy/app/models/dummy_product.rb | class DummyProduct < ActiveRecord::Base
# Use as model level currency
register_currency :gbp
# Use money-rails macros
monetize :price_cents, with_model_currency: :currency
end
| ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/spec/dummy/app/models/transaction.rb | spec/dummy/app/models/transaction.rb | class Transaction < ActiveRecord::Base
monetize :amount_cents, with_model_currency: :currency
monetize :tax_cents, with_model_currency: :currency
monetize :total_cents, with_model_currency: :currency
monetize :optional_amount_cents, with_model_currency: :currency, allow_nil: true
def total_cents(foo = 0, ... | ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/spec/dummy/app/models/product.rb | spec/dummy/app/models/product.rb | class Product < ActiveRecord::Base
# Use USD as model level currency
register_currency :usd
# Use money-rails macros
monetize :price_cents
# Use money-rails macro with multiple fields
monetize :delivery_fee_cents, :restock_fee_cents, allow_nil: true
# Use a custom name for the Money attribute
monetiz... | ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/spec/dummy/app/models/priceable.rb | spec/dummy/app/models/priceable.rb | if defined? Mongoid
class Priceable
include Mongoid::Document
field :price, type: Money
field :price_hash, type: Hash
end
end
| ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/spec/dummy/app/models/other_product.rb | spec/dummy/app/models/other_product.rb | class OtherProduct < ActiveRecord::Base
monetize :price_cents
end
| ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/spec/dummy/app/models/service.rb | spec/dummy/app/models/service.rb | class Service < ActiveRecord::Base
monetize :charge_cents, with_currency: :usd
monetize :discount_cents
end
| ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/spec/dummy/db/migrate/20150217222612_add_lambda_price_to_products.rb | spec/dummy/db/migrate/20150217222612_add_lambda_price_to_products.rb | class AddLambdaPriceToProducts < ActiveRecord::Migration[7.0]
def change
add_column :products, :lambda_price_cents, :integer
end
end
| ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/spec/dummy/db/migrate/20140110194016_add_validates_method_amount_cents_to_products.rb | spec/dummy/db/migrate/20140110194016_add_validates_method_amount_cents_to_products.rb | class AddValidatesMethodAmountCentsToProducts < ActiveRecord::Migration[7.0]
def change
add_column :products, :validates_method_amount_cents, :integer
end
end
| ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/spec/dummy/db/migrate/20150126231442_add_reduced_price_to_products.rb | spec/dummy/db/migrate/20150126231442_add_reduced_price_to_products.rb | class AddReducedPriceToProducts < ActiveRecord::Migration[7.0]
def change
add_column :products, :reduced_price_cents, :integer
add_column :products, :reduced_price_currency, :string
end
end
| ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/spec/dummy/db/migrate/20150107061030_add_delivery_fee_cents_and_restock_fee_cents_to_product.rb | spec/dummy/db/migrate/20150107061030_add_delivery_fee_cents_and_restock_fee_cents_to_product.rb | class AddDeliveryFeeCentsAndRestockFeeCentsToProduct < ActiveRecord::Migration[7.0]
def change
add_column :products, :delivery_fee_cents, :integer
add_column :products, :restock_fee_cents, :integer
end
end
| ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/spec/dummy/db/migrate/20120528181002_create_transactions.rb | spec/dummy/db/migrate/20120528181002_create_transactions.rb | class CreateTransactions < ActiveRecord::Migration[7.0]
def change
create_table :transactions do |t|
t.integer :amount_cents
t.integer :tax_cents
t.string :currency
t.timestamps
end
end
end
| ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/spec/dummy/db/migrate/20151026220420_add_optional_amount_to_transactions.rb | spec/dummy/db/migrate/20151026220420_add_optional_amount_to_transactions.rb | class AddOptionalAmountToTransactions < ActiveRecord::Migration[7.0]
def change
add_column :transactions, :optional_amount_cents, :integer
end
end
| ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/spec/dummy/db/migrate/20120528210103_create_dummy_products.rb | spec/dummy/db/migrate/20120528210103_create_dummy_products.rb | class CreateDummyProducts < ActiveRecord::Migration[7.0]
def change
create_table :dummy_products do |t|
t.string :currency
t.integer :price_cents
t.timestamps
end
end
end
| ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/spec/dummy/db/migrate/20120607210247_add_column_that_allows_nil.rb | spec/dummy/db/migrate/20120607210247_add_column_that_allows_nil.rb | class AddColumnThatAllowsNil < ActiveRecord::Migration[7.0]
def change
add_column :products, :optional_price_cents, :integer
end
end
| ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/spec/dummy/db/migrate/20130124023419_add_price_in_a_range_cents_to_products.rb | spec/dummy/db/migrate/20130124023419_add_price_in_a_range_cents_to_products.rb | class AddPriceInARangeCentsToProducts < ActiveRecord::Migration[7.0]
def change
add_column :products, :price_in_a_range_cents, :integer
end
end
| ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/spec/dummy/db/migrate/20240425081448_add_other_products.rb | spec/dummy/db/migrate/20240425081448_add_other_products.rb | class AddOtherProducts < ActiveRecord::Migration[7.0]
def change
create_table "other_products", force: :cascade do |t|
t.string "currency"
t.integer "price_cents"
t.datetime "created_at"
t.datetime "updated_at"
end
end
end
| ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/spec/dummy/db/migrate/20150213234410_add_special_price_to_products.rb | spec/dummy/db/migrate/20150213234410_add_special_price_to_products.rb | class AddSpecialPriceToProducts < ActiveRecord::Migration[7.0]
def change
add_column :products, :special_price_cents, :integer
end
end
| ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/spec/dummy/db/migrate/20120331190108_create_products.rb | spec/dummy/db/migrate/20120331190108_create_products.rb | class CreateProducts < ActiveRecord::Migration[7.0]
def change
create_table :products do |t|
t.integer :price_cents
t.integer :discount
t.timestamps
end
end
end
| ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/spec/dummy/db/migrate/20141005075025_add_aliased_attr_to_products.rb | spec/dummy/db/migrate/20141005075025_add_aliased_attr_to_products.rb | class AddAliasedAttrToProducts < ActiveRecord::Migration[7.0]
def change
add_column :products, :aliased_cents, :integer
end
end
| ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/spec/dummy/db/migrate/20120524052716_create_services.rb | spec/dummy/db/migrate/20120524052716_create_services.rb | class CreateServices < ActiveRecord::Migration[7.0]
def change
create_table :services do |t|
t.integer :charge_cents
t.integer :discount_cents
t.timestamps
end
end
end
| ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/spec/dummy/db/migrate/20120402080348_add_bonus_cents_to_product.rb | spec/dummy/db/migrate/20120402080348_add_bonus_cents_to_product.rb | class AddBonusCentsToProduct < ActiveRecord::Migration[7.0]
def change
add_column :products, :bonus_cents, :integer
end
end
| ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/spec/dummy/db/migrate/20120712202655_add_sale_price_cents_to_product.rb | spec/dummy/db/migrate/20120712202655_add_sale_price_cents_to_product.rb | class AddSalePriceCentsToProduct < ActiveRecord::Migration[7.0]
def change
add_column :products, :sale_price_amount, :integer,
default: 0, null: false
add_column :products, :sale_price_currency_code, :string
end
end
| ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/spec/dummy/db/migrate/20150303222230_add_skip_validation_price_cents_to_products.rb | spec/dummy/db/migrate/20150303222230_add_skip_validation_price_cents_to_products.rb | class AddSkipValidationPriceCentsToProducts < ActiveRecord::Migration[7.0]
def change
add_column :products, :skip_validation_price_cents, :string
end
end
| ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/spec/dummy/config/application.rb | spec/dummy/config/application.rb | require File.expand_path('../boot', __FILE__)
require "logger"
# Pick the frameworks you want:
require "active_record/railtie"
require "action_controller/railtie"
require "action_mailer/railtie"
require "sprockets/railtie"
Bundler.require
require "money-rails"
module Dummy
class Application < Rails::Application
... | ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/spec/dummy/config/environment.rb | spec/dummy/config/environment.rb | # Load the rails application
require File.expand_path('../application', __FILE__)
# Initialize the rails application
Dummy::Application.initialize!
| ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/spec/dummy/config/routes.rb | spec/dummy/config/routes.rb | Rails.application.routes.draw do
end
| ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/spec/dummy/config/boot.rb | spec/dummy/config/boot.rb | require 'rubygems'
# Default to rails7.0.gemfile if BUNDLE_GEMFILE is not set
default_gemfile = File.expand_path('../../../gemfiles/rails7.0.gemfile', __dir__)
unless ENV['BUNDLE_GEMFILE']
puts "No BUNDLE_GEMFILE specified, defaulting to rails7.0.gemfile"
ENV['BUNDLE_GEMFILE'] = default_gemfile
else
puts "Using... | ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/spec/dummy/config/initializers/session_store.rb | spec/dummy/config/initializers/session_store.rb | # Be sure to restart your server when you modify this file.
Dummy::Application.config.session_store :cookie_store, key: '_dummy_session'
# Use the database for sessions instead of the cookie-based default,
# which shouldn't be used to store highly confidential information
# (create the session table with "rails gener... | ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/spec/dummy/config/initializers/money.rb | spec/dummy/config/initializers/money.rb | # encoding : utf-8
MoneyRails.configure do |config|
Money.locale_backend = :i18n
Money.rounding_mode = BigDecimal::ROUND_HALF_UP
# To set the default currency
#
config.default_currency = :eur
# Add some rates
config.add_rate "USD", "CAD", 1.24515
config.add_rate "CAD", "USD", 0.803115
# To handle ... | ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/spec/dummy/config/initializers/wrap_parameters.rb | spec/dummy/config/initializers/wrap_parameters.rb | # Be sure to restart your server when you modify this file.
#
# This file contains settings for ActionController::ParamsWrapper which
# is enabled by default.
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
ActiveSupport.on_load(:action_controller) do
wrap_parameters ... | ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/spec/dummy/config/initializers/inflections.rb | spec/dummy/config/initializers/inflections.rb | # Be sure to restart your server when you modify this file.
# Add new inflection rules using the following format
# (all these examples are active by default):
# ActiveSupport::Inflector.inflections do |inflect|
# inflect.plural /^(ox)$/i, '\1en'
# inflect.singular /^(ox)en/i, '\1'
# inflect.irregular 'person', ... | ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/spec/dummy/config/initializers/backtrace_silencers.rb | spec/dummy/config/initializers/backtrace_silencers.rb | # Be sure to restart your server when you modify this file.
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
# You can also remove all the silencers if you're trying to debug a probl... | ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/spec/dummy/config/initializers/mime_types.rb | spec/dummy/config/initializers/mime_types.rb | # Be sure to restart your server when you modify this file.
# Add new mime types for use in respond_to blocks:
# Mime::Type.register "text/richtext", :rtf
# Mime::Type.register_alias "text/html", :iphone
| ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/spec/dummy/config/initializers/secret_token.rb | spec/dummy/config/initializers/secret_token.rb | # Be sure to restart your server when you modify this file.
# Your secret key for verifying the integrity of signed cookies.
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attac... | ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/spec/dummy/config/environments/test.rb | spec/dummy/config/environments/test.rb | Dummy::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test suit... | ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/spec/dummy/config/environments/development.rb | spec/dummy/config/environments/development.rb | Dummy::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the web serv... | ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/spec/dummy/config/environments/production.rb | spec/dummy/config/environments/production.rb | Dummy::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# Code is not reloaded between requests
config.cache_classes = true
# Eager load code on boot. This eager loads most of Rails and
# your application in memory, allowing both threaded web server... | ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/spec/active_record/monetizable_spec.rb | spec/active_record/monetizable_spec.rb | require 'spec_helper'
class Sub < Product; end
if defined? ActiveRecord
describe MoneyRails::ActiveRecord::Monetizable do
let(:product) do
Product.create(price_cents: 3000, discount: 150,
bonus_cents: 200, optional_price: 100,
sale_price_amount: 1200, delivery_fee... | ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | true |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/spec/active_record/migration_extensions/table_spec.rb | spec/active_record/migration_extensions/table_spec.rb | require 'spec_helper'
class Item < ActiveRecord::Base; end
if defined? ActiveRecord
describe MoneyRails::ActiveRecord::MigrationExtensions::SchemaStatements do
before :all do
@connection = ActiveRecord::Base.connection
@connection.send :extend, MoneyRails::ActiveRecord::MigrationExtensions::SchemaSt... | ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/spec/active_record/migration_extensions/schema_statements_spec.rb | spec/active_record/migration_extensions/schema_statements_spec.rb | require 'spec_helper'
class Item < ActiveRecord::Base; end
if defined? ActiveRecord
describe MoneyRails::ActiveRecord::MigrationExtensions::SchemaStatements do
before :all do
@connection = ActiveRecord::Base.connection
@connection.drop_table :items if @connection.table_exists? :items
@connecti... | ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/spec/active_job/money_serializer_spec.rb | spec/active_job/money_serializer_spec.rb | require 'spec_helper'
if defined?(::ActiveJob::Serializers)
describe MoneyRails::ActiveJob::MoneySerializer do
let(:money) { Money.new(1_00, "EUR") }
let(:serialized_money) do
{
"_aj_serialized" => "MoneyRails::ActiveJob::MoneySerializer",
"cents" => 1_00,
"currency" => "EUR",
... | ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/lib/money-rails.rb | lib/money-rails.rb | require "money"
require "monetize"
require "monetize/core_extensions"
require "money-rails/configuration"
require "money-rails/money"
require "money-rails/version"
require 'money-rails/hooks'
require 'money-rails/errors'
module MoneyRails
autoload :ActionViewExtension, 'money-rails/helpers/action_view_extension'
... | ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/lib/generators/templates/money.rb | lib/generators/templates/money.rb | # encoding : utf-8
MoneyRails.configure do |config|
# To set the default currency
#
# config.default_currency = :usd
# Set default bank object
#
# Example:
# config.default_bank = EuCentralBank.new
# Add exchange rates to current money bank object.
# (The conversion rate refers to one direction on... | ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/lib/generators/money_rails/initializer_generator.rb | lib/generators/money_rails/initializer_generator.rb | module MoneyRails
module Generators
class InitializerGenerator < ::Rails::Generators::Base
source_root File.expand_path("../../templates", __FILE__)
desc 'Creates a sample MoneyRails initializer.'
def copy_initializer
copy_file 'money.rb', 'config/initializers/money.rb'
end
... | ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/lib/money-rails/version.rb | lib/money-rails/version.rb | # frozen_string_literal: true
module MoneyRails
VERSION = "2.0.0"
end
| ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/lib/money-rails/errors.rb | lib/money-rails/errors.rb | module MoneyRails
class Error < StandardError; end
end
| ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/lib/money-rails/hooks.rb | lib/money-rails/hooks.rb | module MoneyRails
class Hooks
PG_ADAPTERS = %w(activerecord-jdbcpostgresql-adapter postgresql postgis)
def self.init
# For Active Record
ActiveSupport.on_load(:active_record) do
require 'money-rails/active_model/validator'
require 'money-rails/active_record/monetizable'
::... | ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/lib/money-rails/money.rb | lib/money-rails/money.rb | require "active_support/core_ext/module/aliasing.rb"
require "active_support/core_ext/hash/reverse_merge.rb"
class Money
class << self
alias_method :orig_default_formatting_rules, :default_formatting_rules
def default_formatting_rules
rules = orig_default_formatting_rules || {}
defaults = {
... | ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/lib/money-rails/railtie.rb | lib/money-rails/railtie.rb | module MoneyRails
class Railtie < ::Rails::Railtie
initializer 'moneyrails.initialize', after: 'active_record.initialize_database' do
MoneyRails::Hooks.init
end
end
end
| ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/lib/money-rails/configuration.rb | lib/money-rails/configuration.rb | require 'active_support/core_ext/module/delegation'
require 'active_support/core_ext/module/attribute_accessors'
require 'active_support/core_ext/string/inflections'
module MoneyRails
# MoneyRails configuration module.
# This is extended by MoneyRails to provide configuration settings.
module Configuration
... | ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/lib/money-rails/rails_admin.rb | lib/money-rails/rails_admin.rb | require 'rails_admin/config/fields'
require 'rails_admin/config/fields/types/integer'
require 'money-rails/helpers/action_view_extension'
include MoneyRails::ActionViewExtension
module RailsAdmin
module Config
module Fields
module Types
class Money < RailsAdmin::Config::Fields::Types::Decimal
... | ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/lib/money-rails/test_helpers.rb | lib/money-rails/test_helpers.rb | require 'rspec/expectations'
module MoneyRails
module TestHelpers
def monetize(attribute)
MonetizeMatcher.new(attribute)
end
class MonetizeMatcher
def initialize(attribute)
@attribute = attribute
end
def with_currency(currency)
@currency_iso = currency
se... | ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/lib/money-rails/engine.rb | lib/money-rails/engine.rb | module MoneyRails
class Engine < ::Rails::Engine
end
end
| ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/lib/money-rails/helpers/action_view_extension.rb | lib/money-rails/helpers/action_view_extension.rb | module MoneyRails
module ActionViewExtension
def currency_symbol(currency = Money.default_currency)
content_tag(:span, Money::Currency.find(currency).symbol, class: "currency_symbol")
end
def humanized_money(value, options={})
if !options || !options.is_a?(Hash)
warn "humanized_money ... | ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/lib/money-rails/mongoid/money.rb | lib/money-rails/mongoid/money.rb | class Money
# Converts an object of this instance into a database friendly value.
def mongoize
{
cents: cents.mongoize.to_f,
currency_iso: currency.iso_code.mongoize
}
end
class << self
# Get the object as it was stored in the database, and instantiate
# this custom class f... | ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/lib/money-rails/active_model/validator.rb | lib/money-rails/active_model/validator.rb | module MoneyRails
module ActiveModel
class MoneyValidator < ::ActiveModel::Validations::NumericalityValidator
class Details < Struct.new(:raw_value, :thousands_separator, :decimal_mark)
def abs_raw_value
@abs_raw_value ||= raw_value.to_s.sub(/^\s*-/, "").strip
end
def deci... | ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/lib/money-rails/active_record/monetizable.rb | lib/money-rails/active_record/monetizable.rb | require 'active_support/concern'
require 'active_support/core_ext/array/extract_options'
require 'active_support/deprecation/reporting'
module MoneyRails
module ActiveRecord
module Monetizable
class ReadOnlyCurrencyException < MoneyRails::Error; end
extend ActiveSupport::Concern
module ClassMe... | ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/lib/money-rails/active_record/migration_extensions/table.rb | lib/money-rails/active_record/migration_extensions/table.rb | module MoneyRails
module ActiveRecord
module MigrationExtensions
module Table
def money(accessor, options={})
monetize(accessor, options)
end
def remove_money(accessor, options={})
remove_monetize(accessor, options)
end
end
end
end
end
| ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/lib/money-rails/active_record/migration_extensions/schema_statements.rb | lib/money-rails/active_record/migration_extensions/schema_statements.rb | module MoneyRails
module ActiveRecord
module MigrationExtensions
module SchemaStatements
def add_money(table_name, accessor, options={})
add_monetize(table_name, accessor, options)
end
def remove_money(table_name, accessor, options={})
remove_monetize(table_name,... | ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/lib/money-rails/active_record/migration_extensions/table_pg.rb | lib/money-rails/active_record/migration_extensions/table_pg.rb | module MoneyRails
module ActiveRecord
module MigrationExtensions
module Table
def monetize(accessor, options={})
[:amount, :currency].each do |attribute|
column_present, _, *opts = OptionsExtractor.extract attribute, :no_table, accessor, options
constraints = opts.p... | ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/lib/money-rails/active_record/migration_extensions/options_extractor.rb | lib/money-rails/active_record/migration_extensions/options_extractor.rb | module MoneyRails
module ActiveRecord
module MigrationExtensions
class OptionsExtractor
def self.extract(attribute, table_name, accessor, options = {})
default = MoneyRails::Configuration.send("#{attribute}_column").merge(options[attribute] || {})
default[:column_name] ||= [defa... | ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/lib/money-rails/active_record/migration_extensions/schema_statements_pg.rb | lib/money-rails/active_record/migration_extensions/schema_statements_pg.rb | module MoneyRails
module ActiveRecord
module MigrationExtensions
module SchemaStatements
def add_monetize(table_name, accessor, options={})
[:amount, :currency].each do |attribute|
column_present, *opts = OptionsExtractor.extract attribute, table_name, accessor, options
... | ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
RubyMoney/money-rails | https://github.com/RubyMoney/money-rails/blob/eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f/lib/money-rails/active_job/money_serializer.rb | lib/money-rails/active_job/money_serializer.rb | # frozen_string_literal: true
module MoneyRails
module ActiveJob
class MoneySerializer < ::ActiveJob::Serializers::ObjectSerializer
def serialize?(argument)
argument.is_a?(Money)
end
def serialize(money)
super("cents" => money.cents, "currency" => money.currency.to_s)
end... | ruby | MIT | eb29d5b21dc63ab55b5dfcf8c60ea23dfadedb1f | 2026-01-04T16:00:24.098128Z | false |
etsy/deployinator | https://github.com/etsy/deployinator/blob/42a863f9377b529b6514ddaceccd69c9b0b9c515/test/unit/concurrency_test.rb | test/unit/concurrency_test.rb | require 'deployinator'
require 'deployinator/helpers'
require 'deployinator/helpers/concurrency'
require 'test/unit'
require 'mocha/setup'
Celluloid.logger = nil
class ConcurrencyTest < Test::Unit::TestCase
# Celluloid recommends doing this before each test
# https://github.com/celluloid/celluloid/wiki/Gotchas#tes... | ruby | MIT | 42a863f9377b529b6514ddaceccd69c9b0b9c515 | 2026-01-04T16:00:19.268213Z | false |
etsy/deployinator | https://github.com/etsy/deployinator/blob/42a863f9377b529b6514ddaceccd69c9b0b9c515/test/unit/version_test.rb | test/unit/version_test.rb | require 'deployinator/helpers/version'
require 'test/unit'
require 'mocha/setup'
class VersionTest < Test::Unit::TestCase
def test_get_build_from_valid_string
res = Deployinator::Helpers::VersionHelpers.get_build('c5e3d40-20111227-195028-UTC')
assert_equal('c5e3d40', res)
end
def test_get_build_from_lo... | ruby | MIT | 42a863f9377b529b6514ddaceccd69c9b0b9c515 | 2026-01-04T16:00:19.268213Z | false |
etsy/deployinator | https://github.com/etsy/deployinator/blob/42a863f9377b529b6514ddaceccd69c9b0b9c515/test/unit/helpers_dsh_test.rb | test/unit/helpers_dsh_test.rb | require 'deployinator'
require 'deployinator/helpers'
require 'deployinator/helpers/dsh'
require 'test/unit'
require 'mocha/setup'
include Deployinator
include Deployinator::Helpers
include Deployinator::Helpers::DshHelpers
#
# Set of tests for methods in our DshHelpers Module
#
class DshHelperTest < Test::Unit::Test... | ruby | MIT | 42a863f9377b529b6514ddaceccd69c9b0b9c515 | 2026-01-04T16:00:19.268213Z | false |
etsy/deployinator | https://github.com/etsy/deployinator/blob/42a863f9377b529b6514ddaceccd69c9b0b9c515/test/unit/git_test.rb | test/unit/git_test.rb | require 'deployinator'
require 'deployinator/helpers'
require 'deployinator/helpers/git'
include Deployinator::Helpers::GitHelpers
class HelpersTest < Test::Unit::TestCase
def test_git_url_https
GitHelpers.expects(:which_github_host).returns("www.testmagic.com")
GitHelpers.expects(:git_info_for_stack).retu... | ruby | MIT | 42a863f9377b529b6514ddaceccd69c9b0b9c515 | 2026-01-04T16:00:19.268213Z | false |
etsy/deployinator | https://github.com/etsy/deployinator/blob/42a863f9377b529b6514ddaceccd69c9b0b9c515/test/unit/helpers_test.rb | test/unit/helpers_test.rb | # encoding: utf-8
require 'deployinator'
require 'deployinator/helpers'
require 'deployinator/helpers/dsh'
require 'tempfile'
class HelpersTest < Test::Unit::TestCase
include Deployinator::Helpers,
Deployinator::Helpers::DshHelpers
def setup
@jurl = %Q{<a href='https://github.com/example/repo/issues/%s' ... | ruby | MIT | 42a863f9377b529b6514ddaceccd69c9b0b9c515 | 2026-01-04T16:00:19.268213Z | false |
etsy/deployinator | https://github.com/etsy/deployinator/blob/42a863f9377b529b6514ddaceccd69c9b0b9c515/test/character/deployinator_helpers_test.rb | test/character/deployinator_helpers_test.rb | require 'test/unit'
require 'mocha/test_unit'
require 'open3'
require File.expand_path('../../lib/deployinator/helpers.rb',__dir__)
class DeployinatorHelpersTest < Test::Unit::TestCase
def test_run_cmd_calls_popen3_once_with_expected_command
# arrange
cmd = 'fakecommand'
deployinator_helper = Class.new... | ruby | MIT | 42a863f9377b529b6514ddaceccd69c9b0b9c515 | 2026-01-04T16:00:19.268213Z | false |
etsy/deployinator | https://github.com/etsy/deployinator/blob/42a863f9377b529b6514ddaceccd69c9b0b9c515/bin/deployinator-tailer.rb | bin/deployinator-tailer.rb | #!/bin/env ruby
require "deployinator"
require "deployinator/base"
require "deployinator/helpers"
require 'deployinator/stack-tail'
require 'deployinator/helpers/stack-tail'
# Note: If you change the protocol of how this communicates with the front end,
# please also update the version located in helpers/stack-tail.r... | ruby | MIT | 42a863f9377b529b6514ddaceccd69c9b0b9c515 | 2026-01-04T16:00:19.268213Z | false |
etsy/deployinator | https://github.com/etsy/deployinator/blob/42a863f9377b529b6514ddaceccd69c9b0b9c515/lib/deployinator.rb | lib/deployinator.rb | require 'deployinator/version'
require 'deployinator/views/index'
# = Deployinator
#
# This is the main entry point for all things in the Deployination.
module Deployinator
# = Config settings
class << self
# File to log to
attr_accessor :log_file
# Your company domain name
attr_accessor :domain
... | ruby | MIT | 42a863f9377b529b6514ddaceccd69c9b0b9c515 | 2026-01-04T16:00:19.268213Z | false |
etsy/deployinator | https://github.com/etsy/deployinator/blob/42a863f9377b529b6514ddaceccd69c9b0b9c515/lib/deployinator/stack-tail.rb | lib/deployinator/stack-tail.rb | # -*- coding: utf-8 -*-
require "em-websocket"
require "eventmachine-tail"
module Tailer
# Extends FileTail to push data tailed to an EM::Channel. All open websockets
# subscribe to a channel for the request stack and this pushes the data to
# all of them at once.
class StackTail < EventMachine::FileTail
d... | ruby | MIT | 42a863f9377b529b6514ddaceccd69c9b0b9c515 | 2026-01-04T16:00:19.268213Z | false |
etsy/deployinator | https://github.com/etsy/deployinator/blob/42a863f9377b529b6514ddaceccd69c9b0b9c515/lib/deployinator/version.rb | lib/deployinator/version.rb | module Deployinator
VERSION = "1.1.1"
end
| ruby | MIT | 42a863f9377b529b6514ddaceccd69c9b0b9c515 | 2026-01-04T16:00:19.268213Z | false |
etsy/deployinator | https://github.com/etsy/deployinator/blob/42a863f9377b529b6514ddaceccd69c9b0b9c515/lib/deployinator/logging.rb | lib/deployinator/logging.rb | module Deployinator
def self.setup_logging
if Deployinator.log_file?
$deployinator_log_handle = File.new(Deployinator.log_file, "a")
def $stdout.write(string)
$deployinator_log_handle.write string
super
end
$stdout.sync = true
$stderr.reopen($deployinator_log_handle)
... | ruby | MIT | 42a863f9377b529b6514ddaceccd69c9b0b9c515 | 2026-01-04T16:00:19.268213Z | false |
etsy/deployinator | https://github.com/etsy/deployinator/blob/42a863f9377b529b6514ddaceccd69c9b0b9c515/lib/deployinator/plugin.rb | lib/deployinator/plugin.rb | module Deployinator
class Plugin
def run(event, state)
raise "Plugin: #{self.class} does not implement run method"
end
end
end
| ruby | MIT | 42a863f9377b529b6514ddaceccd69c9b0b9c515 | 2026-01-04T16:00:19.268213Z | false |
etsy/deployinator | https://github.com/etsy/deployinator/blob/42a863f9377b529b6514ddaceccd69c9b0b9c515/lib/deployinator/helpers.rb | lib/deployinator/helpers.rb | require 'benchmark'
require 'timeout'
require 'cgi'
require 'deployinator/helpers/version'
require 'deployinator/helpers/plugin'
module Deployinator
module Helpers
class CommandContainsNewlinesError < StandardError
attr_accessor :original_command
def initialize(original_command = nil)
self.o... | ruby | MIT | 42a863f9377b529b6514ddaceccd69c9b0b9c515 | 2026-01-04T16:00:19.268213Z | false |
etsy/deployinator | https://github.com/etsy/deployinator/blob/42a863f9377b529b6514ddaceccd69c9b0b9c515/lib/deployinator/app.rb | lib/deployinator/app.rb | require 'sinatra/base'
require 'mustache/sinatra'
require 'deployinator'
require 'deployinator/controller'
require 'deployinator/helpers'
require 'deployinator/helpers/deploy'
require 'deployinator/helpers/version'
require 'deployinator/helpers/git'
require 'deployinator/helpers/plugin'
require 'deployinator/views/log'... | ruby | MIT | 42a863f9377b529b6514ddaceccd69c9b0b9c515 | 2026-01-04T16:00:19.268213Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.