leif 0.0.9 → 0.0.10

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: 803bf425951a72e2a0a26354c63479fb7a18da26
4
- data.tar.gz: 0f024f19bb334ef1a8c21e5211e9407af9082ce1
3
+ metadata.gz: 2de0f89361c9fd1315fec9c8d1438fec6a67e15e
4
+ data.tar.gz: 2beff9dc1bde09af7c2f350304da3441e2e4ab0e
5
5
  SHA512:
6
- metadata.gz: 81c1c298807283bc86d597974cb3a8f5581182683a7686d772b552d6dd517b37996670a31896b30f13294fb0354f66a727e00b1149a58fe98891d44871ea4c26
7
- data.tar.gz: 125bb032ca4e458fd6cc907a34d2312271d32b5869a4a7f36539b5d94a2f1700ae72e4ffa3eaa05f1ff1f93d59284e9fc653525ec817061cc93a9b60262ad580
6
+ metadata.gz: fe87c298dd7269a1e90ef1529b7d3fb90eb78786a0cc601574aeb998aa2d373e9e159c1d0166799f22a35cc1780710c41d8e573eabc2cc817475e3d9ab5b3669
7
+ data.tar.gz: df17e0906fa28319b56b675f81a5eb16fe5e51a77ac424387bef44e62e73a5b1466c45664dcade8c0fb8d5371b95f40375918a8d07990f756fe8db9e7f64444a
data/bin/leif CHANGED
@@ -4,7 +4,8 @@ require 'leif/collection_json'
4
4
  require 'leif/section'
5
5
 
6
6
  insecure = !!ARGV.delete('--insecure')
7
- Leif::Cli.new(ssl_verify: !insecure).tap do |cli|
7
+ endpoint = ARGV.last
8
+ Leif::Cli.new(endpoint, ssl_verify: !insecure).tap do |cli|
8
9
  cli.get_root
9
10
  loop do
10
11
  cli.print_overview
data/lib/leif/cli.rb CHANGED
@@ -4,22 +4,24 @@ require 'leif/connection'
4
4
 
5
5
  module Leif
6
6
  class Cli
7
- ENDPOINT = 'https://api.getcloudapp.com'
8
- attr_reader :last_exchange, :connection
7
+ DEFAULT_ENDPOINT = 'https://api.getcloudapp.com'
8
+ attr_reader :last_exchange, :endpoint, :connection
9
9
 
10
- def initialize(connection_options = {})
10
+ def initialize(endpoint, connection_options = {})
11
+ @endpoint = endpoint || DEFAULT_ENDPOINT
11
12
  @connection_options = connection_options
12
- @connection = Connection.to_url(ENDPOINT, connection_options)
13
+ @connection = Connection.to_url(self.endpoint,
14
+ self.connection_options)
13
15
  end
14
16
 
15
17
  def basic_auth(username, password)
16
- @connection = Connection.to_url(ENDPOINT,
18
+ @connection = Connection.to_url(endpoint,
17
19
  connection_options(username: username,
18
20
  password: password))
19
21
  end
20
22
 
21
23
  def token_auth(token)
22
- @connection = Connection.to_url(ENDPOINT,
24
+ @connection = Connection.to_url(endpoint,
23
25
  connection_options(token: token))
24
26
  end
25
27
 
data/lib/leif/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Leif
2
- VERSION = '0.0.9'
2
+ VERSION = '0.0.10'
3
3
  end
data/man/leif.1 CHANGED
@@ -7,11 +7,20 @@
7
7
  \fBleif\fR \- A hypermedia browser for the CloudApp Collection+JSON API\.
8
8
  .
9
9
  .SH "SYNOPSIS"
10
- \fBleif\fR
10
+ \fBleif\fR [\fI\-\-insecure\fR] [\fIurl\fR]
11
11
  .
12
12
  .SH "DESCRIPTION"
13
13
  \fBleif\fR is a program to explore the CloudApp hypermedia API\. It was built so developers could feel how the API flows to help them consume it in their programs\.
14
14
  .
15
+ .P
16
+ Provide a \fIurl\fR to use as the API root\. With no \fIurl\fR option, the endpoint \fBhttps://api\.getcloudapp\.com\fR is used\.
17
+ .
18
+ .SH "OPTIONS"
19
+ .
20
+ .TP
21
+ \fB\-\-insecure\fR
22
+ Do not attempt to verify SSL certificates\.
23
+ .
15
24
  .SH "INTERACTIVE COMMANDS"
16
25
  .
17
26
  .TP
data/man/leif.1.html CHANGED
@@ -62,6 +62,7 @@
62
62
  <a href="#NAME">NAME</a>
63
63
  <a href="#SYNOPSIS">SYNOPSIS</a>
64
64
  <a href="#DESCRIPTION">DESCRIPTION</a>
65
+ <a href="#OPTIONS">OPTIONS</a>
65
66
  <a href="#INTERACTIVE-COMMANDS">INTERACTIVE COMMANDS</a>
66
67
  <a href="#EXAMPLES">EXAMPLES</a>
67
68
  </div>
@@ -79,7 +80,7 @@
79
80
 
80
81
  <h2 id="SYNOPSIS">SYNOPSIS</h2>
81
82
 
82
- <p><code>leif</code></p>
83
+ <p><code>leif</code> [<var>--insecure</var>] [<var>url</var>]</p>
83
84
 
84
85
  <h2 id="DESCRIPTION">DESCRIPTION</h2>
85
86
 
@@ -87,6 +88,16 @@
87
88
  developers could feel how the API flows to help them consume it in their
88
89
  programs.</p>
89
90
 
91
+ <p>Provide a <var>url</var> to use as the API root. With no <var>url</var> option, the endpoint
92
+ <code>https://api.getcloudapp.com</code> is used.</p>
93
+
94
+ <h2 id="OPTIONS">OPTIONS</h2>
95
+
96
+ <dl>
97
+ <dt><code>--insecure</code></dt><dd>Do not attempt to verify SSL certificates.</dd>
98
+ </dl>
99
+
100
+
90
101
  <h2 id="INTERACTIVE-COMMANDS">INTERACTIVE COMMANDS</h2>
91
102
 
92
103
  <dl>
data/man/leif.1.ronn CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## SYNOPSIS
4
4
 
5
- `leif`
5
+ `leif` [<--insecure>] [<url>]
6
6
 
7
7
  ## DESCRIPTION
8
8
 
@@ -10,6 +10,14 @@
10
10
  developers could feel how the API flows to help them consume it in their
11
11
  programs.
12
12
 
13
+ Provide a <url> to use as the API root. With no <url> option, the endpoint
14
+ `https://api.getcloudapp.com` is used.
15
+
16
+ ## OPTIONS
17
+
18
+ - `--insecure`:
19
+ Do not attempt to verify SSL certificates.
20
+
13
21
  ## INTERACTIVE COMMANDS
14
22
 
15
23
  - `root`:
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: leif
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Larry Marburger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-20 00:00:00.000000000 Z
11
+ date: 2013-08-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday