super_current 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/super_current/version.rb +1 -1
- data/lib/super_current.rb +7 -7
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dac48a364c1fcb0c66a4bc9463a658f96f1c450eaeb8d97629b168bc349112ef
|
4
|
+
data.tar.gz: f2f602af42e17972fcad9cd7765bff6242cc80faa7582706aa041432f9671f32
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0c0d8fb27b3b52c9648c48c1a1d341c51419b438b4f40e79ed449ffefe39560dbe78a63cc0b3bf24182d9ab3362e760dbfa2d20e4ebbaf0d6be8482616a9390
|
7
|
+
data.tar.gz: c98349f49104dcca586024bcfa3b7468b43af8557b4736c3e5ee94bbf62fd5438055c44b9541bce84cf9bf024d3d0699bcb9f5094e52e38de244c0ba4e620a2c
|
data/lib/super_current.rb
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
5
|
-
require
|
3
|
+
require "super_current/version"
|
4
|
+
require "super_current/railtie"
|
5
|
+
require "dry-configurable"
|
6
6
|
|
7
7
|
# SuperCurrent makes it easier to use ActiveSupport::CurrentAttributes
|
8
8
|
module SuperCurrent
|
9
9
|
extend Dry::Configurable
|
10
10
|
|
11
|
-
setting :current_class_name, default:
|
11
|
+
setting :current_class_name, default: "Current", reader: true
|
12
12
|
|
13
13
|
# The class that actually has the CurrentAttributes as parent class
|
14
14
|
# Named SuperSuperCurrent to avoid conflicts with the SuperCurrent module
|
@@ -28,9 +28,9 @@ module SuperCurrent
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def self.method_missing(method, *args)
|
31
|
-
super unless method.to_s.end_with?(
|
31
|
+
super unless method.to_s.end_with?("=")
|
32
32
|
|
33
|
-
attribute_name = method.to_s.chomp(
|
33
|
+
attribute_name = method.to_s.chomp("=")
|
34
34
|
attribute_value = args.first
|
35
35
|
|
36
36
|
class_eval { attribute attribute_name.to_sym }
|
@@ -39,7 +39,7 @@ module SuperCurrent
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def self.respond_to_missing?(method, include_private = false)
|
42
|
-
@methods.include?(method.to_s) || method.to_s.end_with?(
|
42
|
+
@methods.include?(method.to_s) || method.to_s.end_with?("=") || super
|
43
43
|
end
|
44
44
|
end
|
45
45
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: super_current
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sampo Kuokkanen
|
@@ -66,13 +66,13 @@ files:
|
|
66
66
|
- lib/super_current/railtie.rb
|
67
67
|
- lib/super_current/version.rb
|
68
68
|
- lib/tasks/super_current_tasks.rake
|
69
|
-
homepage: https://
|
69
|
+
homepage: https://github.com/sampokuokkanen/SuperCurrent
|
70
70
|
licenses:
|
71
71
|
- MIT
|
72
72
|
metadata:
|
73
|
-
homepage_uri: https://
|
74
|
-
source_code_uri: https://
|
75
|
-
changelog_uri: https://
|
73
|
+
homepage_uri: https://github.com/sampokuokkanen/SuperCurrent
|
74
|
+
source_code_uri: https://github.com/sampokuokkanen/SuperCurrent
|
75
|
+
changelog_uri: https://github.com/sampokuokkanen/SuperCurrent/blob/main/CHANGELOG.md
|
76
76
|
post_install_message:
|
77
77
|
rdoc_options: []
|
78
78
|
require_paths:
|