angelo 0.1.12 → 0.1.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/CHANGELOG.md +11 -0
- data/lib/angelo/base.rb +2 -0
- data/lib/angelo/stash.rb +4 -2
- data/lib/angelo/tilt/erb.rb +0 -2
- data/lib/angelo/version.rb +1 -1
- data/lib/angelo.rb +14 -1
- data/test/angelo/websocket_spec.rb +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e5eddbc45b846a99f2c3970949b8bcaea4a8da2a
|
4
|
+
data.tar.gz: b03151aeabb0265da3b371d1dbaa9023de404499
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b398233f7e0e60a647661ff90c92f78485e23561a64243548f5eacc59b8f7d07918c03d071520ffee784bf921d23d40afc189224ce6b3290e4eacd295622a078
|
7
|
+
data.tar.gz: 33d0251cf93ef34be952eecdfa5969f0e4278b8f22a73e00ee8ec5ee8a68b44d4cd797e51bc8a18425f04714f20246e95d26d67c8ab58f2362d4dd5aa60e4bc3
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,17 @@
|
|
1
1
|
changelog
|
2
2
|
=========
|
3
3
|
|
4
|
+
### 0.1.13 19 jun 2014
|
5
|
+
|
6
|
+
* add log level settings
|
7
|
+
* make response logging default to :info level
|
8
|
+
* catch SystemCallError, IOError in Stash#each\* methods
|
9
|
+
|
10
|
+
### 0.1.12 17 jun 2014
|
11
|
+
|
12
|
+
* before and after blocks now wrap websocket routes
|
13
|
+
* add :js content_type
|
14
|
+
|
4
15
|
### 0.1.11 13 jun 2014
|
5
16
|
|
6
17
|
* add halt method and handling
|
data/lib/angelo/base.rb
CHANGED
@@ -11,6 +11,7 @@ module Angelo
|
|
11
11
|
@@port = DEFAULT_PORT
|
12
12
|
|
13
13
|
@@ping_time = DEFAULT_PING_TIME
|
14
|
+
@@log_level = DEFAULT_LOG_LEVEL
|
14
15
|
|
15
16
|
if ARGV.any? and not Kernel.const_defined?('Minitest')
|
16
17
|
require 'optparse'
|
@@ -108,6 +109,7 @@ module Angelo
|
|
108
109
|
end
|
109
110
|
|
110
111
|
def run addr = @@addr, port = @@port
|
112
|
+
Celluloid.logger.level = @@log_level
|
111
113
|
@server = Angelo::Server.new self, addr, port
|
112
114
|
@server.async.ping_websockets
|
113
115
|
trap "INT" do
|
data/lib/angelo/stash.rb
CHANGED
@@ -44,7 +44,8 @@ module Angelo
|
|
44
44
|
stash.each do |ws|
|
45
45
|
begin
|
46
46
|
yield ws
|
47
|
-
rescue Reel::SocketError
|
47
|
+
rescue Reel::SocketError, IOError, SystemCallError => e
|
48
|
+
debug e.message
|
48
49
|
remove_socket ws
|
49
50
|
end
|
50
51
|
end
|
@@ -73,7 +74,8 @@ module Angelo
|
|
73
74
|
@@stashes.values.flatten.each do |ws|
|
74
75
|
begin
|
75
76
|
yield ws
|
76
|
-
rescue IOError
|
77
|
+
rescue Reel::SocketError, IOError, SystemCallError => e
|
78
|
+
debug e.message
|
77
79
|
remove_socket ws
|
78
80
|
end
|
79
81
|
end
|
data/lib/angelo/tilt/erb.rb
CHANGED
@@ -32,12 +32,10 @@ module Angelo
|
|
32
32
|
|
33
33
|
def templates
|
34
34
|
@templates ||= templatify('**', '*.erb'){|v| v =~ /^layouts\//}
|
35
|
-
@templates
|
36
35
|
end
|
37
36
|
|
38
37
|
def layout_templates
|
39
38
|
@layout_templates ||= templatify 'layouts', '*.erb'
|
40
|
-
@layout_templates
|
41
39
|
end
|
42
40
|
|
43
41
|
def default_layout
|
data/lib/angelo/version.rb
CHANGED
data/lib/angelo.rb
CHANGED
@@ -38,6 +38,9 @@ module Angelo
|
|
38
38
|
DEFAULT_VIEW_DIR = 'views'
|
39
39
|
DEFAULT_PUBLIC_DIR = 'public'
|
40
40
|
|
41
|
+
DEFAULT_LOG_LEVEL = ::Logger::INFO
|
42
|
+
DEFAULT_RESPONSE_LOG_LEVEL = :info
|
43
|
+
|
41
44
|
DEFAULT_RESPONSE_HEADERS = {
|
42
45
|
CONTENT_TYPE_HEADER_KEY => HTML_TYPE
|
43
46
|
}
|
@@ -54,6 +57,16 @@ module Angelo
|
|
54
57
|
|
55
58
|
HALT_STRUCT = Struct.new :status, :body
|
56
59
|
|
60
|
+
class << self
|
61
|
+
|
62
|
+
attr_writer :response_log_level
|
63
|
+
|
64
|
+
def response_log_level
|
65
|
+
@response_log_level ||= DEFAULT_RESPONSE_LOG_LEVEL
|
66
|
+
end
|
67
|
+
|
68
|
+
end
|
69
|
+
|
57
70
|
def self.log connection, request, socket, status, body_size = '-'
|
58
71
|
|
59
72
|
remote_ip = ->{
|
@@ -64,7 +77,7 @@ module Angelo
|
|
64
77
|
end
|
65
78
|
}
|
66
79
|
|
67
|
-
Celluloid::Logger.
|
80
|
+
Celluloid::Logger.__send__ Angelo.response_log_level, LOG_FORMAT % [
|
68
81
|
remote_ip[],
|
69
82
|
request.method,
|
70
83
|
request.path,
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: angelo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kenichi Nakamura
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-06-
|
11
|
+
date: 2014-06-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: reel
|