apidragon 1.7.0 → 1.7.1

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: 4bb9340ddb9f9df72bce7f1f5c05c35e0b049f64
4
- data.tar.gz: df62dd89a2393c6815f2e7b6bd3d15008ea89776
3
+ metadata.gz: c7366413d79773c8e33c3d94a5fe1e64e4fae174
4
+ data.tar.gz: e0c297e44c47882c66dd8d6cd7e327030b0fbd5d
5
5
  SHA512:
6
- metadata.gz: 52be6cbbd55a21bf4efcec305f5aa34172920a9b0b73f9dfeb5d153d9394321f157afb181a9d66e0afe82d25dcc1ea16089577055e37a35a266b5279d1087641
7
- data.tar.gz: 365925635e3da06754c38bf5ee56e3e6b6ed5fde1749784917db198b40e032beaf1e8b32c9915c2d4bf247ea97ba2793c0cb7230094b2d443e73a3a34bb33202
6
+ metadata.gz: f8bf6d4e7ca869c63ff0f3e237478ec0a29197bef609c718bcd914c9f338ca403764bb4ab1e76a66125739cf1db91dd1a2f48358a98b670610ef13ca4b3e6443
7
+ data.tar.gz: 1b25c82b93c668be525010aef6a66f84bdd840dc984301d3df8800ae4a11d704ce1b2c46bef7c8394a8fc06a95d297593b78cc209aea5df1dc9eb18fff1b2456
data/README.md CHANGED
@@ -170,7 +170,7 @@ Each call can refer to a plugin file. The Plugin class should follow the structu
170
170
 
171
171
 
172
172
  # Planned Features
173
- - Support for multiple instances of variable names for different api's
173
+ - Ability to pass any variables as options at the command line
174
174
 
175
175
  #License
176
176
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.7.0
1
+ 1.7.1
data/bin/apidragon CHANGED
@@ -6,7 +6,7 @@ require_relative '../lib/apidragon.rb'
6
6
 
7
7
  Commander.configure do
8
8
  program :name, 'apidragon'
9
- program :version, '1.7.0'
9
+ program :version, '1.7.1'
10
10
  program :description, 'CLI for automating api requests'
11
11
  program :help, 'Author', 'Isaiah Thiessen <isaiah.thiessen@telus.com>'
12
12
 
@@ -54,11 +54,7 @@ class Call < ArgBucket
54
54
  curl_request command
55
55
  @response = `#{command}`
56
56
  when 'plugin'
57
- begin
58
57
  Object.const_get(@plugin).new(@arg_bucket).run
59
- rescue
60
- puts 'Plugin initialization failed. Class or methods may be incorrectly defined.'
61
- end
62
58
  else
63
59
  puts "#{@mode} not supported."
64
60
  end
@@ -0,0 +1,16 @@
1
+ class SlackNotify
2
+ def initialize(args)
3
+ @args = args
4
+ end
5
+
6
+ def run
7
+ f = File.open '/tmp/report.json', 'w'
8
+ f.write @args['response']
9
+ puts 'file created'
10
+ f.close
11
+ r = `curl https://slack.com/api/files.upload -F 'token=#{@args['token']}' -F 'file=@/tmp/report.json' -F 'channels=#{@args['channel']}'`
12
+ File.delete '/tmp/report.json'
13
+ puts 'file deleted'
14
+ puts r
15
+ end
16
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apidragon
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - isaiah thiessen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-16 00:00:00.000000000 Z
11
+ date: 2015-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -257,6 +257,7 @@ files:
257
257
  - lib/apidragon/macro.rb
258
258
  - lib/apidragon/parser.rb
259
259
  - plugin_examples/GitClone.rb
260
+ - plugin_examples/SlackNotify.rb
260
261
  homepage: http://github.com/isand3r/apidragon
261
262
  licenses:
262
263
  - MIT