thorium 0.3.6 → 0.3.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 +4 -4
- data/lib/thorium/base.rb +22 -7
- data/lib/thorium/tasks/git.rb +2 -2
- data/lib/thorium/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5db9df4d8edcf8c12684ed088c24929bcd5dc537
|
4
|
+
data.tar.gz: 48def82486f09746dc14a2bfda7aaff01afc7e45
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: deff5ddad3edc2e0b240e295aef17bf43153f2fadb81742db8318a02b00414018830757b1ca229042b9a96d4018fdad48d0ef68a8a6e58652541761d183728f2
|
7
|
+
data.tar.gz: a0df9c51bfb792a54daf2742f9ad301f1e30492cdd0510f327f34009459eb2198d324d8444f3fef49476eef9f6d39162c1ddab82f113048cf84e36fa868c5c24
|
data/lib/thorium/base.rb
CHANGED
@@ -22,9 +22,17 @@ module ThoriumCLI
|
|
22
22
|
|
23
23
|
class_option :verbose, type: :boolean, default: false, aliases: :v
|
24
24
|
|
25
|
-
desc 'pubkey', '
|
25
|
+
desc 'pubkey', 'Copy `id_rsa.pub` (default) in your clipboard'
|
26
26
|
def pubkey
|
27
|
-
|
27
|
+
path = '~/.ssh/id_rsa.pub'
|
28
|
+
file = Dir.glob(File.expand_path(path)).first
|
29
|
+
if file
|
30
|
+
say "Use `thorium pubkeys` if you want to select a specific key.", :yellow
|
31
|
+
copy_to_clipboard file
|
32
|
+
else
|
33
|
+
say "File `#{path}` has not been found.", :red
|
34
|
+
generate_pubkey?
|
35
|
+
end
|
28
36
|
end
|
29
37
|
|
30
38
|
desc 'pubkeys', 'Simple public keys manipulation'
|
@@ -39,13 +47,12 @@ module ThoriumCLI
|
|
39
47
|
copy_to_clipboard public_keys[index.to_i - 1] if index != ask_options[:skip]
|
40
48
|
else
|
41
49
|
say 'No public keys have been found.', :red
|
42
|
-
|
43
|
-
run 'ssh-keygen' if generate_new
|
50
|
+
generate_pubkey?
|
44
51
|
end
|
45
52
|
end
|
46
53
|
|
47
54
|
# Apache subcommand
|
48
|
-
desc 'apache [SUBCOMMAND] [ARGS]', '
|
55
|
+
desc 'apache [SUBCOMMAND] [ARGS]', 'Apache controller'
|
49
56
|
subcommand 'apache', Apache
|
50
57
|
|
51
58
|
# Git subcommand
|
@@ -55,6 +62,13 @@ module ThoriumCLI
|
|
55
62
|
no_commands do
|
56
63
|
|
57
64
|
private
|
65
|
+
|
66
|
+
# Prompts to run `ssh-keygen`
|
67
|
+
def generate_pubkey?
|
68
|
+
answered_yes = yes?('Do you want to generate a new public pubkey?', :green)
|
69
|
+
run 'ssh-keygen', verbose: false if answered_yes
|
70
|
+
end
|
71
|
+
|
58
72
|
# Prints public keys with indexes
|
59
73
|
def print_keys(public_keys)
|
60
74
|
public_keys.each_with_index do |f, i|
|
@@ -64,9 +78,10 @@ module ThoriumCLI
|
|
64
78
|
end
|
65
79
|
|
66
80
|
def copy_to_clipboard(content)
|
67
|
-
|
81
|
+
say "(!) No content provided.", :red unless content
|
82
|
+
if (run 'which pbcopy > /dev/null', verbose: false)
|
68
83
|
run "pbcopy < #{content}", verbose: false
|
69
|
-
say "
|
84
|
+
say "--> `#{content}` copied to your clipboard.", :blue
|
70
85
|
else
|
71
86
|
say 'pbcopy is not installed, cannot copy to clipboard', :red
|
72
87
|
end
|
data/lib/thorium/tasks/git.rb
CHANGED
@@ -10,7 +10,7 @@ module GitCLI
|
|
10
10
|
|
11
11
|
class_option :verbose, type: :boolean, default: 1
|
12
12
|
|
13
|
-
desc 'list', 'Lists Github
|
13
|
+
desc 'list', 'Lists repositories (Github)'
|
14
14
|
def list
|
15
15
|
gh_uname = ask('Enter Github username: ', :green)
|
16
16
|
abort if gh_uname.empty?
|
@@ -22,7 +22,7 @@ module GitCLI
|
|
22
22
|
print_table @repos
|
23
23
|
end
|
24
24
|
|
25
|
-
desc 'clone', 'Clones a repository from the list'
|
25
|
+
desc 'clone', 'Clones a repository from the list (Github)'
|
26
26
|
def clone
|
27
27
|
list
|
28
28
|
# Do not do anything if list is empty
|
data/lib/thorium/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thorium
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Stankevich
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-09-
|
11
|
+
date: 2014-09-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|