utopia 2.6.0 → 2.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: faa4b3c96229515a502fd53580408bc45b08c35a55cbda43e0d63644716e97c2
4
- data.tar.gz: d00a2bf55b7b23be8c6365500986cedf672b3ffa4e0b227c18f42a57ad4f93f8
3
+ metadata.gz: b9b8589a3313f00ec6c24f36f42a17beb9daa7b07b45051f5cd7d08adc593960
4
+ data.tar.gz: d79f6ad3105f73acf2abd1e77698540578e98821f70c85ce9a15112c20b455ed
5
5
  SHA512:
6
- metadata.gz: 81d9fb9ce78992d3cb1c127ba05fe4f112832721a1524bcaff08e51e415617c8be06c6b60cdd48170b18b27963bd0341f2cb8beb0626df5818f1484dd90ea6a8
7
- data.tar.gz: 428dbb602a5e4dd86f282533287dc4af9dc384019e562d33cede4b998ab04d2c1bf7fa7d27c4376796c2dc27b9e74d6dd7c922960cca67ebf3e9822f3abb4671
6
+ metadata.gz: 67c0162c3bea51d90699b68d25dd599dc1576a7a2ee7369ed52c42f00a54c8eeccda3884b34c432002160cd97d425fe9605cdcae223e495c414df8c49f64e7c2
7
+ data.tar.gz: 661de3edd3e48871e2d6bd7c786e2d3db39ec4bbd77c0eb8df4cbb86ccd634782333ff667bb9f6a466eb014a535d76557a7b94b7dd75a76f2c46666006ed8702
@@ -18,17 +18,8 @@
18
18
  # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
19
  # THE SOFTWARE.
20
20
 
21
- require_relative 'logger/compact_formatter'
21
+ require 'event/console'
22
22
 
23
23
  module Utopia
24
- # Manages an instance of Logger with useful defaults. Used in rake `tasks/log.rake`.
25
- module Logger
26
- def self.new(output: STDERR, level: ::Logger::WARN)
27
- log = ::Logger.new(output)
28
- log.level = level
29
- log.formatter = Utopia::Logger::CompactFormatter.new
30
-
31
- return log
32
- end
33
- end
24
+ extend Event::Console
34
25
  end
@@ -19,5 +19,5 @@
19
19
  # THE SOFTWARE.
20
20
 
21
21
  module Utopia
22
- VERSION = "2.6.0"
22
+ VERSION = "2.7.0"
23
23
  end
@@ -1,17 +1,17 @@
1
1
 
2
2
  task :log do
3
3
  require 'utopia/logger'
4
- LOGGER = Utopia::Logger.new
4
+ LOGGER = Utopia.logger
5
5
  end
6
6
 
7
7
  namespace :log do
8
8
  desc "Increase verbosity of logger to info."
9
9
  task :info => :log do
10
- LOGGER.level = Logger::INFO
10
+ LOGGER.info!
11
11
  end
12
12
 
13
13
  desc "Increase verbosity of global debug."
14
14
  task :debug => :log do
15
- LOGGER.level = Logger::DEBUG
15
+ LOGGER.debug!
16
16
  end
17
17
  end
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
27
27
  spec.add_dependency 'mime-types', '~> 3.0'
28
28
 
29
29
  spec.add_dependency 'samovar', '~> 1.2'
30
- spec.add_dependency 'rainbow', '~> 2.1'
30
+ spec.add_dependency 'event', '~> 1.1'
31
31
 
32
32
  spec.add_dependency 'rack', '~> 2.0'
33
33
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: utopia
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.0
4
+ version: 2.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-09 00:00:00.000000000 Z
11
+ date: 2019-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: trenni
@@ -53,19 +53,19 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: '1.2'
55
55
  - !ruby/object:Gem::Dependency
56
- name: rainbow
56
+ name: event
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '2.1'
61
+ version: '1.1'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '2.1'
68
+ version: '1.1'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rack
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -578,7 +578,6 @@ files:
578
578
  - lib/utopia/locale.rb
579
579
  - lib/utopia/localization.rb
580
580
  - lib/utopia/logger.rb
581
- - lib/utopia/logger/compact_formatter.rb
582
581
  - lib/utopia/middleware.rb
583
582
  - lib/utopia/path.rb
584
583
  - lib/utopia/path/matcher.rb
@@ -1,47 +0,0 @@
1
- # Copyright, 2016, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the "Software"), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in
11
- # all copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- # THE SOFTWARE.
20
-
21
- require 'logger'
22
- require 'rainbow'
23
-
24
- module Utopia
25
- module Logger
26
- # Provides a concise log output format.
27
- class CompactFormatter
28
- def initialize
29
- @start = Time.now
30
- end
31
-
32
- def time_offset_string
33
- offset = Time.now - @start
34
-
35
- "T+#{offset.round(1).to_s.ljust(5)}"
36
- end
37
-
38
- def call(severity, datetime, progname, message)
39
- if progname
40
- "#{Rainbow(time_offset_string).bright.blue} #{Rainbow(progname).bright}: #{message}\n"
41
- else
42
- "#{Rainbow(time_offset_string).bright.blue} #{message}\n"
43
- end
44
- end
45
- end
46
- end
47
- end