aka2 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/README.md +2 -7
- data/changelog.md +13 -0
- data/lib/aka/version.rb +1 -1
- data/lib/aka.rb +43 -6
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 673cb269a937bd977d3c4de2dd8bdc59dedf6144
|
4
|
+
data.tar.gz: 4b6c30b307730044f9dd0e022aa1e986cffeff5a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c76085f31de613a8bbce3999f5e13c70790eb1a20e803ce5b09f8b770cd629e12d20d078accabe23004c3c267b00132cadfec46d81c6a7b974d1b6916cd5882a
|
7
|
+
data.tar.gz: 1c01be9087ede80a6d83ee3aae7ec9b559c718759311ad9c338883ccf840256b138520ac6fa6b6a13e33278e288113550b0a1f09764e24f252945cd4bea2bc52
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -17,20 +17,15 @@ aka2 requires ruby and is built for bash and zsh users.
|
|
17
17
|
$ aka find hello
|
18
18
|
$ aka usage
|
19
19
|
$ aka
|
20
|
+
$ aka help
|
20
21
|
|
21
22
|
## Requirement
|
22
23
|
|
23
24
|
Ruby
|
24
25
|
|
25
|
-
## Development
|
26
|
-
|
27
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
28
|
-
|
29
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
30
|
-
|
31
26
|
## Contributing
|
32
27
|
|
33
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
28
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/ytbryan/aka-gem.
|
34
29
|
|
35
30
|
|
36
31
|
## License
|
data/changelog.md
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
## v0.1.2
|
2
|
+
|
3
|
+
* Fix setup2 bug - export new line
|
4
|
+
* create setup_akasource
|
5
|
+
|
6
|
+
## v0.1.1
|
7
|
+
|
8
|
+
* User can use 'aka setup2' to set the config file
|
9
|
+
* Fix Bug - config file not found
|
10
|
+
|
11
|
+
## v0.1.0
|
12
|
+
|
13
|
+
* Convert aka project from [ytbran/aka](https://github.com/ytbryan/aka) to a gem.
|
data/lib/aka/version.rb
CHANGED
data/lib/aka.rb
CHANGED
@@ -147,8 +147,10 @@ module Aka
|
|
147
147
|
# list
|
148
148
|
puts "config file is exist in #{configDir}"
|
149
149
|
else
|
150
|
-
setup_config
|
151
|
-
setup_aka2 #setup aka
|
150
|
+
setup_config #create and setup .config file
|
151
|
+
# setup_aka2 #setup aka
|
152
|
+
setup_aka3 #put value in .config file
|
153
|
+
setup_autosource # create, link source file
|
152
154
|
end
|
153
155
|
end
|
154
156
|
|
@@ -695,14 +697,14 @@ trap 'sigusr2 $(cat ~/sigusr1-args)' SIGUSR2\n".pretty
|
|
695
697
|
def setup_aka2
|
696
698
|
if File.exist?("#{Dir.home}/.zshrc") #if zshec exist
|
697
699
|
setZSHRC2
|
698
|
-
append_with_newline("
|
700
|
+
append_with_newline("\nexport HISTSIZE=10000","#{Dir.home}/.zshrc")
|
699
701
|
elsif
|
700
702
|
File.exist?("#{Dir.home}/.bashrc") #if bashrc exist
|
701
703
|
setBASHRC2
|
702
|
-
append_with_newline("
|
704
|
+
append_with_newline("\nexport HISTSIZE=10000","#{Dir.home}/.bashrc")
|
703
705
|
elsif File.exist?("#{Dir.home}/.bash_profile") #if bash_profile exist
|
704
706
|
setBASH2
|
705
|
-
append_with_newline("
|
707
|
+
append_with_newline("\nexport HISTSIZE=10000","#{Dir.home}/.bash_profile")
|
706
708
|
else
|
707
709
|
puts "Currently aka2 just support zshrc, bashrc and bash_profile"
|
708
710
|
puts "Pleaes contact aka2 creator for more info."
|
@@ -716,6 +718,41 @@ trap 'sigusr2 $(cat ~/sigusr1-args)' SIGUSR2\n".pretty
|
|
716
718
|
puts "Done. Please restart this shell.".red
|
717
719
|
end
|
718
720
|
|
721
|
+
# setup_aka3 by ryan - set value in config file
|
722
|
+
def setup_aka3
|
723
|
+
if File.exist?("#{Dir.home}/.zshrc") #if zshec exist
|
724
|
+
setZSHRC2
|
725
|
+
elsif
|
726
|
+
File.exist?("#{Dir.home}/.bashrc") #if bashrc exist
|
727
|
+
setBASHRC2
|
728
|
+
elsif File.exist?("#{Dir.home}/.bash_profile") #if bash_profile exist
|
729
|
+
setBASH2
|
730
|
+
else
|
731
|
+
puts "Currently aka2 just support zshrc, bashrc and bash_profile"
|
732
|
+
puts "Pleaes contact aka2 creator for more info."
|
733
|
+
end
|
734
|
+
end
|
735
|
+
|
736
|
+
# setup_autosource by ryan - create source file
|
737
|
+
def setup_autosource
|
738
|
+
configDir = "#{Dir.home}/.aka"
|
739
|
+
|
740
|
+
if File.exist?("#{configDir}/.config")
|
741
|
+
out_file = File.new("#{configDir}/autosource", "w")
|
742
|
+
out_file.puts("export HISTSIZE=10000")
|
743
|
+
out_file.puts("sigusr2() { unalias $1;}")
|
744
|
+
out_file.puts("sigusr1() { source #{readYML("#{configDir}/.config")["dotfile"]}; history -a; echo 'reloaded dot file'; }")
|
745
|
+
out_file.puts("trap sigusr1 SIGUSR1")
|
746
|
+
out_file.puts("trap 'sigusr2 $(cat ~/sigusr1-args)' SIGUSR2")
|
747
|
+
out_file.close
|
748
|
+
autosource = "\nsource \"#{configDir}/autosource\""
|
749
|
+
append(autosource, readYML("#{configDir}/.config")['profile'])
|
750
|
+
puts "Done. Please restart this shell.".red
|
751
|
+
else
|
752
|
+
puts "Directory #{configDir}/.config doesn't exist"
|
753
|
+
end
|
754
|
+
end
|
755
|
+
|
719
756
|
# create and setup config file
|
720
757
|
def setup_config
|
721
758
|
configDir = "#{Dir.home}/.aka"
|
@@ -724,7 +761,7 @@ trap 'sigusr2 $(cat ~/sigusr1-args)' SIGUSR2\n".pretty
|
|
724
761
|
else
|
725
762
|
FileUtils::mkdir_p("#{configDir}")
|
726
763
|
# FileUtils.cp("./lib/.config", "#{configDir}")
|
727
|
-
out_file = File.new("#{
|
764
|
+
out_file = File.new("#{configDir}/.config", "w")
|
728
765
|
out_file.puts("---")
|
729
766
|
out_file.puts("dotfile: \"/home/user/.bashrc\"")
|
730
767
|
out_file.puts("history: \"/home/user/.bash_history\"")
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aka2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bryan Lim
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-07-
|
12
|
+
date: 2015-07-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: net-scp
|
@@ -141,6 +141,7 @@ files:
|
|
141
141
|
- bin/aka
|
142
142
|
- bin/console
|
143
143
|
- bin/setup
|
144
|
+
- changelog.md
|
144
145
|
- lib/.config
|
145
146
|
- lib/aka.rb
|
146
147
|
- lib/aka/version.rb
|