apidragon 1.2.1 → 1.3.0

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: 76ab796cc1ebae10fc5863169dc3c3a4f5f73f83
4
- data.tar.gz: a2eff6d0afb2817fd23855cdcf7943a837dce1d3
3
+ metadata.gz: e44b27d4c1f256b66c5b961033b08eacf4d5ac00
4
+ data.tar.gz: d764e3b81b24c3217f0ba5985c290f4cf293d940
5
5
  SHA512:
6
- metadata.gz: b73ff42605b6ca031cd0eaa53bf6ca6ff8de6de87f09ca594c32610dcedfd5520dbfe96ab7b027e2ea67325736f66d221a1d7f318c0998576381bb2b7e9f6e5e
7
- data.tar.gz: 481669fc952dab9f24e432f17395558ab1f58d0e6c3040f95d2e72bf9ec8adb76d6fdec4389688e17625ee610984be10e3b78411d025349d6b92c45d48bc921f
6
+ metadata.gz: aa1cb300824858e9e4860483c16f511885ccb3501bba9f689dd3470e9258a6f55cf38b91f87f860f5b73d21a97265e63f6d256af71036ed3d0b94dd5000f4cf3
7
+ data.tar.gz: 272087cb664a076c799a7e614001679c7027782ae0e8e5f4ccf289703ae89240cbeb2315dffb9d956398f2ef47e2334eef9625947b7bd6242f1015a8fdc7a90c
data/README.md CHANGED
@@ -1,4 +1,5 @@
1
1
  # apidragon: an Api Interaction Automation Framework
2
+ [![Code Climate](https://codeclimate.com/github/isand3r/apidragon/badges/gpa.svg)](https://codeclimate.com/github/isand3r/apidragon)
2
3
 
3
4
  These classes run a sequence of API calls using a configuration file.
4
5
  - config file is read and `vars` are dumped into an `arg_bucket`
@@ -53,8 +54,49 @@ Currently supported modes:
53
54
  - `put`
54
55
  - `delete`
55
56
  - `curl_get`, `curl_post` (uses curl instead of the `rest-client` gem for special cases)
57
+ - `plugin`
56
58
  - Planned: `curl_put`, `curl_delete`
57
59
 
60
+ ## get, post, put, delete
61
+
62
+ Makes an api call using the respective HTTP verb through the rest-client gem.
63
+
64
+ ## curl_get, curl_post
65
+
66
+ Makes an api call using the respective HTTP verb through curl.
67
+
68
+ ## plugin
69
+
70
+ Evaluates the given line of ruby code through `eval()`.
71
+ - e.g.:
72
+ - test.rb (@/tmp/apidragonplugins/):
73
+ ```ruby
74
+ class Plugin
75
+ def initialize(message)
76
+ @message = message
77
+ end
78
+
79
+ def run
80
+ puts "This is a test, here are my args: \n #{@message}"
81
+ end
82
+ end
83
+ ```
84
+ - apidragonconf.yaml:
85
+ ```yaml
86
+ vars:
87
+ test: test
88
+ example:
89
+ test:
90
+ function: Plugin.new(@arg_bucket).run # initializes and calls the run function for my Plugin class, passing the arg_bucket.
91
+ plugin: test
92
+ mode: plugin
93
+ ```
94
+ - ouput of `apidragon do example`:
95
+ ```
96
+ This is a test, here are my args:
97
+ {"test" => "test"}
98
+ ```
99
+
58
100
  # Further Options
59
101
 
60
102
  ## record
@@ -114,7 +156,6 @@ Each call can refer to a plugin file. The Plugin class should follow the structu
114
156
 
115
157
 
116
158
  # Planned Features
117
- - The ability to include custom scripts at the end of a call for extensibility
118
159
  - Support for multiple instances of variable names for different api's
119
160
 
120
161
  #License
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.1
1
+ 1.3.0
data/apidragon.gemspec CHANGED
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: apidragon 1.2.1 ruby lib
5
+ # stub: apidragon 1.3.0 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "apidragon"
9
- s.version = "1.2.1"
9
+ s.version = "1.3.0"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["isaiah thiessen"]
14
- s.date = "2015-12-02"
14
+ s.date = "2015-12-03"
15
15
  s.description = "Ruby based CLI for accessing veracode's api"
16
16
  s.email = "isaiah.thiessen@live.ca"
17
17
  s.executables = ["apidragon"]
@@ -53,6 +53,8 @@ class Call < ArgBucket
53
53
  command = "curl -v -X POST --url #{@function}"
54
54
  curl_request command
55
55
  @response = `#{command}`
56
+ when 'plugin'
57
+ eval("#{@function}")
56
58
  else
57
59
  puts "#{@mode} not supported."
58
60
  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.2.1
4
+ version: 1.3.0
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-02 00:00:00.000000000 Z
11
+ date: 2015-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport