source stringclasses 1
value | repo stringlengths 5 63 | repo_url stringlengths 24 82 | path stringlengths 5 167 | language stringclasses 1
value | license stringclasses 5
values | stars int64 10 51.4k | ref stringclasses 23
values | size_bytes int64 200 258k | text stringlengths 137 258k |
|---|---|---|---|---|---|---|---|---|---|
github | plaid/plaid-ruby | https://github.com/plaid/plaid-ruby | lib/plaid/models/credit_relay_create_request.rb | Ruby | mit | 244 | master | 8,846 | =begin
#The Plaid API
#The Plaid REST API. Please see https://plaid.com/docs/api for more details.
The version of the OpenAPI document: 2020-09-14_1.688.6
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.3.0
=end
require 'date'
require 'time'
module Plaid
# CreditRelayCreateRequest defi... |
github | plaid/plaid-ruby | https://github.com/plaid/plaid-ruby | lib/plaid/models/base_report_average_monthly_balances.rb | Ruby | mit | 244 | master | 7,896 | =begin
#The Plaid API
#The Plaid REST API. Please see https://plaid.com/docs/api for more details.
The version of the OpenAPI document: 2020-09-14_1.688.6
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.3.0
=end
require 'date'
require 'time'
module Plaid
# Average balance in dollar amo... |
github | plaid/plaid-ruby | https://github.com/plaid/plaid-ruby | lib/plaid/models/sandbox_item_reset_login_response.rb | Ruby | mit | 244 | master | 7,433 | =begin
#The Plaid API
#The Plaid REST API. Please see https://plaid.com/docs/api for more details.
The version of the OpenAPI document: 2020-09-14_1.688.6
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.3.0
=end
require 'date'
require 'time'
module Plaid
# SandboxItemResetLoginResponse... |
github | plaid/plaid-ruby | https://github.com/plaid/plaid-ruby | lib/plaid/models/cashflow_report_monthly_summary_average_daily_inflow_amount.rb | Ruby | mit | 244 | master | 8,072 | =begin
#The Plaid API
#The Plaid REST API. Please see https://plaid.com/docs/api for more details.
The version of the OpenAPI document: 2020-09-14_1.688.6
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.3.0
=end
require 'date'
require 'time'
module Plaid
# The average daily sum of infl... |
github | plaid/plaid-ruby | https://github.com/plaid/plaid-ruby | lib/plaid/models/taxpayer_identifier_type.rb | Ruby | mit | 244 | master | 1,079 | =begin
#The Plaid API
#The Plaid REST API. Please see https://plaid.com/docs/api for more details.
The version of the OpenAPI document: 2020-09-14_1.688.6
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.3.0
=end
require 'date'
require 'time'
module Plaid
class TaxpayerIdentifierType
... |
github | plaid/plaid-ruby | https://github.com/plaid/plaid-ruby | lib/plaid/models/processor_account_get_request.rb | Ruby | mit | 244 | master | 7,773 | =begin
#The Plaid API
#The Plaid REST API. Please see https://plaid.com/docs/api for more details.
The version of the OpenAPI document: 2020-09-14_1.688.6
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.3.0
=end
require 'date'
require 'time'
module Plaid
# ProcessorAccountGetRequest de... |
github | plaid/plaid-ruby | https://github.com/plaid/plaid-ruby | lib/plaid/models/wallet_transaction.rb | Ruby | mit | 244 | master | 15,195 | =begin
#The Plaid API
#The Plaid REST API. Please see https://plaid.com/docs/api for more details.
The version of the OpenAPI document: 2020-09-14_1.688.6
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.3.0
=end
require 'date'
require 'time'
module Plaid
# The transaction details
cla... |
github | plaid/plaid-ruby | https://github.com/plaid/plaid-ruby | lib/plaid/models/transfer_intent_status.rb | Ruby | mit | 244 | master | 1,017 | =begin
#The Plaid API
#The Plaid REST API. Please see https://plaid.com/docs/api for more details.
The version of the OpenAPI document: 2020-09-14_1.688.6
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.3.0
=end
require 'date'
require 'time'
module Plaid
class TransferIntentStatus
... |
github | plaid/plaid-ruby | https://github.com/plaid/plaid-ruby | lib/plaid/models/transfer_platform_person_create_request.rb | Ruby | mit | 244 | master | 12,254 | =begin
#The Plaid API
#The Plaid REST API. Please see https://plaid.com/docs/api for more details.
The version of the OpenAPI document: 2020-09-14_1.688.6
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.3.0
=end
require 'date'
require 'time'
module Plaid
# Defines the request schema fo... |
github | plaid/plaid-ruby | https://github.com/plaid/plaid-ruby | lib/plaid/models/investment_account_subtype.rb | Ruby | mit | 244 | master | 2,969 | =begin
#The Plaid API
#The Plaid REST API. Please see https://plaid.com/docs/api for more details.
The version of the OpenAPI document: 2020-09-14_1.688.6
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.3.0
=end
require 'date'
require 'time'
module Plaid
class InvestmentAccountSubtype
... |
github | plaid/plaid-ruby | https://github.com/plaid/plaid-ruby | lib/plaid/models/bank_transfer_sweep.rb | Ruby | mit | 244 | master | 8,120 | =begin
#The Plaid API
#The Plaid REST API. Please see https://plaid.com/docs/api for more details.
The version of the OpenAPI document: 2020-09-14_1.688.6
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.3.0
=end
require 'date'
require 'time'
module Plaid
# BankTransferSweep describes a... |
github | plaid/plaid-ruby | https://github.com/plaid/plaid-ruby | lib/plaid/models/cra_bank_income_account.rb | Ruby | mit | 244 | master | 10,573 | =begin
#The Plaid API
#The Plaid REST API. Please see https://plaid.com/docs/api for more details.
The version of the OpenAPI document: 2020-09-14_1.688.6
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.3.0
=end
require 'date'
require 'time'
module Plaid
# The Item's bank accounts that... |
github | plaid/plaid-ruby | https://github.com/plaid/plaid-ruby | lib/plaid/models/asset_holding.rb | Ruby | mit | 244 | master | 13,570 | =begin
#The Plaid API
#The Plaid REST API. Please see https://plaid.com/docs/api for more details.
The version of the OpenAPI document: 2020-09-14_1.688.6
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.3.0
=end
require 'date'
require 'time'
module Plaid
# Documentation not found in th... |
github | plaid/plaid-ruby | https://github.com/plaid/plaid-ruby | lib/plaid/models/beacon_report_syndication_analysis.rb | Ruby | mit | 244 | master | 10,684 | =begin
#The Plaid API
#The Plaid REST API. Please see https://plaid.com/docs/api for more details.
The version of the OpenAPI document: 2020-09-14_1.688.6
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.3.0
=end
require 'date'
require 'time'
module Plaid
# Analysis of which fields matc... |
github | plaid/plaid-ruby | https://github.com/plaid/plaid-ruby | lib/plaid/models/cashflow_report_transactions_get_request.rb | Ruby | mit | 244 | master | 9,440 | =begin
#The Plaid API
#The Plaid REST API. Please see https://plaid.com/docs/api for more details.
The version of the OpenAPI document: 2020-09-14_1.688.6
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.3.0
=end
require 'date'
require 'time'
module Plaid
# CashflowReportTransactionsGet... |
github | plaid/plaid-ruby | https://github.com/plaid/plaid-ruby | lib/plaid/models/bank_transfer_migrate_account_request.rb | Ruby | mit | 244 | master | 9,197 | =begin
#The Plaid API
#The Plaid REST API. Please see https://plaid.com/docs/api for more details.
The version of the OpenAPI document: 2020-09-14_1.688.6
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.3.0
=end
require 'date'
require 'time'
module Plaid
# Defines the request schema fo... |
github | plaid/plaid-ruby | https://github.com/plaid/plaid-ruby | lib/plaid/models/income_verification_precheck_employer_address_data.rb | Ruby | mit | 244 | master | 7,874 | =begin
#The Plaid API
#The Plaid REST API. Please see https://plaid.com/docs/api for more details.
The version of the OpenAPI document: 2020-09-14_1.688.6
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.3.0
=end
require 'date'
require 'time'
module Plaid
# Data about the components com... |
github | plaid/plaid-ruby | https://github.com/plaid/plaid-ruby | lib/plaid/models/standalone_currency_code_list.rb | Ruby | mit | 244 | master | 7,575 | =begin
#The Plaid API
#The Plaid REST API. Please see https://plaid.com/docs/api for more details.
The version of the OpenAPI document: 2020-09-14_1.688.6
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.3.0
=end
require 'date'
require 'time'
module Plaid
# The following currency codes ... |
github | plaid/plaid-ruby | https://github.com/plaid/plaid-ruby | lib/plaid/models/cra_partner_insights_item_account_metadata.rb | Ruby | mit | 244 | master | 7,174 | =begin
#The Plaid API
#The Plaid REST API. Please see https://plaid.com/docs/api for more details.
The version of the OpenAPI document: 2020-09-14_1.688.6
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.3.0
=end
require 'date'
require 'time'
module Plaid
# An object containing metadata... |
github | plaid/plaid-ruby | https://github.com/plaid/plaid-ruby | lib/plaid/models/ytd_net_income_summary_field_number.rb | Ruby | mit | 244 | master | 7,990 | =begin
#The Plaid API
#The Plaid REST API. Please see https://plaid.com/docs/api for more details.
The version of the OpenAPI document: 2020-09-14_1.688.6
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.3.0
=end
require 'date'
require 'time'
module Plaid
# Year-to-date earnings after a... |
github | plaid/plaid-ruby | https://github.com/plaid/plaid-ruby | lib/plaid/models/credit_pay_stub_address.rb | Ruby | mit | 244 | master | 7,714 | =begin
#The Plaid API
#The Plaid REST API. Please see https://plaid.com/docs/api for more details.
The version of the OpenAPI document: 2020-09-14_1.688.6
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.3.0
=end
require 'date'
require 'time'
module Plaid
# Address on the pay stub.
cl... |
github | plaid/plaid-ruby | https://github.com/plaid/plaid-ruby | lib/plaid/models/screening_hit_names_items.rb | Ruby | mit | 244 | master | 6,784 | =begin
#The Plaid API
#The Plaid REST API. Please see https://plaid.com/docs/api for more details.
The version of the OpenAPI document: 2020-09-14_1.688.6
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.3.0
=end
require 'date'
require 'time'
module Plaid
# Analyzed name information for... |
github | plaid/plaid-ruby | https://github.com/plaid/plaid-ruby | lib/plaid/models/business_email_address.rb | Ruby | mit | 244 | master | 6,652 | =begin
#The Plaid API
#The Plaid REST API. Please see https://plaid.com/docs/api for more details.
The version of the OpenAPI document: 2020-09-14_1.688.6
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.3.0
=end
require 'date'
require 'time'
module Plaid
# Email address associated with... |
github | plaid/plaid-ruby | https://github.com/plaid/plaid-ruby | lib/plaid/models/wallet_transaction_amount.rb | Ruby | mit | 244 | master | 8,340 | =begin
#The Plaid API
#The Plaid REST API. Please see https://plaid.com/docs/api for more details.
The version of the OpenAPI document: 2020-09-14_1.688.6
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.3.0
=end
require 'date'
require 'time'
module Plaid
# The amount and currency of a ... |
github | plaid/plaid-ruby | https://github.com/plaid/plaid-ruby | lib/plaid/models/accounts_get_request.rb | Ruby | mit | 244 | master | 7,872 | =begin
#The Plaid API
#The Plaid REST API. Please see https://plaid.com/docs/api for more details.
The version of the OpenAPI document: 2020-09-14_1.688.6
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.3.0
=end
require 'date'
require 'time'
module Plaid
# AccountsGetRequest defines th... |
github | antulik/pagelet_rails | https://github.com/antulik/pagelet_rails | Rakefile | Ruby | mit | 244 | master | 707 | begin
require 'bundler/setup'
rescue LoadError
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
end
require 'rdoc/task'
RDoc::Task.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = 'PageletRails'
rdoc.options << '--line-numbers'
rdoc.rdoc_files.include('README.md')
... |
github | antulik/pagelet_rails | https://github.com/antulik/pagelet_rails | pagelet_rails.gemspec | Ruby | mit | 244 | master | 1,124 | # -*- encoding: utf-8 -*-
$:.push File.expand_path('../lib', __FILE__)
require 'pagelet_rails/version'
Gem::Specification.new do |s|
s.name = 'pagelet_rails'
s.version = PageletRails::VERSION
s.platform = Gem::Platform::RUBY
s.authors = ['Anton Katunin']
s.email = ['antulik@gmail.com'... |
github | antulik/pagelet_rails | https://github.com/antulik/pagelet_rails | Appraisals | Ruby | mit | 244 | master | 298 | RAILS_VERSIONS = %w(
4.2.9
5.0.5
5.1.3
)
RAILS_VERSIONS.each do |version|
appraise "rails_#{version}" do
gem 'rails', version
# http://stackoverflow.com/questions/43886586/minitest-plugin-rb9-getting-wrong-number-of-arguments
gem 'minitest', '= 5.10.1', '!= 5.10.2'
end
end |
github | antulik/pagelet_rails | https://github.com/antulik/pagelet_rails | test/test_helper.rb | Ruby | mit | 244 | master | 995 | require 'simplecov'
SimpleCov.start do
add_filter do |source_file|
source_file.filename.to_s.include?('test')
end
end
# Configure Rails Environment
ENV["RAILS_ENV"] = "test"
require File.expand_path("../../test/dummy/config/environment.rb", __FILE__)
ActiveRecord::Migrator.migrations_paths = [File.expand_pat... |
github | antulik/pagelet_rails | https://github.com/antulik/pagelet_rails | test/dummy/config/application.rb | Ruby | mit | 244 | master | 393 | require_relative 'boot'
require 'rails/all'
Bundler.require(*Rails.groups)
require "pagelet_rails"
module Dummy
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
#... |
github | antulik/pagelet_rails | https://github.com/antulik/pagelet_rails | test/dummy/config/routes.rb | Ruby | mit | 244 | master | 212 | Rails.application.routes.draw do
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
resources :dyno, only: [:show]
resources :streaming, only: [:show]
end |
github | antulik/pagelet_rails | https://github.com/antulik/pagelet_rails | test/dummy/config/environments/test.rb | Ruby | mit | 244 | master | 1,913 | 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... |
github | antulik/pagelet_rails | https://github.com/antulik/pagelet_rails | test/dummy/config/initializers/new_framework_defaults.rb | Ruby | mit | 244 | master | 1,223 | # Be sure to restart your server when you modify this file.
#
# This file contains migration options to ease your Rails 5.0 upgrade.
#
# Read the Rails 5.0 release notes for more info on each option.
if Rails.gem_version >= Gem::Version.new('5')
# Enable per-form CSRF tokens. Previous versions had false.
Rails.ap... |
github | antulik/pagelet_rails | https://github.com/antulik/pagelet_rails | test/integration/dyno_test.rb | Ruby | mit | 244 | master | 338 | require 'test_helper'
class DynoTest < ActionDispatch::IntegrationTest
test "static text" do
get "/dyno/static_text"
assert_response :success
assert_select 'div', 'Static text'
end
test 'params example' do
get "/dyno/params_example"
assert_response :success
assert_select 'div', 'col... |
github | antulik/pagelet_rails | https://github.com/antulik/pagelet_rails | test/lib/options_test.rb | Ruby | mit | 244 | master | 1,389 | require 'test_helper'
class PageletRails::OptionsTest < ActiveSupport::TestCase
class A < ActionController::Base
include PageletRails::Concerns::Options
pagelet_options one: 1, deep_merge: { a: 'a1' }
end
class B < A
pagelet_options deep_merge: { b: 'b1' }
end
class C < B
pagelet_options ... |
github | antulik/pagelet_rails | https://github.com/antulik/pagelet_rails | test/benchmarks/ssi_benchmark.rb | Ruby | mit | 244 | master | 791 | require 'active_support/all'
require 'csv'
require 'pp'
root_url = 'http://local.dev/dyno/benchmark.html'
delays = [0, 10, 20, 30, 50, 100, 200]
sizes = (1..10).to_a
modes = ['inline']
rows = []
sizes.map do |size|
delays.each do |delay|
r = []
r << size
r << delay
modes.each do |mode|
para... |
github | antulik/pagelet_rails | https://github.com/antulik/pagelet_rails | lib/pagelet_rails.rb | Ruby | mit | 244 | master | 507 | require "pagelet_rails/engine"
require "pagelet_rails/version"
require "action_controller/action_caching"
module PageletRails
extend ActiveSupport::Autoload
eager_autoload do
autoload :Encryptor
autoload :Router
end
module Concerns
extend ActiveSupport::Autoload
eager_autoload do
aut... |
github | antulik/pagelet_rails | https://github.com/antulik/pagelet_rails | lib/pagelet_rails/router.rb | Ruby | mit | 244 | master | 665 | class PageletRails::Router
def self.load_routes! context
controllers = Dir[Rails.root.join('app', 'pagelets', '*', '*controller.rb')]
controllers.each do |controller_file|
pagelet_name = File.basename(File.dirname(controller_file))
basename_controller_name = File.basename controller_file, '.rb'... |
github | antulik/pagelet_rails | https://github.com/antulik/pagelet_rails | lib/pagelet_rails/encryptor.rb | Ruby | mit | 244 | master | 974 | class PageletRails::Encryptor
DEFAULT_SALT = '!@#Q156^tdSXggT0&*789++8&?_|T%\/++==RqE'
attr_reader :salt
def self.encode(data, opts = {})
self.new(opts).encode data
end
def self.decode(encrypted_data, opts = {})
self.new(opts).decode encrypted_data
end
def self.get_key secret, salt
@get_k... |
github | antulik/pagelet_rails | https://github.com/antulik/pagelet_rails | lib/pagelet_rails/concerns/tags.rb | Ruby | mit | 244 | master | 440 | module PageletRails::Concerns::Tags
extend ActiveSupport::Concern
included do
helper_method :identified_by
helper_method :trigger_change
end
def trigger_change tag = nil
@trigger_change ||= []
if tag.present?
@trigger_change << tag
end
@trigger_change
end
def identified_by t... |
github | antulik/pagelet_rails | https://github.com/antulik/pagelet_rails | lib/pagelet_rails/concerns/routes.rb | Ruby | mit | 244 | master | 1,045 | module PageletRails::Concerns::Routes
extend ActiveSupport::Concern
included do
@pagelet_routes = []
end
module ClassMethods
# Define routes inline in controller
#
# pagelet_routes do
# resources :users
# end
#
def pagelet_routes &block
@pagelet_routes << bl... |
github | antulik/pagelet_rails | https://github.com/antulik/pagelet_rails | lib/pagelet_rails/concerns/controller.rb | Ruby | mit | 244 | master | 2,994 | module PageletRails::Concerns::Controller
extend ActiveSupport::Concern
included do
# order is important
include PageletRails::Concerns::ResponseWrapper
include PageletRails::Concerns::Routes
include PageletRails::Concerns::Options
include PageletRails::Concerns::Cache
include PageletRails:... |
github | antulik/pagelet_rails | https://github.com/antulik/pagelet_rails | lib/pagelet_rails/concerns/cache.rb | Ruby | mit | 244 | master | 1,755 | module PageletRails::Concerns::Cache
extend ActiveSupport::Concern
included do
include ActionController::Caching::Actions
pagelet_options cache_defaults: {
expires_in: 5.seconds,
cache_path: {}
}
around_action :pagelet_cache
end
def pagelet_cache &block
# puts 'pagelet_cache'... |
github | antulik/pagelet_rails | https://github.com/antulik/pagelet_rails | lib/pagelet_rails/concerns/placeholder.rb | Ruby | mit | 244 | master | 1,133 | module PageletRails::Concerns::Placeholder
extend ActiveSupport::Concern
# This concern should be called after cache callback
# #process_action method does not give such order
# as it's called before callbacks
def send_action *args
render_remote_load
if !performed?
super
end
end
def re... |
github | antulik/pagelet_rails | https://github.com/antulik/pagelet_rails | lib/pagelet_rails/concerns/options.rb | Ruby | mit | 244 | master | 1,851 | module PageletRails::Concerns::Options
extend ActiveSupport::Concern
included do
include Shared
helper_method :pagelet_options
end
def pagelet_options *args
set_pagelet_options(*args)
opts = self.class.pagelet_options
class_default_opts = opts.fetch('default', {})
class_action_opts =... |
github | antulik/pagelet_rails | https://github.com/antulik/pagelet_rails | lib/pagelet_rails/concerns/response_wrapper.rb | Ruby | mit | 244 | master | 927 | module PageletRails::Concerns::ResponseWrapper
extend ActiveSupport::Concern
def process_action *args
super.tap do
if params[:target_container] &&
action_has_layout? &&
request.format.js? # wrap to js only if requested js
response.content_type = 'text/javascript'
html = ... |
github | antulik/pagelet_rails | https://github.com/antulik/pagelet_rails | lib/action_controller/action_caching.rb | Ruby | mit | 244 | master | 349 | # Cloned from https://github.com/rails/actionpack-action_caching
# as it does not support rails 5 yet
require 'action_controller/caching/actions'
module ActionController
module Caching
eager_autoload do
autoload :Actions
end
include Actions
end
end
ActionController::Base.send(:include, ActionC... |
github | antulik/pagelet_rails | https://github.com/antulik/pagelet_rails | lib/action_controller/caching/actions.rb | Ruby | mit | 244 | master | 8,059 | require 'set'
module ActionController
module Caching
# Action caching is similar to page caching by the fact that the entire
# output of the response is cached, but unlike page caching, every
# request still goes through Action Pack. The key benefit of this is
# that filters run before the cache is s... |
github | antulik/pagelet_rails | https://github.com/antulik/pagelet_rails | app/controllers/pagelet_proxy_controller.rb | Ruby | mit | 244 | master | 428 | class PageletProxyController < ::ApplicationController
include ActionController::Live
include PageletsHelper
def show
@urls = params[:urls]
response.headers['Content-Type'] = 'text/javascript'
response.stream.write "\n"
@urls.each do |url|
response.stream.write pagelet(url, skip_parent_p... |
github | antulik/pagelet_rails | https://github.com/antulik/pagelet_rails | app/helpers/pagelets_helper.rb | Ruby | mit | 244 | master | 3,638 | module PageletsHelper
def html_container_attributes
html_opts = pagelet_options.html.deep_dup || {}
classes = html_opts.fetch(:class, '').split(' ')
classes << "pagelet-#{controller_name}"
classes << "pagelet-#{controller_name}-#{action_name}"
html_opts[:id] ||= pagelet_default_id
html_opts[... |
github | jonhue/notifications-rails | https://github.com/jonhue/notifications-rails | notifications-rails.gemspec | Ruby | mit | 244 | main | 1,499 | # frozen_string_literal: true
version = File.read(File.expand_path('VERSION', __dir__)).strip
Gem::Specification.new do |gem|
gem.name = 'notifications-rails'
gem.version = version
gem.platform = Gem::Platform::RUBY
gem.summary = 'The most powerful lib... |
github | jonhue/notifications-rails | https://github.com/jonhue/notifications-rails | spec/notification_settings_spec.rb | Ruby | mit | 244 | main | 2,369 | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe NotificationSettings do
let(:notification) { build_stubbed(:notification, category: :my_category) }
let(:settings) { notification.target.settings }
describe 'global pusher settings' do
it 'is enabled by default' do
expect(setting... |
github | jonhue/notifications-rails | https://github.com/jonhue/notifications-rails | spec/rails_helper.rb | Ruby | mit | 244 | main | 485 | # frozen_string_literal: true
require 'rails/all'
require 'factory_bot'
require 'rspec/rails'
ENV['RAILS_ENV'] = 'test'
require_relative 'support/rails_app/config/environment'
ActiveRecord::Migration.maintain_test_schema!
ActiveRecord::Schema.verbose = false
require_relative 'support/rails_app/db/schema'
require_r... |
github | jonhue/notifications-rails | https://github.com/jonhue/notifications-rails | spec/support/rails_app/Gemfile | Ruby | mit | 244 | main | 2,240 | # frozen_string_literal: true
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '3.0.0'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 7.1.4'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use Puma as the app server
g... |
github | jonhue/notifications-rails | https://github.com/jonhue/notifications-rails | spec/support/rails_app/db/schema.rb | Ruby | mit | 244 | main | 2,094 | # 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 source for your
# dat... |
github | jonhue/notifications-rails | https://github.com/jonhue/notifications-rails | spec/support/rails_app/db/migrate/20190507174115_notification_handler_migration.rb | Ruby | mit | 244 | main | 394 | # frozen_string_literal: true
class NotificationHandlerMigration < ActiveRecord::Migration[5.2]
def change
create_table :notifications do |t|
t.references :target, polymorphic: true, index: true
t.references :object, polymorphic: true, index: true
t.boolean :read, default: false, null: false, ... |
github | jonhue/notifications-rails | https://github.com/jonhue/notifications-rails | spec/support/rails_app/db/migrate/20190507175111_notification_settings_migration.rb | Ruby | mit | 244 | main | 847 | # frozen_string_literal: true
class NotificationSettingsMigration < ActiveRecord::Migration[5.2]
# rubocop:disable Metrics/MethodLength
def change
add_column :notifications, :subscription_id, :bigint, index: true
add_column :notifications, :category, :string, index: true
create_table :notification_set... |
github | jonhue/notifications-rails | https://github.com/jonhue/notifications-rails | spec/support/rails_app/db/migrate/20190507202305_create_users.rb | Ruby | mit | 244 | main | 212 | # frozen_string_literal: true
class CreateUsers < ActiveRecord::Migration[5.2]
def change
create_table :users do |t|
t.string :name
t.string :status
t.string :settings
end
end
end |
github | jonhue/notifications-rails | https://github.com/jonhue/notifications-rails | spec/support/rails_app/config/application.rb | Ruby | mit | 244 | main | 550 | # frozen_string_literal: true
require_relative 'boot'
require 'rails/all'
module RailsApp
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 5.2
# Settings in config/environments/* take precedence over those specified... |
github | jonhue/notifications-rails | https://github.com/jonhue/notifications-rails | spec/support/rails_app/config/environment.rb | Ruby | mit | 244 | main | 470 | # frozen_string_literal: true
# Load the Rails application.
require_relative 'application'
require_relative '../../../../notification-handler/lib/notification-handler'
require_relative '../../../../notification-pusher/lib/notification-pusher'
require_relative '../../../../notification-renderer/lib/notification-render... |
github | jonhue/notifications-rails | https://github.com/jonhue/notifications-rails | spec/support/rails_app/config/initializers/notification_renderer.rb | Ruby | mit | 244 | main | 368 | # frozen_string_literal: true
NotificationRenderer.configure do |config|
# Choose your default notification type. Takes a string.
# config.default_type = 'notification'
# Choose your default renderer. Takes a string.
# config.default_renderer = 'index'
# Automatically mark rendered notifications as read. T... |
github | jonhue/notifications-rails | https://github.com/jonhue/notifications-rails | spec/support/rails_app/config/initializers/notification_pusher.rb | Ruby | mit | 244 | main | 564 | # frozen_string_literal: true
require 'notification_pusher/delivery_method/null'
require 'notification_pusher/delivery_method/some_pusher'
NotificationPusher.configure do |config|
# A delivery method handles the process of sending your notifications to
# various services for you.
# Learn more: https://github.co... |
github | jonhue/notifications-rails | https://github.com/jonhue/notifications-rails | spec/support/rails_app/config/initializers/notification_handler.rb | Ruby | mit | 244 | main | 584 | # frozen_string_literal: true
NotificationHandler.configure do |config|
# Cache amount of unread and read notifications for notification targets.
# Learn more: https://github.com/jonhue/notifications-rails/tree/master/notification-handler#caching
# config.cache = false
# Groups are a powerful way to bulk-crea... |
github | jonhue/notifications-rails | https://github.com/jonhue/notifications-rails | spec/support/rails_app/config/initializers/notification_settings.rb | Ruby | mit | 244 | main | 1,281 | # frozen_string_literal: true
NotificationSettings.configure do |config|
# An array of all notification categories. Takes an array of symbols.
config.categories = [:notification, :my_category]
# Choose your default notification category. Takes a symbol.
# config.default_category = :notification
### STATUS ... |
github | jonhue/notifications-rails | https://github.com/jonhue/notifications-rails | spec/support/rails_app/config/environments/development.rb | Ruby | mit | 244 | main | 2,228 | # frozen_string_literal: true
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... |
github | jonhue/notifications-rails | https://github.com/jonhue/notifications-rails | notification-pusher/notification-pusher.gemspec | Ruby | mit | 244 | main | 1,074 | # frozen_string_literal: true
version = File.read(File.expand_path('../VERSION', __dir__)).strip
Gem::Specification.new do |gem|
gem.name = 'notification-pusher'
gem.version = version
gem.platform = Gem::Platform::RUBY
gem.summary = 'Deliver your notif... |
github | jonhue/notifications-rails | https://github.com/jonhue/notifications-rails | notification-pusher/lib/notification-pusher.rb | Ruby | mit | 244 | main | 352 | # frozen_string_literal: true
module NotificationPusher
require_relative 'notification_pusher/configuration'
require_relative 'notification_pusher/delivery_method/base'
autoload :DeliveryMethodConfiguration,
'notification_pusher/delivery_method_configuration'
autoload :NotificationLib, 'notificati... |
github | jonhue/notifications-rails | https://github.com/jonhue/notifications-rails | notification-pusher/lib/generators/templates/install/initializer.rb | Ruby | mit | 244 | main | 373 | # frozen_string_literal: true
NotificationPusher.configure do |config|
# A delivery method handles the process of sending your notifications to
# various services for you.
# Learn more: https://github.com/jonhue/notifications-rails/tree/master/notification-pusher#delivery-methods
# config.register_delivery_met... |
github | jonhue/notifications-rails | https://github.com/jonhue/notifications-rails | notification-pusher/lib/generators/notification_pusher/install_generator.rb | Ruby | mit | 244 | main | 373 | # frozen_string_literal: true
require 'rails/generators'
module NotificationPusher
class InstallGenerator < Rails::Generators::Base
source_root(File.join(File.dirname(__FILE__), '../templates/install'))
desc 'Install NotificationPusher'
def create_initializer
template 'initializer.rb', 'config/in... |
github | jonhue/notifications-rails | https://github.com/jonhue/notifications-rails | notification-pusher/lib/notification_pusher/delivery_method_configuration.rb | Ruby | mit | 244 | main | 800 | # frozen_string_literal: true
module NotificationPusher
class DeliveryMethodConfiguration
def initialize(class_name, options = {})
@klass = NotificationPusher::DeliveryMethod.const_get(class_name)
@options = options
end
def call(notification, options = {})
options = @options.merge!(opt... |
github | jonhue/notifications-rails | https://github.com/jonhue/notifications-rails | notification-pusher/lib/notification_pusher/configuration.rb | Ruby | mit | 244 | main | 616 | # frozen_string_literal: true
require_relative 'delivery_method_configuration'
module NotificationPusher
class << self
attr_writer :configuration
def configuration
@configuration ||= Configuration.new
end
end
def self.configure
yield configuration
end
class Configuration
attr_ac... |
github | jonhue/notifications-rails | https://github.com/jonhue/notifications-rails | notification-pusher/lib/notification_pusher/notification_lib.rb | Ruby | mit | 244 | main | 1,320 | # frozen_string_literal: true
require 'notification-handler'
require 'active_support'
module NotificationPusher
module NotificationLib
extend ActiveSupport::Concern
included do
attr_accessor :delivery_method
attr_accessor :delivery_options
after_create_commit :deliver_after_create_commit... |
github | jonhue/notifications-rails | https://github.com/jonhue/notifications-rails | notification-pusher/lib/notification_pusher/delivery_method/base.rb | Ruby | mit | 244 | main | 415 | # frozen_string_literal: true
module NotificationPusher
module DeliveryMethod
class Base
attr_reader :notification, :options
def initialize(notification, options = {})
@notification = notification
@options = options
end
def call
raise NotImplementedError,
... |
github | jonhue/notifications-rails | https://github.com/jonhue/notifications-rails | notification-pusher/notification-pusher-onesignal/notification-pusher-onesignal.gemspec | Ruby | mit | 244 | main | 1,300 | # frozen_string_literal: true
version = File.read(File.expand_path('../../VERSION', __dir__)).strip
Gem::Specification.new do |gem|
gem.name = 'notification-pusher-onesignal'
gem.version = version
gem.platform = Gem::Platform::RUBY
gem.summary = 'A del... |
github | jonhue/notifications-rails | https://github.com/jonhue/notifications-rails | notification-pusher/notification-pusher-onesignal/lib/notification_pusher/delivery_method/one_signal.rb | Ruby | mit | 244 | main | 1,019 | # frozen_string_literal: true
module NotificationPusher
module DeliveryMethod
class OneSignal < NotificationPusher::DeliveryMethod::Base
def call
return unless options[:player_ids].any?
::OneSignal::Notification.create params: {
app_id: options[:app_id],
url: url_param,... |
github | jonhue/notifications-rails | https://github.com/jonhue/notifications-rails | notification-pusher/notification-pusher-onesignal/spec/lib/notification_pusher/delivery_method/one_signal_spec.rb | Ruby | mit | 244 | main | 377 | # frozen_string_literal: true
require_relative '../../../../../../spec/spec_helper'
require_relative '../../../../../lib/notification_pusher/delivery_method/base'
require_relative '../../../../lib/notification_pusher/delivery_method/' \
'one_signal'
RSpec.describe NotificationPusher::DeliveryMethod::... |
github | jonhue/notifications-rails | https://github.com/jonhue/notifications-rails | notification-pusher/notification-pusher-actionmailer/notification-pusher-actionmailer.gemspec | Ruby | mit | 244 | main | 1,368 | # frozen_string_literal: true
version = File.read(File.expand_path('../../VERSION', __dir__)).strip
Gem::Specification.new do |gem|
gem.name = 'notification-pusher-actionmailer'
gem.version = version
gem.platform = Gem::Platform::RUBY
gem.summary = 'A ... |
github | jonhue/notifications-rails | https://github.com/jonhue/notifications-rails | notification-pusher/notification-pusher-actionmailer/app/mailers/notification_pusher/action_mailer/notification_mailer.rb | Ruby | mit | 244 | main | 612 | # frozen_string_literal: true
module NotificationPusher
class ActionMailer
class NotificationMailer < ApplicationMailer
# rubocop:disable Metrics/ParameterLists
def push(notification,
from:, to: nil, renderer: 'actionmailer', layout: nil,
mail_options: {})
render... |
github | jonhue/notifications-rails | https://github.com/jonhue/notifications-rails | notification-pusher/notification-pusher-actionmailer/spec/lib/notification_pusher/delivery_method/action_mailer_spec.rb | Ruby | mit | 244 | main | 383 | # frozen_string_literal: true
require_relative '../../../../../../spec/spec_helper'
require_relative '../../../../../lib/notification_pusher/delivery_method/base'
require_relative '../../../../lib/notification_pusher/delivery_method/' \
'action_mailer'
RSpec.describe NotificationPusher::DeliveryMetho... |
github | jonhue/notifications-rails | https://github.com/jonhue/notifications-rails | notification-pusher/notification-pusher-actionmailer/lib/notification_pusher/delivery_method/action_mailer.rb | Ruby | mit | 244 | main | 958 | # frozen_string_literal: true
module NotificationPusher
module DeliveryMethod
class ActionMailer < NotificationPusher::DeliveryMethod::Base
require_relative 'action_mailer/engine'
DEFAULT_MAILER_ACTION = :push
DEFAULT_DELIVER_METHOD = :deliver
def call
mailer_class.send(mailer_a... |
github | jonhue/notifications-rails | https://github.com/jonhue/notifications-rails | notification-pusher/spec/notification_pusher_general_spec.rb | Ruby | mit | 244 | main | 565 | # frozen_string_literal: true
require_relative 'rails_helper'
RSpec.describe NotificationPusher do
describe 'baseline' do
it 'only loaded the absolute minimum dependencies ' \
'so we can test in isolation' do
expect(defined?(NotificationHandler)).to eq 'constant'
# rubocop:disable RSpec/Desc... |
github | jonhue/notifications-rails | https://github.com/jonhue/notifications-rails | notification-pusher/spec/rails_helper.rb | Ruby | mit | 244 | main | 550 | # frozen_string_literal: true
require 'rails/all'
require 'factory_bot'
require 'rspec/rails'
ENV['RAILS_ENV'] = 'test'
require_relative 'support/rails_app/config/environment'
ActiveRecord::Migration.maintain_test_schema!
ActiveRecord::Schema.verbose = false
require_relative 'support/rails_app/db/schema'
require_r... |
github | jonhue/notifications-rails | https://github.com/jonhue/notifications-rails | notification-pusher/spec/lib/notification_pusher/configuration_spec.rb | Ruby | mit | 244 | main | 839 | # frozen_string_literal: true
require_relative '../../../../spec/spec_helper'
require_relative '../../../lib/notification_pusher/configuration'
require_relative '../../../lib/notification_pusher/' \
'delivery_method_configuration'
module NotificationPusher
module DeliveryMethod
class CustomPush... |
github | jonhue/notifications-rails | https://github.com/jonhue/notifications-rails | notification-pusher/spec/lib/notification_pusher/notification_lib_spec.rb | Ruby | mit | 244 | main | 5,820 | # frozen_string_literal: true
require_relative '../../rails_helper'
RSpec.describe NotificationPusher::NotificationLib do
let(:some_pusher) do
instance_double(NotificationPusher::DeliveryMethodConfiguration)
end
let(:other_pusher) do
instance_double(NotificationPusher::DeliveryMethodConfiguration)
end... |
github | jonhue/notifications-rails | https://github.com/jonhue/notifications-rails | notification-pusher/spec/support/rails_app/config/environment.rb | Ruby | mit | 244 | main | 295 | # frozen_string_literal: true
# Load the Rails application.
require_relative 'application'
require_relative '../../../../../notification-handler/lib/notification-handler'
require_relative '../../../../lib/notification-pusher'
# Initialize the Rails application.
Rails.application.initialize! |
github | jonhue/notifications-rails | https://github.com/jonhue/notifications-rails | notification-pusher/spec/support/rails_app/db/schema.rb | Ruby | mit | 244 | main | 1,495 | # 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 source for your
# dat... |
github | jonhue/notifications-rails | https://github.com/jonhue/notifications-rails | notification-pusher/spec/support/rails_app/db/migrate/20190507202305_create_users.rb | Ruby | mit | 244 | main | 220 | # frozen_string_literal: true
class CreateUsers < ActiveRecord::Migration[5.2]
def change
create_table :users do |t|
t.string :name
t.boolean :subscriber, null: false, default: false
end
end
end |
github | jonhue/notifications-rails | https://github.com/jonhue/notifications-rails | notification-handler/notification-handler.gemspec | Ruby | mit | 244 | main | 1,249 | # frozen_string_literal: true
version = File.read(File.expand_path('../VERSION', __dir__)).strip
Gem::Specification.new do |gem|
gem.name = 'notification-handler'
gem.version = version
gem.platform = Gem::Platform::RUBY
gem.summary = 'Create and modify... |
github | jonhue/notifications-rails | https://github.com/jonhue/notifications-rails | notification-handler/spec/notification_handler_general_spec.rb | Ruby | mit | 244 | main | 559 | # frozen_string_literal: true
require_relative 'rails_helper'
RSpec.describe NotificationHandler do
describe 'baseline' do
it 'only loaded the absolute minimum dependencies ' \
'so we can test in isolation' do
# rubocop:disable RSpec/DescribedClass
expect(defined?(NotificationHandler)).to eq... |
github | jonhue/notifications-rails | https://github.com/jonhue/notifications-rails | notification-handler/spec/rails_helper.rb | Ruby | mit | 244 | main | 591 | # frozen_string_literal: true
require 'rails/all'
require 'factory_bot'
require 'rspec/rails'
ENV['RAILS_ENV'] = 'test'
require_relative 'support/rails_app/config/environment'
ActiveRecord::Migration.maintain_test_schema!
ActiveRecord::Schema.verbose = false
require_relative 'support/rails_app/db/schema'
require_r... |
github | jonhue/notifications-rails | https://github.com/jonhue/notifications-rails | notification-handler/spec/support/rails_app/db/schema.rb | Ruby | mit | 244 | main | 1,571 | # 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 source for your
# dat... |
github | jonhue/notifications-rails | https://github.com/jonhue/notifications-rails | notification-handler/spec/support/rails_app/config/environment.rb | Ruby | mit | 244 | main | 216 | # frozen_string_literal: true
# Load the Rails application.
require_relative 'application'
require_relative '../../../../lib/notification-handler'
# Initialize the Rails application.
Rails.application.initialize! |
github | jonhue/notifications-rails | https://github.com/jonhue/notifications-rails | notification-handler/spec/support/rails_app/config/initializers/notification_handler.rb | Ruby | mit | 244 | main | 993 | # frozen_string_literal: true
NotificationHandler.configure do |config|
# Cache amount of unread and read notifications for notification targets.
# Learn more: https://github.com/jonhue/notifications-rails/tree/master/notification-handler#caching
# config.cache = false
# Groups are a powerful way to bulk-crea... |
github | jonhue/notifications-rails | https://github.com/jonhue/notifications-rails | notification-handler/spec/lib/notification_handler/configuration_spec.rb | Ruby | mit | 244 | main | 669 | # frozen_string_literal: true
require_relative '../../../../spec/spec_helper'
require_relative '../../../lib/notification_handler/configuration'
require_relative '../../../lib/notification_handler/group'
RSpec.describe NotificationHandler::Configuration do
let(:configuration) { NotificationHandler.configuration }
... |
github | jonhue/notifications-rails | https://github.com/jonhue/notifications-rails | notification-handler/spec/lib/notification_handler/notification_lib_spec.rb | Ruby | mit | 244 | main | 2,197 | # frozen_string_literal: true
require_relative '../../rails_helper'
RSpec.describe NotificationHandler::NotificationLib do
let(:recipe) { build_stubbed(:recipe) }
let(:user) { build_stubbed(:user) }
it 'can store an object' do
notification = create(:notification, target: user, object: recipe)
expect... |
github | jonhue/notifications-rails | https://github.com/jonhue/notifications-rails | notification-handler/spec/lib/notification_handler/target_spec.rb | Ruby | mit | 244 | main | 525 | # frozen_string_literal: true
require_relative '../../rails_helper'
RSpec.describe NotificationHandler::Target do
let(:user) { build_stubbed(:user) }
describe '#notify' do
it 'returns the notification' do
expect(user.notify).to be_a Notification
end
it 'creates a Notification record' do
... |
github | jonhue/notifications-rails | https://github.com/jonhue/notifications-rails | notification-handler/lib/notification-handler.rb | Ruby | mit | 244 | main | 462 | # frozen_string_literal: true
module NotificationHandler
require_relative 'notification_handler/configuration'
require_relative 'notification_handler/engine'
autoload :Group, 'notification_handler/group'
autoload :Target, 'notification_handler/target'
autoload :Object, 'notification_handler/object'
auto... |
github | jonhue/notifications-rails | https://github.com/jonhue/notifications-rails | notification-handler/lib/notification_handler/engine.rb | Ruby | mit | 244 | main | 357 | # frozen_string_literal: true
require 'rails/engine'
require 'active_record'
module NotificationHandler
class Engine < ::Rails::Engine
initializer 'notification-handler.active_record' do
ActiveSupport.on_load :active_record do
include NotificationHandler::Target
include NotificationHandler... |
github | jonhue/notifications-rails | https://github.com/jonhue/notifications-rails | notification-handler/lib/notification_handler/notification_lib.rb | Ruby | mit | 244 | main | 1,457 | # frozen_string_literal: true
require 'active_support'
module NotificationHandler
module NotificationLib
extend ActiveSupport::Concern
included do
self.inheritance_column = :_type_disabled
after_commit :cache
serialize :metadata, Hash
belongs_to :target, polymorphic: true
b... |
github | jonhue/notifications-rails | https://github.com/jonhue/notifications-rails | notification-handler/lib/notification_handler/group.rb | Ruby | mit | 244 | main | 525 | # frozen_string_literal: true
module NotificationHandler
class Group
attr_reader :target_scope
def initialize(target_scope)
@target_scope = target_scope
end
def self.find_by_name(name)
NotificationHandler.configuration.groups[name]
end
def self.find_by_name!(name)
find_by... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.