oughtve 110.e2f5bb28
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +9 -0
- data/README +115 -0
- data/Rakefile +44 -0
- data/bin/oughtve +62 -0
- data/doc/HOWTO.using +131 -0
- data/doc/LICENCE +44 -0
- data/doc/README.markdown +115 -0
- data/doc/TODO +13 -0
- data/lib/oughtve.rb +87 -0
- data/lib/oughtve/chapter.rb +93 -0
- data/lib/oughtve/database.rb +83 -0
- data/lib/oughtve/errors.rb +6 -0
- data/lib/oughtve/options.rb +193 -0
- data/lib/oughtve/tangent.rb +353 -0
- data/lib/oughtve/verse.rb +83 -0
- data/setup.rb +1360 -0
- data/spec/bootstrap_creates_db_spec.rb +38 -0
- data/spec/bootstrap_creates_default_tangent_spec.rb +40 -0
- data/spec/bootstrap_raises_if_db_exists_spec.rb +37 -0
- data/spec/chapter_spec.rb +36 -0
- data/spec/delete_spec.rb +59 -0
- data/spec/list_spec.rb +25 -0
- data/spec/scribe_spec.rb +137 -0
- data/spec/show_spec.rb +247 -0
- data/spec/spec.rb +87 -0
- data/spec/spec_helper.rb +9 -0
- data/spec/strike_spec.rb +150 -0
- data/spec/tangent_locating_spec.rb +63 -0
- data/spec/tangent_spec.rb +211 -0
- metadata +146 -0
data/.gitignore
ADDED
data/README
ADDED
@@ -0,0 +1,115 @@
|
|
1
|
+
Oughtve
|
2
|
+
=========
|
3
|
+
|
4
|
+
- Shotgun: $105.95.
|
5
|
+
- Beat-up Olds: $2000.
|
6
|
+
- Chemistry 101: $36.
|
7
|
+
|
8
|
+
- Remembering "niktu": Priceless.
|
9
|
+
|
10
|
+
|
11
|
+
What?
|
12
|
+
-------
|
13
|
+
|
14
|
+
Oughtve is a very simple command-line- and directory-based
|
15
|
+
notation tool, always at your fingertips to avoid the few
|
16
|
+
seconds/minutes/aeons that invariably cause you to lose the
|
17
|
+
thought you had.
|
18
|
+
|
19
|
+
Yeah. It lets you make notes. *And* read them later.
|
20
|
+
|
21
|
+
|
22
|
+
Why?
|
23
|
+
------
|
24
|
+
|
25
|
+
Because you *will* forget.
|
26
|
+
|
27
|
+
|
28
|
+
Features
|
29
|
+
----------
|
30
|
+
|
31
|
+
* Notes are grouped based on the working directory they are
|
32
|
+
written from. You might, for example, define a group for
|
33
|
+
each of your coding projects' top directories: any notes
|
34
|
+
you write in or under those directories will be grouped
|
35
|
+
respectively.
|
36
|
+
|
37
|
+
* Notes can be "struck out" or closed so that they do not
|
38
|
+
appear in the default listings (e.g. to emulate simple todo
|
39
|
+
lists.)
|
40
|
+
|
41
|
+
* Sets of notes in a group can be enclosed as a "chapter", or
|
42
|
+
a completed section. For example, one might close a section
|
43
|
+
once all items for the 0.3.0 release have been completed.
|
44
|
+
This starts a new section and removes the old one from the
|
45
|
+
default views.
|
46
|
+
|
47
|
+
* The directory grouping always looks progressively higher in
|
48
|
+
the hierarchy until it finds a defined group, all the way up
|
49
|
+
to the default group bound at / if it comes across none on
|
50
|
+
the way.
|
51
|
+
|
52
|
+
* The normal directory lookup and various other things can be
|
53
|
+
overridden with option switches. Sometimes you want to write
|
54
|
+
a note in a specific group from somewhere else in the system:
|
55
|
+
just specify the group name.
|
56
|
+
|
57
|
+
* A group's notes can be exported to JSON or YAML (rudimentary.)
|
58
|
+
|
59
|
+
|
60
|
+
Examples
|
61
|
+
----------
|
62
|
+
|
63
|
+
An extremely curt introduction is found in doc/HOWTO.using.
|
64
|
+
|
65
|
+
I like to rename my script to "--", so that I can use the
|
66
|
+
following to enter a note:
|
67
|
+
|
68
|
+
$ -- Remember to actually write the HOWTO.
|
69
|
+
|
70
|
+
|
71
|
+
Requirements
|
72
|
+
--------------
|
73
|
+
|
74
|
+
* Ruby
|
75
|
+
** 1.8.7, 1.9.1, 1.9.2, jruby-1.4
|
76
|
+
|
77
|
+
* Gems
|
78
|
+
** dm-core >= 0.10.2
|
79
|
+
** data_objects >= 0.10.1
|
80
|
+
** do_sqlite3 >= 0.10.1
|
81
|
+
|
82
|
+
* Other
|
83
|
+
** [SQLite3](http://sqlite.org)
|
84
|
+
** UNIXy system.
|
85
|
+
|
86
|
+
* Development
|
87
|
+
** Gems
|
88
|
+
*** RSpec (>= 1.3.0)
|
89
|
+
|
90
|
+
|
91
|
+
Status
|
92
|
+
--------
|
93
|
+
|
94
|
+
Experimental rewrite of an age-old workhorse of mine. The
|
95
|
+
intent of this release is to figure out if anyone else
|
96
|
+
finds this useful.
|
97
|
+
|
98
|
+
Please break it. 'Some' robustness is needed.
|
99
|
+
|
100
|
+
|
101
|
+
Where?
|
102
|
+
--------
|
103
|
+
|
104
|
+
$ gem install oughtve
|
105
|
+
|
106
|
+
Source is found on [Github](http://github.com/rue/oughtve).
|
107
|
+
|
108
|
+
|
109
|
+
Who Do I Complain To?
|
110
|
+
-----------------------
|
111
|
+
|
112
|
+
* oughtve MEOW projects _purr_ kittensoft _rawr_ org.
|
113
|
+
* IRC channel #oughtve on Freenode ("rue", in case I
|
114
|
+
am not the only other person on the channel.)
|
115
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
begin
|
2
|
+
require "rubygems"
|
3
|
+
require "jeweler"
|
4
|
+
rescue LoadError
|
5
|
+
puts "Jeweler not available. Install it with: gem install jeweler"
|
6
|
+
end
|
7
|
+
|
8
|
+
|
9
|
+
Jeweler::Tasks.new do |gem|
|
10
|
+
gem.name = "oughtve"
|
11
|
+
|
12
|
+
gem.version = "#{`git log --pretty=oneline | wc -l`.chomp}.#{`git log -1 --pretty=oneline`[0...8]}"
|
13
|
+
|
14
|
+
|
15
|
+
gem.summary = "Command-line tool for notes associated by filesystem location."
|
16
|
+
gem.description = "Command-line tool for notes associated by filesystem location."
|
17
|
+
gem.email = "oughtve@projects.kittensoft.org"
|
18
|
+
gem.homepage = "http://github.com/rue/oughtve"
|
19
|
+
gem.authors = ["Eero Saynatkari"]
|
20
|
+
|
21
|
+
gem.add_runtime_dependency "dm-core", ">= 0.10.2"
|
22
|
+
gem.add_runtime_dependency "data_objects", ">= 0.10.1"
|
23
|
+
gem.add_runtime_dependency "do_sqlite3", ">= 0.10.1"
|
24
|
+
|
25
|
+
gem.add_development_dependency "rspec", ">= 1.3.0"
|
26
|
+
|
27
|
+
gem.post_install_message = <<-END
|
28
|
+
|
29
|
+
=======================================
|
30
|
+
|
31
|
+
Oughtve has been installed. Please run
|
32
|
+
|
33
|
+
$ oughtve --bootstrap
|
34
|
+
|
35
|
+
to set up your database if you have not
|
36
|
+
used Oughtve before.
|
37
|
+
|
38
|
+
=======================================
|
39
|
+
|
40
|
+
END
|
41
|
+
end
|
42
|
+
|
43
|
+
Jeweler::GemcutterTasks.new
|
44
|
+
|
data/bin/oughtve
ADDED
@@ -0,0 +1,62 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# LICENCE
|
4
|
+
# =========
|
5
|
+
#
|
6
|
+
# Authors
|
7
|
+
# ---------
|
8
|
+
#
|
9
|
+
# See doc/AUTHORS.
|
10
|
+
#
|
11
|
+
#
|
12
|
+
# Copyright
|
13
|
+
# -----------
|
14
|
+
#
|
15
|
+
# Copyright (c) 2006-2010 Eero Saynatkari, all rights reserved.
|
16
|
+
#
|
17
|
+
#
|
18
|
+
# Licence
|
19
|
+
# ---------
|
20
|
+
#
|
21
|
+
# Redistribution and use in source and binary forms, with or without
|
22
|
+
# modification, are permitted provided that the following conditions
|
23
|
+
# are met:
|
24
|
+
#
|
25
|
+
# - Redistributions of source code must retain the above copyright
|
26
|
+
# notice, this list of conditions, the following disclaimer and
|
27
|
+
# attribution to the original authors.
|
28
|
+
#
|
29
|
+
# - Redistributions in binary form must reproduce the above copyright
|
30
|
+
# notice, this list of conditions, the following disclaimer and
|
31
|
+
# attribution to the original authors in the documentation and/or
|
32
|
+
# other materials provided with the distribution.
|
33
|
+
#
|
34
|
+
# - The names of the authors may not be used to endorse or promote
|
35
|
+
# products derived from this software without specific prior
|
36
|
+
# written permission.
|
37
|
+
#
|
38
|
+
#
|
39
|
+
# Disclaimer
|
40
|
+
# ------------
|
41
|
+
#
|
42
|
+
# This software is provided "as is" and without any express or
|
43
|
+
# implied warranties, including, without limitation, the implied
|
44
|
+
# warranties of merchantability and fitness for a particular purpose.
|
45
|
+
# Authors are not responsible for any damages, direct or indirect.
|
46
|
+
#
|
47
|
+
|
48
|
+
# Yeah, so we are not really doing much.. there _could_ be a UI here.
|
49
|
+
require "oughtve"
|
50
|
+
|
51
|
+
begin
|
52
|
+
|
53
|
+
puts Oughtve.run(ARGV)
|
54
|
+
|
55
|
+
rescue Exception => e
|
56
|
+
$stderr.puts e.message
|
57
|
+
$stderr.puts e.backtrace.join("\n") if $VERBOSE
|
58
|
+
|
59
|
+
$stderr.puts "Did you run --bootstrap?" if e.message =~ /database/i
|
60
|
+
$stderr.puts "Try #{File.basename $0} --help"
|
61
|
+
end
|
62
|
+
|
data/doc/HOWTO.using
ADDED
@@ -0,0 +1,131 @@
|
|
1
|
+
Using Oughtve
|
2
|
+
===============
|
3
|
+
|
4
|
+
Installing
|
5
|
+
------------
|
6
|
+
|
7
|
+
From the root of the source:
|
8
|
+
|
9
|
+
$ sudo ruby setup.rb
|
10
|
+
|
11
|
+
This installs libraries in the normal site_ruby and the
|
12
|
+
script in the normal bindir. You can naturally change
|
13
|
+
the options, see here:
|
14
|
+
|
15
|
+
$ ruby setup.rb --help
|
16
|
+
|
17
|
+
|
18
|
+
Getting Started
|
19
|
+
-----------------
|
20
|
+
|
21
|
+
I personally like to create a symlink to "--" as the script
|
22
|
+
name, which makes jotting notes that much easier. By default,
|
23
|
+
the script is just called "oughtve".
|
24
|
+
|
25
|
+
First, create your database. Everything is stored in the same
|
26
|
+
place:
|
27
|
+
|
28
|
+
$ oughtve --bootstrap
|
29
|
+
|
30
|
+
This sets up the DB in ~/.oughtve and creates a default
|
31
|
+
group or "tangent" bound at /, so it catches everything.
|
32
|
+
|
33
|
+
|
34
|
+
Write a Note
|
35
|
+
--------------
|
36
|
+
|
37
|
+
You can try this anywhere in your filesystem, all notes will
|
38
|
+
end up in your default group:
|
39
|
+
|
40
|
+
$ oughtve My first note!
|
41
|
+
$ cd /tmp
|
42
|
+
$ oughtve Another one!
|
43
|
+
$ cd back/wherever
|
44
|
+
|
45
|
+
Go ahead, make some.
|
46
|
+
|
47
|
+
|
48
|
+
Viewing Notes
|
49
|
+
---------------
|
50
|
+
|
51
|
+
Did it actually take? Let us find out:
|
52
|
+
|
53
|
+
$ oughtve --show
|
54
|
+
|
55
|
+
This should give you the notes you have entered thus far,
|
56
|
+
all safely in the default group.
|
57
|
+
|
58
|
+
|
59
|
+
Another Group!
|
60
|
+
----------------
|
61
|
+
|
62
|
+
OK, time to make a group. For the purposes of this exercise,
|
63
|
+
we can do this in your home directory (you could use that
|
64
|
+
group as a personal to-do list, for example):
|
65
|
+
|
66
|
+
$ cd ~
|
67
|
+
$ oughtve --new --tangent Personal
|
68
|
+
|
69
|
+
And there you go. The --tangent option is used here to *give*
|
70
|
+
the name, and can later be used to refer to a name.
|
71
|
+
|
72
|
+
|
73
|
+
Which Group Goes Where?
|
74
|
+
-------------------------
|
75
|
+
|
76
|
+
To easily see which groups you have defined and where they
|
77
|
+
live:
|
78
|
+
|
79
|
+
$ oughtve --list
|
80
|
+
|
81
|
+
|
82
|
+
Try it Out
|
83
|
+
------------
|
84
|
+
|
85
|
+
With the new group defined, anything under your home directory
|
86
|
+
should be getting stored there rather than default:
|
87
|
+
|
88
|
+
$ cd ~
|
89
|
+
$ oughtve First personal note!
|
90
|
+
$ oughtve --show
|
91
|
+
|
92
|
+
You should only see the one new note. You can add some more
|
93
|
+
from subdirectories of ~, if you like. Then, hop above the
|
94
|
+
tree:
|
95
|
+
|
96
|
+
$ cd ~/..
|
97
|
+
$ oughtve --show
|
98
|
+
|
99
|
+
This should show you the old default notes. Adding one works
|
100
|
+
too:
|
101
|
+
|
102
|
+
$ oughtve Here we are in the default group again.
|
103
|
+
$ oughtve --show
|
104
|
+
|
105
|
+
|
106
|
+
Going Outside the Box
|
107
|
+
-----------------------
|
108
|
+
|
109
|
+
You can actually address any group explicitly from anywhere
|
110
|
+
in the system, even if it would normally be under some other
|
111
|
+
group:
|
112
|
+
|
113
|
+
$ cd ~
|
114
|
+
$ oughtve --show --tangent default
|
115
|
+
|
116
|
+
Default notes! You can give the --tangent switch to pretty
|
117
|
+
much any command to force a specific group, or "tangent",
|
118
|
+
to be used. Alternately, you could give the --directory
|
119
|
+
switch but it is mostly useful only when creating new ones.
|
120
|
+
|
121
|
+
|
122
|
+
Then What?
|
123
|
+
------------
|
124
|
+
|
125
|
+
You can ask oughtve to tell you what it can do to find more
|
126
|
+
functionality until such time that I (or you!) write some
|
127
|
+
more documentation:
|
128
|
+
|
129
|
+
$ oughtve --help
|
130
|
+
|
131
|
+
|
data/doc/LICENCE
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
LICENCE
|
2
|
+
=========
|
3
|
+
|
4
|
+
Authors
|
5
|
+
---------
|
6
|
+
|
7
|
+
See doc/AUTHORS.
|
8
|
+
|
9
|
+
|
10
|
+
Copyright
|
11
|
+
-----------
|
12
|
+
|
13
|
+
Copyright (c) 2006-2010 Eero Saynatkari, all rights reserved.
|
14
|
+
|
15
|
+
|
16
|
+
Licence
|
17
|
+
---------
|
18
|
+
|
19
|
+
Redistribution and use in source and binary forms, with or without
|
20
|
+
modification, are permitted provided that the following conditions
|
21
|
+
are met:
|
22
|
+
|
23
|
+
- Redistributions of source code must retain the above copyright
|
24
|
+
notice, this list of conditions, the following disclaimer and
|
25
|
+
attribution to the original authors.
|
26
|
+
|
27
|
+
- Redistributions in binary form must reproduce the above copyright
|
28
|
+
notice, this list of conditions, the following disclaimer and
|
29
|
+
attribution to the original authors in the documentation and/or
|
30
|
+
other materials provided with the distribution.
|
31
|
+
|
32
|
+
- The names of the authors may not be used to endorse or promote
|
33
|
+
products derived from this software without specific prior
|
34
|
+
written permission.
|
35
|
+
|
36
|
+
|
37
|
+
Disclaimer
|
38
|
+
------------
|
39
|
+
|
40
|
+
This software is provided "as is" and without any express or
|
41
|
+
implied warranties, including, without limitation, the implied
|
42
|
+
warranties of merchantability and fitness for a particular purpose.
|
43
|
+
Authors are not responsible for any damages, direct or indirect.
|
44
|
+
|
data/doc/README.markdown
ADDED
@@ -0,0 +1,115 @@
|
|
1
|
+
Oughtve
|
2
|
+
=========
|
3
|
+
|
4
|
+
- Shotgun: $105.95.
|
5
|
+
- Beat-up Olds: $2000.
|
6
|
+
- Chemistry 101: $36.
|
7
|
+
|
8
|
+
- Remembering "niktu": Priceless.
|
9
|
+
|
10
|
+
|
11
|
+
What?
|
12
|
+
-------
|
13
|
+
|
14
|
+
Oughtve is a very simple command-line- and directory-based
|
15
|
+
notation tool, always at your fingertips to avoid the few
|
16
|
+
seconds/minutes/aeons that invariably cause you to lose the
|
17
|
+
thought you had.
|
18
|
+
|
19
|
+
Yeah. It lets you make notes. *And* read them later.
|
20
|
+
|
21
|
+
|
22
|
+
Why?
|
23
|
+
------
|
24
|
+
|
25
|
+
Because you *will* forget.
|
26
|
+
|
27
|
+
|
28
|
+
Features
|
29
|
+
----------
|
30
|
+
|
31
|
+
* Notes are grouped based on the working directory they are
|
32
|
+
written from. You might, for example, define a group for
|
33
|
+
each of your coding projects' top directories: any notes
|
34
|
+
you write in or under those directories will be grouped
|
35
|
+
respectively.
|
36
|
+
|
37
|
+
* Notes can be "struck out" or closed so that they do not
|
38
|
+
appear in the default listings (e.g. to emulate simple todo
|
39
|
+
lists.)
|
40
|
+
|
41
|
+
* Sets of notes in a group can be enclosed as a "chapter", or
|
42
|
+
a completed section. For example, one might close a section
|
43
|
+
once all items for the 0.3.0 release have been completed.
|
44
|
+
This starts a new section and removes the old one from the
|
45
|
+
default views.
|
46
|
+
|
47
|
+
* The directory grouping always looks progressively higher in
|
48
|
+
the hierarchy until it finds a defined group, all the way up
|
49
|
+
to the default group bound at / if it comes across none on
|
50
|
+
the way.
|
51
|
+
|
52
|
+
* The normal directory lookup and various other things can be
|
53
|
+
overridden with option switches. Sometimes you want to write
|
54
|
+
a note in a specific group from somewhere else in the system:
|
55
|
+
just specify the group name.
|
56
|
+
|
57
|
+
* A group's notes can be exported to JSON or YAML (rudimentary.)
|
58
|
+
|
59
|
+
|
60
|
+
Examples
|
61
|
+
----------
|
62
|
+
|
63
|
+
An extremely curt introduction is found in doc/HOWTO.using.
|
64
|
+
|
65
|
+
I like to rename my script to "--", so that I can use the
|
66
|
+
following to enter a note:
|
67
|
+
|
68
|
+
$ -- Remember to actually write the HOWTO.
|
69
|
+
|
70
|
+
|
71
|
+
Requirements
|
72
|
+
--------------
|
73
|
+
|
74
|
+
* Ruby
|
75
|
+
** 1.8.7, 1.9.1, 1.9.2, jruby-1.4
|
76
|
+
|
77
|
+
* Gems
|
78
|
+
** dm-core >= 0.10.2
|
79
|
+
** data_objects >= 0.10.1
|
80
|
+
** do_sqlite3 >= 0.10.1
|
81
|
+
|
82
|
+
* Other
|
83
|
+
** [SQLite3](http://sqlite.org)
|
84
|
+
** UNIXy system.
|
85
|
+
|
86
|
+
* Development
|
87
|
+
** Gems
|
88
|
+
*** RSpec (>= 1.3.0)
|
89
|
+
|
90
|
+
|
91
|
+
Status
|
92
|
+
--------
|
93
|
+
|
94
|
+
Experimental rewrite of an age-old workhorse of mine. The
|
95
|
+
intent of this release is to figure out if anyone else
|
96
|
+
finds this useful.
|
97
|
+
|
98
|
+
Please break it. 'Some' robustness is needed.
|
99
|
+
|
100
|
+
|
101
|
+
Where?
|
102
|
+
--------
|
103
|
+
|
104
|
+
$ gem install oughtve
|
105
|
+
|
106
|
+
Source is found on [Github](http://github.com/rue/oughtve).
|
107
|
+
|
108
|
+
|
109
|
+
Who Do I Complain To?
|
110
|
+
-----------------------
|
111
|
+
|
112
|
+
* oughtve MEOW projects _purr_ kittensoft _rawr_ org.
|
113
|
+
* IRC channel #oughtve on Freenode ("rue", in case I
|
114
|
+
am not the only other person on the channel.)
|
115
|
+
|