yuuki 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: 95e60a7be44a24d27a3340b1a0bf86df33927e32cd855dd9b99df4faa2bc1685
4
- data.tar.gz: '055829249f336c32e1f88f73984bbd465c037ad6b6edb5a3e2bce68139b25976'
3
+ metadata.gz: 1d3d8f9e2aa09bcc0a19661a400c20d5efbc522d5f116e7cc8fd0ce6cf9a7212
4
+ data.tar.gz: 5b1724b25b7ca140eda2e70eabf39c1a748aae79464199f2bcba06687afe6767
5
5
  SHA512:
6
- metadata.gz: b44ff4617ffaaf0e18e0654d67113308518b04575bc74ced15b3afa1418c479e5a577fcbac30de3aa9ff32a6bdcf007c4669a742df0da03a5ce684f271936a58
7
- data.tar.gz: 9decda81bcfc32138478d91015590d0da49734e7e3d246a87bc40101daa7691a883118f8ad09d889b94dd9ce225f286a40635c2f94a6b84d3b1035431c8064e5
6
+ metadata.gz: 2de44a625ca13e0d1e290996b7e02ec30725ed5c463ce33894490a797eea4603242aa9e735479a8ef01613030815c6cd3f9bdb544760ca397d84fc52059875df
7
+ data.tar.gz: 351c404e1a6ab8939cb93f944da4d3ba4742a2e147a7e1ae59490a4f43b51a20f1c9df1df5aa78184131dc1b8fdf7c99d84ead60de1a3622efc6017e9477b89f
data/README.md CHANGED
@@ -21,7 +21,11 @@ Or install it yourself as:
21
21
  ## Usage
22
22
 
23
23
  ```ruby
24
+ require 'yuuki'
25
+
24
26
  class HogeClass
27
+ extend Yuuki::Runner
28
+
25
29
  add :a
26
30
  def a
27
31
  puts 'a'
data/lib/yuuki/caller.rb CHANGED
@@ -5,7 +5,7 @@ require 'yuuki/runner'
5
5
 
6
6
  module Yuuki
7
7
  class Caller
8
- def self.require_dir(_dir, recursive: false)
8
+ def self.require_dir(require_dir, recursive: false)
9
9
  Dir.glob(recursive ? "#{require_dir}/**/*.rb" : "#{require_dir}/*.rb"){|file| require file}
10
10
  end
11
11
 
@@ -11,7 +11,7 @@ module Yuuki
11
11
  @yuuki_methods[method] ||= {}
12
12
  @yuuki_methods[method][:periodic] = interval
13
13
  end
14
-
14
+
15
15
  # set whether the method run at the first time
16
16
  def first_run(method, enabled: true)
17
17
  @yuuki_methods ||= {}
data/lib/yuuki/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Yuuki
4
- VERSION = '0.1.1'
4
+ VERSION = '0.1.2'
5
5
  end
@@ -0,0 +1,25 @@
1
+ # TypeProf 0.21.2
2
+
3
+ # Classes
4
+ module Yuuki
5
+ class Caller
6
+ @instances: Set[untyped]
7
+ @threads: Array[Thread]
8
+
9
+ def self.require_dir: (String require_dir, ?recursive: bool) -> void
10
+ def initialize: (*untyped instances) -> void
11
+ def add: (*untyped instances) -> void
12
+ def runners: -> Array[untyped]
13
+ def run: (**untyped) -> void
14
+ def run_select: (^(Method, Hash[Symbol, untyped]) -> bool proc_select, **untyped) -> void
15
+ def run_tag: (*Symbol tags, **untyped) -> void
16
+ def run_method: (Class klass, Symbol method_sig, **untyped) -> void
17
+ def join: -> void
18
+ def alive?: -> bool
19
+ alias running? alive?
20
+
21
+ private
22
+ def run_internal: (Array[untyped] runners, Hash[Symbol, untyped] args) -> void
23
+ def run_method_internal: (Method method, Hash[Symbol, untyped] args) -> void
24
+ end
25
+ end
@@ -0,0 +1,7 @@
1
+ # TypeProf 0.21.2
2
+
3
+ # Classes
4
+ module Yuuki
5
+ class Error < StandardError
6
+ end
7
+ end
@@ -0,0 +1,19 @@
1
+ # TypeProf 0.21.2
2
+
3
+ # Classes
4
+ module Yuuki
5
+ module Runner
6
+ def periodic: (Symbol method, Integer interval) -> void
7
+ def first_run: (Symbol method, ?enabled: bool) -> void
8
+ end
9
+
10
+ class PeriodicCaller < Caller
11
+ @on_error: Proc
12
+
13
+ attr_reader first_run: bool
14
+ attr_reader current_time: Float
15
+ def initialize: (*untyped instances) -> void
16
+ def on_error: {(Exception) -> void} -> void
17
+ def run: (?Integer gmtoff, **untyped) -> void
18
+ end
19
+ end
@@ -0,0 +1,14 @@
1
+ # TypeProf 0.21.2
2
+
3
+ # Classes
4
+ module Yuuki
5
+ module Runner
6
+ @yuuki_methods: Hash[Symbol, Hash[Symbol, untyped]]
7
+
8
+ def add: (*Symbol methods) -> void
9
+ def delete: (*Symbol methods) -> void
10
+ def tag: (Symbol method, *Symbol tags) -> void
11
+ def thread: (*Symbol methods, ?enabled: bool) -> void
12
+ def priority: (*Symbol methods, Numeric priority) -> void
13
+ end
14
+ end
@@ -0,0 +1,6 @@
1
+ # TypeProf 0.21.2
2
+
3
+ # Classes
4
+ module Yuuki
5
+ VERSION: String
6
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yuuki
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
  - Ishotihadus
@@ -72,6 +72,11 @@ files:
72
72
  - lib/yuuki/periodic.rb
73
73
  - lib/yuuki/runner.rb
74
74
  - lib/yuuki/version.rb
75
+ - sig/yuuki/caller.rbs
76
+ - sig/yuuki/error.rbs
77
+ - sig/yuuki/periodic.rbs
78
+ - sig/yuuki/runner.rbs
79
+ - sig/yuuki/version.rbs
75
80
  - yuuki.gemspec
76
81
  homepage: https://github.com/ishotihadus/yuuki
77
82
  licenses: