stats_lite 0.7.2 → 0.8.0

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: 47a9760853e8340d187a9c2d69efff0adb1d29c143cafc8b66d6c20d92470347
4
- data.tar.gz: 553cdcfa797a1071df6c72085fcc4d81ec1c0c06f6762eacd12b7ee17a1eedd4
3
+ metadata.gz: fb29ce935075fd11c0e39c7458ef6c66f0a06c9288a9e233be444b242ea594cf
4
+ data.tar.gz: 5ae3762f6ebf30dbf8fadb75391b33389b57607c92dba5a0052bed981dbcb2ed
5
5
  SHA512:
6
- metadata.gz: e5d9d3953289872a3aa470104e66cd9097df4bcba98692ce64a3b7b6463c5ecc752e0b3244a4d754fdfc223b9fc01663d56dec0133a33e318a2bbd52e3337373
7
- data.tar.gz: 682eb3ee2e0546ac76456d386f35373e2b4ba26dc1548878c110c29c15c138fa2c440b7a5f5042856a172831a918af4bea0d08da4698b709dd68ea1ced92a2fa
6
+ metadata.gz: cdae5f990f20f04dab35144c4911a3388b45d9b2297721cfdfd8e8a505c8a32aef883a47bad4ce492bcdb9c5b86c0d2ccd492ad0aa9911c79e51e19a19806d19
7
+ data.tar.gz: d76b86b445c3fb002578f7742da5d2745fd48ebbd71155e7979572f94e2ad68e9191a1c6bb3294bf961dc4147235413ba76d579285a69635c659e8cedc58e433
data/.gitignore CHANGED
@@ -10,4 +10,5 @@
10
10
  # rspec failure tracking
11
11
  .rspec_status
12
12
  .idea/
13
- .rake_tasks~
13
+ .rake_tasks~
14
+ .rakeTasks
@@ -2,29 +2,29 @@ PATH
2
2
  remote: .
3
3
  specs:
4
4
  stats_lite (0.7.2)
5
- filewatcher (~> 1.1.1)
6
5
  puma (>= 3.0.0, < 5.0.0)
7
6
  rack (>= 2.0.0, < 3.0.0)
7
+ rufus-scheduler (~> 3.6.0)
8
8
  sinatra (>= 2.0.0, < 3.0.0)
9
9
  vidibus-sysinfo (~> 1.2.0)
10
10
 
11
11
  GEM
12
12
  remote: https://rubygems.org/
13
13
  specs:
14
- actionpack (6.0.2)
15
- actionview (= 6.0.2)
16
- activesupport (= 6.0.2)
17
- rack (~> 2.0)
14
+ actionpack (6.0.2.2)
15
+ actionview (= 6.0.2.2)
16
+ activesupport (= 6.0.2.2)
17
+ rack (~> 2.0, >= 2.0.8)
18
18
  rack-test (>= 0.6.3)
19
19
  rails-dom-testing (~> 2.0)
20
20
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
21
- actionview (6.0.2)
22
- activesupport (= 6.0.2)
21
+ actionview (6.0.2.2)
22
+ activesupport (= 6.0.2.2)
23
23
  builder (~> 3.1)
24
24
  erubi (~> 1.4)
25
25
  rails-dom-testing (~> 2.0)
26
26
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
27
- activesupport (6.0.2)
27
+ activesupport (6.0.2.2)
28
28
  concurrent-ruby (~> 1.0, >= 1.0.2)
29
29
  i18n (>= 0.7, < 2)
30
30
  minitest (~> 5.1)
@@ -32,33 +32,37 @@ GEM
32
32
  zeitwerk (~> 2.2)
33
33
  ast (2.4.0)
34
34
  builder (3.2.4)
35
- concurrent-ruby (1.1.5)
36
- crass (1.0.5)
35
+ concurrent-ruby (1.1.6)
36
+ crass (1.0.6)
37
37
  diff-lcs (1.3)
38
38
  erubi (1.9.0)
39
- filewatcher (1.1.1)
40
- optimist (~> 3.0)
41
- i18n (1.7.0)
39
+ et-orbi (1.2.4)
40
+ tzinfo
41
+ fugit (1.3.4)
42
+ et-orbi (~> 1.1, >= 1.1.8)
43
+ raabro (~> 1.1)
44
+ i18n (1.8.2)
42
45
  concurrent-ruby (~> 1.0)
