totrello 0.1.14 → 0.1.15

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
- Njc3NmNlM2IyODE3NDBmOWFkZDFhOWNiNjZlYjM2OWE0YTUwMmM1YQ==
4
+ MDQxNjk1OThiZTE1M2NhNjBlMmJiODExNTg0NWNlMzRhYjU2OTFjZA==
5
5
  data.tar.gz: !binary |-
6
- MmMyNzdiYThmNDA5OTc1ZTdlNmY0YzQ5OGQ4NmE0NmVlMmUxYjVhMQ==
6
+ YmE4NzZiYjJhZTIyMmIxMGFhMjE0ZjdiNDBlZTQwYjE3NTMwYmY3Mg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YzdiNTVmMDA3YmVmODNkYjE3NTExMmUyZDUwZDE0N2E2OTcyZDI0NTA1Njdj
10
- MGM0NjBkNzg1MmJlMDBjZTY3NGY1MDAyZDQ0N2I2YTg2NGZhODhhZTk5ZTg5
11
- YmUzMWUxZWU2MGU3MDQxZjA5NmQwNmI2MzExMTg0MmFlNDk0YmQ=
9
+ NDcwMTdmMmVkYjEwNzIzN2Y4ODExMDE0YTQ4ZGQ1OGY0ZWMxMGRkOGI5OTVj
10
+ MjQ3N2I0MTY4NmYxN2RkNWJkMDRmZWM0ZWJhMzk3NDZkMmQxNTU4YTlmOWJi
11
+ ODJiNGMwMDA2MWYyZjllYmFlNGUwMzkxZDI0Y2JhYThlYTlhMzg=
12
12
  data.tar.gz: !binary |-
13
- OWI1YTkzZmI1ZGI3MDgyZjllNjQ5MjY5MjVkNTEyZGEwZGY4ZjViMjEzODI4
14
- NDE0MmFkM2IyOTMzYzMxZGZhNjdmODY1ZjA0MmIwOGUwY2MzODk4OGRmMzM2
15
- ZmMzNmEyZWEwYmI3YWI2NDkzNmRiNTUyNDdkZjg1MWNmODA4Yjc=
13
+ N2M3OTVmNjYwNDM1YzExYTljOTNlY2U3YzM0NjNmNDMyMGMyOTVmYTY3NDkz
14
+ Yjc0ZmU3MjRjNzk1YzI3NzQ2NWJkOTk3YzIxNmNhNTQ0MmZhOWU3ZDIzNTU3
15
+ MTQ4ZGJlZWJlY2E3MmY5ODE5Yjg5ZjgyZTE3NmZkNDE2YzMxMDA=
@@ -1,3 +1,3 @@
1
1
  module Totrello
2
- VERSION = "0.1.14"
2
+ VERSION = "0.1.15"
3
3
  end
@@ -1,68 +1,110 @@
1
1
  require 'totrello'
2
2
  require 'digest/sha1'
3
3
 
4
-
5
4
  TRELLO_DEVELOPER_PUBLIC_KEY = ENV['TRELLO_DEVELOPER_PUBLIC_KEY']
6
5
  TRELLO_MEMBER_TOKEN = ENV['TRELLO_MEMBER_TOKEN']
7
6
 
8
- describe 'totrello#initialize' do
7
+ describe 'Totrello' do
8
+
9
+ describe 'initialize' do
9
10
 
10
- it "should return a trello and directory" do
11
+ it "should return a trello and directory" do
11
12
 
12
- t = Totrello::Trelloize.new("#{Dir.pwd}/test/test_data")
13
- expect(t).to be_an_instance_of(Totrello::Trelloize)
14
- #expect(@directory).to be_a_kind_of(String)
13
+ t = Totrello::Trelloize.new("#{Dir.pwd}/test/test_data")
14
+ expect(t).to be_an_instance_of(Totrello::Trelloize)
15
+
16
+ end
15
17
 
16
18
  end
17
19
 
18
- end
20
+ describe 'create_or_gen_board' do
21
+ it "should return a board" do
22
+ directory = "#{Dir.pwd}/test/test_data"
23
+ t = Totrello::Trelloize.new(directory)
24
+ board = t.create_or_gen_board(directory.split('/').last)
25
+ expect(board.name.downcase).to eq(directory.split('/').last.downcase)
26
+ end
19
27
 
20
- describe 'totrello#create_or_gen_board' do
21
- it "should return a board" do
22
- directory = "#{Dir.pwd}/test/test_data"
23
- t = Totrello::Trelloize.new(directory)
24
- board = t.create_or_gen_board(directory.split('/').last)
25
- expect(board.name.downcase).to eq(directory.split('/').last.downcase)
26
28
  end
27
29
 
28
- end
30
+ describe 'create_card' do
31
+ it "should return a card" do
32
+ directory = "#{Dir.pwd}/test/test_data"
33
+ t = Totrello::Trelloize.new(directory)
34
+ board = t.create_or_gen_board(directory.split('/').last)
35
+ card_name = Digest::SHA1.hexdigest Time.now.to_s
36
+ card = t.create_trello_card(board, 'To Do', {:todo => card_name, :location => card_name.reverse }, directory.split('/').last)
37
+ expect(card).to include(card_name)
38
+ end
29
39
 
30
- describe 'totrello#create_card' do
31
- it "should return a card" do
32
- directory = "#{Dir.pwd}/test/test_data"
33
- t = Totrello::Trelloize.new(directory)
34
- board = t.create_or_gen_board(directory.split('/').last)
35
- card_name = Digest::SHA1.hexdigest Time.now.to_s
36
- card = t.create_trello_card(board, 'To Do', {:todo => card_name, :location => card_name.reverse }, directory.split('/').last)
37
- expect(card).to include(card_name)
38
40
  end
39
41
 
42
+
40
43
  end
41
44
 
42
- describe '#find_todo_items' do
43
- it 'returns a hash of todo items from a directory'do
44
- todo = ToDoFind.new
45
- todos = todo.search("#{Dir.pwd}/test/test_data")
46
- expected = {:directory => "test_data", :todo_list => [{:file => "/testing.rb", :todos => [{:todo => "test1", :location => 1}, {:todo => "test2", :location => 2}, {:todo => "test3", :location => 3}, {:todo => "test4}", :location => 4}, {:todo => "test5", :location => 5}, {:todo => "test6", :location => 6}]}]}
47
- expect(todos).to include(expected)
45
+ describe 'ToDoFind' do
46
+
47
+ describe 'find_todo_items' do
48
+ it 'returns a hash of todo items from a directory'do
49
+ todo = ToDoFind.new
50
+ todos = todo.search("#{Dir.pwd}/test/test_data")
51
+ expected = {:directory => "test_data", :todo_list => [{:file => "/testing.rb", :todos => [{:todo => "test1", :location => 1}, {:todo => "test2", :location => 2}, {:todo => "test3", :location => 3}, {:todo => "test4}", :location => 4}, {:todo => "test5", :location => 5}, {:todo => "test6", :location => 6}]}]}
52
+ expect(todos).to include(expected)
53
+ end
54
+
48
55
  end
49
56
 
57
+ describe 'formatted_data' do
58
+ it "Should have a string for the todo and an Int for the locaion" do
59
+ todo = ToDoFind.new
60
+ todos = todo.search("#{Dir.pwd}/test/test_data")
61
+
62
+ todos[:todo_list].each do |tdl|
63
+ tdl[:todos].each do |td|
64
+ expect(td[:todo]).to be_a_kind_of(String)
65
+ expect(td[:location]).to be_a_kind_of(Integer)
66
+ end
67
+ end
68
+
69
+ end
70
+
71
+ end
72
+
73
+
50
74
  end
51
75
 
52
- describe 'formatted_data' do
53
- it "Should have a string for the todo and an Int for the locaion" do
54
- todo = ToDoFind.new
55
- todos = todo.search("#{Dir.pwd}/test/test_data")
76
+ describe 'TrelloCreator' do
77
+
78
+ describe 'initialize' do
79
+ it 'should become an instance of itself' do
80
+ t = TrelloCreator.new
81
+ expect(t).to be_an_instance_of(TrelloCreator)
82
+ end
83
+
84
+ end
85
+
86
+ describe 'create_card' do
87
+
88
+ it 'should create a card' do
89
+
90
+ directory = "#{Dir.pwd}/test/test_data"
91
+ board_name = directory.split('/').last
92
+
93
+
94
+ t = TrelloCreator.new
95
+
96
+ board = t.find_board(board_name)
97
+ board ||= t.create_board(board_name, 'Auto Generated by ToTrello Gem')
98
+
99
+ card_name = {:todo => (Digest::SHA1.hexdigest Time.now.to_s)}
100
+ card = t.create_card(board, card_name, card_name[:todo].reverse,'To Do')
101
+ expect(card).to include(card_name[:todo])
56
102
 
57
- todos[:todo_list].each do |tdl|
58
- tdl[:todos].each do |td|
59
- expect(td[:todo]).to be_a_kind_of(String)
60
- expect(td[:location]).to be_a_kind_of(Integer)
61
- end
62
103
  end
63
104
 
64
105
  end
65
106
 
107
+
66
108
  end
67
109
 
68
110
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: totrello
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.14
4
+ version: 0.1.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Teeter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-04 00:00:00.000000000 Z
11
+ date: 2014-09-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler