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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b24802c3b5f7734905bef82ba555c97b273b1139
4
- data.tar.gz: 6c1da2b13f4727a49144d84f140cc1fe91151d7e
3
+ metadata.gz: 77a394223c7d3f2ff7a0d645870b35a64c92be86
4
+ data.tar.gz: c9284dce4dad8503d998e940ea702ceaf5d27767
5
5
  SHA512:
6
- metadata.gz: 889cf9c39a18ff9c0903ec4e154683fb895315b3cc916a5fb44559f0ef1ef47e31a17086586f72f5a4bfc3ab409825698398577856085a71a8efe0c755181b96
7
- data.tar.gz: a4432acb1e4c9ecbb47e53472fa48c7fdb411b5d399c2c91573b953250c87b50fe6817fe7b19ba4311115293e560d68b5aabedb119c01032af04e7fbc71bd73b
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
- projects = fetch_projects(token, user)
37
+ client = fetch_behance(token)
38
38
 
39
- puts "#{projects.length} project(s) found. Importing now..."
39
+ user_projects = client.user_projects(user)
40
40
 
41
- projects.each do |project|
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
- "project" => details
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.fetch_projects(token, user)
74
- Behance::Client.new(access_token: token).user_projects(user)
75
+ def self.fetch_behance(token)
76
+ ::Behance::Client.new(access_token: token)
75
77
  end
76
78
  end
77
79
  end
@@ -1,3 +1,3 @@
1
1
  module JekyllImport
2
- VERSION = '0.5.0'
2
+ VERSION = '0.5.1'
3
3
  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.0
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-09-19 00:00:00.000000000 Z
11
+ date: 2014-11-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll