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 |
|---|---|---|---|---|---|---|---|---|
elct9620/rails-letsencrypt | https://github.com/elct9620/rails-letsencrypt/blob/ff544157f89112d81573dfa1151dea6d97c88c28/lib/letsencrypt/verify_service.rb | lib/letsencrypt/verify_service.rb | # frozen_string_literal: true
module LetsEncrypt
# Process the verification of the domain
class VerifyService
STATUS_PENDING = 'pending'
STATUS_VALID = 'valid'
attr_reader :checker
def initialize(config: LetsEncrypt.config)
@checker = StatusChecker.new(
max_attempts: config.max_atte... | ruby | MIT | ff544157f89112d81573dfa1151dea6d97c88c28 | 2026-01-04T17:47:41.292155Z | false |
elct9620/rails-letsencrypt | https://github.com/elct9620/rails-letsencrypt/blob/ff544157f89112d81573dfa1151dea6d97c88c28/lib/letsencrypt/redis.rb | lib/letsencrypt/redis.rb | # frozen_string_literal: true
module LetsEncrypt
# :nodoc:
class Redis
class << self
def connection
@connection ||= ::Redis.new(url: LetsEncrypt.config.redis_url)
end
# Save certificate into redis.
def save(cert)
return unless cert.key.present? && cert.bundle.present?
... | ruby | MIT | ff544157f89112d81573dfa1151dea6d97c88c28 | 2026-01-04T17:47:41.292155Z | false |
elct9620/rails-letsencrypt | https://github.com/elct9620/rails-letsencrypt/blob/ff544157f89112d81573dfa1151dea6d97c88c28/lib/letsencrypt/errors.rb | lib/letsencrypt/errors.rb | # frozen_string_literal: true
module LetsEncrypt
class Error < StandardError; end
class MaxCheckExceeded < Error; end
class InvalidStatus < Error; end
end
| ruby | MIT | ff544157f89112d81573dfa1151dea6d97c88c28 | 2026-01-04T17:47:41.292155Z | false |
elct9620/rails-letsencrypt | https://github.com/elct9620/rails-letsencrypt/blob/ff544157f89112d81573dfa1151dea6d97c88c28/lib/letsencrypt/railtie.rb | lib/letsencrypt/railtie.rb | # frozen_string_literal: true
module LetsEncrypt
class Railtie < ::Rails::Railtie
end
end
| ruby | MIT | ff544157f89112d81573dfa1151dea6d97c88c28 | 2026-01-04T17:47:41.292155Z | false |
elct9620/rails-letsencrypt | https://github.com/elct9620/rails-letsencrypt/blob/ff544157f89112d81573dfa1151dea6d97c88c28/lib/letsencrypt/configuration.rb | lib/letsencrypt/configuration.rb | # frozen_string_literal: true
module LetsEncrypt
# :nodoc:
class Configuration
include ActiveSupport::Configurable
config_accessor :acme_directory
config_accessor :use_staging do
!Rails.env.production?
end
config_accessor :private_key_path
config_accessor :use_env_key do
false... | ruby | MIT | ff544157f89112d81573dfa1151dea6d97c88c28 | 2026-01-04T17:47:41.292155Z | false |
elct9620/rails-letsencrypt | https://github.com/elct9620/rails-letsencrypt/blob/ff544157f89112d81573dfa1151dea6d97c88c28/lib/letsencrypt/renew_service.rb | lib/letsencrypt/renew_service.rb | # frozen_string_literal: true
module LetsEncrypt
# The renew service to create or renew the certificate
class RenewService
attr_reader :acme_client, :config
def initialize(acme_client: LetsEncrypt.client, config: LetsEncrypt.config)
@acme_client = acme_client
@config = config
end
def ... | ruby | MIT | ff544157f89112d81573dfa1151dea6d97c88c28 | 2026-01-04T17:47:41.292155Z | false |
elct9620/rails-letsencrypt | https://github.com/elct9620/rails-letsencrypt/blob/ff544157f89112d81573dfa1151dea6d97c88c28/lib/letsencrypt/engine.rb | lib/letsencrypt/engine.rb | # frozen_string_literal: true
module LetsEncrypt
# :nodoc:
class Engine < ::Rails::Engine
isolate_namespace LetsEncrypt
engine_name :letsencrypt
config.generators.test_framework :rspec
end
end
| ruby | MIT | ff544157f89112d81573dfa1151dea6d97c88c28 | 2026-01-04T17:47:41.292155Z | false |
elct9620/rails-letsencrypt | https://github.com/elct9620/rails-letsencrypt/blob/ff544157f89112d81573dfa1151dea6d97c88c28/lib/letsencrypt/issue_service.rb | lib/letsencrypt/issue_service.rb | # frozen_string_literal: true
module LetsEncrypt
# The issue service to download the certificate
class IssueService
attr_reader :checker
STATUS_PROCESSING = 'processing'
def initialize(config: LetsEncrypt.config)
@checker = StatusChecker.new(
max_attempts: config.max_attempts,
i... | ruby | MIT | ff544157f89112d81573dfa1151dea6d97c88c28 | 2026-01-04T17:47:41.292155Z | false |
elct9620/rails-letsencrypt | https://github.com/elct9620/rails-letsencrypt/blob/ff544157f89112d81573dfa1151dea6d97c88c28/config/routes.rb | config/routes.rb | # frozen_string_literal: true
LetsEncrypt::Engine.routes.draw do
get '/acme-challenge/:verification_path', to: 'verifications#show'
end
| ruby | MIT | ff544157f89112d81573dfa1151dea6d97c88c28 | 2026-01-04T17:47:41.292155Z | false |
visualitypl/textris | https://github.com/visualitypl/textris/blob/e95954a869198d66b976692114a834f48d6f937c/spec/spec_helper.rb | spec/spec_helper.rb | require 'simplecov'
require 'scrutinizer/ocular'
require "scrutinizer/ocular/formatter"
require "codeclimate-test-reporter"
require "sidekiq/testing"
require 'textris/delay/active_job/missing'
require 'textris/delay/sidekiq/missing'
CodeClimate::TestReporter.configuration.logger = Logger.new("/dev/null")
if Scrutiniz... | ruby | MIT | e95954a869198d66b976692114a834f48d6f937c | 2026-01-04T17:47:39.808354Z | false |
visualitypl/textris | https://github.com/visualitypl/textris/blob/e95954a869198d66b976692114a834f48d6f937c/spec/textris/message_spec.rb | spec/textris/message_spec.rb | describe Textris::Message do
let(:message) do
Textris::Message.new(
:content => 'X',
:from => 'X',
:to => '+48 111 222 333')
end
describe '#initialize' do
describe 'parsing :from' do
it 'parses "name <phone>" syntax properly' do
message = Textris::Message.new(
... | ruby | MIT | e95954a869198d66b976692114a834f48d6f937c | 2026-01-04T17:47:39.808354Z | false |
visualitypl/textris | https://github.com/visualitypl/textris/blob/e95954a869198d66b976692114a834f48d6f937c/spec/textris/delivery_spec.rb | spec/textris/delivery_spec.rb | describe Textris::Delivery do
describe '#get' do
before do
Object.send(:remove_const, :Rails) if defined?(Rails)
class FakeEnv
def initialize(options = {})
self.name = 'development'
end
def name=(value)
@development = false
@test = false
... | ruby | MIT | e95954a869198d66b976692114a834f48d6f937c | 2026-01-04T17:47:39.808354Z | false |
visualitypl/textris | https://github.com/visualitypl/textris/blob/e95954a869198d66b976692114a834f48d6f937c/spec/textris/base_spec.rb | spec/textris/base_spec.rb | describe Textris::Base do
describe '#default' do
it 'sets defaults' do
some_texter = Class.new(Textris::Base)
expect do
some_texter.instance_eval do
default :from => "Me"
end
end.not_to raise_error
defaults = some_texter.instance_variable_get('@defaults')[:from]... | ruby | MIT | e95954a869198d66b976692114a834f48d6f937c | 2026-01-04T17:47:39.808354Z | false |
visualitypl/textris | https://github.com/visualitypl/textris/blob/e95954a869198d66b976692114a834f48d6f937c/spec/textris/phone_formatter_spec.rb | spec/textris/phone_formatter_spec.rb | describe Textris::PhoneFormatter do
it 'should recognise a 4 digit short code' do
expect(described_class.format("4437")).to eq('4437')
expect(described_class.is_a_short_code?("4437")).to eq(true)
end
it 'should recognise a 5 digit short code' do
expect(described_class.format("44397")).to eq('44397')
... | ruby | MIT | e95954a869198d66b976692114a834f48d6f937c | 2026-01-04T17:47:39.808354Z | false |
visualitypl/textris | https://github.com/visualitypl/textris/blob/e95954a869198d66b976692114a834f48d6f937c/spec/textris/delivery/mail_spec.rb | spec/textris/delivery/mail_spec.rb | describe Textris::Delivery::Mail do
let(:message) do
Textris::Message.new(
:from => 'Mr Jones <+48 555 666 777>',
:to => ['+48 600 700 800', '+48 100 200 300'],
:content => 'Some text',
:texter => 'Namespace::MyCuteTexter',
:action => 'my_action',
:medi... | ruby | MIT | e95954a869198d66b976692114a834f48d6f937c | 2026-01-04T17:47:39.808354Z | false |
visualitypl/textris | https://github.com/visualitypl/textris/blob/e95954a869198d66b976692114a834f48d6f937c/spec/textris/delivery/nexmo_spec.rb | spec/textris/delivery/nexmo_spec.rb | describe Textris::Delivery::Nexmo do
let(:message) do
Textris::Message.new(
:to => ['+48 600 700 800', '+48 100 200 300'],
:content => 'Some text',
:from => 'Alpha ID')
end
let(:delivery) { Textris::Delivery::Nexmo.new(message) }
before do
module Nexmo
class Client
de... | ruby | MIT | e95954a869198d66b976692114a834f48d6f937c | 2026-01-04T17:47:39.808354Z | false |
visualitypl/textris | https://github.com/visualitypl/textris/blob/e95954a869198d66b976692114a834f48d6f937c/spec/textris/delivery/twilio_spec.rb | spec/textris/delivery/twilio_spec.rb | describe Textris::Delivery::Twilio do
before do
class MessageArray
@created = []
class << self
attr_reader :created
end
def create(message)
self.class.created.push(message)
end
end
module Twilio
module REST
class Client
attr_reader ... | ruby | MIT | e95954a869198d66b976692114a834f48d6f937c | 2026-01-04T17:47:39.808354Z | false |
visualitypl/textris | https://github.com/visualitypl/textris/blob/e95954a869198d66b976692114a834f48d6f937c/spec/textris/delivery/log_spec.rb | spec/textris/delivery/log_spec.rb | describe Textris::Delivery::Log do
let(:message) do
Textris::Message.new(
:from => 'Mr Jones <+48 555 666 777>',
:to => ['+48 600 700 800', '48100200300'],
:content => 'Some text')
end
let(:delivery) { Textris::Delivery::Log.new(message) }
let(:logger) { FakeLogger.new }
befo... | ruby | MIT | e95954a869198d66b976692114a834f48d6f937c | 2026-01-04T17:47:39.808354Z | false |
visualitypl/textris | https://github.com/visualitypl/textris/blob/e95954a869198d66b976692114a834f48d6f937c/spec/textris/delivery/test_spec.rb | spec/textris/delivery/test_spec.rb | describe Textris::Delivery::Test do
let(:message) do
Textris::Message.new(
:to => ['+48 600 700 800', '+48 100 200 300'],
:content => 'Some text',
:media_urls => ["http://example.com/hilarious.gif"])
end
let(:delivery) { Textris::Delivery::Test.new(message) }
it 'responds to :... | ruby | MIT | e95954a869198d66b976692114a834f48d6f937c | 2026-01-04T17:47:39.808354Z | false |
visualitypl/textris | https://github.com/visualitypl/textris/blob/e95954a869198d66b976692114a834f48d6f937c/spec/textris/delay/sidekiq_spec.rb | spec/textris/delay/sidekiq_spec.rb | describe Textris::Delay::Sidekiq do
before do
class MyTexter < Textris::Base
def delayed_action(phone, body)
text :to => phone, :body => body
end
def serialized_action(user)
text :to => user.id, :body => 'Hello'
end
def serialized_array_action(users)
text :t... | ruby | MIT | e95954a869198d66b976692114a834f48d6f937c | 2026-01-04T17:47:39.808354Z | false |
visualitypl/textris | https://github.com/visualitypl/textris/blob/e95954a869198d66b976692114a834f48d6f937c/spec/textris/delay/active_job_spec.rb | spec/textris/delay/active_job_spec.rb | describe Textris::Delay::ActiveJob do
before do
class MyTexter < Textris::Base
def delayed_action(phone)
text :to => phone
end
end
class ActiveJob::Logging::LogSubscriber
def info(*args, &block)
end
end
end
context 'ActiveJob not present' do
let(:message) do
... | ruby | MIT | e95954a869198d66b976692114a834f48d6f937c | 2026-01-04T17:47:39.808354Z | false |
visualitypl/textris | https://github.com/visualitypl/textris/blob/e95954a869198d66b976692114a834f48d6f937c/example/rails-4.2/app/texters/user_texter.rb | example/rails-4.2/app/texters/user_texter.rb | class UserTexter < Textris::Base
default :from => "Our Team <+48 666-777-888>"
def welcome(user)
@user = user
text :to => @user.phone
end
end
| ruby | MIT | e95954a869198d66b976692114a834f48d6f937c | 2026-01-04T17:47:39.808354Z | false |
visualitypl/textris | https://github.com/visualitypl/textris/blob/e95954a869198d66b976692114a834f48d6f937c/example/rails-4.2/app/helpers/application_helper.rb | example/rails-4.2/app/helpers/application_helper.rb | module ApplicationHelper
end
| ruby | MIT | e95954a869198d66b976692114a834f48d6f937c | 2026-01-04T17:47:39.808354Z | false |
visualitypl/textris | https://github.com/visualitypl/textris/blob/e95954a869198d66b976692114a834f48d6f937c/example/rails-4.2/app/controllers/users_controller.rb | example/rails-4.2/app/controllers/users_controller.rb | class UsersController < ApplicationController
def index
@users = User.order('created_at DESC, id DESC')
end
def new
@user = User.new
end
def create
@user = User.new(user_params)
if @user.save
redirect_to users_url, notice: 'User was created and SMS notification was sent. Check server ... | ruby | MIT | e95954a869198d66b976692114a834f48d6f937c | 2026-01-04T17:47:39.808354Z | false |
visualitypl/textris | https://github.com/visualitypl/textris/blob/e95954a869198d66b976692114a834f48d6f937c/example/rails-4.2/app/controllers/application_controller.rb | example/rails-4.2/app/controllers/application_controller.rb | class ApplicationController < ActionController::Base
protect_from_forgery with: :exception
end
| ruby | MIT | e95954a869198d66b976692114a834f48d6f937c | 2026-01-04T17:47:39.808354Z | false |
visualitypl/textris | https://github.com/visualitypl/textris/blob/e95954a869198d66b976692114a834f48d6f937c/example/rails-4.2/app/models/user.rb | example/rails-4.2/app/models/user.rb | class User < ActiveRecord::Base
validates :name, :phone, :presence => true, :uniqueness => true
validate :phone_plausible
def phone_plausible
errors.add(:phone, :invalid) if phone.present? && !Phony.plausible?(phone)
end
def phone=(value)
Phony.plausible?(value) ? super(Phony.normalize(value)) : sup... | ruby | MIT | e95954a869198d66b976692114a834f48d6f937c | 2026-01-04T17:47:39.808354Z | false |
visualitypl/textris | https://github.com/visualitypl/textris/blob/e95954a869198d66b976692114a834f48d6f937c/example/rails-4.2/db/seeds.rb | example/rails-4.2/db/seeds.rb | # This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
#
# Examples:
#
# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
# Mayor.create(name: 'Emanuel... | ruby | MIT | e95954a869198d66b976692114a834f48d6f937c | 2026-01-04T17:47:39.808354Z | false |
visualitypl/textris | https://github.com/visualitypl/textris/blob/e95954a869198d66b976692114a834f48d6f937c/example/rails-4.2/db/schema.rb | example/rails-4.2/db/schema.rb | # encoding: UTF-8
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative sou... | ruby | MIT | e95954a869198d66b976692114a834f48d6f937c | 2026-01-04T17:47:39.808354Z | false |
visualitypl/textris | https://github.com/visualitypl/textris/blob/e95954a869198d66b976692114a834f48d6f937c/example/rails-4.2/db/migrate/20150220111225_create_users.rb | example/rails-4.2/db/migrate/20150220111225_create_users.rb | class CreateUsers < ActiveRecord::Migration
def change
create_table :users do |t|
t.string :name
t.string :phone
t.timestamps null: false
end
end
end
| ruby | MIT | e95954a869198d66b976692114a834f48d6f937c | 2026-01-04T17:47:39.808354Z | false |
visualitypl/textris | https://github.com/visualitypl/textris/blob/e95954a869198d66b976692114a834f48d6f937c/example/rails-4.2/config/application.rb | example/rails-4.2/config/application.rb | require File.expand_path('../boot', __FILE__)
require 'rails/all'
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
module TextrisExample
class Application < Rails::Application
# Settings in config/environments/* tak... | ruby | MIT | e95954a869198d66b976692114a834f48d6f937c | 2026-01-04T17:47:39.808354Z | false |
visualitypl/textris | https://github.com/visualitypl/textris/blob/e95954a869198d66b976692114a834f48d6f937c/example/rails-4.2/config/environment.rb | example/rails-4.2/config/environment.rb | # Load the Rails application.
require File.expand_path('../application', __FILE__)
# Initialize the Rails application.
Rails.application.initialize!
| ruby | MIT | e95954a869198d66b976692114a834f48d6f937c | 2026-01-04T17:47:39.808354Z | false |
visualitypl/textris | https://github.com/visualitypl/textris/blob/e95954a869198d66b976692114a834f48d6f937c/example/rails-4.2/config/routes.rb | example/rails-4.2/config/routes.rb | Rails.application.routes.draw do
resources :users, :only => [:index, :new, :create]
root :to => 'users#new'
end
| ruby | MIT | e95954a869198d66b976692114a834f48d6f937c | 2026-01-04T17:47:39.808354Z | false |
visualitypl/textris | https://github.com/visualitypl/textris/blob/e95954a869198d66b976692114a834f48d6f937c/example/rails-4.2/config/boot.rb | example/rails-4.2/config/boot.rb | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
require 'bundler/setup' # Set up gems listed in the Gemfile.
| ruby | MIT | e95954a869198d66b976692114a834f48d6f937c | 2026-01-04T17:47:39.808354Z | false |
visualitypl/textris | https://github.com/visualitypl/textris/blob/e95954a869198d66b976692114a834f48d6f937c/example/rails-4.2/config/initializers/filter_parameter_logging.rb | example/rails-4.2/config/initializers/filter_parameter_logging.rb | # Be sure to restart your server when you modify this file.
# Configure sensitive parameters which will be filtered from the log file.
Rails.application.config.filter_parameters += [:password]
| ruby | MIT | e95954a869198d66b976692114a834f48d6f937c | 2026-01-04T17:47:39.808354Z | false |
visualitypl/textris | https://github.com/visualitypl/textris/blob/e95954a869198d66b976692114a834f48d6f937c/example/rails-4.2/config/initializers/session_store.rb | example/rails-4.2/config/initializers/session_store.rb | # Be sure to restart your server when you modify this file.
Rails.application.config.session_store :cookie_store, key: '_textris_example_session'
| ruby | MIT | e95954a869198d66b976692114a834f48d6f937c | 2026-01-04T17:47:39.808354Z | false |
visualitypl/textris | https://github.com/visualitypl/textris/blob/e95954a869198d66b976692114a834f48d6f937c/example/rails-4.2/config/initializers/wrap_parameters.rb | example/rails-4.2/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 f... | ruby | MIT | e95954a869198d66b976692114a834f48d6f937c | 2026-01-04T17:47:39.808354Z | false |
visualitypl/textris | https://github.com/visualitypl/textris/blob/e95954a869198d66b976692114a834f48d6f937c/example/rails-4.2/config/initializers/inflections.rb | example/rails-4.2/config/initializers/inflections.rb | # Be sure to restart your server when you modify this file.
# Add new inflection rules using the following format. Inflections
# are locale specific, and you may define rules for as many different
# locales as you wish. All of these examples are active by default:
# ActiveSupport::Inflector.inflections(:en) do |inflec... | ruby | MIT | e95954a869198d66b976692114a834f48d6f937c | 2026-01-04T17:47:39.808354Z | false |
visualitypl/textris | https://github.com/visualitypl/textris/blob/e95954a869198d66b976692114a834f48d6f937c/example/rails-4.2/config/initializers/cookies_serializer.rb | example/rails-4.2/config/initializers/cookies_serializer.rb | # Be sure to restart your server when you modify this file.
Rails.application.config.action_dispatch.cookies_serializer = :json
| ruby | MIT | e95954a869198d66b976692114a834f48d6f937c | 2026-01-04T17:47:39.808354Z | false |
visualitypl/textris | https://github.com/visualitypl/textris/blob/e95954a869198d66b976692114a834f48d6f937c/example/rails-4.2/config/initializers/assets.rb | example/rails-4.2/config/initializers/assets.rb | # Be sure to restart your server when you modify this file.
# Version of your assets, change this if you want to expire all your assets.
Rails.application.config.assets.version = '1.0'
# Add additional assets to the asset load path
# Rails.application.config.assets.paths << Emoji.images_path
# Precompile additional ... | ruby | MIT | e95954a869198d66b976692114a834f48d6f937c | 2026-01-04T17:47:39.808354Z | false |
visualitypl/textris | https://github.com/visualitypl/textris/blob/e95954a869198d66b976692114a834f48d6f937c/example/rails-4.2/config/initializers/backtrace_silencers.rb | example/rails-4.2/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 | e95954a869198d66b976692114a834f48d6f937c | 2026-01-04T17:47:39.808354Z | false |
visualitypl/textris | https://github.com/visualitypl/textris/blob/e95954a869198d66b976692114a834f48d6f937c/example/rails-4.2/config/initializers/mime_types.rb | example/rails-4.2/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
| ruby | MIT | e95954a869198d66b976692114a834f48d6f937c | 2026-01-04T17:47:39.808354Z | false |
visualitypl/textris | https://github.com/visualitypl/textris/blob/e95954a869198d66b976692114a834f48d6f937c/example/rails-4.2/config/environments/test.rb | example/rails-4.2/config/environments/test.rb | Rails.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 | e95954a869198d66b976692114a834f48d6f937c | 2026-01-04T17:47:39.808354Z | false |
visualitypl/textris | https://github.com/visualitypl/textris/blob/e95954a869198d66b976692114a834f48d6f937c/example/rails-4.2/config/environments/development.rb | example/rails-4.2/config/environments/development.rb | Rails.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 | e95954a869198d66b976692114a834f48d6f937c | 2026-01-04T17:47:39.808354Z | false |
visualitypl/textris | https://github.com/visualitypl/textris/blob/e95954a869198d66b976692114a834f48d6f937c/example/rails-4.2/config/environments/production.rb | example/rails-4.2/config/environments/production.rb | Rails.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 serve... | ruby | MIT | e95954a869198d66b976692114a834f48d6f937c | 2026-01-04T17:47:39.808354Z | false |
visualitypl/textris | https://github.com/visualitypl/textris/blob/e95954a869198d66b976692114a834f48d6f937c/lib/textris.rb | lib/textris.rb | require 'action_controller'
require 'action_mailer'
require 'active_support'
require 'phony'
begin
require 'twilio-ruby'
rescue LoadError
end
begin
require 'sidekiq'
rescue LoadError
require 'textris/delay/sidekiq/missing'
Textris::Delay::Sidekiq.include(Textris::Delay::Sidekiq::Missing)
else
require 'text... | ruby | MIT | e95954a869198d66b976692114a834f48d6f937c | 2026-01-04T17:47:39.808354Z | false |
visualitypl/textris | https://github.com/visualitypl/textris/blob/e95954a869198d66b976692114a834f48d6f937c/lib/textris/version.rb | lib/textris/version.rb | module Textris
VERSION = '0.7.1'
end
| ruby | MIT | e95954a869198d66b976692114a834f48d6f937c | 2026-01-04T17:47:39.808354Z | false |
visualitypl/textris | https://github.com/visualitypl/textris/blob/e95954a869198d66b976692114a834f48d6f937c/lib/textris/base.rb | lib/textris/base.rb | require 'render_anywhere'
module Textris
class Base
class RenderingController < RenderAnywhere::RenderingController
layout false
def default_url_options
ActionMailer::Base.default_url_options || {}
end
end
include RenderAnywhere
extend Textris::Delay::Sidekiq
class <<... | ruby | MIT | e95954a869198d66b976692114a834f48d6f937c | 2026-01-04T17:47:39.808354Z | false |
visualitypl/textris | https://github.com/visualitypl/textris/blob/e95954a869198d66b976692114a834f48d6f937c/lib/textris/message.rb | lib/textris/message.rb | module Textris
class Message
attr_reader :content, :from_name, :from_phone, :to, :texter, :action, :args,
:media_urls, :twilio_messaging_service_sid
def initialize(options = {})
initialize_content(options)
initialize_author(options)
initialize_recipients(options)
@texter = ... | ruby | MIT | e95954a869198d66b976692114a834f48d6f937c | 2026-01-04T17:47:39.808354Z | false |
visualitypl/textris | https://github.com/visualitypl/textris/blob/e95954a869198d66b976692114a834f48d6f937c/lib/textris/delivery.rb | lib/textris/delivery.rb | module Textris
module Delivery
module_function
def get
methods = Rails.application.config.try(:textris_delivery_method)
methods = [*methods].compact
if methods.blank?
if Rails.env.development?
methods = [:log]
elsif Rails.env.test?
methods = [:test]
... | ruby | MIT | e95954a869198d66b976692114a834f48d6f937c | 2026-01-04T17:47:39.808354Z | false |
visualitypl/textris | https://github.com/visualitypl/textris/blob/e95954a869198d66b976692114a834f48d6f937c/lib/textris/phone_formatter.rb | lib/textris/phone_formatter.rb | module Textris
class PhoneFormatter
class << self
def format(phone = '')
return phone if is_a_short_code?(phone) || is_alphameric?(phone) || phone.nil?
"#{'+' unless phone.start_with?('+')}#{phone}"
end
# Short codes have more dependencies and limitations;
# but this is a ... | ruby | MIT | e95954a869198d66b976692114a834f48d6f937c | 2026-01-04T17:47:39.808354Z | false |
visualitypl/textris | https://github.com/visualitypl/textris/blob/e95954a869198d66b976692114a834f48d6f937c/lib/textris/delivery/test.rb | lib/textris/delivery/test.rb | module Textris
module Delivery
class Test < Textris::Delivery::Base
class << self
def deliveries
@deliveries ||= []
end
end
def deliver(to)
self.class.deliveries.push(::Textris::Message.new(
:content => message.content,
:from_name => mes... | ruby | MIT | e95954a869198d66b976692114a834f48d6f937c | 2026-01-04T17:47:39.808354Z | false |
visualitypl/textris | https://github.com/visualitypl/textris/blob/e95954a869198d66b976692114a834f48d6f937c/lib/textris/delivery/log.rb | lib/textris/delivery/log.rb | module Textris
module Delivery
class Log < Textris::Delivery::Base
AVAILABLE_LOG_LEVELS = %w{debug info warn error fatal unknown}
def deliver(to)
log :info, "Sent text to #{Phony.format(to)}"
log :debug, "Texter: #{message.texter || 'UnknownTexter'}" + "#" +
"#{message.acti... | ruby | MIT | e95954a869198d66b976692114a834f48d6f937c | 2026-01-04T17:47:39.808354Z | false |
visualitypl/textris | https://github.com/visualitypl/textris/blob/e95954a869198d66b976692114a834f48d6f937c/lib/textris/delivery/nexmo.rb | lib/textris/delivery/nexmo.rb | module Textris
module Delivery
class Nexmo < Textris::Delivery::Base
def deliver(phone)
client.send_message(
from: sender_id,
to: phone,
text: message.content
)
end
private
def client
@client ||= ::Nexmo::Client.new
end
... | ruby | MIT | e95954a869198d66b976692114a834f48d6f937c | 2026-01-04T17:47:39.808354Z | false |
visualitypl/textris | https://github.com/visualitypl/textris/blob/e95954a869198d66b976692114a834f48d6f937c/lib/textris/delivery/twilio.rb | lib/textris/delivery/twilio.rb | module Textris
module Delivery
class Twilio < Textris::Delivery::Base
def deliver(to)
options = {
:to => PhoneFormatter.format(to),
:body => message.content
}
if message.twilio_messaging_service_sid
options[:messaging_service_sid] = message.twilio_mes... | ruby | MIT | e95954a869198d66b976692114a834f48d6f937c | 2026-01-04T17:47:39.808354Z | false |
visualitypl/textris | https://github.com/visualitypl/textris/blob/e95954a869198d66b976692114a834f48d6f937c/lib/textris/delivery/base.rb | lib/textris/delivery/base.rb | module Textris
module Delivery
class Base
attr_reader :message
def initialize(message)
@message = message
end
def deliver_to_all
message.to.each do |to|
deliver(to)
end
end
end
end
end
| ruby | MIT | e95954a869198d66b976692114a834f48d6f937c | 2026-01-04T17:47:39.808354Z | false |
visualitypl/textris | https://github.com/visualitypl/textris/blob/e95954a869198d66b976692114a834f48d6f937c/lib/textris/delivery/mail.rb | lib/textris/delivery/mail.rb | module Textris
module Delivery
class Mail < Textris::Delivery::Base
class Mailer < ActionMailer::Base
def notify(from, to, subject, body)
mail :from => from, :to => to, :subject => subject, :body => body
end
end
def deliver(to)
template_vars = { :to_phone => to... | ruby | MIT | e95954a869198d66b976692114a834f48d6f937c | 2026-01-04T17:47:39.808354Z | false |
visualitypl/textris | https://github.com/visualitypl/textris/blob/e95954a869198d66b976692114a834f48d6f937c/lib/textris/delay/active_job.rb | lib/textris/delay/active_job.rb | module Textris
module Delay
module ActiveJob
def deliver_now
deliver
end
def deliver_later(options = {})
job = Textris::Delay::ActiveJob::Job
job.new(texter(:raw => true).to_s, action.to_s, args).enqueue(options)
end
end
end
end
| ruby | MIT | e95954a869198d66b976692114a834f48d6f937c | 2026-01-04T17:47:39.808354Z | false |
visualitypl/textris | https://github.com/visualitypl/textris/blob/e95954a869198d66b976692114a834f48d6f937c/lib/textris/delay/sidekiq.rb | lib/textris/delay/sidekiq.rb | module Textris
module Delay
module Sidekiq
def delay
::Textris::Delay::Sidekiq::Proxy.new(self.to_s)
end
def delay_for(interval)
unless interval.is_a?(Integer)
raise(ArgumentError, "Proper interval must be provided")
end
::Textris::Delay::Sidekiq::Prox... | ruby | MIT | e95954a869198d66b976692114a834f48d6f937c | 2026-01-04T17:47:39.808354Z | false |
visualitypl/textris | https://github.com/visualitypl/textris/blob/e95954a869198d66b976692114a834f48d6f937c/lib/textris/delay/sidekiq/proxy.rb | lib/textris/delay/sidekiq/proxy.rb | module Textris
module Delay
module Sidekiq
class Proxy
def initialize(texter, options = {})
@texter = texter
@perform_in = options[:perform_in]
@perform_at = options[:perform_at]
end
def method_missing(method_name, *args)
args = ::Textris:... | ruby | MIT | e95954a869198d66b976692114a834f48d6f937c | 2026-01-04T17:47:39.808354Z | false |
visualitypl/textris | https://github.com/visualitypl/textris/blob/e95954a869198d66b976692114a834f48d6f937c/lib/textris/delay/sidekiq/missing.rb | lib/textris/delay/sidekiq/missing.rb | module Textris
module Delay
module Sidekiq
module Missing
def sidekiq_missing(*args)
raise(LoadError, "Sidekiq is required to delay sending messages")
end
alias_method :delay, :sidekiq_missing
alias_method :delay_for, :sidekiq_missing
alias_method :... | ruby | MIT | e95954a869198d66b976692114a834f48d6f937c | 2026-01-04T17:47:39.808354Z | false |
visualitypl/textris | https://github.com/visualitypl/textris/blob/e95954a869198d66b976692114a834f48d6f937c/lib/textris/delay/sidekiq/serializer.rb | lib/textris/delay/sidekiq/serializer.rb | module Textris
module Delay
module Sidekiq
module Serializer
ACTIVERECORD_POINTER = 'Textris::ActiveRecordPointer'
ACTIVERECORD_ARRAY_POINTER = 'Textris::ActiveRecordArrayPointer'
class << self
def serialize(objects)
objects.collect do |object|
... | ruby | MIT | e95954a869198d66b976692114a834f48d6f937c | 2026-01-04T17:47:39.808354Z | false |
visualitypl/textris | https://github.com/visualitypl/textris/blob/e95954a869198d66b976692114a834f48d6f937c/lib/textris/delay/sidekiq/worker.rb | lib/textris/delay/sidekiq/worker.rb | module Textris
module Delay
module Sidekiq
class Worker
include ::Sidekiq::Worker
def perform(texter, action, args)
texter = texter.safe_constantize
if texter.present?
args = ::Textris::Delay::Sidekiq::Serializer.deserialize(args)
texter.new(act... | ruby | MIT | e95954a869198d66b976692114a834f48d6f937c | 2026-01-04T17:47:39.808354Z | false |
visualitypl/textris | https://github.com/visualitypl/textris/blob/e95954a869198d66b976692114a834f48d6f937c/lib/textris/delay/active_job/missing.rb | lib/textris/delay/active_job/missing.rb | module Textris
module Delay
module ActiveJob
module Missing
def active_job_missing(*args)
raise(LoadError, "ActiveJob is required to delay sending messages")
end
alias_method :deliver_now, :active_job_missing
alias_method :deliver_later, :active_job_missing
... | ruby | MIT | e95954a869198d66b976692114a834f48d6f937c | 2026-01-04T17:47:39.808354Z | false |
visualitypl/textris | https://github.com/visualitypl/textris/blob/e95954a869198d66b976692114a834f48d6f937c/lib/textris/delay/active_job/job.rb | lib/textris/delay/active_job/job.rb | module Textris
module Delay
module ActiveJob
class Job < ::ActiveJob::Base
queue_as :textris
def perform(texter, action, args)
texter = texter.safe_constantize
if texter.present?
texter.new(action, *args).call_action.deliver_now
end
end
... | ruby | MIT | e95954a869198d66b976692114a834f48d6f937c | 2026-01-04T17:47:39.808354Z | false |
rubymotion-community/motion-support | https://github.com/rubymotion-community/motion-support/blob/f9e04234315327a64db8181e3af2c7b87ba3e13a/app/app_delegate.rb | app/app_delegate.rb | class AppDelegate
def application(application, didFinishLaunchingWithOptions:launchOptions)
true
end
end | ruby | MIT | f9e04234315327a64db8181e3af2c7b87ba3e13a | 2026-01-04T17:47:41.763315Z | false |
rubymotion-community/motion-support | https://github.com/rubymotion-community/motion-support/blob/f9e04234315327a64db8181e3af2c7b87ba3e13a/spec/motion-support/concern_spec.rb | spec/motion-support/concern_spec.rb | class ConcernTest
module Baz
extend MotionSupport::Concern
module ClassMethods
def baz
"baz"
end
def included_ran=(value)
@@included_ran = value
end
def included_ran
@@included_ran
end
end
included do
self.included_ran = true
en... | ruby | MIT | f9e04234315327a64db8181e3af2c7b87ba3e13a | 2026-01-04T17:47:41.763315Z | false |
rubymotion-community/motion-support | https://github.com/rubymotion-community/motion-support/blob/f9e04234315327a64db8181e3af2c7b87ba3e13a/spec/motion-support/descendants_tracker_spec.rb | spec/motion-support/descendants_tracker_spec.rb | module DescendantsTrackerSpec
class Parent
extend MotionSupport::DescendantsTracker
end
class Child1 < Parent
end
class Child2 < Parent
end
class Grandchild1 < Child1
end
class Grandchild2 < Child1
end
ALL = [Parent, Child1, Child2, Grandchild1, Grandchild2]
end
describe "DescendantsTrac... | ruby | MIT | f9e04234315327a64db8181e3af2c7b87ba3e13a | 2026-01-04T17:47:41.763315Z | false |
rubymotion-community/motion-support | https://github.com/rubymotion-community/motion-support/blob/f9e04234315327a64db8181e3af2c7b87ba3e13a/spec/motion-support/inflector_spec.rb | spec/motion-support/inflector_spec.rb | module InflectorHelper
# Dups the singleton and yields, restoring the original inflections later.
# Use this in tests what modify the state of the singleton.
#
# This helper is implemented by setting @__instance__ because in some tests
# there are module functions that access MotionSupport::Inflector.inflecti... | ruby | MIT | f9e04234315327a64db8181e3af2c7b87ba3e13a | 2026-01-04T17:47:41.763315Z | false |
rubymotion-community/motion-support | https://github.com/rubymotion-community/motion-support/blob/f9e04234315327a64db8181e3af2c7b87ba3e13a/spec/motion-support/ns_dictionary_spec.rb | spec/motion-support/ns_dictionary_spec.rb | describe "NSDictionary" do
describe "to_hash" do
before do
dict = NSMutableDictionary.alloc.init
dict.setValue('bar', forKey:'foo')
@hash = dict.to_hash
end
it "should convert NSDictionary to Hash" do
@hash.class.should == Hash
end
it "should preserve all keys" do... | ruby | MIT | f9e04234315327a64db8181e3af2c7b87ba3e13a | 2026-01-04T17:47:41.763315Z | false |
rubymotion-community/motion-support | https://github.com/rubymotion-community/motion-support/blob/f9e04234315327a64db8181e3af2c7b87ba3e13a/spec/motion-support/number_helper_spec.rb | spec/motion-support/number_helper_spec.rb | describe "NumberHelper" do
class TestClassWithInstanceNumberHelpers
include MotionSupport::NumberHelper
end
class TestClassWithClassNumberHelpers
extend MotionSupport::NumberHelper
end
before do
@instance_with_helpers = TestClassWithInstanceNumberHelpers.new
end
describe "number_to_phone"... | ruby | MIT | f9e04234315327a64db8181e3af2c7b87ba3e13a | 2026-01-04T17:47:41.763315Z | false |
rubymotion-community/motion-support | https://github.com/rubymotion-community/motion-support/blob/f9e04234315327a64db8181e3af2c7b87ba3e13a/spec/motion-support/duration_spec.rb | spec/motion-support/duration_spec.rb | describe "Duration" do
describe "threequals" do
it "should be a day" do
MotionSupport::Duration.should === 1.day
end
it "should not be an int" do
MotionSupport::Duration.should.not === 1.day.to_i
end
it "should not be a string" do
MotionSupport::Duration.should.not === 'foo'
... | ruby | MIT | f9e04234315327a64db8181e3af2c7b87ba3e13a | 2026-01-04T17:47:41.763315Z | false |
rubymotion-community/motion-support | https://github.com/rubymotion-community/motion-support/blob/f9e04234315327a64db8181e3af2c7b87ba3e13a/spec/motion-support/hash_with_indifferent_access_spec.rb | spec/motion-support/hash_with_indifferent_access_spec.rb | class IndifferentHash < MotionSupport::HashWithIndifferentAccess
end
class SubclassingArray < Array
end
class SubclassingHash < Hash
end
class NonIndifferentHash < Hash
def nested_under_indifferent_access
self
end
end
describe "HashWithIndifferentAccess" do
before do
@strings = { 'a' => 1, 'b' => 2 }
... | ruby | MIT | f9e04234315327a64db8181e3af2c7b87ba3e13a | 2026-01-04T17:47:41.763315Z | false |
rubymotion-community/motion-support | https://github.com/rubymotion-community/motion-support/blob/f9e04234315327a64db8181e3af2c7b87ba3e13a/spec/motion-support/callback_spec.rb | spec/motion-support/callback_spec.rb | module CallbacksTest
class Record
include MotionSupport::Callbacks
define_callbacks :save
def self.before_save(*filters, &blk)
set_callback(:save, :before, *filters, &blk)
end
def self.after_save(*filters, &blk)
set_callback(:save, :after, *filters, &blk)
end
class << self
... | ruby | MIT | f9e04234315327a64db8181e3af2c7b87ba3e13a | 2026-01-04T17:47:41.763315Z | false |
rubymotion-community/motion-support | https://github.com/rubymotion-community/motion-support/blob/f9e04234315327a64db8181e3af2c7b87ba3e13a/spec/motion-support/ns_string_spec.rb | spec/motion-support/ns_string_spec.rb | describe "NSString" do
before do
@string = NSString.stringWithString("ruby_motion")
end
describe "to_s" do
it "should convert NSDictionary to Hash" do
@string.to_s.class.should == String
end
it "should preserve the value" do
@string.to_s.should == @string
end
end
des... | ruby | MIT | f9e04234315327a64db8181e3af2c7b87ba3e13a | 2026-01-04T17:47:41.763315Z | false |
rubymotion-community/motion-support | https://github.com/rubymotion-community/motion-support/blob/f9e04234315327a64db8181e3af2c7b87ba3e13a/spec/motion-support/core_ext/string_spec.rb | spec/motion-support/core_ext/string_spec.rb | describe "string" do
describe "constantize" do
module Ace
module Base
class Case
class Dice
end
end
class Fase < Case
end
end
class Gas
include Base
end
end
class Object
module AddtlGlobalConstants
class Cas... | ruby | MIT | f9e04234315327a64db8181e3af2c7b87ba3e13a | 2026-01-04T17:47:41.763315Z | false |
rubymotion-community/motion-support | https://github.com/rubymotion-community/motion-support/blob/f9e04234315327a64db8181e3af2c7b87ba3e13a/spec/motion-support/core_ext/metaclass_spec.rb | spec/motion-support/core_ext/metaclass_spec.rb | describe "metaclass" do
it "should return the metaclass for a class" do
String.metaclass.is_a?(Class).should == true
end
it "should return the metaclass for an object" do
"string".metaclass.is_a?(Class).should == true
end
end
| ruby | MIT | f9e04234315327a64db8181e3af2c7b87ba3e13a | 2026-01-04T17:47:41.763315Z | false |
rubymotion-community/motion-support | https://github.com/rubymotion-community/motion-support/blob/f9e04234315327a64db8181e3af2c7b87ba3e13a/spec/motion-support/core_ext/array_spec.rb | spec/motion-support/core_ext/array_spec.rb | describe 'array' do
it 'finds hash values' do
array_of_hashes = [
{
line1: 3,
line2: 5
},
{
line3: 7,
line4: 9
}
]
array_of_hashes.has_hash_value?(5).should.be.true
array_of_hashes.has_hash_value?(4).should.not.be.true
end
end
| ruby | MIT | f9e04234315327a64db8181e3af2c7b87ba3e13a | 2026-01-04T17:47:41.763315Z | false |
rubymotion-community/motion-support | https://github.com/rubymotion-community/motion-support/blob/f9e04234315327a64db8181e3af2c7b87ba3e13a/spec/motion-support/core_ext/enumerable_spec.rb | spec/motion-support/core_ext/enumerable_spec.rb | describe "enumerable" do
describe "collect_with_index" do
describe "on Array" do
it "should return an empty array on an empty array" do
[].collect_with_index { |x, i| x }.should == []
end
it "should yield an index for each element" do
[1, 2, 3].collect_with_index { |x, i| [i... | ruby | MIT | f9e04234315327a64db8181e3af2c7b87ba3e13a | 2026-01-04T17:47:41.763315Z | false |
rubymotion-community/motion-support | https://github.com/rubymotion-community/motion-support/blob/f9e04234315327a64db8181e3af2c7b87ba3e13a/spec/motion-support/core_ext/regexp_spec.rb | spec/motion-support/core_ext/regexp_spec.rb | describe "Regexp" do
it "should find out if regexp is multiline" do
//m.multiline?.should.be.true
//.multiline?.should.be.false
/(?m:)/.multiline?.should.be.false
end
end
| ruby | MIT | f9e04234315327a64db8181e3af2c7b87ba3e13a | 2026-01-04T17:47:41.763315Z | false |
rubymotion-community/motion-support | https://github.com/rubymotion-community/motion-support/blob/f9e04234315327a64db8181e3af2c7b87ba3e13a/spec/motion-support/core_ext/string/inflection_spec.rb | spec/motion-support/core_ext/string/inflection_spec.rb | describe "String" do
describe "Inflections" do
describe "singularize" do
InflectorTestCases::SingularToPlural.each do |singular, plural|
it "should pluralize singular #{singular}" do
singular.pluralize.should == plural
end
end
it "should pluralize plural" do
... | ruby | MIT | f9e04234315327a64db8181e3af2c7b87ba3e13a | 2026-01-04T17:47:41.763315Z | false |
rubymotion-community/motion-support | https://github.com/rubymotion-community/motion-support/blob/f9e04234315327a64db8181e3af2c7b87ba3e13a/spec/motion-support/core_ext/string/indent_spec.rb | spec/motion-support/core_ext/string/indent_spec.rb | describe "String" do
describe "indent" do
it "should not indent strings that only contain newlines (edge cases)" do
['', "\n", "\n" * 7].each do |str|
str.indent!(8).should.be.nil
str.indent(8).should == str
str.indent(1, "\t").should == str
end
end
it "should indent b... | ruby | MIT | f9e04234315327a64db8181e3af2c7b87ba3e13a | 2026-01-04T17:47:41.763315Z | false |
rubymotion-community/motion-support | https://github.com/rubymotion-community/motion-support/blob/f9e04234315327a64db8181e3af2c7b87ba3e13a/spec/motion-support/core_ext/string/filter_spec.rb | spec/motion-support/core_ext/string/filter_spec.rb | describe "String" do
describe "filters" do
describe "squish" do
before do
@original = %{ A string surrounded by spaces, with tabs(\t\t),
newlines(\n\n), unicode nextlines(\u0085\u0085) and many spaces( ). }
@expected = "A string surrounded by spaces, with tabs( ), newlines( )," \... | ruby | MIT | f9e04234315327a64db8181e3af2c7b87ba3e13a | 2026-01-04T17:47:41.763315Z | false |
rubymotion-community/motion-support | https://github.com/rubymotion-community/motion-support/blob/f9e04234315327a64db8181e3af2c7b87ba3e13a/spec/motion-support/core_ext/string/starts_end_with_spec.rb | spec/motion-support/core_ext/string/starts_end_with_spec.rb | describe "String" do
describe "starts_with?/ends_with?" do
it "should have starts/ends_with? alias" do
s = "hello"
s.starts_with?('h').should.be.true
s.starts_with?('hel').should.be.true
s.starts_with?('el').should.be.false
s.ends_with?('o').should.be.true
s.ends_with?('lo').s... | ruby | MIT | f9e04234315327a64db8181e3af2c7b87ba3e13a | 2026-01-04T17:47:41.763315Z | false |
rubymotion-community/motion-support | https://github.com/rubymotion-community/motion-support/blob/f9e04234315327a64db8181e3af2c7b87ba3e13a/spec/motion-support/core_ext/string/strip_spec.rb | spec/motion-support/core_ext/string/strip_spec.rb | describe "String" do
describe "strip_heredoc" do
it "should strip heredoc on an empty string" do
''.strip_heredoc.should == ''
end
it "should strip heredoc on a string with no lines" do
'x'.strip_heredoc.should == 'x'
' x'.strip_heredoc.should == 'x'
end
it "should strip her... | ruby | MIT | f9e04234315327a64db8181e3af2c7b87ba3e13a | 2026-01-04T17:47:41.763315Z | false |
rubymotion-community/motion-support | https://github.com/rubymotion-community/motion-support/blob/f9e04234315327a64db8181e3af2c7b87ba3e13a/spec/motion-support/core_ext/string/behavior_spec.rb | spec/motion-support/core_ext/string/behavior_spec.rb | describe "String" do
describe "behavior" do
it "should acts like string" do
'Bambi'.acts_like_string?.should == true
end
end
end
| ruby | MIT | f9e04234315327a64db8181e3af2c7b87ba3e13a | 2026-01-04T17:47:41.763315Z | false |
rubymotion-community/motion-support | https://github.com/rubymotion-community/motion-support/blob/f9e04234315327a64db8181e3af2c7b87ba3e13a/spec/motion-support/core_ext/string/access_spec.rb | spec/motion-support/core_ext/string/access_spec.rb | describe "String" do
describe "access" do
it "should access" do
s = "hello"
s.at(0).should == "h"
s.from(2).should == "llo"
s.to(2).should == "hel"
s.first.should == "h"
s.first(2).should == "he"
s.first(0).should == ""
s.last.should == "o"
s.last(3).should... | ruby | MIT | f9e04234315327a64db8181e3af2c7b87ba3e13a | 2026-01-04T17:47:41.763315Z | false |
rubymotion-community/motion-support | https://github.com/rubymotion-community/motion-support/blob/f9e04234315327a64db8181e3af2c7b87ba3e13a/spec/motion-support/core_ext/string/exclude_spec.rb | spec/motion-support/core_ext/string/exclude_spec.rb | describe "String" do
describe "exclude?" do
it "should be the inverse of #include" do
'foo'.exclude?('o').should.be.false
'foo'.exclude?('p').should.be.true
end
end
end
| ruby | MIT | f9e04234315327a64db8181e3af2c7b87ba3e13a | 2026-01-04T17:47:41.763315Z | false |
rubymotion-community/motion-support | https://github.com/rubymotion-community/motion-support/blob/f9e04234315327a64db8181e3af2c7b87ba3e13a/spec/motion-support/core_ext/hash/key_spec.rb | spec/motion-support/core_ext/hash/key_spec.rb | describe "Hash" do
describe "keys" do
before do
@strings = { 'a' => 1, 'b' => 2 }
@nested_strings = { 'a' => { 'b' => { 'c' => 3 } } }
@symbols = { :a => 1, :b => 2 }
@nested_symbols = { :a => { :b => { :c => 3 } } }
@mixed = { :a => 1, 'b' => 2 }
@nested_mixed = { 'a' =... | ruby | MIT | f9e04234315327a64db8181e3af2c7b87ba3e13a | 2026-01-04T17:47:41.763315Z | false |
rubymotion-community/motion-support | https://github.com/rubymotion-community/motion-support/blob/f9e04234315327a64db8181e3af2c7b87ba3e13a/spec/motion-support/core_ext/hash/deep_delete_if_spec.rb | spec/motion-support/core_ext/hash/deep_delete_if_spec.rb | describe "hash" do
before do
@hash = { :a => 1, :b => [ { :c => 2, :d => 3 }, :b ], :d => { :f => 4 } }
end
describe "deep_delete_if" do
it "should delete a top level key recursively" do
@hash.deep_delete_if { |k,v| k == :a }.should == { :b => [ { :c => 2, :d => 3 }, :b ], :d => { :f => 4 } }
e... | ruby | MIT | f9e04234315327a64db8181e3af2c7b87ba3e13a | 2026-01-04T17:47:41.763315Z | false |
rubymotion-community/motion-support | https://github.com/rubymotion-community/motion-support/blob/f9e04234315327a64db8181e3af2c7b87ba3e13a/spec/motion-support/core_ext/hash/except_spec.rb | spec/motion-support/core_ext/hash/except_spec.rb | describe "hash" do
describe "except" do
it "should remove key" do
original = { :a => 'x', :b => 'y', :c => 10 }
expected = { :a => 'x', :b => 'y' }
original.except(:c).should == expected
original.should.not == expected
end
it "should remove more than one key" do
origina... | ruby | MIT | f9e04234315327a64db8181e3af2c7b87ba3e13a | 2026-01-04T17:47:41.763315Z | false |
rubymotion-community/motion-support | https://github.com/rubymotion-community/motion-support/blob/f9e04234315327a64db8181e3af2c7b87ba3e13a/spec/motion-support/core_ext/hash/reverse_merge_spec.rb | spec/motion-support/core_ext/hash/reverse_merge_spec.rb | describe "hash" do
describe "reverse_merge" do
before do
@defaults = { :a => "x", :b => "y", :c => 10 }.freeze
@options = { :a => 1, :b => 2 }
@expected = { :a => 1, :b => 2, :c => 10 }
end
it "should merge defaults into options, creating a new hash" do
@options.reverse_merge(@de... | ruby | MIT | f9e04234315327a64db8181e3af2c7b87ba3e13a | 2026-01-04T17:47:41.763315Z | false |
rubymotion-community/motion-support | https://github.com/rubymotion-community/motion-support/blob/f9e04234315327a64db8181e3af2c7b87ba3e13a/spec/motion-support/core_ext/hash/deep_merge_spec.rb | spec/motion-support/core_ext/hash/deep_merge_spec.rb | describe "hash" do
before do
@hash_1 = { :a => "a", :b => "b", :c => { :c1 => "c1", :c2 => "c2", :c3 => { :d1 => "d1" } } }
@hash_2 = { :a => 1, :c => { :c1 => 2, :c3 => { :d2 => "d2" } } }
end
describe "deep_merge" do
it "should deep merge" do
expected = { :a => 1, :b => "b", :c => { :c1 => ... | ruby | MIT | f9e04234315327a64db8181e3af2c7b87ba3e13a | 2026-01-04T17:47:41.763315Z | false |
rubymotion-community/motion-support | https://github.com/rubymotion-community/motion-support/blob/f9e04234315327a64db8181e3af2c7b87ba3e13a/spec/motion-support/core_ext/hash/slice_spec.rb | spec/motion-support/core_ext/hash/slice_spec.rb | describe "hash" do
describe "slice" do
it "should return a new hash with only the given keys" do
original = { :a => 'x', :b => 'y', :c => 10 }
expected = { :a => 'x', :b => 'y' }
original.slice(:a, :b).should == expected
original.should.not == expected
end
it "should replace ... | ruby | MIT | f9e04234315327a64db8181e3af2c7b87ba3e13a | 2026-01-04T17:47:41.763315Z | false |
rubymotion-community/motion-support | https://github.com/rubymotion-community/motion-support/blob/f9e04234315327a64db8181e3af2c7b87ba3e13a/spec/motion-support/core_ext/date/calculation_spec.rb | spec/motion-support/core_ext/date/calculation_spec.rb | describe "Date" do
describe "calculations" do
describe "yesterday" do
it "should calculate yesterday's date" do
Date.new(1982,10,15).yesterday.should == Date.new(1982,10,14)
end
it "should construct yesterday's date" do
Date.yesterday.should == Date.current - 1
end
... | ruby | MIT | f9e04234315327a64db8181e3af2c7b87ba3e13a | 2026-01-04T17:47:41.763315Z | false |
rubymotion-community/motion-support | https://github.com/rubymotion-community/motion-support/blob/f9e04234315327a64db8181e3af2c7b87ba3e13a/spec/motion-support/core_ext/date/acts_like_spec.rb | spec/motion-support/core_ext/date/acts_like_spec.rb | describe "Date" do
describe "acts_like" do
it "should act like date" do
Date.new.should.acts_like(:date)
end
it "should not act like time" do
Date.new.should.not.acts_like(:time)
end
end
end
| ruby | MIT | f9e04234315327a64db8181e3af2c7b87ba3e13a | 2026-01-04T17:47:41.763315Z | false |
rubymotion-community/motion-support | https://github.com/rubymotion-community/motion-support/blob/f9e04234315327a64db8181e3af2c7b87ba3e13a/spec/motion-support/core_ext/date/conversion_spec.rb | spec/motion-support/core_ext/date/conversion_spec.rb | describe 'date' do
describe 'conversions' do
before { @date = Date.new(2005, 2, 21) }
describe '#iso8601' do
it 'should convert to iso8601 format' do
@date.iso8601.should == '2005-02-21'
end
end
describe '#to_s' do
it 'should convert to db format by default' do
@dat... | ruby | MIT | f9e04234315327a64db8181e3af2c7b87ba3e13a | 2026-01-04T17:47:41.763315Z | false |
rubymotion-community/motion-support | https://github.com/rubymotion-community/motion-support/blob/f9e04234315327a64db8181e3af2c7b87ba3e13a/spec/motion-support/core_ext/integer/multiple_spec.rb | spec/motion-support/core_ext/integer/multiple_spec.rb | PRIME = 22953686867719691230002707821868552601124472329079
describe "Integer" do
describe "multiple_of" do
it "should determine if an integer is a multiple of another" do
[ -7, 0, 7, 14 ].each { |i| i.should.be.multiple_of 7 }
[ -7, 7, 14 ].each { |i| i.should.not.be.multiple_of 6 }
end
... | ruby | MIT | f9e04234315327a64db8181e3af2c7b87ba3e13a | 2026-01-04T17:47:41.763315Z | false |
rubymotion-community/motion-support | https://github.com/rubymotion-community/motion-support/blob/f9e04234315327a64db8181e3af2c7b87ba3e13a/spec/motion-support/core_ext/integer/inflection_spec.rb | spec/motion-support/core_ext/integer/inflection_spec.rb | # These tests are mostly just to ensure that the ordinalize method exists.
# Its results are tested comprehensively in the inflector test cases.
describe "Integer" do
describe "ordinalize" do
it "should ordinalize 1" do
1.ordinalize.should == '1st'
end
it "should ordinalize 8" do
8.ordina... | ruby | MIT | f9e04234315327a64db8181e3af2c7b87ba3e13a | 2026-01-04T17:47:41.763315Z | false |
rubymotion-community/motion-support | https://github.com/rubymotion-community/motion-support/blob/f9e04234315327a64db8181e3af2c7b87ba3e13a/spec/motion-support/core_ext/kernel/singleton_class_spec.rb | spec/motion-support/core_ext/kernel/singleton_class_spec.rb | describe "Kernel" do
describe "class_eval" do
it "should delegate to singleton class" do
o = Object.new
class << o; @x = 1; end
o.class_eval { @x }.should == 1
end
end
end
| ruby | MIT | f9e04234315327a64db8181e3af2c7b87ba3e13a | 2026-01-04T17:47:41.763315Z | false |
rubymotion-community/motion-support | https://github.com/rubymotion-community/motion-support/blob/f9e04234315327a64db8181e3af2c7b87ba3e13a/spec/motion-support/core_ext/range/include_range_spec.rb | spec/motion-support/core_ext/range/include_range_spec.rb | describe "Range" do
describe "include?" do
it "should should include identical inclusive" do
(1..10).should.include(1..10)
end
it "should should include identical exclusive" do
(1...10).should.include(1...10)
end
it "should should include other with exlusive end" do
(1..10).sho... | ruby | MIT | f9e04234315327a64db8181e3af2c7b87ba3e13a | 2026-01-04T17:47:41.763315Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.