Skip to content

Commit

Permalink
Renamed Erb to ERB to be consistent w/ the ERB class
Browse files Browse the repository at this point in the history
  • Loading branch information
cbroult committed Jun 25, 2022
1 parent 744acbd commit 67277fd
Show file tree
Hide file tree
Showing 14 changed files with 47 additions and 47 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Erb::Processor
# ERB::Processor

[![Test cucumber](https://github.com/cbroult/erb-processor/actions/workflows/main.yml/badge.svg)](https://github.com/cucumber/cucumber-ruby/actions/workflows/cucumber-ruby.yml)

Expand Down Expand Up @@ -54,4 +54,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
## Code of Conduct
Everyone interacting in the Erb::Processor project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/cbroult/erb-processor/blob/master/CODE_OF_CONDUCT.md).
Everyone interacting in the ERB::Processor project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/cbroult/erb-processor/blob/master/CODE_OF_CONDUCT.md).
6 changes: 3 additions & 3 deletions bin/erb-processor
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ $LOAD_PATH.unshift(library_path) unless $LOAD_PATH.include?(library_path)
require "optparse"
require "erb/processor"

Erb::Processor::LoggingSetup.instance.run(:warn)
ERB::Processor::LoggingSetup.instance.run(:warn)

LOG_LEVELS = %i[fatal error warn info debug].freeze

OptionParser.new do |opts|
opts.on("--log-level LEVEL", LOG_LEVELS,
"Set console logging level (#{LOG_LEVELS.join(", ")})") do |level|
Erb::Processor::LoggingSetup.instance.console_appender.level = level
ERB::Processor::LoggingSetup.instance.console_appender.level = level
end

opts.on("-h", "--help", "Prints this help") do
Expand All @@ -26,7 +26,7 @@ OptionParser.new do |opts|
opts.parse!(ARGV)
end

Erb::Processor::ForDirectoryTree.
ERB::Processor::ForDirectoryTree.
new(ARGV.shift).
run

Expand Down
2 changes: 1 addition & 1 deletion erb-processor.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ require_relative "lib/erb/processor/version"

Gem::Specification.new do |spec|
spec.name = "erb-processor"
spec.version = Erb::Processor::VERSION
spec.version = ERB::Processor::VERSION
spec.authors = ["Christophe Broult"]
spec.email = ["cbroult@yahoo.com"]

Expand Down
60 changes: 30 additions & 30 deletions features/logging.feature
Original file line number Diff line number Diff line change
Expand Up @@ -15,43 +15,43 @@ Feature: Allow logging
Then the output should not contain anything
And a file named "erb-processor.log" should contain exactly:
"""
INFO Erb::Processor::ForSingleFile : Processing ./another_dir/features/file.feature.erb...
INFO Erb::Processor::ForSingleFile : Wrote ./another_dir/features/file.feature
INFO Erb::Processor::ForSingleFile : Processing ./another_dir/file.java.erb...
INFO Erb::Processor::ForSingleFile : Wrote ./another_dir/file.java
INFO Erb::Processor::ForSingleFile : Processing ./dir/another_file.js.erb...
INFO Erb::Processor::ForSingleFile : Wrote ./dir/another_file.js
INFO Erb::Processor::ForSingleFile : Processing ./dir/file.cpp.erb...
INFO Erb::Processor::ForSingleFile : Wrote ./dir/file.cpp
INFO Erb::Processor::ForSingleFile : Processing ./file.cpp.erb...
INFO Erb::Processor::ForSingleFile : Wrote ./file.cpp
INFO ERB::Processor::ForSingleFile : Processing ./another_dir/features/file.feature.erb...
INFO ERB::Processor::ForSingleFile : Wrote ./another_dir/features/file.feature
INFO ERB::Processor::ForSingleFile : Processing ./another_dir/file.java.erb...
INFO ERB::Processor::ForSingleFile : Wrote ./another_dir/file.java
INFO ERB::Processor::ForSingleFile : Processing ./dir/another_file.js.erb...
INFO ERB::Processor::ForSingleFile : Wrote ./dir/another_file.js
INFO ERB::Processor::ForSingleFile : Processing ./dir/file.cpp.erb...
INFO ERB::Processor::ForSingleFile : Wrote ./dir/file.cpp
INFO ERB::Processor::ForSingleFile : Processing ./file.cpp.erb...
INFO ERB::Processor::ForSingleFile : Wrote ./file.cpp
"""

