tappow 0.1.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tapp/printer/logger_awesome.rb +21 -0
- data/lib/tapp/printer/logger_pretty.rb +21 -0
- data/lib/{tappow → tapp}/printer/logger_string.rb +4 -2
- data/lib/tappow.rb +5 -5
- data/lib/tappow/version.rb +1 -1
- data/tappow.gemspec +1 -1
- metadata +7 -9
- data/lib/tappow/printer.rb +0 -7
- data/lib/tappow/printer/logger_awesome.rb +0 -10
- data/lib/tappow/printer/logger_pretty.rb +0 -10
- data/lib/tappow/tapp_extension.rb +0 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 909a90fc749b5a0b36cf03027f690d1d7805b415
|
4
|
+
data.tar.gz: d151511ac22a63b4e149efc027f1b8ae2e4e8b29
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8950c951278d671545439ad446a028c105685bcce271dfedaaa67e90eec49db499d9c2b7a9f2c6ae2244874ae46459ad3159697f279b387904228657493c7533
|
7
|
+
data.tar.gz: a7812c6283a1a366e5541836dda7ea77aae917d73b3612df9570be1ad72ec689bb14ef11ede6f271cd6137bc305c21c4088f2945d49fef08aa91d7fc2b294896
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'tapp/printer'
|
2
|
+
|
3
|
+
module Tapp::Printer
|
4
|
+
class LoggerAwesome < Base
|
5
|
+
def print(*args)
|
6
|
+
require 'ap'
|
7
|
+
|
8
|
+
self.class.class_eval do
|
9
|
+
remove_method :print
|
10
|
+
|
11
|
+
def print(*args)
|
12
|
+
Tappow.logger.send(Tappow.log_level, args[0].awesome_inspect)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
print(*args)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
register :logger_awesome, LoggerAwesome
|
21
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'tapp/printer'
|
2
|
+
|
3
|
+
module Tapp::Printer
|
4
|
+
class LoggerPretty < Base
|
5
|
+
def print(*args)
|
6
|
+
require 'pp'
|
7
|
+
|
8
|
+
self.class.class_eval do
|
9
|
+
remove_method :print
|
10
|
+
|
11
|
+
def print(*args)
|
12
|
+
Tappow.logger.send(Tappow.log_level, args[0].pretty_inspect)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
print(*args)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
register :logger_pretty, LoggerPretty
|
21
|
+
end
|
@@ -1,9 +1,11 @@
|
|
1
1
|
require 'tapp/printer'
|
2
2
|
|
3
|
-
module
|
4
|
-
class LoggerString <
|
3
|
+
module Tapp::Printer
|
4
|
+
class LoggerString < Base
|
5
5
|
def print(*args)
|
6
6
|
Tappow.logger.send(Tappow.log_level, args[0].to_s)
|
7
7
|
end
|
8
8
|
end
|
9
|
+
|
10
|
+
register :logger_string, LoggerString
|
9
11
|
end
|
data/lib/tappow.rb
CHANGED
@@ -1,10 +1,11 @@
|
|
1
|
-
require 'tappow/printer'
|
2
|
-
require 'tappow/tapp_extension'
|
3
|
-
require 'tappow/object_extension'
|
4
|
-
|
5
1
|
require 'logger'
|
6
2
|
require 'tapp'
|
7
3
|
|
4
|
+
require 'tappow/object_extension'
|
5
|
+
require 'tapp/printer/logger_awesome'
|
6
|
+
require 'tapp/printer/logger_pretty'
|
7
|
+
require 'tapp/printer/logger_string'
|
8
|
+
|
8
9
|
module Tappow
|
9
10
|
class << self
|
10
11
|
attr_writer :logger, :log_level, :default_printer
|
@@ -22,5 +23,4 @@ module Tappow
|
|
22
23
|
end
|
23
24
|
end
|
24
25
|
|
25
|
-
Tapp::Printer.singleton_class.__send__ :prepend, Tappow::TappExtension
|
26
26
|
Object.__send__ :include, Tappow::ObjectExtension
|
data/lib/tappow/version.rb
CHANGED
data/tappow.gemspec
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_runtime_dependency "tapp"
|
21
|
+
spec.add_runtime_dependency "tapp", ">= 1.5.0"
|
22
22
|
|
23
23
|
spec.add_development_dependency "bundler", ">= 1.7"
|
24
24
|
spec.add_development_dependency "rake", "~> 10.0"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tappow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- joker1007
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tapp
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 1.5.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 1.5.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -95,13 +95,11 @@ files:
|
|
95
95
|
- Rakefile
|
96
96
|
- bin/console
|
97
97
|
- bin/setup
|
98
|
+
- lib/tapp/printer/logger_awesome.rb
|
99
|
+
- lib/tapp/printer/logger_pretty.rb
|
100
|
+
- lib/tapp/printer/logger_string.rb
|
98
101
|
- lib/tappow.rb
|
99
102
|
- lib/tappow/object_extension.rb
|
100
|
-
- lib/tappow/printer.rb
|
101
|
-
- lib/tappow/printer/logger_awesome.rb
|
102
|
-
- lib/tappow/printer/logger_pretty.rb
|
103
|
-
- lib/tappow/printer/logger_string.rb
|
104
|
-
- lib/tappow/tapp_extension.rb
|
105
103
|
- lib/tappow/version.rb
|
106
104
|
- tappow.gemspec
|
107
105
|
homepage: https://github.com/joker1007/tappow
|
data/lib/tappow/printer.rb
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
module Tappow
|
2
|
-
module TappExtension
|
3
|
-
def instance(name)
|
4
|
-
case name
|
5
|
-
when :logger_pretty
|
6
|
-
Tappow::Printer::LoggerPretty.instance
|
7
|
-
when :logger_awesome
|
8
|
-
Tappow::Printer::LoggerAwesome.instance
|
9
|
-
when :logger_string
|
10
|
-
Tappow::Printer::LoggerString.instance
|
11
|
-
else
|
12
|
-
super
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|