install_gem_local 0.1.7 → 0.1.8

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: '081168b3056269dc36e5c5fac7a2a64fdc9eb68293c0bdfa5b17d5fa602d0616'
4
- data.tar.gz: c3a240c5c47ac10f8573623e6ac9ecffccb5eaccbc9703f0efafc5dfb89c08fe
3
+ metadata.gz: b17335d3f9696c4f0199c80bfe216701b31469b3ab185ec9c161bc3864c8005c
4
+ data.tar.gz: 628161a99290d83f5495febf89efe1cdd202e5685c31357ad6ce729d0ea84f8f
5
5
  SHA512:
6
- metadata.gz: 58c611bcc732e1771ac6279f883438813e16889c88cfc0016f43ab9fa65394db4986d1641ea99a44b652f46aa7f7871cbeedd03f0304cc3901358c8c0fe9fe3b
7
- data.tar.gz: 06d07f339795760635085cb414fca9cf94b1a11f76843b76e3c36926377b4d71655422067a9a4d1b3789d1c830980a2607f56b07113381483810b539d07e4738
6
+ metadata.gz: 77f1ecc4b46e75c8f24f346aa2eabcb603f7d4da144a554c560ee14c882e74d9364aabc6ccc2de297950b2ac15f712bbe7a1d87141635e83031898283425db01
7
+ data.tar.gz: 2f8eb20694559f085e3bcabaa78e7e1ba043c8d41c772f8c1fe219f40109d350caf92555ad6ba28dfd023ccfbd00b0f5afa884c687d1818ab772041d33b5f88b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- install_gem_local (0.1.7)
4
+ install_gem_local (0.1.8)
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)
data/README.md CHANGED
@@ -1,9 +1,3 @@
1
- # InstallGem
2
-
3
- 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/install_gem`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
6
-
7
1
  ## Installation
8
2
 
9
3
  Add this line to your application's Gemfile:
@@ -18,11 +12,12 @@ And then execute:
18
12
 
19
13
  Or install it yourself as:
20
14
 
21
- $ gem install install_gem
15
+ $ gem install install_gem_local
22
16
 
23
17
  ## Usage
24
18
 
25
- TODO: Write usage instructions here
19
+ run install_gem_local
20
+ it will fetch you the options
26
21
 
27
22
  ## Development
28
23
 
@@ -23,7 +23,7 @@ module InstallGemLocal
23
23
  private
24
24
 
25
25
  def tty_command
26
- @tty_command ||= TTY::Command.new
26
+ @tty_command ||= TTY::Command.new(uuid: false, printer: :quiet)
27
27
  end
28
28
 
29
29
  def file_names
@@ -38,8 +38,10 @@ module InstallGemLocal
38
38
  options[('a'..'z').to_a[index]] = { 'value' => file_name, 'display' => file_name }
39
39
  end
40
40
  options['/'] = { 'value' => 'exit', 'display' => 'Exit' }
41
- Downup::Base.new(flash_message: 'Choose which version',
42
- options: options).prompt
41
+ InstallGemLocal::Helper.prompt_options(
42
+ flash_message: 'Choose which version',
43
+ options: options
44
+ )
43
45
  end
44
46
  end
45
47
  end
@@ -3,10 +3,10 @@
3
3
  module InstallGemLocal
4
4
  module BuildGem
5
5
  def build_gem
6
- puts '-----------------------------'
7
6
  puts ''
7
+ puts 'Build Gem'.green
8
8
  file = tty_command.run('find -type f -name "*.gemspec"')
9
- ap file_name = file.out.strip
9
+ file_name = file.out.strip
10
10
  file_name.empty? ? ap('Gemspec not found') : tty_command.run("gem build #{file_name}")
11
11
  end
12
12
  end
@@ -10,11 +10,15 @@ module InstallGemLocal
10
10
  '/' => { 'value' => 'exit', 'display' => 'Exit' }
11
11
  }
12
12
 
13
- Downup::Base.new(flash_message: 'Choose Folder To Copy',
14
- options: options).prompt
13
+ InstallGemLocal::Helper.prompt_options(
14
+ flash_message: 'Choose Folder To Copy',
15
+ options: options
16
+ )
15
17
  end
16
18
 
17
19
  def copy_gem
20
+ puts ''
21
+ puts 'Copy Gem'.green
18
22
  files_exists = file_names
19
23
 
20
24
  if files_exists.count > 1
@@ -3,8 +3,8 @@
3
3
  module InstallGemLocal
4
4
  module InstallGem
5
5
  def install_gem
6
- puts '-----------------------------'
7
6
  puts ''
7
+ puts 'Install Gem'.green
8
8
  files_exists = file_names
9
9
  if files_exists.count > 1
10
10
  install_gem_from_path(multiple_version_selection)
@@ -2,8 +2,8 @@ module InstallGemLocal
2
2
  module PushGem
3
3
  def push_gem
4
4
  build_gem
5
- puts '-----------------------------'
6
5
  puts ''
6
+ puts 'Push Gem'.blue
7
7
  files_exists = file_names
8
8
  if files_exists.count > 1
9
9
  push_gem_from_path(multiple_version_selection)
@@ -3,6 +3,8 @@
3
3
  module InstallGemLocal
4
4
  module RemoveGem
5
5
  def remove_gem
6
+ puts ''
7
+ puts 'Remove Gem'.red
6
8
  file_exists = file_names
7
9
  if file_exists.count > 1
8
10
  remove_file_from_path(multiple_version_selection(include_all: true))
@@ -0,0 +1,15 @@
1
+ module InstallGemLocal
2
+ class Helper
3
+ class << self
4
+ def prompt_options(options:, flash_message:, color: :green, selected_color: :bold, flash_color: :green)
5
+ Downup::Base.new(
6
+ flash_message: flash_message,
7
+ options: options,
8
+ default_color: color,
9
+ selected_color: selected_color,
10
+ flash_color: flash_color,
11
+ ).prompt
12
+ end
13
+ end
14
+ end
15
+ end
@@ -5,9 +5,9 @@ module InstallGemLocal
5
5
  class << self
6
6
  def start
7
7
  options = {
8
- 'a' => { 'value' => 'remove', 'display' => 'Remove old version' },
9
- 'b' => { 'value' => 'build', 'display' => 'Build new version' },
10
- 'c' => { 'value' => 'install', 'display' => 'Install new version' },
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
11
  'd' => { 'value' => 'copy_gem', 'display' => 'Copy gem to folder' },
12
12
  'e' => { 'value' => 'push_gem', 'display' => 'Build the latest version and push the gem' },
13
13
  'f' => { 'value' => 'till_install', 'display' => 'Remove old version, build and install the new version' },
@@ -15,28 +15,18 @@ module InstallGemLocal
15
15
  '/' => { 'value' => 'exit', 'display' => 'Exit' }
16
16
  }
17
17
 
18
- selection = Downup::Base.new(flash_message: 'Select Action', options: options).prompt
18
+ selection = InstallGemLocal::Helper.prompt_options(
19
+ flash_message: 'Select Action',
20
+ options: options
21
+ )
19
22
 
20
23
  ap selection
21
24
 
22
- case selection
23
- when 'remove'
24
- InstallGemLocal::Action.remove_gem
25
- when 'build'
26
- InstallGemLocal::Action.build_gem
27
- when 'install'
28
- InstallGemLocal::Action.install_gem
29
- when 'copy_gem'
30
- InstallGemLocal::Action.copy_gem
31
- when 'push_gem'
32
- InstallGemLocal::Action.push_gem
33
- when 'till_install'
34
- InstallGemLocal::Action.till_install
35
- when 'till_copy'
36
- InstallGemLocal::Action.till_copy
25
+ unless selection == 'exit'
26
+ InstallGemLocal::Action.send(selection.to_sym)
27
+ #InstallGemLocal::Navigation.start unless selection == 'exit'
37
28
  end
38
29
 
39
- # InstallGemLocal::Navigation.start unless selection == 'exit'
40
30
  rescue StandardError => e
41
31
  ap e
42
32
  ap 'Something Wrong! Try again!'
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module InstallGemLocal
4
- VERSION = '0.1.7'
4
+ VERSION = '0.1.8'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: install_gem_local
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dhanabal T
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-05-20 00:00:00.000000000 Z
11
+ date: 2019-05-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -160,6 +160,7 @@ files:
160
160
  - lib/install_gem_local/action/install_gem.rb
161
161
  - lib/install_gem_local/action/push_gem.rb
162
162
  - lib/install_gem_local/action/remove_gem.rb
163
+ - lib/install_gem_local/helper.rb
163
164
  - lib/install_gem_local/navigation.rb
164
165
  - lib/install_gem_local/version.rb
165
166
  homepage: https://github.com/dhanabalt/install_gem_local