acts_as_monitor 0.1.2 → 1.0.1

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.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ 1.0.1 (July 9, 2012
2
+ - update version number
3
+ - fixed path problem
4
+ - fixed status_flag_not_equals
5
+ - Added supporto to warn_*? and error_*? public methods
6
+
1
7
  0.1.2 (June 18, 2012)
2
8
  - Added status_flag_equals and status_flag_not_equals class methods
3
9
 
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # ActsAsMonitor
2
2
 
3
3
  Provide a way to monitor the status of a model.
4
- The health of the model is checked by private method, defined by user
4
+ The health of the model is checked by private/public methods, defined by user
5
5
 
6
6
  ## Installation
7
7
 
@@ -68,7 +68,7 @@ You can use the monitor_tag helper to view a red/green/yellow rapresentation:
68
68
  ...
69
69
  <%= monitor_tag(@user) %>
70
70
 
71
- Clicking the icon you'll receive via Ajax the full error/warning list
71
+ Clicking the icon you'll receive, via Ajax, the full error/warning list
72
72
 
73
73
  ## Internationalization
74
74
  You can localize the output modifing the acts_as_monitor.it.yml, or cloning for the language you prefear.
@@ -38,7 +38,7 @@ module ActsAsMonitor
38
38
 
39
39
  #Return records with status flag not equals to given symbol (:red, :green, :yellow)
40
40
  def status_flag_not_equals(value)
41
- select {|p| !p.status_flag == value.to_sym}
41
+ select {|p| p.status_flag != value.to_sym}
42
42
  end
43
43
  end
44
44
 
@@ -51,7 +51,9 @@ module ActsAsMonitor
51
51
  def status
52
52
  search = /^(warn|error)_.*\?/
53
53
  out = {:warn => [], :error => []}
54
- methods = self.private_methods.map{|m| m.match(search) }.compact
54
+ methods = self.private_methods
55
+ methods += self.methods
56
+ methods = methods.map{|m| m.match(search) }.compact
55
57
  methods.each do |method|
56
58
  out[method[1].to_sym] << method[0].gsub("?","").to_sym if send(method[0])
57
59
  end
@@ -1,3 +1,3 @@
1
1
  module ActsAsMonitor
2
- VERSION = "0.1.2"
2
+ VERSION = "1.0.1"
3
3
  end
@@ -11,6 +11,7 @@ document.observe('dom:loaded', function()
11
11
  status_window.hide();
12
12
  //The helper provide the Rails.root inside the created div...
13
13
  application_root = status_window.innerHTML;
14
+ if (application_root == '/') {application_root = ''};
14
15
  }
15
16
 
16
17
  var handle_monitor = function(ev)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acts_as_monitor
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
+ - 1
7
8
  - 0
8
9
  - 1
9
- - 2
10
- version: 0.1.2
10
+ version: 1.0.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Andrea Bignozzi
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-06-18 00:00:00 +02:00
18
+ date: 2012-07-11 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency