c42 0.0.11 → 0.0.12

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: a164dc1419071728406a269f3c7f4d1c2b2ab67c
4
- data.tar.gz: daa69e6feb4c43e7f4240e60f8db08912c673657
3
+ metadata.gz: 4641759e40c56237d7ecd4281ef5d2061e0a4bcf
4
+ data.tar.gz: a773b9ba1728c2f620ce121c1f67c2150f986588
5
5
  SHA512:
6
- metadata.gz: 5eebe76619a38ce95304a081ca65ab55b0f780ca3b873529c7ac7e7c561843e0ca3fe8eb2ec127c612e2a11528afc37e6a26dbb3cf615c8b612081a6da1564a2
7
- data.tar.gz: 4577c8b8f4055bff494e2dc46adc93ad3ff5c62767c4f5f26e87ef4ee8adf3fd3ad83fcf452307463e37f7c45ad1cd2a28d2a000a2e5611a78502e4da06e6d0f
6
+ metadata.gz: cf9bebff2a44b28fa526f88a13c5dbc8aa57a5b5443a7d63c343907bd56f6c4f1133639dd816ea84f0c2123028d0b163b4e93f6adcd6231f185d01fe1bee2ccc
7
+ data.tar.gz: d32d05137ec3346afc5c21a19b1a5d92abf8b5e010d368adb53f0e6ca8a72e01044ffd76f588b55b1041231941cf98fa5048f5db2bbfe6c8f575ef05f7c168a7
data/bin/c42 CHANGED
@@ -11,7 +11,7 @@ if ARGV.count == 1 && ARGV[0] == "--install-completions"
11
11
  %w(bashrc zshrc).each do |rc|
12
12
  rc_shortpath = "~/.#{rc}"
13
13
  rc_path = File.expand_path(rc_shortpath)
14
- comp_path = File.join(File.dirname(__FILE__), "../extra/_c42.#{rc}")
14
+ comp_path = File.join(File.dirname(__FILE__), "../extras/_c42.#{rc}")
15
15
  if File.exists?(rc_path) && File.exists?(comp_path)
16
16
  puts "Processing #{rc_shortpath} ..."
17
17
  completions = File.read(comp_path)
@@ -36,4 +36,4 @@ if ARGV.count == 1 && ARGV[0] == "--install-completions"
36
36
  end
37
37
 
38
38
  require "c42/runner"
39
- C42::Runner.run(c42file)
39
+ C42::Runner.run(c42file)
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.description = "C42 is an internal toolkit for chores based on Thor."
11
11
  spec.email = "contact@commit42.fr"
12
12
  spec.executables = %w(c42)
13
- spec.files = %w(c42.gemspec) + Dir["*.md", "bin/*", "lib/**/*.rb"]
13
+ spec.files = %w(c42.gemspec) + Dir["*.md", "bin/*", "extras/*", "lib/**/*.rb"]
14
14
  spec.homepage = "http://commit42.fr"
15
15
  spec.licenses = %w(MIT)
16
16
  spec.name = "c42"
@@ -0,0 +1,7 @@
1
+ _c42() {
2
+ if [ $COMP_CWORD == 1 ]; then
3
+ local cur="${COMP_WORDS[COMP_CWORD]}"
4
+ COMPREPLY=( $(compgen -W "$(c42 | awk '$2' | awk '{print $2}' | tr "\n" " ")" -- $cur) )
5
+ fi;
6
+ }
7
+ complete -F _c42 c42
@@ -0,0 +1,9 @@
1
+ #compdef c42
2
+
3
+ function _c42() {
4
+ if [[ $CURRENT -eq 2 ]]; then
5
+ OLD_IFS=$IFS; IFS=$'\n'
6
+ _values 'c42 commands' $(c42 --help | awk 'BEGIN { FS="#"; } { split($1, a, " ") ; cmd=a[2]; desc=$2; gsub(/^[ \t]/ "", cmd); gsub(/^[ \t]/, "", desc) ; gsub(/\[/, "\\[", desc); gsub(/\]/, "\\]", desc); printf "%s[%s]\n",cmd,desc }' | sed 's/:/\\:/' | grep -v "\[\]")
7
+ IFS=$OLD_IFS
8
+ fi
9
+ }
@@ -1,3 +1,3 @@
1
1
  module C42
2
- VERSION = "0.0.11"
2
+ VERSION = "0.0.12"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: c42
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - commit42
@@ -48,6 +48,8 @@ files:
48
48
  - README.md
49
49
  - bin/c42
50
50
  - c42.gemspec
51
+ - extras/_c42.bashrc
52
+ - extras/_c42.zshrc
51
53
  - lib/c42.rb
52
54
  - lib/c42/c42file.rb
53
55
  - lib/c42/runner.rb