redis_monitor 0.1 → 0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +1 -0
  3. data/.travis.yml +1 -2
  4. data/Gemfile +2 -1
  5. data/README.md +1 -1
  6. data/Rakefile +5 -0
  7. data/bin/redis_monitor +2 -2
  8. data/lib/{server/command_line_parser.rb → command_line_parser.rb} +0 -3
  9. data/lib/engine/.gitignore +16 -0
  10. data/lib/engine/.rspec +2 -0
  11. data/lib/engine/Gemfile +5 -0
  12. data/lib/engine/Rakefile +6 -0
  13. data/lib/engine/app/assets/images/.keep +0 -0
  14. data/lib/engine/app/controllers/application_controller.rb +10 -0
  15. data/lib/engine/app/controllers/concerns/.keep +0 -0
  16. data/lib/engine/app/controllers/content_controller.rb +34 -0
  17. data/lib/engine/app/controllers/info_controller.rb +6 -0
  18. data/lib/engine/app/controllers/performance_controller.rb +8 -0
  19. data/lib/engine/app/helpers/application_helper.rb +21 -0
  20. data/lib/engine/app/helpers/database_helper.rb +36 -0
  21. data/lib/engine/app/helpers/pagination_helper.rb +8 -0
  22. data/lib/engine/app/lib/backend.rb +45 -0
  23. data/lib/{modules → engine/app/lib}/performance_stats.rb +0 -0
  24. data/lib/engine/app/lib/security/authentication.rb +14 -0
  25. data/lib/engine/app/lib/security/authorization.rb +16 -0
  26. data/lib/engine/app/mailers/.keep +0 -0
  27. data/lib/engine/app/models/.keep +0 -0
  28. data/lib/engine/app/models/concerns/.keep +0 -0
  29. data/lib/{views → engine/app/views}/content/_search_form.haml +0 -0
  30. data/lib/engine/app/views/content/index.haml +1 -0
  31. data/lib/{views → engine/app/views}/content/search.haml +5 -5
  32. data/lib/{views/info/info.haml → engine/app/views/info/index.haml} +1 -1
  33. data/lib/engine/app/views/layouts/application.haml +23 -0
  34. data/lib/{views → engine/app/views}/performance/check.haml +1 -1
  35. data/lib/{views/performance/warning.haml → engine/app/views/performance/index.haml} +0 -0
  36. data/lib/engine/bin/bundle +3 -0
  37. data/lib/engine/bin/rails +4 -0
  38. data/lib/engine/bin/rake +4 -0
  39. data/lib/engine/config/application.rb +34 -0
  40. data/lib/engine/config/boot.rb +4 -0
  41. data/lib/engine/config/database.yml +25 -0
  42. data/lib/engine/config/environment.rb +5 -0
  43. data/lib/engine/config/environments/development.rb +25 -0
  44. data/lib/engine/config/environments/production.rb +65 -0
  45. data/lib/engine/config/environments/test.rb +36 -0
  46. data/lib/engine/config/initializers/backtrace_silencers.rb +7 -0
  47. data/lib/engine/config/initializers/configuration.rb +5 -0
  48. data/lib/engine/config/initializers/filter_parameter_logging.rb +4 -0
  49. data/lib/engine/config/initializers/haml.rb +1 -0
  50. data/lib/engine/config/initializers/inflections.rb +16 -0
  51. data/lib/engine/config/initializers/mime_types.rb +5 -0
  52. data/lib/engine/config/initializers/secret_token.rb +12 -0
  53. data/lib/engine/config/initializers/session_store.rb +3 -0
  54. data/lib/engine/config/initializers/will_paginate.rb +1 -0
  55. data/lib/engine/config/initializers/wrap_parameters.rb +14 -0
  56. data/lib/engine/config/locales/en.bootstrap.yml +18 -0
  57. data/lib/engine/config/locales/en.yml +23 -0
  58. data/lib/engine/config/routes.rb +73 -0
  59. data/lib/engine/config.ru +4 -0
  60. data/lib/engine/db/seeds.rb +7 -0
  61. data/lib/engine/lib/assets/.keep +0 -0
  62. data/lib/engine/lib/tasks/.keep +0 -0
  63. data/lib/engine/log/.keep +0 -0
  64. data/lib/engine/public/404.html +58 -0
  65. data/lib/engine/public/422.html +58 -0
  66. data/lib/engine/public/500.html +57 -0
  67. data/lib/engine/public/favicon.ico +0 -0
  68. data/lib/{static/scripts → engine/public/javascripts}/app.js +0 -0
  69. data/lib/{static/scripts → engine/public/javascripts}/bootstrap-select.min.js +0 -0
  70. data/lib/{static/scripts → engine/public/javascripts}/bootstrap.min.js +0 -0
  71. data/lib/{static/scripts → engine/public/javascripts}/jquery-2.0.3.min.js +0 -0
  72. data/lib/engine/public/robots.txt +5 -0
  73. data/lib/{static/styles → engine/public/stylesheets}/bootstrap-select.min.css +0 -0
  74. data/lib/{static/styles → engine/public/stylesheets}/bootstrap.min.css +0 -0
  75. data/lib/{static/styles → engine/public/stylesheets}/custom.css +0 -0
  76. data/lib/engine/spec/controllers/content_controller_spec.rb +28 -0
  77. data/lib/engine/spec/controllers/info_controller_spec.rb +10 -0
  78. data/lib/engine/spec/controllers/performance_controller_spec.rb +10 -0
  79. data/{spec/modules → lib/engine/spec/lib}/backend_spec.rb +3 -3
  80. data/{spec/modules → lib/engine/spec/lib}/performance_stats_spec.rb +1 -1
  81. data/lib/engine/spec/lib/security/authentication_spec.rb +23 -0
  82. data/{spec/modules → lib/engine/spec/lib}/security/authorization_spec.rb +1 -1
  83. data/lib/engine/spec/spec_helper.rb +47 -0
  84. data/lib/engine/test/controllers/.keep +0 -0
  85. data/lib/engine/test/fixtures/.keep +0 -0
  86. data/lib/engine/test/helpers/.keep +0 -0
  87. data/lib/engine/test/integration/.keep +0 -0
  88. data/lib/engine/test/mailers/.keep +0 -0
  89. data/lib/engine/test/models/.keep +0 -0
  90. data/lib/engine/test/test_helper.rb +15 -0
  91. data/lib/engine/vendor/assets/javascripts/.keep +0 -0
  92. data/lib/engine/vendor/assets/stylesheets/.keep +0 -0
  93. data/lib/redis_monitor.rb +14 -10
  94. data/lib/{modules/version.rb → version.rb} +1 -1
  95. data/redis_monitor.gemspec +14 -4
  96. metadata +153 -100
  97. data/lib/controllers/base_controller.rb +0 -53
  98. data/lib/controllers/content_controller.rb +0 -37
  99. data/lib/controllers/info_controller.rb +0 -14
  100. data/lib/controllers/performance_controller.rb +0 -19
  101. data/lib/errors/errors.rb +0 -1
  102. data/lib/errors/redis_not_available.rb +0 -7
  103. data/lib/helpers/base_helper.rb +0 -13
  104. data/lib/helpers/database_helper.rb +0 -40
  105. data/lib/helpers/layouts_helper.rb +0 -29
  106. data/lib/helpers/pagination_helper.rb +0 -10
  107. data/lib/modules/backend.rb +0 -49
  108. data/lib/modules/controllers.rb +0 -5
  109. data/lib/modules/helpers.rb +0 -15
  110. data/lib/modules/router.rb +0 -26
  111. data/lib/modules/security/authentication.rb +0 -29
  112. data/lib/modules/security/authorization.rb +0 -18
  113. data/lib/server/server.rb +0 -27
  114. data/lib/views/content/index.haml +0 -1
  115. data/lib/views/errors/redis_not_available.haml +0 -2
  116. data/lib/views/layouts/main.haml +0 -21
  117. data/spec/controllers/base_controller_spec.rb +0 -34
  118. data/spec/controllers/content_controller_spec.rb +0 -41
  119. data/spec/controllers/info_controller_spec.rb +0 -22
  120. data/spec/controllers/performance_controller_spec.rb +0 -21
  121. data/spec/modules/security/authentication_spec.rb +0 -48
  122. data/spec/server/command_line_parser_spec.rb +0 -42
  123. data/spec/spec_helper.rb +0 -23
