rememberthemilk 0.0.1 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -60,8 +60,8 @@ end
60
60
 
61
61
  task :gemspec do
62
62
  ignore_extensions = 'git', 'svn', 'tmp', /sw./, 'bak', 'gem'
63
- ignore_directories = 'pkg'
64
- ignore_files = 'test/log'
63
+ ignore_directories = %w[ pkg ]
64
+ ignore_files = %w[ test/log ]
65
65
 
66
66
  shiteless =
67
67
  lambda do |list|
@@ -124,8 +124,13 @@ task :gemspec do
124
124
 
125
125
  spec.has_rdoc = #{ has_rdoc.inspect }
126
126
  spec.test_files = #{ test_files.inspect }
127
- #spec.add_dependency 'lib', '>= version'
128
- spec.add_dependency 'fattr'
127
+
128
+ # spec.add_dependency 'lib', '>= version'
129
+ spec.add_dependency 'json'
130
+ spec.add_dependency 'options'
131
+ spec.add_dependency 'orderedhash'
132
+ spec.add_dependency 'tzinfo'
133
+ spec.add_dependency 'mechanize'
129
134
 
130
135
  spec.extensions.push(*#{ extensions.inspect })
131
136
 
@@ -139,9 +144,8 @@ task :gemspec do
139
144
  end
140
145
 
141
146
  Fu.mkdir_p(This.pkgdir)
142
- gemspec = File.join(This.pkgdir, "#{ lib }.gemspec")
143
- open(gemspec, "w"){|fd| fd.puts(template)}
144
- This.gemspec = gemspec
147
+ This.gemspec = File.join(This.pkgdir, "gemspec.rb")
148
+ open("#{ This.gemspec }", "w"){|fd| fd.puts(template)}
145
149
  end
146
150
 
147
151
  task :gem => [:clean, :gemspec] do
@@ -151,8 +155,8 @@ task :gem => [:clean, :gemspec] do
151
155
  `#{ cmd }`
152
156
  after = Dir['*.gem']
153
157
  gem = ((after - before).first || after.first) or abort('no gem!')
154
- Fu.mv(gem, This.pkgdir)
155
- This.gem = File.join(This.pkgdir, File.basename(gem))
158
+ Fu.mv gem, This.pkgdir
159
+ This.gem = File.basename(gem)
156
160
  end
157
161
 
158
162
  task :readme do
@@ -208,18 +212,12 @@ task :release => [:clean, :gemspec, :gem] do
208
212
  gems = Dir[File.join(This.pkgdir, '*.gem')].flatten
209
213
  raise "which one? : #{ gems.inspect }" if gems.size > 1
210
214
  raise "no gems?" if gems.size < 1
211
-
212
- cmd = "gem push #{ This.gem }"
215
+ cmd = "rubyforge login && rubyforge add_release #{ This.rubyforge_project } #{ This.lib } #{ This.version } #{ This.pkgdir }/#{ This.gem }"
213
216
  puts cmd
214
- puts
215
- system(cmd)
216
- abort("cmd(#{ cmd }) failed with (#{ $?.inspect })") unless $?.exitstatus.zero?
217
-
218
- cmd = "rubyforge login && rubyforge add_release #{ This.rubyforge_project } #{ This.lib } #{ This.version } #{ This.gem }"
217
+ system cmd
218
+ cmd = "gem push #{ This.pkgdir }/#{ This.gem }"
219
219
  puts cmd
220
- puts
221
- system(cmd)
222
- abort("cmd(#{ cmd }) failed with (#{ $?.inspect })") unless $?.exitstatus.zero?
220
+ system cmd
223
221
  end
224
222
 
225
223
 
@@ -292,12 +290,12 @@ BEGIN {
292
290
 
293
291
  def unindent(s)
294
292
  indent = nil
295
- s.each do |line|
296
- next if line =~ %r/^\s*$/
297
- indent = line[%r/^\s*/] and break
293
+ s.each_line do |line|
294
+ next if line =~ %r/^\s*$/
295
+ indent = line[%r/^\s*/] and break
296
+ end
297
+ indent ? s.gsub(%r/^#{ indent }/, "") : s
298
298
  end
299
- indent ? s.gsub(%r/^#{ indent }/, "") : s
300
- end
301
299
  extend self
302
300
  end
303
301
 
@@ -305,7 +303,7 @@ BEGIN {
305
303
  #
306
304
  class Template
307
305
  def initialize(&block)
308
- @block = block
306
+ @block = block.binding
309
307
  @template = block.call.to_s
310
308
  end
311
309
  def expand(b=nil)
@@ -1,5 +1,5 @@
1
1
  module RememberTheMilk
2
- Version = '0.0.1' unless defined?(Version)
2
+ Version = '0.0.3' unless defined?(Version)
3
3
  Load = Kernel.method(:load) unless defined?(Load)
4
4
 
5
5
  def version
@@ -34,7 +34,7 @@ end
34
34
  RTM = RememberTheMilk unless defined?(RTM)
35
35
  Rememberthemilk = RememberTheMilk unless defined?(Rememberthemilk)
36
36
 
37
- require 'md5'
37
+ require 'digest/md5'
38
38
  require 'cgi'
39
39
  require 'net/http'
40
40
 
@@ -48,6 +48,7 @@ require 'json' unless defined?(JSON)
48
48
  require 'options' unless defined?(Options)
49
49
  require 'orderedhash' unless defined?(OrderedHash)
50
50
  require 'tzinfo' unless defined?(TZInfo)
51
+ require 'mechanize' unless defined?(Mechanize)
51
52
 
52
53
 
53
54
  RememberTheMilk.libdir do
@@ -57,11 +58,12 @@ end
57
58
 
58
59
 
59
60
  if __FILE__ == $0
61
+ require 'yaml'
60
62
  options = YAML.load(IO.read(File.expand_path('~/.rtm.yml')))
61
63
  api = RememberTheMilk::Api.new(options)
62
- #p api.ping
64
+ p api.get_token!
65
+ p api.ping
63
66
  #p api.call('rtm.tasks.getList')
64
- #p api.get_token!
65
67
  #p api.call('rtm.settings.getList')
66
- #p api.localtime(utc)
68
+ #p api.localtime(Time.now.utc)
67
69
  end
@@ -60,7 +60,7 @@ module RememberTheMilk
60
60
 
61
61
  def api_sig_for(query)
62
62
  kvs = query.to_a.map{|k,v| [k.to_s, v.to_s]}.sort
63
- MD5.md5(@shared_secret + kvs.join).to_s
63
+ Digest::MD5.hexdigest(@shared_secret + kvs.join).to_s
64
64
  end
65
65
 
66
66
  def ping
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rememberthemilk
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 25
4
5
  prerelease: false
5
6
  segments:
6
7
  - 0
7
8
  - 0
8
- - 1
9
- version: 0.0.1
9
+ - 3
10
+ version: 0.0.3
10
11
  platform: ruby
11
12
  authors:
12
13
  - Ara T. Howard
@@ -14,22 +15,79 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2010-09-13 00:00:00 -06:00
18
+ date: 2010-11-08 00:00:00 -07:00
18
19
  default_executable:
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency
21
- name: fattr
22
+ name: json
22
23
  prerelease: false
23
24
  requirement: &id001 !ruby/object:Gem::Requirement
24
25
  none: false
25
26
  requirements:
26
27
  - - ">="
27
28
  - !ruby/object:Gem::Version
29
+ hash: 3
28
30
  segments:
29
31
  - 0
30
32
  version: "0"
31
33
  type: :runtime
32
34
  version_requirements: *id001
35
+ - !ruby/object:Gem::Dependency
36
+ name: options
37
+ prerelease: false
38
+ requirement: &id002 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ hash: 3
44
+ segments:
45
+ - 0
46
+ version: "0"
47
+ type: :runtime
48
+ version_requirements: *id002
49
+ - !ruby/object:Gem::Dependency
50
+ name: orderedhash
51
+ prerelease: false
52
+ requirement: &id003 !ruby/object:Gem::Requirement
53
+ none: false
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ hash: 3
58
+ segments:
59
+ - 0
60
+ version: "0"
61
+ type: :runtime
62
+ version_requirements: *id003
63
+ - !ruby/object:Gem::Dependency
64
+ name: tzinfo
65
+ prerelease: false
66
+ requirement: &id004 !ruby/object:Gem::Requirement
67
+ none: false
68
+ requirements:
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ hash: 3
72
+ segments:
73
+ - 0
74
+ version: "0"
75
+ type: :runtime
76
+ version_requirements: *id004
77
+ - !ruby/object:Gem::Dependency
78
+ name: mechanize
79
+ prerelease: false
80
+ requirement: &id005 !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ">="
84
+ - !ruby/object:Gem::Version
85
+ hash: 3
86
+ segments:
87
+ - 0
88
+ version: "0"
89
+ type: :runtime
90
+ version_requirements: *id005
33
91
  description: "description: rememberthemilk kicks the ass"
34
92
  email: ara.t.howard@gmail.com
35
93
  executables: []
@@ -58,6 +116,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
58
116
  requirements:
59
117
  - - ">="
60
118
  - !ruby/object:Gem::Version
119
+ hash: 3
61
120
  segments:
62
121
  - 0
63
122
  version: "0"
@@ -66,6 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
66
125
  requirements:
67
126
  - - ">="
68
127
  - !ruby/object:Gem::Version
128
+ hash: 3
69
129
  segments:
70
130
  - 0
71
131
  version: "0"