customlogger 0.0.2 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2e2b96431f3308d6ba56017f46516ef770d93596
4
- data.tar.gz: e2e944144f39e7a03d484c715e37c6b83642c40f
3
+ metadata.gz: cdb6d168912b31deb497b06100850657aa2212c8
4
+ data.tar.gz: 14187ae5e0c64aed6a9f0ad9dee2d851d6512555
5
5
  SHA512:
6
- metadata.gz: 9b4ad55827b26ee75b6a55b66d348d6cc2184c743832ab69541b413fb3c95849865d0f0bb1a90256f2411a7333b3ea0ac7136b3ff9038e9130cbcdfee4171a52
7
- data.tar.gz: 7c938d486b8bb2f55d86ace247657439ddcbee64b1502cf39ba9b1872c7713cba6530250892fe94b6d19a30087ff575a906e4cc58325db5b2474e8b2c76cb947
6
+ metadata.gz: c155006f57e305297411cbd6b4601aef9b0b52eef799567f7634f77fb873093495721bf7df13260ccd4a861258d7fdaaadc49f611d1986e012d89193b99e4536
7
+ data.tar.gz: 7009f330a686f3b2a25c8a1a9d8c7e983dafca5905fcaec4c6835794da40d2d195b9933136d67697abd289ef6ab5067a826707fbb0f9dfa5635038da258d47d8
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.1.0
4
+ - 1.9.3
data/README.md CHANGED
@@ -1,16 +1,29 @@
1
- # Custom Logger 1.0.0
1
+ # Custom Logger
2
+
3
+ [![Gem Version](https://badge.fury.io/rb/customlogger.png)](http://badge.fury.io/rb/customlogger)
4
+ [![Build Status](https://travis-ci.org/SaimonL/CustomLogger.svg)](https://travis-ci.org/SaimonL/CustomLogger)
2
5
 
3
6
  Custom logger allows you to log you're debug infmration to an html file so you can
4
7
  view them in much more easier way. This is my first gem so expect things not
5
8
  to be perfect.
6
9
 
10
+ ## Compatable
11
+
12
+ CustomLogger is compatable with Ruby 1.9 and above. As for Rails 3.x and up.
13
+ You should not be using or have Ruby 1.8 installed for obvious reasons.
14
+
7
15
  ## Installation
8
16
 
9
17
  Add this line to your application's Gemfile:
10
18
 
11
19
  ```ruby
12
- gem 'customlogger'
20
+ group :development, :test do
21
+ [...]
22
+ gem 'customlogger'
23
+ [...]
24
+ end
13
25
  ```
26
+ Keep in mind that "[...]" means that there may or may not have other gems there.
14
27
 
15
28
  And then execute:
16
29
 
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
1
  require "bundler/gem_tasks"
2
2
 
3
- Dir.glob('tasks/**/*.rake').each(&method(:import))
3
+ Dir.glob('tasks/**/*.rake').each(&method(:import))
4
+
5
+ task default: :spec
@@ -4,21 +4,22 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
  require 'customlogger/version'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
- spec.name = "customlogger"
7
+ spec.name = 'customlogger'
8
8
  spec.version = Customlogger::VERSION
9
- spec.authors = ["Saimon Lovell"]
10
- spec.email = ["staysynchronize@gmail.com"]
9
+ spec.authors = ['Saimon Lovell']
10
+ spec.email = ['staysynchronize@gmail.com']
11
11
  spec.summary = %q{Log output in to a seperate html file.}
12
- spec.description = %q{Have you ever wished that you could debug an output to a html nicely colored page? Now you can.}
13
- spec.homepage = "https://github.com/SaimonL/CustomLogger"
14
- spec.license = "MIT"
12
+ spec.description = %q{Have you ever wished that you could debug an output to a html nicely colored page? Now you can log all you need in to a nice html format colored page.
13
+ For more information please visit: https://github.com/SaimonL/CustomLogger}
14
+ spec.homepage = 'https://github.com/SaimonL/CustomLogger'
15
+ spec.license = 'MIT'
15
16
 
16
17
  spec.files = `git ls-files -z`.split("\x0")
17
18
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
19
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
- spec.require_paths = ["lib"]
20
+ spec.require_paths = ['lib']
20
21
 
21
- spec.add_development_dependency "bundler", "~> 1.7"
22
- spec.add_development_dependency "rake", "~> 10.0"
23
- spec.add_development_dependency 'rspec', '~> 3.0'
22
+ spec.add_development_dependency 'bundler', '>= 1.6'
23
+ spec.add_development_dependency 'rake', '>= 10.0'
24
+ spec.add_development_dependency 'rspec', '>= 3.0'
24
25
  end
@@ -3,6 +3,7 @@ require 'customlogger/html_template'
3
3
 
4
4
  module CustomLogger
5
5
  LOOP_LIMIT = 512
6
+ SECTION_HTML = '<section><hr></section>'
6
7
 
7
8
  class << self
8
9
  def path=(value)
@@ -98,6 +99,11 @@ module CustomLogger
98
99
  value
99
100
  end
100
101
 
102
+ def new_line
103
+ log(:section, nil, nil)
104
+ SECTION_HTML
105
+ end
106
+
101
107
  private
102
108
  def set_error_colors
103
109
  @error_colors = {
@@ -135,6 +141,8 @@ module CustomLogger
135
141
  case state
136
142
  when :raw
137
143
  HTMLTemplate.raw_to_html(message, title)
144
+ when :section
145
+ SECTION_HTML
138
146
  else
139
147
  HTMLTemplate.log_to_html(state, message, title)
140
148
  end
@@ -1,3 +1,3 @@
1
1
  module Customlogger
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.4'
3
3
  end
@@ -78,8 +78,12 @@ describe 'with Custom Logger' do
78
78
  allow(CustomLogger).to receive(:log).and_return(true)
79
79
  end
80
80
 
81
+ it 'will return new line html code when new line is called' do
82
+ expect(CustomLogger.new_line).to eq '<section><hr></section>'
83
+ end
84
+
81
85
  describe 'with title' do
82
- it 'will return logged error' do
86
+ it 'will return logged error' do'<section><hr></section>'
83
87
  expect(CustomLogger.error('ss saimon', 'my title')).to eq 'ss saimon'
84
88
  end
85
89
 
@@ -115,7 +119,7 @@ describe 'with Custom Logger' do
115
119
  end
116
120
  end
117
121
 
118
- describe 'with loggin error file' do
122
+ describe 'with loggin file' do
119
123
  before(:all) do
120
124
  CustomLogger.path = Dir.pwd
121
125
  CustomLogger.file = 'delete-me.html'
@@ -199,6 +203,17 @@ describe 'with Custom Logger' do
199
203
  end
200
204
  end
201
205
 
206
+ describe 'with new_line' do
207
+ before(:all) do
208
+ CustomLogger.new_line
209
+ @data = read_file(@file_location)
210
+ end
211
+
212
+ it 'will add a section' do
213
+ expect(@data).to include '<section><hr></section>'
214
+ end
215
+ end
216
+
202
217
  describe 'with cleanup' do
203
218
  before(:all) do
204
219
  CustomLogger.clear
metadata CHANGED
@@ -1,59 +1,60 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: customlogger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Saimon Lovell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-03 00:00:00.000000000 Z
11
+ date: 2014-12-04 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.7'
19
+ version: '1.6'
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.7'
26
+ version: '1.6'
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
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
54
  version: '3.0'
55
- description: Have you ever wished that you could debug an output to a html nicely
56
- colored page? Now you can.
55
+ description: |-
56
+ Have you ever wished that you could debug an output to a html nicely colored page? Now you can log all you need in to a nice html format colored page.
57
+ For more information please visit: https://github.com/SaimonL/CustomLogger
57
58
  email:
58
59
  - staysynchronize@gmail.com
59
60
  executables: []
@@ -61,6 +62,7 @@ extensions: []
61
62
  extra_rdoc_files: []
62
63
  files:
63
64
  - ".gitignore"
65
+ - ".travis.yml"
64
66
  - Gemfile
65
67
  - LICENSE
66
68
  - LICENSE.txt