kr 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +25 -0
- data/README.md +13 -0
- data/Rakefile +2 -0
- data/bin/kr +10 -0
- data/kr.gemspec +21 -0
- data/lib/kr.rb +16 -7
- data/lib/kr/version.rb +3 -0
- metadata +40 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0a36cea97f4ed32469b499625f57f5b0408966b2
|
4
|
+
data.tar.gz: c88c17fa8ccbce0aa3b9abc452e298fcf07c056f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 557c70e6c1f51a247b4773fa0ecc6f4f8bd9f2b63b59ae633837b6df0627975d73fc1e92dfa70fc14bc943716e97cdfeef9fabe2cc855841ccae8e60499fcfa0
|
7
|
+
data.tar.gz: ef06ce82be306ecb01683115e594c6a7161145bf8c99e9624e221b7ea03d61dd4c8f4a50a52b89067525bb1074a860b87a146b1cde6673a0339dad306ede68f4
|
data/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
pkg/
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
kr (0.0.2)
|
5
|
+
heroics
|
6
|
+
netrc
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
excon (0.31.0)
|
12
|
+
heroics (0.0.1)
|
13
|
+
excon
|
14
|
+
moneta
|
15
|
+
multi_json
|
16
|
+
netrc
|
17
|
+
moneta (0.7.20)
|
18
|
+
multi_json (1.8.4)
|
19
|
+
netrc (0.7.7)
|
20
|
+
|
21
|
+
PLATFORMS
|
22
|
+
ruby
|
23
|
+
|
24
|
+
DEPENDENCIES
|
25
|
+
kr!
|
data/README.md
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
# kr
|
2
|
+
|
3
|
+
kr is short for *konsoru*, or console in Japanese. `kr` is a quick Heroku API console.
|
4
|
+
|
5
|
+
## Usage
|
6
|
+
|
7
|
+
```term
|
8
|
+
$ gem install kr
|
9
|
+
$ kr
|
10
|
+
>> h = connect
|
11
|
+
>> h.app.list.map { |a| a['name'] }
|
12
|
+
=> ["codetriage", "drankthirty", "the-best-app-ever", "iheartheroku"]
|
13
|
+
```
|
data/Rakefile
ADDED
data/bin/kr
ADDED
data/kr.gemspec
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
lib = File.expand_path('../lib', __FILE__)
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
+
require "kr/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = 'kr'
|
7
|
+
s.version = Kr::VERSION
|
8
|
+
s.date = '2013-01-31'
|
9
|
+
s.summary = "Konsoru"
|
10
|
+
s.description = "API console for Heroku"
|
11
|
+
s.authors = ["Jon Roes"]
|
12
|
+
s.email = 'jroes@heroku.com'
|
13
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
14
|
+
s.files = `git ls-files`.split($/)
|
15
|
+
s.homepage = 'http://rubygems.org/gems/kr'
|
16
|
+
s.license = 'MIT'
|
17
|
+
s.require_paths = ["lib"]
|
18
|
+
|
19
|
+
s.add_dependency 'heroics'
|
20
|
+
s.add_dependency 'netrc'
|
21
|
+
end
|
data/lib/kr.rb
CHANGED
@@ -1,12 +1,21 @@
|
|
1
|
+
require 'kr/version'
|
2
|
+
|
1
3
|
require 'cgi'
|
2
4
|
require 'heroics'
|
3
5
|
require 'netrc'
|
4
6
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
7
|
+
module Kr
|
8
|
+
def self.connect
|
9
|
+
username, token = Netrc.read["api.heroku.com"]
|
10
|
+
configure_netrc if [username, token].any?(&:nil?)
|
11
|
+
username = CGI.escape(username)
|
12
|
+
url = "https://#{username}:#{token}@api.heroku.com/schema"
|
13
|
+
options = {default_headers: {'Accept' => 'application/vnd.heroku+json; version=3'}}
|
14
|
+
Heroics.client_from_schema_url(url, options)
|
15
|
+
end
|
16
|
+
|
17
|
+
# TODO: Yeah we should probably be more helpful
|
18
|
+
def self.configure_netrc
|
19
|
+
puts "Please configure your netrc for Heroku!"
|
20
|
+
end
|
12
21
|
end
|
data/lib/kr/version.rb
ADDED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jon Roes
|
@@ -9,14 +9,51 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
date: 2013-01-31 00:00:00.000000000 Z
|
12
|
-
dependencies:
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: heroics
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: netrc
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
13
41
|
description: API console for Heroku
|
14
42
|
email: jroes@heroku.com
|
15
|
-
executables:
|
43
|
+
executables:
|
44
|
+
- kr
|
16
45
|
extensions: []
|
17
46
|
extra_rdoc_files: []
|
18
47
|
files:
|
48
|
+
- .gitignore
|
49
|
+
- Gemfile
|
50
|
+
- Gemfile.lock
|
51
|
+
- README.md
|
52
|
+
- Rakefile
|
53
|
+
- bin/kr
|
54
|
+
- kr.gemspec
|
19
55
|
- lib/kr.rb
|
56
|
+
- lib/kr/version.rb
|
20
57
|
homepage: http://rubygems.org/gems/kr
|
21
58
|
licenses:
|
22
59
|
- MIT
|