missile_emitter 0.3.17 → 0.3.20
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/Gemfile +1 -1
- data/Gemfile.lock +32 -35
- data/lib/missile_emitter/configurable.rb +2 -2
- data/lib/missile_emitter/searchable.rb +9 -1
- data/lib/missile_emitter/version.rb +1 -1
- data/missile_emitter.gemspec +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 48818cb77b414e6c99ae67e2ca0b6ba3e8dd1b3e3d099622d1eb44627902bd24
|
|
4
|
+
data.tar.gz: 933645f58566bd6e34ac29e218a418c7e2584500d23fd1ac58b35029abf2fc28
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e116cecd2295c9e8fd07a1a181247937ec6b6d6391c5ad74be138e94529af9afced1c1c79940506f560c2eb57d631d52812e59ad54575aa577f23b2861f10e22
|
|
7
|
+
data.tar.gz: 7b8acc6720e77a526de73ee606f73a9fb2b67640a138c97429cbdc67ff9b313322ab0a91aa79c0f171919becd7e570b0a918f5f6e71f574e109ae331a7d3e616
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,56 +1,53 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
missile_emitter (0.3.
|
|
4
|
+
missile_emitter (0.3.19)
|
|
5
5
|
activesupport
|
|
6
6
|
|
|
7
7
|
GEM
|
|
8
|
-
remote: https://
|
|
8
|
+
remote: https://gems.ruby-china.com/
|
|
9
9
|
specs:
|
|
10
|
-
activesupport (
|
|
10
|
+
activesupport (7.0.3.1)
|
|
11
11
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
12
|
-
i18n (>=
|
|
13
|
-
minitest (
|
|
14
|
-
tzinfo (~>
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
i18n (1.8.2)
|
|
12
|
+
i18n (>= 1.6, < 2)
|
|
13
|
+
minitest (>= 5.1)
|
|
14
|
+
tzinfo (~> 2.0)
|
|
15
|
+
coderay (1.1.3)
|
|
16
|
+
concurrent-ruby (1.1.10)
|
|
17
|
+
diff-lcs (1.5.0)
|
|
18
|
+
i18n (1.12.0)
|
|
20
19
|
concurrent-ruby (~> 1.0)
|
|
21
|
-
method_source (0.
|
|
22
|
-
minitest (5.
|
|
23
|
-
pry (0.
|
|
24
|
-
coderay (~> 1.1
|
|
25
|
-
method_source (~>
|
|
26
|
-
rake (
|
|
27
|
-
rspec (3.
|
|
28
|
-
rspec-core (~> 3.
|
|
29
|
-
rspec-expectations (~> 3.
|
|
30
|
-
rspec-mocks (~> 3.
|
|
31
|
-
rspec-core (3.
|
|
32
|
-
rspec-support (~> 3.
|
|
33
|
-
rspec-expectations (3.
|
|
20
|
+
method_source (1.0.0)
|
|
21
|
+
minitest (5.16.3)
|
|
22
|
+
pry (0.14.1)
|
|
23
|
+
coderay (~> 1.1)
|
|
24
|
+
method_source (~> 1.0)
|
|
25
|
+
rake (13.0.6)
|
|
26
|
+
rspec (3.11.0)
|
|
27
|
+
rspec-core (~> 3.11.0)
|
|
28
|
+
rspec-expectations (~> 3.11.0)
|
|
29
|
+
rspec-mocks (~> 3.11.0)
|
|
30
|
+
rspec-core (3.11.0)
|
|
31
|
+
rspec-support (~> 3.11.0)
|
|
32
|
+
rspec-expectations (3.11.0)
|
|
34
33
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
35
|
-
rspec-support (~> 3.
|
|
36
|
-
rspec-mocks (3.
|
|
34
|
+
rspec-support (~> 3.11.0)
|
|
35
|
+
rspec-mocks (3.11.1)
|
|
37
36
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
38
|
-
rspec-support (~> 3.
|
|
39
|
-
rspec-support (3.
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
thread_safe (~> 0.1)
|
|
43
|
-
zeitwerk (2.2.2)
|
|
37
|
+
rspec-support (~> 3.11.0)
|
|
38
|
+
rspec-support (3.11.0)
|
|
39
|
+
tzinfo (2.0.5)
|
|
40
|
+
concurrent-ruby (~> 1.0)
|
|
44
41
|
|
|
45
42
|
PLATFORMS
|
|
46
|
-
|
|
43
|
+
x86_64-darwin-21
|
|
47
44
|
|
|
48
45
|
DEPENDENCIES
|
|
49
46
|
bundler (~> 2.0)
|
|
50
47
|
missile_emitter!
|
|
51
48
|
pry
|
|
52
|
-
rake (~>
|
|
49
|
+
rake (~> 13.0)
|
|
53
50
|
rspec (~> 3.0)
|
|
54
51
|
|
|
55
52
|
BUNDLED WITH
|
|
56
|
-
2.
|
|
53
|
+
2.3.17
|
|
@@ -29,12 +29,12 @@ module MissileEmitter
|
|
|
29
29
|
end
|
|
30
30
|
end
|
|
31
31
|
|
|
32
|
-
# 获取所有配置项名称:Klass
|
|
32
|
+
# 获取所有配置项名称:Configurable.option_names_for(Klass) ---> [:logo, copyright, ...]
|
|
33
33
|
define_singleton_method :option_names_for do |klass|
|
|
34
34
|
mapping.fetch klass, []
|
|
35
35
|
end
|
|
36
36
|
|
|
37
|
-
# 获取所有配置:Klass
|
|
37
|
+
# 获取所有配置:Configurable.options_for(Klass) ---> {logo: '', copyright: '', ...}
|
|
38
38
|
define_singleton_method :options_for do |klass|
|
|
39
39
|
option_names_for(klass).each_with_object({}) do |key, result|
|
|
40
40
|
result[key] = klass.send key
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
require 'rubygems'
|
|
2
|
+
|
|
1
3
|
module MissileEmitter
|
|
2
4
|
module Searchable
|
|
3
5
|
|
|
@@ -9,14 +11,20 @@ module MissileEmitter
|
|
|
9
11
|
(conditions[klass] ||= {}.with_indifferent_access)[key] = block
|
|
10
12
|
end
|
|
11
13
|
|
|
14
|
+
has_underline_method = Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.7.0')
|
|
15
|
+
|
|
12
16
|
define_method :search do |hash|
|
|
13
17
|
hash.reduce all do |relation, (key, value)|
|
|
14
18
|
next relation if value.blank? # ignore empty value
|
|
15
19
|
|
|
16
20
|
if filter = conditions.fetch(self, {})[key]
|
|
21
|
+
# Inside the scope block, You can get value through calling the _ method
|
|
17
22
|
relation.extending do
|
|
18
|
-
# Just for fun :)
|
|
23
|
+
# Just for fun :)
|
|
19
24
|
define_method(:_) { value }
|
|
25
|
+
# With ruby >= 2.7 you can use _1 instead of _
|
|
26
|
+
# Polyfill for the earlier version
|
|
27
|
+
alias_method :_1, :_ unless has_underline_method
|
|
20
28
|
end.instance_exec(value, &filter)
|
|
21
29
|
elsif column_names.include?(key.to_s)
|
|
22
30
|
relation.where key => value
|
data/missile_emitter.gemspec
CHANGED
|
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
|
|
|
29
29
|
spec.require_paths = ["lib"]
|
|
30
30
|
|
|
31
31
|
spec.add_development_dependency "bundler", "~> 2.0"
|
|
32
|
-
spec.add_development_dependency "rake", "~>
|
|
32
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
|
33
33
|
spec.add_development_dependency "rspec", "~> 3.0"
|
|
34
34
|
spec.add_development_dependency "pry"
|
|
35
35
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: missile_emitter
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.20
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jerry Chen
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2022-08-20 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -30,14 +30,14 @@ dependencies:
|
|
|
30
30
|
requirements:
|
|
31
31
|
- - "~>"
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
|
-
version: '
|
|
33
|
+
version: '13.0'
|
|
34
34
|
type: :development
|
|
35
35
|
prerelease: false
|
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
37
|
requirements:
|
|
38
38
|
- - "~>"
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
|
-
version: '
|
|
40
|
+
version: '13.0'
|
|
41
41
|
- !ruby/object:Gem::Dependency
|
|
42
42
|
name: rspec
|
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -114,7 +114,7 @@ metadata:
|
|
|
114
114
|
homepage_uri: https://github.com/coding-class-club/missile_emitter
|
|
115
115
|
source_code_uri: https://github.com/coding-class-club/missile_emitter
|
|
116
116
|
changelog_uri: https://github.com/coding-class-club/missile_emitter/blob/master/CHANGELOG.md
|
|
117
|
-
post_install_message:
|
|
117
|
+
post_install_message:
|
|
118
118
|
rdoc_options: []
|
|
119
119
|
require_paths:
|
|
120
120
|
- lib
|
|
@@ -129,8 +129,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
129
129
|
- !ruby/object:Gem::Version
|
|
130
130
|
version: '0'
|
|
131
131
|
requirements: []
|
|
132
|
-
rubygems_version: 3.
|
|
133
|
-
signing_key:
|
|
132
|
+
rubygems_version: 3.3.7
|
|
133
|
+
signing_key:
|
|
134
134
|
specification_version: 4
|
|
135
135
|
summary: Ruby元编程辅助工具
|
|
136
136
|
test_files: []
|