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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c944eda3c0839f19319ccde32b7681f95e66127a
4
- data.tar.gz: 414a6d1c0be07b55c633eca283dbd3bf5f033094
3
+ metadata.gz: 673cb269a937bd977d3c4de2dd8bdc59dedf6144
4
+ data.tar.gz: 4b6c30b307730044f9dd0e022aa1e986cffeff5a
5
5
  SHA512:
6
- metadata.gz: 5cbac23af352f49bea7c34498f2ac561b52ef29d74ddd26106f9dc679824fe77f14a035027c42fc00e1878e583985d5efdf0abb8d9c7f8d1ef7bbe4cd1cc25ad
7
- data.tar.gz: 84651e76a6e2521fa93073a6938baf4056df9cc1ce9045045d379503bf9e5639e13c8ccc197df7009af20c4d31c56ea60e45556305d4d309b1f8ace4ab0e0de1
6
+ metadata.gz: c76085f31de613a8bbce3999f5e13c70790eb1a20e803ce5b09f8b770cd629e12d20d078accabe23004c3c267b00132cadfec46d81c6a7b974d1b6916cd5882a
7
+ data.tar.gz: 1c01be9087ede80a6d83ee3aae7ec9b559c718759311ad9c338883ccf840256b138520ac6fa6b6a13e33278e288113550b0a1f09764e24f252945cd4bea2bc52
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- aka2 (0.1.0)
4
+ aka2 (0.1.2)
5
5
  colorize (~> 0)
6
6
  net-scp (~> 1.2, >= 1.2.1)
7
7
  safe_yaml (~> 1.0, >= 1.0.4)
@@ -29,4 +29,4 @@ DEPENDENCIES
29
29
  rake (~> 10.0)
30
30
 
31
31
  BUNDLED WITH
32
- 1.10.2
32
+ 1.10.6
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/ryangoh/aka2.
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
@@ -1,3 +1,3 @@
1
1
  module Aka
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
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 #create and setup .config file
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("export HISTSIZE=10000","#{Dir.home}/.zshrc")
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("export HISTSIZE=10000","#{Dir.home}/.bashrc")
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("export HISTSIZE=10000","#{Dir.home}/.bash_profile")
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("#{Dir.home}/.aka/.config", "w")
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.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-15 00:00:00.000000000 Z
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