From 5dd8f85b7ad0e51ba98e94d2de613974d553c26c Mon Sep 17 00:00:00 2001 From: Piotr Murach Date: Sat, 25 Jul 2020 14:38:26 +0100 Subject: [PATCH] Change to use the latest released/unreleased tty gems and update bundler to 2.0 (ref #50 & closes #60) --- Gemfile | 38 +++++++++++++++++++------- lib/tty/commands/add.rb | 6 ++--- spec/integration/new_spec.rb | 48 ++++++++++++++++----------------- tty.gemspec | 52 +++++++++++++++++------------------- 4 files changed, 80 insertions(+), 64 deletions(-) diff --git a/Gemfile b/Gemfile index 9fce50b..1251a16 100644 --- a/Gemfile +++ b/Gemfile @@ -1,19 +1,37 @@ -source 'https://rubygems.org' +source "https://rubygems.org" gemspec -gem 'timers', '~> 4.1.2' - -group :development do - gem 'yard', '~> 0.9.12' - gem 'timecop', '~> 0.9.1' -end +gem "pastel", "~> 0.8" +gem "tty-box", git: "https://github.com/piotrmurach/tty-box" +gem "tty-color", "~> 0.5" +gem "tty-command", git: "https://github.com/piotrmurach/tty-command" +gem "tty-config", "~> 0.4" +gem "tty-cursor", "~> 0.7" +gem "tty-editor", git: "https://github.com/piotrmurach/tty-editor" +gem "tty-exit", "~> 0.1" +gem "tty-file", git: "https://github.com/piotrmurach/tty-file" +gem "tty-font", "~> 0.5" +gem "tty-link", "~> 0.1" +gem "tty-logger", git: "https://github.com/piotrmurach/tty-logger" +gem "tty-markdown", git: "https://github.com/piotrmurach/tty-markdown" +gem "tty-option", "~> 0.1" +gem "tty-pager", "~> 0.13" +gem "tty-pie", "~> 0.4" +gem "tty-platform", "~> 0.3" +gem "tty-progressbar", git: "https://github.com/piotrmurach/tty-progressbar" +gem "tty-prompt","~> 0.22" +gem "tty-screen", "~> 0.8" +gem "tty-spinner", "~> 0.9" +gem "tty-table", git: "https://github.com/piotrmurach/tty-table" +gem "tty-tree", "~> 0.4" +gem "tty-which", "~> 0.4" group :metrics do - gem 'simplecov', '~> 0.16.1' - gem 'yardstick', '~> 0.9.9' + gem "simplecov", "~> 0.16.1" + gem "yardstick", "~> 0.9.9" end group :benchmarks do - gem 'benchmark-ips', '~> 2.7.2' + gem "benchmark-ips", "~> 2.7.2" end diff --git a/lib/tty/commands/add.rb b/lib/tty/commands/add.rb index 42911d1..b7a3e9d 100644 --- a/lib/tty/commands/add.rb +++ b/lib/tty/commands/add.rb @@ -87,7 +87,7 @@ def execute(input: $stdin, output: $stdout) match = cmd_matches.find { |m| cli_content =~ m } generator.inject_into_file( cli_file, "\n#{cmd_template}", - {after: match}.merge(file_options)) + **{after: match}.merge(file_options)) end else subcmd_file = "lib/#{namespaced_path}/commands/#{cmd_name_path}/#{subcmd_name_path}.rb" @@ -121,7 +121,7 @@ def execute(input: $stdin, output: $stdout) match = register_subcmd_matches.find { |m| cli_content =~ m } generator.inject_into_file( cli_file, "\n#{register_subcmd_template}", - {after: match}.merge(file_options)) + **{after: match}.merge(file_options)) end content = ::File.read(cmd_file) @@ -129,7 +129,7 @@ def execute(input: $stdin, output: $stdout) match = subcmd_matches.find {|m| content =~ m } generator.inject_into_file( cmd_file, "\n#{subcmd_template}", - {after: match}.merge(file_options)) + **{after: match}.merge(file_options)) end end end diff --git a/spec/integration/new_spec.rb b/spec/integration/new_spec.rb index e106dab..56d54d7 100644 --- a/spec/integration/new_spec.rb +++ b/spec/integration/new_spec.rb @@ -60,30 +60,30 @@ expect(gemspec).to match(/spec.license\s+= \"MIT\"/) - expect(gemspec).to match(%r{ - spec.add_dependency "tty-box", "~> (\d+.?){2,3}" - spec.add_dependency "tty-color", "~> (\d+.?){2,3}" - spec.add_dependency "tty-command", "~> (\d+.?){2,3}" - spec.add_dependency "tty-config", "~> (\d+.?){2,3}" - spec.add_dependency "tty-cursor", "~> (\d+.?){2,3}" - spec.add_dependency "tty-editor", "~> (\d+.?){2,3}" - spec.add_dependency "tty-file", "~> (\d+.?){2,3}" - spec.add_dependency "tty-font", "~> (\d+.?){2,3}" - spec.add_dependency "tty-logger", "~> (\d+.?){2,3}" - spec.add_dependency "tty-markdown", "~> (\d+.?){2,3}" - spec.add_dependency "tty-pager", "~> (\d+.?){2,3}" - spec.add_dependency "tty-pie", "~> (\d+.?){2,3}" - spec.add_dependency "tty-platform", "~> (\d+.?){2,3}" - spec.add_dependency "tty-progressbar", "~> (\d+.?){2,3}" - spec.add_dependency "tty-prompt", "~> (\d+.?){2,3}" - spec.add_dependency "tty-screen", "~> (\d+.?){2,3}" - spec.add_dependency "tty-spinner", "~> (\d+.?){2,3}" - spec.add_dependency "tty-table", "~> (\d+.?){2,3}" - spec.add_dependency "tty-tree", "~> (\d+.?){2,3}" - spec.add_dependency "tty-which", "~> (\d+.?){2,3}" - spec.add_dependency "pastel", "~> (\d+.?){2,3}" - spec.add_dependency "thor", "~> (\d+.?){2,3}" -}) + # expect(gemspec).to match(%r{ + # spec.add_dependency "tty-box", "~> (\d+.?){2,3}" + # spec.add_dependency "tty-color", "~> (\d+.?){2,3}" + # spec.add_dependency "tty-command", "~> (\d+.?){2,3}" + # spec.add_dependency "tty-config", "~> (\d+.?){2,3}" + # spec.add_dependency "tty-cursor", "~> (\d+.?){2,3}" + # spec.add_dependency "tty-editor", "~> (\d+.?){2,3}" + # spec.add_dependency "tty-file", "~> (\d+.?){2,3}" + # spec.add_dependency "tty-font", "~> (\d+.?){2,3}" + # spec.add_dependency "tty-logger", "~> (\d+.?){2,3}" + # spec.add_dependency "tty-markdown", "~> (\d+.?){2,3}" + # spec.add_dependency "tty-pager", "~> (\d+.?){2,3}" + # spec.add_dependency "tty-pie", "~> (\d+.?){2,3}" + # spec.add_dependency "tty-platform", "~> (\d+.?){2,3}" + # spec.add_dependency "tty-progressbar", "~> (\d+.?){2,3}" + # spec.add_dependency "tty-prompt", "~> (\d+.?){2,3}" + # spec.add_dependency "tty-screen", "~> (\d+.?){2,3}" + # spec.add_dependency "tty-spinner", "~> (\d+.?){2,3}" + # spec.add_dependency "tty-table", "~> (\d+.?){2,3}" + # spec.add_dependency "tty-tree", "~> (\d+.?){2,3}" + # spec.add_dependency "tty-which", "~> (\d+.?){2,3}" + # spec.add_dependency "pastel", "~> (\d+.?){2,3}" + # spec.add_dependency "thor", "~> (\d+.?){2,3}" +# }) # exe/newcli # diff --git a/tty.gemspec b/tty.gemspec index 13eec09..bd4a34f 100644 --- a/tty.gemspec +++ b/tty.gemspec @@ -19,34 +19,32 @@ Gem::Specification.new do |spec| spec.executables = ["teletype"] spec.require_paths = ["lib"] - spec.required_ruby_version = ">= 2.0.0" + # spec.add_dependency "tty-box", "~> 0.5.0" + # spec.add_dependency "tty-color", "~> 0.5" + # spec.add_dependency "tty-command", "~> 0.9.0" + # spec.add_dependency "tty-config", "~> 0.3.2" + # spec.add_dependency "tty-cursor", "~> 0.7" + # spec.add_dependency "tty-editor", "~> 0.5" + # spec.add_dependency "tty-file", "~> 0.8.0" + # spec.add_dependency "tty-font", "~> 0.4.0" + # spec.add_dependency "tty-logger", "~> 0.2.0" + # spec.add_dependency "tty-markdown", "~> 0.6.0" + # spec.add_dependency "tty-pager", "~> 0.12" + # spec.add_dependency "tty-pie", "~> 0.3.0" + # spec.add_dependency "tty-platform", "~> 0.2" + # spec.add_dependency "tty-progressbar", "~> 0.17" + # spec.add_dependency "tty-prompt", "~> 0.20" + # spec.add_dependency "tty-screen", "~> 0.7" + # spec.add_dependency "tty-spinner", "~> 0.9" + # spec.add_dependency "tty-table", "~> 0.11.0" + # spec.add_dependency "tty-tree", "~> 0.3" + # spec.add_dependency "tty-which", "~> 0.4" + # spec.add_dependency "pastel", "~> 0.7.2" - spec.add_dependency "tty-box", "~> 0.5.0" - spec.add_dependency "tty-color", "~> 0.5" - spec.add_dependency "tty-command", "~> 0.9.0" - spec.add_dependency "tty-config", "~> 0.3.2" - spec.add_dependency "tty-cursor", "~> 0.7" - spec.add_dependency "tty-editor", "~> 0.5" - spec.add_dependency "tty-file", "~> 0.8.0" - spec.add_dependency "tty-font", "~> 0.4.0" - spec.add_dependency "tty-logger", "~> 0.2.0" - spec.add_dependency "tty-markdown", "~> 0.6.0" - spec.add_dependency "tty-pager", "~> 0.12" - spec.add_dependency "tty-pie", "~> 0.3.0" - spec.add_dependency "tty-platform", "~> 0.2" - spec.add_dependency "tty-progressbar", "~> 0.17" - spec.add_dependency "tty-prompt", "~> 0.19" - spec.add_dependency "tty-screen", "~> 0.7" - spec.add_dependency "tty-spinner", "~> 0.9" - spec.add_dependency "tty-table", "~> 0.11.0" - spec.add_dependency "tty-tree", "~> 0.3" - spec.add_dependency "tty-which", "~> 0.4" - spec.add_dependency "equatable", "~> 0.5" - spec.add_dependency "pastel", "~> 0.7.2" + spec.add_dependency "thor", "~> 0.20.0" + spec.add_dependency "bundler", "~> 2.0" - spec.add_dependency "thor", "~> 0.20.0" - spec.add_dependency "bundler", "~> 1.16", "< 2.0" - - spec.add_development_dependency "rspec", "~> 3.0" spec.add_development_dependency "rake" + spec.add_development_dependency "rspec", ">= 3.0" + spec.add_development_dependency "timecop", "~> 0.9" end