typekitty 0.2.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a7ded869856e23ad391a33bc726344a8b3def734
4
- data.tar.gz: 9b04f9c1816220a5790dec1c0566737470fab227
3
+ metadata.gz: 83671a32ddcebcb4ffb603564193853a96d3fb5c
4
+ data.tar.gz: 983302d01e1c3616115c2aa9765a1d68957dc354
5
5
  SHA512:
6
- metadata.gz: 4e74b4733f0ee4d0bb4b0b6f8c15a845a38c74f88148ed6620f7352cbf1a3a681b83a3f14318059137c7f9ae7547b1f92400683f404ec80176870178ba342f60
7
- data.tar.gz: b5dd0b708483d50b0f8550fa11c84a9477d297acc8ba7802d345a32cb98e9c50494ea6d55e7911ae38c5983edd269e5e58a0d2d40d35fdf6733c6d2f88fed9c8
6
+ metadata.gz: 7c7f731c0dc62388e2a559959417bba333817582075fe7afa07e237ede085eb8de59b1ae2aa53f6f3d1b1c9d1beb2ff27893485e32cc92d74f7564a61320035b
7
+ data.tar.gz: 3a1b581aebae446e5c57e3d43571e778ce931e82e39fe0b04e5aefec56bca65a1b3032e6fe021a477760b87b8a55618ee0b086635817f2039f29b74d2a1d3a26
@@ -3,5 +3,6 @@ $:.unshift File.dirname(__FILE__)
3
3
 
4
4
  # Load the libraries
5
5
  require 'typekitty/api'
6
+ require 'typekitty/library'
6
7
  require 'typekitty/kit'
7
8
  require 'typekitty/cli'
@@ -22,6 +22,12 @@ module Typekitty
22
22
  response['kit']
23
23
  end
24
24
 
25
+ def self.libraries
26
+ response = handle_response get '/libraries'
27
+
28
+ response['libraries']
29
+ end
30
+
25
31
  def self.handle_response response
26
32
  case response.code
27
33
  when 200 then response
@@ -4,18 +4,23 @@ require 'typekitty/api'
4
4
 
5
5
  module Typekitty
6
6
  class CLI < Thor
7
- desc 'kits', 'Lists your kits'
7
+ desc 'kits', 'Lists kits'
8
8
  option :token, :required => true
9
9
  def kits
10
10
  pp api.kits
11
11
  end
12
12
 
13
- desc 'kit KIT_ID', 'Get information about a kit'
13
+ desc 'kit KIT_ID', 'Get information about the draft version of a kit'
14
14
  option :token, :required => true
15
15
  def kit id
16
16
  pp api.kit id
17
17
  end
18
18
 
19
+ desc 'libraries', 'Lists font libraries'
20
+ def libraries
21
+ pp api.libraries
22
+ end
23
+
19
24
  no_commands do
20
25
  def api
21
26
  Typekitty::API.default_params :token => options[:token]
@@ -0,0 +1,16 @@
1
+ require 'hashie'
2
+ require 'typekitty/api'
3
+
4
+ module Typekitty
5
+ class Library < Hashie::Dash
6
+ property :id, :required => true
7
+ property :link, :required => true
8
+ property :name, :required => true
9
+
10
+ def self.all
11
+ Typekitty::API.libraries.inject([]) do |libs, lib|
12
+ libs << new(lib)
13
+ end
14
+ end
15
+ end
16
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: typekitty
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zachary Adam Kaplan
@@ -120,6 +120,7 @@ files:
120
120
  - lib/typekitty/api.rb
121
121
  - lib/typekitty/cli.rb
122
122
  - lib/typekitty/kit.rb
123
+ - lib/typekitty/library.rb
123
124
  homepage: https://github.com/razic/typekitty
124
125
  licenses:
125
126
  - MIT