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.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +4 -0
  3. data/bin/c42 +29 -2
  4. data/lib/c42/version.rb +1 -1
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 567240f4be27b888a23b62044ecfda13c07e389f
4
- data.tar.gz: 7b45478240bf52daefeaba7af9fa2edf6f4c5e73
3
+ metadata.gz: a164dc1419071728406a269f3c7f4d1c2b2ab67c
4
+ data.tar.gz: daa69e6feb4c43e7f4240e60f8db08912c673657
5
5
  SHA512:
6
- metadata.gz: e8246458c782ad341207433de4108bc8276fb26bbfae264ed46aa4b7703136184239f7e39653a4f42dc8a67e695dc59d479f0b67627cfa4d6ee0f514e1eaea9b
7
- data.tar.gz: e5a88618d892bfb2b93565b5964a4433cd204a85921fe68dac9c32928a28c91f17536c611facf0421e94a6c8bee053121cab0c7c9f97c6df278ac91408d357aa
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
@@ -1,3 +1,3 @@
1
1
  module C42
2
- VERSION = "0.0.10"
2
+ VERSION = "0.0.11"
3
3
  end
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.10
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-10-19 00:00:00.000000000 Z
11
+ date: 2017-12-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor