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
Netflix/fast_jsonapi
https://github.com/Netflix/fast_jsonapi/blob/68a5515bb33c6ba4f1df4d4f7b51d33eb2bcf3a7/lib/fast_jsonapi/instrumentation/skylight/normalizers/base.rb
lib/fast_jsonapi/instrumentation/skylight/normalizers/base.rb
require 'skylight' SKYLIGHT_NORMALIZER_BASE_CLASS = begin ::Skylight::Core::Normalizers::Normalizer rescue NameError ::Skylight::Normalizers::Normalizer end
ruby
Apache-2.0
68a5515bb33c6ba4f1df4d4f7b51d33eb2bcf3a7
2026-01-04T15:44:27.122992Z
false
Netflix/fast_jsonapi
https://github.com/Netflix/fast_jsonapi/blob/68a5515bb33c6ba4f1df4d4f7b51d33eb2bcf3a7/lib/fast_jsonapi/instrumentation/skylight/normalizers/serializable_hash.rb
lib/fast_jsonapi/instrumentation/skylight/normalizers/serializable_hash.rb
require 'fast_jsonapi/instrumentation/skylight/normalizers/base' require 'fast_jsonapi/instrumentation/serializable_hash' module FastJsonapi module Instrumentation module Skylight module Normalizers class SerializableHash < SKYLIGHT_NORMALIZER_BASE_CLASS register FastJsonapi::ObjectSeria...
ruby
Apache-2.0
68a5515bb33c6ba4f1df4d4f7b51d33eb2bcf3a7
2026-01-04T15:44:27.122992Z
false
Netflix/fast_jsonapi
https://github.com/Netflix/fast_jsonapi/blob/68a5515bb33c6ba4f1df4d4f7b51d33eb2bcf3a7/lib/extensions/has_one.rb
lib/extensions/has_one.rb
# frozen_string_literal: true ::ActiveRecord::Associations::Builder::HasOne.class_eval do # Based on # https://github.com/rails/rails/blob/master/activerecord/lib/active_record/associations/builder/collection_association.rb#L50 # https://github.com/rails/rails/blob/master/activerecord/lib/active_record/associati...
ruby
Apache-2.0
68a5515bb33c6ba4f1df4d4f7b51d33eb2bcf3a7
2026-01-04T15:44:27.122992Z
false
Netflix/fast_jsonapi
https://github.com/Netflix/fast_jsonapi/blob/68a5515bb33c6ba4f1df4d4f7b51d33eb2bcf3a7/lib/generators/serializer/serializer_generator.rb
lib/generators/serializer/serializer_generator.rb
# frozen_string_literal: true require 'rails/generators/base' class SerializerGenerator < Rails::Generators::NamedBase source_root File.expand_path('templates', __dir__) argument :attributes, type: :array, default: [], banner: 'field field' def create_serializer_file template 'serializer.rb.tt', File.join...
ruby
Apache-2.0
68a5515bb33c6ba4f1df4d4f7b51d33eb2bcf3a7
2026-01-04T15:44:27.122992Z
false
mbleigh/acts-as-taggable-on
https://github.com/mbleigh/acts-as-taggable-on/blob/380c0bc4fd7e2c043593d8411250aba268101672/db/migrate/1_setup_acts_as_taggable_on.rb
db/migrate/1_setup_acts_as_taggable_on.rb
# frozen_string_literal: true # Combined migration for acts_as_taggable_on setup # Combines migrations 1-7 from acts_as_taggable_on_engine class SetupActsAsTaggableOn < ActiveRecord::Migration[7.1] def up # Create tags table unless table_exists?(ActsAsTaggableOn.tags_table) create_table ActsAsTaggableO...
ruby
MIT
380c0bc4fd7e2c043593d8411250aba268101672
2026-01-04T15:44:35.730653Z
false
mbleigh/acts-as-taggable-on
https://github.com/mbleigh/acts-as-taggable-on/blob/380c0bc4fd7e2c043593d8411250aba268101672/spec/spec_helper.rb
spec/spec_helper.rb
begin require 'byebug' rescue LoadError end $LOAD_PATH << '.' unless $LOAD_PATH.include?('.') $LOAD_PATH.unshift(File.expand_path('../../lib', __FILE__)) require 'logger' require File.expand_path('../../lib/acts-as-taggable-on', __FILE__) I18n.enforce_available_locales = true require 'rails' require 'rspec/its' requ...
ruby
MIT
380c0bc4fd7e2c043593d8411250aba268101672
2026-01-04T15:44:35.730653Z
false
mbleigh/acts-as-taggable-on
https://github.com/mbleigh/acts-as-taggable-on/blob/380c0bc4fd7e2c043593d8411250aba268101672/spec/support/0-helpers.rb
spec/support/0-helpers.rb
def using_sqlite? ActsAsTaggableOn::Utils.connection && ActsAsTaggableOn::Utils.connection.adapter_name == 'SQLite' end def supports_concurrency? !using_sqlite? end def using_postgresql? ActsAsTaggableOn::Utils.using_postgresql? end def postgresql_version if using_postgresql? ActsAsTaggableOn::Utils.conn...
ruby
MIT
380c0bc4fd7e2c043593d8411250aba268101672
2026-01-04T15:44:35.730653Z
false
mbleigh/acts-as-taggable-on
https://github.com/mbleigh/acts-as-taggable-on/blob/380c0bc4fd7e2c043593d8411250aba268101672/spec/support/array.rb
spec/support/array.rb
unless [].respond_to?(:freq) class Array def freq k=Hash.new(0) each { |e| k[e]+=1 } k end end end
ruby
MIT
380c0bc4fd7e2c043593d8411250aba268101672
2026-01-04T15:44:35.730653Z
false
mbleigh/acts-as-taggable-on
https://github.com/mbleigh/acts-as-taggable-on/blob/380c0bc4fd7e2c043593d8411250aba268101672/spec/support/database.rb
spec/support/database.rb
# frozen_string_literal: true # set adapter to use, default is sqlite3 # to use an alternative adapter run => rake spec DB='postgresql' db_name = ENV['DB'] || 'sqlite3' database_yml = File.expand_path('../internal/config/database.yml', __dir__) unless File.exist?(database_yml) raise "Please create #{database_yml} f...
ruby
MIT
380c0bc4fd7e2c043593d8411250aba268101672
2026-01-04T15:44:35.730653Z
false
mbleigh/acts-as-taggable-on
https://github.com/mbleigh/acts-as-taggable-on/blob/380c0bc4fd7e2c043593d8411250aba268101672/spec/acts_as_taggable_on/tag_list_spec.rb
spec/acts_as_taggable_on/tag_list_spec.rb
require 'spec_helper' RSpec.describe ActsAsTaggableOn::TagList do let(:tag_list) { ActsAsTaggableOn::TagList.new('awesome', 'radical') } let(:another_tag_list) { ActsAsTaggableOn::TagList.new('awesome','crazy', 'alien') } it { should be_kind_of Array } describe '#add' do it 'should be able to be add a ...
ruby
MIT
380c0bc4fd7e2c043593d8411250aba268101672
2026-01-04T15:44:35.730653Z
false
mbleigh/acts-as-taggable-on
https://github.com/mbleigh/acts-as-taggable-on/blob/380c0bc4fd7e2c043593d8411250aba268101672/spec/acts_as_taggable_on/single_table_inheritance_spec.rb
spec/acts_as_taggable_on/single_table_inheritance_spec.rb
require 'spec_helper' RSpec.describe 'Single Table Inheritance' do let(:taggable) { TaggableModel.new(name: 'taggable model') } let(:inheriting_model) { InheritingTaggableModel.new(name: 'Inheriting Taggable Model') } let(:altered_inheriting) { AlteredInheritingTaggableModel.new(name: 'Altered Inheriting Model'...
ruby
MIT
380c0bc4fd7e2c043593d8411250aba268101672
2026-01-04T15:44:35.730653Z
false
mbleigh/acts-as-taggable-on
https://github.com/mbleigh/acts-as-taggable-on/blob/380c0bc4fd7e2c043593d8411250aba268101672/spec/acts_as_taggable_on/related_spec.rb
spec/acts_as_taggable_on/related_spec.rb
require 'spec_helper' RSpec.describe 'Acts As Taggable On' do describe 'Related Objects' do #TODO, shared example it 'should find related objects based on tag names on context' do taggable1 = TaggableModel.create!(name: 'Taggable 1',tag_list: 'one, two') taggable2 = TaggableModel.create!(name: ...
ruby
MIT
380c0bc4fd7e2c043593d8411250aba268101672
2026-01-04T15:44:35.730653Z
false
mbleigh/acts-as-taggable-on
https://github.com/mbleigh/acts-as-taggable-on/blob/380c0bc4fd7e2c043593d8411250aba268101672/spec/acts_as_taggable_on/utils_spec.rb
spec/acts_as_taggable_on/utils_spec.rb
require 'spec_helper' RSpec.describe ActsAsTaggableOn::Utils do describe '#like_operator' do it 'should return \'ILIKE\' when the adapter is PostgreSQL' do allow(ActsAsTaggableOn::Utils.connection).to receive(:adapter_name) { 'PostgreSQL' } expect(ActsAsTaggableOn::Utils.like_operator).to eq('ILIKE')...
ruby
MIT
380c0bc4fd7e2c043593d8411250aba268101672
2026-01-04T15:44:35.730653Z
false
mbleigh/acts-as-taggable-on
https://github.com/mbleigh/acts-as-taggable-on/blob/380c0bc4fd7e2c043593d8411250aba268101672/spec/acts_as_taggable_on/tagging_spec.rb
spec/acts_as_taggable_on/tagging_spec.rb
require 'spec_helper' RSpec.describe ActsAsTaggableOn::Tagging do before(:each) do @tagging = ActsAsTaggableOn::Tagging.new end it 'should not be valid with a invalid tag' do @tagging.taggable = TaggableModel.create(name: 'Bob Jones') @tagging.tag = ActsAsTaggableOn::Tag.new(name: '') @tagging.c...
ruby
MIT
380c0bc4fd7e2c043593d8411250aba268101672
2026-01-04T15:44:35.730653Z
false
mbleigh/acts-as-taggable-on
https://github.com/mbleigh/acts-as-taggable-on/blob/380c0bc4fd7e2c043593d8411250aba268101672/spec/acts_as_taggable_on/default_parser_spec.rb
spec/acts_as_taggable_on/default_parser_spec.rb
require 'spec_helper' RSpec.describe ActsAsTaggableOn::DefaultParser do it '#parse should return empty array if empty array is passed' do parser = ActsAsTaggableOn::DefaultParser.new([]) expect(parser.parse).to be_empty end describe 'Multiple Delimiter' do before do @old_delimiter = ActsAsTagg...
ruby
MIT
380c0bc4fd7e2c043593d8411250aba268101672
2026-01-04T15:44:35.730653Z
false
mbleigh/acts-as-taggable-on
https://github.com/mbleigh/acts-as-taggable-on/blob/380c0bc4fd7e2c043593d8411250aba268101672/spec/acts_as_taggable_on/tags_helper_spec.rb
spec/acts_as_taggable_on/tags_helper_spec.rb
require 'spec_helper' RSpec.describe ActsAsTaggableOn::TagsHelper do before(:each) do @bob = TaggableModel.create(name: 'Bob Jones', language_list: 'ruby, php') @tom = TaggableModel.create(name: 'Tom Marley', language_list: 'ruby, java') @eve = TaggableModel.create(name: 'Eve Nodd', language_list: 'ruby,...
ruby
MIT
380c0bc4fd7e2c043593d8411250aba268101672
2026-01-04T15:44:35.730653Z
false
mbleigh/acts-as-taggable-on
https://github.com/mbleigh/acts-as-taggable-on/blob/380c0bc4fd7e2c043593d8411250aba268101672/spec/acts_as_taggable_on/acts_as_tagger_spec.rb
spec/acts_as_taggable_on/acts_as_tagger_spec.rb
require 'spec_helper' RSpec.describe 'acts_as_tagger' do describe 'Tagger Method Generation' do before(:each) do @tagger = User.new end it 'should add #is_tagger? query method to the class-side' do expect(User).to respond_to(:is_tagger?) end it 'should return true from the class-si...
ruby
MIT
380c0bc4fd7e2c043593d8411250aba268101672
2026-01-04T15:44:35.730653Z
false
mbleigh/acts-as-taggable-on
https://github.com/mbleigh/acts-as-taggable-on/blob/380c0bc4fd7e2c043593d8411250aba268101672/spec/acts_as_taggable_on/generic_parser_spec.rb
spec/acts_as_taggable_on/generic_parser_spec.rb
require 'spec_helper' RSpec.describe ActsAsTaggableOn::GenericParser do it '#parse should return empty array if empty tag string is passed' do tag_list = ActsAsTaggableOn::GenericParser.new('') expect(tag_list.parse).to be_empty end it '#parse should separate tags by comma' do tag_list = ActsAsTagga...
ruby
MIT
380c0bc4fd7e2c043593d8411250aba268101672
2026-01-04T15:44:35.730653Z
false
mbleigh/acts-as-taggable-on
https://github.com/mbleigh/acts-as-taggable-on/blob/380c0bc4fd7e2c043593d8411250aba268101672/spec/acts_as_taggable_on/dirty_spec.rb
spec/acts_as_taggable_on/dirty_spec.rb
require 'spec_helper' RSpec.describe 'Dirty behavior of taggable objects' do context 'with un-contexted tags' do before(:each) do @taggable = TaggableModel.create(tag_list: 'awesome, epic') end context 'when tag_list changed' do before(:each) do expect(@taggable.changes).to be_empty ...
ruby
MIT
380c0bc4fd7e2c043593d8411250aba268101672
2026-01-04T15:44:35.730653Z
false
mbleigh/acts-as-taggable-on
https://github.com/mbleigh/acts-as-taggable-on/blob/380c0bc4fd7e2c043593d8411250aba268101672/spec/acts_as_taggable_on/tag_spec.rb
spec/acts_as_taggable_on/tag_spec.rb
require 'spec_helper' require 'db/migrate/2_add_missing_unique_indices.rb' RSpec.shared_examples_for 'without unique index' do prepend_before(:all) { AddMissingUniqueIndices.down } append_after(:all) do ActsAsTaggableOn::Tag.delete_all AddMissingUniqueIndices.up end end RSpec.describe ActsAsTaggableOn::...
ruby
MIT
380c0bc4fd7e2c043593d8411250aba268101672
2026-01-04T15:44:35.730653Z
false
mbleigh/acts-as-taggable-on
https://github.com/mbleigh/acts-as-taggable-on/blob/380c0bc4fd7e2c043593d8411250aba268101672/spec/acts_as_taggable_on/taggable_spec.rb
spec/acts_as_taggable_on/taggable_spec.rb
require 'spec_helper' RSpec.describe 'Taggable To Preserve Order' do before(:each) do @taggable = OrderedTaggableModel.new(name: 'Bob Jones') end it 'should have tag associations' do [:tags, :colours].each do |type| expect(@taggable.respond_to?(type)).to be_truthy expect(@taggable.respond_t...
ruby
MIT
380c0bc4fd7e2c043593d8411250aba268101672
2026-01-04T15:44:35.730653Z
true
mbleigh/acts-as-taggable-on
https://github.com/mbleigh/acts-as-taggable-on/blob/380c0bc4fd7e2c043593d8411250aba268101672/spec/acts_as_taggable_on/caching_spec.rb
spec/acts_as_taggable_on/caching_spec.rb
require 'spec_helper' RSpec.describe 'Acts As Taggable On' do describe 'Caching' do before(:each) do @taggable = CachedModel.new(name: 'Bob Jones') @another_taggable = OtherCachedModel.new(name: 'John Smith') end it 'should add saving of tag lists and cached tag lists to the instance' do ...
ruby
MIT
380c0bc4fd7e2c043593d8411250aba268101672
2026-01-04T15:44:35.730653Z
false
mbleigh/acts-as-taggable-on
https://github.com/mbleigh/acts-as-taggable-on/blob/380c0bc4fd7e2c043593d8411250aba268101672/spec/acts_as_taggable_on/tagger_spec.rb
spec/acts_as_taggable_on/tagger_spec.rb
require 'spec_helper' RSpec.describe 'Tagger' do before(:each) do @user = User.create @taggable = TaggableModel.create(name: 'Bob Jones') end it 'should have taggings' do @user.tag(@taggable, with: 'ruby,scheme', on: :tags) expect(@user.owned_taggings.size).to eq(2) end it 'should have tags...
ruby
MIT
380c0bc4fd7e2c043593d8411250aba268101672
2026-01-04T15:44:35.730653Z
false
mbleigh/acts-as-taggable-on
https://github.com/mbleigh/acts-as-taggable-on/blob/380c0bc4fd7e2c043593d8411250aba268101672/spec/acts_as_taggable_on/acts_as_taggable_on_spec.rb
spec/acts_as_taggable_on/acts_as_taggable_on_spec.rb
require 'spec_helper' RSpec.describe 'Acts As Taggable On' do it "should provide a class method 'taggable?' that is false for untaggable models" do expect(UntaggableModel).to_not be_taggable end describe 'Taggable Method Generation To Preserve Order' do before(:each) do TaggableModel.tag_types = ...
ruby
MIT
380c0bc4fd7e2c043593d8411250aba268101672
2026-01-04T15:44:35.730653Z
false
mbleigh/acts-as-taggable-on
https://github.com/mbleigh/acts-as-taggable-on/blob/380c0bc4fd7e2c043593d8411250aba268101672/spec/internal/app/models/student.rb
spec/internal/app/models/student.rb
require_relative 'user' class Student < User end
ruby
MIT
380c0bc4fd7e2c043593d8411250aba268101672
2026-01-04T15:44:35.730653Z
false
mbleigh/acts-as-taggable-on
https://github.com/mbleigh/acts-as-taggable-on/blob/380c0bc4fd7e2c043593d8411250aba268101672/spec/internal/app/models/taggable_model.rb
spec/internal/app/models/taggable_model.rb
class TaggableModel < ActiveRecord::Base acts_as_taggable acts_as_taggable_on :languages acts_as_taggable_on :skills acts_as_taggable_on :needs, :offerings acts_as_taggable_tenant :tenant_id has_many :untaggable_models attr_reader :tag_list_submethod_called def tag_list=(v) @tag_list_submethod_ca...
ruby
MIT
380c0bc4fd7e2c043593d8411250aba268101672
2026-01-04T15:44:35.730653Z
false
mbleigh/acts-as-taggable-on
https://github.com/mbleigh/acts-as-taggable-on/blob/380c0bc4fd7e2c043593d8411250aba268101672/spec/internal/app/models/altered_inheriting_taggable_model.rb
spec/internal/app/models/altered_inheriting_taggable_model.rb
require_relative 'taggable_model' class AlteredInheritingTaggableModel < TaggableModel acts_as_taggable_on :parts end
ruby
MIT
380c0bc4fd7e2c043593d8411250aba268101672
2026-01-04T15:44:35.730653Z
false
mbleigh/acts-as-taggable-on
https://github.com/mbleigh/acts-as-taggable-on/blob/380c0bc4fd7e2c043593d8411250aba268101672/spec/internal/app/models/other_cached_model.rb
spec/internal/app/models/other_cached_model.rb
class OtherCachedModel < ActiveRecord::Base acts_as_taggable_on :languages, :statuses, :glasses end
ruby
MIT
380c0bc4fd7e2c043593d8411250aba268101672
2026-01-04T15:44:35.730653Z
false
mbleigh/acts-as-taggable-on
https://github.com/mbleigh/acts-as-taggable-on/blob/380c0bc4fd7e2c043593d8411250aba268101672/spec/internal/app/models/untaggable_model.rb
spec/internal/app/models/untaggable_model.rb
class UntaggableModel < ActiveRecord::Base belongs_to :taggable_model end
ruby
MIT
380c0bc4fd7e2c043593d8411250aba268101672
2026-01-04T15:44:35.730653Z
false
mbleigh/acts-as-taggable-on
https://github.com/mbleigh/acts-as-taggable-on/blob/380c0bc4fd7e2c043593d8411250aba268101672/spec/internal/app/models/cached_model_with_array.rb
spec/internal/app/models/cached_model_with_array.rb
if using_postgresql? class CachedModelWithArray < ActiveRecord::Base acts_as_taggable end if postgresql_support_json? class TaggableModelWithJson < ActiveRecord::Base acts_as_taggable acts_as_taggable_on :skills end end end
ruby
MIT
380c0bc4fd7e2c043593d8411250aba268101672
2026-01-04T15:44:35.730653Z
false
mbleigh/acts-as-taggable-on
https://github.com/mbleigh/acts-as-taggable-on/blob/380c0bc4fd7e2c043593d8411250aba268101672/spec/internal/app/models/inheriting_taggable_model.rb
spec/internal/app/models/inheriting_taggable_model.rb
require_relative 'taggable_model' class InheritingTaggableModel < TaggableModel end
ruby
MIT
380c0bc4fd7e2c043593d8411250aba268101672
2026-01-04T15:44:35.730653Z
false
mbleigh/acts-as-taggable-on
https://github.com/mbleigh/acts-as-taggable-on/blob/380c0bc4fd7e2c043593d8411250aba268101672/spec/internal/app/models/cached_model.rb
spec/internal/app/models/cached_model.rb
class CachedModel < ActiveRecord::Base acts_as_taggable end
ruby
MIT
380c0bc4fd7e2c043593d8411250aba268101672
2026-01-04T15:44:35.730653Z
false
mbleigh/acts-as-taggable-on
https://github.com/mbleigh/acts-as-taggable-on/blob/380c0bc4fd7e2c043593d8411250aba268101672/spec/internal/app/models/market.rb
spec/internal/app/models/market.rb
class Market < ActsAsTaggableOn::Tag end
ruby
MIT
380c0bc4fd7e2c043593d8411250aba268101672
2026-01-04T15:44:35.730653Z
false
mbleigh/acts-as-taggable-on
https://github.com/mbleigh/acts-as-taggable-on/blob/380c0bc4fd7e2c043593d8411250aba268101672/spec/internal/app/models/other_taggable_model.rb
spec/internal/app/models/other_taggable_model.rb
class OtherTaggableModel < ActiveRecord::Base acts_as_taggable_on :tags, :languages acts_as_taggable_on :needs, :offerings end
ruby
MIT
380c0bc4fd7e2c043593d8411250aba268101672
2026-01-04T15:44:35.730653Z
false
mbleigh/acts-as-taggable-on
https://github.com/mbleigh/acts-as-taggable-on/blob/380c0bc4fd7e2c043593d8411250aba268101672/spec/internal/app/models/columns_override_model.rb
spec/internal/app/models/columns_override_model.rb
class ColumnsOverrideModel < ActiveRecord::Base def self.columns super.reject { |c| c.name == 'ignored_column' } end end
ruby
MIT
380c0bc4fd7e2c043593d8411250aba268101672
2026-01-04T15:44:35.730653Z
false
mbleigh/acts-as-taggable-on
https://github.com/mbleigh/acts-as-taggable-on/blob/380c0bc4fd7e2c043593d8411250aba268101672/spec/internal/app/models/non_standard_id_taggable_model.rb
spec/internal/app/models/non_standard_id_taggable_model.rb
class NonStandardIdTaggableModel < ActiveRecord::Base self.primary_key = :an_id acts_as_taggable acts_as_taggable_on :languages acts_as_taggable_on :skills acts_as_taggable_on :needs, :offerings has_many :untaggable_models end
ruby
MIT
380c0bc4fd7e2c043593d8411250aba268101672
2026-01-04T15:44:35.730653Z
false
mbleigh/acts-as-taggable-on
https://github.com/mbleigh/acts-as-taggable-on/blob/380c0bc4fd7e2c043593d8411250aba268101672/spec/internal/app/models/ordered_taggable_model.rb
spec/internal/app/models/ordered_taggable_model.rb
class OrderedTaggableModel < ActiveRecord::Base acts_as_ordered_taggable acts_as_ordered_taggable_on :colours end
ruby
MIT
380c0bc4fd7e2c043593d8411250aba268101672
2026-01-04T15:44:35.730653Z
false
mbleigh/acts-as-taggable-on
https://github.com/mbleigh/acts-as-taggable-on/blob/380c0bc4fd7e2c043593d8411250aba268101672/spec/internal/app/models/company.rb
spec/internal/app/models/company.rb
class Company < ActiveRecord::Base acts_as_taggable_on :locations, :markets has_many :markets, :through => :market_taggings, :source => :tag private def find_or_create_tags_from_list_with_context(tag_list, context) if context.to_sym == :markets Market.find_or_create_all_with_like_by_name(tag_list) ...
ruby
MIT
380c0bc4fd7e2c043593d8411250aba268101672
2026-01-04T15:44:35.730653Z
false
mbleigh/acts-as-taggable-on
https://github.com/mbleigh/acts-as-taggable-on/blob/380c0bc4fd7e2c043593d8411250aba268101672/spec/internal/app/models/user.rb
spec/internal/app/models/user.rb
class User < ActiveRecord::Base acts_as_tagger end
ruby
MIT
380c0bc4fd7e2c043593d8411250aba268101672
2026-01-04T15:44:35.730653Z
false
mbleigh/acts-as-taggable-on
https://github.com/mbleigh/acts-as-taggable-on/blob/380c0bc4fd7e2c043593d8411250aba268101672/spec/internal/db/schema.rb
spec/internal/db/schema.rb
ActiveRecord::Schema.define version: 0 do create_table ActsAsTaggableOn.tags_table, force: true do |t| t.string :name t.integer :taggings_count, default: 0 t.string :type end add_index ActsAsTaggableOn.tags_table, ['name'], name: 'index_tags_on_name', unique: true create_table ActsAsTaggableOn.tagg...
ruby
MIT
380c0bc4fd7e2c043593d8411250aba268101672
2026-01-04T15:44:35.730653Z
false
mbleigh/acts-as-taggable-on
https://github.com/mbleigh/acts-as-taggable-on/blob/380c0bc4fd7e2c043593d8411250aba268101672/lib/acts-as-taggable-on.rb
lib/acts-as-taggable-on.rb
require 'active_record' require 'active_record/version' require 'active_support/core_ext/module' require 'zeitwerk' loader = Zeitwerk::Loader.for_gem loader.inflector.inflect "acts-as-taggable-on" => "ActsAsTaggableOn" loader.setup begin require 'rails/engine' require 'acts-as-taggable-on/engine' rescue LoadError...
ruby
MIT
380c0bc4fd7e2c043593d8411250aba268101672
2026-01-04T15:44:35.730653Z
false
mbleigh/acts-as-taggable-on
https://github.com/mbleigh/acts-as-taggable-on/blob/380c0bc4fd7e2c043593d8411250aba268101672/lib/acts-as-taggable-on/tag.rb
lib/acts-as-taggable-on/tag.rb
# frozen_string_literal: true module ActsAsTaggableOn class Tag < ActsAsTaggableOn.base_class.constantize self.table_name = ActsAsTaggableOn.tags_table ### ASSOCIATIONS: has_many :taggings, dependent: :destroy, class_name: '::ActsAsTaggableOn::Tagging' ### VALIDATIONS: validates_presence_of :...
ruby
MIT
380c0bc4fd7e2c043593d8411250aba268101672
2026-01-04T15:44:35.730653Z
false
mbleigh/acts-as-taggable-on
https://github.com/mbleigh/acts-as-taggable-on/blob/380c0bc4fd7e2c043593d8411250aba268101672/lib/acts-as-taggable-on/default_parser.rb
lib/acts-as-taggable-on/default_parser.rb
# frozen_string_literal: true module ActsAsTaggableOn ## # Returns a new TagList using the given tag string. # # Example: # tag_list = ActsAsTaggableOn::DefaultParser.parse("One , Two, Three") # tag_list # ["One", "Two", "Three"] class DefaultParser < GenericParser def parse string = @tag_...
ruby
MIT
380c0bc4fd7e2c043593d8411250aba268101672
2026-01-04T15:44:35.730653Z
false
mbleigh/acts-as-taggable-on
https://github.com/mbleigh/acts-as-taggable-on/blob/380c0bc4fd7e2c043593d8411250aba268101672/lib/acts-as-taggable-on/version.rb
lib/acts-as-taggable-on/version.rb
# frozen_string_literal: true module ActsAsTaggableOn VERSION = '13.0.0' end
ruby
MIT
380c0bc4fd7e2c043593d8411250aba268101672
2026-01-04T15:44:35.730653Z
false
mbleigh/acts-as-taggable-on
https://github.com/mbleigh/acts-as-taggable-on/blob/380c0bc4fd7e2c043593d8411250aba268101672/lib/acts-as-taggable-on/tag_list.rb
lib/acts-as-taggable-on/tag_list.rb
# frozen_string_literal: true require 'active_support/core_ext/module/delegation' module ActsAsTaggableOn class TagList < Array attr_accessor :owner, :parser def initialize(*args) @parser = ActsAsTaggableOn.default_parser add(*args) end ## # Add tags to the tag_list. Duplicate or b...
ruby
MIT
380c0bc4fd7e2c043593d8411250aba268101672
2026-01-04T15:44:35.730653Z
false
mbleigh/acts-as-taggable-on
https://github.com/mbleigh/acts-as-taggable-on/blob/380c0bc4fd7e2c043593d8411250aba268101672/lib/acts-as-taggable-on/tagger.rb
lib/acts-as-taggable-on/tagger.rb
# frozen_string_literal: true module ActsAsTaggableOn module Tagger extend ActiveSupport::Concern class_methods do ## # Make a model a tagger. This allows an instance of a model to claim ownership # of tags. # # Example: # class User < ActiveRecord::Base # act...
ruby
MIT
380c0bc4fd7e2c043593d8411250aba268101672
2026-01-04T15:44:35.730653Z
false
mbleigh/acts-as-taggable-on
https://github.com/mbleigh/acts-as-taggable-on/blob/380c0bc4fd7e2c043593d8411250aba268101672/lib/acts-as-taggable-on/tags_helper.rb
lib/acts-as-taggable-on/tags_helper.rb
# frozen_string_literal: true module ActsAsTaggableOn module TagsHelper # See the wiki for an example using tag_cloud. def tag_cloud(tags, classes) return [] if tags.empty? max_count = tags.max_by(&:taggings_count).taggings_count.to_f tags.each do |tag| index = ((tag.taggings_coun...
ruby
MIT
380c0bc4fd7e2c043593d8411250aba268101672
2026-01-04T15:44:35.730653Z
false
mbleigh/acts-as-taggable-on
https://github.com/mbleigh/acts-as-taggable-on/blob/380c0bc4fd7e2c043593d8411250aba268101672/lib/acts-as-taggable-on/utils.rb
lib/acts-as-taggable-on/utils.rb
# frozen_string_literal: true # This module is deprecated and will be removed in the incoming versions module ActsAsTaggableOn module Utils class << self # Use ActsAsTaggableOn::Tag connection def connection ActsAsTaggableOn::Tag.connection end def using_postgresql? conn...
ruby
MIT
380c0bc4fd7e2c043593d8411250aba268101672
2026-01-04T15:44:35.730653Z
false
mbleigh/acts-as-taggable-on
https://github.com/mbleigh/acts-as-taggable-on/blob/380c0bc4fd7e2c043593d8411250aba268101672/lib/acts-as-taggable-on/taggable.rb
lib/acts-as-taggable-on/taggable.rb
# frozen_string_literal: true module ActsAsTaggableOn module Taggable def taggable? false end ## # This is an alias for calling <tt>acts_as_taggable_on :tags</tt>. # # Example: # class Book < ActiveRecord::Base # acts_as_taggable # end def acts_as_taggable ...
ruby
MIT
380c0bc4fd7e2c043593d8411250aba268101672
2026-01-04T15:44:35.730653Z
false
mbleigh/acts-as-taggable-on
https://github.com/mbleigh/acts-as-taggable-on/blob/380c0bc4fd7e2c043593d8411250aba268101672/lib/acts-as-taggable-on/tagging.rb
lib/acts-as-taggable-on/tagging.rb
# frozen_string_literal: true module ActsAsTaggableOn class Tagging < ActsAsTaggableOn.base_class.constantize # :nodoc: self.table_name = ActsAsTaggableOn.taggings_table DEFAULT_CONTEXT = 'tags' belongs_to :tag, class_name: '::ActsAsTaggableOn::Tag', counter_cache: ActsAsTaggableOn.tags_counter belo...
ruby
MIT
380c0bc4fd7e2c043593d8411250aba268101672
2026-01-04T15:44:35.730653Z
false
mbleigh/acts-as-taggable-on
https://github.com/mbleigh/acts-as-taggable-on/blob/380c0bc4fd7e2c043593d8411250aba268101672/lib/acts-as-taggable-on/engine.rb
lib/acts-as-taggable-on/engine.rb
# frozen_string_literal: true module ActsAsTaggableOn class Engine < Rails::Engine end end
ruby
MIT
380c0bc4fd7e2c043593d8411250aba268101672
2026-01-04T15:44:35.730653Z
false
mbleigh/acts-as-taggable-on
https://github.com/mbleigh/acts-as-taggable-on/blob/380c0bc4fd7e2c043593d8411250aba268101672/lib/acts-as-taggable-on/generic_parser.rb
lib/acts-as-taggable-on/generic_parser.rb
# frozen_string_literal: true module ActsAsTaggableOn ## # Returns a new TagList using the given tag string. # # Example: # tag_list = ActsAsTaggableOn::GenericParser.new.parse("One , Two, Three") # tag_list # ["One", "Two", "Three"] class GenericParser def initialize(tag_list) @tag_list = tag_...
ruby
MIT
380c0bc4fd7e2c043593d8411250aba268101672
2026-01-04T15:44:35.730653Z
false
mbleigh/acts-as-taggable-on
https://github.com/mbleigh/acts-as-taggable-on/blob/380c0bc4fd7e2c043593d8411250aba268101672/lib/acts-as-taggable-on/taggable/core.rb
lib/acts-as-taggable-on/taggable/core.rb
# frozen_string_literal: true module ActsAsTaggableOn module Taggable module Core extend ActiveSupport::Concern included do attr_writer :custom_contexts after_save :save_tags initialize_acts_as_taggable_on_core end class_methods do def initialize_ac...
ruby
MIT
380c0bc4fd7e2c043593d8411250aba268101672
2026-01-04T15:44:35.730653Z
false
mbleigh/acts-as-taggable-on
https://github.com/mbleigh/acts-as-taggable-on/blob/380c0bc4fd7e2c043593d8411250aba268101672/lib/acts-as-taggable-on/taggable/collection.rb
lib/acts-as-taggable-on/taggable/collection.rb
# frozen_string_literal: true module ActsAsTaggableOn module Taggable module Collection extend ActiveSupport::Concern included do initialize_acts_as_taggable_on_collection end class_methods do def initialize_acts_as_taggable_on_collection tag_types.map(&:to_s)....
ruby
MIT
380c0bc4fd7e2c043593d8411250aba268101672
2026-01-04T15:44:35.730653Z
false
mbleigh/acts-as-taggable-on
https://github.com/mbleigh/acts-as-taggable-on/blob/380c0bc4fd7e2c043593d8411250aba268101672/lib/acts-as-taggable-on/taggable/related.rb
lib/acts-as-taggable-on/taggable/related.rb
# frozen_string_literal: true module ActsAsTaggableOn module Taggable module Related def self.included(base) base.extend ActsAsTaggableOn::Taggable::Related::ClassMethods base.initialize_acts_as_taggable_on_related end module ClassMethods def initialize_acts_as_taggable...
ruby
MIT
380c0bc4fd7e2c043593d8411250aba268101672
2026-01-04T15:44:35.730653Z
false
mbleigh/acts-as-taggable-on
https://github.com/mbleigh/acts-as-taggable-on/blob/380c0bc4fd7e2c043593d8411250aba268101672/lib/acts-as-taggable-on/taggable/tagged_with_query.rb
lib/acts-as-taggable-on/taggable/tagged_with_query.rb
# frozen_string_literal: true module ActsAsTaggableOn module Taggable module TaggedWithQuery def self.build(taggable_model, tag_model, tagging_model, tag_list, options) if options[:exclude].present? ExcludeTagsQuery.new(taggable_model, tag_model, tagging_model, tag_list, options).build ...
ruby
MIT
380c0bc4fd7e2c043593d8411250aba268101672
2026-01-04T15:44:35.730653Z
false
mbleigh/acts-as-taggable-on
https://github.com/mbleigh/acts-as-taggable-on/blob/380c0bc4fd7e2c043593d8411250aba268101672/lib/acts-as-taggable-on/taggable/tag_list_type.rb
lib/acts-as-taggable-on/taggable/tag_list_type.rb
# frozen_string_literal: true module ActsAsTaggableOn module Taggable class TagListType < ActiveModel::Type::Value end end end
ruby
MIT
380c0bc4fd7e2c043593d8411250aba268101672
2026-01-04T15:44:35.730653Z
false
mbleigh/acts-as-taggable-on
https://github.com/mbleigh/acts-as-taggable-on/blob/380c0bc4fd7e2c043593d8411250aba268101672/lib/acts-as-taggable-on/taggable/ownership.rb
lib/acts-as-taggable-on/taggable/ownership.rb
# frozen_string_literal: true module ActsAsTaggableOn module Taggable module Ownership extend ActiveSupport::Concern included do after_save :save_owned_tags initialize_acts_as_taggable_on_ownership end class_methods do def acts_as_taggable_on(*args) in...
ruby
MIT
380c0bc4fd7e2c043593d8411250aba268101672
2026-01-04T15:44:35.730653Z
false
mbleigh/acts-as-taggable-on
https://github.com/mbleigh/acts-as-taggable-on/blob/380c0bc4fd7e2c043593d8411250aba268101672/lib/acts-as-taggable-on/taggable/caching.rb
lib/acts-as-taggable-on/taggable/caching.rb
# frozen_string_literal: true module ActsAsTaggableOn module Taggable module Caching extend ActiveSupport::Concern included do initialize_tags_cache before_save :save_cached_tag_list end class_methods do def initialize_tags_cache tag_types.map(&:to_s).e...
ruby
MIT
380c0bc4fd7e2c043593d8411250aba268101672
2026-01-04T15:44:35.730653Z
false
mbleigh/acts-as-taggable-on
https://github.com/mbleigh/acts-as-taggable-on/blob/380c0bc4fd7e2c043593d8411250aba268101672/lib/acts-as-taggable-on/taggable/tagged_with_query/exclude_tags_query.rb
lib/acts-as-taggable-on/taggable/tagged_with_query/exclude_tags_query.rb
# frozen_string_literal: true module ActsAsTaggableOn module Taggable module TaggedWithQuery class ExcludeTagsQuery < QueryBase def build taggable_model.joins(owning_to_tagger) .where(tags_not_in_list) .having(tags_that_matches_count) ...
ruby
MIT
380c0bc4fd7e2c043593d8411250aba268101672
2026-01-04T15:44:35.730653Z
false
mbleigh/acts-as-taggable-on
https://github.com/mbleigh/acts-as-taggable-on/blob/380c0bc4fd7e2c043593d8411250aba268101672/lib/acts-as-taggable-on/taggable/tagged_with_query/query_base.rb
lib/acts-as-taggable-on/taggable/tagged_with_query/query_base.rb
# frozen_string_literal: true module ActsAsTaggableOn module Taggable module TaggedWithQuery class QueryBase def initialize(taggable_model, tag_model, tagging_model, tag_list, options) @taggable_model = taggable_model @tag_model = tag_model @tagging_model = taggi...
ruby
MIT
380c0bc4fd7e2c043593d8411250aba268101672
2026-01-04T15:44:35.730653Z
false
mbleigh/acts-as-taggable-on
https://github.com/mbleigh/acts-as-taggable-on/blob/380c0bc4fd7e2c043593d8411250aba268101672/lib/acts-as-taggable-on/taggable/tagged_with_query/all_tags_query.rb
lib/acts-as-taggable-on/taggable/tagged_with_query/all_tags_query.rb
# frozen_string_literal: true module ActsAsTaggableOn module Taggable module TaggedWithQuery class AllTagsQuery < QueryBase def build taggable_model.joins(each_tag_in_list) .group(by_taggable) .having(tags_that_matches_count) ...
ruby
MIT
380c0bc4fd7e2c043593d8411250aba268101672
2026-01-04T15:44:35.730653Z
false
mbleigh/acts-as-taggable-on
https://github.com/mbleigh/acts-as-taggable-on/blob/380c0bc4fd7e2c043593d8411250aba268101672/lib/acts-as-taggable-on/taggable/tagged_with_query/any_tags_query.rb
lib/acts-as-taggable-on/taggable/tagged_with_query/any_tags_query.rb
# frozen_string_literal: true module ActsAsTaggableOn module Taggable module TaggedWithQuery class AnyTagsQuery < QueryBase def build taggable_model.select(all_fields) .where(model_has_at_least_one_tag) .order(Arel.sql(order_conditions)) ...
ruby
MIT
380c0bc4fd7e2c043593d8411250aba268101672
2026-01-04T15:44:35.730653Z
false
backup/backup
https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/integration/spec_helper.rb
integration/spec_helper.rb
# encoding: utf-8 require "backup" Dir[File.expand_path("../support/**/*.rb", __FILE__)].each { |f| require f } RSpec.configure do |c| c.include BackupSpec::ExampleHelpers end
ruby
MIT
86c9b07c2a2974376888b1506001f77792d6359a
2026-01-04T15:45:04.712671Z
false
backup/backup
https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/integration/tasks/fileset_builder.rb
integration/tasks/fileset_builder.rb
# encoding: utf-8 class FilesetBuilder def create(root_dir, dir_name, total, file_size) create_dir(root_dir, dir_name) create_fileset(File.join(root_dir, dir_name), total, file_size) end def create_dir(parent_dir, dir_name) dir = File.join(parent_dir, dir_name) Dir.mkdir(dir) unless Dir.exist?(d...
ruby
MIT
86c9b07c2a2974376888b1506001f77792d6359a
2026-01-04T15:45:04.712671Z
false
backup/backup
https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/integration/support/logger.rb
integration/support/logger.rb
# encoding: utf-8 module Backup class Logger class << self alias _clear! clear! def clear! saved << logger _clear! end def saved @saved ||= [] end private alias _reset! reset! def reset! @saved = nil _reset! end ...
ruby
MIT
86c9b07c2a2974376888b1506001f77792d6359a
2026-01-04T15:45:04.712671Z
false
backup/backup
https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/integration/support/package.rb
integration/support/package.rb
# encoding: utf-8 module BackupSpec class Package include Backup::Utilities::Helpers extend Forwardable def_delegators :tarfile, :manifest, :contents, :[] attr_reader :model def initialize(model) @model = model end def exist? !files.empty? && files.all? { |f| File.exist?(f)...
ruby
MIT
86c9b07c2a2974376888b1506001f77792d6359a
2026-01-04T15:45:04.712671Z
false
backup/backup
https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/integration/support/match_manifest.rb
integration/support/match_manifest.rb
# encoding: utf-8 # Matches the contents of a TarFile (or PerformedJob.package) # against the given manifest. # # Usage: # # performed_job = backup_perform :trigger # # expect(performed_job.package).to match_manifest(<<-EOS) # 51200 my_backup/archives/my_archive.tar # 8099 my_backup/databases/My...
ruby
MIT
86c9b07c2a2974376888b1506001f77792d6359a
2026-01-04T15:45:04.712671Z
false
backup/backup
https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/integration/support/example_helpers.rb
integration/support/example_helpers.rb
# encoding: utf-8 module BackupSpec CONFIG_TEMPLATE = Backup::Template.new.result("cli/config") PROJECT_ROOT = "/usr/src/backup".freeze LOCAL_STORAGE_PATH = File.join(PROJECT_ROOT, "tmp", "Storage") module ExampleHelpers # Creates the config.rb file. # # By default, this will be created as ~/Backu...
ruby
MIT
86c9b07c2a2974376888b1506001f77792d6359a
2026-01-04T15:45:04.712671Z
false
backup/backup
https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/integration/support/performed_job.rb
integration/support/performed_job.rb
# encoding: utf-8 module BackupSpec class PerformedJob attr_reader :model, :logger, :package def initialize(model) @model = model @logger = Backup::Logger.saved.shift @package = Package.new(model) end end end
ruby
MIT
86c9b07c2a2974376888b1506001f77792d6359a
2026-01-04T15:45:04.712671Z
false
backup/backup
https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/integration/support/tarfile.rb
integration/support/tarfile.rb
# encoding: utf-8 module BackupSpec class TarFile include Backup::Utilities::Helpers attr_reader :path def initialize(path) @path = path end def manifest @manifest ||= begin if File.exist?(path.to_s) `#{ utility(:tar) } -tvf #{ path } 2>/dev/null` else ...
ruby
MIT
86c9b07c2a2974376888b1506001f77792d6359a
2026-01-04T15:45:04.712671Z
false
backup/backup
https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/integration/acceptance/archive_spec.rb
integration/acceptance/archive_spec.rb
# encoding: utf-8 require File.expand_path("../../spec_helper", __FILE__) module Backup describe Archive do specify "All directories, no compression, without :root" do create_model :my_backup, <<-EOS Backup::Model.new(:my_backup, 'a description') do archive :archive_a do |archive| ...
ruby
MIT
86c9b07c2a2974376888b1506001f77792d6359a
2026-01-04T15:45:04.712671Z
false
backup/backup
https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/integration/acceptance/splitter_spec.rb
integration/acceptance/splitter_spec.rb
require File.expand_path("../../spec_helper", __FILE__) describe Backup::Splitter do specify "suffix length may be configured" do create_model :my_backup, <<-EOS Backup::Model.new(:my_backup, "a description") do split_into_chunks_of 1, 5 archive :my_archive do |archive| archive.a...
ruby
MIT
86c9b07c2a2974376888b1506001f77792d6359a
2026-01-04T15:45:04.712671Z
false
backup/backup
https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/vagrant/spec/spec_helper.rb
vagrant/spec/spec_helper.rb
abort "These specs should only be run on the backup-testbox VM" unless %x[hostname].chomp == 'backup-testbox' version = '9' found = File.read('/home/vagrant/backup-testbox-version').strip rescue '?' warn(<<EOS) unless version == found \n -- Warning: backup-testbox should be v.#{ version } - Found v.#{ found } -- ...
ruby
MIT
86c9b07c2a2974376888b1506001f77792d6359a
2026-01-04T15:45:04.712671Z
false
backup/backup
https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/vagrant/spec/support/logger.rb
vagrant/spec/support/logger.rb
module Backup class Logger class << self alias _clear! clear! def clear! saved << logger _clear! end def saved @saved ||= [] end private alias _reset! reset! def reset! @saved = nil _reset! end end end end
ruby
MIT
86c9b07c2a2974376888b1506001f77792d6359a
2026-01-04T15:45:04.712671Z
false
backup/backup
https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/vagrant/spec/support/package.rb
vagrant/spec/support/package.rb
module BackupSpec class Package include Backup::Utilities::Helpers extend Forwardable def_delegators :tarfile, :manifest, :contents, :[] attr_reader :model def initialize(model) @model = model end def exist? !files.empty? && files.all? {|f| File.exist?(f) } end def ...
ruby
MIT
86c9b07c2a2974376888b1506001f77792d6359a
2026-01-04T15:45:04.712671Z
false
backup/backup
https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/vagrant/spec/support/example_helpers.rb
vagrant/spec/support/example_helpers.rb
module BackupSpec PROJECT_ROOT = '/backup.git' CONFIG_TEMPLATE = Backup::Template.new.result('cli/config') LOCAL_STORAGE_PATH = '/home/vagrant/Storage' ALT_CONFIG_PATH = '/home/vagrant/Backup_alt' LOCAL_SYNC_PATH = '/home/vagrant/sync_root' GPG_HOME_DIR = '/home/vagrant/gpg_home' # default would be ~/.gnupg...
ruby
MIT
86c9b07c2a2974376888b1506001f77792d6359a
2026-01-04T15:45:04.712671Z
false
backup/backup
https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/vagrant/spec/support/live.rb
vagrant/spec/support/live.rb
module BackupSpec file = File.expand_path('../../live.yml', __FILE__) LIVE = File.exist?(file) ? YAML.load_file(file) : Hash.new {|h,k| h.dup } end
ruby
MIT
86c9b07c2a2974376888b1506001f77792d6359a
2026-01-04T15:45:04.712671Z
false
backup/backup
https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/vagrant/spec/support/tar_file.rb
vagrant/spec/support/tar_file.rb
module BackupSpec class TarFile include Backup::Utilities::Helpers attr_reader :path def initialize(path) @path = path end def manifest @manifest ||= begin if File.exist?(path.to_s) %x[#{ utility(:tar) } -tvf #{ path } 2>/dev/null] else '' ...
ruby
MIT
86c9b07c2a2974376888b1506001f77792d6359a
2026-01-04T15:45:04.712671Z
false
backup/backup
https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/vagrant/spec/support/performed_job.rb
vagrant/spec/support/performed_job.rb
module BackupSpec class PerformedJob attr_reader :model, :logger, :package def initialize(model) @model = model @logger = Backup::Logger.saved.shift @package = Package.new(model) end end end
ruby
MIT
86c9b07c2a2974376888b1506001f77792d6359a
2026-01-04T15:45:04.712671Z
false
backup/backup
https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/vagrant/spec/support/gpg_keys.rb
vagrant/spec/support/gpg_keys.rb
module BackupSpec GPGKeys = Hash.new {|h,k| h[k] = {} } GPGKeys[:backup01][:long_id] = '8F5D150616325C61' GPGKeys[:backup01][:public] = <<-EOS -----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG v1.4.12 (GNU/Linux) mI0EUBR6CwEEAMVSlFtAXO4jXYnVFAWy6chyaMw+gXOFKlWojNXOOKmE3SujdLKh kWqnafx7VNrb8cjq...
ruby
MIT
86c9b07c2a2974376888b1506001f77792d6359a
2026-01-04T15:45:04.712671Z
false
backup/backup
https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/vagrant/spec/support/custom_matchers.rb
vagrant/spec/support/custom_matchers.rb
# Matches the contents of a TarFile (or PerformedJob.package) # against the given manifest. # # Usage: # # performed_job = backup_perform :trigger # # expect( performed_job.package ).to match_manifest(<<-EOS) # 51200 my_backup/archives/my_archive.tar # 8099 my_backup/databases/MySQL/backup_test_0...
ruby
MIT
86c9b07c2a2974376888b1506001f77792d6359a
2026-01-04T15:45:04.712671Z
false
backup/backup
https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/vagrant/spec/acceptance/archive_spec.rb
vagrant/spec/acceptance/archive_spec.rb
require File.expand_path('../../spec_helper', __FILE__) module Backup describe Archive do shared_examples 'GNU or BSD tar' do specify 'All directories, no compression, with/without :root' do create_model :my_backup, <<-EOS Backup::Model.new(:my_backup, 'a description') do archive :archi...
ruby
MIT
86c9b07c2a2974376888b1506001f77792d6359a
2026-01-04T15:45:04.712671Z
false
backup/backup
https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/vagrant/spec/acceptance/splitter_spec.rb
vagrant/spec/acceptance/splitter_spec.rb
require File.expand_path('../../spec_helper', __FILE__) module Backup describe Splitter do specify 'suffix length may be configured' do create_model :my_backup, <<-EOS Backup::Model.new(:my_backup, 'a description') do split_into_chunks_of 1, 5 archive :my_archive do |archive| ar...
ruby
MIT
86c9b07c2a2974376888b1506001f77792d6359a
2026-01-04T15:45:04.712671Z
false
backup/backup
https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/vagrant/spec/acceptance/config_spec.rb
vagrant/spec/acceptance/config_spec.rb
require File.expand_path('../../spec_helper', __FILE__) describe 'Backup Configuration' do specify 'Models may be preconfigured' do create_config <<-EOS preconfigure 'MyModel' do archive :archive_a do |archive| archive.add '~/test_data/dir_a' end compress_with Gzip ...
ruby
MIT
86c9b07c2a2974376888b1506001f77792d6359a
2026-01-04T15:45:04.712671Z
false
backup/backup
https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/vagrant/spec/acceptance/storage/ftp_spec.rb
vagrant/spec/acceptance/storage/ftp_spec.rb
require File.expand_path('../../../spec_helper', __FILE__) # Note: vsftpd is setup to chroot to the user's home directory module Backup describe Storage::FTP do it 'cycles stored packages' do create_model :my_backup, <<-EOS Backup::Model.new(:my_backup, 'a description') do split_into_chunks_of 1 #...
ruby
MIT
86c9b07c2a2974376888b1506001f77792d6359a
2026-01-04T15:45:04.712671Z
false
backup/backup
https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/vagrant/spec/acceptance/storage/scp_spec.rb
vagrant/spec/acceptance/storage/scp_spec.rb
require File.expand_path('../../../spec_helper', __FILE__) # Note: the password may be omitted, since the 'vagrant' user # is setup with passphrase-less SSH keys. module Backup describe Storage::SCP do it 'cycles stored packages' do create_model :my_backup, <<-EOS Backup::Model.new(:my_backup, 'a descript...
ruby
MIT
86c9b07c2a2974376888b1506001f77792d6359a
2026-01-04T15:45:04.712671Z
false
backup/backup
https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/vagrant/spec/acceptance/storage/sftp_spec.rb
vagrant/spec/acceptance/storage/sftp_spec.rb
require File.expand_path('../../../spec_helper', __FILE__) # Note: the password may be omitted, since the 'vagrant' user # is setup with passphrase-less SSH keys. module Backup describe Storage::SFTP do it 'cycles stored packages' do create_model :my_backup, <<-EOS Backup::Model.new(:my_backup, 'a descrip...
ruby
MIT
86c9b07c2a2974376888b1506001f77792d6359a
2026-01-04T15:45:04.712671Z
false
backup/backup
https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/vagrant/spec/acceptance/storage/rsync_spec.rb
vagrant/spec/acceptance/storage/rsync_spec.rb
require File.expand_path('../../../spec_helper', __FILE__) module Backup describe Storage::RSync do context 'using local operation' do specify 'single package file' do create_model :my_backup, <<-EOS Backup::Model.new(:my_backup, 'a description') do archive :my_archive do |archive| ...
ruby
MIT
86c9b07c2a2974376888b1506001f77792d6359a
2026-01-04T15:45:04.712671Z
false
backup/backup
https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/vagrant/spec/acceptance/storage/local_spec.rb
vagrant/spec/acceptance/storage/local_spec.rb
require File.expand_path('../../../spec_helper', __FILE__) module Backup describe Storage::Local do it 'cycles stored packages' do create_model :my_backup, <<-EOS Backup::Model.new(:my_backup, 'a description') do split_into_chunks_of 1 # 1MB archive :my_archive do |archive| arch...
ruby
MIT
86c9b07c2a2974376888b1506001f77792d6359a
2026-01-04T15:45:04.712671Z
false
backup/backup
https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/vagrant/spec/acceptance/database/mysql_spec.rb
vagrant/spec/acceptance/database/mysql_spec.rb
require File.expand_path('../../../spec_helper', __FILE__) module Backup describe 'Database::MySQL' do describe 'All Databases' do specify 'All tables' do create_model :my_backup, <<-EOS Backup::Model.new(:my_backup, 'a description') do database MySQL do |db| db.name = :...
ruby
MIT
86c9b07c2a2974376888b1506001f77792d6359a
2026-01-04T15:45:04.712671Z
false
backup/backup
https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/vagrant/spec/acceptance/database/riak_spec.rb
vagrant/spec/acceptance/database/riak_spec.rb
require File.expand_path('../../../spec_helper', __FILE__) module Backup describe 'Database::Riak' do specify 'No Compression' do create_model :my_backup, <<-EOS Backup::Model.new(:my_backup, 'a description') do database Riak store_with Local end EOS # --tmp-path must be cha...
ruby
MIT
86c9b07c2a2974376888b1506001f77792d6359a
2026-01-04T15:45:04.712671Z
false
backup/backup
https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/vagrant/spec/acceptance/database/redis_spec.rb
vagrant/spec/acceptance/database/redis_spec.rb
require File.expand_path('../../../spec_helper', __FILE__) module Backup describe 'Database::Redis' do shared_examples 'redis specs' do specify 'No Compression' do create_model :my_backup, <<-EOS Backup::Model.new(:my_backup, 'a description') do database Redis do |db| db.mod...
ruby
MIT
86c9b07c2a2974376888b1506001f77792d6359a
2026-01-04T15:45:04.712671Z
false
backup/backup
https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/vagrant/spec/acceptance/database/mongodb_spec.rb
vagrant/spec/acceptance/database/mongodb_spec.rb
require File.expand_path('../../../spec_helper', __FILE__) module Backup describe 'Database::MongoDB' do describe 'Single Database' do specify 'All collections' do create_model :my_backup, <<-EOS Backup::Model.new(:my_backup, 'a description') do database MongoDB do |db| db.n...
ruby
MIT
86c9b07c2a2974376888b1506001f77792d6359a
2026-01-04T15:45:04.712671Z
false
backup/backup
https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/vagrant/spec/acceptance/database/postgresql_spec.rb
vagrant/spec/acceptance/database/postgresql_spec.rb
require File.expand_path('../../../spec_helper', __FILE__) module Backup describe 'Database::PostgreSQL' do describe 'All Databases' do specify 'With compression' do create_model :my_backup, <<-EOS Backup::Model.new(:my_backup, 'a description') do database PostgreSQL compress_...
ruby
MIT
86c9b07c2a2974376888b1506001f77792d6359a
2026-01-04T15:45:04.712671Z
false
backup/backup
https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/vagrant/spec/acceptance/syncer/rsync/pull_spec.rb
vagrant/spec/acceptance/syncer/rsync/pull_spec.rb
require File.expand_path('../../../../spec_helper', __FILE__) module Backup describe Syncer::RSync::Pull do context 'using :ssh mode' do specify 'single directory' do create_model :my_backup, <<-EOS Backup::Model.new(:my_backup, 'a description') do sync_with RSync::Pull do |rsync| ...
ruby
MIT
86c9b07c2a2974376888b1506001f77792d6359a
2026-01-04T15:45:04.712671Z
false
backup/backup
https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/vagrant/spec/acceptance/syncer/rsync/push_spec.rb
vagrant/spec/acceptance/syncer/rsync/push_spec.rb
require File.expand_path('../../../../spec_helper', __FILE__) module Backup describe Syncer::RSync::Push do context 'using :ssh mode' do specify 'single directory' do create_model :my_backup, <<-EOS Backup::Model.new(:my_backup, 'a description') do sync_with RSync::Push do |rsync| ...
ruby
MIT
86c9b07c2a2974376888b1506001f77792d6359a
2026-01-04T15:45:04.712671Z
false
backup/backup
https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/vagrant/spec/acceptance/syncer/rsync/local_spec.rb
vagrant/spec/acceptance/syncer/rsync/local_spec.rb
require File.expand_path('../../../../spec_helper', __FILE__) module Backup describe Syncer::RSync::Local do specify 'single directory' do create_model :my_backup, <<-EOS Backup::Model.new(:my_backup, 'a description') do sync_with RSync::Local do |rsync| rsync.path = '~/Storage' ...
ruby
MIT
86c9b07c2a2974376888b1506001f77792d6359a
2026-01-04T15:45:04.712671Z
false
backup/backup
https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/vagrant/spec/acceptance/encryptor/gpg_spec.rb
vagrant/spec/acceptance/encryptor/gpg_spec.rb
require File.expand_path('../../../spec_helper', __FILE__) module Backup describe Encryptor::GPG do specify ':asymmetric mode with preloaded and imported keys' do create_model :my_backup, <<-EOS Backup::Model.new(:my_backup, 'a description') do archive :my_archive do |archive| archive.ad...
ruby
MIT
86c9b07c2a2974376888b1506001f77792d6359a
2026-01-04T15:45:04.712671Z
false
backup/backup
https://github.com/backup/backup/blob/86c9b07c2a2974376888b1506001f77792d6359a/vagrant/spec/live/storage/s3_spec.rb
vagrant/spec/live/storage/s3_spec.rb
require File.expand_path('../../../spec_helper', __FILE__) # To run these tests, you need to setup your AWS S3 credentials in # /vagrant/spec/live.yml # # It's recommended you use a dedicated Bucket for this, like: # <aws_username>-backup-testing # # Note: The S3 Bucket you use should have read-after-write consist...
ruby
MIT
86c9b07c2a2974376888b1506001f77792d6359a
2026-01-04T15:45:04.712671Z
false