install_gem_local 0.1.11 → 0.1.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cf8905403eccc61cb1cd73a12b47bac80b7c3ea2e6219754b2d36df9123cb9c0
4
- data.tar.gz: a10e794837d9ca1fed06f6cc1cd94fdb27254fab2d68767f7f3d120496fffd67
3
+ metadata.gz: ef6d5c9baaa122694989b32f230042e5969ea7040e20e3bd91ab5f46c359f8b4
4
+ data.tar.gz: 31b2af9ec13cb03652fd366e1c1b951db9a29412beb6031add5973c9579cd107
5
5
  SHA512:
6
- metadata.gz: 75261c8ff5ddae2a27aa61554edb958764940d7895d43446a0675cce8f3855bbcc733f90507744a1b291151a081a61939c28b4c89ddb54d8c2accc5af2998030
7
- data.tar.gz: 9c078824c0102e1b96f2ca414ad7e4b6c02ecb4054b9532ea41e668f7603c7f829f8c951d6e3399cecef922703247fc0ce30ebfd39c7432c1b022a451fbbbbf8
6
+ metadata.gz: 4c6eaad72ce368ee98d5a309273c305cec27c86409c107520def518d39f4333e8db9ae5ec67081d565170e7174a7b5e96de4725f2cc364f064444fd1bb76f35a
7
+ data.tar.gz: 78fb13ad2772b779338351052ee81007d0e78ba3f8633f1aa4f757a5fa12bd53f5d234b5abf8820eebf181d0be6f3a2896907ad06d77805582588fe7898a6e23
data/Gemfile CHANGED
@@ -8,5 +8,4 @@ gemspec
8
8
  # cops
9
9
  gem 'rubocop'
10
10
 
11
- gem 'i18n'
12
- gem 'tty-command'
11
+ gem 'i18n'
data/Gemfile.lock CHANGED
@@ -1,10 +1,11 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- install_gem_local (0.1.11)
4
+ install_gem_local (0.1.12)
5
5
  awesome_print (~> 1.8, >= 1.8.0)
6
6
  downup (~> 0.11, >= 0.11.7)
7
7
  thor (~> 0.20, >= 0.20.3)
8
+ tty-command (~> 0.8, >= 0.8.2)
8
9
 
9
10
  GEM
10
11
  remote: https://rubygems.org/
@@ -63,7 +64,6 @@ DEPENDENCIES
63
64
  rake (~> 10.0)
64
65
  rspec (~> 3.0)
65
66
  rubocop
66
- tty-command
67
67
 
68
68
  BUNDLED WITH
69
69
  2.0.1
@@ -0,0 +1,26 @@
1
+ en:
2
+ gem_not_exist: 'Gem not exist'
3
+ gemspec_not_exist: 'Gemspec not exist'
4
+ choose_copy_folder: 'Choose Folder to Copy'
5
+ choose_version: 'Choose Version'
6
+ something_wrong: 'Something Wrong! Try again!'
7
+ action:
8
+ remove_gem:
9
+ puts_line: 'Remove Gem'
10
+ display: 'Remove old version'
11
+ build_gem:
12
+ puts_line: 'Build Gem'
13
+ display: 'Build new version'
14
+ install_gem:
15
+ puts_line: 'Install Gem'
16
+ display: 'Install new version'
17
+ copy_gem:
18
+ puts_line: 'Copy Gem'
19
+ display: 'Copy gem to folder'
20
+ push_gem:
21
+ puts_line: 'Push Gem'
22
+ display: 'Build the latest version and push the gem'
23
+ till_install:
24
+ display: 'Remove old version, build and install the new version'
25
+ till_copy:
26
+ display: 'Remove old version, build, install and copy the new version'
@@ -35,5 +35,5 @@ Gem::Specification.new do |spec|
35
35
  # CLI
36
36
  spec.add_dependency 'thor', '~> 0.20', '>= 0.20.3'
37
37
  # Execute shell commands with pretty output
38
- #spec.add_dependency 'tty-command', '~> 0.8', '>= 0.8.2'
38
+ spec.add_dependency 'tty-command', '~> 0.8', '>= 0.8.2'
39
39
  end
@@ -4,6 +4,7 @@ require 'thor'
4
4
  require 'downup'
5
5
  require 'awesome_print'
6
6
  require 'tty-command'
7
+ require 'i18n'
7
8
 
8
9
  require 'install_gem_local/action/install_gem'