@@ -1,7 +1,7 @@
1
1
  # coding: utf-8
2
2
  lib = File.expand_path('../lib', __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'modules/version'
4
+ require 'version'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = 'redis_monitor'
@@ -18,14 +18,24 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = %w(lib)
20
20
 
21
- spec.add_runtime_dependency 'sinatra', '~> 1.4'
22
- spec.add_runtime_dependency 'webrick'
21
+
23
22
  spec.add_runtime_dependency 'redis', '~> 3.0'
23
+ spec.add_runtime_dependency 'rails', '~> 4.0'
24
+
25
+ if defined?(JRUBY_VERSION)
26
+ spec.add_runtime_dependency 'activerecord-jdbcsqlite3-adapter'
27
+ else
28
+ spec.add_runtime_dependency 'sqlite3'
29
+ end
30
+
31
+ spec.add_runtime_dependency 'jquery-rails'
24
32
  spec.add_runtime_dependency 'haml', '~> 4.0'
25
- spec.add_runtime_dependency 'will_paginate', '~> 3.0'
33
+ spec.add_runtime_dependency 'twitter-bootstrap-rails'
34
+ spec.add_runtime_dependency 'will_paginate', '~> 3.0.5'
26
35
  spec.add_runtime_dependency 'will_paginate-bootstrap'
27
36
 
28
37
  spec.add_development_dependency 'bundler', '~> 1.3'
29
38
  spec.add_development_dependency 'rake'
30
39
  spec.add_development_dependency 'rspec', '~> 2.14'
40
+ spec.add_development_dependency 'rspec-rails'
31
41
  end
metadata CHANGED
@@ -1,68 +1,74 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis_monitor
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.1'
5
- prerelease:
4
+ version: '0.2'
6
5
  platform: ruby
7
6
  authors:
8
7
  - Javier Jimenez
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2014-01-08 00:00:00.000000000 Z
11
+ date: 2014-01-11 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
- name: sinatra
14
+ name: redis
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '3.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '3.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rails
16
29
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
30
  requirements:
19
31
  - - ~>
20
32
  - !ruby/object:Gem::Version
21
- version: '1.4'
33
+ version: '4.0'
22
34
  type: :runtime
23
35
  prerelease: false
24
36
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
37
  requirements:
27
38
  - - ~>
28
39
  - !ruby/object:Gem::Version
29
- version: '1.4'
40
+ version: '4.0'
30
41
  - !ruby/object:Gem::Dependency
31
- name: webrick
42
+ name: sqlite3
32
43
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
44
  requirements:
35
- - - ! '>='
45
+ - - '>='
36
46
  - !ruby/object:Gem::Version
37
47
  version: '0'
38
48
  type: :runtime
39
49
  prerelease: false
40
50
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
51
  requirements:
43
- - - ! '>='
52
+ - - '>='
44
53
  - !ruby/object:Gem::Version
45
54
  version: '0'
46
55
  - !ruby/object:Gem::Dependency
47
- name: redis
56
+ name: jquery-rails
48
57
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
58
  requirements:
51
- - - ~>
59
+ - - '>='
52
60
  - !ruby/object:Gem::Version
53
- version: '3.0'
61
+ version: '0'
54
62
  type: :runtime
55
63
  prerelease: false
56
64
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
65
  requirements:
59
- - - ~>
66
+ - - '>='
60
67
  - !ruby/object:Gem::Version
61
- version: '3.0'
68
+ version: '0'
62
69
  - !ruby/object:Gem::Dependency
63
70
  name: haml
64
71
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
72
  requirements:
67
73
  - - ~>
68
74
  - !ruby/object:Gem::Version
@@ -70,47 +76,55 @@ dependencies:
70
76
  type: :runtime
71
77
  prerelease: false
72
78
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
79
  requirements:
75
80
  - - ~>
76
81
  - !ruby/object:Gem::Version
77
82
  version: '4.0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: twitter-bootstrap-rails
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
78
97
  - !ruby/object:Gem::Dependency
79
98
  name: will_paginate
80
99
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
100
  requirements:
83
101
  - - ~>
84
102
  - !ruby/object:Gem::Version
85
- version: '3.0'
103
+ version: 3.0.5
86
104
  type: :runtime
87
105
  prerelease: false
88
106
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
107
  requirements:
91
108
  - - ~>
92
109
  - !ruby/object:Gem::Version
93
- version: '3.0'
110
+ version: 3.0.5
94
111
  - !ruby/object:Gem::Dependency
95
112
  name: will_paginate-bootstrap
96
113
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
114
  requirements:
99
- - - ! '>='
115
+ - - '>='
100
116
  - !ruby/object:Gem::Version
101
117
  version: '0'
102
118
  type: :runtime
103
119
  prerelease: false
104
120
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
121
  requirements:
107
- - - ! '>='
122
+ - - '>='
108
123
  - !ruby/object:Gem::Version
109
124
  version: '0'
110
125
  - !ruby/object:Gem::Dependency
111
126
  name: bundler
112
127
  requirement: !ruby/object:Gem::Requirement
113
- none: false
114
128
  requirements:
115
129
  - - ~>
116
130
  - !ruby/object:Gem::Version
@@ -118,7 +132,6 @@ dependencies:
118
132
  type: :development
119
133
  prerelease: false
120
134
  version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
135
  requirements:
123
136
  - - ~>
124
137
  - !ruby/object:Gem::Version
@@ -126,23 +139,20 @@ dependencies:
126
139
  - !ruby/object:Gem::Dependency
127
140
  name: rake
128
141
  requirement: !ruby/object:Gem::Requirement
129
- none: false
130
142
  requirements:
131
- - - ! '>='
143
+ - - '>='
132
144
  - !ruby/object:Gem::Version
133
145
  version: '0'
134
146
  type: :development
135
147
  prerelease: false
136
148
  version_requirements: !ruby/object:Gem::Requirement
137
- none: false
138
149
  requirements:
139
- - - ! '>='
150
+ - - '>='
140
151
  - !ruby/object:Gem::Version
141
152
  version: '0'
142
153
  - !ruby/object:Gem::Dependency
143
154
  name: rspec
144
155
  requirement: !ruby/object:Gem::Requirement
145
- none: false
146
156
  requirements:
147
157
  - - ~>
148
158
  - !ruby/object:Gem::Version
@@ -150,11 +160,24 @@ dependencies:
150
160
  type: :development
151
161
  prerelease: false
152
162
  version_requirements: !ruby/object:Gem::Requirement
153
- none: false
154
163
  requirements:
155
164
  - - ~>
156
165
  - !ruby/object:Gem::Version
157
166
  version: '2.14'
167
+ - !ruby/object:Gem::Dependency
168
+ name: rspec-rails
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - '>='
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - '>='
179
+ - !ruby/object:Gem::Version
180
+ version: '0'
158
181
  description: Get general information of a running redis instance
159
182
  email:
160
183
  - javiyu7@gmail.com
@@ -171,86 +194,116 @@ files:
171
194
  - README.md
172
195
  - Rakefile
173
196
  - bin/redis_monitor
174
- - lib/controllers/base_controller.rb
175
- - lib/controllers/content_controller.rb
176
- - lib/controllers/info_controller.rb
177
- - lib/controllers/performance_controller.rb
178
- - lib/errors/errors.rb
179
- - lib/errors/redis_not_available.rb
180
- - lib/helpers/base_helper.rb
181
- - lib/helpers/database_helper.rb
182
- - lib/helpers/layouts_helper.rb
183
- - lib/helpers/pagination_helper.rb
184
- - lib/modules/backend.rb
185
- - lib/modules/controllers.rb
186
- - lib/modules/helpers.rb
187
- - lib/modules/performance_stats.rb
188
- - lib/modules/router.rb
189
- - lib/modules/security/authentication.rb
190
- - lib/modules/security/authorization.rb
191
- - lib/modules/version.rb
197
+ - lib/command_line_parser.rb
198
+ - lib/engine/.gitignore
199
+ - lib/engine/.rspec
200
+ - lib/engine/Gemfile
201
+ - lib/engine/Rakefile
202
+ - lib/engine/app/assets/images/.keep
203
+ - lib/engine/app/controllers/application_controller.rb
204
+ - lib/engine/app/controllers/concerns/.keep
205
+ - lib/engine/app/controllers/content_controller.rb
206
+ - lib/engine/app/controllers/info_controller.rb
207
+ - lib/engine/app/controllers/performance_controller.rb
208
+ - lib/engine/app/helpers/application_helper.rb
209
+ - lib/engine/app/helpers/database_helper.rb
210
+ - lib/engine/app/helpers/pagination_helper.rb
211
+ - lib/engine/app/lib/backend.rb
212
+ - lib/engine/app/lib/performance_stats.rb
213
+ - lib/engine/app/lib/security/authentication.rb
214
+ - lib/engine/app/lib/security/authorization.rb
215
+ - lib/engine/app/mailers/.keep
216
+ - lib/engine/app/models/.keep
217
+ - lib/engine/app/models/concerns/.keep
218
+ - lib/engine/app/views/content/_search_form.haml
219
+ - lib/engine/app/views/content/index.haml
220
+ - lib/engine/app/views/content/search.haml
221
+ - lib/engine/app/views/info/index.haml
222
+ - lib/engine/app/views/layouts/application.haml
223
+ - lib/engine/app/views/performance/check.haml
224
+ - lib/engine/app/views/performance/index.haml
225
+ - lib/engine/bin/bundle
226
+ - lib/engine/bin/rails
227
+ - lib/engine/bin/rake
228
+ - lib/engine/config.ru
229
+ - lib/engine/config/application.rb
230
+ - lib/engine/config/boot.rb
231
+ - lib/engine/config/database.yml
232
+ - lib/engine/config/environment.rb
233
+ - lib/engine/config/environments/development.rb
234
+ - lib/engine/config/environments/production.rb
235
+ - lib/engine/config/environments/test.rb
236
+ - lib/engine/config/initializers/backtrace_silencers.rb
237
+ - lib/engine/config/initializers/configuration.rb
238
+ - lib/engine/config/initializers/filter_parameter_logging.rb
239
+ - lib/engine/config/initializers/haml.rb
240
+ - lib/engine/config/initializers/inflections.rb
241
+ - lib/engine/config/initializers/mime_types.rb
242
+ - lib/engine/config/initializers/secret_token.rb
243
+ - lib/engine/config/initializers/session_store.rb
244
+ - lib/engine/config/initializers/will_paginate.rb
245
+ - lib/engine/config/initializers/wrap_parameters.rb
246
+ - lib/engine/config/locales/en.bootstrap.yml
247
+ - lib/engine/config/locales/en.yml
248
+ - lib/engine/config/routes.rb
249
+ - lib/engine/db/seeds.rb
250
+ - lib/engine/lib/assets/.keep
251
+ - lib/engine/lib/tasks/.keep
252
+ - lib/engine/log/.keep
253
+ - lib/engine/public/404.html
254
+ - lib/engine/public/422.html
255
+ - lib/engine/public/500.html
256
+ - lib/engine/public/favicon.ico
257
+ - lib/engine/public/javascripts/app.js
258
+ - lib/engine/public/javascripts/bootstrap-select.min.js
259
+ - lib/engine/public/javascripts/bootstrap.min.js
260
+ - lib/engine/public/javascripts/jquery-2.0.3.min.js
261
+ - lib/engine/public/robots.txt
262
+ - lib/engine/public/stylesheets/bootstrap-select.min.css
263
+ - lib/engine/public/stylesheets/bootstrap.min.css
264
+ - lib/engine/public/stylesheets/custom.css
265
+ - lib/engine/spec/controllers/content_controller_spec.rb
266
+ - lib/engine/spec/controllers/info_controller_spec.rb
267
+ - lib/engine/spec/controllers/performance_controller_spec.rb
268
+ - lib/engine/spec/lib/backend_spec.rb
269
+ - lib/engine/spec/lib/performance_stats_spec.rb
270
+ - lib/engine/spec/lib/security/authentication_spec.rb
271
+ - lib/engine/spec/lib/security/authorization_spec.rb
272
+ - lib/engine/spec/spec_helper.rb
273
+ - lib/engine/test/controllers/.keep
274
+ - lib/engine/test/fixtures/.keep
275
+ - lib/engine/test/helpers/.keep
276
+ - lib/engine/test/integration/.keep
277
+ - lib/engine/test/mailers/.keep
278
+ - lib/engine/test/models/.keep
279
+ - lib/engine/test/test_helper.rb
280
+ - lib/engine/vendor/assets/javascripts/.keep
281
+ - lib/engine/vendor/assets/stylesheets/.keep
192
282
  - lib/redis_monitor.rb
193
- - lib/server/command_line_parser.rb
194
- - lib/server/server.rb
195
- - lib/static/scripts/app.js
196
- - lib/static/scripts/bootstrap-select.min.js
197
- - lib/static/scripts/bootstrap.min.js
198
- - lib/static/scripts/jquery-2.0.3.min.js
199
- - lib/static/styles/bootstrap-select.min.css
200
- - lib/static/styles/bootstrap.min.css
201
- - lib/static/styles/custom.css
202
- - lib/views/content/_search_form.haml
203
- - lib/views/content/index.haml
204
- - lib/views/content/search.haml
205
- - lib/views/errors/redis_not_available.haml
206
- - lib/views/info/info.haml
207
- - lib/views/layouts/main.haml
208
- - lib/views/performance/check.haml
209
- - lib/views/performance/warning.haml
283
+ - lib/version.rb
210
284
  - redis_monitor.gemspec
211
- - spec/controllers/base_controller_spec.rb
212
- - spec/controllers/content_controller_spec.rb
213
- - spec/controllers/info_controller_spec.rb
214
- - spec/controllers/performance_controller_spec.rb
215
- - spec/modules/backend_spec.rb
216
- - spec/modules/performance_stats_spec.rb
217
- - spec/modules/security/authentication_spec.rb
218
- - spec/modules/security/authorization_spec.rb
219
- - spec/server/command_line_parser_spec.rb
220
- - spec/spec_helper.rb
221
285
  homepage: https://github.com/javiyu/redis_monitor
222
286
  licenses:
223
287
  - MIT
288
+ metadata: {}
224
289
  post_install_message:
225
290
  rdoc_options: []
226
291
  require_paths:
227
292
  - lib
228
293
  required_ruby_version: !ruby/object:Gem::Requirement
229
- none: false
230
294
  requirements:
231
- - - ! '>='
295
+ - - '>='
232
296
  - !ruby/object:Gem::Version
233
297
  version: '0'
234
298
  required_rubygems_version: !ruby/object:Gem::Requirement
235
- none: false
236
299
  requirements:
237
- - - ! '>='
300
+ - - '>='
238
301
  - !ruby/object:Gem::Version
239
302
  version: '0'
240
303
  requirements: []
241
304
  rubyforge_project:
242
- rubygems_version: 1.8.23
305
+ rubygems_version: 2.1.11
243
306
  signing_key:
244
- specification_version: 3
307
+ specification_version: 4
245
308
  summary: Get general information of a running redis instance
246
- test_files:
247
- - spec/controllers/base_controller_spec.rb
248
- - spec/controllers/content_controller_spec.rb
249
- - spec/controllers/info_controller_spec.rb
250
- - spec/controllers/performance_controller_spec.rb
251
- - spec/modules/backend_spec.rb
252
- - spec/modules/performance_stats_spec.rb
253
- - spec/modules/security/authentication_spec.rb
254
- - spec/modules/security/authorization_spec.rb
255
- - spec/server/command_line_parser_spec.rb
256
- - spec/spec_helper.rb
309
+ test_files: []
@@ -1,53 +0,0 @@
1
- require 'modules/backend'
2
- require 'errors/errors'
3
-
4
- module RedisMonitor
5
- module Controllers
6
- class BaseController
7
- attr_accessor :context, :session, :params
8
-
9
- include RedisMonitor::Helpers::BaseHelper
10
- include RedisMonitor::Helpers::LayoutsHelper
11
-
12
- def initialize(opts = {})
13
- @context = opts.delete(:context)
14
- @session = opts.delete(:session)
15
- @params = opts.delete(:params)
16
- end
17
-
18
- def execute(action)
19
- begin
20
- send(action)
21
- rescue RedisMonitor::Errors::RedisNotAvailable
22
- redis_not_available
23
- end
24
- end
25
-
26
- def redis_not_available
27
- haml 'errors/redis_not_available'.to_sym, layout: main_layout,
28
- locals: {host: Backend.host, port: Backend.port}
29
- end
30
-
31
- def http_referer
32
- context.env['HTTP_REFERER']
33
- end
34
-
35
- def context
36
- @context
37
- end
38
-
39
- def params
40
- @params
41
- end
42
-
43
- def session
44
- @session
45
- end
46
-
47
- def set_database(database)
48
- session[:database] = database
49
- Backend.change_database(database)
50
- end
51
- end
52
- end
53
- end
@@ -1,37 +0,0 @@
1
-
2
- module RedisMonitor
3
- module Controllers
4
- class ContentController < BaseController
5
- SECTION = 'content'
6
-
7
- def index
8
- haml 'content/index'.to_sym, layout: main_layout, locals: {section: SECTION}
9
- end
10
-
11
- def search
12
- results = Backend.search(params[:key]).paginate(:page => params[:page], :per_page => 20)
13
- haml 'content/search'.to_sym, layout: main_layout, locals: {results: results, section: SECTION, object: self}
14
- end
15
-
16
- def delete
17
- Backend.del(params[:key])
18
- redirect_back
19
- end
20
-
21
- def change_database
22
- set_database(params[:database])
23
- redirect_back
24
- end
25
-
26
- private
27
- def redirect_back
28
- if http_referer
29
- context.redirect http_referer
30
- else
31
- redirect '/content/search'
32
- end
33
- end
34
-
35
- end
36
- end
37
- end
@@ -1,14 +0,0 @@
1
-
2
- module RedisMonitor
3
- module Controllers
4
- class InfoController < BaseController
5
- include RedisMonitor::Helpers::LayoutsHelper
6
-
7
- SECTION = 'info'
8
-
9
- def index
10
- haml 'info/info'.to_sym, layout: main_layout, locals: {info: Backend.info, section: SECTION}
11
- end
12
- end
13
- end
14
- end
@@ -1,19 +0,0 @@
1
-
2
- module RedisMonitor
3
- module Controllers
4
- class PerformanceController < BaseController
5
-
6
- SECTION = 'performance'
7
-
8
- def warning(params = {})
9
- haml 'performance/warning'.to_sym, layout: main_layout, locals: {section: SECTION}
10
- end
11
-
12
- def check(params = {})
13
- stats = Backend.performance_stats
14
- haml 'performance/check'.to_sym, layout: main_layout, locals: {stats: stats, section: SECTION}
15
- end
16
-
17
- end
18
- end
19
- end
data/lib/errors/errors.rb DELETED
@@ -1 +0,0 @@
1
- require 'errors/redis_not_available'
@@ -1,7 +0,0 @@
1
- module RedisMonitor
2
- module Errors
3
- class RedisNotAvailable < Exception
4
-
5
- end
6
- end
7
- end
@@ -1,13 +0,0 @@
1
- module RedisMonitor
2
- module Helpers
3
- module BaseHelper
4
- def haml(*arguments)
5
- context.haml(*arguments)
6
- end
7
-
8
- def redirect(*arguments)
9
- context.redirect(*arguments)
10
- end
11
- end
12
- end
13
- end
@@ -1,40 +0,0 @@
1
- module RedisMonitor
2
- module Helpers
3
- module DatabaseHelper
4
- def current_database
5
- session[:database].to_i
6
- end
7
-
8
- def databases
9
- Backend.databases.each do |database|
10
- database_option(database)
11
- end
12
- end
13
-
14
- def database_option(database)
15
- haml_tag :option, {selected: (database.to_i == current_database.to_i)} do
16
- haml_concat database
17
- end
18
- end
19
-
20
- def choose_database_select
21
- capture_haml do
22
- haml_tag :form, action: '/content/change_database', method: 'post' do
23
- haml_tag :div, class: 'form-group' do
24
- haml_tag :label, for: 'database_select' do
25
- haml_concat 'Select database'
26
- end
27
-
28
- haml_tag :select, id: 'database_select', name: 'database', class: 'selectpicker form-control', data: {style: 'btn-info'} do
29
- databases
30
- end
31
- end
32
- end
33
-
34
- end
35
- end
36
-
37
- end
38
- end
39
- end
40
-
@@ -1,29 +0,0 @@
1
- module RedisMonitor
2
- module Helpers
3
- module LayoutsHelper
4
- def main_layout
5
- 'layouts/main'.to_sym
6
- end
7
-
8
- def selected_is_selected(section, selected)
9
- 'active' if section == selected
10
- end
11
-
12
- def section(opts = {})
13
- haml_tag :li, class: selected_is_selected(opts[:name], opts[:selected_section]) do
14
- haml_tag :a, opts[:title], href: opts[:url]
15
- end
16
- end
17
-
18
- def content_menu(selected_section)
19
- capture_haml do
20
- haml_tag :ul, class: 'nav navbar-nav' do
21
- section(name: 'info', title: 'Info', url: '/info', selected_section: selected_section)
22
- section(name: 'content', title: 'Content', url: '/content', selected_section: selected_section)
23
- section(name: 'performance', title: 'Performance', url: '/performance', selected_section: selected_section)
24
- end
25
- end
26
- end
27
- end
28
- end
29
- end
@@ -1,10 +0,0 @@
1
- module RedisMonitor
2
- module Helpers
3
- module PaginationHelper
4
- def bootstrap_paginate(results)
5
- will_paginate results, renderer: BootstrapPagination::Sinatra
6
- end
7
- end
8
- end
9
- end
10
-