milkmaid 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +6 -0
- data/VERSION +1 -1
- data/lib/milkmaid.rb +2 -2
- data/milkmaid.gemspec +1 -1
- data/spec/milkmaid_spec.rb +27 -19
- metadata +80 -120
data/README.rdoc
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.1
|
data/lib/milkmaid.rb
CHANGED
@@ -3,13 +3,13 @@ require 'moocow'
|
|
3
3
|
class Milkmaid
|
4
4
|
def initialize
|
5
5
|
@rtm = RTM::RTM.new(RTM::Endpoint.new('31308536ffed80061df846c3a4564a27', 'c1476318e3483441'))
|
6
|
+
@auth = @rtm.auth
|
6
7
|
begin
|
7
8
|
@config_file = File.join(ENV['HOME'], '.milkmaid')
|
8
9
|
@config = YAML.load_file(@config_file)
|
9
|
-
@auth = @rtm.auth
|
10
10
|
@auth.frob = @config[:frob]
|
11
11
|
@rtm.token = @config[:token]
|
12
|
-
@timeline = @rtm.timelines.create['timeline']
|
12
|
+
@timeline = @rtm.timelines.create['timeline'] unless @config[:token].nil?
|
13
13
|
rescue Errno::ENOENT
|
14
14
|
@config = {}
|
15
15
|
end
|
data/milkmaid.gemspec
CHANGED
data/spec/milkmaid_spec.rb
CHANGED
@@ -10,7 +10,7 @@ describe "Milkmaid" do
|
|
10
10
|
before do
|
11
11
|
RTM::RTM.stub(:new) { rtm_double }
|
12
12
|
rtm_double.stub(:auth) { auth_double }
|
13
|
-
YAML.stub(:load_file).and_return({})
|
13
|
+
YAML.stub(:load_file).and_return({:token=>'tsttoken'})
|
14
14
|
File.stub(:open)
|
15
15
|
rtm_double.stub_chain(:timelines, :create) { timeline_double }
|
16
16
|
rtm_double.stub(:tasks) { tasks_double }
|
@@ -26,6 +26,12 @@ describe "Milkmaid" do
|
|
26
26
|
rtm_double.should_receive(:token=).with('testtoken')
|
27
27
|
lib
|
28
28
|
end
|
29
|
+
|
30
|
+
it "does not attempt to create a timeline when no auth token exists" do
|
31
|
+
YAML.stub(:load_file).and_return({})
|
32
|
+
rtm_double.should_not_receive(:timelines)
|
33
|
+
lib
|
34
|
+
end
|
29
35
|
end
|
30
36
|
|
31
37
|
context "when config dotfile does not exist" do
|
@@ -69,6 +75,7 @@ describe "Milkmaid" do
|
|
69
75
|
|
70
76
|
it "assigns and stores a local ID number to each task for easy addressing" do
|
71
77
|
should_store_in_configuration({
|
78
|
+
:token=>'tsttoken',
|
72
79
|
'1list_id'=>'21242147', '1taskseries_id'=>'bts', '1task_id'=>'bt',
|
73
80
|
'2list_id'=>'21242147', '2taskseries_id'=>'ats', '2task_id'=>'at',
|
74
81
|
'3list_id'=>'21242147', '3taskseries_id'=>'dts', '3task_id'=>'dt',
|
@@ -114,30 +121,30 @@ describe "Milkmaid" do
|
|
114
121
|
File.stub(:open)
|
115
122
|
end
|
116
123
|
|
117
|
-
|
124
|
+
|
125
|
+
describe "setup" do
|
118
126
|
before do
|
119
|
-
YAML.stub(:load_file)
|
127
|
+
YAML.stub(:load_file).and_raise(Errno::ENOENT)
|
120
128
|
end
|
121
129
|
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
end
|
130
|
+
it "directs the user to setup auth" do
|
131
|
+
lib.auth_start.should == 'http://testurl'
|
132
|
+
end
|
126
133
|
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
end
|
134
|
+
it "stores the frob in configuration" do
|
135
|
+
should_store_in_configuration({:frob=>"testfrob"})
|
136
|
+
lib.auth_start
|
131
137
|
end
|
138
|
+
end
|
132
139
|
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
140
|
+
describe "completion" do
|
141
|
+
it "stores the auth token in the dotfile" do
|
142
|
+
YAML.stub(:load_file) { {:frob=>'testfrob'} }
|
143
|
+
auth_double.stub(:get_token) {'testtoken'}
|
144
|
+
should_store_in_configuration({
|
145
|
+
:frob=>'testfrob',
|
146
|
+
:token=>'testtoken'})
|
147
|
+
lib.auth_finish
|
141
148
|
end
|
142
149
|
end
|
143
150
|
end
|
@@ -151,6 +158,7 @@ end
|
|
151
158
|
|
152
159
|
def should_call_rtm_api(method, tasknum)
|
153
160
|
YAML.stub(:load_file) {{
|
161
|
+
:token=>'tsttoken',
|
154
162
|
"#{tasknum}list_id"=>"#{tasknum}l",
|
155
163
|
"#{tasknum}taskseries_id"=>"#{tasknum}ts",
|
156
164
|
"#{tasknum}task_id"=>"#{tasknum}t"
|
metadata
CHANGED
@@ -1,136 +1,102 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: milkmaid
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.1
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 2
|
9
|
-
- 0
|
10
|
-
version: 0.2.0
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Marius Grigoriu
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
12
|
+
date: 2011-10-03 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: main
|
16
|
+
requirement: &70334228913400 !ruby/object:Gem::Requirement
|
22
17
|
none: false
|
23
|
-
requirements:
|
18
|
+
requirements:
|
24
19
|
- - ~>
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
hash: 45
|
27
|
-
segments:
|
28
|
-
- 4
|
29
|
-
- 7
|
30
|
-
- 7
|
20
|
+
- !ruby/object:Gem::Version
|
31
21
|
version: 4.7.7
|
32
|
-
name: main
|
33
|
-
prerelease: false
|
34
22
|
type: :runtime
|
35
|
-
|
36
|
-
|
37
|
-
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *70334228913400
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: moocow
|
27
|
+
requirement: &70334228912900 !ruby/object:Gem::Requirement
|
38
28
|
none: false
|
39
|
-
requirements:
|
29
|
+
requirements:
|
40
30
|
- - ~>
|
41
|
-
- !ruby/object:Gem::Version
|
42
|
-
hash: 19
|
43
|
-
segments:
|
44
|
-
- 1
|
45
|
-
- 1
|
46
|
-
- 0
|
31
|
+
- !ruby/object:Gem::Version
|
47
32
|
version: 1.1.0
|
48
|
-
name: moocow
|
49
|
-
prerelease: false
|
50
33
|
type: :runtime
|
51
|
-
|
52
|
-
|
53
|
-
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *70334228912900
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: paint
|
38
|
+
requirement: &70334228878440 !ruby/object:Gem::Requirement
|
54
39
|
none: false
|
55
|
-
requirements:
|
40
|
+
requirements:
|
56
41
|
- - ~>
|
57
|
-
- !ruby/object:Gem::Version
|
58
|
-
hash: 57
|
59
|
-
segments:
|
60
|
-
- 0
|
61
|
-
- 8
|
62
|
-
- 3
|
42
|
+
- !ruby/object:Gem::Version
|
63
43
|
version: 0.8.3
|
64
|
-
name: paint
|
65
|
-
prerelease: false
|
66
44
|
type: :runtime
|
67
|
-
requirement: *id003
|
68
|
-
- !ruby/object:Gem::Dependency
|
69
|
-
version_requirements: &id004 !ruby/object:Gem::Requirement
|
70
|
-
none: false
|
71
|
-
requirements:
|
72
|
-
- - ">="
|
73
|
-
- !ruby/object:Gem::Version
|
74
|
-
hash: 3
|
75
|
-
segments:
|
76
|
-
- 0
|
77
|
-
version: "0"
|
78
|
-
name: rspec
|
79
45
|
prerelease: false
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
46
|
+
version_requirements: *70334228878440
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: rspec
|
49
|
+
requirement: &70334228877960 !ruby/object:Gem::Requirement
|
84
50
|
none: false
|
85
|
-
requirements:
|
86
|
-
- -
|
87
|
-
- !ruby/object:Gem::Version
|
88
|
-
|
89
|
-
segments:
|
90
|
-
- 0
|
91
|
-
version: "0"
|
92
|
-
name: bundler
|
93
|
-
prerelease: false
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
94
55
|
type: :development
|
95
|
-
requirement: *id005
|
96
|
-
- !ruby/object:Gem::Dependency
|
97
|
-
version_requirements: &id006 !ruby/object:Gem::Requirement
|
98
|
-
none: false
|
99
|
-
requirements:
|
100
|
-
- - ">="
|
101
|
-
- !ruby/object:Gem::Version
|
102
|
-
hash: 3
|
103
|
-
segments:
|
104
|
-
- 0
|
105
|
-
version: "0"
|
106
|
-
name: jeweler
|
107
56
|
prerelease: false
|
57
|
+
version_requirements: *70334228877960
|
58
|
+
- !ruby/object:Gem::Dependency
|
59
|
+
name: bundler
|
60
|
+
requirement: &70334228798560 !ruby/object:Gem::Requirement
|
61
|
+
none: false
|
62
|
+
requirements:
|
63
|
+
- - ! '>='
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '0'
|
108
66
|
type: :development
|
109
|
-
|
110
|
-
|
111
|
-
|
67
|
+
prerelease: false
|
68
|
+
version_requirements: *70334228798560
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: jeweler
|
71
|
+
requirement: &70334228798000 !ruby/object:Gem::Requirement
|
112
72
|
none: false
|
113
|
-
requirements:
|
114
|
-
- -
|
115
|
-
- !ruby/object:Gem::Version
|
116
|
-
|
117
|
-
|
118
|
-
- 0
|
119
|
-
version: "0"
|
120
|
-
name: ZenTest
|
73
|
+
requirements:
|
74
|
+
- - ! '>='
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
77
|
+
type: :development
|
121
78
|
prerelease: false
|
79
|
+
version_requirements: *70334228798000
|
80
|
+
- !ruby/object:Gem::Dependency
|
81
|
+
name: ZenTest
|
82
|
+
requirement: &70334228797480 !ruby/object:Gem::Requirement
|
83
|
+
none: false
|
84
|
+
requirements:
|
85
|
+
- - ! '>='
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '0'
|
122
88
|
type: :development
|
123
|
-
|
89
|
+
prerelease: false
|
90
|
+
version_requirements: *70334228797480
|
124
91
|
description: Milkmaid is a command-line client for Remember the Milk
|
125
92
|
email: marius.grigoriu@live.com
|
126
|
-
executables:
|
93
|
+
executables:
|
127
94
|
- milkmaid
|
128
95
|
extensions: []
|
129
|
-
|
130
|
-
extra_rdoc_files:
|
96
|
+
extra_rdoc_files:
|
131
97
|
- LICENSE.txt
|
132
98
|
- README.rdoc
|
133
|
-
files:
|
99
|
+
files:
|
134
100
|
- .document
|
135
101
|
- .rspec
|
136
102
|
- Gemfile
|
@@ -145,37 +111,31 @@ files:
|
|
145
111
|
- spec/milkmaid_spec.rb
|
146
112
|
- spec/spec_helper.rb
|
147
113
|
homepage: http://github.com/mariusgrigoriu/milkmaid
|
148
|
-
licenses:
|
114
|
+
licenses:
|
149
115
|
- MIT
|
150
116
|
post_install_message:
|
151
117
|
rdoc_options: []
|
152
|
-
|
153
|
-
require_paths:
|
118
|
+
require_paths:
|
154
119
|
- lib
|
155
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
120
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
156
121
|
none: false
|
157
|
-
requirements:
|
158
|
-
- -
|
159
|
-
- !ruby/object:Gem::Version
|
160
|
-
|
161
|
-
segments:
|
122
|
+
requirements:
|
123
|
+
- - ! '>='
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '0'
|
126
|
+
segments:
|
162
127
|
- 0
|
163
|
-
|
164
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
128
|
+
hash: -1264874012981768680
|
129
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
165
130
|
none: false
|
166
|
-
requirements:
|
167
|
-
- -
|
168
|
-
- !ruby/object:Gem::Version
|
169
|
-
|
170
|
-
segments:
|
171
|
-
- 0
|
172
|
-
version: "0"
|
131
|
+
requirements:
|
132
|
+
- - ! '>='
|
133
|
+
- !ruby/object:Gem::Version
|
134
|
+
version: '0'
|
173
135
|
requirements: []
|
174
|
-
|
175
136
|
rubyforge_project:
|
176
137
|
rubygems_version: 1.8.10
|
177
138
|
signing_key:
|
178
139
|
specification_version: 3
|
179
140
|
summary: Milkmaid is a command-line client for Remember the Milk
|
180
141
|
test_files: []
|
181
|
-
|