apiaryio 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +9 -0
- data/.rspec +1 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +32 -0
- data/LICENSE +22 -0
- data/README.md +38 -8
- data/Rakefile +26 -0
- data/apiary.gemspec +26 -0
- data/bin/apiary +4 -12
- data/doc/Apiary.html +131 -0
- data/doc/Apiary/CLI.html +480 -0
- data/doc/Apiary/Command.html +117 -0
- data/doc/Apiary/Command/Help.html +331 -0
- data/doc/Apiary/Command/Preview.html +1102 -0
- data/doc/Apiary/Command/Runner.html +201 -0
- data/doc/Apiary/Command/Version.html +201 -0
- data/doc/_index.html +192 -0
- data/doc/class_list.html +53 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +57 -0
- data/doc/css/style.css +328 -0
- data/doc/file.README.html +119 -0
- data/doc/file_list.html +55 -0
- data/doc/frames.html +28 -0
- data/doc/index.html +119 -0
- data/doc/js/app.js +214 -0
- data/doc/js/full_list.js +173 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +252 -0
- data/doc/top-level-namespace.html +112 -0
- data/lib/apiary.rb +6 -1
- data/lib/apiary/cli.rb +59 -9
- data/lib/apiary/command/help.rb +34 -0
- data/lib/apiary/command/preview.rb +103 -0
- data/lib/apiary/command/runner.rb +13 -0
- data/lib/apiary/command/version.rb +13 -0
- data/lib/apiary/version.rb +2 -2
- data/spec/cli_spec.rb +9 -0
- data/spec/spec_helper.rb +2 -0
- metadata +87 -18
- data/lib/apiary/cmd.rb +0 -63
- data/lib/apiary/commands/base.rb +0 -41
- data/lib/apiary/commands/preview.rb +0 -27
@@ -1,27 +0,0 @@
|
|
1
|
-
require "apiary/commands/base"
|
2
|
-
|
3
|
-
# Display preview of local blueprint file
|
4
|
-
#
|
5
|
-
class Apiary::Command::Preview < Apiary::Command::Base
|
6
|
-
|
7
|
-
# preview
|
8
|
-
#
|
9
|
-
# Launch web browser and display preview of local blueprint file
|
10
|
-
#
|
11
|
-
def index
|
12
|
-
|
13
|
-
api_server = ENV['APIARY_API_HOST'] || "api.apiary.io"
|
14
|
-
require 'launchy'
|
15
|
-
require 'rest_client'
|
16
|
-
|
17
|
-
headers = {:accept => "text/html",:content_type => "text/plain"}
|
18
|
-
response = RestClient.post "https://#{api_server}/blueprint/generate", IO.read('apiary.apib'), headers
|
19
|
-
|
20
|
-
aFile = File.new("/tmp/apiarypreview.html", "w")
|
21
|
-
aFile.write(response)
|
22
|
-
aFile.close
|
23
|
-
|
24
|
-
Launchy.open("file:///tmp/apiarypreview.html")
|
25
|
-
end
|
26
|
-
|
27
|
-
end
|