typekit 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +12 -5
- data/VERSION +1 -1
- data/lib/typekit/kit.rb +2 -5
- data/typekit.gemspec +2 -2
- metadata +3 -3
data/README.md
CHANGED
@@ -44,11 +44,10 @@ Quick and simple...
|
|
44
44
|
|
45
45
|
$ gem install typekit
|
46
46
|
|
47
|
-
|
47
|
+
Or just add the gem to your Gemfile and run `bundle install`
|
48
48
|
|
49
49
|
gem 'typekit'
|
50
|
-
|
51
|
-
...and done!
|
50
|
+
|
52
51
|
|
53
52
|
### Getting Started
|
54
53
|
|
@@ -59,15 +58,23 @@ Quick and simple...
|
|
59
58
|
kits = typekit.kits #=> [<Typekit::Kit @id='abcdef'>, <Typekit::Kit @id='ghijkl', ...]
|
60
59
|
|
61
60
|
# Get detailed information for a kit by ID
|
62
|
-
typekit.kit('abcdef')
|
61
|
+
kit = typekit.kit('abcdef')
|
63
62
|
#=> <Typekit::Kit @id='abcdef', @name='Test', @analytics=false, @badge=false, @domains=['localhost'], @families=[...]>
|
63
|
+
|
64
|
+
# Create a new kit with the default badge and analytics settings
|
65
|
+
kit = typekit.create_kit(:name => 'My Kit', :domains => ['example.com', 'example.heroku.com']) #=> <Typekit::Kit @id='abcdef', ...>
|
66
|
+
|
67
|
+
# Delete a kit (where `kit` is an instance of Typekit::Kit)
|
68
|
+
kit.delete
|
64
69
|
|
65
70
|
### Using the API without an instance of Typekit::Client
|
66
71
|
|
67
|
-
|
72
|
+
If you prefer using the class methods directly to query for kits/families, the following is identical to the above methods...
|
73
|
+
|
68
74
|
Typekit::Client.set_token(token)
|
69
75
|
Typekit::Kit.all #=> [<Typekit::Kit @id='abcdef'>, <Typekit::Kit @id='ghijkl', ...]
|
70
76
|
Typekit::Kit.find('abcdef') #=> <Typekit::Kit @id='abcdef', @name="Test", ...>
|
77
|
+
Typekit::Kit.create_kit(:name => 'My Kit', :domains => ['example.com', 'example.heroku.com'])
|
71
78
|
|
72
79
|
### Lazy Loaded Detailed Attributes
|
73
80
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.2
|
data/lib/typekit/kit.rb
CHANGED
@@ -41,6 +41,7 @@ module Typekit
|
|
41
41
|
# @option params [Array] :domains Required: An array of the domains that this kit will be used on
|
42
42
|
# @option params [Boolean] :analytics (false) Allow Typekit to collect kit-usage data via Google Analytics
|
43
43
|
# @option params [Boolean] :badge (false) Show the Typekit colophon badge on websites using this kit
|
44
|
+
# @return [Typekit::Kit] The resulting kit
|
44
45
|
def create(params)
|
45
46
|
params = @@defaults.merge(params)
|
46
47
|
response = Client.post("/kits", :query => params)
|
@@ -97,12 +98,8 @@ module Typekit
|
|
97
98
|
Client.post("/kits/#{@id}/publish")
|
98
99
|
end
|
99
100
|
|
100
|
-
# Delete
|
101
|
-
# @note Typekit does not have this functionality in their API at this time. When they do,
|
102
|
-
# the `raise` call in this method can be removed, along with this warning.
|
103
|
-
# @raise An error, always, telling you this doesn't work.
|
101
|
+
# Delete this kit from Typekit
|
104
102
|
def delete
|
105
|
-
raise "The Typekit API does not support deleting a kit at this time."
|
106
103
|
Client.delete("/kits/#{@id}")
|
107
104
|
end
|
108
105
|
alias :destroy :delete
|
data/typekit.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{typekit}
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Corey Ward"]
|
12
|
-
s.date = %q{2011-02-
|
12
|
+
s.date = %q{2011-02-14}
|
13
13
|
s.description = %q{Ruby library for accessing the Typekit REST API.}
|
14
14
|
s.email = %q{corey.atx@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: typekit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.2.
|
5
|
+
version: 0.2.2
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Corey Ward
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-02-
|
13
|
+
date: 2011-02-14 00:00:00 -06:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -108,7 +108,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
108
108
|
requirements:
|
109
109
|
- - ">="
|
110
110
|
- !ruby/object:Gem::Version
|
111
|
-
hash: -
|
111
|
+
hash: -656620291308992935
|
112
112
|
segments:
|
113
113
|
- 0
|
114
114
|
version: "0"
|