nezu 0.4.13 → 0.4.17
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/Gemfile.lock +4 -2
- data/VERSION +1 -1
- data/lib/nezu.rb +13 -0
- data/lib/nezu/cli.rb +7 -1
- data/lib/nezu/runner.rb +7 -1
- data/nezu.gemspec +3 -2
- metadata +20 -3
data/Gemfile.lock
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
nezu (0.4.
|
4
|
+
nezu (0.4.16)
|
5
5
|
activerecord (~> 3.2.11)
|
6
6
|
activesupport (~> 3.2.11)
|
7
7
|
amqp
|
8
8
|
bunny (>= 0.9.0.pre6)
|
9
9
|
configatron
|
10
|
+
mysql2
|
10
11
|
|
11
12
|
GEM
|
12
13
|
remote: https://rubygems.org/
|
@@ -26,7 +27,7 @@ GEM
|
|
26
27
|
amq-protocol (>= 1.2.0)
|
27
28
|
eventmachine
|
28
29
|
amq-protocol (1.2.0)
|
29
|
-
amqp (0.9.
|
30
|
+
amqp (0.9.10)
|
30
31
|
amq-client (~> 0.9.12)
|
31
32
|
amq-protocol (~> 1.2.0)
|
32
33
|
eventmachine
|
@@ -49,6 +50,7 @@ GEM
|
|
49
50
|
i18n (0.6.4)
|
50
51
|
json (1.7.7)
|
51
52
|
multi_json (1.6.1)
|
53
|
+
mysql2 (0.3.11)
|
52
54
|
rake (10.0.3)
|
53
55
|
rdoc (3.12.2)
|
54
56
|
json (~> 1.4)
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.17
|
data/lib/nezu.rb
CHANGED
@@ -7,11 +7,16 @@ require 'active_record'
|
|
7
7
|
require 'configatron'
|
8
8
|
module Nezu
|
9
9
|
configatron.gem_base_dir = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
10
|
+
configatron.app_base_dir = File.expand_path(Dir.pwd)
|
10
11
|
|
11
12
|
def self.env
|
12
13
|
Env.new(ENV['NEZU_ENV']||'development')
|
13
14
|
end
|
14
15
|
|
16
|
+
def self.root
|
17
|
+
Root::PATH
|
18
|
+
end
|
19
|
+
|
15
20
|
class Env < String
|
16
21
|
def method_missing(meth, params=nil)
|
17
22
|
meth.to_s.sub(/\?$/, '') == self
|
@@ -22,6 +27,14 @@ module Nezu
|
|
22
27
|
end
|
23
28
|
end
|
24
29
|
|
30
|
+
class Root < String
|
31
|
+
PATH = self.new(configatron.app_base_dir)
|
32
|
+
|
33
|
+
def join(*params)
|
34
|
+
File.join(PATH, params)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
25
38
|
class Error < Exception
|
26
39
|
def new(e,msg)
|
27
40
|
Nezu::LOGGER.error(e.to_s)
|
data/lib/nezu/cli.rb
CHANGED
@@ -31,6 +31,13 @@ module Nezu
|
|
31
31
|
Nezu::Runner.new
|
32
32
|
exit(0)
|
33
33
|
end
|
34
|
+
|
35
|
+
def self.console(*params)
|
36
|
+
puts %Q(Starting console...)
|
37
|
+
require 'nezu/runner'
|
38
|
+
ARGV.clear
|
39
|
+
IRB.start()
|
40
|
+
end
|
34
41
|
end
|
35
42
|
end
|
36
43
|
|
@@ -40,4 +47,3 @@ Nezu::CLI.send(ARGV.shift, ARGV)
|
|
40
47
|
|
41
48
|
|
42
49
|
|
43
|
-
|
data/lib/nezu/runner.rb
CHANGED
@@ -29,7 +29,7 @@ module Nezu
|
|
29
29
|
formatted_time = time.strftime(TIME_FORMAT) << time.usec.to_s[0..2].rjust(3)
|
30
30
|
color = SEVERITY_TO_COLOR_MAP[severity]
|
31
31
|
if msg.kind_of?(Exception)
|
32
|
-
"#{formatted_time} #{HOST} #{APP}[#{$$}][\033[#{color}m#{formatted_severity}\033[0m] #{msg.to_s}\n" +
|
32
|
+
"#{formatted_time} #{HOST} #{APP}[#{$$}][\033[#{color}m#{formatted_severity}\033[0m] #{msg.to_s}\n" +
|
33
33
|
msg.backtrace.map do |bt_line|
|
34
34
|
"#{formatted_time} #{HOST} #{APP}[#{$$}][\033[#{color}m#{formatted_severity}\033[0m] #{bt_line.strip}"
|
35
35
|
end.join("\n")
|
@@ -59,6 +59,12 @@ Dir.glob(File.join('config', '*.yml')).each do |yaml_file|
|
|
59
59
|
configatron.configure_from_hash(File.basename(yaml_file.sub(/.yml/, '')) => yaml)
|
60
60
|
end
|
61
61
|
|
62
|
+
if configatron.database.present?
|
63
|
+
ActiveRecord::Base.establish_connection(configatron.database.to_hash)
|
64
|
+
ActiveRecord::Base.logger = Logger.new(File.expand_path(File.join('log/', 'database.log')))
|
65
|
+
end
|
66
|
+
|
67
|
+
|
62
68
|
Nezu::LOGGER.info("[Nezu Runner] initializing...")
|
63
69
|
|
64
70
|
module Nezu
|
data/nezu.gemspec
CHANGED
@@ -2,13 +2,14 @@
|
|
2
2
|
Gem::Specification.new do |s|
|
3
3
|
s.name = "nezu"
|
4
4
|
s.version = File.read(File.join(File.dirname(__FILE__), 'VERSION'))
|
5
|
-
s.authors = ["Sascha Teske"]
|
6
|
-
s.email = %q{sascha.teske@gmail.com}
|
5
|
+
s.authors = ["Sascha Teske", "Florian Görsdorf"]
|
6
|
+
s.email = %q{sascha.teske@gmail.com fgoersdorf@gmail.com}
|
7
7
|
s.homepage = %q{http://github.com/slaxor/nezu}
|
8
8
|
s.summary = %q{Skel generator and launcher for amqp consumers}
|
9
9
|
s.description = %q{Skel generator and launcher for amqp consumers.}
|
10
10
|
|
11
11
|
s.add_dependency 'amqp'
|
12
|
+
s.add_dependency 'mysql2'
|
12
13
|
s.add_dependency 'bunny', '>= 0.9.0.pre6'
|
13
14
|
s.add_dependency 'activerecord', '~>3.2.11'
|
14
15
|
s.add_dependency 'activesupport', '~>3.2.11'
|
metadata
CHANGED
@@ -1,15 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nezu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.17
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Sascha Teske
|
9
|
+
- Florian Görsdorf
|
9
10
|
autorequire:
|
10
11
|
bindir: bin
|
11
12
|
cert_chain: []
|
12
|
-
date: 2013-03-
|
13
|
+
date: 2013-03-12 00:00:00.000000000 Z
|
13
14
|
dependencies:
|
14
15
|
- !ruby/object:Gem::Dependency
|
15
16
|
name: amqp
|
@@ -27,6 +28,22 @@ dependencies:
|
|
27
28
|
- - ! '>='
|
28
29
|
- !ruby/object:Gem::Version
|
29
30
|
version: '0'
|
31
|
+
- !ruby/object:Gem::Dependency
|
32
|
+
name: mysql2
|
33
|
+
requirement: !ruby/object:Gem::Requirement
|
34
|
+
none: false
|
35
|
+
requirements:
|
36
|
+
- - ! '>='
|
37
|
+
- !ruby/object:Gem::Version
|
38
|
+
version: '0'
|
39
|
+
type: :runtime
|
40
|
+
prerelease: false
|
41
|
+
version_requirements: !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
43
|
+
requirements:
|
44
|
+
- - ! '>='
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0'
|
30
47
|
- !ruby/object:Gem::Dependency
|
31
48
|
name: bunny
|
32
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -156,7 +173,7 @@ dependencies:
|
|
156
173
|
- !ruby/object:Gem::Version
|
157
174
|
version: '0'
|
158
175
|
description: Skel generator and launcher for amqp consumers.
|
159
|
-
email: sascha.teske@gmail.com
|
176
|
+
email: sascha.teske@gmail.com fgoersdorf@gmail.com
|
160
177
|
executables:
|
161
178
|
- nezu
|
162
179
|
extensions: []
|