9
10
  require 'install_gem_local/action/build_gem'
@@ -11,6 +12,7 @@ require 'install_gem_local/action/remove_gem'
11
12
  require 'install_gem_local/action/copy_gem'
12
13
  require 'install_gem_local/action/push_gem'
13
14
  Dir[File.join(File.expand_path(__dir__), 'install_gem_local', '**/*.rb')].each { |f| require f }
15
+ I18n.load_path << Dir[File.expand_path("config/locales") + "/*.yml"]
14
16
 
15
17
  module InstallGemLocal
16
18
  class App < Thor
@@ -39,7 +39,7 @@ module InstallGemLocal
39
39
  end
40
40
  options['/'] = { 'value' => 'exit', 'display' => 'Exit' }
41
41
  InstallGemLocal::Helper.prompt_options(
42
- flash_message: InstallGemLocal::Helper.flash_message(title: 'Choose which version'),
42
+ flash_message: InstallGemLocal::Helper.flash_message(title: I18n.t(:choose_version)),
43
43
  options: options
44
44
  )
45
45
  end
@@ -4,10 +4,10 @@ module InstallGemLocal
4
4
  module BuildGem
5
5
  def build_gem
6
6
  puts ''
7
- puts 'Build Gem'.green
7
+ puts I18n.t('action.build_gem.puts_line').green
8
8
  file = tty_command.run('find -type f -name "*.gemspec"')
9
9
  file_name = file.out.strip
10
- file_name.empty? ? ap('Gemspec not found') : tty_command.run("gem build #{file_name}")
10
+ file_name.empty? ? ap(I18n.t(:gemspec_not_exist)) : tty_command.run("gem build #{file_name}")
11
11
  end
12
12
  end
13
13
  end
@@ -11,14 +11,14 @@ module InstallGemLocal
11
11
  }
12
12
 
13
13
  InstallGemLocal::Helper.prompt_options(
14
- flash_message: InstallGemLocal::Helper.flash_message(title: 'Choose Folder To Copy'),
14
+ flash_message: InstallGemLocal::Helper.flash_message(title: I18n.t('choose_copy_folder')),
15
15
  options: options
16
16
  )
17
17
  end
18
18
 
19
19
  def copy_gem
20
20
  puts ''
21
- puts 'Copy Gem'.green
21
+ puts I18n.t('action.copy_gem.puts_line').green
22
22
  files_exists = file_names
23
23
 
24
24
  if files_exists.count > 1
@@ -26,7 +26,7 @@ module InstallGemLocal
26
26
  elsif files_exists.count == 1
27
27
  copy_file_to_path(files_exists.first)
28
28
  else
29
- ap 'Gem not exist'
29
+ ap I18n.t(:gem_not_exist)
30
30
  end
31
31
  end
32
32
 
@@ -4,14 +4,14 @@ module InstallGemLocal
4
4
  module InstallGem
5
5
  def install_gem
6
6
  puts ''
7
- puts 'Install Gem'.green
7
+ puts I18n.t('action.install_gem.puts_line').green
8
8
  files_exists = file_names
9
9
  if files_exists.count > 1
10
10
  install_gem_from_path(multiple_version_selection)
11
11
  elsif files_exists.count == 1
12
12
  install_gem_from_path(files_exists.first)
13
13
  else
14
- ap 'Gem not exist'
14
+ ap I18n.t(:gem_not_exist)
15
15
  end
16
16
  end
17
17
 
@@ -3,14 +3,14 @@ module InstallGemLocal
3
3
  def push_gem
4
4
  till_install
5
5
  puts ''
6
- puts 'Push Gem'.blue
6
+ puts I18n.t('action.push_gem.puts_line').blue
7
7
  files_exists = file_names
8
8
  if files_exists.count > 1
9
9
  push_gem_from_path(multiple_version_selection)
10
10
  elsif files_exists.count == 1
11
11
  push_gem_from_path(files_exists.first)
12
12
  else
13
- ap 'Gem not exist'
13
+ ap I18n.t(:gem_not_exist)
14
14
  end
15
15
  end
16
16
 
@@ -4,14 +4,14 @@ module InstallGemLocal
4
4
  module RemoveGem
5
5
  def remove_gem
6
6
  puts ''
7
- puts 'Remove Gem'.red
7
+ puts I18n.t('action.remove_gem.puts_line').red
8
8
  file_exists = file_names
9
9
  if file_exists.count > 1
10
10
  remove_file_from_path(multiple_version_selection(include_all: true))
11
11
  elsif file_exists.count == 1
12
12
  remove_file_from_path(file_exists.first)
13
13
  else
14
- ap 'Gem not exist'
14
+ ap I18n.t(:gem_not_exist)
15
15
  end
16
16
  end
17
17
 
@@ -12,14 +12,15 @@ module InstallGemLocal
12
12
  end
13
13
 
14
14
  def flash_message(title: "")
15
- message = <<-STR
16
- █████ ███████ █
17
- █ ██ █
18
- █ ██ █
19
- █ ██ ███ █
20
- █ ██ █ █
21
- █████ ███████ ███████ #{title}
22
- STR
15
+ # message = <<-STR
16
+ # █████ ███████ █
17
+ # █ ██ █
18
+ # █ ██ █
19
+ # █ ██ ███ █
20
+ # █ ██ █ █
21
+ # █████ ███████ ███████ #{title}
22
+ #STR
23
+ title
23
24
  end
24
25
 
25
26
  end
@@ -5,13 +5,13 @@ module InstallGemLocal
5
5
  class << self
6
6
  def start
7
7
  options = {
8
- 'a' => { 'value' => 'remove_gem', 'display' => 'Remove old version' },
9
- 'b' => { 'value' => 'build_gem', 'display' => 'Build new version' },
10
- 'c' => { 'value' => 'install_gem', 'display' => 'Install new version' },
11
- 'd' => { 'value' => 'copy_gem', 'display' => 'Copy gem to folder' },
12
- 'e' => { 'value' => 'push_gem', 'display' => 'Build the latest version and push the gem' },
13
- 'f' => { 'value' => 'till_install', 'display' => 'Remove old version, build and install the new version' },
14
- 'g' => { 'value' => 'till_copy', 'display' => 'Remove old version, build, install and copy the new version' },
8
+ 'a' => { 'value' => 'remove_gem', 'display' => I18n.t('action.remove_gem.display') },
9
+ 'b' => { 'value' => 'build_gem', 'display' => I18n.t('action.build_gem.display') },
10
+ 'c' => { 'value' => 'install_gem', 'display' => I18n.t('action.install_gem.display') },
11
+ 'd' => { 'value' => 'copy_gem', 'display' => I18n.t('action.copy_gem.display') },
12
+ 'e' => { 'value' => 'push_gem', 'display' => I18n.t('action.push_gem.display') },
13
+ 'f' => { 'value' => 'till_install', 'display' => I18n.t('action.till_install.display') },
14
+ 'g' => { 'value' => 'till_copy', 'display' => I18n.t('action.till_copy.display') },
15
15
  '/' => { 'value' => 'exit', 'display' => 'Exit' }
16
16
  }
17
17
 
@@ -27,7 +27,7 @@ module InstallGemLocal
27
27
 
28
28
  rescue StandardError => e
29
29
  ap e
30
- ap 'Something Wrong! Try again!'
30
+ ap I18n.t('something_wrong')
31
31
  end
32
32
  end
33
33
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module InstallGemLocal
4
- VERSION = '0.1.11'
4
+ VERSION = '0.1.12'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: install_gem_local
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.11
4
+ version: 0.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dhanabal T
@@ -112,6 +112,26 @@ dependencies:
112
112
  - - ">="
113
113
  - !ruby/object:Gem::Version
114
114
  version: 0.20.3
115
+ - !ruby/object:Gem::Dependency
116
+ name: tty-command
117
+ requirement: !ruby/object:Gem::Requirement
118
+ requirements:
119
+ - - "~>"
120
+ - !ruby/object:Gem::Version
121
+ version: '0.8'
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: 0.8.2
125
+ type: :runtime
126
+ prerelease: false
127
+ version_requirements: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '0.8'
132
+ - - ">="
133
+ - !ruby/object:Gem::Version
134
+ version: 0.8.2
115
135
  description: to build and install the gem in my local
116
136
  email:
117
137
  - vel.dhanabal@gmail.com
@@ -131,6 +151,7 @@ files:
131
151
  - Rakefile
132
152
  - bin/console
133
153
  - bin/setup
154
+ - config/locales/en.yml
134
155
  - exe/install_gem_local
135
156
  - install_gem_local.gemspec
136
157
  - lib/install_gem_local.rb