install_gem_local 0.1.6 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3ed591bb5dfb1babdf51058dd5bb4ecd4cf609586a94a62c4ec430e8febcfb6b
4
- data.tar.gz: f92c19446ee17c8ca9d7f6496d2120e8f0fff8b0a0b9400c289fb871a50c322a
3
+ metadata.gz: '081168b3056269dc36e5c5fac7a2a64fdc9eb68293c0bdfa5b17d5fa602d0616'
4
+ data.tar.gz: c3a240c5c47ac10f8573623e6ac9ecffccb5eaccbc9703f0efafc5dfb89c08fe
5
5
  SHA512:
6
- metadata.gz: ef0c709926f78913ef544aa22441856e31492d455a3fa6d11c964426d58fbbf68b5392e105640ecbd11e642cdbfb06d3c7ca9ce4196b21e082c46c76ddf7ace4
7
- data.tar.gz: bcd61bce3f0b99079b040ca22fec00cc0613d374cc89127e17fffae81ef6fbe31ad83262713bc50fda9b40d04902f3c15a409b23580fc0126d676288b5484ad7
6
+ metadata.gz: 58c611bcc732e1771ac6279f883438813e16889c88cfc0016f43ab9fa65394db4986d1641ea99a44b652f46aa7f7871cbeedd03f0304cc3901358c8c0fe9fe3b
7
+ data.tar.gz: 06d07f339795760635085cb414fca9cf94b1a11f76843b76e3c36926377b4d71655422067a9a4d1b3789d1c830980a2607f56b07113381483810b539d07e4738
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- install_gem_local (0.1.6)
4
+ install_gem_local (0.1.7)
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)
@@ -9,8 +9,8 @@ require 'install_gem_local/action/install_gem'
9
9
  require 'install_gem_local/action/build_gem'
10
10
  require 'install_gem_local/action/remove_gem'
11
11
  require 'install_gem_local/action/copy_gem'
12
- Dir[File.join(File.expand_path("..",__FILE__), 'install_gem_local', '**/*.rb')].each {|f| require f}
13
-
12
+ require 'install_gem_local/action/push_gem'
13
+ Dir[File.join(File.expand_path(__dir__), 'install_gem_local', '**/*.rb')].each { |f| require f }
14
14
 
15
15
  module InstallGemLocal
16
16
  class App < Thor
@@ -6,6 +6,7 @@ module InstallGemLocal
6
6
  extend InstallGemLocal::CopyGem
7
7
  extend InstallGemLocal::RemoveGem
8
8
  extend InstallGemLocal::BuildGem
9
+ extend InstallGemLocal::PushGem
9
10
 
10
11
  class << self
11
12
  def till_install
@@ -36,10 +37,9 @@ module InstallGemLocal
36
37
  file_names.each_with_index do |file_name, index|
37
38
  options[('a'..'z').to_a[index]] = { 'value' => file_name, 'display' => file_name }
38
39
  end
39
- options['/'] = { 'value' => 'exit', 'display' => 'Exit'}
40
+ options['/'] = { 'value' => 'exit', 'display' => 'Exit' }
40
41
  Downup::Base.new(flash_message: 'Choose which version',
41
42
  options: options).prompt
42
-
43
43
  end
44
44
  end
45
45
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module InstallGemLocal
2
4
  module BuildGem
3
5
  def build_gem
@@ -5,7 +7,7 @@ module InstallGemLocal
5
7
  puts ''
6
8
  file = tty_command.run('find -type f -name "*.gemspec"')
7
9
  ap file_name = file.out.strip
8
- file_name.empty? ? ap('Gemspec not exist') : tty_command.run("gem build #{file_name}")
10
+ file_name.empty? ? ap('Gemspec not found') : tty_command.run("gem build #{file_name}")
9
11
  end
10
12
  end
11
13
  end
@@ -1,11 +1,13 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module InstallGemLocal
2
4
  module CopyGem
3
5
  def choose_copy_folder