43
46
  jaro_winkler (1.5.4)
44
- loofah (2.4.0)
47
+ loofah (2.5.0)
45
48
  crass (~> 1.0.2)
46
49
  nokogiri (>= 1.5.9)
47
- method_source (0.9.2)
50
+ method_source (1.0.0)
48
51
  mini_portile2 (2.4.0)
49
- minitest (5.13.0)
50
- mustermann (1.0.3)
52
+ minitest (5.14.0)
53
+ mustermann (1.1.1)
54
+ ruby2_keywords (~> 0.0.1)
51
55
  nio4r (2.5.2)
52
- nokogiri (1.10.7)
56
+ nokogiri (1.10.9)
53
57
  mini_portile2 (~> 2.4.0)
54
- optimist (3.0.0)
55
58
  parallel (1.19.1)
56
- parser (2.6.5.0)
59
+ parser (2.7.1.2)
57
60
  ast (~> 2.4.0)
58
- puma (4.3.1)
61
+ puma (4.3.3)
59
62
  nio4r (~> 2.0)
60
- rack (2.0.7)
61
- rack-protection (2.0.7)
63
+ raabro (1.1.6)
64
+ rack (2.2.2)
65
+ rack-protection (2.0.8.1)
62
66
  rack
63
67
  rack-test (1.1.0)
64
68
  rack (>= 1.0, < 3)
@@ -67,68 +71,74 @@ GEM
67
71
  nokogiri (>= 1.6)
68
72
  rails-html-sanitizer (1.3.0)
69
73
  loofah (~> 2.3)
70
- railties (6.0.2)
71
- actionpack (= 6.0.2)
72
- activesupport (= 6.0.2)
74
+ railties (6.0.2.2)
75
+ actionpack (= 6.0.2.2)
76
+ activesupport (= 6.0.2.2)
73
77
  method_source
74
78
  rake (>= 0.8.7)
75
79
  thor (>= 0.20.3, < 2.0)
76
80
  rainbow (3.0.0)
77
- rake (10.5.0)
81
+ rake (13.0.1)
82
+ rexml (3.2.4)
78
83
  rspec (3.9.0)
79
84
  rspec-core (~> 3.9.0)
80
85
  rspec-expectations (~> 3.9.0)
81
86
  rspec-mocks (~> 3.9.0)
82
- rspec-core (3.9.0)
83
- rspec-support (~> 3.9.0)
84
- rspec-expectations (3.9.0)
87
+ rspec-core (3.9.1)
88
+ rspec-support (~> 3.9.1)
89
+ rspec-expectations (3.9.1)
85
90
  diff-lcs (>= 1.2.0, < 2.0)
86
91
  rspec-support (~> 3.9.0)
87
- rspec-mocks (3.9.0)
92
+ rspec-mocks (3.9.1)
88
93
  diff-lcs (>= 1.2.0, < 2.0)
89
94
  rspec-support (~> 3.9.0)
90
- rspec-support (3.9.0)
91
- rubocop (0.77.0)
95
+ rspec-support (3.9.2)
96
+ rubocop (0.82.0)
92
97
  jaro_winkler (~> 1.5.1)
93
98
  parallel (~> 1.10)
94
- parser (>= 2.6)
99
+ parser (>= 2.7.0.1)
95
100
  rainbow (>= 2.2.2, < 4.0)
101
+ rexml
96
102
  ruby-progressbar (~> 1.7)
97
- unicode-display_width (>= 1.4.0, < 1.7)
98
- rubocop-performance (1.5.1)
103
+ unicode-display_width (>= 1.4.0, < 2.0)
104
+ rubocop-performance (1.5.2)
99
105
  rubocop (>= 0.71.0)
100
- rubocop-rails (2.4.0)
106
+ rubocop-rails (2.5.2)
107
+ activesupport
101
108
  rack (>= 1.1)
102
109
  rubocop (>= 0.72.0)
103
- rubocop-rails_config (0.9.0)
104
- railties (>= 3.0)
105
- rubocop (~> 0.77)
110
+ rubocop-rails_config (0.12.1)
111
+ railties (>= 5.0)
112
+ rubocop (~> 0.82)
106
113
  rubocop-performance (~> 1.3)
