Skip to content

Commit

Permalink
[Chore] renamed todo_tracker to todo_agent
Browse files Browse the repository at this point in the history
  • Loading branch information
rpbaltazar committed Jul 25, 2020
1 parent 396af93 commit 5465a3f
Show file tree
Hide file tree
Showing 25 changed files with 54 additions and 54 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
.rspec_status
.byebug_history

todo_tracker-*.gem
todo_agent-*.gem
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

source "https://rubygems.org"

# Specify your gem's dependencies in todo_tracker.gemspec
# Specify your gem's dependencies in todo_agent.gemspec
gemspec

gem "byebug"
Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
todo_tracker (0.1.0)
todo_agent (0.1.0)

GEM
remote: https://rubygems.org/
Expand Down Expand Up @@ -51,7 +51,7 @@ DEPENDENCIES
rake (~> 12.0)
rspec (~> 3.0)
rubocop
todo_tracker!
todo_agent!

BUNDLED WITH
2.1.4
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# TodoTracker
# TodoAgent

Searches the code for TODOs and creates issues in the configured tracker

Expand All @@ -13,7 +13,7 @@ Might be interesting to extract some of the features from story_branch gem to a
Add this line to your application's Gemfile:

```ruby
gem 'todo_tracker'
gem 'todo_agent'
```

And then execute:
Expand All @@ -22,7 +22,7 @@ And then execute:

Or install it yourself as:

$ gem install todo_tracker
$ gem install todo_agent

## Usage

Expand All @@ -36,7 +36,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/rpbaltazar/todo_tracker. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/rpbaltazar/todo_tracker/blob/master/CODE_OF_CONDUCT.md).
Bug reports and pull requests are welcome on GitHub at https://github.com/rpbaltazar/todo_agent. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/rpbaltazar/todo_agent/blob/master/CODE_OF_CONDUCT.md).


## License
Expand All @@ -45,4 +45,4 @@ The gem is available as open source under the terms of the [MIT License](https:/

## Code of Conduct

Everyone interacting in the TodoTracker project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/rpbaltazar/todo_tracker/blob/master/CODE_OF_CONDUCT.md).
Everyone interacting in the TodoAgent project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/rpbaltazar/todo_agent/blob/master/CODE_OF_CONDUCT.md).
2 changes: 1 addition & 1 deletion bin/console
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# frozen_string_literal: true

require "bundler/setup"
require "todo_tracker"
require "todo_agent"

# You can add fixtures and/or initialization code here to make experimenting
# with your gem easier. You can also use a different console, if you like.
Expand Down
6 changes: 3 additions & 3 deletions exe/todo_tracker → exe/todo_agent
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@

lib_path = File.expand_path('../lib', __dir__)
$:.unshift(lib_path) if !$:.include?(lib_path)
require 'todo_tracker/cli'
require 'todo_agent/cli'

Signal.trap('INT') do
warn("\n#{caller.join("\n")}: interrupted")
exit(1)
end

begin
TodoTracker::CLI.start
rescue TodoTracker::CLI::Error => err
TodoAgent::CLI.start
rescue TodoAgent::CLI::Error => err
puts "ERROR: #{err.message}"
exit 1
end
10 changes: 10 additions & 0 deletions lib/todo_agent.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# frozen_string_literal: true

require_relative "todo_agent/version"
require_relative "todo_agent/file_identifier"
require_relative "todo_agent/parsers/ruby"

module TodoAgent
class Error < StandardError; end
# Your code goes here...
end
8 changes: 4 additions & 4 deletions lib/todo_tracker/cli.rb → lib/todo_agent/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

require "thor"

module TodoTracker
module TodoAgent
# Handle the application command line parsing
# and the dispatch to various command objects
#
Expand All @@ -11,10 +11,10 @@ class CLI < Thor
# Error raised by this runner
Error = Class.new(StandardError)

desc "version", "todo_tracker version"
desc "version", "todo_agent version"
def version
require_relative "version"
puts "v#{TodoTracker::VERSION}"
puts "v#{TodoAgent::VERSION}"
end
map %w[--version -v] => :version

Expand All @@ -28,7 +28,7 @@ def analyze(path = ".")
invoke :help, ["analyze"]
else
require_relative "commands/analyze"
TodoTracker::Commands::Analyze.new(path, options).execute
TodoAgent::Commands::Analyze.new(path, options).execute
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/todo_tracker/command.rb → lib/todo_agent/command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

require 'forwardable'

module TodoTracker
module TodoAgent
class Command
extend Forwardable

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
# TODO: load remaining parsers
require_relative "../parsers/ruby"

