jekyll-import 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/jekyll-import/importers/behance.rb +9 -7
- data/lib/jekyll-import/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 77a394223c7d3f2ff7a0d645870b35a64c92be86
|
4
|
+
data.tar.gz: c9284dce4dad8503d998e940ea702ceaf5d27767
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d432c8f4e86aa88e6b5c4d66597cc72392e7ab90c97532db7e81dc2f83d263801972e1aea65ce903604874c2bcaa1dbd2b6b1bfdcc51ed3e1d216afdd6083e63
|
7
|
+
data.tar.gz: 456d84a69556f46dddae111e69199c0e4173a37ff2e532007c281c3562bfb73f3cc347c2cf53c3821b9247ffde8a722d37ca56ceffb7241a00c40ae0aeecd4f0
|
@@ -34,11 +34,13 @@ module JekyllImport
|
|
34
34
|
user = options.fetch('user')
|
35
35
|
token = options.fetch('api_token')
|
36
36
|
|
37
|
-
|
37
|
+
client = fetch_behance(token)
|
38
38
|
|
39
|
-
|
39
|
+
user_projects = client.user_projects(user)
|
40
40
|
|
41
|
-
|
41
|
+
puts "#{user_projects.length} project(s) found. Importing now..."
|
42
|
+
|
43
|
+
user_projects.each do |project|
|
42
44
|
|
43
45
|
details = client.project(project['id'])
|
44
46
|
title = project['name'].to_s
|
@@ -53,7 +55,7 @@ module JekyllImport
|
|
53
55
|
header = {
|
54
56
|
"layout" => "post",
|
55
57
|
"title" => title,
|
56
|
-
"
|
58
|
+
"details" => details
|
57
59
|
}
|
58
60
|
|
59
61
|
FileUtils.mkdir_p("_posts")
|
@@ -61,7 +63,7 @@ module JekyllImport
|
|
61
63
|
File.open("_posts/#{name}.md", "w") do |f|
|
62
64
|
f.puts header.to_yaml
|
63
65
|
f.puts "---\n\n"
|
64
|
-
f.puts details['description']
|
66
|
+
f.puts details['description'].to_s
|
65
67
|
end
|
66
68
|
end
|
67
69
|
|
@@ -70,8 +72,8 @@ module JekyllImport
|
|
70
72
|
|
71
73
|
private
|
72
74
|
|
73
|
-
def self.
|
74
|
-
Behance::Client.new(access_token: token)
|
75
|
+
def self.fetch_behance(token)
|
76
|
+
::Behance::Client.new(access_token: token)
|
75
77
|
end
|
76
78
|
end
|
77
79
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-import
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Preston-Werner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-11-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|