tty-logger 0.1.0 → 0.6.0

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.
@@ -1,40 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- RSpec.describe TTY::Logger, "outputs" do
4
- let(:styles) { TTY::Logger::Handlers::Console::STYLES }
5
-
6
- it "outputs to multiple streams of the same handler" do
7
- stream = StringIO.new
8
-
9
- logger = TTY::Logger.new do |config|
10
- config.handlers = [[:stream, formatter: :text]]
11
- config.output = [stream, stream]
12
- end
13
-
14
- logger.info("logging")
15
-
16
- expect(stream.string).to eq([
17
- "level=info message=logging\n",
18
- "level=info message=logging\n"
19
- ].join)
20
- end
21
-
22
- it "outputs each handler to a different stream" do
23
- stream = StringIO.new
24
-
25
- logger = TTY::Logger.new do |config|
26
- config.handlers = [
27
- [:console, output: stream],
28
- [:stream, output: stream]
29
- ]
30
- end
31
-
32
- logger.info("logging")
33
-
34
- expect(stream.string).to eq([
35
- "\e[32m#{styles[:info][:symbol]}\e[0m \e[32minfo\e[0m ",
36
- "logging \n",
37
- "level=info message=logging\n"
38
- ].join)
39
- end
40
- end
@@ -1,11 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- desc 'Load gem inside irb console'
4
- task :console do
5
- require 'irb'
6
- require 'irb/completion'
7
- require File.join(__FILE__, '../../lib/tty-logger')
8
- ARGV.clear
9
- IRB.start
10
- end
11
- task c: %w[ console ]
@@ -1,11 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- desc 'Measure code coverage'
4
- task :coverage do
5
- begin
6
- original, ENV['COVERAGE'] = ENV['COVERAGE'], 'true'
7
- Rake::Task['spec'].invoke
8
- ensure
9
- ENV['COVERAGE'] = original
10
- end
11
- end
@@ -1,29 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- begin
4
- require 'rspec/core/rake_task'
5
-
6
- desc 'Run all specs'
7
- RSpec::Core::RakeTask.new(:spec) do |task|
8
- task.pattern = 'spec/{unit,integration}{,/*/**}/*_spec.rb'
9
- end
10
-
11
- namespace :spec do
12
- desc 'Run unit specs'
13
- RSpec::Core::RakeTask.new(:unit) do |task|
14
- task.pattern = 'spec/unit{,/*/**}/*_spec.rb'
15
- end
16
-
17
- desc 'Run integration specs'
18
- RSpec::Core::RakeTask.new(:integration) do |task|
19
- task.pattern = 'spec/integration{,/*/**}/*_spec.rb'
20
- end
21
- end
22
-
23
- rescue LoadError
24
- %w[spec spec:unit spec:integration].each do |name|
25
- task name do
26
- $stderr.puts "In order to run #{name}, do `gem install rspec`"
27
- end
28
- end
29
- end
@@ -1,35 +0,0 @@
1
- lib = File.expand_path("lib", __dir__)
2
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
- require "tty/logger/version"
4
-
5
- Gem::Specification.new do |spec|
6
- spec.name = "tty-logger"
7
- spec.version = TTY::Logger::VERSION
8
- spec.authors = ["Piotr Murach"]
9
- spec.email = ["me@piotrmurach.com"]
10
- spec.summary = %q{Readable, structured and beautiful terminal logging}
11
- spec.description = %q{Readable, structured and beautiful terminal logging}
12
- spec.homepage = "https://piotrmurach.github.io/tty"
13
- spec.license = "MIT"
14
-
15
- spec.metadata["allowed_push_host"] = "https://rubygems.org"
16
- spec.metadata["bug_tracker_uri"] = "https://github.com/piotrmurach/tty-logger/issues"
17
- spec.metadata["changelog_uri"] = "https://github.com/piotrmurach/tty-logger/blob/master/CHANGELOG.md"
18
- spec.metadata["documentation_uri"] = "https://www.rubydoc.info/gems/tty-logger"
19
- spec.metadata["homepage_uri"] = spec.homepage
20
- spec.metadata["source_code_uri"] = "https://github.com/piotrmurach/tty-logger"
21
-
22
- spec.files = Dir['{lib,spec,examples}/**/*.rb']
23
- spec.files += Dir['tasks/*', 'tty-logger.gemspec']
24
- spec.files += Dir['README.md', 'CHANGELOG.md', 'LICENSE.txt', 'Rakefile']
25
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
26
- spec.require_paths = ["lib"]
27
-
28
- spec.required_ruby_version = '>= 2.0.0'
29
-
30
- spec.add_dependency "pastel", "~> 0.7.0"
31
-
32
- spec.add_development_dependency "bundler", ">= 1.5"
33
- spec.add_development_dependency "rake"
34
- spec.add_development_dependency "rspec", "~> 3.0"
35
- end