ruff 1.1.0 → 1.2.0

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.
@@ -7,6 +7,22 @@ require 'ostruct'
7
7
  #
8
8
  # The module has an instance of `Instance` and provides its methods as module method.
9
9
  # @see Standard::State::Instance
10
+ # @example
11
+ # r = State.with {
12
+ # State.put 10
13
+ # puts State.get #==> 10
14
+ # State.modify {|s| s + 20}
15
+ # State.modify {|s|
16
+ # puts s #==> 30
17
+ # 0
18
+ # }
19
+ #
20
+ # puts State.get #==> 0
21
+ #
22
+ # State.put 11
23
+ # }
24
+ #
25
+ # puts r #==> 11
10
26
  module Ruff::Standard::State
11
27
  class Instance
12
28
  # makes new instances.
@@ -57,6 +73,7 @@ module Ruff::Standard::State
57
73
  # just using mutable assignment
58
74
  state = init
59
75
 
76
+ # The handler *closes* `state` variable so it should be created every time.
60
77
  Ruff.handler
61
78
  .on(@eff.modify) do |k, fn|
62
79
  state = fn[state]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ruff
4
- VERSION = '1.1.0'
4
+ VERSION = '1.2.0'
5
5
  end
data/version CHANGED
@@ -1 +1 @@
1
- 1.1.0
1
+ 1.2.0
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruff
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - nymphium
@@ -61,6 +61,8 @@ files:
61
61
  - docs/Ruff/Standard/CurrentTime/Instance.html
62
62
  - docs/Ruff/Standard/Defer.html
63
63
  - docs/Ruff/Standard/Defer/Instance.html
64
+ - docs/Ruff/Standard/MeasureTime.html
65
+ - docs/Ruff/Standard/MeasureTime/Instance.html
64
66
  - docs/Ruff/Standard/State.html
65
67
  - docs/Ruff/Standard/State/Instance.html
66
68
  - docs/Ruff/Throws.html
@@ -87,6 +89,7 @@ files:
87
89
  - lib/ruff/standard.rb
88
90
  - lib/ruff/standard/current_time.rb
89
91
  - lib/ruff/standard/defer.rb
92
+ - lib/ruff/standard/measure_time.rb
90
93
  - lib/ruff/standard/state.rb
91
94
  - lib/ruff/version.gen.sh
92
95
  - lib/ruff/version.rb