install_gem_local 0.1.3 → 0.1.4
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/action.rb +35 -12
- data/lib/install_gem_local/navigation.rb +13 -3
- data/lib/install_gem_local/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9fb359829ea7f108b9cf5094f536cfe7e7928d298a2f5edca52db8b88275acff
|
4
|
+
data.tar.gz: ede47929e4b46e1219b2bb1f75c4ac21071e2593423f207052efabf18df4ffe7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 44e6b54d1af8983ed5402bfd9823bd474692109e14ce475c1069dee921fa30b977f3d066d8c07602fae4cd8f0db8040ac229b678eb628780e4e865877ea56be4
|
7
|
+
data.tar.gz: 50c89d5f1271218077864b518be8913051f80b77a036ed9e294daf570dd374efc7a9e5cbf15c71ad5dee71a0285e7abf6c8aaa0653528b6f3b7ab2702f68156f
|
data/Gemfile.lock
CHANGED
@@ -6,10 +6,6 @@ module InstallGemLocal
|
|
6
6
|
file = cmd.run('find -type f -name "*.gem"')
|
7
7
|
ap file_name = file.out.strip
|
8
8
|
file_name.empty? ? ap('Gem not exist') : cmd.run("rm #{file_name}")
|
9
|
-
|
10
|
-
rescue StandardError => e
|
11
|
-
ap e
|
12
|
-
ap 'Something Wrong! Try again!'
|
13
9
|
end
|
14
10
|
|
15
11
|
def build_gem
|
@@ -19,10 +15,6 @@ module InstallGemLocal
|
|
19
15
|
file = cmd.run('find -type f -name "*.gemspec"')
|
20
16
|
ap file_name = file.out.strip
|
21
17
|
file_name.empty? ? ap('Gemspec not exist') : cmd.run("gem build #{file_name}")
|
22
|
-
|
23
|
-
rescue StandardError => e
|
24
|
-
ap e
|
25
|
-
ap 'Something Wrong! Try again!'
|
26
18
|
end
|
27
19
|
|
28
20
|
def install_gem
|
@@ -32,17 +24,48 @@ module InstallGemLocal
|
|
32
24
|
file = cmd.run('find -type f -name "*.gem"')
|
33
25
|
ap file_name = file.out.strip
|
34
26
|
file_name.empty? ? ap('Gem not exist') : cmd.run("gem install #{file_name}")
|
27
|
+
end
|
28
|
+
|
29
|
+
def copy_gem
|
30
|
+
options = {
|
31
|
+
"a" => {"value" => 'desktop', "display" => 'Desktop'},
|
32
|
+
"b" => {"value" => 'downloads', "display" => 'Downloads'},
|
33
|
+
"c" => {"value" => 'documents', "display" => 'Documents'},
|
34
|
+
"/" => {"value" => "exit", "display" => "Exit"}
|
35
|
+
}
|
36
|
+
|
37
|
+
selection = Downup::Base.new(flash_message: 'Choose Folder To Copy',
|
38
|
+
options: options).prompt
|
39
|
+
|
40
|
+
ap selection
|
35
41
|
|
36
|
-
|
37
|
-
|
38
|
-
ap
|
42
|
+
cmd = TTY::Command.new
|
43
|
+
file = cmd.run('find -type f -name "*.gem"')
|
44
|
+
ap file_name = file.out.strip
|
45
|
+
if file_name.empty?
|
46
|
+
ap 'Gem not present in the current folder'
|
47
|
+
else
|
48
|
+
case selection
|
49
|
+
when 'desktop'
|
50
|
+
cmd.run("cp #{file_name} ~/Desktop")
|
51
|
+
when 'downloads'
|
52
|
+
cmd.run("cp #{file_name} ~/Downloads")
|
53
|
+
when 'documents'
|
54
|
+
cmd.run("cp #{file_name} ~/Documents")
|
55
|
+
end
|
56
|
+
end
|
39
57
|
end
|
40
58
|
|
41
|
-
def
|
59
|
+
def till_install
|
42
60
|
remove_gem
|
43
61
|
build_gem
|
44
62
|
install_gem
|
45
63
|
end
|
64
|
+
|
65
|
+
def till_copy
|
66
|
+
till_install
|
67
|
+
copy_gem
|
68
|
+
end
|
46
69
|
end
|
47
70
|
end
|
48
71
|
end
|
@@ -6,7 +6,9 @@ module InstallGemLocal
|
|
6
6
|
"a" => {"value" => 'remove', "display" => 'Remove old version'},
|
7
7
|
"b" => {"value" => 'build', "display" => 'Build new version'},
|
8
8
|
"c" => {"value" => 'install', "display" => 'Install new version'},
|
9
|
-
"d" => {"value" => '
|
9
|
+
"d" => {"value" => 'copy_gem', "display" => 'Copy gem to folder'},
|
10
|
+
"e" => {"value" => 'till_install', "display" => 'Remove old version, build and install the new version'},
|
11
|
+
"f" => {"value" => 'till_copy', "display" => 'Remove old version, build, install and copy the new version'},
|
10
12
|
"/" => {"value" => "exit", "display" => "Exit"}
|
11
13
|
}
|
12
14
|
|
@@ -21,9 +23,17 @@ module InstallGemLocal
|
|
21
23
|
InstallGemLocal::Action.build_gem
|
22
24
|
when 'install'
|
23
25
|
InstallGemLocal::Action.install_gem
|
24
|
-
when '
|
25
|
-
InstallGemLocal::Action.
|
26
|
+
when 'copy_gem'
|
27
|
+
InstallGemLocal::Action.copy_gem
|
28
|
+
when 'till_install'
|
29
|
+
InstallGemLocal::Action.till_install
|
30
|
+
when 'till_copy'
|
31
|
+
InstallGemLocal::Action.till_copy
|
26
32
|
end
|
33
|
+
|
34
|
+
rescue StandardError => e
|
35
|
+
ap e
|
36
|
+
ap 'Something Wrong! Try again!'
|
27
37
|
end
|
28
38
|
end
|
29
39
|
end
|