log_marker 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -1
- data/.rspec +1 -0
- data/.travis.yml +3 -2
- data/CODE_OF_CONDUCT.md +68 -7
- data/Gemfile +3 -1
- data/Gemfile.lock +35 -0
- data/LICENSE.txt +1 -1
- data/README.md +116 -8
- data/bin/console +1 -1
- data/bin/setup +2 -1
- data/lib/log_marker/config.rb +14 -0
- data/lib/log_marker/version.rb +1 -1
- data/lib/log_marker.rb +40 -2
- data/log_marker.gemspec +15 -17
- metadata +23 -22
- data/lib/log_marker/extention/active_support/object.rb +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 901259ddef5ec66b1a33351ddb322349b189b272
|
4
|
+
data.tar.gz: e0ccdcc2fd3218989be8bbeb12640abfac8458bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e292ef7a6df46d67dbe983f84b54be54810e4ec56f1988d1a613b67e9b8f02260b540a592330b1fb819b91f0b3048ec0c406538b04e7ae603834d508121de131
|
7
|
+
data.tar.gz: 195caf3cabaffab88fabe8c0ea29adb5905ff8245ef54547ed8f38941c652b6e44608f22846ef5eb95f017cbb2d05c4e8cc05a6d5ef75fa68cb748a23b02c98e
|
data/.gitignore
CHANGED
data/.rspec
CHANGED
data/.travis.yml
CHANGED
data/CODE_OF_CONDUCT.md
CHANGED
@@ -1,13 +1,74 @@
|
|
1
|
-
# Contributor Code of Conduct
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
2
|
|
3
|
-
|
3
|
+
## Our Pledge
|
4
4
|
|
5
|
-
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
6
11
|
|
7
|
-
|
12
|
+
## Our Standards
|
8
13
|
|
9
|
-
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
10
16
|
|
11
|
-
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
12
22
|
|
13
|
-
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at jun.okada0203@gmail.com. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
CHANGED
data/Gemfile.lock
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
log_marker (0.1.1)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
diff-lcs (1.3)
|
10
|
+
rake (10.5.0)
|
11
|
+
rspec (3.8.0)
|
12
|
+
rspec-core (~> 3.8.0)
|
13
|
+
rspec-expectations (~> 3.8.0)
|
14
|
+
rspec-mocks (~> 3.8.0)
|
15
|
+
rspec-core (3.8.0)
|
16
|
+
rspec-support (~> 3.8.0)
|
17
|
+
rspec-expectations (3.8.2)
|
18
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
19
|
+
rspec-support (~> 3.8.0)
|
20
|
+
rspec-mocks (3.8.0)
|
21
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
22
|
+
rspec-support (~> 3.8.0)
|
23
|
+
rspec-support (3.8.0)
|
24
|
+
|
25
|
+
PLATFORMS
|
26
|
+
ruby
|
27
|
+
|
28
|
+
DEPENDENCIES
|
29
|
+
bundler (~> 1.16)
|
30
|
+
log_marker!
|
31
|
+
rake (~> 10.0)
|
32
|
+
rspec (~> 3.0)
|
33
|
+
|
34
|
+
BUNDLED WITH
|
35
|
+
1.16.0
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
# LogMarker
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
3
|
+
debug logging with marker
|
6
4
|
|
7
5
|
## Installation
|
8
6
|
|
@@ -22,20 +20,130 @@ Or install it yourself as:
|
|
22
20
|
|
23
21
|
## Usage
|
24
22
|
|
25
|
-
|
23
|
+
log_marker methods
|
24
|
+
`ml`, `p!`, `pp!`, `puts!`
|
25
|
+
|
26
|
+
```ruby
|
27
|
+
ml 'Hello my debug log'
|
28
|
+
# => ======================================================================================================================================================
|
29
|
+
# ======================================================================================================================================================
|
30
|
+
# ======================================================================================================================================================
|
31
|
+
# ======================================================================================================================================================
|
32
|
+
# ======================================================================================================================================================
|
33
|
+
#
|
34
|
+
#
|
35
|
+
#
|
36
|
+
#
|
37
|
+
#
|
38
|
+
# "Hello my debug log"
|
39
|
+
#
|
40
|
+
#
|
41
|
+
#
|
42
|
+
#
|
43
|
+
#
|
44
|
+
# ======================================================================================================================================================
|
45
|
+
# ======================================================================================================================================================
|
46
|
+
# ======================================================================================================================================================
|
47
|
+
# ======================================================================================================================================================
|
48
|
+
# ======================================================================================================================================================
|
49
|
+
|
50
|
+
p! 'Hello my debug log'
|
51
|
+
# => ======================================================================================================================================================
|
52
|
+
# ======================================================================================================================================================
|
53
|
+
# ======================================================================================================================================================
|
54
|
+
# ======================================================================================================================================================
|
55
|
+
# ======================================================================================================================================================
|
56
|
+
#
|
57
|
+
#
|
58
|
+
#
|
59
|
+
#
|
60
|
+
#
|
61
|
+
# "Hello my debug log"
|
62
|
+
#
|
63
|
+
#
|
64
|
+
#
|
65
|
+
#
|
66
|
+
#
|
67
|
+
# ======================================================================================================================================================
|
68
|
+
# ======================================================================================================================================================
|
69
|
+
# ======================================================================================================================================================
|
70
|
+
# ======================================================================================================================================================
|
71
|
+
# ======================================================================================================================================================
|
72
|
+
|
73
|
+
puts! 'Hello my debug log'
|
74
|
+
# => ======================================================================================================================================================
|
75
|
+
# ======================================================================================================================================================
|
76
|
+
# ======================================================================================================================================================
|
77
|
+
# ======================================================================================================================================================
|
78
|
+
# ======================================================================================================================================================
|
79
|
+
#
|
80
|
+
#
|
81
|
+
#
|
82
|
+
#
|
83
|
+
#
|
84
|
+
# Hello my debug log
|
85
|
+
#
|
86
|
+
#
|
87
|
+
#
|
88
|
+
#
|
89
|
+
#
|
90
|
+
# ======================================================================================================================================================
|
91
|
+
# ======================================================================================================================================================
|
92
|
+
# ======================================================================================================================================================
|
93
|
+
# ======================================================================================================================================================
|
94
|
+
# ======================================================================================================================================================
|
95
|
+
|
96
|
+
pp! ['Hello my debug log'] * 5
|
97
|
+
# => ======================================================================================================================================================
|
98
|
+
# ======================================================================================================================================================
|
99
|
+
# ======================================================================================================================================================
|
100
|
+
# ======================================================================================================================================================
|
101
|
+
# ======================================================================================================================================================
|
102
|
+
#
|
103
|
+
#
|
104
|
+
#
|
105
|
+
#
|
106
|
+
#
|
107
|
+
# ["Hello my debug log",
|
108
|
+
# "Hello my debug log",
|
109
|
+
# "Hello my debug log",
|
110
|
+
# "Hello my debug log",
|
111
|
+
# "Hello my debug log"]
|
112
|
+
#
|
113
|
+
#
|
114
|
+
#
|
115
|
+
#
|
116
|
+
#
|
117
|
+
# ======================================================================================================================================================
|
118
|
+
# ======================================================================================================================================================
|
119
|
+
# ======================================================================================================================================================
|
120
|
+
# ======================================================================================================================================================
|
121
|
+
# ======================================================================================================================================================
|
122
|
+
```
|
123
|
+
|
124
|
+
## Config
|
125
|
+
|
126
|
+
```ruby
|
127
|
+
LogMarker.config do |config|
|
128
|
+
config.ml_alias = :p!
|
129
|
+
config.marker = -> { (['=' * 150] * 5).join("\n") }
|
130
|
+
end
|
131
|
+
```
|
26
132
|
|
27
133
|
## Development
|
28
134
|
|
29
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake
|
135
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
136
|
|
31
137
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
138
|
|
33
139
|
## Contributing
|
34
140
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/log_marker. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
|
36
|
-
|
141
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/log_marker. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
37
142
|
|
38
143
|
## License
|
39
144
|
|
40
|
-
The gem is available as open source under the terms of the [MIT License](
|
145
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
146
|
+
|
147
|
+
## Code of Conduct
|
41
148
|
|
149
|
+
Everyone interacting in the LogMarker project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/log_marker/blob/master/CODE_OF_CONDUCT.md).
|
data/bin/console
CHANGED
data/bin/setup
CHANGED
data/lib/log_marker/version.rb
CHANGED
data/lib/log_marker.rb
CHANGED
@@ -1,2 +1,40 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'pp'
|
4
|
+
require 'log_marker/version'
|
5
|
+
require 'log_marker/config'
|
6
|
+
|
7
|
+
module LogMarker
|
8
|
+
MARK_METHODS = %w(p pp puts)
|
9
|
+
|
10
|
+
MARK_METHODS.each do |name|
|
11
|
+
define_method("#{name}!") do |*args|
|
12
|
+
logging_with_marker do
|
13
|
+
send(name, *args)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def logging_with_marker(&block)
|
19
|
+
puts marker
|
20
|
+
|
21
|
+
result = block.call
|
22
|
+
|
23
|
+
puts marker.reverse
|
24
|
+
|
25
|
+
result
|
26
|
+
end
|
27
|
+
|
28
|
+
def marker
|
29
|
+
[
|
30
|
+
LogMarker.marker.respond_to?(:call) ? LogMarker.marker.call : LogMarker.marker.to_s,
|
31
|
+
"\n" * 5
|
32
|
+
]
|
33
|
+
end
|
34
|
+
|
35
|
+
def ml(*args)
|
36
|
+
send(LogMarker.ml_alias, *args)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
Object.include LogMarker
|
data/log_marker.gemspec
CHANGED
@@ -1,28 +1,26 @@
|
|
1
|
-
# coding: utf-8
|
2
1
|
lib = File.expand_path('../lib', __FILE__)
|
3
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
3
|
require 'log_marker/version'
|
5
4
|
|
6
5
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name =
|
6
|
+
spec.name = 'log_marker'
|
8
7
|
spec.version = LogMarker::VERSION
|
9
|
-
spec.authors = [
|
10
|
-
spec.email = [
|
8
|
+
spec.authors = ['Jun0kada']
|
9
|
+
spec.email = ['jun.0kada.dev@gmail.com']
|
11
10
|
|
12
|
-
spec.summary =
|
13
|
-
spec.description =
|
14
|
-
spec.homepage =
|
15
|
-
spec.license =
|
11
|
+
spec.summary = 'Add marker to debug logs'
|
12
|
+
spec.description = 'Add marker to debug logs'
|
13
|
+
spec.homepage = 'https://github.com/Jun0kada/log_marker'
|
14
|
+
spec.license = 'MIT'
|
16
15
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
spec.
|
21
|
-
spec.bindir = "exe"
|
16
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
17
|
+
f.match(%r{^(test|spec|features)/})
|
18
|
+
end
|
19
|
+
spec.bindir = 'exe'
|
22
20
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
23
|
-
spec.require_paths = [
|
21
|
+
spec.require_paths = ['lib']
|
24
22
|
|
25
|
-
spec.add_development_dependency
|
26
|
-
spec.add_development_dependency
|
27
|
-
spec.add_development_dependency
|
23
|
+
spec.add_development_dependency 'bundler', '~> 1.16'
|
24
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
25
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
28
26
|
end
|
metadata
CHANGED
@@ -1,79 +1,80 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: log_marker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Jun0kada
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-03-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1.
|
19
|
+
version: '1.16'
|
20
20
|
type: :development
|
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: '1.
|
26
|
+
version: '1.16'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '10.0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - ~>
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '10.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
47
|
+
version: '3.0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
54
|
+
version: '3.0'
|
55
55
|
description: Add marker to debug logs
|
56
56
|
email:
|
57
|
-
- jun.
|
57
|
+
- jun.0kada.dev@gmail.com
|
58
58
|
executables: []
|
59
59
|
extensions: []
|
60
60
|
extra_rdoc_files: []
|
61
61
|
files:
|
62
|
-
- .gitignore
|
63
|
-
- .rspec
|
64
|
-
- .travis.yml
|
62
|
+
- ".gitignore"
|
63
|
+
- ".rspec"
|
64
|
+
- ".travis.yml"
|
65
65
|
- CODE_OF_CONDUCT.md
|
66
66
|
- Gemfile
|
67
|
+
- Gemfile.lock
|
67
68
|
- LICENSE.txt
|
68
69
|
- README.md
|
69
70
|
- Rakefile
|
70
71
|
- bin/console
|
71
72
|
- bin/setup
|
72
73
|
- lib/log_marker.rb
|
73
|
-
- lib/log_marker/
|
74
|
+
- lib/log_marker/config.rb
|
74
75
|
- lib/log_marker/version.rb
|
75
76
|
- log_marker.gemspec
|
76
|
-
homepage:
|
77
|
+
homepage: https://github.com/Jun0kada/log_marker
|
77
78
|
licenses:
|
78
79
|
- MIT
|
79
80
|
metadata: {}
|
@@ -83,17 +84,17 @@ require_paths:
|
|
83
84
|
- lib
|
84
85
|
required_ruby_version: !ruby/object:Gem::Requirement
|
85
86
|
requirements:
|
86
|
-
- -
|
87
|
+
- - ">="
|
87
88
|
- !ruby/object:Gem::Version
|
88
89
|
version: '0'
|
89
90
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
90
91
|
requirements:
|
91
|
-
- -
|
92
|
+
- - ">="
|
92
93
|
- !ruby/object:Gem::Version
|
93
94
|
version: '0'
|
94
95
|
requirements: []
|
95
96
|
rubyforge_project:
|
96
|
-
rubygems_version: 2.
|
97
|
+
rubygems_version: 2.6.13
|
97
98
|
signing_key:
|
98
99
|
specification_version: 4
|
99
100
|
summary: Add marker to debug logs
|