familia 1.2.1 → 1.2.2
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 +4 -4
- data/.gitignore +1 -0
- data/Gemfile.lock +1 -1
- data/VERSION.yml +1 -1
- data/lib/familia/horreum/class_methods.rb +20 -0
- metadata +3 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 969b9307f36ebcbc6174af20be7b408260daaaf1a273a366f45a20cde7cb6243
|
4
|
+
data.tar.gz: 9ce626f524f4208902d887dbe3bab701573e55c4a5cc6a64c1c7ff5e35b3b2f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 81caa35023632653f04f11e4f457fc3a6a0e9865cb361372a1f98644eefb12f956eb86ee1d911d7e0f17d8000e2cabd9faa9f23050668de652359997e42cbca3
|
7
|
+
data.tar.gz: d2e1bb0cfaa6af02a0475985355f873d85b1f13a5f54cecb5a92db95f408a57c502e1323db29a80a60ab262879a41d1aec89982fe9f517b01a59ec4df2e54723
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
data/VERSION.yml
CHANGED
@@ -139,6 +139,12 @@ module Familia
|
|
139
139
|
# end
|
140
140
|
#
|
141
141
|
define_method :"#{name}!" do |*args|
|
142
|
+
|
143
|
+
if method_defined?(:"#{name}!")
|
144
|
+
warn "Method #{name}! is already defined for #{self}"
|
145
|
+
return
|
146
|
+
end
|
147
|
+
|
142
148
|
# Check if the correct number of arguments is provided (exactly one).
|
143
149
|
raise ArgumentError, "wrong number of arguments (given #{args.size}, expected 0 or 1)" if args.size > 1
|
144
150
|
|
@@ -235,6 +241,20 @@ module Familia
|
|
235
241
|
@prefix || name.downcase.gsub('::', Familia.delim).to_sym
|
236
242
|
end
|
237
243
|
|
244
|
+
# Converts the class name into a string that can be used to look up
|
245
|
+
# configuration values. This is particularly useful when mapping
|
246
|
+
# familia models with specific database numbers in the configuration.
|
247
|
+
#
|
248
|
+
# @example V2::Session.config_name => 'session'
|
249
|
+
#
|
250
|
+
# @return [String] The underscored class name as a string
|
251
|
+
def config_name
|
252
|
+
name.split('::').last
|
253
|
+
.gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
|
254
|
+
.gsub(/([a-z\d])([A-Z])/, '\1_\2')
|
255
|
+
.downcase
|
256
|
+
end
|
257
|
+
|
238
258
|
# Creates and persists a new instance of the class.
|
239
259
|
#
|
240
260
|
# @param *args [Array] Variable number of positional arguments to be passed
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: familia
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Delano Mandelbaum
|
8
|
-
autorequire:
|
9
8
|
bindir: exe
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: redis
|
@@ -132,7 +131,6 @@ licenses:
|
|
132
131
|
- MIT
|
133
132
|
metadata:
|
134
133
|
rubygems_mfa_required: 'true'
|
135
|
-
post_install_message:
|
136
134
|
rdoc_options: []
|
137
135
|
require_paths:
|
138
136
|
- lib
|
@@ -147,8 +145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
147
145
|
- !ruby/object:Gem::Version
|
148
146
|
version: '0'
|
149
147
|
requirements: []
|
150
|
-
rubygems_version: 3.
|
151
|
-
signing_key:
|
148
|
+
rubygems_version: 3.6.9
|
152
149
|
specification_version: 4
|
153
150
|
summary: An ORM for Redis in Ruby.
|
154
151
|
test_files: []
|