sculd 0.0.3 → 0.1.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.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sculd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,22 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-18 00:00:00.000000000 Z
12
+ date: 2013-05-16 00:00:00.000000000 Z
13
13
  dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: rspec
16
- requirement: &81543840 !ruby/object:Gem::Requirement
17
- none: false
18
- requirements:
19
- - - ~>
20
- - !ruby/object:Gem::Version
21
- version: 2.12.0
22
- type: :development
23
- prerelease: false
24
- version_requirements: *81543840
25
14
  - !ruby/object:Gem::Dependency
26
15
  name: rdoc
27
- requirement: &81542780 !ruby/object:Gem::Requirement
16
+ requirement: &88535180 !ruby/object:Gem::Requirement
28
17
  none: false
29
18
  requirements:
30
19
  - - ~>
@@ -32,10 +21,10 @@ dependencies:
32
21
  version: '3.12'
33
22
  type: :development
34
23
  prerelease: false
35
- version_requirements: *81542780
24
+ version_requirements: *88535180
36
25
  - !ruby/object:Gem::Dependency
37
26
  name: bundler
38
- requirement: &81557840 !ruby/object:Gem::Requirement
27
+ requirement: &88534940 !ruby/object:Gem::Requirement
39
28
  none: false
40
29
  requirements:
41
30
  - - ~>
@@ -43,10 +32,10 @@ dependencies:
43
32
  version: 1.3.5
44
33
  type: :development
45
34
  prerelease: false
46
- version_requirements: *81557840
35
+ version_requirements: *88534940
47
36
  - !ruby/object:Gem::Dependency
48
37
  name: jeweler
49
- requirement: &81555870 !ruby/object:Gem::Requirement
38
+ requirement: &88534690 !ruby/object:Gem::Requirement
50
39
  none: false
51
40
  requirements:
52
41
  - - ~>
@@ -54,10 +43,10 @@ dependencies:
54
43
  version: 1.8.4
55
44
  type: :development
56
45
  prerelease: false
57
- version_requirements: *81555870
46
+ version_requirements: *88534690
58
47
  - !ruby/object:Gem::Dependency
59
48
  name: simplecov
60
- requirement: &81553970 !ruby/object:Gem::Requirement
49
+ requirement: &88534450 !ruby/object:Gem::Requirement
61
50
  none: false
62
51
  requirements:
63
52
  - - ! '>='
@@ -65,10 +54,10 @@ dependencies:
65
54
  version: '0'
66
55
  type: :development
67
56
  prerelease: false
68
- version_requirements: *81553970
57
+ version_requirements: *88534450
69
58
  - !ruby/object:Gem::Dependency
70
59
  name: highline
71
- requirement: &81552290 !ruby/object:Gem::Requirement
60
+ requirement: &88534140 !ruby/object:Gem::Requirement
72
61
  none: false
73
62
  requirements:
74
63
  - - ! '>='
@@ -76,18 +65,7 @@ dependencies:
76
65
  version: 1.6.15
77
66
  type: :development
78
67
  prerelease: false
79
- version_requirements: *81552290
80
- - !ruby/object:Gem::Dependency
81
- name: psych
82
- requirement: &81550640 !ruby/object:Gem::Requirement
83
- none: false
84
- requirements:
85
- - - ! '>='
86
- - !ruby/object:Gem::Version
87
- version: '0'
88
- type: :development
89
- prerelease: false
90
- version_requirements: *81550640
68
+ version_requirements: *88534140
91
69
  description: ! 'Schedule management system using ''howm'' like format. Plans, i.e.,
92
70
  schedule(@), reminder(-), deadline(!), and tood(+), make events and tasks. Command
93
71
  ''sculd'' can output events on each date and tasks with high priority. '
@@ -111,29 +89,23 @@ files:
111
89
  - bin/dates
112
90
  - bin/sculd
113
91
  - lib/sculd.rb
114
- - lib/sculd/event.rb
115
92
  - lib/sculd/manager.rb
116
93
  - lib/sculd/plan.rb
117
94
  - lib/sculd/plan/deadline.rb
118
95
  - lib/sculd/plan/reminder.rb
119
96
  - lib/sculd/plan/schedule.rb
120
97
  - lib/sculd/plan/todo.rb
