daemon-ogre 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.idea/.name +1 -0
- data/.idea/.rakeTasks +7 -0
- data/.idea/daemon-ogre.iml +18 -0
- data/.idea/encodings.xml +5 -0
- data/.idea/misc.xml +42 -0
- data/.idea/modules.xml +9 -0
- data/.idea/scopes/scope_settings.xml +5 -0
- data/.idea/vcs.xml +7 -0
- data/.idea/workspace.xml +655 -0
- data/Gemfile +9 -0
- data/Gemfile.lock +26 -0
- data/LICENSE.txt +20 -0
- data/README.md +121 -0
- data/README.rdoc +115 -0
- data/Rakefile +52 -0
- data/VERSION +1 -0
- data/daemon-ogre.gemspec +69 -0
- data/lib/daemon-ogre.rb +569 -0
- data/test/helper.rb +18 -0
- data/test/test_daemon-ogre.rb +22 -0
- data/test/var/daemon.stderr.log +0 -0
- data/test/var/log/log_file_name +494 -0
- data/test/var/pid/pid_file_name +1 -0
- metadata +126 -0
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
columnize (0.3.6)
|
5
|
+
debugger (1.5.0)
|
6
|
+
columnize (>= 0.3.1)
|
7
|
+
debugger-linecache (~> 1.2.0)
|
8
|
+
debugger-ruby_core_source (~> 1.2.0)
|
9
|
+
debugger-linecache (1.2.0)
|
10
|
+
debugger-ruby_core_source (1.2.0)
|
11
|
+
git (1.2.5)
|
12
|
+
jeweler (1.8.4)
|
13
|
+
bundler (~> 1.0)
|
14
|
+
git (>= 1.2.5)
|
15
|
+
rake
|
16
|
+
rdoc
|
17
|
+
rake (10.0.4)
|
18
|
+
rdoc (3.9.5)
|
19
|
+
|
20
|
+
PLATFORMS
|
21
|
+
ruby
|
22
|
+
|
23
|
+
DEPENDENCIES
|
24
|
+
debugger
|
25
|
+
jeweler (~> 1.8.4)
|
26
|
+
rdoc
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2013 adam.luzsi
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,121 @@
|
|
1
|
+
daemon-ogre
|
2
|
+
===========
|
3
|
+
|
4
|
+
= daemon-ogre
|
5
|
+
|
6
|
+
|
7
|
+
gem install 'daemon-ogre'
|
8
|
+
|
9
|
+
|
10
|
+
require 'daemon-ogre'
|
11
|
+
DaemonOgre.start
|
12
|
+
|
13
|
+
|
14
|
+
but we love config our beloved App!
|
15
|
+
-======================================================================================================================-
|
16
|
+
DaemonOgre.start :name => "MySuperAppName!", #this will be the name of the application
|
17
|
+
:log_path => "./var/log/log_file_name", #this will be the logfile place and name
|
18
|
+
:pid_path => "./var/pid/pid_file_name", #this will be the pidfile place and name
|
19
|
+
:terminate => true #this command not let start your code if it's not started
|
20
|
+
# with "start" arguments like :
|
21
|
+
# ruby my_awsome_app.rb start
|
22
|
+
|
23
|
+
|
24
|
+
-======================================================================================================================-
|
25
|
+
othere stuffs to use:
|
26
|
+
everybody love: require_relative...
|
27
|
+
so why should not try require_directory instead all the fuss
|
28
|
+
you can tell to it if you want some file to be excluded or just delayed loaded,
|
29
|
+
because you want them loaded in the last place
|
30
|
+
Example:
|
31
|
+
|
32
|
+
require_directory "some_dir_name_from_here_where_are_multi_dir_levels"
|
33
|
+
|
34
|
+
or
|
35
|
+
|
36
|
+
require_directory "some_dir_name_from_here_where_are_multi_dir_levels",
|
37
|
+
:delayed => ["files","to","be","delayed","in","load"],
|
38
|
+
:exclude => ["files","to","be","exclude","in","load"]
|
39
|
+
|
40
|
+
|
41
|
+
-======================================================================================================================-
|
42
|
+
and ofc what else what we love if not our beloved yml-s
|
43
|
+
we should use a nice Config constant for this(or at least i love to do)
|
44
|
+
|
45
|
+
CONFIG = require_ymls "some_dir_name_from_here_where_are_the_yml_files_in_multi_dir_level"
|
46
|
+
the file names will be the hash-key and under that , there will be the yml file datas loaded in
|
47
|
+
|
48
|
+
if you need get a free port in a range or from, you can use this:
|
49
|
+
get_port(from_nmb,to_nmb,host)
|
50
|
+
|
51
|
+
or by simply
|
52
|
+
|
53
|
+
get_port(number)
|
54
|
+
|
55
|
+
|
56
|
+
and if you hate find all the bugs... you can use error_logger at your command like this:
|
57
|
+
|
58
|
+
|
59
|
+
begin
|
60
|
+
|
61
|
+
your awsome code!
|
62
|
+
|
63
|
+
rescue xyexception => ex
|
64
|
+
logger ex, #error_msg
|
65
|
+
prefix, #this is optionable! but i usualy use: "#{__FILE__}/#{__LINE__}"
|
66
|
+
log_file #this is optionable!
|
67
|
+
end
|
68
|
+
|
69
|
+
|
70
|
+
if you need methods from any kind of class without the object methods, you should try this!
|
71
|
+
Xyclassname.class_methods
|
72
|
+
|
73
|
+
|
74
|
+
you want make some test script with rnd numbers, strings, dates, bools etc? use the Rnd class at your command
|
75
|
+
Rnd
|
76
|
+
-string
|
77
|
+
-number
|
78
|
+
-boolean
|
79
|
+
-date
|
80
|
+
|
81
|
+
example: Rnd.number(100)
|
82
|
+
or Rnd.string(15,2) #for rnd bla bla names
|
83
|
+
|
84
|
+
|
85
|
+
You need get the index of an Array element? you can use:
|
86
|
+
array_variable.index_of("something)
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
-=========================================================-
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
in Short:
|
95
|
+
require 'daemon-ogre'
|
96
|
+
DaemonOgre.start
|
97
|
+
|
98
|
+
for boot your files and ymls, helpers above :)
|
99
|
+
your_Super_app_code!
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
== Contributing to daemon-ogre
|
105
|
+
|
106
|
+
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
|
107
|
+
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
|
108
|
+
* Fork the project.
|
109
|
+
* Start a feature/bugfix branch.
|
110
|
+
* Commit and push until you are happy with your contribution.
|
111
|
+
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
112
|
+
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
113
|
+
|
114
|
+
== Copyright
|
115
|
+
|
116
|
+
Copyright (c) 2013 adam.luzsi. See LICENSE.txt for
|
117
|
+
further details.
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
daemon-ogre
|
data/README.rdoc
ADDED
@@ -0,0 +1,115 @@
|
|
1
|
+
= daemon-ogre
|
2
|
+
|
3
|
+
|
4
|
+
gem install 'daemon-ogre'
|
5
|
+
|
6
|
+
|
7
|
+
require 'daemon-ogre'
|
8
|
+
DaemonOgre.start
|
9
|
+
|
10
|
+
|
11
|
+
but we love config our beloved App!
|
12
|
+
-======================================================================================================================-
|
13
|
+
DaemonOgre.start :name => "MySuperAppName!", #this will be the name of the application
|
14
|
+
:log_path => "./var/log/log_file_name", #this will be the logfile place and name
|
15
|
+
:pid_path => "./var/pid/pid_file_name", #this will be the pidfile place and name
|
16
|
+
:terminate => true #this command not let start your code if it's not started
|
17
|
+
# with "start" arguments like :
|
18
|
+
# ruby my_awsome_app.rb start
|
19
|
+
|
20
|
+
|
21
|
+
-======================================================================================================================-
|
22
|
+
othere stuffs to use:
|
23
|
+
everybody love: require_relative...
|
24
|
+
so why should not try require_directory instead all the fuss
|
25
|
+
you can tell to it if you want some file to be excluded or just delayed loaded,
|
26
|
+
because you want them loaded in the last place
|
27
|
+
Example:
|
28
|
+
|
29
|
+
require_directory "some_dir_name_from_here_where_are_multi_dir_levels"
|
30
|
+
|
31
|
+
or
|
32
|
+
|
33
|
+
require_directory "some_dir_name_from_here_where_are_multi_dir_levels",
|
34
|
+
:delayed => ["files","to","be","delayed","in","load"],
|
35
|
+
:exclude => ["files","to","be","exclude","in","load"]
|
36
|
+
|
37
|
+
|
38
|
+
-======================================================================================================================-
|
39
|
+
and ofc what else what we love if not our beloved yml-s
|
40
|
+
we should use a nice Config constant for this(or at least i love to do)
|
41
|
+
|
42
|
+
CONFIG = require_ymls "some_dir_name_from_here_where_are_the_yml_files_in_multi_dir_level"
|
43
|
+
the file names will be the hash-key and under that , there will be the yml file datas loaded in
|
44
|
+
|
45
|
+
if you need get a free port in a range or from, you can use this:
|
46
|
+
get_port(from_nmb,to_nmb,host)
|
47
|
+
|
48
|
+
or by simply
|
49
|
+
|
50
|
+
get_port(number)
|
51
|
+
|
52
|
+
|
53
|
+
and if you hate find all the bugs... you can use error_logger at your command like this:
|
54
|
+
|
55
|
+
|
56
|
+
begin
|
57
|
+
|
58
|
+
your awsome code!
|
59
|
+
|
60
|
+
rescue xyexception => ex
|
61
|
+
logger ex, #error_msg
|
62
|
+
prefix, #this is optionable! but i usualy use: "#{__FILE__}/#{__LINE__}"
|
63
|
+
log_file #this is optionable!
|
64
|
+
end
|
65
|
+
|
66
|
+
|
67
|
+
if you need methods from any kind of class without the object methods, you should try this!
|
68
|
+
Xyclassname.class_methods
|
69
|
+
|
70
|
+
|
71
|
+
you want make some test script with rnd numbers, strings, dates, bools etc? use the Rnd class at your command
|
72
|
+
Rnd
|
73
|
+
-string
|
74
|
+
-number
|
75
|
+
-boolean
|
76
|
+
-date
|
77
|
+
|
78
|
+
example: Rnd.number(100)
|
79
|
+
or Rnd.string(15,2) #for rnd bla bla names
|
80
|
+
|
81
|
+
|
82
|
+
You need get the index of an Array element? you can use:
|
83
|
+
array_variable.index_of("something)
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
-=========================================================-
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
in Short:
|
92
|
+
require 'daemon-ogre'
|
93
|
+
DaemonOgre.start
|
94
|
+
|
95
|
+
for boot your files and ymls, helpers above :)
|
96
|
+
your_Super_app_code!
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
== Contributing to daemon-ogre
|
102
|
+
|
103
|
+
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
|
104
|
+
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
|
105
|
+
* Fork the project.
|
106
|
+
* Start a feature/bugfix branch.
|
107
|
+
* Commit and push until you are happy with your contribution.
|
108
|
+
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
109
|
+
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
110
|
+
|
111
|
+
== Copyright
|
112
|
+
|
113
|
+
Copyright (c) 2013 adam.luzsi. See LICENSE.txt for
|
114
|
+
further details.
|
115
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'bundler'
|
5
|
+
begin
|
6
|
+
Bundler.setup(:default, :development)
|
7
|
+
rescue Bundler::BundlerError => e
|
8
|
+
$stderr.puts e.message
|
9
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
10
|
+
exit e.status_code
|
11
|
+
end
|
12
|
+
require 'rake'
|
13
|
+
|
14
|
+
require 'jeweler'
|
15
|
+
Jeweler::Tasks.new do |gem|
|
16
|
+
gem.name = "daemon-ogre"
|
17
|
+
gem.homepage = "http://github.com/adamluzsi/daemon-ogre"
|
18
|
+
gem.license = "MIT"
|
19
|
+
gem.summary = %Q{Let the Ogre Do the hard work}
|
20
|
+
gem.description = %Q{This gem is made for one purpose. Ruby meant to be for easy use, not hardcore coding! And in terms for this, ogre will aid you in the brute way, so you can relax... Are you need load a whole bunch of folders to your rack application ? do it! You want one nice hash for config constant from ymls all over your dirs? sure you can! you want have start/stop/status/restart/daemon/etc argument commands from terminal to control your application without any fuss? There you go! Are you need an easy way to do the classic way of daemonise your awsome app? there will be no problem at all, let the Ogre do the job :) so all you need is enjoy your code!}
|
21
|
+
gem.email = "adamluzsi@gmail.com"
|
22
|
+
gem.authors = ["Adam.Luzsi"]
|
23
|
+
# dependencies defined in Gemfile
|
24
|
+
end
|
25
|
+
Jeweler::RubygemsDotOrgTasks.new
|
26
|
+
|
27
|
+
require 'rake/testtask'
|
28
|
+
Rake::TestTask.new(:test) do |test|
|
29
|
+
test.libs << 'lib' << 'test'
|
30
|
+
test.pattern = 'test/**/test_*.rb'
|
31
|
+
test.verbose = true
|
32
|
+
end
|
33
|
+
|
34
|
+
#require 'rcov/rcovtask'
|
35
|
+
#Rcov::RcovTask.new do |test|
|
36
|
+
# test.libs << 'test'
|
37
|
+
# test.pattern = 'test/**/test_*.rb'
|
38
|
+
# test.verbose = true
|
39
|
+
# test.rcov_opts << '--exclude "gems/*"'
|
40
|
+
#end
|
41
|
+
|
42
|
+
task :default => :test
|
43
|
+
|
44
|
+
require 'rdoc/task'
|
45
|
+
Rake::RDocTask.new do |rdoc|
|
46
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
47
|
+
|
48
|
+
rdoc.rdoc_dir = 'rdoc'
|
49
|
+
rdoc.title = "daemon-ogre #{version}"
|
50
|
+
rdoc.rdoc_files.include('README*')
|
51
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
52
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
1.2.0
|
data/daemon-ogre.gemspec
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = "daemon-ogre"
|
8
|
+
s.version = "1.2.0"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Adam.Luzsi"]
|
12
|
+
s.date = "2013-05-30"
|
13
|
+
s.description = "This gem is made for one purpose. Ruby meant to be for easy use, not hardcore coding! And in terms for this, ogre will aid you in the brute way, so you can relax... Are you need load a whole bunch of folders to your rack application ? do it! You want one nice hash for config constant from ymls all over your dirs? sure you can! you want have start/stop/status/restart/daemon/etc argument commands from terminal to control your application without any fuss? There you go! Are you need an easy way to do the classic way of daemonise your awsome app? there will be no problem at all, let the Ogre do the job :) so all you need is enjoy your code!"
|
14
|
+
s.email = "adamluzsi@gmail.com"
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE.txt",
|
17
|
+
"README.md",
|
18
|
+
"README.rdoc"
|
19
|
+
]
|
20
|
+
s.files = [
|
21
|
+
".idea/.name",
|
22
|
+
".idea/.rakeTasks",
|
23
|
+
".idea/daemon-ogre.iml",
|
24
|
+
".idea/encodings.xml",
|
25
|
+
".idea/misc.xml",
|
26
|
+
".idea/modules.xml",
|
27
|
+
".idea/scopes/scope_settings.xml",
|
28
|
+
".idea/vcs.xml",
|
29
|
+
".idea/workspace.xml",
|
30
|
+
"Gemfile",
|
31
|
+
"Gemfile.lock",
|
32
|
+
"LICENSE.txt",
|
33
|
+
"README.md",
|
34
|
+
"README.rdoc",
|
35
|
+
"Rakefile",
|
36
|
+
"VERSION",
|
37
|
+
"daemon-ogre.gemspec",
|
38
|
+
"lib/daemon-ogre.rb",
|
39
|
+
"test/helper.rb",
|
40
|
+
"test/test_daemon-ogre.rb",
|
41
|
+
"test/var/daemon.stderr.log",
|
42
|
+
"test/var/log/log_file_name",
|
43
|
+
"test/var/pid/pid_file_name"
|
44
|
+
]
|
45
|
+
s.homepage = "http://github.com/adamluzsi/daemon-ogre"
|
46
|
+
s.licenses = ["MIT"]
|
47
|
+
s.require_paths = ["lib"]
|
48
|
+
s.rubygems_version = "1.8.25"
|
49
|
+
s.summary = "Let the Ogre Do the hard work"
|
50
|
+
|
51
|
+
if s.respond_to? :specification_version then
|
52
|
+
s.specification_version = 3
|
53
|
+
|
54
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
55
|
+
s.add_development_dependency(%q<rdoc>, [">= 0"])
|
56
|
+
s.add_development_dependency(%q<debugger>, [">= 0"])
|
57
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.8.4"])
|
58
|
+
else
|
59
|
+
s.add_dependency(%q<rdoc>, [">= 0"])
|
60
|
+
s.add_dependency(%q<debugger>, [">= 0"])
|
61
|
+
s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
|
62
|
+
end
|
63
|
+
else
|
64
|
+
s.add_dependency(%q<rdoc>, [">= 0"])
|
65
|
+
s.add_dependency(%q<debugger>, [">= 0"])
|
66
|
+
s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|