lita-cmd 0.3.2 → 0.3.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: aad579995756a9b615f84a1e21d82a792bd3821b
4
- data.tar.gz: 7537fa112442272d5b5a79adafd26118d9d97e68
3
+ metadata.gz: d4c55c7371df7dbb8d15715d11c70cdaafb665d9
4
+ data.tar.gz: 01daec5f13e0375ae5a0312aedb7dcacde1e165e
5
5
  SHA512:
6
- metadata.gz: 54be9aa10e634b1c3f197d72486790b3c533a4e11630546c6a3a25fa7b2783c01a8d3b82075ffcc4b0946193c30844ca2985a29f9b66558e6436369b4a5bf287
7
- data.tar.gz: ff9f77fac39ba0c58e9f555696d797ffc7b770dae7d36da20df2a747573d6086c70da5b8f53559379d91de13ef431995ef77d7b5f2496804aec7a7497745a243
6
+ metadata.gz: afaa0b051545b223d92641e0087114689594e1ad815886c86d1b3d544750dd6d597872eb3bbc04c784d3091a785f71820317dab8d1fd8c37703f7cb8c510ccf4
7
+ data.tar.gz: b5610b2f197a42161e9ce1d889220d317dc5d6077bfa2ff846efa5e757a854dfea348cc66dec5dee4306fa623326849ff894b01a1fd596f57f7dcdbbddd1208a
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.3.3
2
+ - [3a498f6](https://github.com/dfinninger/lita-cmd/commit/3a498f6d3448bcf044e3981b8c97e739d5920d64): Add support for options with spaces
3
+ - [@sjernigan](https://github.com/sjernigan)
4
+
1
5
  ## 0.3.2
2
6
 
3
7
  - [a79c08b](https://github.com/dfinninger/lita-cmd/commit/a79c08b7cde2295b34d38016827d410962632866): Fix issue with `lita-slack`
@@ -8,4 +12,4 @@
8
12
  - [6aa45ca](https://github.com/dfinninger/lita-cmd/commit/6aa45ca0acc68c8677562704a0d4436189f102f3): Customize stdout/stderr prefixes and code format.
9
13
  - [@DannyBen](https://github.com/DannyBen), [@groob](https://github.com/groob), [@manicholls](https://github.com/manicholls)
10
14
  - [0574baa](https://github.com/dfinninger/lita-cmd/commit/0574baa85e422c71cb064b83dd50479f14194fac): Add MIT License
11
- - [mekhanique](https://github.com/mekhanique)
15
+ - [@mekhanique](https://github.com/mekhanique)
data/README.md CHANGED
@@ -38,7 +38,7 @@ Lita.configure do |config|
38
38
  config.handlers.cmd.stdout_prefix = ""
39
39
  config.handlers.cmd.stderr_prefix = "ERROR: "
40
40
 
41
- # Set the prefix for running scripts.
41
+ # Set the prefix for running scripts.
42
42
  config.handlers.cmd.command_prefix = "run "
43
43
 
44
44
  end
@@ -56,13 +56,17 @@ Query the configured directory for filenames and return the list
56
56
 
57
57
  Execute a file in the configured directory
58
58
 
59
+ ### `lita cmd <file> "option with spaces"`
60
+
61
+ Scripts can be passed in options that contain spaces by surrounding with double quotes
62
+
59
63
 
60
64
  ## Group Control
61
65
 
62
66
  You can control what groups have access to your Lita scripts.
63
67
 
64
- In your `scripts` directory make a sub directory named after each of your
65
- groups. Only users that belong to these groups can list and execute the
68
+ In your `scripts` directory make a sub directory named after each of your
69
+ groups. Only users that belong to these groups can list and execute the
66
70
  scripts inside them.
67
71
 
68
72
  This is the basic directory structure
@@ -75,7 +79,7 @@ scripts/
75
79
  |- script2
76
80
  ```
77
81
 
78
- When you run `lita cmd list` you will only see scripts that you have access
82
+ When you run `lita cmd list` you will only see scripts that you have access
79
83
  to. For example:
80
84
 
81
85
  ```
@@ -92,7 +96,7 @@ lita: Executing the secret script
92
96
 
93
97
  ## Notes
94
98
 
95
- - The user name of the calling user will be saved in an environment variable
99
+ - The user name of the calling user will be saved in an environment variable
96
100
  called `LITA_USER`.
97
101
  - Make sure that your files are executables (`chmod +x FILE`)
98
102
  - Make sure that your files have the proper sheband (`#!/bin/bash`)
@@ -1,4 +1,5 @@
1
1
  require 'open3'
2
+ require 'csv'
2
3
 
3
4
  module Lita
4
5
  module Handlers
@@ -19,7 +20,7 @@ module Lita
19
20
 
20
21
  def run_action(resp)
21
22
  script = resp.matches[0][0]
22
- opts = resp.matches[0][1].split(" ")
23
+ opts = CSV::parse_line(resp.matches[0][1], col_sep: ' ')
23
24
 
24
25
  # the script will be the robot name if command_prefix is empty
25
26
  return if robot_name and script =~ /^@?#{robot_name}$/i
data/lita-cmd.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "lita-cmd"
3
- spec.version = "0.3.2"
3
+ spec.version = "0.3.3"
4
4
  spec.authors = ["Devon Finninger"]
5
5
  spec.email = ["devon.finninger@peopleadmin.com"]
6
6
  spec.description = "Run commands from Lita"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-cmd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Devon Finninger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-01 00:00:00.000000000 Z
11
+ date: 2016-01-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lita