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
stimulusreflex/stimulus_reflex
https://github.com/stimulusreflex/stimulus_reflex/blob/a0ef193c770d849856ebee420a7135f082a7c31c/lib/stimulus_reflex/element.rb
lib/stimulus_reflex/element.rb
# frozen_string_literal: true require "stimulus_reflex/dataset" require "stimulus_reflex/utils/attribute_builder" class StimulusReflex::Element < OpenStruct include StimulusReflex::AttributeBuilder attr_reader :attrs, :dataset alias_method :data_attributes, :dataset delegate :signed, :unsigned, :numeric, :...
ruby
MIT
a0ef193c770d849856ebee420a7135f082a7c31c
2026-01-04T15:56:28.761250Z
false
stimulusreflex/stimulus_reflex
https://github.com/stimulusreflex/stimulus_reflex/blob/a0ef193c770d849856ebee420a7135f082a7c31c/lib/stimulus_reflex/version.rb
lib/stimulus_reflex/version.rb
# frozen_string_literal: true module StimulusReflex VERSION = "3.5.5" end
ruby
MIT
a0ef193c770d849856ebee420a7135f082a7c31c
2026-01-04T15:56:28.761250Z
false
stimulusreflex/stimulus_reflex
https://github.com/stimulusreflex/stimulus_reflex/blob/a0ef193c770d849856ebee420a7135f082a7c31c/lib/stimulus_reflex/reflex_data.rb
lib/stimulus_reflex/reflex_data.rb
# frozen_string_literal: true class StimulusReflex::ReflexData attr_reader :data def initialize(data) @data = data.deep_merge(data.deep_transform_keys { |k| k.to_s.underscore }).with_indifferent_access end def reflex_name reflex_name = target.split("#").first reflex_name = reflex_name.camelize ...
ruby
MIT
a0ef193c770d849856ebee420a7135f082a7c31c
2026-01-04T15:56:28.761250Z
false
stimulusreflex/stimulus_reflex
https://github.com/stimulusreflex/stimulus_reflex/blob/a0ef193c770d849856ebee420a7135f082a7c31c/lib/stimulus_reflex/open_struct_fix.rb
lib/stimulus_reflex/open_struct_fix.rb
# frozen_string_literal: true # # Temporary fix until this PR gets merged: # https://github.com/ruby/ostruct/pull/37 # Thanks to @Laykou # # Calling this in OpenStruct 0.5.2 fails: # os = OpenStruct.new(class: "my-class", method: "post") if defined?(OpenStruct::VERSION) && OpenStruct::VERSION == "0.5.2" class OpenS...
ruby
MIT
a0ef193c770d849856ebee420a7135f082a7c31c
2026-01-04T15:56:28.761250Z
false
stimulusreflex/stimulus_reflex
https://github.com/stimulusreflex/stimulus_reflex/blob/a0ef193c770d849856ebee420a7135f082a7c31c/lib/stimulus_reflex/request_parameters.rb
lib/stimulus_reflex/request_parameters.rb
# frozen_string_literal: true module StimulusReflex class RequestParameters def initialize(params:, req:, url:) @params = params @req = req @url = url end def apply! path_params = Rails.application.routes.recognize_path_with_request(@req, @url, @req.env[:extras] || {}) path...
ruby
MIT
a0ef193c770d849856ebee420a7135f082a7c31c
2026-01-04T15:56:28.761250Z
false
stimulusreflex/stimulus_reflex
https://github.com/stimulusreflex/stimulus_reflex/blob/a0ef193c770d849856ebee420a7135f082a7c31c/lib/stimulus_reflex/callbacks.rb
lib/stimulus_reflex/callbacks.rb
# frozen_string_literal: true require "active_support/concern" module StimulusReflex module Callbacks extend ActiveSupport::Concern included do include ActiveSupport::Callbacks define_callbacks :process, skip_after_callbacks_if_terminated: true, terminator: ->(target, result_lambda) do ...
ruby
MIT
a0ef193c770d849856ebee420a7135f082a7c31c
2026-01-04T15:56:28.761250Z
false
stimulusreflex/stimulus_reflex
https://github.com/stimulusreflex/stimulus_reflex/blob/a0ef193c770d849856ebee420a7135f082a7c31c/lib/stimulus_reflex/cable_readiness.rb
lib/stimulus_reflex/cable_readiness.rb
# frozen_string_literal: true module StimulusReflex module CableReadiness attr_reader :cable_ready def initialize(*args, **kwargs) super(*args, **kwargs) if is_a? CableReady::Broadcaster message = <<~MSG #{self.class.name} includes CableReady::Broadcaster, and you need to rem...
ruby
MIT
a0ef193c770d849856ebee420a7135f082a7c31c
2026-01-04T15:56:28.761250Z
false
stimulusreflex/stimulus_reflex
https://github.com/stimulusreflex/stimulus_reflex/blob/a0ef193c770d849856ebee420a7135f082a7c31c/lib/stimulus_reflex/importmap.rb
lib/stimulus_reflex/importmap.rb
# frozen_string_literal: true pin "@rails/actioncable", to: "actioncable.esm.js", preload: true pin "@hotwired/stimulus", to: "stimulus.js", preload: true pin "morphdom", to: "https://ga.jspm.io/npm:morphdom@2.6.1/dist/morphdom.js", preload: true pin "cable_ready", to: "cable_ready.js", preload: true pin "stimulus_ref...
ruby
MIT
a0ef193c770d849856ebee420a7135f082a7c31c
2026-01-04T15:56:28.761250Z
false
stimulusreflex/stimulus_reflex
https://github.com/stimulusreflex/stimulus_reflex/blob/a0ef193c770d849856ebee420a7135f082a7c31c/lib/stimulus_reflex/configuration.rb
lib/stimulus_reflex/configuration.rb
# frozen_string_literal: true module StimulusReflex class << self def configure yield configuration end def configuration @configuration ||= Configuration.new end alias_method :config, :configuration end class Configuration attr_accessor :on_failed_sanity_checks, :on_missin...
ruby
MIT
a0ef193c770d849856ebee420a7135f082a7c31c
2026-01-04T15:56:28.761250Z
false
stimulusreflex/stimulus_reflex
https://github.com/stimulusreflex/stimulus_reflex/blob/a0ef193c770d849856ebee420a7135f082a7c31c/lib/stimulus_reflex/reflex_factory.rb
lib/stimulus_reflex/reflex_factory.rb
# frozen_string_literal: true class StimulusReflex::ReflexFactory attr_reader :channel, :data delegate :reflex_name, :method_name, to: :data def initialize(channel, data) @channel = channel @data = StimulusReflex::ReflexData.new(data) end def call verify_method_name! reflex_class.new(chann...
ruby
MIT
a0ef193c770d849856ebee420a7135f082a7c31c
2026-01-04T15:56:28.761250Z
false
stimulusreflex/stimulus_reflex
https://github.com/stimulusreflex/stimulus_reflex/blob/a0ef193c770d849856ebee420a7135f082a7c31c/lib/stimulus_reflex/dataset.rb
lib/stimulus_reflex/dataset.rb
# frozen_string_literal: true require "stimulus_reflex/utils/attribute_builder" class StimulusReflex::Dataset < OpenStruct include StimulusReflex::AttributeBuilder attr_accessor :attrs, :data_attrs def initialize(data = {}) datasets = data["dataset"] || {} regular_dataset = datasets["dataset"] || {} ...
ruby
MIT
a0ef193c770d849856ebee420a7135f082a7c31c
2026-01-04T15:56:28.761250Z
false
stimulusreflex/stimulus_reflex
https://github.com/stimulusreflex/stimulus_reflex/blob/a0ef193c770d849856ebee420a7135f082a7c31c/lib/stimulus_reflex/installer.rb
lib/stimulus_reflex/installer.rb
# frozen_string_literal: true require "thor" module StimulusReflex class Installer include Thor::Base include Thor::Actions source_root Dir.pwd ## Thor wrapper def self.create_file(...) new.create_file(...) end def self.append_file(...) new.append_file(...) end d...
ruby
MIT
a0ef193c770d849856ebee420a7135f082a7c31c
2026-01-04T15:56:28.761250Z
false
stimulusreflex/stimulus_reflex
https://github.com/stimulusreflex/stimulus_reflex/blob/a0ef193c770d849856ebee420a7135f082a7c31c/lib/stimulus_reflex/reflex.rb
lib/stimulus_reflex/reflex.rb
# frozen_string_literal: true require "stimulus_reflex/cable_readiness" require "stimulus_reflex/version_checker" class StimulusReflex::Reflex prepend StimulusReflex::CableReadiness include StimulusReflex::VersionChecker include StimulusReflex::Callbacks include ActiveSupport::Rescuable include ActionView::...
ruby
MIT
a0ef193c770d849856ebee420a7135f082a7c31c
2026-01-04T15:56:28.761250Z
false
stimulusreflex/stimulus_reflex
https://github.com/stimulusreflex/stimulus_reflex/blob/a0ef193c770d849856ebee420a7135f082a7c31c/lib/stimulus_reflex/cable_ready_channels.rb
lib/stimulus_reflex/cable_ready_channels.rb
# frozen_string_literal: true module StimulusReflex class CableReadyChannels delegate :[], to: "cable_ready_channels" def initialize(reflex) @stream_name = reflex.stream_name @id = reflex.id CableReady.config.add_operation_name(:stimulus_reflex_version_mismatch) end def cable_read...
ruby
MIT
a0ef193c770d849856ebee420a7135f082a7c31c
2026-01-04T15:56:28.761250Z
false
stimulusreflex/stimulus_reflex
https://github.com/stimulusreflex/stimulus_reflex/blob/a0ef193c770d849856ebee420a7135f082a7c31c/lib/stimulus_reflex/engine.rb
lib/stimulus_reflex/engine.rb
# frozen_string_literal: true require "rails/engine" module StimulusReflex class Engine < ::Rails::Engine initializer "stimulus_reflex.sanity_check" do SanityChecker.check! unless Rails.env.production? end # If you don't want to precompile StimulusReflex's assets (eg. because you're using webpack...
ruby
MIT
a0ef193c770d849856ebee420a7135f082a7c31c
2026-01-04T15:56:28.761250Z
false
stimulusreflex/stimulus_reflex
https://github.com/stimulusreflex/stimulus_reflex/blob/a0ef193c770d849856ebee420a7135f082a7c31c/lib/stimulus_reflex/concern_enhancer.rb
lib/stimulus_reflex/concern_enhancer.rb
# frozen_string_literal: true module StimulusReflex module ConcernEnhancer extend ActiveSupport::Concern class_methods do def method_missing(name, *args) case ancestors when ->(a) { !(a & [StimulusReflex::Reflex]).empty? } if ((defined?(ActiveRecord) ? ActiveRecord::Base.publ...
ruby
MIT
a0ef193c770d849856ebee420a7135f082a7c31c
2026-01-04T15:56:28.761250Z
false
stimulusreflex/stimulus_reflex
https://github.com/stimulusreflex/stimulus_reflex/blob/a0ef193c770d849856ebee420a7135f082a7c31c/lib/stimulus_reflex/version_checker.rb
lib/stimulus_reflex/version_checker.rb
# frozen_string_literal: true module StimulusReflex class VersionMismatchError < StandardError end module VersionChecker def check_version! return if StimulusReflex.config.on_failed_sanity_checks == :ignore return if version == StimulusReflex::VERSION level = (StimulusReflex.config.on_fai...
ruby
MIT
a0ef193c770d849856ebee420a7135f082a7c31c
2026-01-04T15:56:28.761250Z
false
stimulusreflex/stimulus_reflex
https://github.com/stimulusreflex/stimulus_reflex/blob/a0ef193c770d849856ebee420a7135f082a7c31c/lib/stimulus_reflex/policies/reflex_invocation_policy.rb
lib/stimulus_reflex/policies/reflex_invocation_policy.rb
# frozen_string_literal: true module StimulusReflex class ReflexMethodInvocationPolicy attr_reader :arguments, :required_params, :optional_params def initialize(method, arguments) @arguments = arguments @required_params = method.parameters.select { |(kind, _)| kind == :req } @optional_para...
ruby
MIT
a0ef193c770d849856ebee420a7135f082a7c31c
2026-01-04T15:56:28.761250Z
false
stimulusreflex/stimulus_reflex
https://github.com/stimulusreflex/stimulus_reflex/blob/a0ef193c770d849856ebee420a7135f082a7c31c/lib/stimulus_reflex/utils/sanity_checker.rb
lib/stimulus_reflex/utils/sanity_checker.rb
# frozen_string_literal: true class StimulusReflex::SanityChecker class << self def check! return if ENV["SKIP_SANITY_CHECK"] return if StimulusReflex.config.on_failed_sanity_checks == :ignore return if called_by_installer? return if called_by_generate_config? return if called_by_ra...
ruby
MIT
a0ef193c770d849856ebee420a7135f082a7c31c
2026-01-04T15:56:28.761250Z
false
stimulusreflex/stimulus_reflex
https://github.com/stimulusreflex/stimulus_reflex/blob/a0ef193c770d849856ebee420a7135f082a7c31c/lib/stimulus_reflex/utils/logger.rb
lib/stimulus_reflex/utils/logger.rb
# frozen_string_literal: true module StimulusReflex class Logger attr_reader :logger attr_accessor :reflex, :current_operation delegate :debug, :info, :warn, :error, :fatal, :unknown, to: :logger def initialize(reflex) @reflex = reflex @current_operation = 1 @logger = StimulusRefl...
ruby
MIT
a0ef193c770d849856ebee420a7135f082a7c31c
2026-01-04T15:56:28.761250Z
false
stimulusreflex/stimulus_reflex
https://github.com/stimulusreflex/stimulus_reflex/blob/a0ef193c770d849856ebee420a7135f082a7c31c/lib/stimulus_reflex/utils/attribute_builder.rb
lib/stimulus_reflex/utils/attribute_builder.rb
# frozen_string_literal: true module StimulusReflex::AttributeBuilder def build_data_attrs(dataset, dataset_all) dataset_all.transform_keys! { |key| "data-#{key.delete_prefix("data-").pluralize}" } dataset.each { |key, value| dataset_all[key]&.prepend(value) } data_attrs = dataset.merge(dataset_all) ...
ruby
MIT
a0ef193c770d849856ebee420a7135f082a7c31c
2026-01-04T15:56:28.761250Z
false
stimulusreflex/stimulus_reflex
https://github.com/stimulusreflex/stimulus_reflex/blob/a0ef193c770d849856ebee420a7135f082a7c31c/lib/stimulus_reflex/utils/colorize.rb
lib/stimulus_reflex/utils/colorize.rb
# frozen_string_literal: true module StimulusReflex module Utils module Colorize COLORS = { red: "31", green: "32", yellow: "33", blue: "34", magenta: "35", cyan: "36", white: "37" } refine String do COLORS.each do |name, code| ...
ruby
MIT
a0ef193c770d849856ebee420a7135f082a7c31c
2026-01-04T15:56:28.761250Z
false
stimulusreflex/stimulus_reflex
https://github.com/stimulusreflex/stimulus_reflex/blob/a0ef193c770d849856ebee420a7135f082a7c31c/lib/stimulus_reflex/html/document_fragment.rb
lib/stimulus_reflex/html/document_fragment.rb
# frozen_string_literal: true module StimulusReflex module HTML class DocumentFragment < Document def parsing_class Nokogiri::HTML5::Inference end def document_element @document end end end end
ruby
MIT
a0ef193c770d849856ebee420a7135f082a7c31c
2026-01-04T15:56:28.761250Z
false
stimulusreflex/stimulus_reflex
https://github.com/stimulusreflex/stimulus_reflex/blob/a0ef193c770d849856ebee420a7135f082a7c31c/lib/stimulus_reflex/html/document.rb
lib/stimulus_reflex/html/document.rb
# frozen_string_literal: true module StimulusReflex module HTML class Document DEFAULT_HTML_WITHOUT_FORMAT = Nokogiri::XML::Node::SaveOptions::DEFAULT_HTML & ~Nokogiri::XML::Node::SaveOptions::FORMAT delegate :element, to: :@document def document_element @document&.root end ...
ruby
MIT
a0ef193c770d849856ebee420a7135f082a7c31c
2026-01-04T15:56:28.761250Z
false
stimulusreflex/stimulus_reflex
https://github.com/stimulusreflex/stimulus_reflex/blob/a0ef193c770d849856ebee420a7135f082a7c31c/lib/stimulus_reflex/broadcasters/update.rb
lib/stimulus_reflex/broadcasters/update.rb
# frozen_string_literal: true module StimulusReflex module Broadcasters class Update include CableReady::Identifiable def initialize(key, value, reflex) @key = key @value = value @reflex = reflex end def selector @selector ||= identifiable?(@key) ? dom_id...
ruby
MIT
a0ef193c770d849856ebee420a7135f082a7c31c
2026-01-04T15:56:28.761250Z
false
stimulusreflex/stimulus_reflex
https://github.com/stimulusreflex/stimulus_reflex/blob/a0ef193c770d849856ebee420a7135f082a7c31c/lib/stimulus_reflex/broadcasters/broadcaster.rb
lib/stimulus_reflex/broadcasters/broadcaster.rb
# frozen_string_literal: true module StimulusReflex class Broadcaster attr_reader :reflex, :cable_ready, :logger, :operations delegate :permanent_attribute_name, :payload, to: :reflex def initialize(reflex) @reflex = reflex @logger = Rails.logger if defined?(Rails.logger) @operations =...
ruby
MIT
a0ef193c770d849856ebee420a7135f082a7c31c
2026-01-04T15:56:28.761250Z
false
stimulusreflex/stimulus_reflex
https://github.com/stimulusreflex/stimulus_reflex/blob/a0ef193c770d849856ebee420a7135f082a7c31c/lib/stimulus_reflex/broadcasters/selector_broadcaster.rb
lib/stimulus_reflex/broadcasters/selector_broadcaster.rb
# frozen_string_literal: true module StimulusReflex class SelectorBroadcaster < Broadcaster def broadcast(_, data = {}) morphs.each do |morph| selectors, html = morph updates = create_update_collection(selectors, html) updates.each do |update| document = StimulusReflex::HT...
ruby
MIT
a0ef193c770d849856ebee420a7135f082a7c31c
2026-01-04T15:56:28.761250Z
false
stimulusreflex/stimulus_reflex
https://github.com/stimulusreflex/stimulus_reflex/blob/a0ef193c770d849856ebee420a7135f082a7c31c/lib/stimulus_reflex/broadcasters/page_broadcaster.rb
lib/stimulus_reflex/broadcasters/page_broadcaster.rb
# frozen_string_literal: true module StimulusReflex class PageBroadcaster < Broadcaster def broadcast(selectors, data) reflex.controller.process reflex.params[:action] document = StimulusReflex::HTML::Document.new(reflex.controller.response.body) return if document.empty? selectors = se...
ruby
MIT
a0ef193c770d849856ebee420a7135f082a7c31c
2026-01-04T15:56:28.761250Z
false
stimulusreflex/stimulus_reflex
https://github.com/stimulusreflex/stimulus_reflex/blob/a0ef193c770d849856ebee420a7135f082a7c31c/lib/stimulus_reflex/broadcasters/nothing_broadcaster.rb
lib/stimulus_reflex/broadcasters/nothing_broadcaster.rb
# frozen_string_literal: true module StimulusReflex class NothingBroadcaster < Broadcaster def broadcast(_, data) operations << ["document", :dispatch_event] cable_ready.dispatch_event( name: "stimulus-reflex:morph-nothing", selector: nil, payload: payload, stimulus_re...
ruby
MIT
a0ef193c770d849856ebee420a7135f082a7c31c
2026-01-04T15:56:28.761250Z
false
stimulusreflex/stimulus_reflex
https://github.com/stimulusreflex/stimulus_reflex/blob/a0ef193c770d849856ebee420a7135f082a7c31c/lib/generators/stimulus_reflex/stimulus_reflex_generator.rb
lib/generators/stimulus_reflex/stimulus_reflex_generator.rb
# frozen_string_literal: true require "rails/generators" require "stimulus_reflex/version" require "stimulus_reflex/installer" class StimulusReflexGenerator < Rails::Generators::NamedBase source_root File.expand_path("templates", __dir__) argument :name, type: :string, required: true, banner: "NAME" argument :...
ruby
MIT
a0ef193c770d849856ebee420a7135f082a7c31c
2026-01-04T15:56:28.761250Z
false
stimulusreflex/stimulus_reflex
https://github.com/stimulusreflex/stimulus_reflex/blob/a0ef193c770d849856ebee420a7135f082a7c31c/lib/generators/stimulus_reflex/templates/config/initializers/cable_ready.rb
lib/generators/stimulus_reflex/templates/config/initializers/cable_ready.rb
# frozen_string_literal: true CableReady.configure do |config| # Enable/disable exiting / warning when the sanity checks fail options: # `:exit` or `:warn` or `:ignore` # # config.on_failed_sanity_checks = :exit # Enable/disable assets compilation # `true` or `false` # # config.precompile_assets = tru...
ruby
MIT
a0ef193c770d849856ebee420a7135f082a7c31c
2026-01-04T15:56:28.761250Z
false
stimulusreflex/stimulus_reflex
https://github.com/stimulusreflex/stimulus_reflex/blob/a0ef193c770d849856ebee420a7135f082a7c31c/lib/generators/stimulus_reflex/templates/config/initializers/stimulus_reflex.rb
lib/generators/stimulus_reflex/templates/config/initializers/stimulus_reflex.rb
# frozen_string_literal: true # The ActionCable logger is REALLY noisy, and might even impact performance. # Uncomment the line below to silence the ActionCable logger. # ActionCable.server.config.logger = Logger.new(nil) StimulusReflex.configure do |config| # Enable/disable exiting / warning when the sanity check...
ruby
MIT
a0ef193c770d849856ebee420a7135f082a7c31c
2026-01-04T15:56:28.761250Z
false
stimulusreflex/stimulus_reflex
https://github.com/stimulusreflex/stimulus_reflex/blob/a0ef193c770d849856ebee420a7135f082a7c31c/lib/install/initializers.rb
lib/install/initializers.rb
# frozen_string_literal: true require "stimulus_reflex/installer" sr_initializer_src = StimulusReflex::Installer.fetch("/", "config/initializers/stimulus_reflex.rb") sr_initializer_path = Rails.root.join("config/initializers/stimulus_reflex.rb") cr_initializer_src = StimulusReflex::Installer.fetch("/", "config/initi...
ruby
MIT
a0ef193c770d849856ebee420a7135f082a7c31c
2026-01-04T15:56:28.761250Z
false
stimulusreflex/stimulus_reflex
https://github.com/stimulusreflex/stimulus_reflex/blob/a0ef193c770d849856ebee420a7135f082a7c31c/lib/install/bundle.rb
lib/install/bundle.rb
# frozen_string_literal: true require "stimulus_reflex/installer" hash = StimulusReflex::Installer.gemfile_hash # run bundle only when gems are waiting to be added or removed add = StimulusReflex::Installer.add_gem_list.exist? ? StimulusReflex::Installer.add_gem_list.readlines.map(&:chomp) : [] remove = StimulusRefl...
ruby
MIT
a0ef193c770d849856ebee420a7135f082a7c31c
2026-01-04T15:56:28.761250Z
false
stimulusreflex/stimulus_reflex
https://github.com/stimulusreflex/stimulus_reflex/blob/a0ef193c770d849856ebee420a7135f082a7c31c/lib/install/action_cable.rb
lib/install/action_cable.rb
# frozen_string_literal: true require "stimulus_reflex/installer" # verify that Action Cable is installed if defined?(ActionCable::Engine) say "⏩ ActionCable::Engine is already loaded and in scope. Skipping" else StimulusReflex::Installer.halt "ActionCable::Engine is not loaded, please add or uncomment `require \...
ruby
MIT
a0ef193c770d849856ebee420a7135f082a7c31c
2026-01-04T15:56:28.761250Z
false
stimulusreflex/stimulus_reflex
https://github.com/stimulusreflex/stimulus_reflex/blob/a0ef193c770d849856ebee420a7135f082a7c31c/lib/install/development.rb
lib/install/development.rb
# frozen_string_literal: true require "stimulus_reflex/installer" # mutate working copy of development.rb to avoid bundle alerts FileUtils.cp(StimulusReflex::Installer.development_path, StimulusReflex::Installer.development_working_path) # add default_url_options to development.rb for Action Mailer if defined?(Actio...
ruby
MIT
a0ef193c770d849856ebee420a7135f082a7c31c
2026-01-04T15:56:28.761250Z
false
stimulusreflex/stimulus_reflex
https://github.com/stimulusreflex/stimulus_reflex/blob/a0ef193c770d849856ebee420a7135f082a7c31c/lib/install/compression.rb
lib/install/compression.rb
# frozen_string_literal: true require "stimulus_reflex/installer" initializer = StimulusReflex::Installer.action_cable_initializer_working_path.read if StimulusReflex::Installer.gemfile.match?(/gem ['"]permessage_deflate['"]/) say "⏩ permessage_deflate already present in Gemfile. Skipping." else StimulusReflex::...
ruby
MIT
a0ef193c770d849856ebee420a7135f082a7c31c
2026-01-04T15:56:28.761250Z
false
stimulusreflex/stimulus_reflex
https://github.com/stimulusreflex/stimulus_reflex/blob/a0ef193c770d849856ebee420a7135f082a7c31c/lib/install/yarn.rb
lib/install/yarn.rb
# frozen_string_literal: true require "stimulus_reflex/installer" if !StimulusReflex::Installer.package_json_path.exist? say "⏩ No package.json file found. Skipping." return end # run yarn install only when packages are waiting to be added or removed add = StimulusReflex::Installer.package_list.exist? ? Stimulu...
ruby
MIT
a0ef193c770d849856ebee420a7135f082a7c31c
2026-01-04T15:56:28.761250Z
false
stimulusreflex/stimulus_reflex
https://github.com/stimulusreflex/stimulus_reflex/blob/a0ef193c770d849856ebee420a7135f082a7c31c/lib/install/updatable.rb
lib/install/updatable.rb
# frozen_string_literal: true require "stimulus_reflex/installer" if StimulusReflex::Installer.application_record_path.exist? lines = StimulusReflex::Installer.application_record_path.readlines if !lines.index { |line| line =~ /^\s*include CableReady::Updatable/ } proceed = if StimulusReflex::Installer.optio...
ruby
MIT
a0ef193c770d849856ebee420a7135f082a7c31c
2026-01-04T15:56:28.761250Z
false
stimulusreflex/stimulus_reflex
https://github.com/stimulusreflex/stimulus_reflex/blob/a0ef193c770d849856ebee420a7135f082a7c31c/lib/install/reflexes.rb
lib/install/reflexes.rb
# frozen_string_literal: true require "stimulus_reflex/installer" reflexes_path = Rails.root.join("app/reflexes") step_path = "/app/reflexes/" application_reflex_path = reflexes_path / "application_reflex.rb" application_reflex_src = StimulusReflex::Installer.fetch(step_path, "application_reflex.rb.tt") # verify app...
ruby
MIT
a0ef193c770d849856ebee420a7135f082a7c31c
2026-01-04T15:56:28.761250Z
false
stimulusreflex/stimulus_reflex
https://github.com/stimulusreflex/stimulus_reflex/blob/a0ef193c770d849856ebee420a7135f082a7c31c/lib/install/npm_packages.rb
lib/install/npm_packages.rb
# frozen_string_literal: true require "stimulus_reflex/installer" lines = StimulusReflex::Installer.package_json_path.readlines if !lines.index { |line| line =~ /^\s*["']cable_ready["']: ["'].*#{StimulusReflex::Installer.cr_npm_version}["']/ } StimulusReflex::Installer.add_package "cable_ready@#{StimulusReflex::In...
ruby
MIT
a0ef193c770d849856ebee420a7135f082a7c31c
2026-01-04T15:56:28.761250Z
false
stimulusreflex/stimulus_reflex
https://github.com/stimulusreflex/stimulus_reflex/blob/a0ef193c770d849856ebee420a7135f082a7c31c/lib/install/shakapacker.rb
lib/install/shakapacker.rb
# frozen_string_literal: true require "stimulus_reflex/installer" return if StimulusReflex::Installer.pack_path_missing? # verify that all critical dependencies are up to date; if not, queue for later lines = StimulusReflex::Installer.package_json_path.readlines if !lines.index { |line| line =~ /^\s*["']@hotwired\/...
ruby
MIT
a0ef193c770d849856ebee420a7135f082a7c31c
2026-01-04T15:56:28.761250Z
false
stimulusreflex/stimulus_reflex
https://github.com/stimulusreflex/stimulus_reflex/blob/a0ef193c770d849856ebee420a7135f082a7c31c/lib/install/broadcaster.rb
lib/install/broadcaster.rb
# frozen_string_literal: true require "stimulus_reflex/installer" def needs_broadcaster?(path) return false unless path.exist? !path.readlines.index { |line| line =~ /^\s*include CableReady::Broadcaster/ } end channel_path = Rails.root.join("app/channels/application_cable/channel.rb") controller_path = Rails.ro...
ruby
MIT
a0ef193c770d849856ebee420a7135f082a7c31c
2026-01-04T15:56:28.761250Z
false
stimulusreflex/stimulus_reflex
https://github.com/stimulusreflex/stimulus_reflex/blob/a0ef193c770d849856ebee420a7135f082a7c31c/lib/install/importmap.rb
lib/install/importmap.rb
# frozen_string_literal: true require "stimulus_reflex/installer" return if StimulusReflex::Installer.pack_path_missing? if !StimulusReflex::Installer.importmap_path.exist? StimulusReflex::Installer.halt "#{friendly_StimulusReflex::Installer.importmap_path} is missing. You need a valid importmap config file to pro...
ruby
MIT
a0ef193c770d849856ebee420a7135f082a7c31c
2026-01-04T15:56:28.761250Z
false
stimulusreflex/stimulus_reflex
https://github.com/stimulusreflex/stimulus_reflex/blob/a0ef193c770d849856ebee420a7135f082a7c31c/lib/install/vite.rb
lib/install/vite.rb
# frozen_string_literal: true require "stimulus_reflex/installer" return if StimulusReflex::Installer.pack_path_missing? # verify that all critical dependencies are up to date; if not, queue for later lines = StimulusReflex::Installer.package_json_path.readlines if !lines.index { |line| line =~ /^\s*["']stimulus-vi...
ruby
MIT
a0ef193c770d849856ebee420a7135f082a7c31c
2026-01-04T15:56:28.761250Z
false
stimulusreflex/stimulus_reflex
https://github.com/stimulusreflex/stimulus_reflex/blob/a0ef193c770d849856ebee420a7135f082a7c31c/lib/install/esbuild.rb
lib/install/esbuild.rb
# frozen_string_literal: true require "stimulus_reflex/installer" return if StimulusReflex::Installer.pack_path_missing? # verify that all critical dependencies are up to date; if not, queue for later lines = StimulusReflex::Installer.package_json_path.readlines if !lines.index { |line| line =~ /^\s*["']esbuild-rai...
ruby
MIT
a0ef193c770d849856ebee420a7135f082a7c31c
2026-01-04T15:56:28.761250Z
false
stimulusreflex/stimulus_reflex
https://github.com/stimulusreflex/stimulus_reflex/blob/a0ef193c770d849856ebee420a7135f082a7c31c/lib/install/config.rb
lib/install/config.rb
# frozen_string_literal: true require "stimulus_reflex/installer" return if StimulusReflex::Installer.pack_path_missing? step_path = "/app/javascript/config/" index_src = StimulusReflex::Installer.fetch(step_path, "index.js.tt") index_path = StimulusReflex::Installer.config_path / "index.js" friendly_index_path = in...
ruby
MIT
a0ef193c770d849856ebee420a7135f082a7c31c
2026-01-04T15:56:28.761250Z
false
stimulusreflex/stimulus_reflex
https://github.com/stimulusreflex/stimulus_reflex/blob/a0ef193c770d849856ebee420a7135f082a7c31c/lib/install/webpacker.rb
lib/install/webpacker.rb
# frozen_string_literal: true require "stimulus_reflex/installer" return if StimulusReflex::Installer.pack_path_missing? # verify that all critical dependencies are up to date; if not, queue for later lines = StimulusReflex::Installer.package_json_path.readlines if !lines.index { |line| line =~ /^\s*["']webpack["']:...
ruby
MIT
a0ef193c770d849856ebee420a7135f082a7c31c
2026-01-04T15:56:28.761250Z
false
stimulusreflex/stimulus_reflex
https://github.com/stimulusreflex/stimulus_reflex/blob/a0ef193c770d849856ebee420a7135f082a7c31c/lib/install/example.rb
lib/install/example.rb
# frozen_string_literal: true require "stimulus_reflex/installer" proceed = false if !Rails.root.join("app/reflexes/example_reflex.rb").exist? proceed = if StimulusReflex::Installer.options.key? "example" StimulusReflex::Installer.options["example"] else !no?("✨ Generate an example Reflex with a quick dem...
ruby
MIT
a0ef193c770d849856ebee420a7135f082a7c31c
2026-01-04T15:56:28.761250Z
false
stimulusreflex/stimulus_reflex
https://github.com/stimulusreflex/stimulus_reflex/blob/a0ef193c770d849856ebee420a7135f082a7c31c/lib/install/mrujs.rb
lib/install/mrujs.rb
# frozen_string_literal: true require "stimulus_reflex/installer" return if StimulusReflex::Installer.pack_path_missing? mrujs_path = StimulusReflex::Installer.config_path / "mrujs.js" proceed = false if !File.exist?(mrujs_path) proceed = if StimulusReflex::Installer.options.key? "mrujs" StimulusReflex::Inst...
ruby
MIT
a0ef193c770d849856ebee420a7135f082a7c31c
2026-01-04T15:56:28.761250Z
false
stimulusreflex/stimulus_reflex
https://github.com/stimulusreflex/stimulus_reflex/blob/a0ef193c770d849856ebee420a7135f082a7c31c/lib/install/spring.rb
lib/install/spring.rb
# frozen_string_literal: true require "stimulus_reflex/installer" spring_pattern = /^[^#]*gem ["']spring["']/ proceed = false lines = StimulusReflex::Installer.gemfile_path.readlines if lines.index { |line| line =~ spring_pattern } proceed = if StimulusReflex::Installer.options.key? "spring" StimulusReflex::I...
ruby
MIT
a0ef193c770d849856ebee420a7135f082a7c31c
2026-01-04T15:56:28.761250Z
false
NoamB/sorcery
https://github.com/NoamB/sorcery/blob/4aaf38363eddf7a2982312ce68f0105dcc4ae8dc/spec/sorcery_crypto_providers_spec.rb
spec/sorcery_crypto_providers_spec.rb
require 'spec_helper' describe "Crypto Providers wrappers" do describe Sorcery::CryptoProviders::MD5 do after(:each) do Sorcery::CryptoProviders::MD5.reset! end it "encrypt works via wrapper like normal lib" do expect(Sorcery::CryptoProviders::MD5.encrypt 'Noam Ben-Ari').to eq Digest::MD5....
ruby
MIT
4aaf38363eddf7a2982312ce68f0105dcc4ae8dc
2026-01-04T15:56:41.074273Z
false
NoamB/sorcery
https://github.com/NoamB/sorcery/blob/4aaf38363eddf7a2982312ce68f0105dcc4ae8dc/spec/spec_helper.rb
spec/spec_helper.rb
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) $LOAD_PATH.unshift(File.dirname(__FILE__)) ENV["RAILS_ENV"] ||= 'test' SORCERY_ORM = :active_record # require 'simplecov' # SimpleCov.root File.join(File.dirname(__FILE__), '..', 'lib') # SimpleCov.start require 'rspec' require 'rails/all' require ...
ruby
MIT
4aaf38363eddf7a2982312ce68f0105dcc4ae8dc
2026-01-04T15:56:41.074273Z
false
NoamB/sorcery
https://github.com/NoamB/sorcery/blob/4aaf38363eddf7a2982312ce68f0105dcc4ae8dc/spec/controllers/controller_activity_logging_spec.rb
spec/controllers/controller_activity_logging_spec.rb
require 'spec_helper' # require 'shared_examples/controller_activity_logging_shared_examples' describe SorceryController do after(:all) do sorcery_controller_property_set(:register_login_time, true) sorcery_controller_property_set(:register_logout_time, true) sorcery_controller_property_set(:register_la...
ruby
MIT
4aaf38363eddf7a2982312ce68f0105dcc4ae8dc
2026-01-04T15:56:41.074273Z
false
NoamB/sorcery
https://github.com/NoamB/sorcery/blob/4aaf38363eddf7a2982312ce68f0105dcc4ae8dc/spec/controllers/controller_remember_me_spec.rb
spec/controllers/controller_remember_me_spec.rb
require 'spec_helper' describe SorceryController do let!(:user) { double('user', id: 42) } # ----------------- REMEMBER ME ----------------------- context "with remember me features" do before(:all) do sorcery_reload!([:remember_me]) end after(:each) do session = nil cookies = n...
ruby
MIT
4aaf38363eddf7a2982312ce68f0105dcc4ae8dc
2026-01-04T15:56:41.074273Z
false
NoamB/sorcery
https://github.com/NoamB/sorcery/blob/4aaf38363eddf7a2982312ce68f0105dcc4ae8dc/spec/controllers/controller_spec.rb
spec/controllers/controller_spec.rb
require 'spec_helper' describe SorceryController do describe "plugin configuration" do before(:all) do sorcery_reload! end after(:each) do Sorcery::Controller::Config.reset! sorcery_reload! end it "enables configuration option 'user_class'" do sorcery_controller_property...
ruby
MIT
4aaf38363eddf7a2982312ce68f0105dcc4ae8dc
2026-01-04T15:56:41.074273Z
false
NoamB/sorcery
https://github.com/NoamB/sorcery/blob/4aaf38363eddf7a2982312ce68f0105dcc4ae8dc/spec/controllers/controller_oauth_spec.rb
spec/controllers/controller_oauth_spec.rb
require 'spec_helper' # require 'shared_examples/controller_oauth_shared_examples' require 'ostruct' def stub_all_oauth_requests! consumer = OAuth::Consumer.new("key","secret", :site => "http://myapi.com") req_token = OAuth::RequestToken.new(consumer) acc_token = OAuth::AccessToken.new(consumer) response = O...
ruby
MIT
4aaf38363eddf7a2982312ce68f0105dcc4ae8dc
2026-01-04T15:56:41.074273Z
false
NoamB/sorcery
https://github.com/NoamB/sorcery/blob/4aaf38363eddf7a2982312ce68f0105dcc4ae8dc/spec/controllers/controller_session_timeout_spec.rb
spec/controllers/controller_session_timeout_spec.rb
require 'spec_helper' describe SorceryController do let!(:user) { double('user', id: 42) } # ----------------- SESSION TIMEOUT ----------------------- context "with session timeout features" do before(:all) do sorcery_reload!([:session_timeout]) sorcery_controller_property_set(:session_timeout,...
ruby
MIT
4aaf38363eddf7a2982312ce68f0105dcc4ae8dc
2026-01-04T15:56:41.074273Z
false
NoamB/sorcery
https://github.com/NoamB/sorcery/blob/4aaf38363eddf7a2982312ce68f0105dcc4ae8dc/spec/controllers/controller_http_basic_auth_spec.rb
spec/controllers/controller_http_basic_auth_spec.rb
require 'spec_helper' describe SorceryController do let(:user) { double("user", id: 42, email: 'bla@bla.com') } describe "with http basic auth features" do before(:all) do sorcery_reload!([:http_basic_auth]) sorcery_controller_property_set(:controller_to_realm_map, {"sorcery" => "sorcery"}) ...
ruby
MIT
4aaf38363eddf7a2982312ce68f0105dcc4ae8dc
2026-01-04T15:56:41.074273Z
false
NoamB/sorcery
https://github.com/NoamB/sorcery/blob/4aaf38363eddf7a2982312ce68f0105dcc4ae8dc/spec/controllers/controller_oauth2_spec.rb
spec/controllers/controller_oauth2_spec.rb
require 'spec_helper' # require 'shared_examples/controller_oauth2_shared_examples' describe SorceryController, :active_record => true do before(:all) do if SORCERY_ORM == :active_record ActiveRecord::Migrator.migrate("#{Rails.root}/db/migrate/external") User.reset_column_information end so...
ruby
MIT
4aaf38363eddf7a2982312ce68f0105dcc4ae8dc
2026-01-04T15:56:41.074273Z
false
NoamB/sorcery
https://github.com/NoamB/sorcery/blob/4aaf38363eddf7a2982312ce68f0105dcc4ae8dc/spec/controllers/controller_brute_force_protection_spec.rb
spec/controllers/controller_brute_force_protection_spec.rb
require 'spec_helper' describe SorceryController do let(:user) { double('user', id: 42, email: 'bla@bla.com') } def request_test_login get :test_login, email: 'bla@bla.com', password: 'blabla' end # ----------------- SESSION TIMEOUT ----------------------- describe "brute force protection features" do...
ruby
MIT
4aaf38363eddf7a2982312ce68f0105dcc4ae8dc
2026-01-04T15:56:41.074273Z
false
NoamB/sorcery
https://github.com/NoamB/sorcery/blob/4aaf38363eddf7a2982312ce68f0105dcc4ae8dc/spec/shared_examples/user_brute_force_protection_shared_examples.rb
spec/shared_examples/user_brute_force_protection_shared_examples.rb
shared_examples_for "rails_3_brute_force_protection_model" do let(:user) { create_new_user } before(:each) do User.sorcery_adapter.delete_all end context "loaded plugin configuration" do let(:config) { User.sorcery_config } before(:all) do sorcery_reload!([:brute_force_protection]) end...
ruby
MIT
4aaf38363eddf7a2982312ce68f0105dcc4ae8dc
2026-01-04T15:56:41.074273Z
false
NoamB/sorcery
https://github.com/NoamB/sorcery/blob/4aaf38363eddf7a2982312ce68f0105dcc4ae8dc/spec/shared_examples/user_oauth_shared_examples.rb
spec/shared_examples/user_oauth_shared_examples.rb
shared_examples_for "rails_3_oauth_model" do # ----------------- PLUGIN CONFIGURATION ----------------------- let(:external_user) { create_new_external_user :twitter } describe "loaded plugin configuration" do before(:all) do Authentication.sorcery_adapter.delete_all User.sorcery_adapter.delete...
ruby
MIT
4aaf38363eddf7a2982312ce68f0105dcc4ae8dc
2026-01-04T15:56:41.074273Z
false
NoamB/sorcery
https://github.com/NoamB/sorcery/blob/4aaf38363eddf7a2982312ce68f0105dcc4ae8dc/spec/shared_examples/user_activation_shared_examples.rb
spec/shared_examples/user_activation_shared_examples.rb
shared_examples_for "rails_3_activation_model" do let(:user) { create_new_user } let(:new_user) { build_new_user } context "loaded plugin configuration" do before(:all) do sorcery_reload!([:user_activation], :user_activation_mailer => ::SorceryMailer) end after(:each) do User.sorcery_con...
ruby
MIT
4aaf38363eddf7a2982312ce68f0105dcc4ae8dc
2026-01-04T15:56:41.074273Z
false
NoamB/sorcery
https://github.com/NoamB/sorcery/blob/4aaf38363eddf7a2982312ce68f0105dcc4ae8dc/spec/shared_examples/user_shared_examples.rb
spec/shared_examples/user_shared_examples.rb
shared_examples_for "rails_3_core_model" do let(:user) { create_new_user } let(:crypted_password) { user.send User.sorcery_config.crypted_password_attribute_name } describe "loaded plugin configuration" do after(:each) { User.sorcery_config.reset! } it "enables configuration option 'username_attribute...
ruby
MIT
4aaf38363eddf7a2982312ce68f0105dcc4ae8dc
2026-01-04T15:56:41.074273Z
false
NoamB/sorcery
https://github.com/NoamB/sorcery/blob/4aaf38363eddf7a2982312ce68f0105dcc4ae8dc/spec/shared_examples/user_activity_logging_shared_examples.rb
spec/shared_examples/user_activity_logging_shared_examples.rb
shared_examples_for "rails_3_activity_logging_model" do context "loaded plugin configuration" do before(:all) do sorcery_reload!([:activity_logging]) end after(:each) do User.sorcery_config.reset! end it "allows configuration option 'last_login_at_attribute_name'" do sorcery_mo...
ruby
MIT
4aaf38363eddf7a2982312ce68f0105dcc4ae8dc
2026-01-04T15:56:41.074273Z
false
NoamB/sorcery
https://github.com/NoamB/sorcery/blob/4aaf38363eddf7a2982312ce68f0105dcc4ae8dc/spec/shared_examples/user_remember_me_shared_examples.rb
spec/shared_examples/user_remember_me_shared_examples.rb
shared_examples_for "rails_3_remember_me_model" do let(:user) { create_new_user } describe "loaded plugin configuration" do before(:all) do sorcery_reload!([:remember_me]) end after(:each) do User.sorcery_config.reset! end it "allows configuration option 'remember_me_token_...
ruby
MIT
4aaf38363eddf7a2982312ce68f0105dcc4ae8dc
2026-01-04T15:56:41.074273Z
false
NoamB/sorcery
https://github.com/NoamB/sorcery/blob/4aaf38363eddf7a2982312ce68f0105dcc4ae8dc/spec/shared_examples/user_reset_password_shared_examples.rb
spec/shared_examples/user_reset_password_shared_examples.rb
shared_examples_for "rails_3_reset_password_model" do # ----------------- PLUGIN CONFIGURATION ----------------------- let(:user) { create_new_user } describe "loaded plugin configuration" do before(:all) do sorcery_reload!([:reset_password], :reset_password_mailer => ::SorceryMailer) end aft...
ruby
MIT
4aaf38363eddf7a2982312ce68f0105dcc4ae8dc
2026-01-04T15:56:41.074273Z
false
NoamB/sorcery
https://github.com/NoamB/sorcery/blob/4aaf38363eddf7a2982312ce68f0105dcc4ae8dc/spec/orm/active_record.rb
spec/orm/active_record.rb
require 'sorcery' ActiveRecord::Migration.verbose = false # ActiveRecord::Base.logger = Logger.new(nil) # ActiveRecord::Base.include_root_in_json = true class TestUser < ActiveRecord::Base authenticates_with_sorcery! end def setup_orm ActiveRecord::Migrator.migrate(migrations_path) end def teardown_orm Active...
ruby
MIT
4aaf38363eddf7a2982312ce68f0105dcc4ae8dc
2026-01-04T15:56:41.074273Z
false
NoamB/sorcery
https://github.com/NoamB/sorcery/blob/4aaf38363eddf7a2982312ce68f0105dcc4ae8dc/spec/active_record/user_brute_force_protection_spec.rb
spec/active_record/user_brute_force_protection_spec.rb
require 'spec_helper' require 'shared_examples/user_brute_force_protection_shared_examples' describe User, "with brute_force_protection submodule", :active_record => true do before(:all) do ActiveRecord::Migrator.migrate("#{Rails.root}/db/migrate/brute_force_protection") User.reset_column_information end ...
ruby
MIT
4aaf38363eddf7a2982312ce68f0105dcc4ae8dc
2026-01-04T15:56:41.074273Z
false
NoamB/sorcery
https://github.com/NoamB/sorcery/blob/4aaf38363eddf7a2982312ce68f0105dcc4ae8dc/spec/active_record/user_activation_spec.rb
spec/active_record/user_activation_spec.rb
require 'spec_helper' require 'rails_app/app/mailers/sorcery_mailer' require 'shared_examples/user_activation_shared_examples' describe User, "with activation submodule", :active_record => true do before(:all) do ActiveRecord::Migrator.migrate("#{Rails.root}/db/migrate/activation") User.reset_column_informa...
ruby
MIT
4aaf38363eddf7a2982312ce68f0105dcc4ae8dc
2026-01-04T15:56:41.074273Z
false
NoamB/sorcery
https://github.com/NoamB/sorcery/blob/4aaf38363eddf7a2982312ce68f0105dcc4ae8dc/spec/active_record/user_remember_me_spec.rb
spec/active_record/user_remember_me_spec.rb
require 'spec_helper' require 'shared_examples/user_remember_me_shared_examples' describe User, "with remember_me submodule", :active_record => true do before(:all) do ActiveRecord::Migrator.migrate("#{Rails.root}/db/migrate/remember_me") User.reset_column_information end after(:all) do ActiveRecord...
ruby
MIT
4aaf38363eddf7a2982312ce68f0105dcc4ae8dc
2026-01-04T15:56:41.074273Z
false
NoamB/sorcery
https://github.com/NoamB/sorcery/blob/4aaf38363eddf7a2982312ce68f0105dcc4ae8dc/spec/active_record/user_oauth_spec.rb
spec/active_record/user_oauth_spec.rb
require 'spec_helper' require 'shared_examples/user_oauth_shared_examples' describe User, "with oauth submodule", :active_record => true do before(:all) do ActiveRecord::Migrator.migrate("#{Rails.root}/db/migrate/external") User.reset_column_information end after(:all) do ActiveRecord::Migrator.roll...
ruby
MIT
4aaf38363eddf7a2982312ce68f0105dcc4ae8dc
2026-01-04T15:56:41.074273Z
false
NoamB/sorcery
https://github.com/NoamB/sorcery/blob/4aaf38363eddf7a2982312ce68f0105dcc4ae8dc/spec/active_record/user_activity_logging_spec.rb
spec/active_record/user_activity_logging_spec.rb
require 'spec_helper' require 'shared_examples/user_activity_logging_shared_examples' describe User, "with activity logging submodule", :active_record => true do before(:all) do ActiveRecord::Migrator.migrate("#{Rails.root}/db/migrate/activity_logging") User.reset_column_information end after(:all) do ...
ruby
MIT
4aaf38363eddf7a2982312ce68f0105dcc4ae8dc
2026-01-04T15:56:41.074273Z
false
NoamB/sorcery
https://github.com/NoamB/sorcery/blob/4aaf38363eddf7a2982312ce68f0105dcc4ae8dc/spec/active_record/user_spec.rb
spec/active_record/user_spec.rb
require 'spec_helper' require 'rails_app/app/mailers/sorcery_mailer' require 'shared_examples/user_shared_examples' describe User, "with no submodules (core)", :active_record => true do before(:all) do sorcery_reload! end context "when app has plugin loaded" do it "responds to the plugin activation clas...
ruby
MIT
4aaf38363eddf7a2982312ce68f0105dcc4ae8dc
2026-01-04T15:56:41.074273Z
false
NoamB/sorcery
https://github.com/NoamB/sorcery/blob/4aaf38363eddf7a2982312ce68f0105dcc4ae8dc/spec/active_record/user_reset_password_spec.rb
spec/active_record/user_reset_password_spec.rb
require 'spec_helper' require 'shared_examples/user_reset_password_shared_examples' describe User, "with reset_password submodule", :active_record => true do before(:all) do ActiveRecord::Migrator.migrate("#{Rails.root}/db/migrate/reset_password") User.reset_column_information end after(:all) do Act...
ruby
MIT
4aaf38363eddf7a2982312ce68f0105dcc4ae8dc
2026-01-04T15:56:41.074273Z
false
NoamB/sorcery
https://github.com/NoamB/sorcery/blob/4aaf38363eddf7a2982312ce68f0105dcc4ae8dc/spec/rails_app/app/helpers/application_helper.rb
spec/rails_app/app/helpers/application_helper.rb
module ApplicationHelper end
ruby
MIT
4aaf38363eddf7a2982312ce68f0105dcc4ae8dc
2026-01-04T15:56:41.074273Z
false
NoamB/sorcery
https://github.com/NoamB/sorcery/blob/4aaf38363eddf7a2982312ce68f0105dcc4ae8dc/spec/rails_app/app/controllers/sorcery_controller.rb
spec/rails_app/app/controllers/sorcery_controller.rb
require 'oauth' class SorceryController < ActionController::Base protect_from_forgery before_action :require_login_from_http_basic, only: [:test_http_basic_auth] before_action :require_login, only: [:test_logout, :test_logout_with_force_forget_me, :test_should_be_logged_in, :some_action] def index end d...
ruby
MIT
4aaf38363eddf7a2982312ce68f0105dcc4ae8dc
2026-01-04T15:56:41.074273Z
false
NoamB/sorcery
https://github.com/NoamB/sorcery/blob/4aaf38363eddf7a2982312ce68f0105dcc4ae8dc/spec/rails_app/app/active_record/authentication.rb
spec/rails_app/app/active_record/authentication.rb
class Authentication < ActiveRecord::Base belongs_to :user end
ruby
MIT
4aaf38363eddf7a2982312ce68f0105dcc4ae8dc
2026-01-04T15:56:41.074273Z
false
NoamB/sorcery
https://github.com/NoamB/sorcery/blob/4aaf38363eddf7a2982312ce68f0105dcc4ae8dc/spec/rails_app/app/active_record/user_provider.rb
spec/rails_app/app/active_record/user_provider.rb
class UserProvider < ActiveRecord::Base belongs_to :user end
ruby
MIT
4aaf38363eddf7a2982312ce68f0105dcc4ae8dc
2026-01-04T15:56:41.074273Z
false
NoamB/sorcery
https://github.com/NoamB/sorcery/blob/4aaf38363eddf7a2982312ce68f0105dcc4ae8dc/spec/rails_app/app/active_record/user.rb
spec/rails_app/app/active_record/user.rb
class User < ActiveRecord::Base has_many :authentications, :dependent => :destroy has_many :user_providers, :dependent => :destroy accepts_nested_attributes_for :authentications end
ruby
MIT
4aaf38363eddf7a2982312ce68f0105dcc4ae8dc
2026-01-04T15:56:41.074273Z
false
NoamB/sorcery
https://github.com/NoamB/sorcery/blob/4aaf38363eddf7a2982312ce68f0105dcc4ae8dc/spec/rails_app/app/mailers/sorcery_mailer.rb
spec/rails_app/app/mailers/sorcery_mailer.rb
class SorceryMailer < ActionMailer::Base default :from => "notifications@example.com" def activation_needed_email(user) @user = user @url = "http://example.com/login" mail(:to => user.email, :subject => "Welcome to My Awesome Site") end def activation_success_email(user) @user...
ruby
MIT
4aaf38363eddf7a2982312ce68f0105dcc4ae8dc
2026-01-04T15:56:41.074273Z
false
NoamB/sorcery
https://github.com/NoamB/sorcery/blob/4aaf38363eddf7a2982312ce68f0105dcc4ae8dc/spec/rails_app/db/seeds.rb
spec/rails_app/db/seeds.rb
# This file should contain all the record creation needed to seed the database with its default values. # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup). # # Examples: # # cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }]) # Mayor.create(:name =>...
ruby
MIT
4aaf38363eddf7a2982312ce68f0105dcc4ae8dc
2026-01-04T15:56:41.074273Z
false
NoamB/sorcery
https://github.com/NoamB/sorcery/blob/4aaf38363eddf7a2982312ce68f0105dcc4ae8dc/spec/rails_app/db/schema.rb
spec/rails_app/db/schema.rb
# 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...
ruby
MIT
4aaf38363eddf7a2982312ce68f0105dcc4ae8dc
2026-01-04T15:56:41.074273Z
false
NoamB/sorcery
https://github.com/NoamB/sorcery/blob/4aaf38363eddf7a2982312ce68f0105dcc4ae8dc/spec/rails_app/db/migrate/external/20101224223628_create_authentications_and_user_providers.rb
spec/rails_app/db/migrate/external/20101224223628_create_authentications_and_user_providers.rb
class CreateAuthenticationsAndUserProviders < ActiveRecord::Migration def self.up create_table :authentications do |t| t.integer :user_id, null: false t.string :provider, :uid, null: false t.timestamps null: false end create_table :user_providers do |t| t.integer :user_id, null: ...
ruby
MIT
4aaf38363eddf7a2982312ce68f0105dcc4ae8dc
2026-01-04T15:56:41.074273Z
false
NoamB/sorcery
https://github.com/NoamB/sorcery/blob/4aaf38363eddf7a2982312ce68f0105dcc4ae8dc/spec/rails_app/db/migrate/remember_me/20101224223623_add_remember_me_token_to_users.rb
spec/rails_app/db/migrate/remember_me/20101224223623_add_remember_me_token_to_users.rb
class AddRememberMeTokenToUsers < ActiveRecord::Migration def self.up add_column :users, :remember_me_token, :string, :default => nil add_column :users, :remember_me_token_expires_at, :datetime, :default => nil add_index :users, :remember_me_token end def self.down remove_index :users, :reme...
ruby
MIT
4aaf38363eddf7a2982312ce68f0105dcc4ae8dc
2026-01-04T15:56:41.074273Z
false
NoamB/sorcery
https://github.com/NoamB/sorcery/blob/4aaf38363eddf7a2982312ce68f0105dcc4ae8dc/spec/rails_app/db/migrate/brute_force_protection/20101224223626_add_brute_force_protection_to_users.rb
spec/rails_app/db/migrate/brute_force_protection/20101224223626_add_brute_force_protection_to_users.rb
class AddBruteForceProtectionToUsers < ActiveRecord::Migration def self.up add_column :users, :failed_logins_count, :integer, :default => 0 add_column :users, :lock_expires_at, :datetime, :default => nil add_column :users, :unlock_token, :string, :default => nil end def self.down remove_column :u...
ruby
MIT
4aaf38363eddf7a2982312ce68f0105dcc4ae8dc
2026-01-04T15:56:41.074273Z
false
NoamB/sorcery
https://github.com/NoamB/sorcery/blob/4aaf38363eddf7a2982312ce68f0105dcc4ae8dc/spec/rails_app/db/migrate/core/20101224223620_create_users.rb
spec/rails_app/db/migrate/core/20101224223620_create_users.rb
class CreateUsers < ActiveRecord::Migration def self.up create_table :users do |t| t.string :username, :null => false t.string :email, :default => nil t.string :crypted_password t.string :salt t.timestamps :null => false end end def self.do...
ruby
MIT
4aaf38363eddf7a2982312ce68f0105dcc4ae8dc
2026-01-04T15:56:41.074273Z
false
NoamB/sorcery
https://github.com/NoamB/sorcery/blob/4aaf38363eddf7a2982312ce68f0105dcc4ae8dc/spec/rails_app/db/migrate/activity_logging/20101224223624_add_activity_logging_to_users.rb
spec/rails_app/db/migrate/activity_logging/20101224223624_add_activity_logging_to_users.rb
class AddActivityLoggingToUsers < ActiveRecord::Migration def self.up add_column :users, :last_login_at, :datetime, :default => nil add_column :users, :last_logout_at, :datetime, :default => nil add_column :users, :last_activity_at, :datetime, :default => nil add_column :users, :last_login_fro...
ruby
MIT
4aaf38363eddf7a2982312ce68f0105dcc4ae8dc
2026-01-04T15:56:41.074273Z
false
NoamB/sorcery
https://github.com/NoamB/sorcery/blob/4aaf38363eddf7a2982312ce68f0105dcc4ae8dc/spec/rails_app/db/migrate/reset_password/20101224223622_add_reset_password_to_users.rb
spec/rails_app/db/migrate/reset_password/20101224223622_add_reset_password_to_users.rb
class AddResetPasswordToUsers < ActiveRecord::Migration def self.up add_column :users, :reset_password_token, :string, :default => nil add_column :users, :reset_password_token_expires_at, :datetime, :default => nil add_column :users, :reset_password_email_sent_at, :datetime, :default => nil end def s...
ruby
MIT
4aaf38363eddf7a2982312ce68f0105dcc4ae8dc
2026-01-04T15:56:41.074273Z
false
NoamB/sorcery
https://github.com/NoamB/sorcery/blob/4aaf38363eddf7a2982312ce68f0105dcc4ae8dc/spec/rails_app/db/migrate/activation/20101224223622_add_activation_to_users.rb
spec/rails_app/db/migrate/activation/20101224223622_add_activation_to_users.rb
class AddActivationToUsers < ActiveRecord::Migration def self.up add_column :users, :activation_state, :string, :default => nil add_column :users, :activation_token, :string, :default => nil add_column :users, :activation_token_expires_at, :datetime, :default => nil add_index :users, :activation_toke...
ruby
MIT
4aaf38363eddf7a2982312ce68f0105dcc4ae8dc
2026-01-04T15:56:41.074273Z
false
NoamB/sorcery
https://github.com/NoamB/sorcery/blob/4aaf38363eddf7a2982312ce68f0105dcc4ae8dc/spec/rails_app/config/application.rb
spec/rails_app/config/application.rb
require File.expand_path('../boot', __FILE__) require "action_controller/railtie" require "action_mailer/railtie" require "rails/test_unit/railtie" Bundler.require :default, SORCERY_ORM begin require "#{SORCERY_ORM}/railtie" rescue LoadError end require "sorcery" module AppRoot class Application < Rails::Appli...
ruby
MIT
4aaf38363eddf7a2982312ce68f0105dcc4ae8dc
2026-01-04T15:56:41.074273Z
false
NoamB/sorcery
https://github.com/NoamB/sorcery/blob/4aaf38363eddf7a2982312ce68f0105dcc4ae8dc/spec/rails_app/config/environment.rb
spec/rails_app/config/environment.rb
# Load the rails application require File.expand_path('../application', __FILE__) # Initialize the rails application AppRoot::Application.initialize!
ruby
MIT
4aaf38363eddf7a2982312ce68f0105dcc4ae8dc
2026-01-04T15:56:41.074273Z
false
NoamB/sorcery
https://github.com/NoamB/sorcery/blob/4aaf38363eddf7a2982312ce68f0105dcc4ae8dc/spec/rails_app/config/routes.rb
spec/rails_app/config/routes.rb
AppRoot::Application.routes.draw do root :to => "application#index" controller :sorcery do get :test_login get :test_logout get :some_action post :test_return_to get :test_auto_login post :test_login_with_remember_in_login get :test_login_from_cookie get :test_login_from get :te...
ruby
MIT
4aaf38363eddf7a2982312ce68f0105dcc4ae8dc
2026-01-04T15:56:41.074273Z
false
NoamB/sorcery
https://github.com/NoamB/sorcery/blob/4aaf38363eddf7a2982312ce68f0105dcc4ae8dc/spec/rails_app/config/boot.rb
spec/rails_app/config/boot.rb
# Set up gems listed in the Gemfile. ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__) require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
ruby
MIT
4aaf38363eddf7a2982312ce68f0105dcc4ae8dc
2026-01-04T15:56:41.074273Z
false
NoamB/sorcery
https://github.com/NoamB/sorcery/blob/4aaf38363eddf7a2982312ce68f0105dcc4ae8dc/spec/rails_app/config/initializers/session_store.rb
spec/rails_app/config/initializers/session_store.rb
# Be sure to restart your server when you modify this file. AppRoot::Application.config.session_store :cookie_store, :key => '_app_root_session' # Use the database for sessions instead of the cookie-based default, # which shouldn't be used to store highly confidential information # (create the session table with "rai...
ruby
MIT
4aaf38363eddf7a2982312ce68f0105dcc4ae8dc
2026-01-04T15:56:41.074273Z
false
NoamB/sorcery
https://github.com/NoamB/sorcery/blob/4aaf38363eddf7a2982312ce68f0105dcc4ae8dc/spec/rails_app/config/initializers/inflections.rb
spec/rails_app/config/initializers/inflections.rb
# Be sure to restart your server when you modify this file. # Add new inflection rules using the following format # (all these examples are active by default): # ActiveSupport::Inflector.inflections do |inflect| # inflect.plural /^(ox)$/i, '\1en' # inflect.singular /^(ox)en/i, '\1' # inflect.irregular 'person', ...
ruby
MIT
4aaf38363eddf7a2982312ce68f0105dcc4ae8dc
2026-01-04T15:56:41.074273Z
false
NoamB/sorcery
https://github.com/NoamB/sorcery/blob/4aaf38363eddf7a2982312ce68f0105dcc4ae8dc/spec/rails_app/config/initializers/backtrace_silencers.rb
spec/rails_app/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
4aaf38363eddf7a2982312ce68f0105dcc4ae8dc
2026-01-04T15:56:41.074273Z
false
NoamB/sorcery
https://github.com/NoamB/sorcery/blob/4aaf38363eddf7a2982312ce68f0105dcc4ae8dc/spec/rails_app/config/initializers/mime_types.rb
spec/rails_app/config/initializers/mime_types.rb
# Be sure to restart your server when you modify this file. # Add new mime types for use in respond_to blocks: # Mime::Type.register "text/richtext", :rtf # Mime::Type.register_alias "text/html", :iphone
ruby
MIT
4aaf38363eddf7a2982312ce68f0105dcc4ae8dc
2026-01-04T15:56:41.074273Z
false
NoamB/sorcery
https://github.com/NoamB/sorcery/blob/4aaf38363eddf7a2982312ce68f0105dcc4ae8dc/spec/rails_app/config/initializers/secret_token.rb
spec/rails_app/config/initializers/secret_token.rb
# Be sure to restart your server when you modify this file. # Your secret key for verifying the integrity of signed cookies. # If you change this key, all old signed cookies will become invalid! # Make sure the secret is at least 30 characters and all random, # no regular words or you'll be exposed to dictionary attac...
ruby
MIT
4aaf38363eddf7a2982312ce68f0105dcc4ae8dc
2026-01-04T15:56:41.074273Z
false