107
114
  rubocop-rails (~> 2.0)
108
115
  ruby-progressbar (1.10.1)
109
- sinatra (2.0.7)
116
+ ruby2_keywords (0.0.2)
117
+ rufus-scheduler (3.6.0)
118
+ fugit (~> 1.1, >= 1.1.6)
119
+ sinatra (2.0.8.1)
110
120
  mustermann (~> 1.0)
111
121
  rack (~> 2.0)
112
- rack-protection (= 2.0.7)
122
+ rack-protection (= 2.0.8.1)
113
123
  tilt (~> 2.0)
114
- thor (1.0.0)
124
+ thor (1.0.1)
115
125
  thread_safe (0.3.6)
116
126
  tilt (2.0.10)
117
- tzinfo (1.2.5)
127
+ tzinfo (1.2.7)
118
128
  thread_safe (~> 0.1)
119
- unicode-display_width (1.6.0)
129
+ unicode-display_width (1.7.0)
120
130
  vidibus-sysinfo (1.2.0)
121
- zeitwerk (2.2.2)
131
+ zeitwerk (2.3.0)
122
132
 
123
133
  PLATFORMS
124
134
  ruby
125
135
 
126
136
  DEPENDENCIES
127
- bundler (~> 2.0)
128
- rake (~> 10.0)
129
- rspec (~> 3.0)
130
- rubocop-rails_config (~> 0.9.0)
137
+ bundler (~> 2.1.4)
138
+ rake (~> 13.0.1)
139
+ rspec (~> 3.9.0)
140
+ rubocop-rails_config (~> 0.12.1)
131
141
  stats_lite!
132
142
 
133
143
  BUNDLED WITH
134
- 2.0.2
144
+ 2.1.4
data/README.md CHANGED
@@ -90,5 +90,14 @@ StatsLite.configure do |s, h|
90
90
  run lambda { |env| [200, {'Content-Type' => 'text/plain'}, ['OK']] }
91
91
  end
92
92
  end
93
+
94
+ s.cron do |rufus| # uses the Rufus scheduler, more details here https://github.com/jmettraux/rufus-scheduler
95
+ rufus.every "5s" do
96
+ print "\n cron job"
97
+ end
98
+ rufus.every "1h" do
99
+ print "\n hourly cron job"
100
+ end
101
+ end
93
102
  end
