remember-the-ruby 0.4.1 → 1.0.0
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/.gitignore +5 -0
- data/Rakefile +47 -0
- data/VERSION +1 -0
- data/bin/.placeholder +0 -0
- data/doc/.placeholder +0 -0
- data/lib/rtr/commands.rb +9 -2
- data/remember-the-ruby.gemspec +91 -0
- data/spec/api_spec.rb +33 -0
- data/spec/remember-the-ruby_spec.rb +24 -0
- data/spec/settings.rb +15 -0
- data/spec/settings.yml.dist +2 -0
- data/spec/task_spec.rb +22 -0
- metadata +48 -14
data/.gitignore
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'jeweler'
|
6
|
+
Jeweler::Tasks.new do |gem|
|
7
|
+
gem.name = "remember-the-ruby"
|
8
|
+
gem.summary = %Q{A Ruby interface to Remember the Milk}
|
9
|
+
gem.description = %Q{http://peervoice.com/software/remember-the-ruby}
|
10
|
+
gem.email = "<ddollar@gmail.com>"
|
11
|
+
gem.homepage = "http://github.com/ddollar/remember-the-ruby"
|
12
|
+
gem.authors = ["David Dollar"]
|
13
|
+
gem.add_development_dependency "rspec"
|
14
|
+
gem.add_development_dependency "yard"
|
15
|
+
|
16
|
+
gem.add_dependency 'ddollar-preferences', '>= 0.1.3'
|
17
|
+
gem.add_dependency 'term-ansicolor', '>= 1.0.3'
|
18
|
+
end
|
19
|
+
Jeweler::GemcutterTasks.new
|
20
|
+
rescue LoadError
|
21
|
+
puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
|
22
|
+
end
|
23
|
+
|
24
|
+
require 'spec/rake/spectask'
|
25
|
+
Spec::Rake::SpecTask.new(:spec) do |spec|
|
26
|
+
spec.libs << 'lib' << 'spec'
|
27
|
+
spec.spec_files = FileList['spec/**/*_spec.rb']
|
28
|
+
end
|
29
|
+
|
30
|
+
Spec::Rake::SpecTask.new(:rcov) do |spec|
|
31
|
+
spec.libs << 'lib' << 'spec'
|
32
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
33
|
+
spec.rcov = true
|
34
|
+
end
|
35
|
+
|
36
|
+
task :spec => :check_dependencies
|
37
|
+
|
38
|
+
task :default => :spec
|
39
|
+
|
40
|
+
begin
|
41
|
+
require 'yard'
|
42
|
+
YARD::Rake::YardocTask.new
|
43
|
+
rescue LoadError
|
44
|
+
task :yardoc do
|
45
|
+
abort "YARD is not available. In order to run yardoc, you must: sudo gem install yard"
|
46
|
+
end
|
47
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
1.0.0
|
data/bin/.placeholder
ADDED
File without changes
|
data/doc/.placeholder
ADDED
File without changes
|
data/lib/rtr/commands.rb
CHANGED
@@ -20,7 +20,12 @@ class Commands
|
|
20
20
|
|
21
21
|
register_method :tasks do |options|
|
22
22
|
|
23
|
-
|
23
|
+
plain = options.include?('plain')
|
24
|
+
|
25
|
+
header = "Outstanding Tasks"
|
26
|
+
header = header.white.bold unless plain
|
27
|
+
|
28
|
+
puts header
|
24
29
|
puts
|
25
30
|
|
26
31
|
tasks = $storage[:tasks] || api.default_list.tasks
|
@@ -35,6 +40,7 @@ class Commands
|
|
35
40
|
diff = due.blank? ? nil : due - now
|
36
41
|
|
37
42
|
color = case
|
43
|
+
when plain then nil
|
38
44
|
when diff.nil? then :white
|
39
45
|
when diff.abs < 1 && due.day == now.day then :yellow
|
40
46
|
when diff < 0 then :red
|
@@ -47,7 +53,8 @@ class Commands
|
|
47
53
|
prefix = " *"
|
48
54
|
prefix = prefix.send(color).bold if color
|
49
55
|
|
50
|
-
suffix = task.tags.map { |t| "@#{t.name}" }.join(' ')
|
56
|
+
suffix = task.tags.map { |t| "@#{t.name}" }.join(' ')
|
57
|
+
suffix = suffix.cyan unless plain
|
51
58
|
|
52
59
|
puts "#{prefix} #{title} #{suffix}"
|
53
60
|
|
@@ -0,0 +1,91 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{remember-the-ruby}
|
8
|
+
s.version = "1.0.0"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["David Dollar"]
|
12
|
+
s.date = %q{2009-09-12}
|
13
|
+
s.default_executable = %q{rtr}
|
14
|
+
s.description = %q{http://peervoice.com/software/remember-the-ruby}
|
15
|
+
s.email = %q{<ddollar@gmail.com>}
|
16
|
+
s.executables = ["rtr"]
|
17
|
+
s.extra_rdoc_files = [
|
18
|
+
"README"
|
19
|
+
]
|
20
|
+
s.files = [
|
21
|
+
".gitignore",
|
22
|
+
"README",
|
23
|
+
"Rakefile",
|
24
|
+
"VERSION",
|
25
|
+
"bin/.placeholder",
|
26
|
+
"bin/rtr",
|
27
|
+
"doc/.placeholder",
|
28
|
+
"lib/core_ext/datetime.rb",
|
29
|
+
"lib/core_ext/enumerable.rb",
|
30
|
+
"lib/core_ext/fixnum.rb",
|
31
|
+
"lib/core_ext/nil.rb",
|
32
|
+
"lib/core_ext/string.rb",
|
33
|
+
"lib/remember-the-ruby.rb",
|
34
|
+
"lib/remember-the-ruby/api.rb",
|
35
|
+
"lib/remember-the-ruby/contact.rb",
|
36
|
+
"lib/remember-the-ruby/entity.rb",
|
37
|
+
"lib/remember-the-ruby/entity_list.rb",
|
38
|
+
"lib/remember-the-ruby/group.rb",
|
39
|
+
"lib/remember-the-ruby/list.rb",
|
40
|
+
"lib/remember-the-ruby/location.rb",
|
41
|
+
"lib/remember-the-ruby/note.rb",
|
42
|
+
"lib/remember-the-ruby/rpc.rb",
|
43
|
+
"lib/remember-the-ruby/storage.rb",
|
44
|
+
"lib/remember-the-ruby/tag.rb",
|
45
|
+
"lib/remember-the-ruby/task.rb",
|
46
|
+
"lib/remember-the-ruby/task_occurrence.rb",
|
47
|
+
"lib/rtr.rb",
|
48
|
+
"lib/rtr/api.rb",
|
49
|
+
"lib/rtr/command_helper.rb",
|
50
|
+
"lib/rtr/commands.rb",
|
51
|
+
"remember-the-ruby.gemspec",
|
52
|
+
"spec/api_spec.rb",
|
53
|
+
"spec/remember-the-ruby_spec.rb",
|
54
|
+
"spec/settings.rb",
|
55
|
+
"spec/settings.yml.dist",
|
56
|
+
"spec/task_spec.rb"
|
57
|
+
]
|
58
|
+
s.homepage = %q{http://github.com/ddollar/remember-the-ruby}
|
59
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
60
|
+
s.require_paths = ["lib"]
|
61
|
+
s.rubygems_version = %q{1.3.5}
|
62
|
+
s.summary = %q{A Ruby interface to Remember the Milk}
|
63
|
+
s.test_files = [
|
64
|
+
"spec/api_spec.rb",
|
65
|
+
"spec/remember-the-ruby_spec.rb",
|
66
|
+
"spec/settings.rb",
|
67
|
+
"spec/task_spec.rb"
|
68
|
+
]
|
69
|
+
|
70
|
+
if s.respond_to? :specification_version then
|
71
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
72
|
+
s.specification_version = 3
|
73
|
+
|
74
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
75
|
+
s.add_development_dependency(%q<rspec>, [">= 0"])
|
76
|
+
s.add_development_dependency(%q<yard>, [">= 0"])
|
77
|
+
s.add_runtime_dependency(%q<ddollar-preferences>, [">= 0.1.3"])
|
78
|
+
s.add_runtime_dependency(%q<term-ansicolor>, [">= 1.0.3"])
|
79
|
+
else
|
80
|
+
s.add_dependency(%q<rspec>, [">= 0"])
|
81
|
+
s.add_dependency(%q<yard>, [">= 0"])
|
82
|
+
s.add_dependency(%q<ddollar-preferences>, [">= 0.1.3"])
|
83
|
+
s.add_dependency(%q<term-ansicolor>, [">= 1.0.3"])
|
84
|
+
end
|
85
|
+
else
|
86
|
+
s.add_dependency(%q<rspec>, [">= 0"])
|
87
|
+
s.add_dependency(%q<yard>, [">= 0"])
|
88
|
+
s.add_dependency(%q<ddollar-preferences>, [">= 0.1.3"])
|
89
|
+
s.add_dependency(%q<term-ansicolor>, [">= 1.0.3"])
|
90
|
+
end
|
91
|
+
end
|
data/spec/api_spec.rb
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
$:.push('lib')
|
2
|
+
require 'remember-the-ruby'
|
3
|
+
include RememberTheRuby
|
4
|
+
|
5
|
+
require File.join(File.dirname(__FILE__), 'settings')
|
6
|
+
|
7
|
+
describe RememberTheRuby::API do
|
8
|
+
|
9
|
+
before(:all) do
|
10
|
+
@api = api_from_settings
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should not be nil" do
|
14
|
+
@api.should_not be_nil
|
15
|
+
end
|
16
|
+
|
17
|
+
it "should return an EntityList for #lists" do
|
18
|
+
@api.lists.should be_an_instance_of(EntityList)
|
19
|
+
end
|
20
|
+
|
21
|
+
it "should return a Hash for #settings" do
|
22
|
+
@api.settings.should be_an_instance_of(Hash)
|
23
|
+
end
|
24
|
+
|
25
|
+
it "should return an EntityList for #tags" do
|
26
|
+
@api.tags.should be_an_instance_of(EntityList)
|
27
|
+
end
|
28
|
+
|
29
|
+
it "should return an EntityList for #tasks" do
|
30
|
+
@api.tasks.should be_an_instance_of(EntityList)
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
$:.push('lib')
|
2
|
+
require 'remember-the-ruby'
|
3
|
+
include RememberTheRuby
|
4
|
+
|
5
|
+
describe RememberTheRuby do
|
6
|
+
|
7
|
+
describe 'api' do
|
8
|
+
|
9
|
+
|
10
|
+
it "should have a version" do
|
11
|
+
lambda { RememberTheRuby.version }.should_not raise_error
|
12
|
+
end
|
13
|
+
|
14
|
+
it "should have a libpath" do
|
15
|
+
lambda { RememberTheRuby.libpath }.should_not raise_error
|
16
|
+
end
|
17
|
+
|
18
|
+
it "should have a path" do
|
19
|
+
lambda { RememberTheRuby.path }.should_not raise_error
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
data/spec/settings.rb
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
def api_from_settings
|
2
|
+
begin
|
3
|
+
settings = YAML::load_file(File.join(File.dirname(__FILE__), "settings.yml"))
|
4
|
+
api = RememberTheRuby::API.new(settings)
|
5
|
+
rescue Errno::ENOENT
|
6
|
+
unless $errored_about_api_settings
|
7
|
+
puts "################################################################################"
|
8
|
+
puts "# NOTICE: spec/settings.yml.dist to spec/settings.yml and set up appropriately #"
|
9
|
+
puts "################################################################################"
|
10
|
+
api = nil
|
11
|
+
end
|
12
|
+
$errored_about_api_settings = true
|
13
|
+
end
|
14
|
+
api
|
15
|
+
end
|
data/spec/task_spec.rb
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
$:.push('lib')
|
2
|
+
require 'remember-the-ruby'
|
3
|
+
include RememberTheRuby
|
4
|
+
|
5
|
+
require File.join(File.dirname(__FILE__), 'settings')
|
6
|
+
|
7
|
+
describe RememberTheRuby::Task do
|
8
|
+
|
9
|
+
before(:all) do
|
10
|
+
@api = api_from_settings
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should be findable by id" do
|
14
|
+
if task = @api.tasks.first
|
15
|
+
id = task.id
|
16
|
+
id.should_not be_nil
|
17
|
+
@api.tasks.find(id.to_s).should == task
|
18
|
+
@api.tasks.find(id.to_i).should == task
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: remember-the-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Dollar
|
@@ -9,9 +9,29 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
13
|
-
default_executable:
|
12
|
+
date: 2009-09-12 00:00:00 -04:00
|
13
|
+
default_executable: rtr
|
14
14
|
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: rspec
|
17
|
+
type: :development
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: "0"
|
24
|
+
version:
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: yard
|
27
|
+
type: :development
|
28
|
+
version_requirement:
|
29
|
+
version_requirements: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: "0"
|
34
|
+
version:
|
15
35
|
- !ruby/object:Gem::Dependency
|
16
36
|
name: ddollar-preferences
|
17
37
|
type: :runtime
|
@@ -32,8 +52,8 @@ dependencies:
|
|
32
52
|
- !ruby/object:Gem::Version
|
33
53
|
version: 1.0.3
|
34
54
|
version:
|
35
|
-
description:
|
36
|
-
email: ddollar@gmail.com
|
55
|
+
description: http://peervoice.com/software/remember-the-ruby
|
56
|
+
email: <ddollar@gmail.com>
|
37
57
|
executables:
|
38
58
|
- rtr
|
39
59
|
extensions: []
|
@@ -41,12 +61,19 @@ extensions: []
|
|
41
61
|
extra_rdoc_files:
|
42
62
|
- README
|
43
63
|
files:
|
64
|
+
- .gitignore
|
65
|
+
- README
|
66
|
+
- Rakefile
|
67
|
+
- VERSION
|
68
|
+
- bin/.placeholder
|
44
69
|
- bin/rtr
|
70
|
+
- doc/.placeholder
|
45
71
|
- lib/core_ext/datetime.rb
|
46
72
|
- lib/core_ext/enumerable.rb
|
47
73
|
- lib/core_ext/fixnum.rb
|
48
74
|
- lib/core_ext/nil.rb
|
49
75
|
- lib/core_ext/string.rb
|
76
|
+
- lib/remember-the-ruby.rb
|
50
77
|
- lib/remember-the-ruby/api.rb
|
51
78
|
- lib/remember-the-ruby/contact.rb
|
52
79
|
- lib/remember-the-ruby/entity.rb
|
@@ -60,19 +87,23 @@ files:
|
|
60
87
|
- lib/remember-the-ruby/tag.rb
|
61
88
|
- lib/remember-the-ruby/task.rb
|
62
89
|
- lib/remember-the-ruby/task_occurrence.rb
|
63
|
-
- lib/
|
90
|
+
- lib/rtr.rb
|
64
91
|
- lib/rtr/api.rb
|
65
92
|
- lib/rtr/command_helper.rb
|
66
93
|
- lib/rtr/commands.rb
|
67
|
-
-
|
68
|
-
-
|
94
|
+
- remember-the-ruby.gemspec
|
95
|
+
- spec/api_spec.rb
|
96
|
+
- spec/remember-the-ruby_spec.rb
|
97
|
+
- spec/settings.rb
|
98
|
+
- spec/settings.yml.dist
|
99
|
+
- spec/task_spec.rb
|
69
100
|
has_rdoc: true
|
70
|
-
homepage: http://
|
101
|
+
homepage: http://github.com/ddollar/remember-the-ruby
|
71
102
|
licenses: []
|
72
103
|
|
73
104
|
post_install_message:
|
74
|
-
rdoc_options:
|
75
|
-
|
105
|
+
rdoc_options:
|
106
|
+
- --charset=UTF-8
|
76
107
|
require_paths:
|
77
108
|
- lib
|
78
109
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -89,10 +120,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
89
120
|
version:
|
90
121
|
requirements: []
|
91
122
|
|
92
|
-
rubyforge_project:
|
123
|
+
rubyforge_project:
|
93
124
|
rubygems_version: 1.3.5
|
94
125
|
signing_key:
|
95
126
|
specification_version: 3
|
96
127
|
summary: A Ruby interface to Remember the Milk
|
97
|
-
test_files:
|
98
|
-
|
128
|
+
test_files:
|
129
|
+
- spec/api_spec.rb
|
130
|
+
- spec/remember-the-ruby_spec.rb
|
131
|
+
- spec/settings.rb
|
132
|
+
- spec/task_spec.rb
|