c42 0.0.10 → 0.0.11
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 +4 -0
- data/bin/c42 +29 -2
- data/lib/c42/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a164dc1419071728406a269f3c7f4d1c2b2ab67c
|
4
|
+
data.tar.gz: daa69e6feb4c43e7f4240e60f8db08912c673657
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5eebe76619a38ce95304a081ca65ab55b0f780ca3b873529c7ac7e7c561843e0ca3fe8eb2ec127c612e2a11528afc37e6a26dbb3cf615c8b612081a6da1564a2
|
7
|
+
data.tar.gz: 4577c8b8f4055bff494e2dc46adc93ad3ff5c62767c4f5f26e87ef4ee8adf3fd3ad83fcf452307463e37f7c45ad1cd2a28d2a000a2e5611a78502e4da06e6d0f
|
data/README.md
CHANGED
@@ -1,2 +1,6 @@
|
|
1
1
|
# C42
|
2
2
|
C42 is based on Thor but with simple override implementation and loading recursively
|
3
|
+
|
4
|
+
## Hidden features
|
5
|
+
`--install-completions` as only argument installs auto completions inside your ~/.[bash|zsh]rc
|
6
|
+
`--c42file filepath` as first argument overrides the last interpreted c42file (ie: all tasks in this file can override others)
|
data/bin/c42
CHANGED
@@ -2,11 +2,38 @@
|
|
2
2
|
# -*- mode: ruby -*-
|
3
3
|
$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__)+"/../lib"))
|
4
4
|
|
5
|
-
require "c42/runner"
|
6
|
-
|
7
5
|
c42file = nil
|
8
6
|
if ARGV.count > 1 && ARGV[0] == "--c42file"
|
9
7
|
ARGV.shift # into void
|
10
8
|
c42file = ARGV.shift
|
11
9
|
end
|
10
|
+
if ARGV.count == 1 && ARGV[0] == "--install-completions"
|
11
|
+
%w(bashrc zshrc).each do |rc|
|
12
|
+
rc_shortpath = "~/.#{rc}"
|
13
|
+
rc_path = File.expand_path(rc_shortpath)
|
14
|
+
comp_path = File.join(File.dirname(__FILE__), "../extra/_c42.#{rc}")
|
15
|
+
if File.exists?(rc_path) && File.exists?(comp_path)
|
16
|
+
puts "Processing #{rc_shortpath} ..."
|
17
|
+
completions = File.read(comp_path)
|
18
|
+
if File.read(rc_path).include?(completions)
|
19
|
+
puts "Completions are already there, skipping."
|
20
|
+
else
|
21
|
+
require "date"
|
22
|
+
open(rc_path, 'a') do |f|
|
23
|
+
f.puts ""
|
24
|
+
f.puts "# Autocompletion for c42 tool"
|
25
|
+
f.puts "# Added at #{DateTime.now.strftime("%F %R")}"
|
26
|
+
f.puts ""
|
27
|
+
f.puts completions
|
28
|
+
end
|
29
|
+
puts "Completions appended."
|
30
|
+
end
|
31
|
+
else
|
32
|
+
puts "#{rc_shortpath} not found, skipping."
|
33
|
+
end
|
34
|
+
end
|
35
|
+
exit;
|
36
|
+
end
|
37
|
+
|
38
|
+
require "c42/runner"
|
12
39
|
C42::Runner.run(c42file)
|
data/lib/c42/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: c42
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- commit42
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-12-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|