install_gem_local 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/install_gem_local.rb +2 -2
- data/lib/install_gem_local/action.rb +2 -2
- data/lib/install_gem_local/action/build_gem.rb +3 -1
- data/lib/install_gem_local/action/copy_gem.rb +7 -5
- data/lib/install_gem_local/action/install_gem.rb +3 -1
- data/lib/install_gem_local/action/push_gem.rb +23 -0
- data/lib/install_gem_local/action/remove_gem.rb +2 -0
- data/lib/install_gem_local/navigation.rb +6 -3
- data/lib/install_gem_local/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '081168b3056269dc36e5c5fac7a2a64fdc9eb68293c0bdfa5b17d5fa602d0616'
|
4
|
+
data.tar.gz: c3a240c5c47ac10f8573623e6ac9ecffccb5eaccbc9703f0efafc5dfb89c08fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 58c611bcc732e1771ac6279f883438813e16889c88cfc0016f43ab9fa65394db4986d1641ea99a44b652f46aa7f7871cbeedd03f0304cc3901358c8c0fe9fe3b
|
7
|
+
data.tar.gz: 06d07f339795760635085cb414fca9cf94b1a11f76843b76e3c36926377b4d71655422067a9a4d1b3789d1c830980a2607f56b07113381483810b539d07e4738
|
data/Gemfile.lock
CHANGED
data/lib/install_gem_local.rb
CHANGED
@@ -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
|
-
|
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
|
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
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
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
|
@@ -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
|
@@ -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' => '
|
13
|
-
'f' => { 'value' => '
|
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!'
|
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.
|
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
|