apiaryio 0.4.2 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.rubocop_todo.yml +42 -0
- data/README.md +10 -11
- data/Rakefile +1 -1
- data/apiary.gemspec +24 -23
- data/bin/apiary +1 -1
- data/circle.yml +2 -0
- data/features/step_definitions/file_content_step.rb +2 -2
- data/features/support/env.rb +7 -7
- data/lib/apiary/agent.rb +1 -1
- data/lib/apiary/cli.rb +16 -17
- data/lib/apiary/command/fetch.rb +8 -8
- data/lib/apiary/command/preview.rb +77 -87
- data/lib/apiary/command/publish.rb +60 -61
- data/lib/apiary/helpers.rb +6 -6
- data/lib/apiary/helpers/javascript_helper.rb +19 -23
- data/lib/apiary/version.rb +1 -1
- data/spec/apiary/cli_spec.rb +9 -12
- data/spec/apiary/command/fetch_spec.rb +6 -9
- data/spec/apiary/command/preview_spec.rb +3 -5
- data/spec/apiary/command/publish_spec.rb +13 -19
- data/spec/apiary/helpers_spec.rb +3 -3
- data/spec/spec_helper.rb +3 -3
- metadata +36 -31
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 4a36c2e7ac9a3e128f7829c1d5ed3be33548d341
|
4
|
+
data.tar.gz: 17c8f132e9f9a61385d19fa17242267537b84b17
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 818e3ec9b05cbf51af887e9626e1b4f39cd3083e0c543cb4a0eac6d004054274e3d0c85bccbc67b104b52110c4ec2caf47a84de8da54f6fdfa1b9022fc30be91
|
7
|
+
data.tar.gz: a500c7a68dc6241c636ad20d7af3a293fb9198e69c52b0b3dcd56389f0847668ed0c9d892ea823c945c3c32f20c0f837389de10f3e5cc5b88a1125eb37d323b6
|
data/.rubocop_todo.yml
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
Lint/Eval:
|
2
|
+
Exclude:
|
3
|
+
- 'Rakefile'
|
4
|
+
|
5
|
+
Lint/UnusedBlockArgument:
|
6
|
+
Exclude:
|
7
|
+
- 'lib/apiary/command/preview.rb'
|
8
|
+
|
9
|
+
Metrics/AbcSize:
|
10
|
+
Max: 25
|
11
|
+
|
12
|
+
|
13
|
+
Metrics/LineLength:
|
14
|
+
Max: 180
|
15
|
+
Exclude:
|
16
|
+
- 'spec/*'
|
17
|
+
- 'spec/apiary/*'
|
18
|
+
- 'spec/apiary/command/*'
|
19
|
+
|
20
|
+
Metrics/MethodLength:
|
21
|
+
Max: 26
|
22
|
+
|
23
|
+
Style/ClassAndModuleChildren:
|
24
|
+
Enabled: false
|
25
|
+
|
26
|
+
Style/ClassVars:
|
27
|
+
Enabled: false
|
28
|
+
|
29
|
+
Style/Documentation:
|
30
|
+
Enabled: false
|
31
|
+
|
32
|
+
Style/RegexpLiteral:
|
33
|
+
Enabled: false
|
34
|
+
EnforcedStyle: slashes
|
35
|
+
|
36
|
+
Style/UnneededInterpolation:
|
37
|
+
Enabled: false
|
38
|
+
|
39
|
+
Style/MutableConstant:
|
40
|
+
Exclude:
|
41
|
+
- 'lib/apiary/helpers/javascript_helper.rb'
|
42
|
+
- 'spec/apiary/command/fetch_spec.rb'
|
data/README.md
CHANGED
@@ -59,7 +59,7 @@ $ apiary help
|
|
59
59
|
Commands:
|
60
60
|
apiary fetch --api-name=API_NAME # Fetch API Description Document from API_NAME.apiary.io
|
61
61
|
apiary help [COMMAND] # Describe available commands or one specific command
|
62
|
-
apiary preview # Show API documentation in
|
62
|
+
apiary preview # Show API documentation in browser or write it to file
|
63
63
|
apiary publish --api-name=API_NAME # Publish API Description Document on docs.API_NAME.apiary.io
|
64
64
|
apiary version # Show version
|
65
65
|
|
@@ -90,16 +90,15 @@ Usage:
|
|
90
90
|
apiary preview
|
91
91
|
|
92
92
|
Options:
|
93
|
-
[--browser=
|
94
|
-
|
95
|
-
[--
|
96
|
-
[--
|
97
|
-
[--
|
98
|
-
[--
|
99
|
-
[--
|
100
|
-
|
101
|
-
|
102
|
-
Show API documentation in default browser
|
93
|
+
[--browser=BROWSER] # Show API documentation in specified browser (full command is needed - e.g. `--browser='open -a safari'` in case of osx)
|
94
|
+
[--output=FILE] # Write generated HTML into specified file
|
95
|
+
[--path=PATH] # Specify path to API Description Document. When given a directory, it will look for apiary.apib or swagger.yaml file
|
96
|
+
[--api-host=HOST] # Specify apiary host
|
97
|
+
[--server], [--no-server] # Start standalone web server on port 8080
|
98
|
+
[--port=PORT] # Set port for --server option
|
99
|
+
[--host=HOST] # Set host for --server option
|
100
|
+
|
101
|
+
Show API documentation in browser or write it to file
|
103
102
|
```
|
104
103
|
|
105
104
|
#### publish
|
data/Rakefile
CHANGED
data/apiary.gemspec
CHANGED
@@ -5,33 +5,34 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
5
5
|
require 'apiary/version'
|
6
6
|
|
7
7
|
Gem::Specification.new do |gem|
|
8
|
-
gem.name =
|
8
|
+
gem.name = 'apiaryio'
|
9
9
|
gem.version = Apiary::VERSION
|
10
|
-
gem.authors = [
|
11
|
-
gem.email = [
|
10
|
+
gem.authors = ['Apiary Ltd.']
|
11
|
+
gem.email = ['team@apiary.io']
|
12
12
|
|
13
|
-
gem.description =
|
14
|
-
gem.summary =
|
15
|
-
gem.homepage =
|
16
|
-
gem.license =
|
13
|
+
gem.description = 'Apiary.io CLI'
|
14
|
+
gem.summary = 'Apiary.io CLI'
|
15
|
+
gem.homepage = 'http://apiary.io'
|
16
|
+
gem.license = 'MIT'
|
17
17
|
|
18
|
-
gem.files = `git ls-files`.split(
|
19
|
-
gem.bindir =
|
20
|
-
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
18
|
+
gem.files = `git ls-files`.split($OUTPUT_RECORD_SEPARATOR)
|
19
|
+
gem.bindir = 'bin'
|
20
|
+
gem.executables = gem.files.grep(%r{^bin/}).map { |f| File.basename(f) }
|
21
21
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
22
|
-
gem.require_paths = [
|
22
|
+
gem.require_paths = ['lib']
|
23
23
|
|
24
|
-
gem.
|
25
|
-
gem.
|
26
|
-
gem.
|
24
|
+
gem.add_runtime_dependency 'rest-client', '~> 1.8'
|
25
|
+
gem.add_runtime_dependency 'rack', '~> 1.6.4'
|
26
|
+
gem.add_runtime_dependency 'thor', '~> 0.19.1'
|
27
|
+
gem.add_runtime_dependency 'json', '~> 1.8'
|
28
|
+
gem.add_runtime_dependency 'launchy', '~> 2.4'
|
27
29
|
|
28
|
-
gem.
|
29
|
-
|
30
|
-
gem.add_development_dependency
|
31
|
-
gem.add_development_dependency
|
32
|
-
gem.add_development_dependency
|
33
|
-
gem.add_development_dependency
|
34
|
-
gem.add_development_dependency
|
35
|
-
gem.add_development_dependency
|
36
|
-
gem.add_development_dependency "cucumber", "~> 2.0"
|
30
|
+
gem.add_development_dependency 'bundler', '~> 1.12'
|
31
|
+
gem.add_development_dependency 'rake', '~> 10.0'
|
32
|
+
gem.add_development_dependency 'rspec', '~> 3.4'
|
33
|
+
gem.add_development_dependency 'webmock', '~> 2.0'
|
34
|
+
gem.add_development_dependency 'yard', '~> 0.8'
|
35
|
+
gem.add_development_dependency 'aruba', '~> 0.14'
|
36
|
+
gem.add_development_dependency 'cucumber', '~> 2.0'
|
37
|
+
gem.add_development_dependency 'rubocop', '~> 0.41.2'
|
37
38
|
end
|
data/bin/apiary
CHANGED
data/circle.yml
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
Then
|
1
|
+
Then(/^the output should contain the content of file "(.*)"$/) do |filename|
|
2
2
|
expected = nil
|
3
3
|
cd('../../spec/fixtures') do
|
4
4
|
expected = File.read(filename)
|
5
5
|
end
|
6
6
|
|
7
|
-
actual = all_commands.map
|
7
|
+
actual = all_commands.map(&:output).join("\n")
|
8
8
|
|
9
9
|
expect(unescape_text(actual)).to include(unescape_text(expected))
|
10
10
|
end
|
data/features/support/env.rb
CHANGED
@@ -4,17 +4,17 @@ Before('@needs_apiary_api_key') do
|
|
4
4
|
@aruba_timeout_seconds = 45
|
5
5
|
end
|
6
6
|
|
7
|
-
Around('@needs_apiary_api_key') do |
|
7
|
+
Around('@needs_apiary_api_key') do |_scenario, block|
|
8
8
|
# DEBUG puts "Scenario #{scenario.name} wants APIARY_API_KEY."
|
9
|
-
original_value = ENV.delete(
|
10
|
-
ENV[
|
9
|
+
original_value = ENV.delete('APIARY_API_KEY')
|
10
|
+
ENV['APIARY_API_KEY'] = '340bda135034529ab2abf341295c3aa2' # XXX
|
11
11
|
block.call
|
12
|
-
ENV[
|
12
|
+
ENV['APIARY_API_KEY'] = original_value
|
13
13
|
end
|
14
14
|
|
15
|
-
Around('@doesnt_need_apiary_api_key') do |
|
15
|
+
Around('@doesnt_need_apiary_api_key') do |_scenario, block|
|
16
16
|
# DEBUG puts "Scenario #{scenario.name} doesn't want APIARY_API_KEY."
|
17
|
-
original_value = ENV.delete(
|
17
|
+
original_value = ENV.delete('APIARY_API_KEY')
|
18
18
|
block.call
|
19
|
-
ENV[
|
19
|
+
ENV['APIARY_API_KEY'] = original_value
|
20
20
|
end
|
data/lib/apiary/agent.rb
CHANGED
data/lib/apiary/cli.rb
CHANGED
@@ -6,25 +6,24 @@ require 'apiary/command/publish'
|
|
6
6
|
|
7
7
|
module Apiary
|
8
8
|
class CLI < Thor
|
9
|
-
|
10
9
|
desc 'fetch', 'Fetch API Description Document from API_NAME.apiary.io'
|
11
|
-
method_option :api_name, :
|
12
|
-
method_option :api_host, :
|
13
|
-
method_option :output, :
|
10
|
+
method_option :api_name, type: :string, required: true
|
11
|
+
method_option :api_host, type: :string, banner: 'HOST', desc: 'Specify apiary host'
|
12
|
+
method_option :output, type: :string, banner: 'FILE', desc: 'Write API Description Document into specified file'
|
14
13
|
|
15
14
|
def fetch
|
16
15
|
cmd = Apiary::Command::Fetch.new options
|
17
16
|
cmd.execute
|
18
17
|
end
|
19
18
|
|
20
|
-
desc 'preview', 'Show API documentation in
|
21
|
-
method_option :browser, :
|
22
|
-
method_option :output, :
|
23
|
-
method_option :path, :
|
24
|
-
method_option :api_host, :
|
25
|
-
method_option :server, :
|
26
|
-
method_option :port, :
|
27
|
-
method_option :host, :
|
19
|
+
desc 'preview', 'Show API documentation in browser or write it to file'
|
20
|
+
method_option :browser, type: :string, desc: 'Show API documentation in specified browser (full command is needed - e.g. `--browser=\'open -a safari\'` in case of osx)'
|
21
|
+
method_option :output, type: :string, banner: 'FILE', desc: 'Write generated HTML into specified file'
|
22
|
+
method_option :path, type: :string, desc: 'Specify path to API Description Document. When given a directory, it will look for apiary.apib or swagger.yaml file'
|
23
|
+
method_option :api_host, type: :string, banner: 'HOST', desc: 'Specify apiary host'
|
24
|
+
method_option :server, type: :boolean, desc: 'Start standalone web server on port 8080'
|
25
|
+
method_option :port, type: :numeric, banner: 'PORT', desc: 'Set port for --server option'
|
26
|
+
method_option :host, type: :string, desc: 'Set host for --server option'
|
28
27
|
|
29
28
|
def preview
|
30
29
|
cmd = Apiary::Command::Preview.new options
|
@@ -32,10 +31,10 @@ module Apiary
|
|
32
31
|
end
|
33
32
|
|
34
33
|
desc 'publish', 'Publish API Description Document on docs.API_NAME.apiary.io'
|
35
|
-
method_option :message, :
|
36
|
-
method_option :path, :
|
37
|
-
method_option :api_host, :
|
38
|
-
method_option :api_name, :
|
34
|
+
method_option :message, type: :string, banner: 'COMMIT_MESSAGE', desc: 'Publish with custom commit message'
|
35
|
+
method_option :path, type: :string, desc: 'Specify path to API Description Document. When given a directory, it will look for apiary.apib or swagger.yaml file'
|
36
|
+
method_option :api_host, type: :string, banner: 'HOST', desc: 'Specify apiary host'
|
37
|
+
method_option :api_name, type: :string, required: true
|
39
38
|
|
40
39
|
def publish
|
41
40
|
cmd = Apiary::Command::Publish.new options
|
@@ -43,7 +42,7 @@ module Apiary
|
|
43
42
|
end
|
44
43
|
|
45
44
|
desc 'version', 'Show version'
|
46
|
-
method_option :
|
45
|
+
method_option aliases: '-v'
|
47
46
|
|
48
47
|
def version
|
49
48
|
puts Apiary::VERSION
|
data/lib/apiary/command/fetch.rb
CHANGED
@@ -9,7 +9,6 @@ require 'apiary/agent'
|
|
9
9
|
module Apiary::Command
|
10
10
|
# Retrieve blueprint from apiary
|
11
11
|
class Fetch
|
12
|
-
|
13
12
|
def initialize(opts)
|
14
13
|
@options = OpenStruct.new(opts)
|
15
14
|
@options.api_host ||= 'api.apiary.io'
|
@@ -17,18 +16,19 @@ module Apiary::Command
|
|
17
16
|
@options.api_key ||= ENV['APIARY_API_KEY']
|
18
17
|
@options.proxy ||= ENV['http_proxy']
|
19
18
|
@options.headers ||= {
|
20
|
-
:
|
21
|
-
:
|
22
|
-
:
|
23
|
-
:
|
19
|
+
accept: 'text/html',
|
20
|
+
content_type: 'text/plain',
|
21
|
+
authentication: "Token #{@options.api_key}",
|
22
|
+
user_agent: Apiary.user_agent
|
24
23
|
}
|
25
24
|
end
|
26
25
|
|
27
26
|
def execute
|
28
27
|
response = fetch_from_apiary
|
29
|
-
|
30
|
-
|
31
|
-
|
28
|
+
|
29
|
+
return unless response.instance_of? String
|
30
|
+
|
31
|
+
puts response
|
32
32
|
end
|
33
33
|
|
34
34
|
def fetch_from_apiary
|
@@ -5,120 +5,110 @@ require 'ostruct'
|
|
5
5
|
require 'json'
|
6
6
|
require 'tmpdir'
|
7
7
|
require 'erb'
|
8
|
+
require 'launchy'
|
8
9
|
|
9
10
|
require 'apiary/agent'
|
10
11
|
require 'apiary/helpers'
|
11
12
|
require 'apiary/helpers/javascript_helper'
|
12
13
|
|
13
14
|
module Apiary::Command
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
15
|
+
# Display preview of local blueprint file
|
16
|
+
class Preview
|
17
|
+
include Apiary::Helpers
|
18
|
+
include Apiary::Helpers::JavascriptHelper
|
19
|
+
|
20
|
+
PREVIEW_TEMPLATE_PATH = "#{File.expand_path File.dirname(__FILE__)}/../file_templates/preview.erb".freeze
|
21
|
+
|
22
|
+
attr_reader :options
|
23
|
+
|
24
|
+
def initialize(opts)
|
25
|
+
@options = OpenStruct.new(opts)
|
26
|
+
@options.path ||= '.'
|
27
|
+
@options.api_host ||= 'api.apiary.io'
|
28
|
+
@options.port ||= 8080
|
29
|
+
@options.proxy ||= ENV['http_proxy']
|
30
|
+
@options.server ||= false
|
31
|
+
@options.host ||= '127.0.0.1'
|
32
|
+
@options.headers ||= {
|
33
|
+
accept: 'text/html',
|
34
|
+
content_type: 'text/plain',
|
35
|
+
user_agent: Apiary.user_agent
|
25
36
|
}
|
26
37
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
@options.path ||= '.'
|
32
|
-
@options.api_host ||= 'api.apiary.io'
|
33
|
-
@options.port ||= 8080
|
34
|
-
@options.proxy ||= ENV['http_proxy']
|
35
|
-
@options.server ||= false
|
36
|
-
@options.host ||= '127.0.0.1'
|
37
|
-
@options.headers ||= {
|
38
|
-
:accept => 'text/html',
|
39
|
-
:content_type => 'text/plain',
|
40
|
-
:user_agent => Apiary.user_agent
|
41
|
-
}
|
42
|
-
|
43
|
-
begin
|
44
|
-
@source_path = api_description_source_path(@options.path)
|
45
|
-
rescue Exception => e
|
46
|
-
abort "#{e.message}"
|
47
|
-
end
|
38
|
+
begin
|
39
|
+
@source_path = api_description_source_path(@options.path)
|
40
|
+
rescue StandardError => e
|
41
|
+
abort "#{e.message}"
|
48
42
|
end
|
43
|
+
end
|
49
44
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
end
|
45
|
+
def execute
|
46
|
+
if @options.server
|
47
|
+
server
|
48
|
+
else
|
49
|
+
show
|
56
50
|
end
|
51
|
+
end
|
57
52
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
end
|
62
|
-
|
63
|
-
Rack::Server.start(:Port => @options.port, :Host => @options.host, :app => app)
|
53
|
+
def server
|
54
|
+
app = rack_app do
|
55
|
+
generate
|
64
56
|
end
|
65
57
|
|
66
|
-
|
67
|
-
|
58
|
+
Rack::Server.start(Port: @options.port, Host: @options.host, app: app)
|
59
|
+
end
|
68
60
|
|
69
|
-
|
70
|
-
|
71
|
-
file.flush
|
72
|
-
@options.output ? write_generated_path(file.path, @options.output) : open_generated_page(file.path)
|
73
|
-
end
|
74
|
-
end
|
61
|
+
def show
|
62
|
+
preview_string = generate
|
75
63
|
|
76
|
-
|
77
|
-
|
64
|
+
File.open(preview_path, 'w') do |file|
|
65
|
+
file.write preview_string
|
66
|
+
file.flush
|
67
|
+
@options.output ? write_generated_path(file.path, @options.output) : open_generated_page(file.path)
|
78
68
|
end
|
69
|
+
end
|
79
70
|
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
end
|
71
|
+
def rack_app
|
72
|
+
Rack::Builder.new do
|
73
|
+
run ->(env) { [200, {}, [yield]] }
|
84
74
|
end
|
75
|
+
end
|
85
76
|
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
end
|
77
|
+
def open_generated_page(path)
|
78
|
+
def_browser = ENV['BROWSER']
|
79
|
+
ENV['BROWSER'] = @options.browser
|
90
80
|
|
91
|
-
|
92
|
-
|
81
|
+
Launchy.open(path) do |e|
|
82
|
+
puts "Attempted to open `#{path}` and failed because #{e}"
|
93
83
|
end
|
84
|
+
ENV['BROWSER'] = def_browser
|
85
|
+
end
|
94
86
|
|
95
|
-
|
96
|
-
|
87
|
+
def write_generated_path(path, outfile)
|
88
|
+
File.write(outfile, File.read(path))
|
89
|
+
end
|
97
90
|
|
98
|
-
|
99
|
-
|
100
|
-
source: api_description_source(@source_path)
|
101
|
-
}
|
91
|
+
def generate
|
92
|
+
template = load_preview_template
|
102
93
|
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
basename = File.basename(@source_path, '.*')
|
108
|
-
temp = Dir.tmpdir
|
109
|
-
"#{temp}/#{basename}-preview.html"
|
110
|
-
end
|
94
|
+
data = {
|
95
|
+
title: File.basename(@source_path, '.*'),
|
96
|
+
source: api_description_source(@source_path)
|
97
|
+
}
|
111
98
|
|
112
|
-
|
113
|
-
|
114
|
-
template_string = file.read
|
115
|
-
ERB.new(template_string)
|
116
|
-
end
|
99
|
+
template.result(binding)
|
100
|
+
end
|
117
101
|
|
118
|
-
|
102
|
+
def preview_path
|
103
|
+
basename = File.basename(@source_path, '.*')
|
104
|
+
temp = Dir.tmpdir
|
105
|
+
"#{temp}/#{basename}-preview.html"
|
106
|
+
end
|
119
107
|
|
120
|
-
|
121
|
-
|
122
|
-
|
108
|
+
def load_preview_template
|
109
|
+
file = File.open(PREVIEW_TEMPLATE_PATH, 'r')
|
110
|
+
template_string = file.read
|
111
|
+
ERB.new(template_string)
|
123
112
|
end
|
113
|
+
end
|
124
114
|
end
|
@@ -8,80 +8,79 @@ require 'apiary/agent'
|
|
8
8
|
require 'apiary/helpers'
|
9
9
|
|
10
10
|
module Apiary::Command
|
11
|
-
|
12
|
-
|
13
|
-
|
11
|
+
# Display preview of local blueprint file
|
12
|
+
class Publish
|
13
|
+
include Apiary::Helpers
|
14
14
|
|
15
|
-
|
15
|
+
attr_reader :options
|
16
16
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
17
|
+
def initialize(opts)
|
18
|
+
@options = OpenStruct.new(opts)
|
19
|
+
@options.path ||= '.'
|
20
|
+
@options.api_host ||= 'api.apiary.io'
|
21
|
+
@options.api_name ||= false
|
22
|
+
@options.api_key ||= ENV['APIARY_API_KEY']
|
23
|
+
@options.proxy ||= ENV['http_proxy']
|
24
|
+
@options.headers ||= {
|
25
|
+
accept: 'text/html',
|
26
|
+
content_type: 'text/plain',
|
27
|
+
authentication: "Token #{@options.api_key}",
|
28
|
+
user_agent: Apiary.user_agent
|
29
|
+
}
|
30
|
+
@options.message ||= 'Saving API Description Document from apiary-client'
|
31
31
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
def execute
|
40
|
-
publish_on_apiary
|
32
|
+
begin
|
33
|
+
@source_path = api_description_source_path(@options.path)
|
34
|
+
rescue StandardError => e
|
35
|
+
abort "#{e.message}"
|
41
36
|
end
|
37
|
+
end
|
42
38
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
end
|
39
|
+
def execute
|
40
|
+
publish_on_apiary
|
41
|
+
end
|
47
42
|
|
48
|
-
|
49
|
-
|
50
|
-
|
43
|
+
def publish_on_apiary
|
44
|
+
unless @options.api_name
|
45
|
+
abort 'Please provide an api-name option (subdomain part from your http://docs.<api-name>.apiary.io/)'
|
46
|
+
end
|
51
47
|
|
52
|
-
|
48
|
+
unless @options.api_key
|
49
|
+
abort 'API key must be provided through environment variable APIARY_API_KEY. \Please go to https://login.apiary.io/tokens to obtain it.'
|
53
50
|
end
|
54
51
|
|
55
|
-
|
56
|
-
|
57
|
-
source = api_description_source(@source_path)
|
52
|
+
query_apiary
|
53
|
+
end
|
58
54
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
:messageToSave => @options.message
|
63
|
-
}
|
55
|
+
def query_apiary
|
56
|
+
url = "https://#{@options.api_host}/blueprint/publish/#{@options.api_name}"
|
57
|
+
source = api_description_source(@source_path)
|
64
58
|
|
65
|
-
|
59
|
+
return if source.nil?
|
60
|
+
data = {
|
61
|
+
code: source,
|
62
|
+
messageToSave: @options.message
|
63
|
+
}
|
66
64
|
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
65
|
+
RestClient.proxy = @options.proxy
|
66
|
+
|
67
|
+
begin
|
68
|
+
RestClient.post url, data, @options.headers
|
69
|
+
rescue RestClient::BadRequest => e
|
70
|
+
err = JSON.parse e.response
|
71
|
+
if err.key? 'parserError'
|
72
|
+
abort "#{err['message']}: #{err['parserError']}"
|
73
|
+
else
|
74
|
+
abort "Apiary service responded with an error: #{err['message']}"
|
75
|
+
end
|
76
|
+
rescue RestClient::Exception => e
|
77
|
+
err = JSON.parse e.response
|
78
|
+
if err.key? 'message'
|
79
|
+
abort "Apiary service responded with an error: #{err['message']}"
|
80
|
+
else
|
81
|
+
abort "Apiary service responded with an error: #{e.message}"
|
84
82
|
end
|
85
83
|
end
|
86
84
|
end
|
85
|
+
end
|
87
86
|
end
|
data/lib/apiary/helpers.rb
CHANGED
@@ -20,26 +20,26 @@ module Apiary
|
|
20
20
|
protected
|
21
21
|
|
22
22
|
def choose_one(path)
|
23
|
-
|
24
|
-
|
23
|
+
apib_path = api_blueprint(path)
|
24
|
+
swagger_path = swagger(path)
|
25
25
|
|
26
|
-
if
|
26
|
+
if apib_path && swagger_path
|
27
27
|
warn 'WARNING: Both apiary.apib and swagger.yaml are present. The apiary.apib file will be used. To override this selection specify path to desired file'
|
28
28
|
end
|
29
29
|
|
30
|
-
|
30
|
+
apib_path || swagger_path
|
31
31
|
end
|
32
32
|
|
33
33
|
def api_blueprint(path)
|
34
34
|
source_path = File.join(path, 'apiary.apib')
|
35
35
|
return source_path if File.exist? source_path
|
36
|
-
|
36
|
+
nil
|
37
37
|
end
|
38
38
|
|
39
39
|
def swagger(path)
|
40
40
|
source_path = File.join(path, 'swagger.yaml')
|
41
41
|
return source_path if File.exist? source_path
|
42
|
-
|
42
|
+
nil
|
43
43
|
end
|
44
44
|
end
|
45
45
|
end
|
@@ -1,29 +1,25 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
-
module Apiary
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
"'" => "\\'"
|
13
|
-
}
|
2
|
+
module Apiary::Helpers::JavascriptHelper
|
3
|
+
JS_ESCAPE_MAP = {
|
4
|
+
'\\' => '\\\\',
|
5
|
+
'</' => '<\/',
|
6
|
+
"\r\n" => '\n',
|
7
|
+
"\n" => '\n',
|
8
|
+
"\r" => '\n',
|
9
|
+
'"' => '\\"',
|
10
|
+
"'" => "\\'"
|
11
|
+
}
|
14
12
|
|
15
|
-
|
16
|
-
|
13
|
+
JS_ESCAPE_MAP["\342\200\250".force_encoding(Encoding::UTF_8).encode!] = '
'
|
14
|
+
JS_ESCAPE_MAP["\342\200\251".force_encoding(Encoding::UTF_8).encode!] = '
'
|
17
15
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
alias_method :j, :escape_javascript
|
16
|
+
def escape_javascript(javascript)
|
17
|
+
if javascript
|
18
|
+
javascript.gsub(/(\\|<\/|\r\n|\342\200\250|\342\200\251|[\n\r"'])/u) { |match| JS_ESCAPE_MAP[match] }
|
19
|
+
else
|
20
|
+
''
|
27
21
|
end
|
28
22
|
end
|
23
|
+
|
24
|
+
alias j escape_javascript
|
29
25
|
end
|
data/lib/apiary/version.rb
CHANGED
data/spec/apiary/cli_spec.rb
CHANGED
@@ -1,40 +1,37 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Apiary::CLI do
|
4
|
-
|
5
4
|
# Don't let Thor fold or truncate lines
|
6
5
|
ENV['THOR_COLUMNS'] = '1000'
|
7
6
|
|
8
7
|
# The documentation that ought to match the code
|
9
|
-
READMETEXT = open(
|
8
|
+
READMETEXT = open('README.md', &:read)
|
10
9
|
|
11
10
|
it 'has help' do
|
12
|
-
help = open('|ruby bin/apiary help'
|
13
|
-
expect(help).to include(
|
11
|
+
help = open('|ruby bin/apiary help', &:read)
|
12
|
+
expect(help).to include('Commands:')
|
14
13
|
expect(help.lines.count).to be >= 5
|
15
14
|
end
|
16
15
|
|
17
16
|
it 'has README.md' do
|
18
|
-
expect(READMETEXT).to include(
|
17
|
+
expect(READMETEXT).to include('apiary help')
|
19
18
|
expect(READMETEXT.lines.count).to be >= 5
|
20
19
|
end
|
21
20
|
|
22
21
|
# Confirm that all subcommands are documented, verbatim
|
23
|
-
([
|
24
|
-
.map {|l| /^ +apiary
|
25
|
-
.map {|l| /^ *apiary help
|
22
|
+
([''] + (open('|ruby bin/apiary help', 'r', &:readlines)
|
23
|
+
.map { |l| /^ +apiary / =~ l ? l : nil }
|
24
|
+
.map { |l| /^ *apiary help/ =~ l ? nil : l }
|
26
25
|
.compact
|
27
|
-
.map {|l| /^ *apiary ([^ ]*)/.match(l)[1] +
|
26
|
+
.map { |l| /^ *apiary ([^ ]*)/.match(l)[1] + ' ' }
|
28
27
|
)
|
29
28
|
).each do |cmd|
|
30
|
-
|
31
29
|
it "includes help #{cmd}in README.md" do
|
32
|
-
helptext = open("|ruby bin/apiary help #{cmd}"
|
30
|
+
helptext = open("|ruby bin/apiary help #{cmd}", &:read)
|
33
31
|
|
34
32
|
expect(helptext).to include("apiary #{cmd.strip}")
|
35
33
|
expect(READMETEXT).to include("apiary #{cmd.strip}")
|
36
34
|
expect(READMETEXT).to include(helptext)
|
37
|
-
|
38
35
|
end
|
39
36
|
end
|
40
37
|
end
|
@@ -1,7 +1,6 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Apiary::Command::Fetch do
|
4
|
-
|
5
4
|
it 'pass command without params' do
|
6
5
|
opts = {}
|
7
6
|
command = Apiary::Command::Fetch.new(opts)
|
@@ -9,9 +8,8 @@ describe Apiary::Command::Fetch do
|
|
9
8
|
end
|
10
9
|
|
11
10
|
it 'pass command only with api_name', api_key: true do
|
12
|
-
|
13
11
|
opts = {
|
14
|
-
|
12
|
+
api_name: 'test_api'
|
15
13
|
}
|
16
14
|
|
17
15
|
command = Apiary::Command::Fetch.new(opts)
|
@@ -19,12 +17,11 @@ describe Apiary::Command::Fetch do
|
|
19
17
|
end
|
20
18
|
|
21
19
|
it 'check request for fetch to apiary' do
|
22
|
-
|
23
|
-
API_NAME = 'test_api'
|
20
|
+
API_NAME = 'test_api'.freeze
|
24
21
|
|
25
22
|
opts = {
|
26
|
-
|
27
|
-
|
23
|
+
api_name: API_NAME,
|
24
|
+
api_key: '1234567890'
|
28
25
|
}
|
29
26
|
command = Apiary::Command::Fetch.new(opts)
|
30
27
|
|
@@ -34,7 +31,7 @@ describe Apiary::Command::Fetch do
|
|
34
31
|
"code": "FORMAT: 1A\nHOST: http://www.testing.com\n\n# Notes API test 123\nNotes API is a *short texts saving* service similar to its physical paper presence on your table.\n\n# Group Notes\nNotes related resources of the **Notes API**\n\n## Notes Collection [/notes]\n### List all Notes [GET]\n+ Response 200 (application/json)\n\n [{\n \"id\": 1, \"title\": \"Jogging in park\"\n }, {\n \"id\": 2, \"title\": \"Pick-up posters from post-office\"\n }]\n\n### Create a Note [POST]\n+ Request (application/json)\n\n { \"title\": \"Buy cheese and bread for breakfast.\" }\n\n+ Response 201 (application/json)\n\n { \"id\": 3, \"title\": \"Buy cheese and bread for breakfast.\" }\n\n## Note [/notes/{id}]\nA single Note object with all its details\n\n+ Parameters\n + id (required, number, `1`) ... Numeric `id` of the Note to perform action with. Has example value.\n\n### Retrieve a Note [GET]\n+ Response 200 (application/json)\n\n + Header\n\n X-My-Header: The Value\n\n + Body\n\n { \"id\": 2, \"title\": \"Pick-up posters from post-office\" }\n\n### Remove a Note [DELETE]\n+ Response 204\n"
|
35
32
|
}'
|
36
33
|
|
37
|
-
BLUEPRINT_EXAMPLE = %
|
34
|
+
BLUEPRINT_EXAMPLE = %{FORMAT: 1A
|
38
35
|
HOST: http://www.testing.com
|
39
36
|
|
40
37
|
# Notes API test 123
|
@@ -83,7 +80,7 @@ A single Note object with all its details
|
|
83
80
|
+ Response 204
|
84
81
|
}
|
85
82
|
|
86
|
-
stub_request(:get, "https://api.apiary.io/blueprint/get/#{API_NAME}").to_return(:
|
83
|
+
stub_request(:get, "https://api.apiary.io/blueprint/get/#{API_NAME}").to_return(status: 200, body: BODY_EXAMPLE, headers: { 'Content-Type' => 'text/plain' })
|
87
84
|
expect(command.fetch_from_apiary).to eq(BLUEPRINT_EXAMPLE)
|
88
85
|
end
|
89
86
|
end
|
@@ -1,7 +1,6 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Apiary::Command::Preview do
|
4
|
-
|
5
4
|
let(:command) do
|
6
5
|
opts = {
|
7
6
|
path: "#{File.expand_path File.dirname(__FILE__)}/../../fixtures/apiary.apib"
|
@@ -10,15 +9,14 @@ describe Apiary::Command::Preview do
|
|
10
9
|
end
|
11
10
|
|
12
11
|
it 'check tmp path if contains filename' do
|
13
|
-
expect(command.preview_path
|
12
|
+
expect(command.preview_path).to end_with('apiary-preview.html')
|
14
13
|
end
|
15
14
|
|
16
15
|
it 'shoud contain html5 doctype' do
|
17
|
-
expect(command.generate
|
16
|
+
expect(command.generate).to include('<!DOCTYPE html>')
|
18
17
|
end
|
19
18
|
|
20
19
|
it 'should contain embed javascript' do
|
21
|
-
expect(command.generate
|
20
|
+
expect(command.generate).to include('https://api.apiary.io/seeds/embed.js')
|
22
21
|
end
|
23
|
-
|
24
22
|
end
|
@@ -3,11 +3,9 @@ require 'spec_helper'
|
|
3
3
|
describe Apiary::Command::Publish do
|
4
4
|
context 'when constructed without a message' do
|
5
5
|
let(:message) do
|
6
|
-
Apiary::Command::Publish.new(
|
7
|
-
|
8
|
-
|
9
|
-
:api_key => 'testkey'
|
10
|
-
}).options.message
|
6
|
+
Apiary::Command::Publish.new(api_name: 'myapi',
|
7
|
+
path: 'spec/fixtures/apiary.apib',
|
8
|
+
api_key: 'testkey').options.message
|
11
9
|
end
|
12
10
|
|
13
11
|
it 'uses the default message' do
|
@@ -17,12 +15,10 @@ describe Apiary::Command::Publish do
|
|
17
15
|
|
18
16
|
context 'when constructed with a message' do
|
19
17
|
let(:message) do
|
20
|
-
Apiary::Command::Publish.new(
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
:api_key => 'testkey'
|
25
|
-
}).options.message
|
18
|
+
Apiary::Command::Publish.new(api_name: 'myapi',
|
19
|
+
message: 'Custom message',
|
20
|
+
path: 'spec/fixtures/apiary.apib',
|
21
|
+
api_key: 'testkey').options.message
|
26
22
|
end
|
27
23
|
|
28
24
|
it 'stores the message in the opts' do
|
@@ -34,17 +30,15 @@ describe Apiary::Command::Publish do
|
|
34
30
|
context 'when calling with a custom message' do
|
35
31
|
before(:all) do
|
36
32
|
WebMock.stub_request(:post, 'https://api.apiary.io/blueprint/publish/myapi')
|
37
|
-
Apiary::Command::Publish.new(
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
:api_key => 'testkey'
|
42
|
-
}).execute
|
33
|
+
Apiary::Command::Publish.new(api_name: 'myapi',
|
34
|
+
message: 'Custom message',
|
35
|
+
path: 'spec/fixtures/apiary.apib',
|
36
|
+
api_key: 'testkey').execute
|
43
37
|
end
|
44
38
|
|
45
39
|
it 'sends the message when publishing' do
|
46
|
-
expect(WebMock).to have_requested(:post, 'https://api.apiary.io/blueprint/publish/myapi')
|
47
|
-
with {|request| request.body.include? 'messageToSave=Custom%20message'}
|
40
|
+
expect(WebMock).to have_requested(:post, 'https://api.apiary.io/blueprint/publish/myapi')
|
41
|
+
.with { |request| request.body.include? 'messageToSave=Custom%20message' }
|
48
42
|
end
|
49
43
|
end
|
50
44
|
end
|
data/spec/apiary/helpers_spec.rb
CHANGED
@@ -7,14 +7,14 @@ describe Apiary::Helpers do
|
|
7
7
|
context 'path doesn\'t exists' do
|
8
8
|
it 'should raise error saying that Directory doesn\'t exists' do
|
9
9
|
path = 'spec/fixtures/invalid_path'
|
10
|
-
expect { api_description_source_path(path)}.to raise_error(/Invalid path/)
|
10
|
+
expect { api_description_source_path(path) }.to raise_error(/Invalid path/)
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
14
|
context 'missing file is in path' do
|
15
15
|
it 'should raise error saying that file doesn\'t exists' do
|
16
16
|
path = 'spec/fixtures/only_api_blueprint/swagger.yaml'
|
17
|
-
expect { api_description_source_path(path)}.to raise_error(/Invalid path/)
|
17
|
+
expect { api_description_source_path(path) }.to raise_error(/Invalid path/)
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
@@ -43,7 +43,7 @@ describe Apiary::Helpers do
|
|
43
43
|
context 'empty folder' do
|
44
44
|
it 'should raise error saying that file doesn\'t exists' do
|
45
45
|
path = 'spec/fixtures/empty_folder'
|
46
|
-
expect { api_description_source_path(path)}.to raise_error('No API Description Document found')
|
46
|
+
expect { api_description_source_path(path) }.to raise_error('No API Description Document found')
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
data/spec/spec_helper.rb
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
|
2
2
|
|
3
3
|
if RUBY_VERSION < '1.9.3'
|
4
|
-
|
4
|
+
::Dir.glob(::File.expand_path('../support/**/*.rb', __FILE__)).each { |f| require File.join(File.dirname(f), File.basename(f, '.rb')) }
|
5
5
|
else
|
6
|
-
|
6
|
+
::Dir.glob(::File.expand_path('../support/**/*.rb', __FILE__)).each { |f| require_relative f }
|
7
7
|
end
|
8
8
|
|
9
9
|
require 'apiary'
|
10
10
|
|
11
11
|
RSpec.configure do |config|
|
12
|
-
config.filter_run_excluding :
|
12
|
+
config.filter_run_excluding api_key: true if ENV['APIARY_API_KEY']
|
13
13
|
end
|
metadata
CHANGED
@@ -1,20 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apiaryio
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.5.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Apiary Ltd.
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2016-
|
11
|
+
date: 2016-07-21 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: rest-client
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
17
|
- - ~>
|
20
18
|
- !ruby/object:Gem::Version
|
@@ -22,7 +20,6 @@ dependencies:
|
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
24
|
- - ~>
|
28
25
|
- !ruby/object:Gem::Version
|
@@ -30,7 +27,6 @@ dependencies:
|
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: rack
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
31
|
- - ~>
|
36
32
|
- !ruby/object:Gem::Version
|
@@ -38,7 +34,6 @@ dependencies:
|
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
38
|
- - ~>
|
44
39
|
- !ruby/object:Gem::Version
|
@@ -46,7 +41,6 @@ dependencies:
|
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: thor
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
45
|
- - ~>
|
52
46
|
- !ruby/object:Gem::Version
|
@@ -54,7 +48,6 @@ dependencies:
|
|
54
48
|
type: :runtime
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
52
|
- - ~>
|
60
53
|
- !ruby/object:Gem::Version
|
@@ -62,7 +55,6 @@ dependencies:
|
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: json
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
59
|
- - ~>
|
68
60
|
- !ruby/object:Gem::Version
|
@@ -70,15 +62,27 @@ dependencies:
|
|
70
62
|
type: :runtime
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
66
|
- - ~>
|
76
67
|
- !ruby/object:Gem::Version
|
77
68
|
version: '1.8'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: launchy
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ~>
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '2.4'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ~>
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '2.4'
|
78
83
|
- !ruby/object:Gem::Dependency
|
79
84
|
name: bundler
|
80
85
|
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
86
|
requirements:
|
83
87
|
- - ~>
|
84
88
|
- !ruby/object:Gem::Version
|
@@ -86,7 +90,6 @@ dependencies:
|
|
86
90
|
type: :development
|
87
91
|
prerelease: false
|
88
92
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
93
|
requirements:
|
91
94
|
- - ~>
|
92
95
|
- !ruby/object:Gem::Version
|
@@ -94,7 +97,6 @@ dependencies:
|
|
94
97
|
- !ruby/object:Gem::Dependency
|
95
98
|
name: rake
|
96
99
|
requirement: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
100
|
requirements:
|
99
101
|
- - ~>
|
100
102
|
- !ruby/object:Gem::Version
|
@@ -102,7 +104,6 @@ dependencies:
|
|
102
104
|
type: :development
|
103
105
|
prerelease: false
|
104
106
|
version_requirements: !ruby/object:Gem::Requirement
|
105
|
-
none: false
|
106
107
|
requirements:
|
107
108
|
- - ~>
|
108
109
|
- !ruby/object:Gem::Version
|
@@ -110,7 +111,6 @@ dependencies:
|
|
110
111
|
- !ruby/object:Gem::Dependency
|
111
112
|
name: rspec
|
112
113
|
requirement: !ruby/object:Gem::Requirement
|
113
|
-
none: false
|
114
114
|
requirements:
|
115
115
|
- - ~>
|
116
116
|
- !ruby/object:Gem::Version
|
@@ -118,7 +118,6 @@ dependencies:
|
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
none: false
|
122
121
|
requirements:
|
123
122
|
- - ~>
|
124
123
|
- !ruby/object:Gem::Version
|
@@ -126,7 +125,6 @@ dependencies:
|
|
126
125
|
- !ruby/object:Gem::Dependency
|
127
126
|
name: webmock
|
128
127
|
requirement: !ruby/object:Gem::Requirement
|
129
|
-
none: false
|
130
128
|
requirements:
|
131
129
|
- - ~>
|
132
130
|
- !ruby/object:Gem::Version
|
@@ -134,7 +132,6 @@ dependencies:
|
|
134
132
|
type: :development
|
135
133
|
prerelease: false
|
136
134
|
version_requirements: !ruby/object:Gem::Requirement
|
137
|
-
none: false
|
138
135
|
requirements:
|
139
136
|
- - ~>
|
140
137
|
- !ruby/object:Gem::Version
|
@@ -142,7 +139,6 @@ dependencies:
|
|
142
139
|
- !ruby/object:Gem::Dependency
|
143
140
|
name: yard
|
144
141
|
requirement: !ruby/object:Gem::Requirement
|
145
|
-
none: false
|
146
142
|
requirements:
|
147
143
|
- - ~>
|
148
144
|
- !ruby/object:Gem::Version
|
@@ -150,7 +146,6 @@ dependencies:
|
|
150
146
|
type: :development
|
151
147
|
prerelease: false
|
152
148
|
version_requirements: !ruby/object:Gem::Requirement
|
153
|
-
none: false
|
154
149
|
requirements:
|
155
150
|
- - ~>
|
156
151
|
- !ruby/object:Gem::Version
|
@@ -158,7 +153,6 @@ dependencies:
|
|
158
153
|
- !ruby/object:Gem::Dependency
|
159
154
|
name: aruba
|
160
155
|
requirement: !ruby/object:Gem::Requirement
|
161
|
-
none: false
|
162
156
|
requirements:
|
163
157
|
- - ~>
|
164
158
|
- !ruby/object:Gem::Version
|
@@ -166,7 +160,6 @@ dependencies:
|
|
166
160
|
type: :development
|
167
161
|
prerelease: false
|
168
162
|
version_requirements: !ruby/object:Gem::Requirement
|
169
|
-
none: false
|
170
163
|
requirements:
|
171
164
|
- - ~>
|
172
165
|
- !ruby/object:Gem::Version
|
@@ -174,7 +167,6 @@ dependencies:
|
|
174
167
|
- !ruby/object:Gem::Dependency
|
175
168
|
name: cucumber
|
176
169
|
requirement: !ruby/object:Gem::Requirement
|
177
|
-
none: false
|
178
170
|
requirements:
|
179
171
|
- - ~>
|
180
172
|
- !ruby/object:Gem::Version
|
@@ -182,11 +174,24 @@ dependencies:
|
|
182
174
|
type: :development
|
183
175
|
prerelease: false
|
184
176
|
version_requirements: !ruby/object:Gem::Requirement
|
185
|
-
none: false
|
186
177
|
requirements:
|
187
178
|
- - ~>
|
188
179
|
- !ruby/object:Gem::Version
|
189
180
|
version: '2.0'
|
181
|
+
- !ruby/object:Gem::Dependency
|
182
|
+
name: rubocop
|
183
|
+
requirement: !ruby/object:Gem::Requirement
|
184
|
+
requirements:
|
185
|
+
- - ~>
|
186
|
+
- !ruby/object:Gem::Version
|
187
|
+
version: 0.41.2
|
188
|
+
type: :development
|
189
|
+
prerelease: false
|
190
|
+
version_requirements: !ruby/object:Gem::Requirement
|
191
|
+
requirements:
|
192
|
+
- - ~>
|
193
|
+
- !ruby/object:Gem::Version
|
194
|
+
version: 0.41.2
|
190
195
|
description: Apiary.io CLI
|
191
196
|
email:
|
192
197
|
- team@apiary.io
|
@@ -197,6 +202,7 @@ extra_rdoc_files: []
|
|
197
202
|
files:
|
198
203
|
- .gitignore
|
199
204
|
- .rspec
|
205
|
+
- .rubocop_todo.yml
|
200
206
|
- .travis.yml
|
201
207
|
- Dockerfile
|
202
208
|
- Gemfile
|
@@ -243,27 +249,26 @@ files:
|
|
243
249
|
homepage: http://apiary.io
|
244
250
|
licenses:
|
245
251
|
- MIT
|
252
|
+
metadata: {}
|
246
253
|
post_install_message:
|
247
254
|
rdoc_options: []
|
248
255
|
require_paths:
|
249
256
|
- lib
|
250
257
|
required_ruby_version: !ruby/object:Gem::Requirement
|
251
|
-
none: false
|
252
258
|
requirements:
|
253
|
-
- -
|
259
|
+
- - '>='
|
254
260
|
- !ruby/object:Gem::Version
|
255
261
|
version: '0'
|
256
262
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
257
|
-
none: false
|
258
263
|
requirements:
|
259
|
-
- -
|
264
|
+
- - '>='
|
260
265
|
- !ruby/object:Gem::Version
|
261
266
|
version: '0'
|
262
267
|
requirements: []
|
263
268
|
rubyforge_project:
|
264
|
-
rubygems_version:
|
269
|
+
rubygems_version: 2.0.14
|
265
270
|
signing_key:
|
266
|
-
specification_version:
|
271
|
+
specification_version: 4
|
267
272
|
summary: Apiary.io CLI
|
268
273
|
test_files:
|
269
274
|
- features/fetch.feature
|