apiaryio 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.travis.yml +5 -2
- data/Gemfile +0 -5
- data/README.md +23 -5
- data/doc/Apiary.html +6 -6
- data/doc/Apiary/CLI.html +15 -5
- data/doc/Apiary/Command.html +5 -5
- data/doc/Apiary/Command/Fetch.html +4 -4
- data/doc/Apiary/Command/Help.html +9 -7
- data/doc/Apiary/Command/Preview.html +4 -4
- data/doc/Apiary/Command/Publish.html +32 -28
- data/doc/Apiary/Command/Runner.html +4 -4
- data/doc/Apiary/Command/Version.html +4 -4
- data/doc/_index.html +5 -5
- data/doc/css/style.css +1 -0
- data/doc/file.README.html +48 -14
- data/doc/frames.html +1 -1
- data/doc/index.html +48 -14
- data/doc/method_list.html +34 -34
- data/doc/top-level-namespace.html +4 -4
- data/lib/apiary/cli.rb +5 -0
- data/lib/apiary/command/help.rb +3 -2
- data/lib/apiary/command/publish.rb +10 -8
- data/lib/apiary/version.rb +1 -1
- metadata +96 -122
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Top Level Namespace
|
8
8
|
|
9
|
-
— Documentation by YARD 0.8.7.
|
9
|
+
— Documentation by YARD 0.8.7.4
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -17,7 +17,7 @@
|
|
17
17
|
<script type="text/javascript" charset="utf-8">
|
18
18
|
hasFrames = window.top.frames.main ? true : false;
|
19
19
|
relpath = '';
|
20
|
-
framesUrl = "frames.html#!"
|
20
|
+
framesUrl = "frames.html#!top-level-namespace.html";
|
21
21
|
</script>
|
22
22
|
|
23
23
|
|
@@ -103,9 +103,9 @@
|
|
103
103
|
</div>
|
104
104
|
|
105
105
|
<div id="footer">
|
106
|
-
Generated on
|
106
|
+
Generated on Mon May 12 13:32:43 2014 by
|
107
107
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
108
|
-
0.8.7.
|
108
|
+
0.8.7.4 (ruby-2.0.0).
|
109
109
|
</div>
|
110
110
|
|
111
111
|
</body>
|
data/lib/apiary/cli.rb
CHANGED
@@ -43,6 +43,11 @@ module Apiary
|
|
43
43
|
options[:api_name] = api_name
|
44
44
|
end
|
45
45
|
|
46
|
+
opts.on("--message COMMIT_MESSAGE") do |commit_message|
|
47
|
+
raise OptionParser::InvalidOption if command != "publish"
|
48
|
+
options[:commit_message] = commit_message
|
49
|
+
end
|
50
|
+
|
46
51
|
opts.on("--browser BROWSER") do |browser|
|
47
52
|
raise OptionParser::InvalidOption if command != "preview"
|
48
53
|
options[:browser] = browser
|
data/lib/apiary/command/help.rb
CHANGED
@@ -24,10 +24,11 @@ module Apiary
|
|
24
24
|
puts "\tpreview --server Start standalone web server on port 8080"
|
25
25
|
puts "\tpreview --server --port [PORT] Start standalone web server on specified port"
|
26
26
|
puts "\tpublish --api-name [API_NAME] Publish apiary.apib on docs.API_NAME.apiary.io"
|
27
|
-
puts "\
|
27
|
+
puts "\tpublish --api-name [API_NAME] \\"
|
28
|
+
puts "\t --message [COMMIT_MESSAGE] Publish with custom commit message"
|
29
|
+
puts "\tfetch --api-name [API_NAME] Fetch apiary.apib from API_NAME.apiary.io"
|
28
30
|
puts "\n"
|
29
31
|
puts "\thelp Show this help"
|
30
|
-
puts "\n"
|
31
32
|
puts "\tversion Show version"
|
32
33
|
puts "\n"
|
33
34
|
end
|
@@ -14,17 +14,18 @@ module Apiary
|
|
14
14
|
# TODO: use OpenStruct to store @options
|
15
15
|
def initialize(opts)
|
16
16
|
@options = OpenStruct.new(opts)
|
17
|
-
@options.path
|
18
|
-
@options.api_host
|
19
|
-
@options.port
|
20
|
-
@options.api_name
|
21
|
-
@options.api_key
|
22
|
-
@options.proxy
|
23
|
-
@options.headers
|
17
|
+
@options.path ||= "apiary.apib"
|
18
|
+
@options.api_host ||= "api.apiary.io"
|
19
|
+
@options.port ||= 8080
|
20
|
+
@options.api_name ||= false
|
21
|
+
@options.api_key ||= ENV['APIARY_API_KEY']
|
22
|
+
@options.proxy ||= ENV['http_proxy']
|
23
|
+
@options.headers ||= {
|
24
24
|
:accept => "text/html",
|
25
25
|
:content_type => "text/plain",
|
26
26
|
:authentication => "Token #{@options.api_key}"
|
27
27
|
}
|
28
|
+
@options.commit_message ||= "Saving blueprint from apiary-client"
|
28
29
|
end
|
29
30
|
|
30
31
|
def self.execute(args)
|
@@ -57,7 +58,8 @@ module Apiary
|
|
57
58
|
def query_apiary(host, path)
|
58
59
|
url = "https://#{host}/blueprint/publish/#{@options.api_name}"
|
59
60
|
data = {
|
60
|
-
:code => File.read(path)
|
61
|
+
:code => File.read(path),
|
62
|
+
:messageToSave => @options.commit_message
|
61
63
|
}
|
62
64
|
RestClient.proxy = @options.proxy
|
63
65
|
|
data/lib/apiary/version.rb
CHANGED
metadata
CHANGED
@@ -1,132 +1,116 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: apiaryio
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 1
|
9
|
-
- 0
|
10
|
-
version: 0.1.0
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.1
|
11
5
|
platform: ruby
|
12
|
-
authors:
|
6
|
+
authors:
|
13
7
|
- Apiary Ltd.
|
14
8
|
autorequire:
|
15
9
|
bindir: bin
|
16
10
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
dependencies:
|
21
|
-
- !ruby/object:Gem::Dependency
|
11
|
+
date: 2014-05-12 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
22
14
|
name: rest-client
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
- - ~>
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
hash: 1
|
30
|
-
segments:
|
31
|
-
- 1
|
32
|
-
- 6
|
33
|
-
- 7
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
34
19
|
version: 1.6.7
|
35
20
|
type: :runtime
|
36
|
-
version_requirements: *id001
|
37
|
-
- !ruby/object:Gem::Dependency
|
38
|
-
name: rack
|
39
21
|
prerelease: false
|
40
|
-
|
41
|
-
|
42
|
-
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 1.6.7
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rack
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
43
31
|
- - ">="
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
hash: 7
|
46
|
-
segments:
|
47
|
-
- 1
|
48
|
-
- 4
|
49
|
-
- 0
|
32
|
+
- !ruby/object:Gem::Version
|
50
33
|
version: 1.4.0
|
51
|
-
- - <
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
hash: 15
|
54
|
-
segments:
|
55
|
-
- 1
|
56
|
-
- 6
|
57
|
-
- 0
|
34
|
+
- - "<"
|
35
|
+
- !ruby/object:Gem::Version
|
58
36
|
version: 1.6.0
|
59
37
|
type: :runtime
|
60
|
-
version_requirements: *id002
|
61
|
-
- !ruby/object:Gem::Dependency
|
62
|
-
name: rake
|
63
38
|
prerelease: false
|
64
|
-
|
65
|
-
|
66
|
-
requirements:
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
67
41
|
- - ">="
|
68
|
-
- !ruby/object:Gem::Version
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
version:
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: 1.4.0
|
44
|
+
- - "<"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: 1.6.0
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: rake
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
73
54
|
type: :runtime
|
74
|
-
version_requirements: *id003
|
75
|
-
- !ruby/object:Gem::Dependency
|
76
|
-
name: rspec
|
77
55
|
prerelease: false
|
78
|
-
|
79
|
-
|
80
|
-
requirements:
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
81
58
|
- - ">="
|
82
|
-
- !ruby/object:Gem::Version
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '0'
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: rspec
|
63
|
+
requirement: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - ">="
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '0'
|
87
68
|
type: :development
|
88
|
-
version_requirements: *id004
|
89
|
-
- !ruby/object:Gem::Dependency
|
90
|
-
name: webmock
|
91
69
|
prerelease: false
|
92
|
-
|
93
|
-
|
94
|
-
|
70
|
+
version_requirements: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0'
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
name: webmock
|
77
|
+
requirement: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
95
79
|
- - ">="
|
96
|
-
- !ruby/object:Gem::Version
|
97
|
-
|
98
|
-
segments:
|
99
|
-
- 0
|
100
|
-
version: "0"
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '0'
|
101
82
|
type: :development
|
102
|
-
version_requirements: *id005
|
103
|
-
- !ruby/object:Gem::Dependency
|
104
|
-
name: yard
|
105
83
|
prerelease: false
|
106
|
-
|
107
|
-
|
108
|
-
|
84
|
+
version_requirements: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - ">="
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '0'
|
89
|
+
- !ruby/object:Gem::Dependency
|
90
|
+
name: yard
|
91
|
+
requirement: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
109
93
|
- - ">="
|
110
|
-
- !ruby/object:Gem::Version
|
111
|
-
|
112
|
-
segments:
|
113
|
-
- 0
|
114
|
-
version: "0"
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '0'
|
115
96
|
type: :development
|
116
|
-
|
97
|
+
prerelease: false
|
98
|
+
version_requirements: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - ">="
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '0'
|
117
103
|
description: Apiary.io CLI
|
118
|
-
email:
|
104
|
+
email:
|
119
105
|
- team@apiary.io
|
120
|
-
executables:
|
106
|
+
executables:
|
121
107
|
- apiary
|
122
108
|
extensions: []
|
123
|
-
|
124
109
|
extra_rdoc_files: []
|
125
|
-
|
126
|
-
|
127
|
-
- .
|
128
|
-
- .
|
129
|
-
- .travis.yml
|
110
|
+
files:
|
111
|
+
- ".gitignore"
|
112
|
+
- ".rspec"
|
113
|
+
- ".travis.yml"
|
130
114
|
- Gemfile
|
131
115
|
- LICENSE
|
132
116
|
- README.md
|
@@ -168,41 +152,31 @@ files:
|
|
168
152
|
- spec/cli_spec.rb
|
169
153
|
- spec/command/fetch_spec.rb
|
170
154
|
- spec/spec_helper.rb
|
171
|
-
has_rdoc: true
|
172
155
|
homepage: http://apiary.io
|
173
|
-
licenses:
|
156
|
+
licenses:
|
174
157
|
- MIT
|
158
|
+
metadata: {}
|
175
159
|
post_install_message:
|
176
160
|
rdoc_options: []
|
177
|
-
|
178
|
-
require_paths:
|
161
|
+
require_paths:
|
179
162
|
- lib
|
180
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
181
|
-
|
182
|
-
requirements:
|
163
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
164
|
+
requirements:
|
183
165
|
- - ">="
|
184
|
-
- !ruby/object:Gem::Version
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
version: "0"
|
189
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
190
|
-
none: false
|
191
|
-
requirements:
|
166
|
+
- !ruby/object:Gem::Version
|
167
|
+
version: '0'
|
168
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
169
|
+
requirements:
|
192
170
|
- - ">="
|
193
|
-
- !ruby/object:Gem::Version
|
194
|
-
|
195
|
-
segments:
|
196
|
-
- 0
|
197
|
-
version: "0"
|
171
|
+
- !ruby/object:Gem::Version
|
172
|
+
version: '0'
|
198
173
|
requirements: []
|
199
|
-
|
200
174
|
rubyforge_project:
|
201
|
-
rubygems_version:
|
175
|
+
rubygems_version: 2.2.2
|
202
176
|
signing_key:
|
203
|
-
specification_version:
|
177
|
+
specification_version: 4
|
204
178
|
summary: Apiary.io CLI
|
205
|
-
test_files:
|
179
|
+
test_files:
|
206
180
|
- spec/cli_spec.rb
|
207
181
|
- spec/command/fetch_spec.rb
|
208
182
|
- spec/spec_helper.rb
|