rails_friends 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/Rakefile +24 -0
- data/lib/generators/rails_friends/install_generator.rb +17 -0
- data/lib/generators/rails_friends/templates/migrations/20240518023302_create_friendships.rb +21 -0
- data/lib/generators/rails_friends/templates/migrations/20240518023303_add_blocker_id_to_friendships.rb +15 -0
- data/lib/generators/rails_friends/templates/migrations/20240518023304_update_friendships.rb +31 -0
- data/lib/generators/rails_friends/templates/migrations/20240518023305_add_unique_index_to_friendships.rb +21 -0
- data/lib/rails_friends/engine.rb +9 -0
- data/lib/rails_friends/extender.rb +13 -0
- data/lib/rails_friends/friendable.rb +117 -0
- data/lib/rails_friends/friendship.rb +89 -0
- data/lib/rails_friends/version.rb +3 -0
- data/lib/rails_friends.rb +18 -0
- data/lib/tasks/rails_friends_tasks.rake +0 -0
- metadata +225 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 16d732621008d42394463d60062d252e9ff5b722cd37b89f02aa05c9366d19f4
|
4
|
+
data.tar.gz: fd7493df09797d9d0ce2f24570252335642986f5fdfb3bb8bcef00b56367a9c9
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: c88b1f09c4ebd5ec234a4ae7bee9d33743705259995773af9fc01c8ed73ed728e28b0c60689379b1af2631b460753d6869a58efcd1da4cab117202a9e0158099
|
7
|
+
data.tar.gz: f0ca8788c617650ca46f6e7b5467dfb50b781d4dd6da524ec4ce35fa72371f1b5a68720f58f1543fa66111b37ff94b55ca1e1ab18f44c73bebb96e40ca5061bc
|
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright 2015 Sung Won Cho
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
begin
|
2
|
+
require 'bundler/setup'
|
3
|
+
rescue LoadError
|
4
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
5
|
+
end
|
6
|
+
|
7
|
+
require 'rspec/core/rake_task'
|
8
|
+
require 'rdoc/task'
|
9
|
+
|
10
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
11
|
+
rdoc.rdoc_dir = 'rdoc'
|
12
|
+
rdoc.title = 'RailsFriends'
|
13
|
+
rdoc.options << '--line-numbers'
|
14
|
+
rdoc.rdoc_files.include('README.rdoc')
|
15
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
16
|
+
end
|
17
|
+
|
18
|
+
Bundler::GemHelper.install_tasks
|
19
|
+
|
20
|
+
desc 'Run specs'
|
21
|
+
RSpec::Core::RakeTask.new(:spec)
|
22
|
+
|
23
|
+
desc 'Default: run specs'
|
24
|
+
task default: :spec
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RailsFriends
|
4
|
+
module Generators
|
5
|
+
class InstallGenerator < Rails::Generators::Base
|
6
|
+
# include Rails::Generators::ResourceHelpers
|
7
|
+
|
8
|
+
source_root File.expand_path('templates', __dir__)
|
9
|
+
|
10
|
+
desc 'Copies the migrations for RailsFriends'
|
11
|
+
|
12
|
+
def copy_migrations
|
13
|
+
directory 'migrations', 'db/migrate'
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
if ActiveRecord.gem_version >= Gem::Version.new('5.0')
|
2
|
+
class CreateFriendships < ActiveRecord::Migration[4.2]; end
|
3
|
+
else
|
4
|
+
class CreateFriendships < ActiveRecord::Migration; end
|
5
|
+
end
|
6
|
+
|
7
|
+
CreateFriendships.class_eval do
|
8
|
+
def self.up
|
9
|
+
create_table :friendships do |t|
|
10
|
+
t.references :friendable, polymorphic: true
|
11
|
+
t.integer :friend_id
|
12
|
+
t.string :status
|
13
|
+
|
14
|
+
t.timestamps
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.down
|
19
|
+
drop_table :friendships
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
if ActiveRecord.gem_version >= Gem::Version.new('5.0')
|
2
|
+
class AddBlockerIdToFriendships < ActiveRecord::Migration[4.2]; end
|
3
|
+
else
|
4
|
+
class AddBlockerIdToFriendships < ActiveRecord::Migration; end
|
5
|
+
end
|
6
|
+
|
7
|
+
AddBlockerIdToFriendships.class_eval do
|
8
|
+
def self.up
|
9
|
+
add_column :friendships, :blocker_id, :integer, default: nil
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.down
|
13
|
+
remove_column :friendships, :blocker_id
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
if ActiveRecord.gem_version >= Gem::Version.new('5.0')
|
2
|
+
class UpdateFriendships < ActiveRecord::Migration[4.2]; end
|
3
|
+
else
|
4
|
+
class UpdateFriendships < ActiveRecord::Migration; end
|
5
|
+
end
|
6
|
+
|
7
|
+
UpdateFriendships.class_eval do
|
8
|
+
def self.up
|
9
|
+
add_column :friendships, :status_temp, :integer, index: true
|
10
|
+
|
11
|
+
ActiveRecord::Base.connection.execute("UPDATE friendships SET status_temp = 0 WHERE status = 'pending'")
|
12
|
+
ActiveRecord::Base.connection.execute("UPDATE friendships SET status_temp = 1 WHERE status = 'requested'")
|
13
|
+
ActiveRecord::Base.connection.execute("UPDATE friendships SET status_temp = 2 WHERE status = 'accepted'")
|
14
|
+
ActiveRecord::Base.connection.execute("UPDATE friendships SET status_temp = 3 WHERE status = 'blocked'")
|
15
|
+
|
16
|
+
remove_column :friendships, :status
|
17
|
+
rename_column :friendships, :status_temp, :status
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.down
|
21
|
+
add_column :friendships, :status_temp, :string
|
22
|
+
|
23
|
+
ActiveRecord::Base.connection.execute("UPDATE friendships SET status_temp = 'pending' WHERE status = 0")
|
24
|
+
ActiveRecord::Base.connection.execute("UPDATE friendships SET status_temp = 'requested' WHERE status = 1")
|
25
|
+
ActiveRecord::Base.connection.execute("UPDATE friendships SET status_temp = 'accepted' WHERE status = 2")
|
26
|
+
ActiveRecord::Base.connection.execute("UPDATE friendships SET status_temp = 'blocked' WHERE status = 3")
|
27
|
+
|
28
|
+
remove_column :friendships, :status
|
29
|
+
rename_column :friendships, :status_temp, :status
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
if ActiveRecord.gem_version >= Gem::Version.new('5.0')
|
2
|
+
class AddUniqueIndexToFriendships < ActiveRecord::Migration[4.2]; end
|
3
|
+
else
|
4
|
+
class AddUniqueIndexToFriendships < ActiveRecord::Migration; end
|
5
|
+
end
|
6
|
+
|
7
|
+
AddUniqueIndexToFriendships.class_eval do
|
8
|
+
disable_ddl_transaction!
|
9
|
+
|
10
|
+
def self.up
|
11
|
+
return if index_exists?(:friendships, %i[friendable_id friend_id])
|
12
|
+
|
13
|
+
add_index :friendships, %i[friendable_id friend_id], unique: true, algorithm: :concurrently
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.down
|
17
|
+
return unless index_exists?(:friendships, %i[friendable_id friend_id])
|
18
|
+
|
19
|
+
remove_index :friendships, %i[friendable_id friend_id]
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
module RailsFriends
|
2
|
+
class Engine < ::Rails::Engine
|
3
|
+
# Do not isolate namespace to avoid issues
|
4
|
+
initializer 'rails_friends.load_generators' do
|
5
|
+
Rails.application.config.generators.templates << RailsFriends::Engine.root.join('lib', 'generators',
|
6
|
+
'rails_friends', 'templates')
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module RailsFriends
|
2
|
+
module Extender
|
3
|
+
def self.included(base)
|
4
|
+
|
5
|
+
# Dynamically define the Friendship's association based on where the module is included.
|
6
|
+
RailsFriends::Friendship.class_eval do
|
7
|
+
belongs_to :friendable, polymorphic: true
|
8
|
+
belongs_to :friend, class_name: "#{base.to_s}", foreign_key: :friend_id
|
9
|
+
end
|
10
|
+
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,117 @@
|
|
1
|
+
module RailsFriends
|
2
|
+
module Friendable
|
3
|
+
def friendable?
|
4
|
+
false
|
5
|
+
end
|
6
|
+
|
7
|
+
def has_friendship
|
8
|
+
class_eval do
|
9
|
+
has_many :friendships, as: :friendable,
|
10
|
+
class_name: 'RailsFriends::Friendship', dependent: :destroy
|
11
|
+
|
12
|
+
has_many :blocked_friends,
|
13
|
+
-> { where friendships: { status: 3 } },
|
14
|
+
through: :friendships,
|
15
|
+
source: :friend
|
16
|
+
|
17
|
+
has_many :friends,
|
18
|
+
-> { where friendships: { status: 2 } },
|
19
|
+
through: :friendships
|
20
|
+
|
21
|
+
has_many :requested_friends,
|
22
|
+
-> { where friendships: { status: 1 } },
|
23
|
+
through: :friendships,
|
24
|
+
source: :friend
|
25
|
+
|
26
|
+
has_many :pending_friends,
|
27
|
+
-> { where friendships: { status: 0 } },
|
28
|
+
through: :friendships,
|
29
|
+
source: :friend
|
30
|
+
|
31
|
+
def self.friendable?
|
32
|
+
true
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
include RailsFriends::Friendable::InstanceMethods
|
37
|
+
include RailsFriends::Extender
|
38
|
+
end
|
39
|
+
|
40
|
+
module InstanceMethods
|
41
|
+
CALLBACK_METHOD_NAMES = %i[
|
42
|
+
on_friendship_created
|
43
|
+
on_friendship_accepted
|
44
|
+
on_friendship_blocked
|
45
|
+
on_friendship_destroyed
|
46
|
+
].freeze
|
47
|
+
|
48
|
+
CALLBACK_METHOD_NAMES.each do |method_name|
|
49
|
+
define_method(method_name) do |*args|
|
50
|
+
super(*args) if defined?(super)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
def friend_request(friend)
|
55
|
+
return if self == friend || RailsFriends::Friendship.exist?(self, friend)
|
56
|
+
|
57
|
+
transaction do
|
58
|
+
RailsFriends::Friendship.create_relation(self, friend, status: 0)
|
59
|
+
RailsFriends::Friendship.create_relation(friend, self, status: 1)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
def accept_request(friend)
|
64
|
+
on_relation_with(friend) do |one, other|
|
65
|
+
friendship = RailsFriends::Friendship.find_unblocked_friendship(one, other)
|
66
|
+
friendship.accept! if can_accept_request?(friendship)
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
def decline_request(friend)
|
71
|
+
on_relation_with(friend) do |one, other|
|
72
|
+
RailsFriends::Friendship.find_unblocked_friendship(one, other).destroy
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
alias remove_friend decline_request
|
77
|
+
|
78
|
+
def block_friend(friend)
|
79
|
+
on_relation_with(friend) do |one, other|
|
80
|
+
RailsFriends::Friendship.find_unblocked_friendship(one, other).block_by(self)
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
def unblock_friend(friend)
|
85
|
+
return unless has_blocked(friend)
|
86
|
+
|
87
|
+
on_relation_with(friend) do |one, other|
|
88
|
+
RailsFriends::Friendship.find_blocked_friendship(one, other).destroy
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
def on_relation_with(friend)
|
93
|
+
transaction do
|
94
|
+
yield(self, friend)
|
95
|
+
yield(friend, self)
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
def friends_with?(friend)
|
100
|
+
RailsFriends::Friendship.find_relation(self, friend, status: 2).any?
|
101
|
+
end
|
102
|
+
|
103
|
+
private
|
104
|
+
|
105
|
+
def has_blocked(friend)
|
106
|
+
RailsFriends::Friendship.find_one_side(self, friend).blocker_id == id
|
107
|
+
end
|
108
|
+
|
109
|
+
def can_accept_request?(friendship)
|
110
|
+
return if friendship.pending? && self == friendship.friendable
|
111
|
+
return if friendship.requested? && self == friendship.friend
|
112
|
+
|
113
|
+
true
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
117
|
+
end
|
@@ -0,0 +1,89 @@
|
|
1
|
+
module RailsFriends
|
2
|
+
class Friendship < ActiveRecord::Base
|
3
|
+
validate :satisfy_custom_conditions
|
4
|
+
|
5
|
+
after_create do |record|
|
6
|
+
friend.on_friendship_created(record)
|
7
|
+
end
|
8
|
+
|
9
|
+
after_destroy do |record|
|
10
|
+
friendable.try(:on_friendship_destroyed, record)
|
11
|
+
end
|
12
|
+
|
13
|
+
attr_reader :status_was
|
14
|
+
|
15
|
+
enum status: { pending: 0, requested: 1, accepted: 2, blocked: 3 } do
|
16
|
+
event :accept do
|
17
|
+
before do
|
18
|
+
@status_was = status
|
19
|
+
end
|
20
|
+
|
21
|
+
transition %i[pending requested] => :accepted
|
22
|
+
|
23
|
+
after do
|
24
|
+
friendable.on_friendship_accepted(self)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
event :block do
|
29
|
+
after do
|
30
|
+
friendable.on_friendship_blocked(self)
|
31
|
+
end
|
32
|
+
transition all - [:blocked] => :blocked
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def block_by(blocker)
|
37
|
+
self.blocker_id = blocker.id
|
38
|
+
block!
|
39
|
+
end
|
40
|
+
|
41
|
+
def self.relation_attributes(one, other, status: nil)
|
42
|
+
attr = {
|
43
|
+
friendable_id: one.id,
|
44
|
+
friendable_type: one.class.base_class.name,
|
45
|
+
friend_id: other.id
|
46
|
+
}
|
47
|
+
|
48
|
+
attr[:status] = status if status
|
49
|
+
|
50
|
+
attr
|
51
|
+
end
|
52
|
+
|
53
|
+
def self.create_relation(one, other, options)
|
54
|
+
relation = new relation_attributes(one, other)
|
55
|
+
relation.attributes = options
|
56
|
+
relation.save
|
57
|
+
end
|
58
|
+
|
59
|
+
def self.find_relation(friendable, friend, status: nil)
|
60
|
+
where relation_attributes(friendable, friend, status: status)
|
61
|
+
end
|
62
|
+
|
63
|
+
def self.exist?(friendable, friend)
|
64
|
+
find_relation(friendable, friend).any? && find_relation(friend, friendable).any?
|
65
|
+
end
|
66
|
+
|
67
|
+
def self.find_unblocked_friendship(friendable, friend)
|
68
|
+
find_relation(friendable, friend).where.not(status: 3).first
|
69
|
+
end
|
70
|
+
|
71
|
+
def self.find_blocked_friendship(friendable, friend)
|
72
|
+
find_relation(friendable, friend).where(status: 3).first
|
73
|
+
end
|
74
|
+
|
75
|
+
def self.find_one_side(one, other)
|
76
|
+
find_by(relation_attributes(one, other))
|
77
|
+
end
|
78
|
+
|
79
|
+
private
|
80
|
+
|
81
|
+
def satisfy_custom_conditions
|
82
|
+
return unless friend.respond_to?(:friendship_errors)
|
83
|
+
|
84
|
+
friend.friendship_errors(friendable).to_a.each do |friendship_error|
|
85
|
+
errors.add(:base, friendship_error)
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'stateful_enum'
|
2
|
+
|
3
|
+
require 'active_support'
|
4
|
+
require 'active_record'
|
5
|
+
require 'rails/engine'
|
6
|
+
require 'rails_friends/engine'
|
7
|
+
|
8
|
+
module RailsFriends
|
9
|
+
extend ActiveSupport::Autoload
|
10
|
+
|
11
|
+
autoload :Friendable
|
12
|
+
autoload :Friendship
|
13
|
+
autoload :Extender
|
14
|
+
end
|
15
|
+
|
16
|
+
ActiveSupport.on_load(:active_record) do
|
17
|
+
extend RailsFriends::Friendable
|
18
|
+
end
|
File without changes
|
metadata
ADDED
@@ -0,0 +1,225 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rails_friends
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Tim Carey
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2024-05-18 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: activemodel
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 4.2.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 4.2.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: activerecord
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 4.2.0
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 4.2.0
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: activesupport
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 4.2.0
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 4.2.0
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: stateful_enum
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: byebug
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: coveralls
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: generator_spec
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: guard-rspec
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: rspec-rails
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: shoulda
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: sqlite3
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ">="
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ">="
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: tzinfo-data
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - ">="
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '0'
|
174
|
+
type: :development
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - ">="
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '0'
|
181
|
+
description:
|
182
|
+
email:
|
183
|
+
- timcarey1989@gmail.com
|
184
|
+
executables: []
|
185
|
+
extensions: []
|
186
|
+
extra_rdoc_files: []
|
187
|
+
files:
|
188
|
+
- MIT-LICENSE
|
189
|
+
- Rakefile
|
190
|
+
- lib/generators/rails_friends/install_generator.rb
|
191
|
+
- lib/generators/rails_friends/templates/migrations/20240518023302_create_friendships.rb
|
192
|
+
- lib/generators/rails_friends/templates/migrations/20240518023303_add_blocker_id_to_friendships.rb
|
193
|
+
- lib/generators/rails_friends/templates/migrations/20240518023304_update_friendships.rb
|
194
|
+
- lib/generators/rails_friends/templates/migrations/20240518023305_add_unique_index_to_friendships.rb
|
195
|
+
- lib/rails_friends.rb
|
196
|
+
- lib/rails_friends/engine.rb
|
197
|
+
- lib/rails_friends/extender.rb
|
198
|
+
- lib/rails_friends/friendable.rb
|
199
|
+
- lib/rails_friends/friendship.rb
|
200
|
+
- lib/rails_friends/version.rb
|
201
|
+
- lib/tasks/rails_friends_tasks.rake
|
202
|
+
homepage: https://github.com/tim-carey-code/rails_friends
|
203
|
+
licenses:
|
204
|
+
- MIT
|
205
|
+
metadata: {}
|
206
|
+
post_install_message:
|
207
|
+
rdoc_options: []
|
208
|
+
require_paths:
|
209
|
+
- lib
|
210
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
211
|
+
requirements:
|
212
|
+
- - ">="
|
213
|
+
- !ruby/object:Gem::Version
|
214
|
+
version: 2.7.0
|
215
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
216
|
+
requirements:
|
217
|
+
- - ">="
|
218
|
+
- !ruby/object:Gem::Version
|
219
|
+
version: '0'
|
220
|
+
requirements: []
|
221
|
+
rubygems_version: 3.3.7
|
222
|
+
signing_key:
|
223
|
+
specification_version: 4
|
224
|
+
summary: Add social network friendship features to your Active Record models.
|
225
|
+
test_files: []
|