acts_as_ecv 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/README +0 -0
  2. data/lib/acts_as_ecv.rb +23 -0
  3. metadata +68 -0
data/README ADDED
File without changes
@@ -0,0 +1,23 @@
1
+ module ActsAsEcv
2
+ def self.included(base)
3
+ base.extend ClassMethods
4
+ end
5
+
6
+ module ClassMethods
7
+ def acts_as_ecv(attr={})
8
+ up_txt = attr[:up_txt] || "SYSTEM UP"
9
+ down_txt = attr[:down_txt] || "SYSTEM DOWN"
10
+ down_file = attr[:down_file] || File.join("public", "system", "down")
11
+ define_method('index') do
12
+ # Check if app has been marked as down
13
+ if File.exists?(down_file)
14
+ render :text => down_txt
15
+ else
16
+ render :text => up_txt
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
22
+
23
+ ActionController::Base.send(:include, ActsAsEcv)
metadata ADDED
@@ -0,0 +1,68 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: acts_as_ecv
3
+ version: !ruby/object:Gem::Version
4
+ hash: 27
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 2
10
+ version: 0.0.2
11
+ platform: ruby
12
+ authors:
13
+ - Darren Dao
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2011-02-24 00:00:00 Z
19
+ dependencies: []
20
+
21
+ description:
22
+ email: darrendao@gmail.com
23
+ executables: []
24
+
25
+ extensions: []
26
+
27
+ extra_rdoc_files: []
28
+
29
+ files:
30
+ - README
31
+ - lib/acts_as_ecv.rb
32
+ homepage: http://github.com/darrendao/acts_as_ecv
33
+ licenses: []
34
+
35
+ post_install_message:
36
+ rdoc_options:
37
+ - --inline-source
38
+ - --charset=UTF-8
39
+ require_paths:
40
+ - lib
41
+ required_ruby_version: !ruby/object:Gem::Requirement
42
+ none: false
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ hash: 3
47
+ segments:
48
+ - 0
49
+ version: "0"
50
+ required_rubygems_version: !ruby/object:Gem::Requirement
51
+ none: false
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ hash: 3
56
+ segments:
57
+ - 0
58
+ version: "0"
59
+ requirements: []
60
+
61
+ rubyforge_project:
62
+ rubygems_version: 1.8.11
63
+ signing_key:
64
+ specification_version: 2
65
+ summary: blah
66
+ test_files: []
67
+
68
+ has_rdoc: true