fompila 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ext/kernel.rb +15 -0
- data/lib/fompila.rb +4 -5
- data/lib/fompila/configuration.rb +18 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 21ce625d856db8bea1492589de132c7a81ca1fc7
|
4
|
+
data.tar.gz: 8ce39bf46bc94835c7c9f3d92d60d977fa522bbb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 89bf6746b08af04fabfff81b2fd803658e2efaef70ae593f04059437762a8bd1b9257c0a6bd0537d269515f78d2e3bfc9724537e353a0ef0e9f6293eb2707662
|
7
|
+
data.tar.gz: 08e4520f18597478c0d7b19927aba5a9658f2dfafb8acc71b14577d7953b8745801186be0d250e1a77e1067b97387023b85ec12989684769756e3bead8283c33
|
data/lib/ext/kernel.rb
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
module Kernel
|
2
|
+
alias :original_puts :puts
|
3
|
+
|
4
|
+
def puts(args)
|
5
|
+
config = Fompila::Configuration.instance
|
6
|
+
message = args
|
7
|
+
if config.prepend?
|
8
|
+
prepend = config.message || 'FOMPILA'
|
9
|
+
message = "#{prepend} #{args}"
|
10
|
+
end
|
11
|
+
|
12
|
+
original_puts message
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
data/lib/fompila.rb
CHANGED
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'singleton'
|
2
|
+
|
3
|
+
module Fompila
|
4
|
+
class Configuration
|
5
|
+
include Singleton
|
6
|
+
|
7
|
+
attr_accessor :message, :prepend
|
8
|
+
|
9
|
+
def self.configure
|
10
|
+
yield Fompila::Configuration.instance if block_given?
|
11
|
+
end
|
12
|
+
|
13
|
+
def prepend?
|
14
|
+
prepend == "true" || prepend == true
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fompila
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Leandro Maringolo
|
@@ -17,6 +17,8 @@ extensions: []
|
|
17
17
|
extra_rdoc_files: []
|
18
18
|
files:
|
19
19
|
- lib/fompila.rb
|
20
|
+
- lib/ext/kernel.rb
|
21
|
+
- lib/fompila/configuration.rb
|
20
22
|
homepage:
|
21
23
|
licenses: []
|
22
24
|
metadata: {}
|