acts_as_service 0.0.5 → 0.0.6
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/acts_as_service.gemspec +2 -2
- data/lib/acts_as_service.rb +4 -11
- metadata +4 -4
data/acts_as_service.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{acts_as_service}
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.6"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Brian Percival"]
|
12
|
-
s.date = %q{2011-
|
12
|
+
s.date = %q{2011-02-07}
|
13
13
|
s.description = %q{A gem with a mixin to let you turn a class into something that runs like a service,
|
14
14
|
which you can MyService.start, MyService.stop, and MyService.restart. It tracks
|
15
15
|
its own pid. For now, pretty sure it requires that the class is running inside
|
data/lib/acts_as_service.rb
CHANGED
@@ -197,26 +197,19 @@ module ActsAsService
|
|
197
197
|
# fetches the service's name, using class name as default
|
198
198
|
#---------------------------------------------------------------------------
|
199
199
|
def _display_name
|
200
|
-
|
201
|
-
service_name :
|
202
|
-
name.split("::").last)
|
200
|
+
respond_to?(:service_name) ? service_name : name.split("::").last
|
203
201
|
end
|
204
202
|
|
205
203
|
|
206
204
|
# returns the pid filename
|
207
205
|
#---------------------------------------------------------------------------
|
208
206
|
def _pid_filename
|
209
|
-
if defined?(@@_pid_filename)
|
210
|
-
return @@_pid_filename
|
211
|
-
end
|
212
|
-
|
213
207
|
if respond_to?(:service_pid_filename)
|
214
|
-
|
208
|
+
return service_pid_filename
|
215
209
|
else
|
216
|
-
|
217
|
-
|
210
|
+
return File.join(RAILS_ROOT, 'tmp', 'pids',
|
211
|
+
"#{_display_name.underscore.gsub(/\s+/, '_')}.pid")
|
218
212
|
end
|
219
|
-
return @@_pid_filename
|
220
213
|
end
|
221
214
|
|
222
215
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: acts_as_service
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 6
|
10
|
+
version: 0.0.6
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Brian Percival
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-02-07 00:00:00 -08:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|