install_gem_local 0.1.3 → 0.1.4

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: d58b297ced058feeb90148e7bc9e5b0e314fc41ecb1d5c555d7ff3c3b8599c59
4
- data.tar.gz: 463a9bd9deb735179db4f8016788f6167bd3e689b8035e2590fa6ed8ee3aaaba
3
+ metadata.gz: 9fb359829ea7f108b9cf5094f536cfe7e7928d298a2f5edca52db8b88275acff
4
+ data.tar.gz: ede47929e4b46e1219b2bb1f75c4ac21071e2593423f207052efabf18df4ffe7
5
5
  SHA512:
6
- metadata.gz: 8ada11a2e7b1e87126d4e5a3911cb349f2fb5f1d10dc4a19e1c4060591b9f798712e802e683561dc2044c1e6552b381ec284c7dc608a6bafdae3733bb7157072
7
- data.tar.gz: 0e934cc86e134967b89a565132e0d011f741132a521dcef8c5ba80b0d532b09d6793cb12cae004f1e5eaebf2e011ffdb2dd07d2e12a7708559306b5b84068048
6
+ metadata.gz: 44e6b54d1af8983ed5402bfd9823bd474692109e14ce475c1069dee921fa30b977f3d066d8c07602fae4cd8f0db8040ac229b678eb628780e4e865877ea56be4
7
+ data.tar.gz: 50c89d5f1271218077864b518be8913051f80b77a036ed9e294daf570dd374efc7a9e5cbf15c71ad5dee71a0285e7abf6c8aaa0653528b6f3b7ab2702f68156f
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- install_gem_local (0.1.3)
4
+ install_gem_local (0.1.4)
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)
@@ -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
- rescue StandardError => e
37
- ap e
38
- ap 'Something Wrong! Try again!'
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 aoa
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" => 'aoa', "display" => 'Remove old version, build and install the new version'},
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 'aoa'
25
- InstallGemLocal::Action.aoa
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module InstallGemLocal
4
- VERSION = '0.1.3'
4
+ VERSION = '0.1.4'
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.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dhanabal T