121
- - lib/sculd/task.rb
122
- - sculd.gemspec
123
- - spec/command_spec.rb
124
- - spec/deadline_spec.rb
125
- - spec/event_spec.rb
126
- - spec/job_spec.rb
127
- - spec/manager_spec.rb
128
- - spec/plan_spec.rb
129
- - spec/reminder_spec.rb
130
- - spec/schedule/empty.dat
131
- - spec/schedule/error.dat
132
- - spec/schedule/schedule.dat
133
- - spec/schedule_spec.rb
134
- - spec/sculd_spec.rb
135
- - spec/spec_helper.rb
136
- - spec/todo_spec.rb
98
+ - test/helper.rb
99
+ - test/schedule/empty/empty.dat
100
+ - test/schedule/error/error.dat
101
+ - test/schedule/normal/a.dat
102
+ - test/schedule/normal/b.dat
103
+ - test/test_deadline.rb
104
+ - test/test_manager.rb
105
+ - test/test_plan.rb
106
+ - test/test_reminder.rb
107
+ - test/test_schedule.rb
108
+ - test/test_todo.rb
137
109
  homepage: http://github.com/ippei94da/sculd
138
110
  licenses:
139
111
  - MIT
@@ -149,7 +121,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
149
121
  version: '0'
150
122
  segments:
151
123
  - 0
152
- hash: -261038947
124
+ hash: 558675731
153
125
  required_rubygems_version: !ruby/object:Gem::Requirement
154
126
  none: false
155
127
  requirements:
