totrello 0.2.01 → 0.2.02

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,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NDJiZWVhNWI5NDUxYjBlMzE3Yzc1MGU3MGM1ZmFiZGZjMGU0NDIzNw==
4
+ YzA1OGEzOWMzYmM5YTViZDJjMDA2MTM5ZmRjZjJkYWI0NDA4OGRhNg==
5
5
  data.tar.gz: !binary |-
6
- YTllOGExY2E3N2I0YjNkM2ZmZjZkN2FhMTBlZjhjZjE0YTQzOGQ4Mw==
6
+ ZTE4NGZhNTg1Y2YzYzcwMTRlZWQ4ODJkZGYwNGY0M2RmNTlhMTg0Yw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MWI4ODY4MDQ2ZTQxOGUwYjRlNDBmM2ZiM2E2ZmFmMGI4Yjk1NWViOGFiYzU3
10
- NjgxNGYwMjBhNzk3NWQwYjRhZDYwMjExNmQ3NDU2NmZkMDEzNzlhNzMwZWM1
11
- YjUzN2FjODMwZTY4Zjg5NGIzOGIxYzRiMzQ3YzI1NzYxOWRiODk=
9
+ MTI1ZGNmMDg3OWIzMmZmNzgwMWE2ODdmY2Y2ZjYwYWVhYWJkZTIxN2U1MDBm
10
+ OTk1YmEwZDFkNTEwNDAwMTBiZWQ2ODYwZTkxZGNmYTFiNTE2MmI4YmNjNmVi
11
+ MjU2MDJhZjQ2ZWZlMTYwNzdlNmYxMWUzODI2NDU2MDFkMWQwZmQ=
12
12
  data.tar.gz: !binary |-
13
- YzhhMzBlMGE0MTZkZmRjMjM1YTRhZGQyZjk5OGY4NTQzNzI0ZmNhNDkwMDAw
14
- YzU1YjM5OTJiODZmMjEyOGY1ZTU0NDMyOTc0NDY5ODhjZWUzMThhNWI0YTIz
15
- Y2Y3ZWEwYzE4MTY3N2Q2ODZmOGRmYmIwYjE5NWEzM2IzZWJmYmE=
13
+ NTU5MWZhN2M4OTM4OGE2MGFmZjNlOGU1MDJiNjRhZDA5NDhhYzU2YjYwYjU1
14
+ ZGIzZGFlMDc4YzcxNzMyNmRlOWY5MDEyZWY5OTllZjg0ODI5ODIxM2FkYmVh
15
+ MmUxNGI4MWVlN2VmZmUwOWE1NDZlMjMzZTRmNDYzNzA0ZTg2ZDg=
@@ -1,3 +1,3 @@
1
1
  module Totrello
2
- VERSION = "0.2.01"
2
+ VERSION = "0.2.02"
3
3
  end
data/lib/totrello.rb CHANGED
@@ -52,7 +52,18 @@ module Totrello
52
52
  end
53
53
 
54
54
  def create_trello_card(board, list, todo, filename)
55
- @trello.create_card(board, todo, gen_description(filename,todo, @config[:project_name].to_s),list)
55
+ description = gen_description(filename,todo, @config[:project_name].to_s)
56
+ card = @trello.create_card(board, todo[:todo], description ,list)
57
+ end
58
+
59
+ #TODO: Test if this works
60
+ def gen_description(file, todo, project_name)
61
+ out = "TODO item found by the [ToTrello](https://rubygems.org/gems/totrello) gem\n"
62
+ out += "===========================\n"
63
+ out += "**Project name:** #{project_name}\n"
64
+ out += "**Filename**: #{file}\n"
65
+ out += "**Action item**: #{todo[:todo]}\n"
66
+ out += "**Location (at or near) line**: #{todo[:location]}\n"
56
67
  end
57
68
 
58
69
  private
@@ -67,7 +78,8 @@ module Totrello
67
78
  todos[:todo_list].each do |tdl|
68
79
  tdl[:todos].each do |td|
69
80
  unless td == ''
70
- processes.append(fork {create_trello_card(board, @config[:default_list].to_s, td, tdl[:file])})
81
+ processes.append(fork {create_trello_card(board, @config[:default_list], td, tdl[:file])})
82
+
71
83
  end
72
84
  end
73
85
  end
@@ -91,15 +103,6 @@ module Totrello
91
103
 
92
104
 
93
105
 
94
- private
95
- def gen_description(file, todo, project_name)
96
- out = "TODO item found by ToTrello\n"
97
- out += "===========================\n"
98
- out += "**Project name:** #{project_name}\n"
99
- out += "**Filename**: #{file}\n"
100
- out += "**Action item**: #{todo[:todo]}\n"
101
- out += "**Location (at or near) line**: #{todo[:location]}\n"
102
- end
103
106
 
104
107
 
105
108
  end
@@ -9,10 +9,13 @@ class TrelloCreator
9
9
  end
10
10
 
11
11
  def create_card(board, name, description, list_name)
12
+ puts description
12
13
  list_names = ['To Do', 'Doing', 'Done']
13
- unless card_exists?(board, list_names, name[:todo])
14
- card = Trello::Card.create(name: name[:todo], list_id: self.find_list(board, list_name), description: description)
14
+ unless card_exists?(board, list_names, name)
15
+ card = Trello::Card.create(name: name, list_id: self.find_list(board, list_name), desc: description)
15
16
  card.save
17
+
18
+ #puts card.desc
16
19
  end
17
20
  end
18
21
 
@@ -25,7 +25,7 @@ describe 'TrelloCreator' do
25
25
  board ||= t.create_board(board_name, 'Auto Generated by ToTrello Gem')
26
26
 
27
27
  card_name = {:todo => (Digest::SHA1.hexdigest Time.now.to_s)}
28
- card = t.create_card(board, card_name, card_name[:todo].reverse,'To Do')
28
+ card = t.create_card(board, card_name[:todo], card_name[:todo].reverse,'To Do')
29
29
  expect(card).to include(card_name[:todo])
30
30
 
31
31
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: totrello
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.01
4
+ version: 0.2.02
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Teeter