install_gem_local 0.1.7 → 0.1.8
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 +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +3 -8
- data/lib/install_gem_local/action.rb +5 -3
- data/lib/install_gem_local/action/build_gem.rb +2 -2
- data/lib/install_gem_local/action/copy_gem.rb +6 -2
- data/lib/install_gem_local/action/install_gem.rb +1 -1
- data/lib/install_gem_local/action/push_gem.rb +1 -1
- data/lib/install_gem_local/action/remove_gem.rb +2 -0
- data/lib/install_gem_local/helper.rb +15 -0
- data/lib/install_gem_local/navigation.rb +10 -20
- data/lib/install_gem_local/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b17335d3f9696c4f0199c80bfe216701b31469b3ab185ec9c161bc3864c8005c
|
4
|
+
data.tar.gz: 628161a99290d83f5495febf89efe1cdd202e5685c31357ad6ce729d0ea84f8f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 77f1ecc4b46e75c8f24f346aa2eabcb603f7d4da144a554c560ee14c882e74d9364aabc6ccc2de297950b2ac15f712bbe7a1d87141635e83031898283425db01
|
7
|
+
data.tar.gz: 2f8eb20694559f085e3bcabaa78e7e1ba043c8d41c772f8c1fe219f40109d350caf92555ad6ba28dfd023ccfbd00b0f5afa884c687d1818ab772041d33b5f88b
|
data/Gemfile.lock
CHANGED
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
|
15
|
+
$ gem install install_gem_local
|
22
16
|
|
23
17
|
## Usage
|
24
18
|
|
25
|
-
|
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
|
-
|
42
|
-
|
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
|
-
|
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
|
-
|
14
|
-
|
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
|
@@ -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' => '
|
9
|
-
'b' => { 'value' => '
|
10
|
-
'c' => { 'value' => '
|
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 =
|
18
|
+
selection = InstallGemLocal::Helper.prompt_options(
|
19
|
+
flash_message: 'Select Action',
|
20
|
+
options: options
|
21
|
+
)
|
19
22
|
|
20
23
|
ap selection
|
21
24
|
|
22
|
-
|
23
|
-
|
24
|
-
InstallGemLocal::
|
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!'
|
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.
|
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-
|
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
|