trekyll 0.2.0 → 0.2.1

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: 7b54e678739f77ed2785e490a371da0265afd435
4
- data.tar.gz: 69b21e08a499bb423645cc2baf3b47bd6b4c3dde
3
+ metadata.gz: '09789f5453e5d4d496e9c9a68820e4586375cdfe'
4
+ data.tar.gz: 156b3ed3a50f16f2ebec2028aecf87c9a1881ce3
5
5
  SHA512:
6
- metadata.gz: ca96a57d46d9cc77063044ea91e0d4f0a3947fcf42d46303a39d02bca1abc5043c56fffb205adce0fd866904150c4ea37a2f5ff2aca7f9ceaac1d27ebdc5f12e
7
- data.tar.gz: 6e9116577873d7f3f2ba087cf64fca35fb9ef09313764597d42b6defe0881166fd65ac4098075d08a344a4245b9d81ab8d7d6bc3cb31b09ed0a6cce71bfa4f4a
6
+ metadata.gz: f7ee1c3767cb4443220923df42d768ed56711d45db29781f37bd49760d37cc79420bdf88d64b1762fd730a5a54d82078c52912f7eda8d0d0d9a41051de6504c9
7
+ data.tar.gz: 16351a0adcd07d3d1741a4baf2d377fb553bcd142602ec4eaa139d6147406796842fae2fd4ee855a6fecbf563e0b24ed0309a6404ec70f0ffff6105099d06715
@@ -62,7 +62,9 @@ module Trekyll
62
62
 
63
63
  counter = 1
64
64
  wgtcounter = 1
65
+ postcounter = 1
65
66
  cards.each do |card|
67
+ puts "Currently on card: #{card.name}"
66
68
 
67
69
  # Create Navigation if navigation list name is defined in _nav.yml
68
70
  if card.list.name == init_config.navigation then
@@ -228,8 +230,10 @@ module Trekyll
228
230
  tmp[k] = v
229
231
  end
230
232
  # Sort hash and get url's
231
- sorted_hash = tmp.sort.reverse.to_h
232
- attachment_url = sorted_hash.map { |k, v| "\"#{[v].flatten.join(',')}\"" }.join(', ')
233
+ # sorted_hash = tmp.sort.reverse.to_h
234
+ # attachment_url = sorted_hash.map { |k, v| "\"#{[v].flatten.join(',')}\"" }.join(', ')
235
+ sorted_hash = tmp.sort_by { |k,v| k}.reverse
236
+ attachment_url = sorted_hash.map { |k, v| v}
233
237
 
234
238
  puts "Attachment: #{attachment_url}" if attachment_url != ""
235
239
  end
@@ -239,7 +243,7 @@ module Trekyll
239
243
  template.puts <<~DOC.gsub(/\t/, '')
240
244
  ---
241
245
  name: #{card.name}
242
- attachments: [ #{attachment_url} ]
246
+ attachments: #{attachment_url}
243
247
  ---
244
248
  DOC
245
249
  # template.puts "#{card.desc}" Interpret content ?! TO DO
@@ -255,21 +259,34 @@ module Trekyll
255
259
  label_name = ""
256
260
 
257
261
  unless card.labels.nil? then
262
+ arr = []
258
263
  card.labels.each do |label|
259
- label_name = label_name + " " + label.name
264
+ # label_name = label_name + " " + label.name
265
+ arr.push(label.name)
260
266
  end
267
+ label_name = arr.to_s
261
268
  end
262
269
 
263
- # Get cover image
270
+ # Get cover image and all other attachments
264
271
  cover_id = card.cover_image_id
265
272
  cover_image_url = ""
273
+ attachments = ""
266
274
  unless card.attachments.nil? then
275
+ arr = Hash.new
267
276
  card.attachments.each do |attachment|
277
+
278
+ k = attachment.pos
279
+ v = attachment.url
280
+ arr[k] = v
281
+
268
282
  if attachment.id == cover_id
269
283
  cover_image_url = attachment.url
270
284
  end
271
285
  end
272
286
 
287
+ tmp = arr.sort_by { |k,v| k}.reverse
288
+ attachments = tmp.map { |k,v| v}
289
+
273
290
  puts "Post cover image: #{cover_image_url} " if cover_image_url != ""
274
291
 
275
292
  end
@@ -326,15 +343,18 @@ module Trekyll
326
343
  ---
327
344
  layout: #{layout}
328
345
  cover: "#{cover_image_url}"
329
- title: #{card.name}
346
+ title: "#{card.name}"
330
347
  date: #{card.created_at}
331
348
  categories: #{card.list.name.sanitize_as_post_name}
349
+ weight: #{postcounter}
332
350
  tags: #{label_name}
351
+ attachments: #{attachments}
333
352
  #{custom_fields.join("\n")}
334
353
  ---
335
354
  DOC
336
355
  template.puts "#{content}"
337
356
  template.close
357
+ postcounter = postcounter.next
338
358
  end
339
359
  end
340
360
  return true
@@ -1,3 +1,3 @@
1
1
  module Trekyll
2
- VERSION = "0.2.0".freeze
2
+ VERSION = "0.2.1".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trekyll
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Canic Interactive
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-10-11 00:00:00.000000000 Z
11
+ date: 2017-12-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: trelloapi
@@ -89,7 +89,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
89
89
  version: '0'
90
90
  requirements: []
91
91
  rubyforge_project:
92
- rubygems_version: 2.6.8
92
+ rubygems_version: 2.6.13
93
93
  signing_key:
94
94
  specification_version: 4
95
95
  summary: Trello to Jekyll CMS