Scenario: Processor logs info to the console
When I successfully run `erb-processor --log-level=info .`
Then the stdout should contain exactly:
"""
INFO Erb::Processor::ForSingleFile : Processing ./another_dir/features/file.feature.erb...
INFO Erb::Processor::ForSingleFile : Wrote ./another_dir/features/file.feature
INFO Erb::Processor::ForSingleFile : Processing ./another_dir/file.java.erb...
INFO Erb::Processor::ForSingleFile : Wrote ./another_dir/file.java
INFO Erb::Processor::ForSingleFile : Processing ./dir/another_file.js.erb...
INFO Erb::Processor::ForSingleFile : Wrote ./dir/another_file.js
INFO Erb::Processor::ForSingleFile : Processing ./dir/file.cpp.erb...
INFO Erb::Processor::ForSingleFile : Wrote ./dir/file.cpp
INFO Erb::Processor::ForSingleFile : Processing ./file.cpp.erb...
INFO Erb::Processor::ForSingleFile : Wrote ./file.cpp
INFO ERB::Processor::ForSingleFile : Processing ./another_dir/features/file.feature.erb...
INFO ERB::Processor::ForSingleFile : Wrote ./another_dir/features/file.feature
INFO ERB::Processor::ForSingleFile : Processing ./another_dir/file.java.erb...
INFO ERB::Processor::ForSingleFile : Wrote ./another_dir/file.java
INFO ERB::Processor::ForSingleFile : Processing ./dir/another_file.js.erb...
INFO ERB::Processor::ForSingleFile : Wrote ./dir/another_file.js
INFO ERB::Processor::ForSingleFile : Processing ./dir/file.cpp.erb...
INFO ERB::Processor::ForSingleFile : Wrote ./dir/file.cpp
INFO ERB::Processor::ForSingleFile : Processing ./file.cpp.erb...
INFO ERB::Processor::ForSingleFile : Wrote ./file.cpp
"""
And a file named "erb-processor.log" should contain exactly:
"""
INFO Erb::Processor::ForSingleFile : Processing ./another_dir/features/file.feature.erb...
INFO Erb::Processor::ForSingleFile : Wrote ./another_dir/features/file.feature
INFO Erb::Processor::ForSingleFile : Processing ./another_dir/file.java.erb...
INFO Erb::Processor::ForSingleFile : Wrote ./another_dir/file.java
INFO Erb::Processor::ForSingleFile : Processing ./dir/another_file.js.erb...
INFO Erb::Processor::ForSingleFile : Wrote ./dir/another_file.js
INFO Erb::Processor::ForSingleFile : Processing ./dir/file.cpp.erb...
INFO Erb::Processor::ForSingleFile : Wrote ./dir/file.cpp
INFO Erb::Processor::ForSingleFile : Processing ./file.cpp.erb...
INFO Erb::Processor::ForSingleFile : Wrote ./file.cpp
INFO ERB::Processor::ForSingleFile : Processing ./another_dir/features/file.feature.erb...
INFO ERB::Processor::ForSingleFile : Wrote ./another_dir/features/file.feature
INFO ERB::Processor::ForSingleFile : Processing ./another_dir/file.java.erb...
INFO ERB::Processor::ForSingleFile : Wrote ./another_dir/file.java
INFO ERB::Processor::ForSingleFile : Processing ./dir/another_file.js.erb...
INFO ERB::Processor::ForSingleFile : Wrote ./dir/another_file.js
INFO ERB::Processor::ForSingleFile : Processing ./dir/file.cpp.erb...
INFO ERB::Processor::ForSingleFile : Wrote ./dir/file.cpp
INFO ERB::Processor::ForSingleFile : Processing ./file.cpp.erb...
INFO ERB::Processor::ForSingleFile : Wrote ./file.cpp
"""
2 changes: 1 addition & 1 deletion lib/erb/processor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
require_relative "processor/version"
require_relative "processor/for_directory_tree"

module Erb
class ERB
module Processor
class Error < StandardError; end
# Your code goes here...
Expand Down
2 changes: 1 addition & 1 deletion lib/erb/processor/for_directory_tree.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require "find"
require_relative "for_single_file"

module Erb
class ERB
module Processor
# Orchestrate the processing of all .erb templates in tree structure
class ForDirectoryTree
Expand Down
2 changes: 1 addition & 1 deletion lib/erb/processor/for_single_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
require "find"
require_relative "language_commenter"

module Erb
class ERB
module Processor
# Processes a single file template
class ForSingleFile
Expand Down
2 changes: 1 addition & 1 deletion lib/erb/processor/language_commenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require "find"
require_relative "for_single_file"

module Erb
class ERB
module Processor
# Convert text to a comment depending on the target language
class LanguageCommenter
Expand Down
2 changes: 1 addition & 1 deletion lib/erb/processor/logging_setup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require "logging"
require "singleton"

module Erb
class ERB
module Processor
# Configure the logging framework according the process needs
class LoggingSetup
Expand Down
2 changes: 1 addition & 1 deletion lib/erb/processor/version.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

module Erb
class ERB
module Processor
VERSION = "0.1.0"
end
Expand Down
2 changes: 1 addition & 1 deletion sig/erb/processor.rbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Erb
class ERB
module Processor
VERSION: String
# See the writing guide of rbs: https://github.com/ruby/rbs#guides
Expand Down
2 changes: 1 addition & 1 deletion spec/erb/processor/for_single_file_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

RSpec.describe Erb::Processor::ForSingleFile do
RSpec.describe ERB::Processor::ForSingleFile do
let(:erb_processor) { described_class.new("./foo/bar/a_template_file.c.erb") }

describe ".template_file?" do
Expand Down
2 changes: 1 addition & 1 deletion spec/erb/processor/language_commenter_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

RSpec.describe Erb::Processor::LanguageCommenter do
RSpec.describe ERB::Processor::LanguageCommenter do
let(:text_to_comment) do
<<~END_OF_TEXT
A multiline text
Expand Down
4 changes: 2 additions & 2 deletions spec/erb/processor_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

RSpec.describe Erb::Processor do
RSpec.describe ERB::Processor do
it "has a version number" do
expect(Erb::Processor::VERSION).not_to be_nil
expect(ERB::Processor::VERSION).not_to be_nil
end
end

0 comments on commit 67277fd

Please sign in to comment.