4
6
  options = {
5
- 'a' => { 'value' => 'desktop', 'display' => 'Desktop' },
6
- 'b' => { 'value' => 'downloads', 'display' => 'Downloads' },
7
- 'c' => { 'value' => 'documents', 'display' => 'Documents' },
8
- '/' => { 'value' => 'exit', 'display' => 'Exit' }
7
+ 'a' => { 'value' => 'desktop', 'display' => 'Desktop' },
8
+ 'b' => { 'value' => 'downloads', 'display' => 'Downloads' },
9
+ 'c' => { 'value' => 'documents', 'display' => 'Documents' },
10
+ '/' => { 'value' => 'exit', 'display' => 'Exit' }
9
11
  }
10
12
 
11
13
  Downup::Base.new(flash_message: 'Choose Folder To Copy',
@@ -37,4 +39,4 @@ module InstallGemLocal
37
39
  end
38
40
  end
39
41
  end
40
- end
42
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module InstallGemLocal
2
4
  module InstallGem
3
5
  def install_gem
@@ -19,4 +21,4 @@ module InstallGemLocal
19
21
  tty_command.run("gem install #{file_name}")
20
22
  end
21
23
  end
22
- end
24
+ end
@@ -0,0 +1,23 @@
1
+ module InstallGemLocal
2
+ module PushGem
3
+ def push_gem
4
+ build_gem
5
+ puts '-----------------------------'
6
+ puts ''
7
+ files_exists = file_names
8
+ if files_exists.count > 1
9
+ push_gem_from_path(multiple_version_selection)
10
+ elsif files_exists.count == 1
11
+ push_gem_from_path(files_exists.first)
12
+ else
13
+ ap 'Gem not exist'
14
+ end
15
+ end
16
+
17
+ def push_gem_from_path(file_name)
18
+ return if file_name == 'exit'
19
+
20
+ tty_command.run("gem push #{file_name}")
21
+ end
22
+ end
23
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module InstallGemLocal
2
4
  module RemoveGem
3
5
  def remove_gem
@@ -9,8 +9,9 @@ module InstallGemLocal
9
9
  'b' => { 'value' => 'build', 'display' => 'Build new version' },
10
10
  'c' => { 'value' => 'install', 'display' => 'Install new version' },
11
11
  'd' => { 'value' => 'copy_gem', 'display' => 'Copy gem to folder' },
12
- 'e' => { 'value' => 'till_install', 'display' => 'Remove old version, build and install the new version' },
13
- 'f' => { 'value' => 'till_copy', 'display' => 'Remove old version, build, install and copy the new version' },
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' },
14
15
  '/' => { 'value' => 'exit', 'display' => 'Exit' }
15
16
  }
16
17
 
@@ -27,13 +28,15 @@ module InstallGemLocal
27
28
  InstallGemLocal::Action.install_gem
28
29
  when 'copy_gem'
29
30
  InstallGemLocal::Action.copy_gem
31
+ when 'push_gem'
32
+ InstallGemLocal::Action.push_gem
30
33
  when 'till_install'
31
34
  InstallGemLocal::Action.till_install
32
35
  when 'till_copy'
33
36
  InstallGemLocal::Action.till_copy
34
37
  end
35
38
 
36
- #InstallGemLocal::Navigation.start unless selection == 'exit'
39
+ # InstallGemLocal::Navigation.start unless selection == 'exit'
37
40
  rescue StandardError => e
38
41
  ap e
39
42
  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.6'
4
+ VERSION = '0.1.7'
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.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dhanabal T
@@ -158,6 +158,7 @@ files:
158
158
  - lib/install_gem_local/action/build_gem.rb
159
159
  - lib/install_gem_local/action/copy_gem.rb
160
160
  - lib/install_gem_local/action/install_gem.rb
161
+ - lib/install_gem_local/action/push_gem.rb
161
162
  - lib/install_gem_local/action/remove_gem.rb
162
163
  - lib/install_gem_local/navigation.rb
163
164
  - lib/install_gem_local/version.rb