circuit_switch 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b729bf949fe4ac1ac72d71ddd5610aa0dfc2a10baed31dd72d13bb36540c1181
4
- data.tar.gz: c2e9135c66f0c7b4bfe45d9984e3e111c852ea83a63eebd71d2d3deb3ebeb9e7
3
+ metadata.gz: b4cdb8d820d7ecce566ca391ad90990a2df09007d23ab3c223dbac66a3fcaa93
4
+ data.tar.gz: adb2a3ab38f303dd610f10a964014cbe75f0c752f5f6cd24ebf3c03319329c96
5
5
  SHA512:
6
- metadata.gz: a4a00c89177c4ea5efd74da1019ba37b18e06ecf241b428d7a45b31eec20d5040e39f6f0e5549f38ffad8f39f287014ba5922913e13d6dd56e1abd1661028d79
7
- data.tar.gz: 9d010114e183f72c769f97967d69d4271d00f242e758535a418dc5401cf8f42696a372ef1f89e16ecb7760d2d280fc8d6a2f8c8208bf5146969a664a11a8e452
6
+ metadata.gz: 25f3265010930a67234ab82ad2aac34915460c12fd2f85789961c93f32e459ef8af0516bac47160b390564056aad9d51f3d75dbf36103294eae72962944f3b77
7
+ data.tar.gz: bd0195acf137e1aba67081a1c0bef74a58cb8594cc4e2960eb899c88c5dfad84f0759761fce7aaab45a4b0ea860fc86057dbbda6c6490b03f5581f5a28219284
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.1.2
2
+
3
+ * Modify `CircuitSwitch.open?` recieves same arguments as `CircuitSwtich.run`
4
+
1
5
  ## 0.1.1
2
6
 
3
7
  * Fix bug due_date is not set.
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # CircuitSwitch
1
+ # circuit_switch
2
2
 
3
- CircuitSwitch is a gem for 'difficult' application; for example, few tests, too many meta-programming codes, low aggregation classes and few deploys.
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).
@@ -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 = 'Circuit switch to help changing source code in safety and easy with report tools'
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.
@@ -1,3 +1,3 @@
1
1
  module CircuitSwitch
2
- VERSION = '0.1.1'
2
+ VERSION = '0.1.2'
3
3
  end
@@ -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
- def open?(if: true, limit_count: nil)
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.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-06 00:00:00.000000000 Z
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: Circuit switch to help changing source code in safety and easy with report
98
- tools
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: