path_manager 0.0.1 → 0.0.2
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/README.md +1 -0
- data/lib/path_manager.rb +4 -3
- data/lib/path_manager/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 92bb2daba7c3d6fc8550b20395c9fea61daa1793
|
4
|
+
data.tar.gz: 473fa9a85f98d3ae7ac6fa41e389485950f5e61f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 67d7a6fda44254da2b045c437afce787daf77478f9bd0410faff3b4d1137e27ec9a07e6f080858edf032b66a326e1144ff5b769935ed43a474115c67022947a5
|
7
|
+
data.tar.gz: f81b98733159a739a0df76aee69703fc87a14a1b5770949cfc75b834fc59c9590b4875ef9f65a4dbbfba9a05323a82042a62d961d6c9a07ec4b264ec9a49503d
|
data/README.md
CHANGED
data/lib/path_manager.rb
CHANGED
@@ -7,7 +7,8 @@ module PathManager
|
|
7
7
|
include Thor::Actions
|
8
8
|
no_commands do
|
9
9
|
def get_path_location
|
10
|
-
|
10
|
+
puts File.dirname(__FILE__) + "config.json"
|
11
|
+
file = File.read(File.dirname(__FILE__) + "/config.json")
|
11
12
|
configs = JSON.parse(file, symbolize_names: true)
|
12
13
|
regex = /Shell: \/bin\/([a-zA-Z\/]*)/i
|
13
14
|
info = %x[finger `whoami`]
|
@@ -57,6 +58,7 @@ module PathManager
|
|
57
58
|
location = get_path_location
|
58
59
|
File.open(location[:path], "r+") do |file|
|
59
60
|
while (location[:line] -= 1) > 0
|
61
|
+
file.readline
|
60
62
|
end
|
61
63
|
pos = file.pos
|
62
64
|
regex = /((?:\/|~).+)/
|
@@ -68,7 +70,6 @@ module PathManager
|
|
68
70
|
path_items = path_items.join(":")
|
69
71
|
rest = file.read
|
70
72
|
file.seek pos
|
71
|
-
final_path = "export PATH=" + path_items + ":$PATH\n"
|
72
73
|
file.write "export PATH=" + path_items + ":$PATH\n"
|
73
74
|
file.write rest
|
74
75
|
end
|
@@ -79,6 +80,7 @@ module PathManager
|
|
79
80
|
location = get_path_location
|
80
81
|
File.open(location[:path], "r+") do |file|
|
81
82
|
while (location[:line] -= 1) > 0
|
83
|
+
file.readline
|
82
84
|
end
|
83
85
|
pos = file.pos
|
84
86
|
regex = /((?:\/|~).+)/
|
@@ -90,7 +92,6 @@ module PathManager
|
|
90
92
|
path_items = path_items.join(":")
|
91
93
|
rest = file.read
|
92
94
|
file.seek pos
|
93
|
-
final_path = "export PATH=" + path_items + ":$PATH\n"
|
94
95
|
file.write "export PATH=" + path_items + ":$PATH\n"
|
95
96
|
file.write rest
|
96
97
|
end
|
data/lib/path_manager/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: path_manager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Charley Hutchison
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-08-
|
11
|
+
date: 2014-08-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -104,7 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
104
104
|
version: '0'
|
105
105
|
requirements: []
|
106
106
|
rubyforge_project:
|
107
|
-
rubygems_version: 2.
|
107
|
+
rubygems_version: 2.2.2
|
108
108
|
signing_key:
|
109
109
|
specification_version: 4
|
110
110
|
summary: Helps manage your $PATH variable.
|