94
103
  ```
@@ -27,4 +27,10 @@ StatsLite.configure do |s, h|
27
27
  run lambda { |env| [200, { "Content-Type" => "text/plain" }, ["OK"]] }
28
28
  end
29
29
  end
30
+
31
+ s.cron do |rufus|
32
+ rufus.every "5s" do
33
+ print "\ncron job"
34
+ end
35
+ end
30
36
  end
@@ -3,6 +3,7 @@
3
3
  require "sinatra"
4
4
  require "json"
5
5
  require "vidibus-sysinfo"
6
+ require 'rufus-scheduler'
6
7
 
7
8
  Dir[File.join(__dir__, "stats_lite", "**/*.rb")].each { |file| require file }
8
9
 
@@ -31,6 +31,11 @@ module StatsLite
31
31
  def data(_data = nil)
32
32
  _data ? @data = _data : @data
33
33
  end
34
+
35
+ def cron
36
+ @rufus_wrapper ||= RufusWrapper.new
37
+ yield @rufus_wrapper.instance
38
+ end
34
39
  end
35
40
 
36
41
  class << self
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module StatsLite
4
- VERSION = "0.7.2"
4
+ VERSION = "0.8.0"
5
5
  end
@@ -10,8 +10,8 @@ Gem::Specification.new do |spec|
10
10
  spec.authors = ["sebi"]
11
11
  spec.email = ["sebyx07.pro@gmail.com"]
12
12
 
13
- spec.summary = "Simple web server to get linux system information. Rails compatible engine"
14
- spec.description = %{ Get system information for linux hosts. Standalone or rails engine }
13
+ spec.summary = "Simple web server to get linux system information. Rails compatible engine. Supports scheduled jobs"
14
+ spec.description = %{ Get system information for linux hosts. Standalone or rails engine. Rufus scheduler included }
15
15
  spec.homepage = "https://github.com/sebyx07/stats-lite"
16
16
  spec.license = "MIT"
17
17
 
@@ -36,14 +36,14 @@ Gem::Specification.new do |spec|
36
36
  spec.executables = "stats-lite"
37
37
  spec.require_paths = ["lib"]
38
38
 
39
- spec.add_development_dependency "bundler", "~> 2.0"
40
- spec.add_development_dependency "rake", "~> 10.0"
41
- spec.add_development_dependency "rspec", "~> 3.0"
42
- spec.add_development_dependency "rubocop-rails_config", "~> 0.9.0"
39
+ spec.add_development_dependency "bundler", "~> 2.1.4"
40
+ spec.add_development_dependency "rake", "~> 13.0.1"
41
+ spec.add_development_dependency "rspec", "~> 3.9.0"
42
+ spec.add_development_dependency "rubocop-rails_config", "~> 0.12.1"
43
43
 
44
44
  spec.add_dependency "rack", ">= 2.0.0", "< 3.0.0"
45
45
  spec.add_dependency "puma", ">= 3.0.0", "< 5.0.0"
46
46
  spec.add_dependency "sinatra", ">= 2.0.0", "< 3.0.0"
47
47
  spec.add_dependency "vidibus-sysinfo", "~> 1.2.0"
48
- spec.add_dependency "filewatcher", "~> 1.1.1"
48
+ spec.add_dependency "rufus-scheduler", "~> 3.6.0"
49
49
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stats_lite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - sebi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-12-20 00:00:00.000000000 Z
11
+ date: 2020-05-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,56 +16,56 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '2.0'
19
+ version: 2.1.4
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '2.0'
26
+ version: 2.1.4
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: 13.0.1
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: '10.0'
40
+ version: 13.0.1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '3.0'
47
+ version: 3.9.0
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '3.0'
54
+ version: 3.9.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rubocop-rails_config
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 0.9.0
61
+ version: 0.12.1
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 0.9.0
68
+ version: 0.12.1
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rack
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -141,20 +141,21 @@ dependencies:
141
141
  - !ruby/object:Gem::Version
142
142
  version: 1.2.0
143
143
  - !ruby/object:Gem::Dependency
144
- name: filewatcher
144
+ name: rufus-scheduler
145
145
  requirement: !ruby/object:Gem::Requirement
146
146
  requirements:
147
147
  - - "~>"
148
148
  - !ruby/object:Gem::Version
149
- version: 1.1.1
149
+ version: 3.6.0
150
150
  type: :runtime
151
151
  prerelease: false
152
152
  version_requirements: !ruby/object:Gem::Requirement
153
153
  requirements:
154
154
  - - "~>"
155
155
  - !ruby/object:Gem::Version
156
- version: 1.1.1
157
- description: " Get system information for linux hosts. Standalone or rails engine "
156
+ version: 3.6.0
157
+ description: " Get system information for linux hosts. Standalone or rails engine.
158
+ Rufus scheduler included "
158
159
  email:
159
160
  - sebyx07.pro@gmail.com
160
161
  executables:
@@ -163,7 +164,6 @@ extensions: []
163
164
  extra_rdoc_files: []
164
165
  files:
165
166
  - ".gitignore"
166
- - ".rakeTasks"
167
167
  - ".rspec"
168
168
  - ".rubocop.yml"
169
169
  - ".travis.yml"
@@ -209,8 +209,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
209
209
  - !ruby/object:Gem::Version
210
210
  version: '0'
211
211
  requirements: []
212
- rubygems_version: 3.0.6
212
+ rubygems_version: 3.1.2
213
213
  signing_key:
214
214
  specification_version: 4
215
- summary: Simple web server to get linux system information. Rails compatible engine
215
+ summary: Simple web server to get linux system information. Rails compatible engine.
216
+ Supports scheduled jobs
216
217
  test_files: []
data/.rakeTasks DELETED
@@ -1,7 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <Settings><!--This file was automatically generated by Ruby plugin.
3
- You are allowed to:
4
- 1. Remove rake task
5
- 2. Add existing rake tasks
6
- To add existing rake tasks automatically delete this file and reload the project.
7
- --><RakeGroup description="" fullCmd="" taksId="rake" /></Settings>