circuit_switch 0.1.1 → 0.1.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/CHANGELOG.md +4 -0
- data/README.md +2 -8
- data/circuit_switch.gemspec +2 -2
- data/lib/circuit_switch/version.rb +1 -1
- data/lib/circuit_switch.rb +11 -1
- 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: b4cdb8d820d7ecce566ca391ad90990a2df09007d23ab3c223dbac66a3fcaa93
|
4
|
+
data.tar.gz: adb2a3ab38f303dd610f10a964014cbe75f0c752f5f6cd24ebf3c03319329c96
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 25f3265010930a67234ab82ad2aac34915460c12fd2f85789961c93f32e459ef8af0516bac47160b390564056aad9d51f3d75dbf36103294eae72962944f3b77
|
7
|
+
data.tar.gz: bd0195acf137e1aba67081a1c0bef74a58cb8594cc4e2960eb899c88c5dfad84f0759761fce7aaab45a4b0ea860fc86057dbbda6c6490b03f5581f5a28219284
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
#
|
1
|
+
# circuit_switch
|
2
2
|
|
3
|
-
|
3
|
+
circuit_switch is a gem for 'difficult' application; for example, few tests, too many meta-programming codes, low aggregation classes and few deploys.
|
4
4
|
This switch helps make changes easier and deploy safely.
|
5
5
|
You can deploy and check with a short code like following if the change is good or not, and when a problem is found, you can undo it without releasing it.
|
6
6
|
|
@@ -153,12 +153,6 @@ By default, due_date is 10 days after today. To modify, set `due_date` to initia
|
|
153
153
|
|
154
154
|
Under development :)
|
155
155
|
|
156
|
-
## Development
|
157
|
-
|
158
|
-
After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
159
|
-
|
160
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
161
|
-
|
162
156
|
## Contributing
|
163
157
|
|
164
158
|
Bug reports and pull requests are welcome on GitHub at https://github.com/makicamel/circuit_switch. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/makicamel/circuit_switch/blob/master/CODE_OF_CONDUCT.md).
|
data/circuit_switch.gemspec
CHANGED
@@ -7,14 +7,14 @@ Gem::Specification.new do |spec|
|
|
7
7
|
spec.email = ["unright@gmail.com"]
|
8
8
|
|
9
9
|
spec.summary = 'Circuit switch with report tools'
|
10
|
-
spec.description = '
|
10
|
+
spec.description = 'circuit_switch is a gem for \'difficult\' application. This switch helps to make changes easier and deploy safely.'
|
11
11
|
spec.homepage = 'https://github.com/makicamel/circuit_switch'
|
12
12
|
spec.license = "MIT"
|
13
13
|
spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
|
14
14
|
|
15
15
|
spec.metadata["homepage_uri"] = spec.homepage
|
16
16
|
spec.metadata["source_code_uri"] = 'https://github.com/makicamel/circuit_switch'
|
17
|
-
spec.metadata["changelog_uri"] = 'https://github.com/makicamel/circuit_switch/CHANGELOG.md'
|
17
|
+
spec.metadata["changelog_uri"] = 'https://github.com/makicamel/circuit_switch/blob/main/CHANGELOG.md'
|
18
18
|
|
19
19
|
# Specify which files should be added to the gem when it is released.
|
20
20
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
data/lib/circuit_switch.rb
CHANGED
@@ -65,14 +65,24 @@ module CircuitSwitch
|
|
65
65
|
|
66
66
|
# Syntax sugar for `CircuitSwitch.run`
|
67
67
|
# @param if [Boolean, Proc] `CircuitSwitch.run` is runnable when `if` is truthy (default: true)
|
68
|
+
# @param close_if [Boolean, Proc] `CircuitSwitch.run` is runnable when `close_if` is falsy (default: false)
|
69
|
+
# @param close_if_reach_limit [Boolean] `CircuitSwitch.run` is NOT runnable when run count reaches limit (default: true)
|
68
70
|
# @param limit_count [Integer] Limit count. Use `run_limit_count` default value if it's nil. Can't be set 0 (default: nil)
|
69
|
-
|
71
|
+
# @return [Boolean]
|
72
|
+
def open?(
|
73
|
+
if: true,
|
74
|
+
close_if: false,
|
75
|
+
close_if_reach_limit: true,
|
76
|
+
limit_count: nil
|
77
|
+
)
|
70
78
|
if block_given?
|
71
79
|
raise ArgumentError.new('CircuitSwitch.open doesn\'t receive block. Use CircuitSwitch.run if you want to pass block.')
|
72
80
|
end
|
73
81
|
|
74
82
|
Core.new.run(
|
75
83
|
if: binding.local_variable_get(:if),
|
84
|
+
close_if: close_if,
|
85
|
+
close_if_reach_limit: close_if_reach_limit,
|
76
86
|
limit_count: limit_count
|
77
87
|
) {}.run?
|
78
88
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: circuit_switch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- makicamel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-10-
|
11
|
+
date: 2021-10-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activejob
|
@@ -94,8 +94,8 @@ dependencies:
|
|
94
94
|
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
|
-
description:
|
98
|
-
|
97
|
+
description: circuit_switch is a gem for 'difficult' application. This switch helps
|
98
|
+
to make changes easier and deploy safely.
|
99
99
|
email:
|
100
100
|
- unright@gmail.com
|
101
101
|
executables: []
|
@@ -135,7 +135,7 @@ licenses:
|
|
135
135
|
metadata:
|
136
136
|
homepage_uri: https://github.com/makicamel/circuit_switch
|
137
137
|
source_code_uri: https://github.com/makicamel/circuit_switch
|
138
|
-
changelog_uri: https://github.com/makicamel/circuit_switch/CHANGELOG.md
|
138
|
+
changelog_uri: https://github.com/makicamel/circuit_switch/blob/main/CHANGELOG.md
|
139
139
|
post_install_message:
|
140
140
|
rdoc_options: []
|
141
141
|
require_paths:
|