leankitkanban 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/Manifest CHANGED
@@ -1,6 +1,7 @@
1
1
  Gemfile
2
2
  Gemfile.lock
3
- README
3
+ Manifest
4
+ README.md
4
5
  Rakefile
5
6
  lib/leankitkanban.rb
6
7
  lib/leankitkanban/board.rb
@@ -9,4 +10,3 @@ spec/leankitkanban/board_spec.rb
9
10
  spec/leankitkanban/config_spec.rb
10
11
  spec/spec_helper.rb
11
12
  spec/support/config_helper.rb
12
- Manifest
data/README.md ADDED
@@ -0,0 +1,49 @@
1
+ LeanKitKanban
2
+ =============
3
+
4
+ LeanKitKanban is a simple ruby wrapper around the LeanKitKanban API
5
+
6
+ http://leankitkanban.com/
7
+
8
+ Usage
9
+ -----
10
+
11
+ LeanKitKanban::Config.email = "mytestemail@test.com"
12
+ LeanKitKanban::Config.password = "mypassword"
13
+ LeanKitKanban::Config.account = "myaccount"
14
+
15
+ @boards = LeanKitKanban::Board.all # gets all boards and returns an array of hashes
16
+ @board = LeanKitKanban::Board.find(board_id) # gets the board with specified id as a hash
17
+
18
+ Board ID
19
+ --------
20
+
21
+ If you want to fetch a specified board from your organization, you'll need the board ID. To get it, log in to leankitkanban, go to that board and check the url. After /Boards you should see a number, that's the board ID.
22
+
23
+ Contributing
24
+ ------------
25
+
26
+ Clone this repo and send pull requests.
27
+
28
+ *Running specs*
29
+
30
+ All specs are in the /spec directory, to run them:
31
+
32
+ rspec
33
+
34
+ Additional information
35
+ ----------------------
36
+
37
+ * LeanKitKanban API doc: http://support.leankitkanban.com/forums/20153741-api
38
+
39
+ License
40
+ -------
41
+
42
+ Copyright © 28/10/11, mlainez
43
+
44
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
45
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
46
+
47
+ The Software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the Software.
48
+
49
+ Except as contained in this notice, the name of mlainez shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from mlainez.
data/Rakefile CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
  require 'rake'
3
3
  require 'echoe'
4
4
 
5
- Echoe.new('leankitkanban', '0.0.1') do |p|
5
+ Echoe.new('leankitkanban', '0.0.2') do |p|
6
6
  p.description = "Ruby Wrapper around LeanKitKanban Api"
7
7
  p.url = "http://github.com/mlainez/leankitkanban"
8
8
  p.author = "Marc Lainez"
@@ -2,17 +2,17 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{leankitkanban}
5
- s.version = "0.0.1"
5
+ s.version = "0.0.2"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = [%q{Marc Lainez}]
9
- s.date = %q{2011-10-27}
9
+ s.date = %q{2011-10-28}
10
10
  s.description = %q{Ruby Wrapper around LeanKitKanban Api}
11
11
  s.email = %q{ml@theotherguys.be}
12
- s.extra_rdoc_files = [%q{README}, %q{lib/leankitkanban.rb}, %q{lib/leankitkanban/board.rb}, %q{lib/leankitkanban/config.rb}]
13
- s.files = [%q{Gemfile}, %q{Gemfile.lock}, %q{README}, %q{Rakefile}, %q{lib/leankitkanban.rb}, %q{lib/leankitkanban/board.rb}, %q{lib/leankitkanban/config.rb}, %q{spec/leankitkanban/board_spec.rb}, %q{spec/leankitkanban/config_spec.rb}, %q{spec/spec_helper.rb}, %q{spec/support/config_helper.rb}, %q{Manifest}, %q{leankitkanban.gemspec}]
12
+ s.extra_rdoc_files = [%q{README.md}, %q{lib/leankitkanban.rb}, %q{lib/leankitkanban/board.rb}, %q{lib/leankitkanban/config.rb}]
13
+ s.files = [%q{Gemfile}, %q{Gemfile.lock}, %q{Manifest}, %q{README.md}, %q{Rakefile}, %q{lib/leankitkanban.rb}, %q{lib/leankitkanban/board.rb}, %q{lib/leankitkanban/config.rb}, %q{spec/leankitkanban/board_spec.rb}, %q{spec/leankitkanban/config_spec.rb}, %q{spec/spec_helper.rb}, %q{spec/support/config_helper.rb}, %q{leankitkanban.gemspec}]
14
14
  s.homepage = %q{http://github.com/mlainez/leankitkanban}
15
- s.rdoc_options = [%q{--line-numbers}, %q{--inline-source}, %q{--title}, %q{Leankitkanban}, %q{--main}, %q{README}]
15
+ s.rdoc_options = [%q{--line-numbers}, %q{--inline-source}, %q{--title}, %q{Leankitkanban}, %q{--main}, %q{README.md}]
16
16
  s.require_paths = [%q{lib}]
17
17
  s.rubyforge_project = %q{leankitkanban}
18
18
  s.rubygems_version = %q{1.8.4}
@@ -2,8 +2,9 @@ module LeanKitKanban
2
2
  module Board
3
3
  include HTTParty
4
4
 
5
- ALL_BOARDS = "/Boards"
6
- ONE_BOARD = "/Boards/{boardID}"
5
+ ALL_BOARDS = "/Boards"
6
+ ONE_BOARD = "/Boards/{boardID}"
7
+ IDENTIFIERS = "/Board/{boardID}/GetBoardIdentifiers"
7
8
 
8
9
  def self.all
9
10
  url = "#{LeanKitKanban::Config.uri}#{ALL_BOARDS}"
@@ -18,6 +19,13 @@ module LeanKitKanban
18
19
  parse_body(response.body)
19
20
  end
20
21
 
22
+ def self.get_identifiers(board_id)
23
+ api_call = IDENTIFIERS.gsub("{boardID}", board_id.to_s)
24
+ url = "#{LeanKitKanban::Config.uri}#{api_call}"
25
+ response = get(url, LeanKitKanban::Config.basic_auth_hash)
26
+ parse_body(response.body)
27
+ end
28
+
21
29
  private
22
30
  def self.parse_body(body)
23
31
  json_data = JSON.parse body
@@ -73,4 +73,39 @@ describe LeanKitKanban::Board do
73
73
  LeanKitKanban::Board.find(@board_id)
74
74
  end
75
75
  end
76
+
77
+ describe :get_identifiers do
78
+ before :each do
79
+ @board_id = 123
80
+ @response = mock("Response")
81
+ @body = mock("Body")
82
+ @auth_hash = mock("Auth hash")
83
+ LeanKitKanban::Config.stub(:uri)
84
+ LeanKitKanban::Config.stub(:basic_auth_hash => @auth_hash)
85
+ LeanKitKanban::Board.stub(:get => @response)
86
+ @response.stub(:body => @body)
87
+ LeanKitKanban::Board.stub(:parse_body)
88
+ end
89
+
90
+ it "gets the base uri" do
91
+ LeanKitKanban::Config.should_receive(:uri)
92
+ LeanKitKanban::Board.get_identifiers(@board_id)
93
+ end
94
+
95
+ it "gets the basic authentication hash" do
96
+ LeanKitKanban::Config.should_receive(:basic_auth_hash)
97
+ LeanKitKanban::Board.get_identifiers(@board_id)
98
+ end
99
+
100
+ it "gets the board whose id is passed as parameter" do
101
+ url = "/Board/#{@board_id}/GetBoardIdentifiers"
102
+ LeanKitKanban::Board.should_receive(:get).with(url, @auth_hash).and_return(@response)
103
+ LeanKitKanban::Board.get_identifiers(@board_id)
104
+ end
105
+
106
+ it "gets the body from the response" do
107
+ @response.should_receive(:body).and_return(@body)
108
+ LeanKitKanban::Board.get_identifiers(@board_id)
109
+ end
110
+ end
76
111
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: leankitkanban
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.1
5
+ version: 0.0.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Marc Lainez
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-10-27 00:00:00 Z
13
+ date: 2011-10-28 00:00:00 Z
14
14
  dependencies: []
15
15
 
16
16
  description: Ruby Wrapper around LeanKitKanban Api
@@ -20,14 +20,15 @@ executables: []
20
20
  extensions: []
21
21
 
22
22
  extra_rdoc_files:
23
- - README
23
+ - README.md
24
24
  - lib/leankitkanban.rb
25
25
  - lib/leankitkanban/board.rb
26
26
  - lib/leankitkanban/config.rb
27
27
  files:
28
28
  - Gemfile
29
29
  - Gemfile.lock
30
- - README
30
+ - Manifest
31
+ - README.md
31
32
  - Rakefile
32
33
  - lib/leankitkanban.rb
33
34
  - lib/leankitkanban/board.rb
@@ -36,7 +37,6 @@ files:
36
37
  - spec/leankitkanban/config_spec.rb
37
38
  - spec/spec_helper.rb
38
39
  - spec/support/config_helper.rb
39
- - Manifest
40
40
  - leankitkanban.gemspec
41
41
  homepage: http://github.com/mlainez/leankitkanban
42
42
  licenses: []
@@ -48,7 +48,7 @@ rdoc_options:
48
48
  - --title
49
49
  - Leankitkanban
50
50
  - --main
51
- - README
51
+ - README.md
52
52
  require_paths:
53
53
  - lib
54
54
  required_ruby_version: !ruby/object:Gem::Requirement
data/README DELETED
@@ -1,8 +0,0 @@
1
- Usage
2
-
3
- LeanKitKanban::Config.email = "mytestemail@test.com"
4
- LeanKitKanban::Config.password = "mypassword"
5
- LeanKitKanban::Config.account = "myaccount"
6
-
7
- LeanKitKanban::Board.all #gets all boards and returns an array of hashes
8
- LeanKitKanban::Board.find(board_id) #gets the specified board