posto 0.3.5 → 0.4.0.SNAPSHOT

Sign up to get free protection for your applications and to get access to all the features.
@@ -43,16 +43,19 @@ module Posto
43
43
 
44
44
  def start(todo)
45
45
  add(todo)
46
- @file.commit_alone("[posto] scheduled '#{todo}'")
46
+ @file.commit_alone("scheduled '#{todo}'")
47
47
  end
48
48
  alias :schedule :start
49
49
 
50
50
  def commit(n = 1)
51
- @file.commit("[posto] finished '#{done(n)}'")
51
+ @file.commit("#{done(n)}")
52
52
  end
53
53
 
54
54
  def oops
55
+ add(`git log -1 --pretty=%B`.strip)
56
+ @file.write @todos = @list_utility.do_bottom(todos)
55
57
  @file.oops
58
+ @list_utility.lookup(todos, 1)
56
59
  end
57
60
 
58
61
  def init
data/lib/posto/file.rb CHANGED
@@ -20,12 +20,7 @@ module Posto
20
20
  end
21
21
 
22
22
  def oops
23
- commit_msg = `git log --pretty=format:'%s' -n 1`
24
- if /^\[posto\]/ =~ commit_msg
25
- `git reset --soft HEAD^`
26
- else
27
- "last commit was not made by posto: #{commit_msg}"
28
- end
23
+ `git reset --soft HEAD^`
29
24
  end
30
25
 
31
26
  def touch
data/lib/posto/list.rb CHANGED
@@ -55,6 +55,10 @@ module Posto
55
55
  end
56
56
  alias :do :top
57
57
 
58
+ def do_bottom(todos)
59
+ top(todos, todos.size)
60
+ end
61
+
58
62
  def lookup(todos, n)
59
63
  Posto::Todo.hide_markdown(todos[n.to_i - 1])
60
64
  end
data/test/list_test.rb CHANGED
@@ -67,4 +67,9 @@ class ListTest < MiniTest::Unit::TestCase
67
67
  assert_equal(["1. this is another", "2. this is one", "* card molly"],
68
68
  Posto::List.top(["1. this is one", "2. this is another", "* card molly"], 2))
69
69
  end
70
+
71
+ def test_do_bottom
72
+ assert_equal(["1. jingle bells", "2. this is one", "3. this is another", "* card molly"],
73
+ Posto::List.do_bottom(["1. this is one", "2. this is another", "* card molly", "* jingle bells"]))
74
+ end
70
75
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: posto
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
5
- prerelease:
4
+ version: 0.4.0.SNAPSHOT
5
+ prerelease: 6
6
6
  platform: ruby
7
7
  authors:
8
8
  - Matt J Raibert
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-12 00:00:00.000000000 Z
12
+ date: 2012-12-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -134,23 +134,23 @@ files:
134
134
  - README.md
135
135
  - LICENSE.txt
136
136
  - bin/posto
137
- - lib/posto/monkeypatch_array.rb
138
- - lib/posto/application.rb
139
- - lib/posto/list.rb
137
+ - lib/posto.rb
140
138
  - lib/posto/help.rb
141
- - lib/posto/todo.rb
139
+ - lib/posto/monkeypatch_array.rb
142
140
  - lib/posto/file.rb
141
+ - lib/posto/todo.rb
142
+ - lib/posto/application.rb
143
+ - lib/posto/human_comparison.rb
143
144
  - lib/posto/help.md
145
+ - lib/posto/list.rb
144
146
  - lib/posto/arguments.rb
145
- - lib/posto/human_comparison.rb
146
- - lib/posto.rb
147
- - test/list_test.rb
148
- - test/arguments_test.rb
147
+ - test/monkeypatch_array_test.rb
148
+ - test/help_test.rb
149
149
  - test/test_helper.rb
150
+ - test/arguments_test.rb
150
151
  - test/application_test.rb
151
- - test/monkeypatch_array_test.rb
152
+ - test/list_test.rb
152
153
  - test/todo_test.rb
153
- - test/help_test.rb
154
154
  homepage: http://github.com/mattraibert/posto
155
155
  licenses:
156
156
  - GPLv3
@@ -166,16 +166,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
166
166
  version: '0'
167
167
  segments:
168
168
  - 0
169
- hash: -1910736030221862158
169
+ hash: 2193702014575093908
170
170
  required_rubygems_version: !ruby/object:Gem::Requirement
171
171
  none: false
172
172
  requirements:
173
- - - ! '>='
173
+ - - ! '>'
174
174
  - !ruby/object:Gem::Version
175
- version: '0'
176
- segments:
177
- - 0
178
- hash: -1910736030221862158
175
+ version: 1.3.1
179
176
  requirements: []
180
177
  rubyforge_project:
181
178
  rubygems_version: 1.8.24
@@ -183,10 +180,10 @@ signing_key:
183
180
  specification_version: 3
184
181
  summary: CLI to sort your todo list.
185
182
  test_files:
186
- - test/list_test.rb
187
- - test/arguments_test.rb
183
+ - test/monkeypatch_array_test.rb
184
+ - test/help_test.rb
188
185
  - test/test_helper.rb
186
+ - test/arguments_test.rb
189
187
  - test/application_test.rb
190
- - test/monkeypatch_array_test.rb
188
+ - test/list_test.rb
191
189
  - test/todo_test.rb
192
- - test/help_test.rb