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 |
|---|---|---|---|---|---|---|---|---|
michelson/chaskiq-newsletters | https://github.com/michelson/chaskiq-newsletters/blob/1f0d0e6cf7f198e888d421471619bdfdedffa1d2/spec/controllers/chaskiq/manage/templates_controller_spec.rb | spec/controllers/chaskiq/manage/templates_controller_spec.rb | require 'rails_helper'
module Chaskiq
RSpec.describe Manage::TemplatesController, type: :controller do
end
end
| ruby | MIT | 1f0d0e6cf7f198e888d421471619bdfdedffa1d2 | 2026-01-04T17:52:24.705458Z | false |
michelson/chaskiq-newsletters | https://github.com/michelson/chaskiq-newsletters/blob/1f0d0e6cf7f198e888d421471619bdfdedffa1d2/spec/controllers/chaskiq/manage/metrics_controller_spec.rb | spec/controllers/chaskiq/manage/metrics_controller_spec.rb | require 'rails_helper'
module Chaskiq
RSpec.describe Manage::MetricsController, type: :controller do
end
end
| ruby | MIT | 1f0d0e6cf7f198e888d421471619bdfdedffa1d2 | 2026-01-04T17:52:24.705458Z | false |
michelson/chaskiq-newsletters | https://github.com/michelson/chaskiq-newsletters/blob/1f0d0e6cf7f198e888d421471619bdfdedffa1d2/spec/models/chaskiq/attachment_spec.rb | spec/models/chaskiq/attachment_spec.rb | require 'rails_helper'
module Chaskiq
RSpec.describe Attachment, type: :model do
it{ should belong_to :campaign }
end
end
| ruby | MIT | 1f0d0e6cf7f198e888d421471619bdfdedffa1d2 | 2026-01-04T17:52:24.705458Z | false |
michelson/chaskiq-newsletters | https://github.com/michelson/chaskiq-newsletters/blob/1f0d0e6cf7f198e888d421471619bdfdedffa1d2/spec/models/chaskiq/campaign_spec.rb | spec/models/chaskiq/campaign_spec.rb | require 'rails_helper'
module Chaskiq
RSpec.describe Campaign, type: :model do
include ActiveJob::TestHelper
it{ should have_many :attachments }
it{ should have_many :metrics }
#it{ should have_one :campaign_template }
#it{ should have_one(:template).through(:campaign_template) }
it{ should... | ruby | MIT | 1f0d0e6cf7f198e888d421471619bdfdedffa1d2 | 2026-01-04T17:52:24.705458Z | false |
michelson/chaskiq-newsletters | https://github.com/michelson/chaskiq-newsletters/blob/1f0d0e6cf7f198e888d421471619bdfdedffa1d2/spec/models/chaskiq/subscription_spec.rb | spec/models/chaskiq/subscription_spec.rb | require 'rails_helper'
module Chaskiq
RSpec.describe Subscription, type: :model do
it{ should belong_to :list }
it{ should belong_to :subscriber }
it{ should have_many :campaigns }
let(:template){ FactoryGirl.create(:chaskiq_template) }
let(:list){ FactoryGirl.create(:chaskiq_list) }
let(:su... | ruby | MIT | 1f0d0e6cf7f198e888d421471619bdfdedffa1d2 | 2026-01-04T17:52:24.705458Z | false |
michelson/chaskiq-newsletters | https://github.com/michelson/chaskiq-newsletters/blob/1f0d0e6cf7f198e888d421471619bdfdedffa1d2/spec/models/chaskiq/subscriber_spec.rb | spec/models/chaskiq/subscriber_spec.rb | require 'rails_helper'
require 'urlcrypt'
module Chaskiq
RSpec.describe Subscriber, type: :model do
it{ should have_many :subscriptions }
it{ should have_many(:lists).through(:subscriptions) }
it{ should have_many :metrics }
it{ should have_many(:campaigns).through(:lists) }
describe "states" do... | ruby | MIT | 1f0d0e6cf7f198e888d421471619bdfdedffa1d2 | 2026-01-04T17:52:24.705458Z | false |
michelson/chaskiq-newsletters | https://github.com/michelson/chaskiq-newsletters/blob/1f0d0e6cf7f198e888d421471619bdfdedffa1d2/spec/models/chaskiq/list_spec.rb | spec/models/chaskiq/list_spec.rb | require 'rails_helper'
module Chaskiq
RSpec.describe List, type: :model do
it{ should have_many :subscribers }
it{ should have_many :campaigns }
describe "creation" do
let(:list){FactoryGirl.create(:chaskiq_list)}
it "will create a list" do
Chaskiq::Subscriber.delete_all
da... | ruby | MIT | 1f0d0e6cf7f198e888d421471619bdfdedffa1d2 | 2026-01-04T17:52:24.705458Z | false |
michelson/chaskiq-newsletters | https://github.com/michelson/chaskiq-newsletters/blob/1f0d0e6cf7f198e888d421471619bdfdedffa1d2/spec/models/chaskiq/metric_spec.rb | spec/models/chaskiq/metric_spec.rb | require 'rails_helper'
module Chaskiq
RSpec.describe Metric, type: :model do
it{should belong_to :trackable}
end
end
| ruby | MIT | 1f0d0e6cf7f198e888d421471619bdfdedffa1d2 | 2026-01-04T17:52:24.705458Z | false |
michelson/chaskiq-newsletters | https://github.com/michelson/chaskiq-newsletters/blob/1f0d0e6cf7f198e888d421471619bdfdedffa1d2/spec/models/chaskiq/setting_spec.rb | spec/models/chaskiq/setting_spec.rb | require 'rails_helper'
module Chaskiq
RSpec.describe Setting, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end
end
| ruby | MIT | 1f0d0e6cf7f198e888d421471619bdfdedffa1d2 | 2026-01-04T17:52:24.705458Z | false |
michelson/chaskiq-newsletters | https://github.com/michelson/chaskiq-newsletters/blob/1f0d0e6cf7f198e888d421471619bdfdedffa1d2/spec/models/chaskiq/template_spec.rb | spec/models/chaskiq/template_spec.rb | require 'rails_helper'
module Chaskiq
RSpec.describe Template, type: :model do
it{ should have_many(:campaigns) }
end
end
| ruby | MIT | 1f0d0e6cf7f198e888d421471619bdfdedffa1d2 | 2026-01-04T17:52:24.705458Z | false |
michelson/chaskiq-newsletters | https://github.com/michelson/chaskiq-newsletters/blob/1f0d0e6cf7f198e888d421471619bdfdedffa1d2/spec/dummy/app/helpers/application_helper.rb | spec/dummy/app/helpers/application_helper.rb | module ApplicationHelper
end
| ruby | MIT | 1f0d0e6cf7f198e888d421471619bdfdedffa1d2 | 2026-01-04T17:52:24.705458Z | false |
michelson/chaskiq-newsletters | https://github.com/michelson/chaskiq-newsletters/blob/1f0d0e6cf7f198e888d421471619bdfdedffa1d2/spec/dummy/app/controllers/application_controller.rb | spec/dummy/app/controllers/application_controller.rb | class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
end
| ruby | MIT | 1f0d0e6cf7f198e888d421471619bdfdedffa1d2 | 2026-01-04T17:52:24.705458Z | false |
michelson/chaskiq-newsletters | https://github.com/michelson/chaskiq-newsletters/blob/1f0d0e6cf7f198e888d421471619bdfdedffa1d2/spec/dummy/db/schema.rb | spec/dummy/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 | 1f0d0e6cf7f198e888d421471619bdfdedffa1d2 | 2026-01-04T17:52:24.705458Z | false |
michelson/chaskiq-newsletters | https://github.com/michelson/chaskiq-newsletters/blob/1f0d0e6cf7f198e888d421471619bdfdedffa1d2/spec/dummy/config/application.rb | spec/dummy/config/application.rb | require File.expand_path('../boot', __FILE__)
require 'rails/all'
Bundler.require(*Rails.groups)
require "chaskiq"
module Dummy
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/in... | ruby | MIT | 1f0d0e6cf7f198e888d421471619bdfdedffa1d2 | 2026-01-04T17:52:24.705458Z | false |
michelson/chaskiq-newsletters | https://github.com/michelson/chaskiq-newsletters/blob/1f0d0e6cf7f198e888d421471619bdfdedffa1d2/spec/dummy/config/environment.rb | spec/dummy/config/environment.rb | # Load the Rails application.
require File.expand_path('../application', __FILE__)
# Initialize the Rails application.
Rails.application.initialize!
| ruby | MIT | 1f0d0e6cf7f198e888d421471619bdfdedffa1d2 | 2026-01-04T17:52:24.705458Z | false |
michelson/chaskiq-newsletters | https://github.com/michelson/chaskiq-newsletters/blob/1f0d0e6cf7f198e888d421471619bdfdedffa1d2/spec/dummy/config/routes.rb | spec/dummy/config/routes.rb | Rails.application.routes.draw do
mount Chaskiq::Engine => '/'
require 'sidekiq/web'
mount Sidekiq::Web => '/sidekiq'
end
| ruby | MIT | 1f0d0e6cf7f198e888d421471619bdfdedffa1d2 | 2026-01-04T17:52:24.705458Z | false |
michelson/chaskiq-newsletters | https://github.com/michelson/chaskiq-newsletters/blob/1f0d0e6cf7f198e888d421471619bdfdedffa1d2/spec/dummy/config/boot.rb | spec/dummy/config/boot.rb | # Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__)
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
$LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__)
| ruby | MIT | 1f0d0e6cf7f198e888d421471619bdfdedffa1d2 | 2026-01-04T17:52:24.705458Z | false |
michelson/chaskiq-newsletters | https://github.com/michelson/chaskiq-newsletters/blob/1f0d0e6cf7f198e888d421471619bdfdedffa1d2/spec/dummy/config/rainbows.rb | spec/dummy/config/rainbows.rb | worker_processes 3
timeout 30
preload_app true
Rainbows! do
use :EventMachine
end
before_fork do |server, worker|
# Replace with MongoDB or whatever
if defined?(ActiveRecord::Base)
ActiveRecord::Base.connection.disconnect!
end
end | ruby | MIT | 1f0d0e6cf7f198e888d421471619bdfdedffa1d2 | 2026-01-04T17:52:24.705458Z | false |
michelson/chaskiq-newsletters | https://github.com/michelson/chaskiq-newsletters/blob/1f0d0e6cf7f198e888d421471619bdfdedffa1d2/spec/dummy/config/initializers/filter_parameter_logging.rb | spec/dummy/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 | 1f0d0e6cf7f198e888d421471619bdfdedffa1d2 | 2026-01-04T17:52:24.705458Z | false |
michelson/chaskiq-newsletters | https://github.com/michelson/chaskiq-newsletters/blob/1f0d0e6cf7f198e888d421471619bdfdedffa1d2/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.
Rails.application.config.session_store :cookie_store, key: '_dummy_session'
| ruby | MIT | 1f0d0e6cf7f198e888d421471619bdfdedffa1d2 | 2026-01-04T17:52:24.705458Z | false |
michelson/chaskiq-newsletters | https://github.com/michelson/chaskiq-newsletters/blob/1f0d0e6cf7f198e888d421471619bdfdedffa1d2/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 f... | ruby | MIT | 1f0d0e6cf7f198e888d421471619bdfdedffa1d2 | 2026-01-04T17:52:24.705458Z | false |
michelson/chaskiq-newsletters | https://github.com/michelson/chaskiq-newsletters/blob/1f0d0e6cf7f198e888d421471619bdfdedffa1d2/spec/dummy/config/initializers/chaskiq.rb | spec/dummy/config/initializers/chaskiq.rb | require "chaskiq"
Chaskiq::Config.setup do |config|
#config.authentication_method = :authenticate_user!
config.ses_access_key = ENV['FOG_ACCESS_KEY_ID']
config.ses_access_secret_key = ENV['FOG_SECRET_ACCESS_KEY']
config.s3_bucket = ENV['FOG_BUCKET']
config.chaskiq_secret_key = "chaskiq123"
end | ruby | MIT | 1f0d0e6cf7f198e888d421471619bdfdedffa1d2 | 2026-01-04T17:52:24.705458Z | false |
michelson/chaskiq-newsletters | https://github.com/michelson/chaskiq-newsletters/blob/1f0d0e6cf7f198e888d421471619bdfdedffa1d2/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. 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 | 1f0d0e6cf7f198e888d421471619bdfdedffa1d2 | 2026-01-04T17:52:24.705458Z | false |
michelson/chaskiq-newsletters | https://github.com/michelson/chaskiq-newsletters/blob/1f0d0e6cf7f198e888d421471619bdfdedffa1d2/spec/dummy/config/initializers/cookies_serializer.rb | spec/dummy/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 | 1f0d0e6cf7f198e888d421471619bdfdedffa1d2 | 2026-01-04T17:52:24.705458Z | false |
michelson/chaskiq-newsletters | https://github.com/michelson/chaskiq-newsletters/blob/1f0d0e6cf7f198e888d421471619bdfdedffa1d2/spec/dummy/config/initializers/assets.rb | spec/dummy/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 | 1f0d0e6cf7f198e888d421471619bdfdedffa1d2 | 2026-01-04T17:52:24.705458Z | false |
michelson/chaskiq-newsletters | https://github.com/michelson/chaskiq-newsletters/blob/1f0d0e6cf7f198e888d421471619bdfdedffa1d2/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 | 1f0d0e6cf7f198e888d421471619bdfdedffa1d2 | 2026-01-04T17:52:24.705458Z | false |
michelson/chaskiq-newsletters | https://github.com/michelson/chaskiq-newsletters/blob/1f0d0e6cf7f198e888d421471619bdfdedffa1d2/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
| ruby | MIT | 1f0d0e6cf7f198e888d421471619bdfdedffa1d2 | 2026-01-04T17:52:24.705458Z | false |
michelson/chaskiq-newsletters | https://github.com/michelson/chaskiq-newsletters/blob/1f0d0e6cf7f198e888d421471619bdfdedffa1d2/spec/dummy/config/environments/test.rb | spec/dummy/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 | 1f0d0e6cf7f198e888d421471619bdfdedffa1d2 | 2026-01-04T17:52:24.705458Z | false |
michelson/chaskiq-newsletters | https://github.com/michelson/chaskiq-newsletters/blob/1f0d0e6cf7f198e888d421471619bdfdedffa1d2/spec/dummy/config/environments/development.rb | spec/dummy/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 | 1f0d0e6cf7f198e888d421471619bdfdedffa1d2 | 2026-01-04T17:52:24.705458Z | false |
michelson/chaskiq-newsletters | https://github.com/michelson/chaskiq-newsletters/blob/1f0d0e6cf7f198e888d421471619bdfdedffa1d2/spec/dummy/config/environments/production.rb | spec/dummy/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 | 1f0d0e6cf7f198e888d421471619bdfdedffa1d2 | 2026-01-04T17:52:24.705458Z | false |
michelson/chaskiq-newsletters | https://github.com/michelson/chaskiq-newsletters/blob/1f0d0e6cf7f198e888d421471619bdfdedffa1d2/spec/lib/link_renamer_spec.rb | spec/lib/link_renamer_spec.rb | require 'rails_helper'
module Chaskiq
RSpec.describe LinkRenamer, type: :model do
let(:html) { "<p><a href='http://google.com'></p>"}
let(:renamer){ Chaskiq::LinkRenamer }
it "will rename links" do
data = renamer.convert(html, "AAA")
expect(data).to include("AAA")
end
it "test_in... | ruby | MIT | 1f0d0e6cf7f198e888d421471619bdfdedffa1d2 | 2026-01-04T17:52:24.705458Z | false |
michelson/chaskiq-newsletters | https://github.com/michelson/chaskiq-newsletters/blob/1f0d0e6cf7f198e888d421471619bdfdedffa1d2/spec/lib/csv_importer_spec.rb | spec/lib/csv_importer_spec.rb | require 'rails_helper'
module Chaskiq
RSpec.describe CsvImporter, type: :model do
let(:importer){ Chaskiq::CsvImporter.new }
it "will initialize" do
expect(importer).to be_an_instance_of Chaskiq::CsvImporter
end
it "will import data" do
data = importer.import("spec/fixtures/csv_examp... | ruby | MIT | 1f0d0e6cf7f198e888d421471619bdfdedffa1d2 | 2026-01-04T17:52:24.705458Z | false |
michelson/chaskiq-newsletters | https://github.com/michelson/chaskiq-newsletters/blob/1f0d0e6cf7f198e888d421471619bdfdedffa1d2/spec/lib/config_spec.rb | spec/lib/config_spec.rb | require 'rails_helper'
module Chaskiq
RSpec.describe Config, type: :model do
let(:chaskiq_config){ Chaskiq::Config }
it "will setup" do
chaskiq_config.setup do |config|
config.mail_settings = {
:address => "someuser@gmail.com",
:user_name ... | ruby | MIT | 1f0d0e6cf7f198e888d421471619bdfdedffa1d2 | 2026-01-04T17:52:24.705458Z | false |
michelson/chaskiq-newsletters | https://github.com/michelson/chaskiq-newsletters/blob/1f0d0e6cf7f198e888d421471619bdfdedffa1d2/spec/mailers/previews/chaskiq/campaign_mailer_preview.rb | spec/mailers/previews/chaskiq/campaign_mailer_preview.rb | module Chaskiq
# Preview all emails at http://localhost:3000/rails/mailers/campaign_mailer
class CampaignMailerPreview < ActionMailer::Preview
end
end
| ruby | MIT | 1f0d0e6cf7f198e888d421471619bdfdedffa1d2 | 2026-01-04T17:52:24.705458Z | false |
michelson/chaskiq-newsletters | https://github.com/michelson/chaskiq-newsletters/blob/1f0d0e6cf7f198e888d421471619bdfdedffa1d2/spec/mailers/chaskiq/campaign_mailer_spec.rb | spec/mailers/chaskiq/campaign_mailer_spec.rb | require "rails_helper"
module Chaskiq
RSpec.describe CampaignMailer, type: :mailer do
let(:template){ FactoryGirl.create(:chaskiq_template) }
let(:list){ FactoryGirl.create(:chaskiq_list) }
let(:subscriber){
list.create_subscriber FactoryGirl.attributes_for(:chaskiq_subscriber)
}
let(:camp... | ruby | MIT | 1f0d0e6cf7f198e888d421471619bdfdedffa1d2 | 2026-01-04T17:52:24.705458Z | false |
michelson/chaskiq-newsletters | https://github.com/michelson/chaskiq-newsletters/blob/1f0d0e6cf7f198e888d421471619bdfdedffa1d2/lib/chaskiq.rb | lib/chaskiq.rb | require 'chaskiq/engine'
require 'haml'
require 'simple_form'
require 'kaminari'
require 'font-awesome-rails'
require 'bootstrap-sass'
require 'chaskiq/engine'
require 'urlcrypt'
require 'cocoon'
require 'mustache'
require 'dotenv'
require 'carrierwave'
require 'coffee-rails'
require 'premailer'
require 'groupdate'
req... | ruby | MIT | 1f0d0e6cf7f198e888d421471619bdfdedffa1d2 | 2026-01-04T17:52:24.705458Z | false |
michelson/chaskiq-newsletters | https://github.com/michelson/chaskiq-newsletters/blob/1f0d0e6cf7f198e888d421471619bdfdedffa1d2/lib/generators/chaskiq/install_generator.rb | lib/generators/chaskiq/install_generator.rb | require 'securerandom'
module Chaskiq
module Generators
class InstallGenerator < Rails::Generators::Base
source_root File.expand_path("../templates", __FILE__)
desc "Creates Chaskiq initializer, routes and copy locale files to your application."
class_option :orm
def copy_initializer
... | ruby | MIT | 1f0d0e6cf7f198e888d421471619bdfdedffa1d2 | 2026-01-04T17:52:24.705458Z | false |
michelson/chaskiq-newsletters | https://github.com/michelson/chaskiq-newsletters/blob/1f0d0e6cf7f198e888d421471619bdfdedffa1d2/lib/chaskiq/version.rb | lib/chaskiq/version.rb | module Chaskiq
VERSION = "0.0.6"
end
| ruby | MIT | 1f0d0e6cf7f198e888d421471619bdfdedffa1d2 | 2026-01-04T17:52:24.705458Z | false |
michelson/chaskiq-newsletters | https://github.com/michelson/chaskiq-newsletters/blob/1f0d0e6cf7f198e888d421471619bdfdedffa1d2/lib/chaskiq/csv_importer.rb | lib/chaskiq/csv_importer.rb | require "csv"
module Chaskiq
class CsvImporter
def import(file_path)
file = File.open(file_path)
CSV.parse(file.read)
end
end
end
| ruby | MIT | 1f0d0e6cf7f198e888d421471619bdfdedffa1d2 | 2026-01-04T17:52:24.705458Z | false |
michelson/chaskiq-newsletters | https://github.com/michelson/chaskiq-newsletters/blob/1f0d0e6cf7f198e888d421471619bdfdedffa1d2/lib/chaskiq/link_renamer.rb | lib/chaskiq/link_renamer.rb | require "nokogiri"
module Chaskiq
class LinkRenamer
def self.convert(html, url_prefix="")
content = Nokogiri::HTML(html)
content.css("a").each do |link|
next if link.attr("class").present? && link.attr("class").include?("tpl-block")
val = link.attributes["href"].value
link.at... | ruby | MIT | 1f0d0e6cf7f198e888d421471619bdfdedffa1d2 | 2026-01-04T17:52:24.705458Z | false |
michelson/chaskiq-newsletters | https://github.com/michelson/chaskiq-newsletters/blob/1f0d0e6cf7f198e888d421471619bdfdedffa1d2/lib/chaskiq/config.rb | lib/chaskiq/config.rb | module Chaskiq
class Config
mattr_accessor :mail_settings,
:authentication_method,
:ses_access_key,
:ses_access_secret_key,
:s3_bucket,
:chaskiq_secret_key
def self.setup
yield self
end
def self.configure!
begin
self.check_config_vars
self.config_urlc... | ruby | MIT | 1f0d0e6cf7f198e888d421471619bdfdedffa1d2 | 2026-01-04T17:52:24.705458Z | false |
michelson/chaskiq-newsletters | https://github.com/michelson/chaskiq-newsletters/blob/1f0d0e6cf7f198e888d421471619bdfdedffa1d2/lib/chaskiq/engine.rb | lib/chaskiq/engine.rb | module Chaskiq
class Engine < ::Rails::Engine
isolate_namespace Chaskiq
config.generators do |g|
g.test_framework :rspec
g.fixture_replacement :factory_girl, :dir => 'spec/factories'
g.integration_tool :rspec
end
config.autoload_paths += Dir["#{config.root}/app/jobs"]
config.... | ruby | MIT | 1f0d0e6cf7f198e888d421471619bdfdedffa1d2 | 2026-01-04T17:52:24.705458Z | false |
michelson/chaskiq-newsletters | https://github.com/michelson/chaskiq-newsletters/blob/1f0d0e6cf7f198e888d421471619bdfdedffa1d2/config/routes.rb | config/routes.rb | Chaskiq::Engine.routes.draw do
root 'dashboard#show'
#public
resources :campaigns, only: :show do
member do
get :subscribe
get :unsubscribe
get :forward
end
resources :subscribers do
member do
get :delete
end
end
resources :tracks do
member do
... | ruby | MIT | 1f0d0e6cf7f198e888d421471619bdfdedffa1d2 | 2026-01-04T17:52:24.705458Z | false |
michelson/chaskiq-newsletters | https://github.com/michelson/chaskiq-newsletters/blob/1f0d0e6cf7f198e888d421471619bdfdedffa1d2/config/initializers/simple_form_bootstrap.rb | config/initializers/simple_form_bootstrap.rb | # Use this setup block to configure all options available in SimpleForm.
SimpleForm.setup do |config|
config.error_notification_class = 'alert alert-danger'
config.button_class = 'btn btn-default'
config.boolean_label_class = nil
config.wrappers :vertical_form, tag: 'div', class: 'form-group', error_class: 'h... | ruby | MIT | 1f0d0e6cf7f198e888d421471619bdfdedffa1d2 | 2026-01-04T17:52:24.705458Z | false |
michelson/chaskiq-newsletters | https://github.com/michelson/chaskiq-newsletters/blob/1f0d0e6cf7f198e888d421471619bdfdedffa1d2/config/initializers/kaminari_config.rb | config/initializers/kaminari_config.rb | Kaminari.configure do |config|
# config.default_per_page = 25
# config.max_per_page = nil
# config.window = 4
# config.outer_window = 0
# config.left = 0
# config.right = 0
# config.page_method_name = :page
# config.param_name = :page
end
| ruby | MIT | 1f0d0e6cf7f198e888d421471619bdfdedffa1d2 | 2026-01-04T17:52:24.705458Z | false |
influitive/apartment-sidekiq | https://github.com/influitive/apartment-sidekiq/blob/2e5b59def9220ea2f7861c3e21bd8cdd49fe3155/spec/spec_helper.rb | spec/spec_helper.rb | ENV['RACK_ENV'] = ENV['RAILS_ENV'] = 'test'
require 'minitest/autorun' | ruby | MIT | 2e5b59def9220ea2f7861c3e21bd8cdd49fe3155 | 2026-01-04T17:52:26.266886Z | false |
influitive/apartment-sidekiq | https://github.com/influitive/apartment-sidekiq/blob/2e5b59def9220ea2f7861c3e21bd8cdd49fe3155/lib/apartment-sidekiq.rb | lib/apartment-sidekiq.rb | require 'apartment/sidekiq' | ruby | MIT | 2e5b59def9220ea2f7861c3e21bd8cdd49fe3155 | 2026-01-04T17:52:26.266886Z | false |
influitive/apartment-sidekiq | https://github.com/influitive/apartment-sidekiq/blob/2e5b59def9220ea2f7861c3e21bd8cdd49fe3155/lib/apartment/sidekiq.rb | lib/apartment/sidekiq.rb | require 'apartment/sidekiq/version'
require 'sidekiq'
require 'apartment/sidekiq/middleware/client'
require 'apartment/sidekiq/middleware/server'
module Apartment
module Sidekiq
module Middleware
def self.run
::Sidekiq.configure_client do |config|
config.client_middleware do |chain|
... | ruby | MIT | 2e5b59def9220ea2f7861c3e21bd8cdd49fe3155 | 2026-01-04T17:52:26.266886Z | false |
influitive/apartment-sidekiq | https://github.com/influitive/apartment-sidekiq/blob/2e5b59def9220ea2f7861c3e21bd8cdd49fe3155/lib/apartment/sidekiq/version.rb | lib/apartment/sidekiq/version.rb | module Apartment
module Sidekiq
VERSION = "1.2.0"
end
end
| ruby | MIT | 2e5b59def9220ea2f7861c3e21bd8cdd49fe3155 | 2026-01-04T17:52:26.266886Z | false |
influitive/apartment-sidekiq | https://github.com/influitive/apartment-sidekiq/blob/2e5b59def9220ea2f7861c3e21bd8cdd49fe3155/lib/apartment/sidekiq/railtie.rb | lib/apartment/sidekiq/railtie.rb | module Apartment::Sidekiq
class Railtie < Rails::Railtie
initializer "apartment.sidekiq" do
Apartment::Sidekiq::Middleware.run
end
end
end
| ruby | MIT | 2e5b59def9220ea2f7861c3e21bd8cdd49fe3155 | 2026-01-04T17:52:26.266886Z | false |
influitive/apartment-sidekiq | https://github.com/influitive/apartment-sidekiq/blob/2e5b59def9220ea2f7861c3e21bd8cdd49fe3155/lib/apartment/sidekiq/middleware/client.rb | lib/apartment/sidekiq/middleware/client.rb | module Apartment::Sidekiq::Middleware
class Client
def call(worker_class, item, queue, redis_pool=nil)
item["apartment"] ||= Apartment::Tenant.current
yield
end
end
end | ruby | MIT | 2e5b59def9220ea2f7861c3e21bd8cdd49fe3155 | 2026-01-04T17:52:26.266886Z | false |
influitive/apartment-sidekiq | https://github.com/influitive/apartment-sidekiq/blob/2e5b59def9220ea2f7861c3e21bd8cdd49fe3155/lib/apartment/sidekiq/middleware/server.rb | lib/apartment/sidekiq/middleware/server.rb | module Apartment::Sidekiq::Middleware
class Server
def call(worker_class, item, queue)
Apartment::Tenant.switch(item['apartment']) do
yield
end
end
end
end
| ruby | MIT | 2e5b59def9220ea2f7861c3e21bd8cdd49fe3155 | 2026-01-04T17:52:26.266886Z | false |
influitive/apartment-sidekiq | https://github.com/influitive/apartment-sidekiq/blob/2e5b59def9220ea2f7861c3e21bd8cdd49fe3155/lib/apartment/sidekiq/middleware/honeybadger/server.rb | lib/apartment/sidekiq/middleware/honeybadger/server.rb | module Apartment::Sidekiq::Middleware::Honeybadger
class Server
def call(worker_class, item, queue)
Honeybadger.context({tenant: Apartment::Tenant.current})
yield
end
end
end
| ruby | MIT | 2e5b59def9220ea2f7861c3e21bd8cdd49fe3155 | 2026-01-04T17:52:26.266886Z | false |
soulcutter/saxerator | https://github.com/soulcutter/saxerator/blob/bdae3703d777a41cb070d7a79ca0a1d32de894cd/benchmark/generate_sample_file.rb | benchmark/generate_sample_file.rb | #!/usr/bin/env ruby
filename = ARGV.shift
unless filename
puts "Syntax: ruby #{__FILE__} <filename>"
exit 1
end
num_records = ARGV.shift || 100000
num_records = num_records.to_i
element = <<-eos
<artist id="%i">
<name>Rock Star %i</name>
<active>true</active>
<description>...</description>
<gen... | ruby | MIT | bdae3703d777a41cb070d7a79ca0a1d32de894cd | 2026-01-04T17:52:28.472040Z | false |
soulcutter/saxerator | https://github.com/soulcutter/saxerator/blob/bdae3703d777a41cb070d7a79ca0a1d32de894cd/benchmark/benchmark.rb | benchmark/benchmark.rb | $LOAD_PATH.push File.expand_path('../../lib', __FILE__)
require 'saxerator'
require 'benchmark'
file = ARGV.shift
unless File.exist?(file)
puts "Cannot find file #{file}"
exit 1
end
file = File.new(file)
ADAPTERS = %i[nokogiri ox oga rexml].freeze
class SaxeratorBenchmark
def initialize(file)
@file = file
... | ruby | MIT | bdae3703d777a41cb070d7a79ca0a1d32de894cd | 2026-01-04T17:52:28.472040Z | false |
soulcutter/saxerator | https://github.com/soulcutter/saxerator/blob/bdae3703d777a41cb070d7a79ca0a1d32de894cd/spec/spec_helper.rb | spec/spec_helper.rb | if ENV['COVERAGE']
require 'simplecov'
SimpleCov.start do
add_filter 'spec/'
end
end
require 'support/fixture_file'
RSpec.configure do |config|
config.example_status_persistence_file_path = 'spec/examples.txt'
config.include FixtureFile
adapter = ENV['SAXERATOR_ADAPTER']
config.before(:suite) do |... | ruby | MIT | bdae3703d777a41cb070d7a79ca0a1d32de894cd | 2026-01-04T17:52:28.472040Z | false |
soulcutter/saxerator | https://github.com/soulcutter/saxerator/blob/bdae3703d777a41cb070d7a79ca0a1d32de894cd/spec/support/fixture_file.rb | spec/support/fixture_file.rb | module FixtureFile
def fixture_file(name)
File.new(File.join(File.dirname(__FILE__), '..', 'fixtures', name))
end
end
| ruby | MIT | bdae3703d777a41cb070d7a79ca0a1d32de894cd | 2026-01-04T17:52:28.472040Z | false |
soulcutter/saxerator | https://github.com/soulcutter/saxerator/blob/bdae3703d777a41cb070d7a79ca0a1d32de894cd/spec/lib/saxerator_spec.rb | spec/lib/saxerator_spec.rb | require 'spec_helper'
RSpec.describe Saxerator do
context '#parser' do
subject(:parser) do
Saxerator.parser(xml)
end
context 'with a File argument' do
let(:xml) { fixture_file('flat_blurbs.xml') }
it 'can parse it' do
expect(parser.all).to eq('blurb' => %w[one two three])
... | ruby | MIT | bdae3703d777a41cb070d7a79ca0a1d32de894cd | 2026-01-04T17:52:28.472040Z | false |
soulcutter/saxerator | https://github.com/soulcutter/saxerator/blob/bdae3703d777a41cb070d7a79ca0a1d32de894cd/spec/lib/builder/xml_builder_spec.rb | spec/lib/builder/xml_builder_spec.rb | # encoding: utf-8
require 'spec_helper'
describe 'Saxerator xml format' do
let(:xml) { fixture_file('nested_elements.xml') }
subject(:entry) do
Saxerator.parser(xml) do |config|
config.output_type = :xml
end.for_tag(:entry).first
end
it { is_expected.to be_a(REXML::Document) }
it 'looks like... | ruby | MIT | bdae3703d777a41cb070d7a79ca0a1d32de894cd | 2026-01-04T17:52:28.472040Z | false |
soulcutter/saxerator | https://github.com/soulcutter/saxerator/blob/bdae3703d777a41cb070d7a79ca0a1d32de894cd/spec/lib/builder/hash_builder_spec.rb | spec/lib/builder/hash_builder_spec.rb | # encoding: utf-8
require 'spec_helper'
describe 'Saxerator (default) hash format' do
let(:xml) { fixture_file('nested_elements.xml') }
subject(:entry) { Saxerator.parser(xml).for_tag(:entry).first }
# string
specify { expect(entry['title']).to eq('How to eat an airplane') }
# hash and cdata inside name
... | ruby | MIT | bdae3703d777a41cb070d7a79ca0a1d32de894cd | 2026-01-04T17:52:28.472040Z | false |
soulcutter/saxerator | https://github.com/soulcutter/saxerator/blob/bdae3703d777a41cb070d7a79ca0a1d32de894cd/spec/lib/dsl/for_tag_spec.rb | spec/lib/dsl/for_tag_spec.rb | require 'spec_helper'
describe 'Saxerator::DSL#for_tag' do
subject(:parser) { Saxerator.parser(xml) }
let(:xml) do
<<-eos
<blurbs>
<blurb>one</blurb>
<blurb>two</blurb>
<blurb>three</blurb>
<notablurb>four</notablurb>
</blurbs>
eos
end
it 'only selects the ... | ruby | MIT | bdae3703d777a41cb070d7a79ca0a1d32de894cd | 2026-01-04T17:52:28.472040Z | false |
soulcutter/saxerator | https://github.com/soulcutter/saxerator/blob/bdae3703d777a41cb070d7a79ca0a1d32de894cd/spec/lib/dsl/at_depth_spec.rb | spec/lib/dsl/at_depth_spec.rb | require 'spec_helper'
describe 'Saxerator::DSL#at_depth' do
subject(:parser) { Saxerator.parser(xml) }
let(:xml) do
<<-eos
<publications>
<book>
<name>How to eat an airplane</name>
<author>Leviticus Alabaster</author>
</book>
<book>
<name>To wallop a... | ruby | MIT | bdae3703d777a41cb070d7a79ca0a1d32de894cd | 2026-01-04T17:52:28.472040Z | false |
soulcutter/saxerator | https://github.com/soulcutter/saxerator/blob/bdae3703d777a41cb070d7a79ca0a1d32de894cd/spec/lib/dsl/with_attributes_spec.rb | spec/lib/dsl/with_attributes_spec.rb | require 'spec_helper'
describe 'Saxerator::DSL#with_attributes' do
subject(:parser) { Saxerator.parser(xml) }
let(:xml) do
<<-eos
<book>
<name>How to eat an airplane</name>
<author>
<name type="primary" ridiculous="true">Leviticus Alabaster</name>
<name type="foreword... | ruby | MIT | bdae3703d777a41cb070d7a79ca0a1d32de894cd | 2026-01-04T17:52:28.472040Z | false |
soulcutter/saxerator | https://github.com/soulcutter/saxerator/blob/bdae3703d777a41cb070d7a79ca0a1d32de894cd/spec/lib/dsl/all_spec.rb | spec/lib/dsl/all_spec.rb | require 'spec_helper'
describe 'Saxerator::FullDocument#all' do
subject(:parser) { Saxerator.parser(xml) }
let(:xml) do
<<-eos
<blurbs>
<blurb>one</blurb>
<blurb>two</blurb>
<blurb>three</blurb>
<notablurb>four</notablurb>
<empty with="attribute"/>
</blurbs>... | ruby | MIT | bdae3703d777a41cb070d7a79ca0a1d32de894cd | 2026-01-04T17:52:28.472040Z | false |
soulcutter/saxerator | https://github.com/soulcutter/saxerator/blob/bdae3703d777a41cb070d7a79ca0a1d32de894cd/spec/lib/dsl/within_spec.rb | spec/lib/dsl/within_spec.rb | require 'spec_helper'
describe 'Saxerator::DSL#within' do
subject(:parser) { Saxerator.parser(xml) }
let(:xml) do
<<-eos
<magazine>
<name>The Smarterest</name>
<article>
<name>Is our children learning?</name>
<author>Hazel Nutt</author>
</article>
</maga... | ruby | MIT | bdae3703d777a41cb070d7a79ca0a1d32de894cd | 2026-01-04T17:52:28.472040Z | false |
soulcutter/saxerator | https://github.com/soulcutter/saxerator/blob/bdae3703d777a41cb070d7a79ca0a1d32de894cd/spec/lib/dsl/with_attribute_spec.rb | spec/lib/dsl/with_attribute_spec.rb | require 'spec_helper'
describe 'Saxerator::DSL#with_attribute' do
subject(:parser) { Saxerator.parser(xml) }
let(:xml) do
<<-eos
<book>
<name>How to eat an airplane</name>
<author>
<name type="primary">Leviticus Alabaster</name>
<name type="foreword">Eunice Diesel</na... | ruby | MIT | bdae3703d777a41cb070d7a79ca0a1d32de894cd | 2026-01-04T17:52:28.472040Z | false |
soulcutter/saxerator | https://github.com/soulcutter/saxerator/blob/bdae3703d777a41cb070d7a79ca0a1d32de894cd/spec/lib/dsl/for_tags_spec.rb | spec/lib/dsl/for_tags_spec.rb | require 'spec_helper'
describe 'Saxerator::DSL#for_tags' do
subject(:parser) { Saxerator.parser(xml) }
let(:xml) do
<<-eos
<blurbs>
<blurb1>one</blurb1>
<blurb2>two</blurb2>
<blurb3>three</blurb3>
</blurbs>
eos
end
it 'only selects the specified tags' do
expect... | ruby | MIT | bdae3703d777a41cb070d7a79ca0a1d32de894cd | 2026-01-04T17:52:28.472040Z | false |
soulcutter/saxerator | https://github.com/soulcutter/saxerator/blob/bdae3703d777a41cb070d7a79ca0a1d32de894cd/spec/lib/dsl/child_of_spec.rb | spec/lib/dsl/child_of_spec.rb | require 'spec_helper'
describe 'Saxerator::DSL#child_of' do
subject(:parser) { Saxerator.parser(xml) }
let(:xml) do
<<-eos
<root>
<children>
<name>Rudy McMannis</name>
<children>
<name>Tom McMannis</name>
</children>
<grandchildren>
<name>Mildred... | ruby | MIT | bdae3703d777a41cb070d7a79ca0a1d32de894cd | 2026-01-04T17:52:28.472040Z | false |
soulcutter/saxerator | https://github.com/soulcutter/saxerator/blob/bdae3703d777a41cb070d7a79ca0a1d32de894cd/lib/saxerator.rb | lib/saxerator.rb | require 'saxerator/version'
require 'saxerator/sax_handler'
require 'saxerator/dsl'
require 'saxerator/full_document'
require 'saxerator/document_fragment'
require 'saxerator/configuration'
require 'saxerator/builder'
require 'saxerator/builder/array_element'
require 'saxerator/builder/hash_element'
require 'saxerato... | ruby | MIT | bdae3703d777a41cb070d7a79ca0a1d32de894cd | 2026-01-04T17:52:28.472040Z | false |
soulcutter/saxerator | https://github.com/soulcutter/saxerator/blob/bdae3703d777a41cb070d7a79ca0a1d32de894cd/lib/saxerator/full_document.rb | lib/saxerator/full_document.rb | module Saxerator
class FullDocument
include DSL
def initialize(source, config)
@source = source
@config = config
@latches = []
end
def all
DocumentFragment.new(@source, @config, @latches).first
end
end
end
| ruby | MIT | bdae3703d777a41cb070d7a79ca0a1d32de894cd | 2026-01-04T17:52:28.472040Z | false |
soulcutter/saxerator | https://github.com/soulcutter/saxerator/blob/bdae3703d777a41cb070d7a79ca0a1d32de894cd/lib/saxerator/version.rb | lib/saxerator/version.rb | module Saxerator
VERSION = '0.9.9'.freeze
end
| ruby | MIT | bdae3703d777a41cb070d7a79ca0a1d32de894cd | 2026-01-04T17:52:28.472040Z | false |
soulcutter/saxerator | https://github.com/soulcutter/saxerator/blob/bdae3703d777a41cb070d7a79ca0a1d32de894cd/lib/saxerator/sax_handler.rb | lib/saxerator/sax_handler.rb | module Saxerator
class SaxHandler
def characters(_text); end
def start_element(_name, _attrs = []); end
def end_element(_name); end
end
end
| ruby | MIT | bdae3703d777a41cb070d7a79ca0a1d32de894cd | 2026-01-04T17:52:28.472040Z | false |
soulcutter/saxerator | https://github.com/soulcutter/saxerator/blob/bdae3703d777a41cb070d7a79ca0a1d32de894cd/lib/saxerator/dsl.rb | lib/saxerator/dsl.rb | module Saxerator
module DSL
def for_tag(*tags)
for_tags(tags)
end
def for_tags(tags)
raise ArgumentError, '#for_tags requires an Array argument' unless tags.is_a? Array
specify Latches::ForTags.new(tags.map(&:to_s))
end
def at_depth(depth)
specify Latches::AtDepth.new(dep... | ruby | MIT | bdae3703d777a41cb070d7a79ca0a1d32de894cd | 2026-01-04T17:52:28.472040Z | false |
soulcutter/saxerator | https://github.com/soulcutter/saxerator/blob/bdae3703d777a41cb070d7a79ca0a1d32de894cd/lib/saxerator/configuration.rb | lib/saxerator/configuration.rb | module Saxerator
class Configuration
attr_writer :hash_key_generator
attr_reader :output_type
ADAPTER_TYPES = %i[ox nokogiri rexml oga].freeze
def initialize
@adapter = :rexml
@output_type = :hash
@put_attributes_in_hash = false
@ignore_namespaces = false
end
def ada... | ruby | MIT | bdae3703d777a41cb070d7a79ca0a1d32de894cd | 2026-01-04T17:52:28.472040Z | false |
soulcutter/saxerator | https://github.com/soulcutter/saxerator/blob/bdae3703d777a41cb070d7a79ca0a1d32de894cd/lib/saxerator/document_fragment.rb | lib/saxerator/document_fragment.rb | module Saxerator
class DocumentFragment
include Enumerable
include DSL
def initialize(source, config = nil, latches = [])
@source = source
@latches = latches
@config = config
end
def each(&block)
return to_enum unless block_given?
# Always have to start at the begi... | ruby | MIT | bdae3703d777a41cb070d7a79ca0a1d32de894cd | 2026-01-04T17:52:28.472040Z | false |
soulcutter/saxerator | https://github.com/soulcutter/saxerator/blob/bdae3703d777a41cb070d7a79ca0a1d32de894cd/lib/saxerator/builder.rb | lib/saxerator/builder.rb | module Saxerator
module Builder
extend self
def valid?(type)
Builder.const_defined? "#{camel_case(type)}Builder"
end
def to_class(type)
Builder.const_get("#{camel_case(type)}Builder")
end
def camel_case(str)
str = str.to_s
return str if str !~ /_/ && str =~ /[A-Z]+.*... | ruby | MIT | bdae3703d777a41cb070d7a79ca0a1d32de894cd | 2026-01-04T17:52:28.472040Z | false |
soulcutter/saxerator | https://github.com/soulcutter/saxerator/blob/bdae3703d777a41cb070d7a79ca0a1d32de894cd/lib/saxerator/builder/hash_builder.rb | lib/saxerator/builder/hash_builder.rb | module Saxerator
module Builder
class HashBuilder
attr_reader :name
def initialize(config, name, attributes)
@config = config
@name = config.generate_key_for(name)
@attributes = normalize_attributes(attributes)
@children = []
end
def add_node(node)
... | ruby | MIT | bdae3703d777a41cb070d7a79ca0a1d32de894cd | 2026-01-04T17:52:28.472040Z | false |
soulcutter/saxerator | https://github.com/soulcutter/saxerator/blob/bdae3703d777a41cb070d7a79ca0a1d32de894cd/lib/saxerator/builder/xml_builder.rb | lib/saxerator/builder/xml_builder.rb | require 'rexml/document'
module Saxerator
module Builder
class XmlBuilder
attr_reader :name
def initialize(config, name, attributes)
@config = config
@name = name
@attributes = attributes
@children = []
@text = false
end
def add_node(node)
... | ruby | MIT | bdae3703d777a41cb070d7a79ca0a1d32de894cd | 2026-01-04T17:52:28.472040Z | false |
soulcutter/saxerator | https://github.com/soulcutter/saxerator/blob/bdae3703d777a41cb070d7a79ca0a1d32de894cd/lib/saxerator/builder/string_element.rb | lib/saxerator/builder/string_element.rb | require 'saxerator/builder/array_element'
require 'delegate'
module Saxerator
module Builder
class StringElement < DelegateClass(String)
attr_accessor :attributes
attr_accessor :name
def initialize(str, name = nil, attributes = nil)
@name = name
@attributes = attributes
... | ruby | MIT | bdae3703d777a41cb070d7a79ca0a1d32de894cd | 2026-01-04T17:52:28.472040Z | false |
soulcutter/saxerator | https://github.com/soulcutter/saxerator/blob/bdae3703d777a41cb070d7a79ca0a1d32de894cd/lib/saxerator/builder/array_element.rb | lib/saxerator/builder/array_element.rb | require 'delegate'
module Saxerator
module Builder
class ArrayElement < DelegateClass(Array)
attr_accessor :name, :attributes
def initialize(arr = [], name = nil, attributes = nil)
@name = name
@attributes = attributes
super(arr)
end
def to_a; self end
end
... | ruby | MIT | bdae3703d777a41cb070d7a79ca0a1d32de894cd | 2026-01-04T17:52:28.472040Z | false |
soulcutter/saxerator | https://github.com/soulcutter/saxerator/blob/bdae3703d777a41cb070d7a79ca0a1d32de894cd/lib/saxerator/builder/hash_element.rb | lib/saxerator/builder/hash_element.rb | require 'saxerator/builder/array_element'
require 'delegate'
module Saxerator
module Builder
class HashElement < DelegateClass(Hash)
attr_accessor :attributes
attr_accessor :name
def initialize(name = nil, attributes = nil)
@name = name
@attributes = attributes
super({}... | ruby | MIT | bdae3703d777a41cb070d7a79ca0a1d32de894cd | 2026-01-04T17:52:28.472040Z | false |
soulcutter/saxerator | https://github.com/soulcutter/saxerator/blob/bdae3703d777a41cb070d7a79ca0a1d32de894cd/lib/saxerator/latches/child_of.rb | lib/saxerator/latches/child_of.rb | module Saxerator
module Latches
class ChildOf < ::Saxerator::SaxHandler
def initialize(name)
@name = name
@depths = []
end
def start_element(name, _)
increment_depth(1) if depth_within_element > 0
@depths.push 1 if @name == name
end
def end_element(_... | ruby | MIT | bdae3703d777a41cb070d7a79ca0a1d32de894cd | 2026-01-04T17:52:28.472040Z | false |
soulcutter/saxerator | https://github.com/soulcutter/saxerator/blob/bdae3703d777a41cb070d7a79ca0a1d32de894cd/lib/saxerator/latches/with_attributes.rb | lib/saxerator/latches/with_attributes.rb | require 'saxerator/latches/abstract_latch'
module Saxerator
module Latches
class WithAttributes < AbstractLatch
def initialize(attrs)
@attrs = attrs
end
def start_element(_, attributes)
attributes = Hash[attributes]
if @attrs.all? { |k, v| attributes[k] && (v.nil? || at... | ruby | MIT | bdae3703d777a41cb070d7a79ca0a1d32de894cd | 2026-01-04T17:52:28.472040Z | false |
soulcutter/saxerator | https://github.com/soulcutter/saxerator/blob/bdae3703d777a41cb070d7a79ca0a1d32de894cd/lib/saxerator/latches/abstract_latch.rb | lib/saxerator/latches/abstract_latch.rb | module Saxerator
module Latches
class AbstractLatch < ::Saxerator::SaxHandler
def open
@open = true
end
def close
@open = false
end
def open?
@open
end
end
end
end
| ruby | MIT | bdae3703d777a41cb070d7a79ca0a1d32de894cd | 2026-01-04T17:52:28.472040Z | false |
soulcutter/saxerator | https://github.com/soulcutter/saxerator/blob/bdae3703d777a41cb070d7a79ca0a1d32de894cd/lib/saxerator/latches/for_tags.rb | lib/saxerator/latches/for_tags.rb | require 'saxerator/latches/abstract_latch'
module Saxerator
module Latches
class ForTags < AbstractLatch
def initialize(names)
@names = names
end
def start_element(name, _)
@names.include?(name) ? open : close
end
def end_element(name)
close if @names.inclu... | ruby | MIT | bdae3703d777a41cb070d7a79ca0a1d32de894cd | 2026-01-04T17:52:28.472040Z | false |
soulcutter/saxerator | https://github.com/soulcutter/saxerator/blob/bdae3703d777a41cb070d7a79ca0a1d32de894cd/lib/saxerator/latches/within.rb | lib/saxerator/latches/within.rb | module Saxerator
module Latches
class Within < ::Saxerator::SaxHandler
def initialize(name)
@name = name
@depth_within_element = 0
end
def start_element(name, _)
@depth_within_element += 1 if name == @name || @depth_within_element > 0
end
def end_element(_)
... | ruby | MIT | bdae3703d777a41cb070d7a79ca0a1d32de894cd | 2026-01-04T17:52:28.472040Z | false |
soulcutter/saxerator | https://github.com/soulcutter/saxerator/blob/bdae3703d777a41cb070d7a79ca0a1d32de894cd/lib/saxerator/latches/at_depth.rb | lib/saxerator/latches/at_depth.rb | module Saxerator
module Latches
class AtDepth < ::Saxerator::SaxHandler
def initialize(depth)
@target_depth = depth
@current_depth = -1
end
def start_element(_, __)
@current_depth += 1
end
def end_element(_)
@current_depth -= 1
end
def o... | ruby | MIT | bdae3703d777a41cb070d7a79ca0a1d32de894cd | 2026-01-04T17:52:28.472040Z | false |
soulcutter/saxerator | https://github.com/soulcutter/saxerator/blob/bdae3703d777a41cb070d7a79ca0a1d32de894cd/lib/saxerator/adapters/nokogiri.rb | lib/saxerator/adapters/nokogiri.rb | require 'forwardable'
require 'nokogiri'
module Saxerator
module Adapters
class Nokogiri < ::Nokogiri::XML::SAX::Document
extend Forwardable
def self.parse(source, reader)
parser = ::Nokogiri::XML::SAX::Parser.new(new(reader))
parser.parse(source)
end
def initialize(read... | ruby | MIT | bdae3703d777a41cb070d7a79ca0a1d32de894cd | 2026-01-04T17:52:28.472040Z | false |
soulcutter/saxerator | https://github.com/soulcutter/saxerator/blob/bdae3703d777a41cb070d7a79ca0a1d32de894cd/lib/saxerator/adapters/oga.rb | lib/saxerator/adapters/oga.rb | require 'forwardable'
require 'oga'
module Saxerator
module Adapters
class Oga
extend Forwardable
def self.parse(source, reader)
parser = ::Oga::XML::SaxParser.new(new(reader), source, strict: true)
parser.parse
rescue LL::ParserError => message
raise Saxerator::ParseEx... | ruby | MIT | bdae3703d777a41cb070d7a79ca0a1d32de894cd | 2026-01-04T17:52:28.472040Z | false |
soulcutter/saxerator | https://github.com/soulcutter/saxerator/blob/bdae3703d777a41cb070d7a79ca0a1d32de894cd/lib/saxerator/adapters/rexml.rb | lib/saxerator/adapters/rexml.rb | require 'forwardable'
require 'rexml/document'
require 'rexml/streamlistener'
module Saxerator
module Adapters
class Rexml
extend Forwardable
include REXML::StreamListener
def self.parse(source, reader)
handler = new(reader)
REXML::Document.parse_stream(source, handler)
r... | ruby | MIT | bdae3703d777a41cb070d7a79ca0a1d32de894cd | 2026-01-04T17:52:28.472040Z | false |
soulcutter/saxerator | https://github.com/soulcutter/saxerator/blob/bdae3703d777a41cb070d7a79ca0a1d32de894cd/lib/saxerator/adapters/ox.rb | lib/saxerator/adapters/ox.rb | require 'forwardable'
require 'ox'
module Saxerator
module Adapters
class Ox # < ::Ox::Sax
extend Forwardable
def self.parse(source, reader)
handler = new(reader)
::Ox.sax_parse(handler, source)
end
attr_accessor :name
attr_reader :attributes
attr_reader :rea... | ruby | MIT | bdae3703d777a41cb070d7a79ca0a1d32de894cd | 2026-01-04T17:52:28.472040Z | false |
soulcutter/saxerator | https://github.com/soulcutter/saxerator/blob/bdae3703d777a41cb070d7a79ca0a1d32de894cd/lib/saxerator/parser/accumulator.rb | lib/saxerator/parser/accumulator.rb | module Saxerator
module Parser
class Accumulator < ::Saxerator::SaxHandler
def initialize(config, block)
@stack = []
@config = config
@block = block
end
def start_element(name, attrs = [])
@stack.push @config.output_type.new(@config, name, Hash[attrs])
end
... | ruby | MIT | bdae3703d777a41cb070d7a79ca0a1d32de894cd | 2026-01-04T17:52:28.472040Z | false |
soulcutter/saxerator | https://github.com/soulcutter/saxerator/blob/bdae3703d777a41cb070d7a79ca0a1d32de894cd/lib/saxerator/parser/latched_accumulator.rb | lib/saxerator/parser/latched_accumulator.rb | module Saxerator
module Parser
class LatchedAccumulator < ::Saxerator::SaxHandler
def initialize(config, latches, block)
@latches = latches
@accumulator = Accumulator.new(config, block)
@ignore_namespaces = config.ignore_namespaces?
end
def check_latches_and_passthrough(... | ruby | MIT | bdae3703d777a41cb070d7a79ca0a1d32de894cd | 2026-01-04T17:52:28.472040Z | false |
kobaltz/action_auth | https://github.com/kobaltz/action_auth/blob/b43f513090a1188e3f8f400ba4317c9b96c99181/version.rb | version.rb | module ActionAuth
VERSION = "1.8.7"
end
| ruby | MIT | b43f513090a1188e3f8f400ba4317c9b96c99181 | 2026-01-04T17:52:32.033910Z | false |
kobaltz/action_auth | https://github.com/kobaltz/action_auth/blob/b43f513090a1188e3f8f400ba4317c9b96c99181/app/jobs/action_auth/application_job.rb | app/jobs/action_auth/application_job.rb | module ActionAuth
class ApplicationJob < ActiveJob::Base
end
end
| ruby | MIT | b43f513090a1188e3f8f400ba4317c9b96c99181 | 2026-01-04T17:52:32.033910Z | false |
kobaltz/action_auth | https://github.com/kobaltz/action_auth/blob/b43f513090a1188e3f8f400ba4317c9b96c99181/app/helpers/action_auth/application_helper.rb | app/helpers/action_auth/application_helper.rb | module ActionAuth
module ApplicationHelper
end
end
| ruby | MIT | b43f513090a1188e3f8f400ba4317c9b96c99181 | 2026-01-04T17:52:32.033910Z | false |
kobaltz/action_auth | https://github.com/kobaltz/action_auth/blob/b43f513090a1188e3f8f400ba4317c9b96c99181/app/controllers/action_auth/webauthn_credentials_controller.rb | app/controllers/action_auth/webauthn_credentials_controller.rb | class ActionAuth::WebauthnCredentialsController < ApplicationController
before_action :authenticate_user!
layout "action_auth/application"
def new
end
def options
if current_user.webauthn_id.blank?
current_user.update!(webauthn_id: WebAuthn.generate_user_id)
end
create_options = WebAuthn:... | ruby | MIT | b43f513090a1188e3f8f400ba4317c9b96c99181 | 2026-01-04T17:52:32.033910Z | false |
kobaltz/action_auth | https://github.com/kobaltz/action_auth/blob/b43f513090a1188e3f8f400ba4317c9b96c99181/app/controllers/action_auth/webauthn_credential_authentications_controller.rb | app/controllers/action_auth/webauthn_credential_authentications_controller.rb | class ActionAuth::WebauthnCredentialAuthenticationsController < ApplicationController
before_action :ensure_user_not_authenticated
before_action :ensure_login_initiated
layout "action_auth/application"
rate_limit to: 5,
within: 20.seconds,
only: :create,
name: "webauthn-throttle",
with: -> { re... | ruby | MIT | b43f513090a1188e3f8f400ba4317c9b96c99181 | 2026-01-04T17:52:32.033910Z | false |
kobaltz/action_auth | https://github.com/kobaltz/action_auth/blob/b43f513090a1188e3f8f400ba4317c9b96c99181/app/controllers/action_auth/passwords_controller.rb | app/controllers/action_auth/passwords_controller.rb | module ActionAuth
class PasswordsController < ApplicationController
before_action :set_user
before_action :validate_pwned_password, only: :update
rate_limit to: 3,
within: 60.seconds,
only: :update,
name: "password-reset-throttle",
with: -> { redirect_to sign_in_path, alert: "Too ... | ruby | MIT | b43f513090a1188e3f8f400ba4317c9b96c99181 | 2026-01-04T17:52:32.033910Z | false |
kobaltz/action_auth | https://github.com/kobaltz/action_auth/blob/b43f513090a1188e3f8f400ba4317c9b96c99181/app/controllers/action_auth/users_controller.rb | app/controllers/action_auth/users_controller.rb | module ActionAuth
class UsersController < ApplicationController
before_action :authenticate_user!
def destroy
Current.user.destroy
redirect_to main_app.root_url, notice: "Your account has been deleted."
end
end
end
| ruby | MIT | b43f513090a1188e3f8f400ba4317c9b96c99181 | 2026-01-04T17:52:32.033910Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.