module TodoTracker
module TodoAgent
module Commands
class Analyze < TodoTracker::Command
class Analyze < TodoAgent::Command
def initialize(path, options)
@path = path
@options = options
Expand All @@ -17,10 +17,10 @@ def initialize(path, options)
def execute(_input: $stdin, _output: $stdout)
comments = []
Rake::FileList["#{@path}/**/*"].exclude(paths_to_ignore).each do |filepath|
parser = TodoTracker::FileIdentifier.based_on_file_extension(filepath)
parser = TodoAgent::FileIdentifier.based_on_file_extension(filepath)
next unless parser

parser_class = Object.const_get("TodoTracker::Parsers::#{parser}")
parser_class = Object.const_get("TodoAgent::Parsers::#{parser}")
result = parser_class.parse(filepath)
comments += result
end
Expand Down Expand Up @@ -50,7 +50,7 @@ def output(comments)
end

def output_file
@options["output_file"] || "todo_tracker.log"
@options["output_file"] || "todo_agent.log"
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/todo_tracker/comment.rb → lib/todo_agent/comment.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

module TodoTracker
module TodoAgent
class Comment
attr_reader :line, :filename

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

module TodoTracker
module TodoAgent
class FileIdentifier
def self.based_on_file_extension(filename)
supported_files = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

module TodoTracker
module TodoAgent
module Parsers
class DefaultTags
# TODO: read from config or fallback to defaults
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

require_relative "default_tags"

module TodoTracker
module TodoAgent
module Parsers
class RegexBuilder
DEFAULT_TAGS = [DefaultTags.todo, DefaultTags.fixme].freeze
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
require_relative "regex_builder"
require_relative "../comment"

module TodoTracker
module TodoAgent
module Parsers
class Ruby
def self.parse(file)
regex_str = TodoTracker::Parsers::RegexBuilder.regex
regex_str = TodoAgent::Parsers::RegexBuilder.regex
regexp = Regexp.new("^\\s*##{regex_str}$", "mig")
comments = []

# TODO: This logic belongs out of the specific ruby parser
# This only matches single line.
IO.foreach(file) do |line|
match = regexp.match(line)
comments << TodoTracker::Comment.new(match, file, $INPUT_LINE_NUMBER) if match
comments << TodoAgent::Comment.new(match, file, $INPUT_LINE_NUMBER) if match
end

comments
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/todo_tracker/version.rb → lib/todo_agent/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module TodoTracker
module TodoAgent
VERSION = "0.1.0"
end
10 changes: 0 additions & 10 deletions lib/todo_tracker.rb

This file was deleted.

8 changes: 4 additions & 4 deletions spec/integration/analyze_spec.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
RSpec.describe "`todo_tracker run` command", type: :cli do
it "executes `todo_tracker help run` command successfully" do
output = `todo_tracker help run`
RSpec.describe "`todo_agent run` command", type: :cli do
it "executes `todo_agent help run` command successfully" do
output = `todo_agent help run`
expected_output = <<-OUT
Usage:
todo_tracker run [PATH]
todo_agent run [PATH]
Options:
-h, [--help], [--no-help] # Display usage information
Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

require "bundler/setup"
require "todo_tracker"
require "todo_agent"

RSpec.configure do |config|
# Enable flags like --only-failures and --next-failure
Expand Down
4 changes: 2 additions & 2 deletions spec/todo_tracker_spec.rb → spec/todo_agent_spec.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# frozen_string_literal: true

RSpec.describe TodoTracker do
RSpec.describe TodoAgent do
it "has a version number" do
expect(TodoTracker::VERSION).not_to be nil
expect(TodoAgent::VERSION).not_to be nil
end

it "does something useful" do
Expand Down
6 changes: 3 additions & 3 deletions spec/unit/analyze_spec.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
require 'todo_tracker/commands/run'
require 'todo_agent/commands/run'

RSpec.describe TodoTracker::Commands::Run do
RSpec.describe TodoAgent::Commands::Run do
it "executes `run` command successfully" do
output = StringIO.new
path = nil
options = {}
command = TodoTracker::Commands::Run.new(path, options)
command = TodoAgent::Commands::Run.new(path, options)

command.execute(output: output)

Expand Down
6 changes: 3 additions & 3 deletions todo_tracker.gemspec → todo_agent.gemspec
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# frozen_string_literal: true

require_relative "lib/todo_tracker/version"
require_relative "lib/todo_agent/version"

Gem::Specification.new do |spec|
spec.name = "todo_tracker"
spec.version = TodoTracker::VERSION
spec.name = "todo_agent"
spec.version = TodoAgent::VERSION
spec.authors = ["Rui Baltazar"]
spec.email = ["[email protected]"]

Expand Down

0 comments on commit 5465a3f

Please sign in to comment.