From 9734696d7a15dc48cc01140a19c1af72618d1f0f Mon Sep 17 00:00:00 2001 From: Matt Brictson Date: Fri, 4 Jan 2019 09:09:59 -0800 Subject: [PATCH] Rename to tomo --- README.md | 12 ++--- bin/console | 2 +- exe/jam | 4 -- exe/tomo | 4 ++ ideas.rb | 8 --- lib/jam.rb | 52 ------------------- lib/jam/commands.rb | 9 ---- lib/jam/plugins.rb | 8 --- lib/jam/plugins/rails/plugin.rb | 11 ---- lib/jam/ssh.rb | 27 ---------- lib/tomo.rb | 52 +++++++++++++++++++ lib/{jam => tomo}/cli.rb | 20 +++---- lib/{jam => tomo}/cli/deploy_options.rb | 4 +- lib/{jam => tomo}/cli/parser.rb | 4 +- lib/{jam => tomo}/colors.rb | 4 +- lib/tomo/commands.rb | 9 ++++ lib/{jam => tomo}/commands/default.rb | 14 ++--- lib/{jam => tomo}/commands/deploy.rb | 18 +++---- lib/{jam => tomo}/commands/init.rb | 36 ++++++------- lib/{jam => tomo}/commands/run.rb | 28 +++++----- lib/{jam => tomo}/commands/tasks.rb | 14 ++--- lib/{jam => tomo}/error.rb | 10 ++-- lib/{jam => tomo}/error/suggestions.rb | 2 +- lib/{jam => tomo}/errors/connection_error.rb | 4 +- .../errors/remote_execution_error.rb | 2 +- .../errors/unknown_task_error.rb | 4 +- lib/{jam => tomo}/framework.rb | 28 +++++----- .../framework/concurrent_ruby_load_error.rb | 6 +-- .../framework/concurrent_ruby_thread_pool.rb | 4 +- lib/{jam => tomo}/framework/configuration.rb | 2 +- lib/{jam => tomo}/framework/current.rb | 4 +- lib/{jam => tomo}/framework/execution_plan.rb | 2 +- lib/{jam => tomo}/framework/glob.rb | 2 +- .../framework/inline_thread_pool.rb | 2 +- .../framework/plugins_registry.rb | 16 +++--- lib/{jam => tomo}/framework/roles_filter.rb | 2 +- .../framework/settings_registry.rb | 6 +-- lib/{jam => tomo}/framework/tasks_registry.rb | 4 +- .../framework/unknown_plugin_error.rb | 4 +- lib/{jam => tomo}/host.rb | 2 +- lib/{jam => tomo}/logger.rb | 8 +-- .../logger/host_prepending_io.rb | 4 +- lib/{jam => tomo}/path.rb | 2 +- lib/{jam => tomo}/paths.rb | 2 +- lib/{jam => tomo}/plugin.rb | 2 +- lib/tomo/plugins.rb | 8 +++ lib/{jam => tomo}/plugins/bundler/helpers.rb | 2 +- lib/{jam => tomo}/plugins/bundler/plugin.rb | 8 +-- lib/{jam => tomo}/plugins/bundler/tasks.rb | 4 +- lib/{jam => tomo}/plugins/core/helpers.rb | 2 +- lib/{jam => tomo}/plugins/core/plugin.rb | 8 +-- lib/{jam => tomo}/plugins/core/tasks.rb | 4 +- lib/{jam => tomo}/plugins/git/helpers.rb | 2 +- lib/{jam => tomo}/plugins/git/plugin.rb | 8 +-- lib/{jam => tomo}/plugins/git/tasks.rb | 4 +- lib/{jam => tomo}/plugins/rails/helpers.rb | 2 +- lib/tomo/plugins/rails/plugin.rb | 11 ++++ lib/{jam => tomo}/plugins/rails/tasks.rb | 4 +- lib/{jam => tomo}/project.rb | 6 +-- lib/{jam => tomo}/project/not_found_error.rb | 6 +-- lib/{jam => tomo}/project/specification.rb | 4 +- lib/{jam => tomo}/remote.rb | 4 +- lib/{jam => tomo}/result.rb | 2 +- lib/{jam => tomo}/script.rb | 2 +- lib/{jam => tomo}/shell_builder.rb | 2 +- lib/tomo/ssh.rb | 27 ++++++++++ lib/{jam => tomo}/ssh/child_process.rb | 4 +- lib/{jam => tomo}/ssh/connection.rb | 8 +-- lib/{jam => tomo}/ssh/connection_error.rb | 2 +- lib/{jam => tomo}/ssh/connection_validator.rb | 10 ++-- lib/{jam => tomo}/ssh/error.rb | 4 +- lib/{jam => tomo}/ssh/executable_error.rb | 2 +- lib/{jam => tomo}/ssh/options.rb | 2 +- lib/{jam => tomo}/ssh/permission_error.rb | 2 +- lib/{jam => tomo}/ssh/script_error.rb | 2 +- lib/{jam => tomo}/ssh/unknown_error.rb | 2 +- .../ssh/unsupported_version_error.rb | 2 +- lib/{jam => tomo}/task_library.rb | 4 +- lib/{jam => tomo}/templates/project.json | 0 lib/{jam => tomo}/version.rb | 2 +- test/test_helper.rb | 4 +- test/{jam_test.rb => tomo_test.rb} | 4 +- jam.gemspec => tomo.gemspec | 8 +-- 83 files changed, 319 insertions(+), 327 deletions(-) delete mode 100755 exe/jam create mode 100755 exe/tomo delete mode 100644 ideas.rb delete mode 100644 lib/jam.rb delete mode 100644 lib/jam/commands.rb delete mode 100644 lib/jam/plugins.rb delete mode 100644 lib/jam/plugins/rails/plugin.rb delete mode 100644 lib/jam/ssh.rb create mode 100644 lib/tomo.rb rename lib/{jam => tomo}/cli.rb (60%) rename lib/{jam => tomo}/cli/deploy_options.rb (91%) rename lib/{jam => tomo}/cli/parser.rb (98%) rename lib/{jam => tomo}/colors.rb (91%) create mode 100644 lib/tomo/commands.rb rename lib/{jam => tomo}/commands/default.rb (54%) rename lib/{jam => tomo}/commands/deploy.rb (71%) rename lib/{jam => tomo}/commands/init.rb (58%) rename lib/{jam => tomo}/commands/run.rb (65%) rename lib/{jam => tomo}/commands/tasks.rb (60%) rename lib/{jam => tomo}/error.rb (61%) rename lib/{jam => tomo}/error/suggestions.rb (98%) rename lib/{jam => tomo}/errors/connection_error.rb (60%) rename lib/{jam => tomo}/errors/remote_execution_error.rb (94%) rename lib/{jam => tomo}/errors/unknown_task_error.rb (80%) rename lib/{jam => tomo}/framework.rb (66%) rename lib/{jam => tomo}/framework/concurrent_ruby_load_error.rb (87%) rename lib/{jam => tomo}/framework/concurrent_ruby_thread_pool.rb (93%) rename lib/{jam => tomo}/framework/configuration.rb (99%) rename lib/{jam => tomo}/framework/current.rb (90%) rename lib/{jam => tomo}/framework/execution_plan.rb (99%) rename lib/{jam => tomo}/framework/glob.rb (97%) rename lib/{jam => tomo}/framework/inline_thread_pool.rb (97%) rename lib/{jam => tomo}/framework/plugins_registry.rb (73%) rename lib/{jam => tomo}/framework/roles_filter.rb (98%) rename lib/{jam => tomo}/framework/settings_registry.rb (94%) rename lib/{jam => tomo}/framework/tasks_registry.rb (96%) rename lib/{jam => tomo}/framework/unknown_plugin_error.rb (85%) rename lib/{jam => tomo}/host.rb (98%) rename lib/{jam => tomo}/logger.rb (89%) rename lib/{jam => tomo}/logger/host_prepending_io.rb (89%) rename lib/{jam => tomo}/path.rb (96%) rename lib/{jam => tomo}/paths.rb (98%) rename lib/{jam => tomo}/plugin.rb (97%) create mode 100644 lib/tomo/plugins.rb rename lib/{jam => tomo}/plugins/bundler/helpers.rb (91%) rename lib/{jam => tomo}/plugins/bundler/plugin.rb (76%) rename lib/{jam => tomo}/plugins/bundler/tasks.rb (95%) rename lib/{jam => tomo}/plugins/core/helpers.rb (97%) rename lib/{jam => tomo}/plugins/core/plugin.rb (88%) rename lib/{jam => tomo}/plugins/core/tasks.rb (95%) rename lib/{jam => tomo}/plugins/git/helpers.rb (84%) rename lib/{jam => tomo}/plugins/git/plugin.rb (75%) rename lib/{jam => tomo}/plugins/git/tasks.rb (94%) rename lib/{jam => tomo}/plugins/rails/helpers.rb (87%) create mode 100644 lib/tomo/plugins/rails/plugin.rb rename lib/{jam => tomo}/plugins/rails/tasks.rb (87%) rename lib/{jam => tomo}/project.rb (84%) rename lib/{jam => tomo}/project/not_found_error.rb (66%) rename lib/{jam => tomo}/project/specification.rb (97%) rename lib/{jam => tomo}/remote.rb (97%) rename lib/{jam => tomo}/result.rb (96%) rename lib/{jam => tomo}/script.rb (98%) rename lib/{jam => tomo}/shell_builder.rb (99%) create mode 100644 lib/tomo/ssh.rb rename lib/{jam => tomo}/ssh/child_process.rb (95%) rename lib/{jam => tomo}/ssh/connection.rb (90%) rename lib/{jam => tomo}/ssh/connection_error.rb (96%) rename lib/{jam => tomo}/ssh/connection_validator.rb (89%) rename lib/{jam => tomo}/ssh/error.rb (78%) rename lib/{jam => tomo}/ssh/executable_error.rb (97%) rename lib/{jam => tomo}/ssh/options.rb (99%) rename lib/{jam => tomo}/ssh/permission_error.rb (97%) rename lib/{jam => tomo}/ssh/script_error.rb (97%) rename lib/{jam => tomo}/ssh/unknown_error.rb (95%) rename lib/{jam => tomo}/ssh/unsupported_version_error.rb (96%) rename lib/{jam => tomo}/task_library.rb (94%) rename lib/{jam => tomo}/templates/project.json (100%) rename lib/{jam => tomo}/version.rb (72%) rename test/{jam_test.rb => tomo_test.rb} (53%) rename jam.gemspec => tomo.gemspec (90%) diff --git a/README.md b/README.md index 3661cc9e..3514a6e7 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# Jam +# Tomo -Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/jam`. To experiment with that code, run `bin/console` for an interactive prompt. +Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/tomo`. To experiment with that code, run `bin/console` for an interactive prompt. TODO: Delete this and the text above, and describe your gem @@ -9,7 +9,7 @@ TODO: Delete this and the text above, and describe your gem Add this line to your application's Gemfile: ```ruby -gem 'jam' +gem 'tomo' ``` And then execute: @@ -18,7 +18,7 @@ And then execute: Or install it yourself as: - $ gem install jam + $ gem install tomo ## Usage @@ -32,7 +32,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/[USERNAME]/jam. 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. +Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/tomo. 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. ## License @@ -40,4 +40,4 @@ The gem is available as open source under the terms of the [MIT License](https:/ ## Code of Conduct -Everyone interacting in the Jam project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/jam/blob/master/CODE_OF_CONDUCT.md). +Everyone interacting in the Tomo project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/tomo/blob/master/CODE_OF_CONDUCT.md). diff --git a/bin/console b/bin/console index 1d6c678e..b41d5e21 100755 --- a/bin/console +++ b/bin/console @@ -1,7 +1,7 @@ #!/usr/bin/env ruby require "bundler/setup" -require "jam" +require "tomo" # 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. diff --git a/exe/jam b/exe/jam deleted file mode 100755 index 9730b340..00000000 --- a/exe/jam +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env ruby - -require "jam" -Jam::CLI.new.call(ARGV) diff --git a/exe/tomo b/exe/tomo new file mode 100755 index 00000000..dde354f5 --- /dev/null +++ b/exe/tomo @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby + +require "tomo" +Tomo::CLI.new.call(ARGV) diff --git a/ideas.rb b/ideas.rb deleted file mode 100644 index 0a2f3afd..00000000 --- a/ideas.rb +++ /dev/null @@ -1,8 +0,0 @@ -# If I run `jam run -e production bundler:clean`, how does jam know which hosts -# to run that task on??? Is the user forced to clarify it by passing something -# like `--tags app`? This seems like a fundamental problem with the decision to -# remove roles from task definitions. At the same time, I don't like how in -# capistrano plugin authors have to define abstractions on top of roles so that -# they can be overridden per project. I suppose jam could search through the -# "deploy" plan, find the bundler:clean task, and get the tags that were -# specified there. But what if the task appears in the plan more than once? diff --git a/lib/jam.rb b/lib/jam.rb deleted file mode 100644 index 283a0b33..00000000 --- a/lib/jam.rb +++ /dev/null @@ -1,52 +0,0 @@ -module Jam - autoload :CLI, "jam/cli" - autoload :Colors, "jam/colors" - autoload :Commands, "jam/commands" - autoload :Error, "jam/error" - autoload :Framework, "jam/framework" - autoload :Host, "jam/host" - autoload :Logger, "jam/logger" - autoload :Path, "jam/path" - autoload :Paths, "jam/paths" - autoload :Plugin, "jam/plugin" - autoload :Plugins, "jam/plugins" - autoload :Project, "jam/project" - autoload :Remote, "jam/remote" - autoload :Result, "jam/result" - autoload :Script, "jam/script" - autoload :ShellBuilder, "jam/shell_builder" - autoload :SSH, "jam/ssh" - autoload :TaskLibrary, "jam/task_library" - autoload :UnknownTaskError, "jam/errors/unknown_task_error" - autoload :VERSION, "jam/version" - - class << self - attr_accessor :logger - attr_writer :debug - - def load_project!(environment:, settings: {}) - spec = Project::Specification.from_json(".jam/project.json") - .for_environment(environment) - - framework = Framework.configure do |config| - config.add_plugins(spec.plugins) - config.add_settings(spec.settings.merge(settings)) - if File.file?(".jam/tasks.rb") - config.add_task_library(TaskLibrary.from_script(".jam/tasks.rb")) - end - end - - Project.new(framework, spec) - end - - def debug? - !!@debug - end - - def bundled? - !!(defined?(Bundler) && ENV["BUNDLE_GEMFILE"]) - end - end - - self.logger = Logger.new -end diff --git a/lib/jam/commands.rb b/lib/jam/commands.rb deleted file mode 100644 index 7c4053c9..00000000 --- a/lib/jam/commands.rb +++ /dev/null @@ -1,9 +0,0 @@ -module Jam - module Commands - autoload :Default, "jam/commands/default" - autoload :Deploy, "jam/commands/deploy" - autoload :Init, "jam/commands/init" - autoload :Run, "jam/commands/run" - autoload :Tasks, "jam/commands/tasks" - end -end diff --git a/lib/jam/plugins.rb b/lib/jam/plugins.rb deleted file mode 100644 index 668a7d09..00000000 --- a/lib/jam/plugins.rb +++ /dev/null @@ -1,8 +0,0 @@ -module Jam - module Plugins - autoload :Bundler, "jam/plugins/bundler/plugin" - autoload :Core, "jam/plugins/core/plugin" - autoload :Git, "jam/plugins/git/plugin" - autoload :Rails, "jam/plugins/rails/plugin" - end -end diff --git a/lib/jam/plugins/rails/plugin.rb b/lib/jam/plugins/rails/plugin.rb deleted file mode 100644 index 13fa9241..00000000 --- a/lib/jam/plugins/rails/plugin.rb +++ /dev/null @@ -1,11 +0,0 @@ -require_relative "helpers" -require_relative "tasks" - -module Jam::Plugins::Rails - module Plugin - extend Jam::Plugin - - helpers Jam::Plugins::Rails::Helpers - tasks Jam::Plugins::Rails::Tasks - end -end diff --git a/lib/jam/ssh.rb b/lib/jam/ssh.rb deleted file mode 100644 index 5cd97627..00000000 --- a/lib/jam/ssh.rb +++ /dev/null @@ -1,27 +0,0 @@ -module Jam - module SSH - autoload :ChildProcess, "jam/ssh/child_process" - autoload :Connection, "jam/ssh/connection" - autoload :ConnectionValidator, "jam/ssh/connection_validator" - autoload :ConnectionError, "jam/ssh/connection_error" - autoload :Error, "jam/ssh/error" - autoload :ExecutableError, "jam/ssh/executable_error" - autoload :Options, "jam/ssh/options" - autoload :PermissionError, "jam/ssh/permission_error" - autoload :ScriptError, "jam/ssh/script_error" - autoload :UnknownError, "jam/ssh/unknown_error" - autoload :UnsupportedVersionError, "jam/ssh/unsupported_version_error" - - def self.connect(host:, options:) - Jam.logger.connect(host) - - conn = Connection.new(host, options) - validator = ConnectionValidator.new(options.executable, conn) - validator.assert_valid_executable! - validator.assert_valid_connection! - validator.dump_env if Jam.debug? - - conn - end - end -end diff --git a/lib/tomo.rb b/lib/tomo.rb new file mode 100644 index 00000000..882b2f01 --- /dev/null +++ b/lib/tomo.rb @@ -0,0 +1,52 @@ +module Tomo + autoload :CLI, "tomo/cli" + autoload :Colors, "tomo/colors" + autoload :Commands, "tomo/commands" + autoload :Error, "tomo/error" + autoload :Framework, "tomo/framework" + autoload :Host, "tomo/host" + autoload :Logger, "tomo/logger" + autoload :Path, "tomo/path" + autoload :Paths, "tomo/paths" + autoload :Plugin, "tomo/plugin" + autoload :Plugins, "tomo/plugins" + autoload :Project, "tomo/project" + autoload :Remote, "tomo/remote" + autoload :Result, "tomo/result" + autoload :Script, "tomo/script" + autoload :ShellBuilder, "tomo/shell_builder" + autoload :SSH, "tomo/ssh" + autoload :TaskLibrary, "tomo/task_library" + autoload :UnknownTaskError, "tomo/errors/unknown_task_error" + autoload :VERSION, "tomo/version" + + class << self + attr_accessor :logger + attr_writer :debug + + def load_project!(environment:, settings: {}) + spec = Project::Specification.from_json(".tomo/project.json") + .for_environment(environment) + + framework = Framework.configure do |config| + config.add_plugins(spec.plugins) + config.add_settings(spec.settings.merge(settings)) + if File.file?(".tomo/tasks.rb") + config.add_task_library(TaskLibrary.from_script(".tomo/tasks.rb")) + end + end + + Project.new(framework, spec) + end + + def debug? + !!@debug + end + + def bundled? + !!(defined?(Bundler) && ENV["BUNDLE_GEMFILE"]) + end + end + + self.logger = Logger.new +end diff --git a/lib/jam/cli.rb b/lib/tomo/cli.rb similarity index 60% rename from lib/jam/cli.rb rename to lib/tomo/cli.rb index 3fae04ae..5977df5d 100644 --- a/lib/jam/cli.rb +++ b/lib/tomo/cli.rb @@ -1,24 +1,24 @@ -module Jam +module Tomo class CLI - autoload :DeployOptions, "jam/cli/deploy_options" - autoload :Parser, "jam/cli/parser" + autoload :DeployOptions, "tomo/cli/deploy_options" + autoload :Parser, "tomo/cli/parser" class << self attr_accessor :show_backtrace end COMMANDS = { - "deploy" => Jam::Commands::Deploy, - "init" => Jam::Commands::Init, - "run" => Jam::Commands::Run, - "tasks" => Jam::Commands::Tasks + "deploy" => Tomo::Commands::Deploy, + "init" => Tomo::Commands::Init, + "run" => Tomo::Commands::Run, + "tasks" => Tomo::Commands::Tasks }.freeze def call(argv) command = if COMMANDS.key?(argv.first) COMMANDS[argv.shift].new else - Jam::Commands::Default.new + Tomo::Commands::Default.new end options = command.parser.parse(argv) @@ -32,9 +32,9 @@ def call(argv) def handle_error(error) raise error unless error.respond_to?(:to_console) - Jam.logger.error(error.to_console) + Tomo.logger.error(error.to_console) status = error.respond_to?(:exit_status) ? error.exit_status : 1 - exit(status) unless Jam::CLI.show_backtrace + exit(status) unless Tomo::CLI.show_backtrace raise error end diff --git a/lib/jam/cli/deploy_options.rb b/lib/tomo/cli/deploy_options.rb similarity index 91% rename from lib/jam/cli/deploy_options.rb rename to lib/tomo/cli/deploy_options.rb index cedb63e0..dc7f0206 100644 --- a/lib/jam/cli/deploy_options.rb +++ b/lib/tomo/cli/deploy_options.rb @@ -1,4 +1,4 @@ -module Jam +module Tomo class CLI module DeployOptions # rubocop:disable Metrics/MethodLength @@ -19,7 +19,7 @@ def self.call(opts, results) end opts.on("--[no-]color", "Enable/disable color output") do |color| - color ? Jam::Colors.enable : Jam::Colors.disable + color ? Tomo::Colors.enable : Tomo::Colors.disable end end # rubocop:enable Metrics/MethodLength diff --git a/lib/jam/cli/parser.rb b/lib/tomo/cli/parser.rb similarity index 98% rename from lib/jam/cli/parser.rb rename to lib/tomo/cli/parser.rb index 56c93cde..eaf08a43 100644 --- a/lib/jam/cli/parser.rb +++ b/lib/tomo/cli/parser.rb @@ -1,7 +1,7 @@ require "forwardable" require "optparse" -module Jam +module Tomo class CLI class Parser extend Forwardable @@ -61,7 +61,7 @@ def add(parser_extensions) def add_debug_option on_tail("--[no-]debug", "Enable/disable verbose debug logging") do |debug| - Jam.debug = debug + Tomo.debug = debug end end diff --git a/lib/jam/colors.rb b/lib/tomo/colors.rb similarity index 91% rename from lib/jam/colors.rb rename to lib/tomo/colors.rb index 75486b39..74c531e6 100644 --- a/lib/jam/colors.rb +++ b/lib/tomo/colors.rb @@ -1,4 +1,4 @@ -module Jam +module Tomo module Colors ANSI_CODES = { red: 31, @@ -45,7 +45,7 @@ def tty?(io) ANSI_CODES.each do |name, code| define_method(name) do |str| - ::Jam::Colors.enabled? ? "\e[0;#{code};49m#{str}\e[0m" : str + ::Tomo::Colors.enabled? ? "\e[0;#{code};49m#{str}\e[0m" : str end end end diff --git a/lib/tomo/commands.rb b/lib/tomo/commands.rb new file mode 100644 index 00000000..6c95478e --- /dev/null +++ b/lib/tomo/commands.rb @@ -0,0 +1,9 @@ +module Tomo + module Commands + autoload :Default, "tomo/commands/default" + autoload :Deploy, "tomo/commands/deploy" + autoload :Init, "tomo/commands/init" + autoload :Run, "tomo/commands/run" + autoload :Tasks, "tomo/commands/tasks" + end +end diff --git a/lib/jam/commands/default.rb b/lib/tomo/commands/default.rb similarity index 54% rename from lib/jam/commands/default.rb rename to lib/tomo/commands/default.rb index c0d31497..4be8536e 100644 --- a/lib/jam/commands/default.rb +++ b/lib/tomo/commands/default.rb @@ -1,22 +1,22 @@ -module Jam +module Tomo module Commands class Default # rubocop:disable Metrics/MethodLength def parser - Jam::CLI::Parser.new do |parser| - parser.banner = "Usage: jam COMMAND [options]" + Tomo::CLI::Parser.new do |parser| + parser.banner = "Usage: tomo COMMAND [options]" parser.usage = <<~USAGE - Jam is an extensible tool for deploying projects to remote hosts via SSH. + Tomo is an extensible tool for deploying projects to remote hosts via SSH. Please specify a COMMAND, which can be: - #{Jam::CLI::COMMANDS.keys.map { |key| " - #{key}" }.join("\n")} + #{Tomo::CLI::COMMANDS.keys.map { |key| " - #{key}" }.join("\n")} For additional help, run: - jam COMMAND -h + tomo COMMAND -h USAGE parser.on("-v", "--version") do - puts Jam::VERSION + puts Tomo::VERSION exit end end diff --git a/lib/jam/commands/deploy.rb b/lib/tomo/commands/deploy.rb similarity index 71% rename from lib/jam/commands/deploy.rb rename to lib/tomo/commands/deploy.rb index 484b0be4..7d215cb5 100644 --- a/lib/jam/commands/deploy.rb +++ b/lib/tomo/commands/deploy.rb @@ -1,24 +1,24 @@ -module Jam +module Tomo module Commands class Deploy - include Jam::Colors + include Tomo::Colors def parser - Jam::CLI::Parser.new do |parser| + Tomo::CLI::Parser.new do |parser| parser.banner = <<~BANNER - Usage: jam deploy [options] + Usage: tomo deploy [options] - Run the "deploy" script specified in .jam/project.json to deploy this project. + Run the "deploy" script specified in .tomo/project.json to deploy this project. For projects that have more than one environment (e.g. staging, production), specify the target environment using the `-e` option. BANNER parser.permit_empty_args = true - parser.add(Jam::CLI::DeployOptions) + parser.add(Tomo::CLI::DeployOptions) end end def call(options) - Jam.logger.info "jam deploy v#{Jam::VERSION}" + Tomo.logger.info "tomo deploy v#{Tomo::VERSION}" release = Time.now.utc.strftime("%Y%m%d%H%M%S") project = load_project!(options, release) @@ -26,7 +26,7 @@ def call(options) plan = project.build_deploy_plan plan.run - Jam.logger.info( + Tomo.logger.info( green("✔ Deployed #{app} to #{plan.applicable_hosts_sentence}") ) end @@ -34,7 +34,7 @@ def call(options) private def load_project!(options, release) - Jam.load_project!( + Tomo.load_project!( environment: options[:environment], settings: options[:settings].merge( release_path: "%/#{release}" diff --git a/lib/jam/commands/init.rb b/lib/tomo/commands/init.rb similarity index 58% rename from lib/jam/commands/init.rb rename to lib/tomo/commands/init.rb index 06a640bf..7707376b 100644 --- a/lib/jam/commands/init.rb +++ b/lib/tomo/commands/init.rb @@ -1,18 +1,18 @@ -module Jam +module Tomo module Commands class Init - include Jam::Colors + include Tomo::Colors # rubocop:disable Metrics/MethodLength def parser - Jam::CLI::Parser.new do |parser| + Tomo::CLI::Parser.new do |parser| parser.banner = <<~BANNER - Usage: jam init [APP] + Usage: tomo init [APP] - Sets up a new jam project named APP. If APP is not specified, the + Sets up a new tomo project named APP. If APP is not specified, the name of the current directory will be used. - This command creates a .jam/project.json file relative the current + This command creates a .tomo/project.json file relative the current directory containing some example configuration. BANNER parser.permit_empty_args = true @@ -22,31 +22,31 @@ def parser # rubocop:enable Metrics/MethodLength def call(options) - assert_can_create_jam_directory! - assert_no_jam_project! + assert_can_create_tomo_directory! + assert_no_tomo_project! app = options[:extra_args].first || current_dir_name || "default" git_url = git_origin_url || "TODO" - FileUtils.mkdir(".jam") - IO.write(".jam/project.json", json_template(app, git_url)) + FileUtils.mkdir(".tomo") + IO.write(".tomo/project.json", json_template(app, git_url)) - Jam.logger.info(green("✔ Created .jam/project.json")) + Tomo.logger.info(green("✔ Created .tomo/project.json")) end private - def assert_can_create_jam_directory! - return if Dir.exist?(".jam") - return unless File.exist?(".jam") + def assert_can_create_tomo_directory! + return if Dir.exist?(".tomo") + return unless File.exist?(".tomo") - Jam.logger.error("Can't create .jam directory; a file already exists") + Tomo.logger.error("Can't create .tomo directory; a file already exists") exit(1) end - def assert_no_jam_project! - return unless File.exist?(".jam/project.json") + def assert_no_tomo_project! + return unless File.exist?(".tomo/project.json") - Jam.logger.error("A .jam/project.json file already exists") + Tomo.logger.error("A .tomo/project.json file already exists") exit(1) end diff --git a/lib/jam/commands/run.rb b/lib/tomo/commands/run.rb similarity index 65% rename from lib/jam/commands/run.rb rename to lib/tomo/commands/run.rb index 37e9faec..324da258 100644 --- a/lib/jam/commands/run.rb +++ b/lib/tomo/commands/run.rb @@ -1,38 +1,38 @@ -module Jam +module Tomo module Commands class Run - include Jam::Colors + include Tomo::Colors # rubocop:disable Metrics/MethodLength def parser - Jam::CLI::Parser.new do |parser| + Tomo::CLI::Parser.new do |parser| parser.banner = <<~BANNER - Usage: jam run [options] [--] TASK [ARGS...] + Usage: tomo run [options] [--] TASK [ARGS...] Remotely run one specified TASK, optionally passing ARGS to that task. For example, if this project uses the "rails" plugin, you could run: - jam run -- rails:console --sandbox + tomo run -- rails:console --sandbox This will run the `rails:console` task on the host specified in - .jam/project.json, and will pass the `--sandbox` argument to that task. - The `--` is used to separate jam options from options that are passed + .tomo/project.json, and will pass the `--sandbox` argument to that task. + The `--` is used to separate tomo options from options that are passed to the task. If a task does not accept options, the `--` can be omitted. - Available tasks are those defined by plugins loaded in .jam/project.json, - or can also be custom tasks defined in .jam/tasks.rb. To see a list of + Available tasks are those defined by plugins loaded in .tomo/project.json, + or can also be custom tasks defined in .tomo/tasks.rb. To see a list of available tasks, run: - jam tasks + tomo tasks BANNER parser.permit_extra_args = true - parser.add(Jam::CLI::DeployOptions) + parser.add(Tomo::CLI::DeployOptions) end end # rubocop:enable Metrics/MethodLength def call(options) - Jam.logger.info "jam run v#{Jam::VERSION}" + Tomo.logger.info "tomo run v#{Tomo::VERSION}" task, *args = options[:extra_args] project = load_project!(options, args) @@ -40,7 +40,7 @@ def call(options) plan = project.build_run_plan(task) plan.run - Jam.logger.info( + Tomo.logger.info( green("✔ Ran #{task} on #{plan.applicable_hosts_sentence}") ) end @@ -48,7 +48,7 @@ def call(options) private def load_project!(options, args) - Jam.load_project!( + Tomo.load_project!( environment: options[:environment], settings: options[:settings].merge( options[:settings].merge(run_args: args) diff --git a/lib/jam/commands/tasks.rb b/lib/tomo/commands/tasks.rb similarity index 60% rename from lib/jam/commands/tasks.rb rename to lib/tomo/commands/tasks.rb index e322835e..3904bada 100644 --- a/lib/jam/commands/tasks.rb +++ b/lib/tomo/commands/tasks.rb @@ -1,22 +1,22 @@ -module Jam +module Tomo module Commands class Tasks def parser - Jam::CLI::Parser.new do |parser| + Tomo::CLI::Parser.new do |parser| parser.banner = <<~BANNER - Usage: jam tasks + Usage: tomo tasks - Lists all jam tasks (i.e. those that can be used with `jam run`). + Lists all tomo tasks (i.e. those that can be used with `tomo run`). - Available tasks are those defined by plugins loaded in .jam/project.json, - or can also be custom tasks defined in .jam/tasks.rb. + Available tasks are those defined by plugins loaded in .tomo/project.json, + or can also be custom tasks defined in .tomo/tasks.rb. BANNER parser.permit_empty_args = true end end def call(_options) - project = Jam.load_project!(environment: :auto) + project = Tomo.load_project!(environment: :auto) tasks = project.tasks groups = tasks.group_by { |task| task[/^([^:]+):/, 1].to_s } diff --git a/lib/jam/error.rb b/lib/tomo/error.rb similarity index 61% rename from lib/jam/error.rb rename to lib/tomo/error.rb index 41eebeb5..f14046ba 100644 --- a/lib/jam/error.rb +++ b/lib/tomo/error.rb @@ -1,8 +1,8 @@ -module Jam +module Tomo class Error < StandardError - autoload :Suggestions, "jam/error/suggestions" + autoload :Suggestions, "tomo/error/suggestions" - include Jam::Colors + include Tomo::Colors def self.raise_with(message=nil, attributes) err = new(message) @@ -13,9 +13,9 @@ def self.raise_with(message=nil, attributes) private def debug_suggestion - return if Jam.debug? + return if Tomo.debug? - "For more troubleshooting info, run jam again using the "\ + "For more troubleshooting info, run tomo again using the "\ "#{blue('--debug')} option." end end diff --git a/lib/jam/error/suggestions.rb b/lib/tomo/error/suggestions.rb similarity index 98% rename from lib/jam/error/suggestions.rb rename to lib/tomo/error/suggestions.rb index 790da885..037d3fec 100644 --- a/lib/jam/error/suggestions.rb +++ b/lib/tomo/error/suggestions.rb @@ -1,4 +1,4 @@ -module Jam +module Tomo class Error class Suggestions def initialize(dictionary:, word:) diff --git a/lib/jam/errors/connection_error.rb b/lib/tomo/errors/connection_error.rb similarity index 60% rename from lib/jam/errors/connection_error.rb rename to lib/tomo/errors/connection_error.rb index 9337ddb9..3ee6dfde 100644 --- a/lib/jam/errors/connection_error.rb +++ b/lib/tomo/errors/connection_error.rb @@ -1,8 +1,8 @@ -module Jam +module Tomo class ConnectionError < RemoteExecutionError def to_console <<~MESSAGE - Jam was unable to use ssh to connect to #{blue(host)}. + Tomo was unable to use ssh to connect to #{blue(host)}. MESSAGE end end diff --git a/lib/jam/errors/remote_execution_error.rb b/lib/tomo/errors/remote_execution_error.rb similarity index 94% rename from lib/jam/errors/remote_execution_error.rb rename to lib/tomo/errors/remote_execution_error.rb index 5f04502f..0d113d60 100644 --- a/lib/jam/errors/remote_execution_error.rb +++ b/lib/tomo/errors/remote_execution_error.rb @@ -1,4 +1,4 @@ -module Jam +module Tomo class RemoteExecutionError < Error attr_accessor :host, :script, :ssh_command, :result diff --git a/lib/jam/errors/unknown_task_error.rb b/lib/tomo/errors/unknown_task_error.rb similarity index 80% rename from lib/jam/errors/unknown_task_error.rb rename to lib/tomo/errors/unknown_task_error.rb index 63f60395..09768026 100644 --- a/lib/jam/errors/unknown_task_error.rb +++ b/lib/tomo/errors/unknown_task_error.rb @@ -1,11 +1,11 @@ -module Jam +module Tomo class UnknownTaskError < Error attr_accessor :unknown_task, :known_tasks def to_console error = <<~ERROR #{yellow(unknown_task)} is not a recognized task. - To see a list of all available tasks, run #{blue('jam tasks')}. + To see a list of all available tasks, run #{blue('tomo tasks')}. ERROR sugg = Error::Suggestions.new(dictionary: known_tasks, word: unknown_task) diff --git a/lib/jam/framework.rb b/lib/tomo/framework.rb similarity index 66% rename from lib/jam/framework.rb rename to lib/tomo/framework.rb index 2dec6228..cc9a5be1 100644 --- a/lib/jam/framework.rb +++ b/lib/tomo/framework.rb @@ -1,23 +1,23 @@ require "forwardable" -module Jam +module Tomo class Framework extend Forwardable autoload :ConcurrentRubyLoadError, - "jam/framework/concurrent_ruby_load_error" + "tomo/framework/concurrent_ruby_load_error" autoload :ConcurrentRubyThreadPool, - "jam/framework/concurrent_ruby_thread_pool" - autoload :Configuration, "jam/framework/configuration" - autoload :Current, "jam/framework/current" - autoload :ExecutionPlan, "jam/framework/execution_plan" - autoload :Glob, "jam/framework/glob" - autoload :InlineThreadPool, "jam/framework/inline_thread_pool" - autoload :PluginsRegistry, "jam/framework/plugins_registry" - autoload :RolesFilter, "jam/framework/roles_filter" - autoload :SettingsRegistry, "jam/framework/settings_registry" - autoload :TasksRegistry, "jam/framework/tasks_registry" - autoload :UnknownPluginError, "jam/framework/unknown_plugin_error" + "tomo/framework/concurrent_ruby_thread_pool" + autoload :Configuration, "tomo/framework/configuration" + autoload :Current, "tomo/framework/current" + autoload :ExecutionPlan, "tomo/framework/execution_plan" + autoload :Glob, "tomo/framework/glob" + autoload :InlineThreadPool, "tomo/framework/inline_thread_pool" + autoload :PluginsRegistry, "tomo/framework/plugins_registry" + autoload :RolesFilter, "tomo/framework/roles_filter" + autoload :SettingsRegistry, "tomo/framework/settings_registry" + autoload :TasksRegistry, "tomo/framework/tasks_registry" + autoload :UnknownPluginError, "tomo/framework/unknown_plugin_error" class << self def configure(&block) @@ -70,7 +70,7 @@ def invoke_task(name) end Current.with(task: name) do - Jam.logger.task_start(name) + Tomo.logger.task_start(name) task.call end end diff --git a/lib/jam/framework/concurrent_ruby_load_error.rb b/lib/tomo/framework/concurrent_ruby_load_error.rb similarity index 87% rename from lib/jam/framework/concurrent_ruby_load_error.rb rename to lib/tomo/framework/concurrent_ruby_load_error.rb index 67330e09..75577612 100644 --- a/lib/jam/framework/concurrent_ruby_load_error.rb +++ b/lib/tomo/framework/concurrent_ruby_load_error.rb @@ -1,6 +1,6 @@ -module Jam +module Tomo class Framework - class ConcurrentRubyLoadError < Jam::Error + class ConcurrentRubyLoadError < Tomo::Error attr_accessor :version def to_console @@ -13,7 +13,7 @@ def to_console private def install_instructions - if Jam.bundled? + if Tomo.bundled? gem_entry = %Q(gem "concurrent-ruby", "#{version}") "add this entry to your Gemfile:\n\n #{blue(gem_entry)}" else diff --git a/lib/jam/framework/concurrent_ruby_thread_pool.rb b/lib/tomo/framework/concurrent_ruby_thread_pool.rb similarity index 93% rename from lib/jam/framework/concurrent_ruby_thread_pool.rb rename to lib/tomo/framework/concurrent_ruby_thread_pool.rb index 353c5ce2..44387da8 100644 --- a/lib/jam/framework/concurrent_ruby_thread_pool.rb +++ b/lib/tomo/framework/concurrent_ruby_thread_pool.rb @@ -4,13 +4,13 @@ gem "concurrent-ruby", concurrent_ver require "concurrent" rescue LoadError => error - Jam::Framework::ConcurrentRubyLoadError.raise_with( + Tomo::Framework::ConcurrentRubyLoadError.raise_with( error.message, version: concurrent_ver ) end -module Jam +module Tomo class Framework class ConcurrentRubyThreadPool include ::Concurrent::Promises::FactoryMethods diff --git a/lib/jam/framework/configuration.rb b/lib/tomo/framework/configuration.rb similarity index 99% rename from lib/jam/framework/configuration.rb rename to lib/tomo/framework/configuration.rb index 60fe706b..f56f32d4 100644 --- a/lib/jam/framework/configuration.rb +++ b/lib/tomo/framework/configuration.rb @@ -1,4 +1,4 @@ -module Jam +module Tomo class Framework class Configuration def self.configure diff --git a/lib/jam/framework/current.rb b/lib/tomo/framework/current.rb similarity index 90% rename from lib/jam/framework/current.rb rename to lib/tomo/framework/current.rb index c1065ee9..0c177d7f 100644 --- a/lib/jam/framework/current.rb +++ b/lib/tomo/framework/current.rb @@ -1,4 +1,4 @@ -module Jam +module Tomo class Framework module Current class << self @@ -33,7 +33,7 @@ def slice(*keys) end def fiber_locals - Thread.current["Jam::Framework::Current"] ||= {} + Thread.current["Tomo::Framework::Current"] ||= {} end end end diff --git a/lib/jam/framework/execution_plan.rb b/lib/tomo/framework/execution_plan.rb similarity index 99% rename from lib/jam/framework/execution_plan.rb rename to lib/tomo/framework/execution_plan.rb index 94f046a8..27fc0fe9 100644 --- a/lib/jam/framework/execution_plan.rb +++ b/lib/tomo/framework/execution_plan.rb @@ -1,4 +1,4 @@ -module Jam +module Tomo class Framework class ExecutionPlan def initialize(framework:, hosts:, roles:, tasks:) diff --git a/lib/jam/framework/glob.rb b/lib/tomo/framework/glob.rb similarity index 97% rename from lib/jam/framework/glob.rb rename to lib/tomo/framework/glob.rb index b118891b..dbc96baf 100644 --- a/lib/jam/framework/glob.rb +++ b/lib/tomo/framework/glob.rb @@ -1,4 +1,4 @@ -module Jam +module Tomo class Framework class Glob def initialize(spec) diff --git a/lib/jam/framework/inline_thread_pool.rb b/lib/tomo/framework/inline_thread_pool.rb similarity index 97% rename from lib/jam/framework/inline_thread_pool.rb rename to lib/tomo/framework/inline_thread_pool.rb index dbf96a3e..f3fc80cd 100644 --- a/lib/jam/framework/inline_thread_pool.rb +++ b/lib/tomo/framework/inline_thread_pool.rb @@ -1,4 +1,4 @@ -module Jam +module Tomo class Framework class InlineThreadPool def post(*args) diff --git a/lib/jam/framework/plugins_registry.rb b/lib/tomo/framework/plugins_registry.rb similarity index 73% rename from lib/jam/framework/plugins_registry.rb rename to lib/tomo/framework/plugins_registry.rb index 2e93b435..c052c369 100644 --- a/lib/jam/framework/plugins_registry.rb +++ b/lib/tomo/framework/plugins_registry.rb @@ -1,11 +1,11 @@ -module Jam +module Tomo class Framework class PluginsRegistry BUILT_IN_PLUGINS = { - "core" => "Jam::Plugins::Core::Plugin", - "bundler" => "Jam::Plugins::Bundler::Plugin", - "git" => "Jam::Plugins::Git::Plugin", - "rails" => "Jam::Plugins::Rails::Plugin" + "core" => "Tomo::Plugins::Core::Plugin", + "bundler" => "Tomo::Plugins::Bundler::Plugin", + "git" => "Tomo::Plugins::Git::Plugin", + "rails" => "Tomo::Plugins::Rails::Plugin" }.freeze private_constant :BUILT_IN_PLUGINS @@ -18,7 +18,7 @@ def initialize(settings_registry:, tasks_registry:) end def core_loaded? - helper_modules.include?(Jam::Plugins::Core::Plugin) + helper_modules.include?(Tomo::Plugins::Core::Plugin) end def load_plugins_by_name(names) @@ -33,11 +33,11 @@ def load_plugin_by_name(name) ) end - load_plugin(name, Jam.const_get(BUILT_IN_PLUGINS[name])) + load_plugin(name, Tomo.const_get(BUILT_IN_PLUGINS[name])) end def load_plugin(namespace, plugin_class) - Jam.logger.debug("Loading plugin #{plugin_class}") + Tomo.logger.debug("Loading plugin #{plugin_class}") helper_modules.push(*plugin_class.helper_modules) settings_registry.define_settings(plugin_class.default_settings) diff --git a/lib/jam/framework/roles_filter.rb b/lib/tomo/framework/roles_filter.rb similarity index 98% rename from lib/jam/framework/roles_filter.rb rename to lib/tomo/framework/roles_filter.rb index dc78fba3..3afe5750 100644 --- a/lib/jam/framework/roles_filter.rb +++ b/lib/tomo/framework/roles_filter.rb @@ -1,4 +1,4 @@ -module Jam +module Tomo class Framework class RolesFilter def initialize(roles_spec) diff --git a/lib/jam/framework/settings_registry.rb b/lib/tomo/framework/settings_registry.rb similarity index 94% rename from lib/jam/framework/settings_registry.rb rename to lib/tomo/framework/settings_registry.rb index 0c1ead57..85ca23b7 100644 --- a/lib/jam/framework/settings_registry.rb +++ b/lib/tomo/framework/settings_registry.rb @@ -1,4 +1,4 @@ -module Jam +module Tomo class Framework class SettingsRegistry def initialize @@ -15,7 +15,7 @@ def assign_settings(assignments) def to_hash hash = Hash[settings.keys.map { |name| [name, fetch(name)] }] - dump_settings(hash) if Jam.debug? + dump_settings(hash) if Tomo.debug? hash end @@ -52,7 +52,7 @@ def dump_settings(hash) dump << " #{justified_key} #{value.inspect},\n" end dump << "}" - Jam.logger.debug(dump) + Tomo.logger.debug(dump) end end end diff --git a/lib/jam/framework/tasks_registry.rb b/lib/tomo/framework/tasks_registry.rb similarity index 96% rename from lib/jam/framework/tasks_registry.rb rename to lib/tomo/framework/tasks_registry.rb index a449037f..161367c9 100644 --- a/lib/jam/framework/tasks_registry.rb +++ b/lib/tomo/framework/tasks_registry.rb @@ -1,4 +1,4 @@ -module Jam +module Tomo class Framework class TasksRegistry def initialize @@ -21,7 +21,7 @@ def register_task_libraries(namespace, *library_classes) end def register_task_library(namespace, library_class) - Jam.logger.debug( + Tomo.logger.debug( "Registering task library #{library_class}"\ " (#{namespace.inspect} namespace)" ) diff --git a/lib/jam/framework/unknown_plugin_error.rb b/lib/tomo/framework/unknown_plugin_error.rb similarity index 85% rename from lib/jam/framework/unknown_plugin_error.rb rename to lib/tomo/framework/unknown_plugin_error.rb index 0b21aa53..7a6870fd 100644 --- a/lib/jam/framework/unknown_plugin_error.rb +++ b/lib/tomo/framework/unknown_plugin_error.rb @@ -1,6 +1,6 @@ -module Jam +module Tomo class Framework - class UnknownPluginError < Jam::Error + class UnknownPluginError < Tomo::Error attr_accessor :name, :known_plugins def to_console diff --git a/lib/jam/host.rb b/lib/tomo/host.rb similarity index 98% rename from lib/jam/host.rb rename to lib/tomo/host.rb index 6549f0c9..a37ac6d2 100644 --- a/lib/jam/host.rb +++ b/lib/tomo/host.rb @@ -1,4 +1,4 @@ -module Jam +module Tomo class Host PATTERN = /^(?:(\S+)@)?(\S*?)(?::(\S+))?$/.freeze private_constant :PATTERN diff --git a/lib/jam/logger.rb b/lib/tomo/logger.rb similarity index 89% rename from lib/jam/logger.rb rename to lib/tomo/logger.rb index bf48a85f..0e651284 100644 --- a/lib/jam/logger.rb +++ b/lib/tomo/logger.rb @@ -1,11 +1,11 @@ require "forwardable" -module Jam +module Tomo class Logger - autoload :HostPrependingIO, "jam/logger/host_prepending_io" + autoload :HostPrependingIO, "tomo/logger/host_prepending_io" extend Forwardable - include Jam::Colors + include Tomo::Colors def initialize(stdout: $stdout, stderr: $stderr) @stdout = HostPrependingIO.new(stdout) @@ -49,7 +49,7 @@ def error(message) end def debug(message) - return unless Jam.debug? + return unless Tomo.debug? stderr.puts gray("DEBUG: #{message}") end diff --git a/lib/jam/logger/host_prepending_io.rb b/lib/tomo/logger/host_prepending_io.rb similarity index 89% rename from lib/jam/logger/host_prepending_io.rb rename to lib/tomo/logger/host_prepending_io.rb index 2e6bc3b0..15415ccf 100644 --- a/lib/jam/logger/host_prepending_io.rb +++ b/lib/tomo/logger/host_prepending_io.rb @@ -1,7 +1,7 @@ -module Jam +module Tomo class Logger class HostPrependingIO - include Jam::Colors + include Tomo::Colors def initialize(io) @io = io diff --git a/lib/jam/path.rb b/lib/tomo/path.rb similarity index 96% rename from lib/jam/path.rb rename to lib/tomo/path.rb index afbd1e75..2aa5e85b 100644 --- a/lib/jam/path.rb +++ b/lib/tomo/path.rb @@ -1,7 +1,7 @@ require "forwardable" require "pathname" -module Jam +module Tomo class Path < SimpleDelegator def initialize(path) super(path.to_s) diff --git a/lib/jam/paths.rb b/lib/tomo/paths.rb similarity index 98% rename from lib/jam/paths.rb rename to lib/tomo/paths.rb index 1250d07d..e944b077 100644 --- a/lib/jam/paths.rb +++ b/lib/tomo/paths.rb @@ -1,4 +1,4 @@ -module Jam +module Tomo class Paths def initialize(settings) @settings = settings diff --git a/lib/jam/plugin.rb b/lib/tomo/plugin.rb similarity index 97% rename from lib/jam/plugin.rb rename to lib/tomo/plugin.rb index 58b58ccd..3014bec2 100644 --- a/lib/jam/plugin.rb +++ b/lib/tomo/plugin.rb @@ -1,4 +1,4 @@ -module Jam +module Tomo module Plugin def self.extended(mod) mod.instance_variable_set(:@helper_modules, []) diff --git a/lib/tomo/plugins.rb b/lib/tomo/plugins.rb new file mode 100644 index 00000000..2ca8e571 --- /dev/null +++ b/lib/tomo/plugins.rb @@ -0,0 +1,8 @@ +module Tomo + module Plugins + autoload :Bundler, "tomo/plugins/bundler/plugin" + autoload :Core, "tomo/plugins/core/plugin" + autoload :Git, "tomo/plugins/git/plugin" + autoload :Rails, "tomo/plugins/rails/plugin" + end +end diff --git a/lib/jam/plugins/bundler/helpers.rb b/lib/tomo/plugins/bundler/helpers.rb similarity index 91% rename from lib/jam/plugins/bundler/helpers.rb rename to lib/tomo/plugins/bundler/helpers.rb index 803def9e..7bea54ab 100644 --- a/lib/jam/plugins/bundler/helpers.rb +++ b/lib/tomo/plugins/bundler/helpers.rb @@ -1,4 +1,4 @@ -module Jam::Plugins::Bundler +module Tomo::Plugins::Bundler module Helpers def bundle(*args, **opts) env(settings[:bundler_env_variables]) do diff --git a/lib/jam/plugins/bundler/plugin.rb b/lib/tomo/plugins/bundler/plugin.rb similarity index 76% rename from lib/jam/plugins/bundler/plugin.rb rename to lib/tomo/plugins/bundler/plugin.rb index 9d17bc3a..6d9fdd31 100644 --- a/lib/jam/plugins/bundler/plugin.rb +++ b/lib/tomo/plugins/bundler/plugin.rb @@ -1,12 +1,12 @@ require_relative "helpers" require_relative "tasks" -module Jam::Plugins::Bundler +module Tomo::Plugins::Bundler module Plugin - extend Jam::Plugin + extend Tomo::Plugin - tasks Jam::Plugins::Bundler::Tasks - helpers Jam::Plugins::Bundler::Helpers + tasks Tomo::Plugins::Bundler::Tasks + helpers Tomo::Plugins::Bundler::Helpers defaults bundler_binstubs: nil, bundler_clean_options: nil, diff --git a/lib/jam/plugins/bundler/tasks.rb b/lib/tomo/plugins/bundler/tasks.rb similarity index 95% rename from lib/jam/plugins/bundler/tasks.rb rename to lib/tomo/plugins/bundler/tasks.rb index 349c3119..4195cc20 100644 --- a/lib/jam/plugins/bundler/tasks.rb +++ b/lib/tomo/plugins/bundler/tasks.rb @@ -1,5 +1,5 @@ -module Jam::Plugins::Bundler - class Tasks < Jam::TaskLibrary +module Tomo::Plugins::Bundler + class Tasks < Tomo::TaskLibrary def install return if remote.bundle?("check", *check_options) diff --git a/lib/jam/plugins/core/helpers.rb b/lib/tomo/plugins/core/helpers.rb similarity index 97% rename from lib/jam/plugins/core/helpers.rb rename to lib/tomo/plugins/core/helpers.rb index 8c1157d5..48f1952d 100644 --- a/lib/jam/plugins/core/helpers.rb +++ b/lib/tomo/plugins/core/helpers.rb @@ -1,4 +1,4 @@ -module Jam::Plugins::Core +module Tomo::Plugins::Core module Helpers def capture(*command, **run_opts) result = run(*command, **{ silent: true }.merge(run_opts)) diff --git a/lib/jam/plugins/core/plugin.rb b/lib/tomo/plugins/core/plugin.rb similarity index 88% rename from lib/jam/plugins/core/plugin.rb rename to lib/tomo/plugins/core/plugin.rb index 37f9a305..ab0d712c 100644 --- a/lib/jam/plugins/core/plugin.rb +++ b/lib/tomo/plugins/core/plugin.rb @@ -1,12 +1,12 @@ require_relative "helpers" require_relative "tasks" -module Jam::Plugins::Core +module Tomo::Plugins::Core module Plugin - extend Jam::Plugin + extend Tomo::Plugin - helpers Jam::Plugins::Core::Helpers - tasks Jam::Plugins::Core::Tasks + helpers Tomo::Plugins::Core::Helpers + tasks Tomo::Plugins::Core::Tasks defaults application: "default", concurrency: 10, diff --git a/lib/jam/plugins/core/tasks.rb b/lib/tomo/plugins/core/tasks.rb similarity index 95% rename from lib/jam/plugins/core/tasks.rb rename to lib/tomo/plugins/core/tasks.rb index 925dda2f..63d15241 100644 --- a/lib/jam/plugins/core/tasks.rb +++ b/lib/tomo/plugins/core/tasks.rb @@ -1,5 +1,5 @@ -module Jam::Plugins::Core - class Tasks < Jam::TaskLibrary +module Tomo::Plugins::Core + class Tasks < Tomo::TaskLibrary def create_shared_directories return if linked_dirs.empty? diff --git a/lib/jam/plugins/git/helpers.rb b/lib/tomo/plugins/git/helpers.rb similarity index 84% rename from lib/jam/plugins/git/helpers.rb rename to lib/tomo/plugins/git/helpers.rb index 42c54987..3a05cf82 100644 --- a/lib/jam/plugins/git/helpers.rb +++ b/lib/tomo/plugins/git/helpers.rb @@ -1,4 +1,4 @@ -module Jam::Plugins::Git +module Tomo::Plugins::Git module Helpers def git(*args, **opts) env(settings[:git_env]) do diff --git a/lib/jam/plugins/git/plugin.rb b/lib/tomo/plugins/git/plugin.rb similarity index 75% rename from lib/jam/plugins/git/plugin.rb rename to lib/tomo/plugins/git/plugin.rb index 764ce864..e034a2d5 100644 --- a/lib/jam/plugins/git/plugin.rb +++ b/lib/tomo/plugins/git/plugin.rb @@ -1,12 +1,12 @@ require_relative "helpers" require_relative "tasks" -module Jam::Plugins::Git +module Tomo::Plugins::Git module Plugin - extend Jam::Plugin + extend Tomo::Plugin - helpers Jam::Plugins::Git::Helpers - tasks Jam::Plugins::Git::Tasks + helpers Tomo::Plugins::Git::Helpers + tasks Tomo::Plugins::Git::Tasks # rubocop:disable Metrics/LineLength defaults git_branch: "master", diff --git a/lib/jam/plugins/git/tasks.rb b/lib/tomo/plugins/git/tasks.rb similarity index 94% rename from lib/jam/plugins/git/tasks.rb rename to lib/tomo/plugins/git/tasks.rb index 134019fc..7cff45cc 100644 --- a/lib/jam/plugins/git/tasks.rb +++ b/lib/tomo/plugins/git/tasks.rb @@ -1,7 +1,7 @@ require "shellwords" -module Jam::Plugins::Git - class Tasks < Jam::TaskLibrary +module Tomo::Plugins::Git + class Tasks < Tomo::TaskLibrary # rubocop:disable Metrics/AbcSize def clone return if remote.directory?(paths.git_repo) diff --git a/lib/jam/plugins/rails/helpers.rb b/lib/tomo/plugins/rails/helpers.rb similarity index 87% rename from lib/jam/plugins/rails/helpers.rb rename to lib/tomo/plugins/rails/helpers.rb index 5c9bd009..3f44cabd 100644 --- a/lib/jam/plugins/rails/helpers.rb +++ b/lib/tomo/plugins/rails/helpers.rb @@ -1,4 +1,4 @@ -module Jam::Plugins::Rails +module Tomo::Plugins::Rails module Helpers def rails(*args, **opts) bundle("exec", "rails", *args, **opts) diff --git a/lib/tomo/plugins/rails/plugin.rb b/lib/tomo/plugins/rails/plugin.rb new file mode 100644 index 00000000..5ec1afa7 --- /dev/null +++ b/lib/tomo/plugins/rails/plugin.rb @@ -0,0 +1,11 @@ +require_relative "helpers" +require_relative "tasks" + +module Tomo::Plugins::Rails + module Plugin + extend Tomo::Plugin + + helpers Tomo::Plugins::Rails::Helpers + tasks Tomo::Plugins::Rails::Tasks + end +end diff --git a/lib/jam/plugins/rails/tasks.rb b/lib/tomo/plugins/rails/tasks.rb similarity index 87% rename from lib/jam/plugins/rails/tasks.rb rename to lib/tomo/plugins/rails/tasks.rb index f10269bd..a1908ca2 100644 --- a/lib/jam/plugins/rails/tasks.rb +++ b/lib/tomo/plugins/rails/tasks.rb @@ -1,5 +1,5 @@ -module Jam::Plugins::Rails - class Tasks < Jam::TaskLibrary +module Tomo::Plugins::Rails + class Tasks < Tomo::TaskLibrary def assets_precompile remote.rake("assets:precompile") end diff --git a/lib/jam/project.rb b/lib/tomo/project.rb similarity index 84% rename from lib/jam/project.rb rename to lib/tomo/project.rb index b4da81da..a571f1e5 100644 --- a/lib/jam/project.rb +++ b/lib/tomo/project.rb @@ -1,11 +1,11 @@ require "forwardable" -module Jam +module Tomo class Project extend Forwardable - autoload :NotFoundError, "jam/project/not_found_error" - autoload :Specification, "jam/project/specification" + autoload :NotFoundError, "tomo/project/not_found_error" + autoload :Specification, "tomo/project/specification" def_delegators :framework, :settings, :tasks diff --git a/lib/jam/project/not_found_error.rb b/lib/tomo/project/not_found_error.rb similarity index 66% rename from lib/jam/project/not_found_error.rb rename to lib/tomo/project/not_found_error.rb index f728cddc..d0e3bb8e 100644 --- a/lib/jam/project/not_found_error.rb +++ b/lib/tomo/project/not_found_error.rb @@ -1,6 +1,6 @@ -module Jam +module Tomo class Project - class NotFoundError < Jam::Error + class NotFoundError < Tomo::Error attr_accessor :path def to_console @@ -8,7 +8,7 @@ def to_console A #{yellow(path)} configuration file is required to run this command. Are you in the right directory? - To create a new #{yellow(path)} file, run #{blue('jam init')}. + To create a new #{yellow(path)} file, run #{blue('tomo init')}. ERROR end end diff --git a/lib/jam/project/specification.rb b/lib/tomo/project/specification.rb similarity index 97% rename from lib/jam/project/specification.rb rename to lib/tomo/project/specification.rb index 7fdb7261..d9a91f4b 100644 --- a/lib/jam/project/specification.rb +++ b/lib/tomo/project/specification.rb @@ -1,12 +1,12 @@ require "json" -module Jam +module Tomo class Project class Specification def self.from_json(path) NotFoundError.raise_with(path: path) unless File.file?(path) - Jam.logger.debug("Loading project from #{path.inspect}") + Tomo.logger.debug("Loading project from #{path.inspect}") new(JSON.parse(IO.read(path))) end diff --git a/lib/jam/remote.rb b/lib/tomo/remote.rb similarity index 97% rename from lib/jam/remote.rb rename to lib/tomo/remote.rb index 51d1e828..3bb7ec97 100644 --- a/lib/jam/remote.rb +++ b/lib/tomo/remote.rb @@ -1,6 +1,6 @@ require "forwardable" -module Jam +module Tomo class Remote extend Forwardable def_delegators :ssh, :close, :host @@ -32,7 +32,7 @@ def run(*command, attach: false, default_chdir: nil, **command_opts) attr_reader :framework, :ssh, :shell_builder def logger - Jam.logger + Tomo.logger end def remote diff --git a/lib/jam/result.rb b/lib/tomo/result.rb similarity index 96% rename from lib/jam/result.rb rename to lib/tomo/result.rb index eb61ffc7..4778e919 100644 --- a/lib/jam/result.rb +++ b/lib/tomo/result.rb @@ -1,4 +1,4 @@ -module Jam +module Tomo class Result attr_reader :stdout, :stderr, :exit_status diff --git a/lib/jam/script.rb b/lib/tomo/script.rb similarity index 98% rename from lib/jam/script.rb rename to lib/tomo/script.rb index 5b1decca..788227d2 100644 --- a/lib/jam/script.rb +++ b/lib/tomo/script.rb @@ -1,4 +1,4 @@ -module Jam +module Tomo class Script attr_reader :script diff --git a/lib/jam/shell_builder.rb b/lib/tomo/shell_builder.rb similarity index 99% rename from lib/jam/shell_builder.rb rename to lib/tomo/shell_builder.rb index 59fa0112..ee6e820d 100644 --- a/lib/jam/shell_builder.rb +++ b/lib/tomo/shell_builder.rb @@ -1,6 +1,6 @@ require "shellwords" -module Jam +module Tomo class ShellBuilder def initialize @env = {} diff --git a/lib/tomo/ssh.rb b/lib/tomo/ssh.rb new file mode 100644 index 00000000..6e71b548 --- /dev/null +++ b/lib/tomo/ssh.rb @@ -0,0 +1,27 @@ +module Tomo + module SSH + autoload :ChildProcess, "tomo/ssh/child_process" + autoload :Connection, "tomo/ssh/connection" + autoload :ConnectionValidator, "tomo/ssh/connection_validator" + autoload :ConnectionError, "tomo/ssh/connection_error" + autoload :Error, "tomo/ssh/error" + autoload :ExecutableError, "tomo/ssh/executable_error" + autoload :Options, "tomo/ssh/options" + autoload :PermissionError, "tomo/ssh/permission_error" + autoload :ScriptError, "tomo/ssh/script_error" + autoload :UnknownError, "tomo/ssh/unknown_error" + autoload :UnsupportedVersionError, "tomo/ssh/unsupported_version_error" + + def self.connect(host:, options:) + Tomo.logger.connect(host) + + conn = Connection.new(host, options) + validator = ConnectionValidator.new(options.executable, conn) + validator.assert_valid_executable! + validator.assert_valid_connection! + validator.dump_env if Tomo.debug? + + conn + end + end +end diff --git a/lib/jam/ssh/child_process.rb b/lib/tomo/ssh/child_process.rb similarity index 95% rename from lib/jam/ssh/child_process.rb rename to lib/tomo/ssh/child_process.rb index 287a4d9e..9de1271e 100644 --- a/lib/jam/ssh/child_process.rb +++ b/lib/tomo/ssh/child_process.rb @@ -1,7 +1,7 @@ require "open3" require "shellwords" -module Jam +module Tomo module SSH class ChildProcess def self.execute(*command, on_data: ->(data) {}) @@ -15,7 +15,7 @@ def initialize(*command, on_data:) @on_data = on_data @stdout_buffer = StringIO.new @stderr_buffer = StringIO.new - Jam.logger.debug command.map(&:shellescape).join(" ") + Tomo.logger.debug command.map(&:shellescape).join(" ") end def wait_for_exit diff --git a/lib/jam/ssh/connection.rb b/lib/tomo/ssh/connection.rb similarity index 90% rename from lib/jam/ssh/connection.rb rename to lib/tomo/ssh/connection.rb index 7884d05d..17461f85 100644 --- a/lib/jam/ssh/connection.rb +++ b/lib/tomo/ssh/connection.rb @@ -4,7 +4,7 @@ # TODO: register at_exit to call #close -module Jam +module Tomo module SSH class Connection attr_reader :host @@ -17,7 +17,7 @@ def initialize(host, options) def ssh_exec(script) ssh_args = build_args(script) logger.script_start(script) - Jam.logger.debug ssh_args.map(&:shellescape).join(" ") + Tomo.logger.debug ssh_args.map(&:shellescape).join(" ") Process.exec(*ssh_args) end @@ -45,7 +45,7 @@ def close attr_reader :options def logger - Jam.logger + Tomo.logger end def build_args(script, verbose=false) @@ -55,7 +55,7 @@ def build_args(script, verbose=false) def control_path @control_path ||= begin token = SecureRandom.hex(8) - File.join(Dir.tmpdir, "jam_ssh_#{token}") + File.join(Dir.tmpdir, "tomo_ssh_#{token}") end end diff --git a/lib/jam/ssh/connection_error.rb b/lib/tomo/ssh/connection_error.rb similarity index 96% rename from lib/jam/ssh/connection_error.rb rename to lib/tomo/ssh/connection_error.rb index c5f971bd..3af73aec 100644 --- a/lib/jam/ssh/connection_error.rb +++ b/lib/tomo/ssh/connection_error.rb @@ -1,4 +1,4 @@ -module Jam +module Tomo module SSH class ConnectionError < Error def to_console diff --git a/lib/jam/ssh/connection_validator.rb b/lib/tomo/ssh/connection_validator.rb similarity index 89% rename from lib/jam/ssh/connection_validator.rb rename to lib/tomo/ssh/connection_validator.rb index 706c5594..4fa14cc0 100644 --- a/lib/jam/ssh/connection_validator.rb +++ b/lib/tomo/ssh/connection_validator.rb @@ -1,6 +1,6 @@ require "forwardable" -module Jam +module Tomo module SSH class ConnectionValidator MINIMUM_OPENSSH_VERSION = 7.6 @@ -20,7 +20,7 @@ def assert_valid_executable! handle_bad_executable(error) end - Jam.logger.debug(result.output) + Tomo.logger.debug(result.output) return if result.success? && supported?(result.output) raise_unsupported_version(result.output) @@ -29,9 +29,9 @@ def assert_valid_executable! def assert_valid_connection! script = Script.new( "echo hi", - silent: !Jam.debug?, echo: false, raise_on_error: false + silent: !Tomo.debug?, echo: false, raise_on_error: false ) - res = connection.ssh_subprocess(script, verbose: Jam.debug?) + res = connection.ssh_subprocess(script, verbose: Tomo.debug?) raise_connection_failure(res) if res.exit_status == 255 raise_unknown_error(res) if res.failure? || res.stdout.chomp != "hi" end @@ -39,7 +39,7 @@ def assert_valid_connection! def dump_env script = Script.new("env", silent: true, echo: false) res = connection.ssh_subprocess(script) - Jam.logger.debug("#{host} environment:\n#{res.stdout.strip}") + Tomo.logger.debug("#{host} environment:\n#{res.stdout.strip}") end private diff --git a/lib/jam/ssh/error.rb b/lib/tomo/ssh/error.rb similarity index 78% rename from lib/jam/ssh/error.rb rename to lib/tomo/ssh/error.rb index 8da3373f..a63394c8 100644 --- a/lib/jam/ssh/error.rb +++ b/lib/tomo/ssh/error.rb @@ -1,6 +1,6 @@ -module Jam +module Tomo module SSH - class Error < Jam::Error + class Error < Tomo::Error attr_accessor :host def to_console diff --git a/lib/jam/ssh/executable_error.rb b/lib/tomo/ssh/executable_error.rb similarity index 97% rename from lib/jam/ssh/executable_error.rb rename to lib/tomo/ssh/executable_error.rb index 72c26ec3..f61a6eff 100644 --- a/lib/jam/ssh/executable_error.rb +++ b/lib/tomo/ssh/executable_error.rb @@ -1,4 +1,4 @@ -module Jam +module Tomo module SSH class ExecutableError < Error attr_accessor :executable diff --git a/lib/jam/ssh/options.rb b/lib/tomo/ssh/options.rb similarity index 99% rename from lib/jam/ssh/options.rb rename to lib/tomo/ssh/options.rb index f9cdf9d3..376d320d 100644 --- a/lib/jam/ssh/options.rb +++ b/lib/tomo/ssh/options.rb @@ -1,4 +1,4 @@ -module Jam +module Tomo module SSH class Options attr_reader :executable diff --git a/lib/jam/ssh/permission_error.rb b/lib/tomo/ssh/permission_error.rb similarity index 97% rename from lib/jam/ssh/permission_error.rb rename to lib/tomo/ssh/permission_error.rb index fa12943e..fe67d8f9 100644 --- a/lib/jam/ssh/permission_error.rb +++ b/lib/tomo/ssh/permission_error.rb @@ -1,4 +1,4 @@ -module Jam +module Tomo module SSH class PermissionError < Error def to_console diff --git a/lib/jam/ssh/script_error.rb b/lib/tomo/ssh/script_error.rb similarity index 97% rename from lib/jam/ssh/script_error.rb rename to lib/tomo/ssh/script_error.rb index d421b432..3af5a4ed 100644 --- a/lib/jam/ssh/script_error.rb +++ b/lib/tomo/ssh/script_error.rb @@ -1,6 +1,6 @@ require "shellwords" -module Jam +module Tomo module SSH class ScriptError < Error attr_accessor :result, :script, :ssh_args diff --git a/lib/jam/ssh/unknown_error.rb b/lib/tomo/ssh/unknown_error.rb similarity index 95% rename from lib/jam/ssh/unknown_error.rb rename to lib/tomo/ssh/unknown_error.rb index 7c07140d..154825ae 100644 --- a/lib/jam/ssh/unknown_error.rb +++ b/lib/tomo/ssh/unknown_error.rb @@ -1,4 +1,4 @@ -module Jam +module Tomo module SSH class UnknownError < Error def to_console diff --git a/lib/jam/ssh/unsupported_version_error.rb b/lib/tomo/ssh/unsupported_version_error.rb similarity index 96% rename from lib/jam/ssh/unsupported_version_error.rb rename to lib/tomo/ssh/unsupported_version_error.rb index b17d546f..64a85b17 100644 --- a/lib/jam/ssh/unsupported_version_error.rb +++ b/lib/tomo/ssh/unsupported_version_error.rb @@ -1,4 +1,4 @@ -module Jam +module Tomo module SSH class UnsupportedVersionError < Error attr_accessor :command, :expected_version diff --git a/lib/jam/task_library.rb b/lib/tomo/task_library.rb similarity index 94% rename from lib/jam/task_library.rb rename to lib/tomo/task_library.rb index 1b841624..edf68e62 100644 --- a/lib/jam/task_library.rb +++ b/lib/tomo/task_library.rb @@ -1,6 +1,6 @@ require "forwardable" -module Jam +module Tomo class TaskLibrary extend Forwardable @@ -21,7 +21,7 @@ def initialize(framework) attr_reader :framework def logger - Jam.logger + Tomo.logger end def remote diff --git a/lib/jam/templates/project.json b/lib/tomo/templates/project.json similarity index 100% rename from lib/jam/templates/project.json rename to lib/tomo/templates/project.json diff --git a/lib/jam/version.rb b/lib/tomo/version.rb similarity index 72% rename from lib/jam/version.rb rename to lib/tomo/version.rb index 65cb80cf..4b9204d2 100644 --- a/lib/jam/version.rb +++ b/lib/tomo/version.rb @@ -1,3 +1,3 @@ -module Jam +module Tomo VERSION = "0.1.0".freeze end diff --git a/test/test_helper.rb b/test/test_helper.rb index 6b48c4f0..29ec466a 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,7 +1,7 @@ $LOAD_PATH.unshift File.expand_path("../lib", __dir__) -require "jam" +require "tomo" -Jam::Colors.disable +Tomo::Colors.disable require "minitest/autorun" Dir[File.expand_path("support/**/*.rb", __dir__)].each { |rb| require(rb) } diff --git a/test/jam_test.rb b/test/tomo_test.rb similarity index 53% rename from test/jam_test.rb rename to test/tomo_test.rb index 767aa180..46ada15c 100644 --- a/test/jam_test.rb +++ b/test/tomo_test.rb @@ -1,7 +1,7 @@ require "test_helper" -class JamTest < Minitest::Test +class TomoTest < Minitest::Test def test_that_it_has_a_version_number - refute_nil ::Jam::VERSION + refute_nil ::Tomo::VERSION end end diff --git a/jam.gemspec b/tomo.gemspec similarity index 90% rename from jam.gemspec rename to tomo.gemspec index 84c9f07f..202b4364 100644 --- a/jam.gemspec +++ b/tomo.gemspec @@ -1,15 +1,15 @@ lib = File.expand_path("lib", __dir__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) -require "jam/version" +require "tomo/version" Gem::Specification.new do |spec| - spec.name = "jam" - spec.version = Jam::VERSION + spec.name = "tomo" + spec.version = Tomo::VERSION spec.authors = ["Matt Brictson"] spec.email = ["opensource@mattbrictson.com"] spec.summary = "A simple SSH-based deployment tool, built for Rails" - spec.homepage = "https://github.com/mattbrictson/jam" + spec.homepage = "https://github.com/mattbrictson/tomo" spec.license = "MIT" if spec.respond_to?(:metadata)