atk_toolbox 0.0.134 → 0.0.135
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/atk/atk_info.rb +2 -0
- data/lib/atk/file_system.rb +8 -6
- data/lib/atk/git.rb +6 -4
- data/lib/atk/info.rb +2 -1
- data/lib/atk_toolbox/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 497f584b02fd452d58548f8f28f315469c8998e7c9ac04c9f8f6fb7216bb049e
|
4
|
+
data.tar.gz: dd6509b4814cba3598cbdc6d0dc0f5581f04308617bee5d1737f52e48447a895
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e2a0a6ac3951482a019c3912cbab7e35d99b8c3cc34a18254c8602b9463ea518f0c3f627aaa0633b96049f7c5a15b2c754e8b0a72714c67b1b6d92868d3d46d
|
7
|
+
data.tar.gz: 5a070d7fd10dba01652c0aee20c49adbace3a5b5ca35e0398bae9d0e80a051f4321663956416b9192edc22392dfce0db8b77f76d48f8b28a16e45185efe220c1
|
data/lib/atk/atk_info.rb
CHANGED
@@ -270,6 +270,8 @@ class AtkPackage
|
|
270
270
|
|
271
271
|
def ensure_cached()
|
272
272
|
if @is_cached == nil
|
273
|
+
puts "self.cache_location is: #{self.cache_location} "
|
274
|
+
puts "self.url is: #{self.url} "
|
273
275
|
Git.ensure_cloned_and_up_to_date(self.cache_location, self.url)
|
274
276
|
@is_cached = true
|
275
277
|
end
|
data/lib/atk/file_system.rb
CHANGED
@@ -441,24 +441,26 @@ module FileSystem
|
|
441
441
|
@unqiue_id = unqiue_id
|
442
442
|
end
|
443
443
|
|
444
|
-
|
445
|
-
|
444
|
+
def bash_comment_out
|
445
|
+
->(code) do
|
446
|
+
"### #{code}"
|
447
|
+
end
|
446
448
|
end
|
447
449
|
|
448
450
|
def add_to_bash_profile(code)
|
449
|
-
uniquely_append(code, HOME/".bash_profile",
|
451
|
+
uniquely_append(code, HOME/".bash_profile", bash_comment_out)
|
450
452
|
end
|
451
453
|
|
452
454
|
def add_to_zsh_profile(code)
|
453
|
-
uniquely_append(code, HOME/".zprofile",
|
455
|
+
uniquely_append(code, HOME/".zprofile", bash_comment_out)
|
454
456
|
end
|
455
457
|
|
456
458
|
def add_to_bash_rc(code)
|
457
|
-
uniquely_append(code, HOME/".bashrc",
|
459
|
+
uniquely_append(code, HOME/".bashrc", bash_comment_out)
|
458
460
|
end
|
459
461
|
|
460
462
|
def add_to_zsh_rc(code)
|
461
|
-
uniquely_append(code, HOME/".zshrc",
|
463
|
+
uniquely_append(code, HOME/".zshrc", bash_comment_out)
|
462
464
|
end
|
463
465
|
|
464
466
|
def uniquely_append(string_to_add, location_of_file, comment_out_line)
|
data/lib/atk/git.rb
CHANGED
@@ -5,10 +5,12 @@ module Git
|
|
5
5
|
# check if its a git repo
|
6
6
|
if FS.folder?(target_dir/".git")
|
7
7
|
# fetch master
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
8
|
+
FS.in_dir(target_dir) do
|
9
|
+
system("git fetch origin master")
|
10
|
+
if $?.success?
|
11
|
+
# force pull
|
12
|
+
system("git reset --hard origin/master")
|
13
|
+
end
|
12
14
|
end
|
13
15
|
return
|
14
16
|
else
|
data/lib/atk/info.rb
CHANGED
@@ -259,6 +259,7 @@ class Info
|
|
259
259
|
rescue
|
260
260
|
@paths = {}
|
261
261
|
end
|
262
|
+
@root = FileSystem.dirname(@path)
|
262
263
|
for each_key, each_value in @paths
|
263
264
|
# if its an array, just join it together
|
264
265
|
if each_value.is_a?(Array)
|
@@ -273,7 +274,7 @@ class Info
|
|
273
274
|
# Dont add a source_path if its an absolute path
|
274
275
|
if not each_value.size > 0 && each_value[0] == '/'
|
275
276
|
# convert the path into an absolute path
|
276
|
-
@paths[each_key] = FileSystem.join(@
|
277
|
+
@paths[each_key] = FileSystem.join(@root, each_value)
|
277
278
|
end
|
278
279
|
end
|
279
280
|
end
|
data/lib/atk_toolbox/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: atk_toolbox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.135
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeff Hykin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-01-
|
11
|
+
date: 2020-01-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tty-prompt
|