@@ -1,23 +0,0 @@
1
- #! /usr/bin/env ruby
2
- # coding: utf-8
3
-
4
- require "sculd.rb"
5
-
6
- #
7
- #
8
- #
9
- class Sculd::Event
10
- attr_reader :datetime, :description
11
-
12
- #
13
- def initialize(datetime, description)
14
- @datetime = datetime
15
- @description = description
16
- end
17
-
18
- def date
19
- @datetime.to_date
20
- end
21
-
22
- end
23
-
@@ -1,18 +0,0 @@
1
- #! /usr/bin/env ruby
2
- # coding: utf-8
3
-
4
- require "sculd.rb"
5
-
6
- #
7
- #
8
- #
9
- class Sculd::Task
10
- attr_reader :priority, :description
11
-
12
- #
13
- def initialize(priority, description)
14
- @priority = priority
15
- @description = description
16
- end
17
- end
18
-
@@ -1,92 +0,0 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
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 = "sculd"
8
- s.version = "0.0.3"
9
-
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["ippei94da"]
12
- s.date = "2013-04-18"
13
- s.description = "Schedule management system using 'howm' like format. Plans, i.e., schedule(@), reminder(-), deadline(!), and tood(+), make events and tasks. Command 'sculd' can output events on each date and tasks with high priority. "
14
- s.email = "ippei94da@gmail.com"
15
- s.executables = ["dates", "sculd"]
16
- s.extra_rdoc_files = [
17
- "LICENSE.txt",
18
- "README.rdoc"
19
- ]
20
- s.files = [
21
- ".document",
22
- ".rspec",
23
- "CHANGES",
24
- "Gemfile",
25
- "LICENSE.txt",
26
- "README.rdoc",
27
- "Rakefile",
28
- "VERSION",
29
- "bin/dates",
30
- "bin/sculd",
31
- "lib/sculd.rb",
32
- "lib/sculd/event.rb",
33
- "lib/sculd/manager.rb",
34
- "lib/sculd/plan.rb",
35
- "lib/sculd/plan/deadline.rb",
36
- "lib/sculd/plan/reminder.rb",
37
- "lib/sculd/plan/schedule.rb",
38
- "lib/sculd/plan/todo.rb",
39
- "lib/sculd/task.rb",
40
- "sculd.gemspec",
41
- "spec/command_spec.rb",
42
- "spec/deadline_spec.rb",
43
- "spec/event_spec.rb",
44
- "spec/job_spec.rb",
45
- "spec/manager_spec.rb",
46
- "spec/plan_spec.rb",
47
- "spec/reminder_spec.rb",
48
- "spec/schedule/empty.dat",
49
- "spec/schedule/error.dat",
50
- "spec/schedule/schedule.dat",
51
- "spec/schedule_spec.rb",
52
- "spec/sculd_spec.rb",
53
- "spec/spec_helper.rb",
54
- "spec/todo_spec.rb"
55
- ]
56
- s.homepage = "http://github.com/ippei94da/sculd"
57
- s.licenses = ["MIT"]
58
- s.require_paths = ["lib"]
59
- s.rubygems_version = "1.8.11"
60
- s.summary = "Sculd, SChedULe Dealer."
61
-
62
- if s.respond_to? :specification_version then
63
- s.specification_version = 3
64
-
65
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
66
- s.add_development_dependency(%q<rspec>, ["~> 2.12.0"])
67
- s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
68
- s.add_development_dependency(%q<bundler>, ["~> 1.3.5"])
69
- s.add_development_dependency(%q<jeweler>, ["~> 1.8.4"])
70
- s.add_development_dependency(%q<simplecov>, [">= 0"])
71
- s.add_development_dependency(%q<highline>, [">= 1.6.15"])
72
- s.add_development_dependency(%q<psych>, [">= 0"])
73
- else
74
- s.add_dependency(%q<rspec>, ["~> 2.12.0"])
75
- s.add_dependency(%q<rdoc>, ["~> 3.12"])
76
- s.add_dependency(%q<bundler>, ["~> 1.3.5"])
77
- s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
78
- s.add_dependency(%q<simplecov>, [">= 0"])
79
- s.add_dependency(%q<highline>, [">= 1.6.15"])
80
- s.add_dependency(%q<psych>, [">= 0"])
81
- end
82
- else
83
- s.add_dependency(%q<rspec>, ["~> 2.12.0"])
84
- s.add_dependency(%q<rdoc>, ["~> 3.12"])
85
- s.add_dependency(%q<bundler>, ["~> 1.3.5"])
86
- s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
87
- s.add_dependency(%q<simplecov>, [">= 0"])
88
- s.add_dependency(%q<highline>, [">= 1.6.15"])
89
- s.add_dependency(%q<psych>, [">= 0"])
90
- end
91
- end
92
-
@@ -1,7 +0,0 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
-
3
- #describe "Command" do
4
- # context "data containg wrong weekday" do
5
- # end
6
- #end
7
-
@@ -1,46 +0,0 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
-
3
- describe Sculd::Plan::Deadline do # E.g., Klass
4
- context 'Date[2012-10-15], 10, [2012-10-15]!10 deadlineA' do
5
-
6
- before do
7
- today = Date.new(2012, 10, 15)
8
- @d00 = Sculd::Plan::Deadline.new(today, 10, '[2012-10-15]!10 deadlineA')
9
- end
10
-
11
- describe '#priority' do # ''
12
- context '' do
13
- it 'return DEADLINE_PRIORITY when the day is today.' do
14
- today = Date.new(2012, 10, 15)
15
- @d00.priority(today).should == 20000
16
- end
17
-
18
- it 'return DEADLINE_PRIORITY when the day is past.' do
19
- today = Date.new(2012, 10, 20)
20
- @d00.priority(today).should == 20000
21
- end
22
-
23
- it 'return values between REMINDER_PRIORITY and DEADLINE_PRIORITY during the period.' do
24
- today = Date.new(2012, 10, 10)
25
- @d00.priority(today).should == 15000
26
- end
27
-
28
- it 'return 0 before the period.' do
29
- today = Date.new(2012, 10, 1)
30
- @d00.priority(today).should == 0
31
- end
32
- end
33
- end
34
-
35
- describe "#events" do
36
- context '' do
37
- it '' do
38
- @d00.events.size.should == 2
39
- @d00.events[0].date.should == Date.new(2012, 10, 5)
40
- @d00.events[1].date.should == Date.new(2012, 10, 15)
41
- end
42
- end
43
- end
44
- end
45
- end
46
-
@@ -1,35 +0,0 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
-
3
- describe Sculd::Event do # E.g., Klass
4
- context 'normal' do # 'when stack is empty'
5
- before do
6
- datetime = DateTime.new(2012, 3, 4, 5, 6, 7)
7
- @e00 = Sculd::Event.new(datetime, "abc")
8
- end
9
-
10
- describe '#date' do # ''
11
- context '' do
12
- it 'should return Date.new(2012, 3, 4)' do
13
- @e00.date.should == Date.new(2012, 3, 4)
14
- end
15
- end
16
- end
17
-
18
- describe '#datetime' do # ''
19
- context '' do
20
- it 'should return DateTime.new(2012, 3, 4, 5, 6, 7)' do
21
- @e00.datetime.should == DateTime.new(2012, 3, 4, 5, 6, 7)
22
- end
23
- end
24
- end
25
-
26
- describe '#description' do # ''
27
- context '' do
28
- it 'should return abc' do
29
- @e00.description.should == "abc"
30
- end
31
- end
32
- end
33
- end
34
- end
35
-
@@ -1,7 +0,0 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
-
3
- describe "Job" do
4
- #it "fails" do
5
- # fail "hey buddy, you should probably rename this file and start specing for real"
6
- #end
7
- end
@@ -1,131 +0,0 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
- # coding: utf-8
3
-
4
- #require "stringio"
5
-
6
- class Sculd::Manager
7
- public :load_file, :show_events, :days_events, :show_tasks
8
- attr_accessor :plans
9
- end
10
-
11
- describe "Manager" do
12
- context "empty" do
13
- before do
14
- @s00 = Sculd::Manager.new("spec/schedule/empty.dat")
15
- end
16
-
17
- describe "#load_file" do
18
- context "correct data" do
19
- it "should overwrite data" do
20
- result = @s00.load_file("spec/schedule/schedule.dat")
21
- @s00.plans.size.should == 4
22
- @s00.plans[0].should be_kind_of Sculd::Plan
23
- @s00.plans[1].should be_kind_of Sculd::Plan
24
- @s00.plans[2].should be_kind_of Sculd::Plan
25
- @s00.plans[3].should be_kind_of Sculd::Plan
26
-
27
- result = @s00.load_file("spec/schedule/empty.dat")
28
- @s00.plans.size.should == 0
29
- end
30
- end
31
-
32
- context "data containing error" do
33
- it "should interrupt with error line." do
34
- io = StringIO.new
35
- lambda{ @s00.load_file("spec/schedule/error.dat", io)}.should raise_error Sculd::Manager::LoadError
36
- end
37
- end
38
- end
39
- end
40
-
41
- context "when there are some plans" do
42
- before do
43
- @s01 = Sculd::Manager.new("spec/schedule/schedule.dat")
44
- end
45
-
46
- describe "#days_events" do
47
- it 'should return hash dates as keys and events as values.' do
48
- results = @s01.days_events
49
- results.keys.should == [
50
- Date.new(2012, 9, 15), #@ schedule a 2012, 09, 06),
51
- Date.new(2012, 9, 9), #! deadline b 2012, 09, 06),
52
- Date.new(2012, 9, 16), #! deadline b 2012, 09, 06),
53
- Date.new(2012, 9, 17), #- reminder c 2012, 09, 06),
54
- Date.new(2012, 9, 18), #+ todo d 2012, 09, 06),
55
- Date.new(2012, 9, 25), #+ todo d 2012, 09, 06),
56
- ]
57
- results[Date.new(2012, 9, 15)].should be_kind_of Array
58
- #pp results[Date.new(2012, 9, 15)][0]
59
- results[Date.new(2012, 9, 15)][0].should be_kind_of Sculd::Event
60
- end
61
- end
62
-
63
- describe "#show_events" do
64
- it 'should return itemized days and events' do
65
- io = StringIO.new
66
- today = Date.new(2012, 9, 15)
67
- @s01.show_events(2, today, io)
68
- io.rewind
69
- results = io.readlines
70
- #pp results
71
- results.size.should == 7
72
- results[0].should == "Events:\n"
73
- #results[1].should == " 2012-09-09 Sun\n"
74
- results[1].should == "  2012-09-15 Sat \n"
75
- results[2].should == " [2012-09-15]@ schedule a\n"
76
- results[3].should == "\n"
77
- results[4].should == "  2012-09-16 Sun \n"
78
- results[5].should == " [2012-09-16]! deadline b\n"
79
- results[6].should == "\n"
80
- #results[].should == "\n"
81
- #results[].should == " [2012-09-16]\n"
82
- #results[].should == " [2012-09-16]! deadline b\n"
83
- #results[].should == "\n"
84
- #results[].should == " [2012-09-17]\n"
85
- #results[].should == " [2012-09-17]- reminder c\n"
86
- #results[].should == "\n"
87
- #results[].should == " [2012-09-18]\n"
88
- #results[].should == " [2012-09-18]+ todo d\n"
89
- #results[].should == "\n"
90
- #results[].should == " [2012-09-15]\n"
91
- #results[].should == " [2012-09-18]+ todo d\n"
92
- end
93
- end
94
-
95
- describe "#show_tasks" do
96
- it 'should return sorted tasks' do
97
- io = StringIO.new
98
- today = Date.new(2012, 9,20)
99
- @s01.show_tasks(3, today, io)
100
- io.rewind
101
- results = io.readlines
102
- #pp results
103
- results.size.should == 4
104
- results[0].should == "Tasks:\n"
105
- results[1].should == " [2012-09-16]! deadline b\n"
106
- results[2].should == " [2012-09-18]+ todo d\n"
107
- results[3].should == " [2012-09-17]- reminder c\n"
108
- #results[4].should == " [2012-09-15]@ schedule a\n"
109
- end
110
- end
111
- end
112
- end
113
-
114
- #describe "Manager" do
115
- # context "empty" do
116
- # describe "#load_file" do
117
- # result = @s00.load_file("spec/schedule/schedule.dat")
118
- # it '' do
119
- # @s00.plans.size.should == 4
120
- # @s00.plans[0].should be_kind_of Sculd::Plan
121
- # @s00.plans[1].should be_kind_of Sculd::Plan
122
- # @s00.plans[2].should be_kind_of Sculd::Plan
123
- # @s00.plans[3].should be_kind_of Sculd::Plan
124
- #
125
- # result = @s00.load_file("spec/schedule/empty.dat")
126
- # @s00.plans.size.should == 0
127
- # end
128
- # end
129
- # end
130
- #end
131
- #