twdo 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -68,12 +68,13 @@ Twitter のプロフィールでタスク管理する TwDo コマンド
68
68
  Usage:
69
69
  twdo command [task1, task2 ...]
70
70
  Commands:
71
- twdo init task1 task2 ... init with tasks.
72
- twdo list list tasks.
73
- twdo add task1 task2 ... add tasks.
74
- twdo del task1 task2 ... del tasks.
75
- twdo done task1 task2 ... mark task as done.
76
- twdo undo task1 task2 ... mark task as not done.
71
+ twdo init task1 task2 ... init with tasks.
72
+ twdo list list tasks.
73
+ twdo add task1 task2 ... add tasks.
74
+ twdo del task1 task2 ... del tasks.
75
+ twdo done task1 task2 ... mark task as done.
76
+ twdo undo task1 task2 ... mark task as not done.
77
+ twdo help show this help.
77
78
 
78
79
  インストール
79
80
  -------------
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.1
1
+ 0.0.2
data/bin/twdo CHANGED
@@ -29,9 +29,11 @@ end
29
29
 
30
30
  [:del, :done, :undo].each do |c|
31
31
  cmd c do |args|
32
- args.each do |arg|
33
- arg = arg =~ /^\d+$/ ? arg.to_i : arg
34
- @twd.send(c, arg)
32
+ names = args.map do |arg|
33
+ arg =~ /^\d+$/ ? @twd.list[arg.to_i][0] : arg
34
+ end
35
+ names.each do |name|
36
+ @twd.send(c, name)
35
37
  end
36
38
  @twd.update!
37
39
  puts 'done.'
@@ -44,7 +46,7 @@ Usage:
44
46
  twdo command [task1, task2 ...]
45
47
  Commands:
46
48
  twdo init task1 task2 ... init with tasks.
47
- twdo list task1 task2 ... list tasks.
49
+ twdo list list tasks.
48
50
  twdo add task1 task2 ... add tasks.
49
51
  twdo del task1 task2 ... del tasks.
50
52
  twdo done task1 task2 ... mark task as done.
@@ -48,6 +48,9 @@ class TwDo
48
48
  operation(:del ) {|t, l| l.delete(t) }
49
49
 
50
50
  def add(name)
51
+ if name =~ /^\d+$/
52
+ raise Error, 'task name can not be number.'
53
+ end
51
54
  if list.assoc(name)
52
55
  raise Error, 'task already exists.'
53
56
  end
@@ -1,7 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  require 'rubygems'
3
- require 'twitter'
4
3
  require 'oauth'
4
+ require 'twitter'
5
5
  require 'oauth/cli/twitter'
6
6
 
7
7
  class TwDo
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{twdo}
8
- s.version = "0.0.1"
8
+ s.version = "0.0.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["tily"]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twdo
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 27
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 1
10
- version: 0.0.1
9
+ - 2
10
+ version: 0.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - tily