jive 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/jive/cli.rb +13 -5
  3. data/lib/jive/version.rb +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ecf28e3a1d722522cb6fc2bb810c34563ba78f81209f78f8a4abc7e628c6f23e
4
- data.tar.gz: 9c8c3e0390939c7393b7cc170d538f3f1a97595d8c4b8783dac66cd000067ecd
3
+ metadata.gz: e4e977bb29d50702ee9aa80637724df04b013cf102459d68253463f2054783a1
4
+ data.tar.gz: fc7378411041145f99299af960523978bae18943444747f65b8ff6abdb311cb7
5
5
  SHA512:
6
- metadata.gz: f1631fb5229c44e2ab09e3c38723e7db97822a3c7fa0525220b9f901b38d8ee1a6f7e19e2c9d138bab405edb7ec1d4c7c210020e18c3092fc76577b867db9f73
7
- data.tar.gz: 842ac071b5edf167f5c9c240faf4466cbee6979bdfa797fed89e60f4db852486da68ae2d8e1186e8d4229af69e671e08a0b2716a4435f0eea96dd25b47d4b62d
6
+ metadata.gz: 851701b9f269cbdf0f56fe08a84cfe45551540d6b2916aee515315aef700378def2253cfbb6de9f75ca25e14982384c2a30ca3c04c4ffcea8b06c834aa82bb55
7
+ data.tar.gz: 2966d909607b30a2db80b023f554c0f81eda2fdbb22feb161eb3716e87cf8afc92652788a3afd753af7109a25751512e99ff9f2ce3a9e224b3f58ae0f6d2ca35
data/lib/jive/cli.rb CHANGED
@@ -1,8 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "pathname"
3
4
  require "thor"
5
+ require "yaml"
6
+
4
7
  require "jive"
5
- require "pathname"
6
8
 
7
9
  module Jive
8
10
  module Cli
@@ -13,15 +15,21 @@ module Jive
13
15
 
14
16
  desc "cd <org>/<project>", "cd to ~/src/github.com/<org>/<project>"
15
17
  def cd(slug)
16
- runner.run_safely do
17
- Git.new(runner).cd(slug)
18
- end
18
+ runner.run_safely { Git.new(runner).cd(slug) }
19
19
  end
20
20
 
21
21
  desc "clone <org>/<project>", "git clone to ~/src/github.com/<org>/<project>"
22
22
  def clone(slug)
23
+ runner.run_safely { Git.new(runner).clone(slug) }
24
+ end
25
+
26
+ desc "exec <command>", "run command from jive.yml"
27
+ def exec(command)
28
+ path = Pathname.pwd.join("jive.yml")
29
+ return shell.error("Error: jive.yml not found") unless path.exist?
30
+
23
31
  runner.run_safely do
24
- Git.new(runner).clone(slug)
32
+ runner.execute(YAML.safe_load(path.read).dig("commands", command))
25
33
  end
26
34
  end
27
35
 
data/lib/jive/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Jive
4
- VERSION = "0.2.2"
4
+ VERSION = "0.2.3"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jive
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - mo khan
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-02-06 00:00:00.000000000 Z
11
+ date: 2021-02-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor