calamity 0.0.4 → 0.0.5
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.
- data/bin/calamity +5 -2
- data/lib/calamity_version.rb +1 -1
- data/test/tc_calamity.rb +5 -0
- metadata +3 -3
data/bin/calamity
CHANGED
@@ -43,6 +43,9 @@ command :save do |c|
|
|
43
43
|
c.arg_name '"project"'
|
44
44
|
c.flag [:p, :project]
|
45
45
|
c.action do |global_options,options,args|
|
46
|
+
raise "Task name must be 35 characters or less" if args[0].size > 35
|
47
|
+
raise "Context must be 20 characters or less" if (options[:context] and options[:context].size > 20)
|
48
|
+
raise "Project must be 20 characters or less" if (options[:project] and options[:project].size > 20)
|
46
49
|
task = Calamity::Task.new
|
47
50
|
task.name = args[0]
|
48
51
|
task.context = options[:context]
|
@@ -64,9 +67,9 @@ command :list do |c|
|
|
64
67
|
bold = `tput bold`
|
65
68
|
underline = `tput smul`
|
66
69
|
normal = `tput sgr0`
|
67
|
-
puts "#{bold}#{underline}#{'Task Name'.center(
|
70
|
+
puts "#{bold}#{underline}#{'Task Name'.center(35)}#{'Context'.center(20)}#{'Project'.center(20)}#{normal}"
|
68
71
|
tasks.each do |t|
|
69
|
-
puts "#{t.name.center(
|
72
|
+
puts "#{t.name.center(35) if t.name}#{t.context.center(20) if t.context}#{t.project.center(20) if t.project}"
|
70
73
|
end
|
71
74
|
end
|
72
75
|
end
|
data/lib/calamity_version.rb
CHANGED
data/test/tc_calamity.rb
CHANGED
@@ -38,7 +38,12 @@ class TC_testCalamity < Test::Unit::TestCase
|
|
38
38
|
`./bin/calamity --database="./test/calamity.db" finish foobar`
|
39
39
|
foo = `./bin/calamity --database="./test/calamity.db" list | grep foo | awk '{print $1}'`.strip
|
40
40
|
assert(foo.eql?(""))
|
41
|
+
end
|
41
42
|
|
43
|
+
def test_char_limit_on_task_name
|
44
|
+
`./bin/calamity --database="./test/calamity.db" save foobardfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdfdf`
|
45
|
+
foo = `./bin/calamity --database="./test/calamity.db" list | grep foo | awk '{print $1}'`.strip
|
46
|
+
assert(foo.eql?(""))
|
42
47
|
end
|
43
48
|
|
44
49
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 5
|
9
|
+
version: 0.0.5
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Kevin Beddingfield
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2012-03-
|
17
|
+
date: 2012-03-25 00:00:00 -07:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|