kanban 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.document +5 -0
- data/.rspec +1 -0
- data/Gemfile +21 -0
- data/Gemfile.lock +104 -0
- data/LICENSE +22 -0
- data/LICENSE.txt +20 -0
- data/README.md +2 -0
- data/README.rdoc +19 -0
- data/Rakefile +56 -0
- data/VERSION +1 -0
- data/kanban.gemspec +88 -0
- data/lib/kanban/hash_safety.rb +14 -0
- data/lib/kanban.rb +42 -0
- data/spec/kanban/hash_safety_spec.rb +20 -0
- data/spec/kanban_spec.rb +74 -0
- data/spec/spec_helper.rb +27 -0
- metadata +217 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 1269e09e1ed2b1e5fe61f15a0bc6afca6de16fe4
|
4
|
+
data.tar.gz: 5a9d91b4fa9422ad18b3dddfb9d7586f01db9085
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 4294deecdd8f137be52fc4478815b2d65fcf0d2f4b583d78831ff166c95fe1794235f81b6f813a13845775ee08bc96c52d9a93a0522900b9989825d0f4fa5dfe
|
7
|
+
data.tar.gz: 1bd3f95ede9394a0f93d15a3c722b6d91ffefae87be9f59bc325aa001d71480e8a01235ba0fdeed24bd4f7c503d436517c4ae56119d972c5b0ec425a022e0a0d
|
data/.document
ADDED
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--color
|
data/Gemfile
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
source "http://rubygems.org"
|
2
|
+
# Add dependencies required to use your gem here.
|
3
|
+
# Example:
|
4
|
+
# gem "activesupport", ">= 2.3.5"
|
5
|
+
|
6
|
+
gem 'redis'
|
7
|
+
|
8
|
+
# Add dependencies to develop your gem here.
|
9
|
+
# Include everything needed to run rake, tests, features, etc.
|
10
|
+
group :development do
|
11
|
+
gem "rspec", "~> 3.2"
|
12
|
+
gem "yard", "~> 0.7"
|
13
|
+
gem "rdoc", "~> 3.12"
|
14
|
+
gem "bundler", "~> 1.0"
|
15
|
+
gem "jeweler", "~> 2.0.1"
|
16
|
+
gem "simplecov", ">= 0"
|
17
|
+
gem "reek", "~> 1.2.8"
|
18
|
+
gem "roodi", "~> 2.1.0"
|
19
|
+
gem "autotest-standalone"
|
20
|
+
gem "rspec-autotest"
|
21
|
+
end
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,104 @@
|
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
addressable (2.3.8)
|
5
|
+
autotest-standalone (4.5.11)
|
6
|
+
builder (3.2.2)
|
7
|
+
descendants_tracker (0.0.4)
|
8
|
+
thread_safe (~> 0.3, >= 0.3.1)
|
9
|
+
diff-lcs (1.2.5)
|
10
|
+
docile (1.1.5)
|
11
|
+
faraday (0.9.1)
|
12
|
+
multipart-post (>= 1.2, < 3)
|
13
|
+
git (1.2.9.1)
|
14
|
+
github_api (0.12.3)
|
15
|
+
addressable (~> 2.3)
|
16
|
+
descendants_tracker (~> 0.0.4)
|
17
|
+
faraday (~> 0.8, < 0.10)
|
18
|
+
hashie (>= 3.3)
|
19
|
+
multi_json (>= 1.7.5, < 2.0)
|
20
|
+
nokogiri (~> 1.6.3)
|
21
|
+
oauth2
|
22
|
+
hashie (3.4.1)
|
23
|
+
highline (1.7.2)
|
24
|
+
jeweler (2.0.1)
|
25
|
+
builder
|
26
|
+
bundler (>= 1.0)
|
27
|
+
git (>= 1.2.5)
|
28
|
+
github_api
|
29
|
+
highline (>= 1.6.15)
|
30
|
+
nokogiri (>= 1.5.10)
|
31
|
+
rake
|
32
|
+
rdoc
|
33
|
+
json (1.8.2)
|
34
|
+
jwt (1.5.0)
|
35
|
+
mini_portile (0.6.2)
|
36
|
+
multi_json (1.11.0)
|
37
|
+
multi_xml (0.5.5)
|
38
|
+
multipart-post (2.0.0)
|
39
|
+
nokogiri (1.6.6.2)
|
40
|
+
mini_portile (~> 0.6.0)
|
41
|
+
oauth2 (1.0.0)
|
42
|
+
faraday (>= 0.8, < 0.10)
|
43
|
+
jwt (~> 1.0)
|
44
|
+
multi_json (~> 1.3)
|
45
|
+
multi_xml (~> 0.5)
|
46
|
+
rack (~> 1.2)
|
47
|
+
rack (1.6.1)
|
48
|
+
rake (10.4.2)
|
49
|
+
rdoc (3.12.2)
|
50
|
+
json (~> 1.4)
|
51
|
+
redis (3.2.1)
|
52
|
+
reek (1.2.13)
|
53
|
+
ripper_ruby_parser (~> 0.0.7)
|
54
|
+
ruby2ruby (~> 1.2.5)
|
55
|
+
ruby_parser (~> 2.0)
|
56
|
+
sexp_processor (~> 3.0)
|
57
|
+
ripper_ruby_parser (0.0.8)
|
58
|
+
sexp_processor (~> 3.0)
|
59
|
+
roodi (2.1.0)
|
60
|
+
ruby_parser
|
61
|
+
rspec (3.2.0)
|
62
|
+
rspec-core (~> 3.2.0)
|
63
|
+
rspec-expectations (~> 3.2.0)
|
64
|
+
rspec-mocks (~> 3.2.0)
|
65
|
+
rspec-autotest (1.0.0)
|
66
|
+
rspec-core (>= 2.99.0.beta1, < 4.0.0)
|
67
|
+
rspec-core (3.2.3)
|
68
|
+
rspec-support (~> 3.2.0)
|
69
|
+
rspec-expectations (3.2.1)
|
70
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
71
|
+
rspec-support (~> 3.2.0)
|
72
|
+
rspec-mocks (3.2.1)
|
73
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
74
|
+
rspec-support (~> 3.2.0)
|
75
|
+
rspec-support (3.2.2)
|
76
|
+
ruby2ruby (1.2.5)
|
77
|
+
ruby_parser (~> 2.0)
|
78
|
+
sexp_processor (~> 3.0)
|
79
|
+
ruby_parser (2.3.1)
|
80
|
+
sexp_processor (~> 3.0)
|
81
|
+
sexp_processor (3.2.0)
|
82
|
+
simplecov (0.10.0)
|
83
|
+
docile (~> 1.1.0)
|
84
|
+
json (~> 1.8)
|
85
|
+
simplecov-html (~> 0.10.0)
|
86
|
+
simplecov-html (0.10.0)
|
87
|
+
thread_safe (0.3.5)
|
88
|
+
yard (0.8.7.6)
|
89
|
+
|
90
|
+
PLATFORMS
|
91
|
+
ruby
|
92
|
+
|
93
|
+
DEPENDENCIES
|
94
|
+
autotest-standalone
|
95
|
+
bundler (~> 1.0)
|
96
|
+
jeweler (~> 2.0.1)
|
97
|
+
rdoc (~> 3.12)
|
98
|
+
redis
|
99
|
+
reek (~> 1.2.8)
|
100
|
+
roodi (~> 2.1.0)
|
101
|
+
rspec (~> 3.2)
|
102
|
+
rspec-autotest
|
103
|
+
simplecov
|
104
|
+
yard (~> 0.7)
|
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 Chris Olstrom
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
22
|
+
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2015 Chris Olstrom
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
data/README.rdoc
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
= kanban
|
2
|
+
|
3
|
+
Description goes here.
|
4
|
+
|
5
|
+
== Contributing to kanban
|
6
|
+
|
7
|
+
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
|
8
|
+
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
|
9
|
+
* Fork the project.
|
10
|
+
* Start a feature/bugfix branch.
|
11
|
+
* Commit and push until you are happy with your contribution.
|
12
|
+
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
13
|
+
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
14
|
+
|
15
|
+
== Copyright
|
16
|
+
|
17
|
+
Copyright (c) 2015 Chris Olstrom. See LICENSE.txt for
|
18
|
+
further details.
|
19
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'bundler'
|
5
|
+
begin
|
6
|
+
Bundler.setup(:default, :development)
|
7
|
+
rescue Bundler::BundlerError => e
|
8
|
+
$stderr.puts e.message
|
9
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
10
|
+
exit e.status_code
|
11
|
+
end
|
12
|
+
require 'rake'
|
13
|
+
|
14
|
+
require 'jeweler'
|
15
|
+
Jeweler::Tasks.new do |gem|
|
16
|
+
# gem is a Gem::Specification... see http://guides.rubygems.org/specification-reference/ for more options
|
17
|
+
gem.name = "kanban"
|
18
|
+
gem.homepage = "http://github.com/colstrom/kanban"
|
19
|
+
gem.license = "MIT"
|
20
|
+
gem.summary = %Q{Agile Workflow for your code}
|
21
|
+
gem.description = %Q{Because your code totally needed an Agile Workflow}
|
22
|
+
gem.email = "chris@olstrom.com"
|
23
|
+
gem.authors = ["Chris Olstrom"]
|
24
|
+
# dependencies defined in Gemfile
|
25
|
+
end
|
26
|
+
Jeweler::RubygemsDotOrgTasks.new
|
27
|
+
|
28
|
+
require 'rspec/core'
|
29
|
+
require 'rspec/core/rake_task'
|
30
|
+
RSpec::Core::RakeTask.new(:spec) do |spec|
|
31
|
+
spec.pattern = FileList['spec/**/*_spec.rb']
|
32
|
+
end
|
33
|
+
|
34
|
+
desc "Code coverage detail"
|
35
|
+
task :simplecov do
|
36
|
+
ENV['COVERAGE'] = "true"
|
37
|
+
Rake::Task['spec'].execute
|
38
|
+
end
|
39
|
+
|
40
|
+
require 'reek/rake/task'
|
41
|
+
Reek::Rake::Task.new do |t|
|
42
|
+
t.fail_on_error = true
|
43
|
+
t.verbose = false
|
44
|
+
t.source_files = 'lib/**/*.rb'
|
45
|
+
end
|
46
|
+
|
47
|
+
require 'roodi'
|
48
|
+
require 'roodi_task'
|
49
|
+
RoodiTask.new do |t|
|
50
|
+
t.verbose = false
|
51
|
+
end
|
52
|
+
|
53
|
+
task :default => :spec
|
54
|
+
|
55
|
+
require 'yard'
|
56
|
+
YARD::Rake::YardocTask.new
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.3.1
|
data/kanban.gemspec
ADDED
@@ -0,0 +1,88 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
# stub: kanban 0.3.1 ruby lib
|
6
|
+
|
7
|
+
Gem::Specification.new do |s|
|
8
|
+
s.name = "kanban"
|
9
|
+
s.version = "0.3.1"
|
10
|
+
|
11
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
|
+
s.require_paths = ["lib"]
|
13
|
+
s.authors = ["Chris Olstrom"]
|
14
|
+
s.date = "2015-05-26"
|
15
|
+
s.description = "Because your code totally needed an Agile Workflow"
|
16
|
+
s.email = "chris@olstrom.com"
|
17
|
+
s.extra_rdoc_files = [
|
18
|
+
"LICENSE",
|
19
|
+
"LICENSE.txt",
|
20
|
+
"README.md",
|
21
|
+
"README.rdoc"
|
22
|
+
]
|
23
|
+
s.files = [
|
24
|
+
".document",
|
25
|
+
".rspec",
|
26
|
+
"Gemfile",
|
27
|
+
"Gemfile.lock",
|
28
|
+
"LICENSE",
|
29
|
+
"LICENSE.txt",
|
30
|
+
"README.md",
|
31
|
+
"README.rdoc",
|
32
|
+
"Rakefile",
|
33
|
+
"VERSION",
|
34
|
+
"kanban.gemspec",
|
35
|
+
"lib/kanban.rb",
|
36
|
+
"lib/kanban/hash_safety.rb",
|
37
|
+
"spec/kanban/hash_safety_spec.rb",
|
38
|
+
"spec/kanban_spec.rb",
|
39
|
+
"spec/spec_helper.rb"
|
40
|
+
]
|
41
|
+
s.homepage = "http://github.com/colstrom/kanban"
|
42
|
+
s.licenses = ["MIT"]
|
43
|
+
s.rubygems_version = "2.4.5"
|
44
|
+
s.summary = "Agile Workflow for your code"
|
45
|
+
|
46
|
+
if s.respond_to? :specification_version then
|
47
|
+
s.specification_version = 4
|
48
|
+
|
49
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
50
|
+
s.add_runtime_dependency(%q<redis>, [">= 0"])
|
51
|
+
s.add_development_dependency(%q<rspec>, ["~> 3.2"])
|
52
|
+
s.add_development_dependency(%q<yard>, ["~> 0.7"])
|
53
|
+
s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
|
54
|
+
s.add_development_dependency(%q<bundler>, ["~> 1.0"])
|
55
|
+
s.add_development_dependency(%q<jeweler>, ["~> 2.0.1"])
|
56
|
+
s.add_development_dependency(%q<simplecov>, [">= 0"])
|
57
|
+
s.add_development_dependency(%q<reek>, ["~> 1.2.8"])
|
58
|
+
s.add_development_dependency(%q<roodi>, ["~> 2.1.0"])
|
59
|
+
s.add_development_dependency(%q<autotest-standalone>, [">= 0"])
|
60
|
+
s.add_development_dependency(%q<rspec-autotest>, [">= 0"])
|
61
|
+
else
|
62
|
+
s.add_dependency(%q<redis>, [">= 0"])
|
63
|
+
s.add_dependency(%q<rspec>, ["~> 3.2"])
|
64
|
+
s.add_dependency(%q<yard>, ["~> 0.7"])
|
65
|
+
s.add_dependency(%q<rdoc>, ["~> 3.12"])
|
66
|
+
s.add_dependency(%q<bundler>, ["~> 1.0"])
|
67
|
+
s.add_dependency(%q<jeweler>, ["~> 2.0.1"])
|
68
|
+
s.add_dependency(%q<simplecov>, [">= 0"])
|
69
|
+
s.add_dependency(%q<reek>, ["~> 1.2.8"])
|
70
|
+
s.add_dependency(%q<roodi>, ["~> 2.1.0"])
|
71
|
+
s.add_dependency(%q<autotest-standalone>, [">= 0"])
|
72
|
+
s.add_dependency(%q<rspec-autotest>, [">= 0"])
|
73
|
+
end
|
74
|
+
else
|
75
|
+
s.add_dependency(%q<redis>, [">= 0"])
|
76
|
+
s.add_dependency(%q<rspec>, ["~> 3.2"])
|
77
|
+
s.add_dependency(%q<yard>, ["~> 0.7"])
|
78
|
+
s.add_dependency(%q<rdoc>, ["~> 3.12"])
|
79
|
+
s.add_dependency(%q<bundler>, ["~> 1.0"])
|
80
|
+
s.add_dependency(%q<jeweler>, ["~> 2.0.1"])
|
81
|
+
s.add_dependency(%q<simplecov>, [">= 0"])
|
82
|
+
s.add_dependency(%q<reek>, ["~> 1.2.8"])
|
83
|
+
s.add_dependency(%q<roodi>, ["~> 2.1.0"])
|
84
|
+
s.add_dependency(%q<autotest-standalone>, [">= 0"])
|
85
|
+
s.add_dependency(%q<rspec-autotest>, [">= 0"])
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
data/lib/kanban.rb
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
require 'redis'
|
2
|
+
require_relative 'kanban/hash_safety'
|
3
|
+
|
4
|
+
module Kanban
|
5
|
+
class Backlog
|
6
|
+
using HashSafety
|
7
|
+
|
8
|
+
attr_reader :namespace, :queue, :item
|
9
|
+
|
10
|
+
def initialize(backend:, **options)
|
11
|
+
@namespace = options.fetch :namespace, 'default'
|
12
|
+
@queue = "#{@namespace}:#{options.fetch :queue, 'tasks'}"
|
13
|
+
@item = "#{@namespace}:#{options.fetch :item, 'tasks'}"
|
14
|
+
@backend = backend
|
15
|
+
end
|
16
|
+
|
17
|
+
def get(id)
|
18
|
+
@backend.hgetall "#{@item}:#{id}"
|
19
|
+
end
|
20
|
+
|
21
|
+
def next_id
|
22
|
+
@backend.incr "#{@queue}:id"
|
23
|
+
end
|
24
|
+
|
25
|
+
def todo
|
26
|
+
@backend.lrange("#{@queue}:todo", 0, -1).map(&:to_i)
|
27
|
+
end
|
28
|
+
|
29
|
+
def add(task)
|
30
|
+
fail TypeError if task.keys_contain_symbols?
|
31
|
+
id = next_id
|
32
|
+
@backend.hmset "#{@item}:#{id}", *task.to_a
|
33
|
+
@backend.lpush "#{@queue}:todo", id
|
34
|
+
id
|
35
|
+
end
|
36
|
+
|
37
|
+
def add!(task)
|
38
|
+
safe = task.with_string_keys
|
39
|
+
add(safe)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require_relative '../spec_helper'
|
2
|
+
|
3
|
+
using HashSafety
|
4
|
+
|
5
|
+
describe 'HashSafety' do
|
6
|
+
before do
|
7
|
+
@symbol_hash = { foo: 1, bar: 2, baz: 3 }
|
8
|
+
@string_hash = { 'foo' => 1, 'bar' => 2, 'baz' => 3 }
|
9
|
+
end
|
10
|
+
|
11
|
+
it 'should detect symbols in hash keys' do
|
12
|
+
expect(@symbol_hash.keys_contain_symbols?).to be true
|
13
|
+
end
|
14
|
+
|
15
|
+
it 'should provide an alternate hash with string keys' do
|
16
|
+
safe = @symbol_hash.with_string_keys
|
17
|
+
expect(safe).to eq @string_hash
|
18
|
+
expect(safe.keys_contain_symbols?).to be false
|
19
|
+
end
|
20
|
+
end
|
data/spec/kanban_spec.rb
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
+
|
3
|
+
describe 'Backlog' do
|
4
|
+
before do
|
5
|
+
@backlog = Kanban::Backlog.new backend: Redis.new
|
6
|
+
end
|
7
|
+
|
8
|
+
it 'instantiates without error' do
|
9
|
+
expect(@backlog).to be_an_instance_of(Kanban::Backlog)
|
10
|
+
end
|
11
|
+
|
12
|
+
it 'should have a namespace' do
|
13
|
+
expect(@backlog.namespace).to eq 'default'
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'should allow namespace configuration at initialization' do
|
17
|
+
backlog = Kanban::Backlog.new namespace: 'foo', backend: nil
|
18
|
+
expect(backlog.namespace).to eq 'foo'
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'should prefix queue keys with the namespace' do
|
22
|
+
expect(@backlog.queue).to start_with('default')
|
23
|
+
end
|
24
|
+
|
25
|
+
it 'should prefix item keys with the namespace' do
|
26
|
+
expect(@backlog.item).to start_with('default')
|
27
|
+
end
|
28
|
+
|
29
|
+
it 'should require a backend' do
|
30
|
+
expect { Kanban::Backlog.new }.to raise_error(ArgumentError)
|
31
|
+
end
|
32
|
+
|
33
|
+
it 'should be able to get a task' do
|
34
|
+
expect(@backlog.get(0)).to be_a Hash
|
35
|
+
end
|
36
|
+
|
37
|
+
it 'shoud provide the next ID to assign to a task' do
|
38
|
+
expect(@backlog.next_id).to be_a Fixnum
|
39
|
+
end
|
40
|
+
|
41
|
+
it 'should not reuse IDs' do
|
42
|
+
expect(@backlog.next_id).to eq (@backlog.next_id - 1)
|
43
|
+
end
|
44
|
+
|
45
|
+
it 'should have a list of tasks waiting to be done' do
|
46
|
+
expect(@backlog.todo).to be_an Array
|
47
|
+
end
|
48
|
+
|
49
|
+
it 'should throw a TypeError if passed a Hash with Symbol keys' do
|
50
|
+
task = { foo: 'bar' }
|
51
|
+
expect { @backlog.add task }.to raise_error(TypeError)
|
52
|
+
end
|
53
|
+
|
54
|
+
it 'should return the ID of a newly added task' do
|
55
|
+
task = { 'foo' => 'bar' }
|
56
|
+
expect(@backlog.add(task)).to be_a Fixnum
|
57
|
+
end
|
58
|
+
|
59
|
+
it 'should allow Symbol keys with add! method' do
|
60
|
+
task = { foo: 'bar' }
|
61
|
+
expect(@backlog.add!(task)).to be_a Fixnum
|
62
|
+
end
|
63
|
+
|
64
|
+
it 'should preserve the task details' do
|
65
|
+
task = { 'foo' => 'bar' }
|
66
|
+
expect(@backlog.get(@backlog.add(task))).to eq task
|
67
|
+
end
|
68
|
+
|
69
|
+
it 'should add new tasks to the list of tasks waiting to be done' do
|
70
|
+
task = { 'foo' => 'bar' }
|
71
|
+
id = @backlog.add(task)
|
72
|
+
expect(@backlog.todo).to include(id)
|
73
|
+
end
|
74
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'simplecov'
|
2
|
+
|
3
|
+
module SimpleCov
|
4
|
+
module Configuration
|
5
|
+
def clean_filters
|
6
|
+
@filters = []
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
SimpleCov.configure do
|
12
|
+
clean_filters
|
13
|
+
load_profile 'test_frameworks'
|
14
|
+
end
|
15
|
+
|
16
|
+
ENV['COVERAGE'] && SimpleCov.start do
|
17
|
+
add_filter '/.rvm/'
|
18
|
+
end
|
19
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
20
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
21
|
+
|
22
|
+
require 'rspec'
|
23
|
+
require 'kanban'
|
24
|
+
|
25
|
+
# Requires supporting files with custom matchers and macros, etc,
|
26
|
+
# in ./support/ and its subdirectories.
|
27
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
metadata
ADDED
@@ -0,0 +1,217 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: kanban
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.3.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Chris Olstrom
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-05-26 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: redis
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rspec
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '3.2'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '3.2'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: yard
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0.7'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0.7'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rdoc
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '3.12'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '3.12'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: bundler
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '1.0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '1.0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: jeweler
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 2.0.1
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 2.0.1
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: simplecov
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: reek
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: 1.2.8
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: 1.2.8
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: roodi
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - "~>"
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: 2.1.0
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - "~>"
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: 2.1.0
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: autotest-standalone
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: rspec-autotest
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ">="
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ">="
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
167
|
+
description: Because your code totally needed an Agile Workflow
|
168
|
+
email: chris@olstrom.com
|
169
|
+
executables: []
|
170
|
+
extensions: []
|
171
|
+
extra_rdoc_files:
|
172
|
+
- LICENSE
|
173
|
+
- LICENSE.txt
|
174
|
+
- README.md
|
175
|
+
- README.rdoc
|
176
|
+
files:
|
177
|
+
- ".document"
|
178
|
+
- ".rspec"
|
179
|
+
- Gemfile
|
180
|
+
- Gemfile.lock
|
181
|
+
- LICENSE
|
182
|
+
- LICENSE.txt
|
183
|
+
- README.md
|
184
|
+
- README.rdoc
|
185
|
+
- Rakefile
|
186
|
+
- VERSION
|
187
|
+
- kanban.gemspec
|
188
|
+
- lib/kanban.rb
|
189
|
+
- lib/kanban/hash_safety.rb
|
190
|
+
- spec/kanban/hash_safety_spec.rb
|
191
|
+
- spec/kanban_spec.rb
|
192
|
+
- spec/spec_helper.rb
|
193
|
+
homepage: http://github.com/colstrom/kanban
|
194
|
+
licenses:
|
195
|
+
- MIT
|
196
|
+
metadata: {}
|
197
|
+
post_install_message:
|
198
|
+
rdoc_options: []
|
199
|
+
require_paths:
|
200
|
+
- lib
|
201
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
202
|
+
requirements:
|
203
|
+
- - ">="
|
204
|
+
- !ruby/object:Gem::Version
|
205
|
+
version: '0'
|
206
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
207
|
+
requirements:
|
208
|
+
- - ">="
|
209
|
+
- !ruby/object:Gem::Version
|
210
|
+
version: '0'
|
211
|
+
requirements: []
|
212
|
+
rubyforge_project:
|
213
|
+
rubygems_version: 2.4.5
|
214
|
+
signing_key:
|
215
|
+
specification_version: 4
|
216
|
+
summary: Agile Workflow for your code
|
217
|
+
test_files: []
|