nowhen 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.txt +5 -0
- data/README.md +12 -0
- data/lib/nowhen/command.rb +4 -2
- data/lib/nowhen/model.rb +2 -2
- data/lib/nowhen/model/log.rb +1 -1
- data/lib/nowhen/model/tag.rb +1 -1
- data/lib/nowhen/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e83ec10f8a9dba314302778c8f32e21cd3664631
|
4
|
+
data.tar.gz: 641c07b9cc5c9c73fa4c0f288b163e2c34528c35
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cbec1d6eb76858f9c9bdd45e8629fa6541b97e7d26cfeac1505eb81c8f0e58ca6b14bca3bd38f2179bd14d08d3105df73033259443d1592ebc3d0cf5dd6e0255
|
7
|
+
data.tar.gz: 63a90315a024548072c148f32246013d1acb914d60a8aa908a99c2b344c01575821894aeafcf4b8577b3be4cecfc69d3c18cfab46f6eeb9f53cec5e602748935
|
data/History.txt
CHANGED
data/README.md
CHANGED
@@ -12,9 +12,17 @@ Installation
|
|
12
12
|
Usage
|
13
13
|
-----
|
14
14
|
|
15
|
+
% now --help
|
16
|
+
|
17
|
+
log
|
18
|
+
|
15
19
|
% now yummy
|
16
20
|
% now -log http://example.com/food
|
21
|
+
|
22
|
+
search
|
23
|
+
|
17
24
|
% when yummy
|
25
|
+
% when yummy --all
|
18
26
|
|
19
27
|
|
20
28
|
Test
|
@@ -25,6 +33,10 @@ Test
|
|
25
33
|
% bin/now todo
|
26
34
|
% bin/when todo
|
27
35
|
|
36
|
+
change DB path
|
37
|
+
|
38
|
+
% export NOWHEN_DB=./tmp/db
|
39
|
+
|
28
40
|
|
29
41
|
Contributing
|
30
42
|
------------
|
data/lib/nowhen/command.rb
CHANGED
@@ -10,6 +10,7 @@ module NoWhen
|
|
10
10
|
STDERR.puts
|
11
11
|
STDERR.puts "e.g."
|
12
12
|
STDERR.puts " % now yummy"
|
13
|
+
STDERR.puts " % now -log http://example.com/delicious_food_recipe"
|
13
14
|
STDERR.puts " % when yummy"
|
14
15
|
end
|
15
16
|
|
@@ -30,7 +31,7 @@ module NoWhen
|
|
30
31
|
log = parser.has_param?(:log) ? parser[:log] : parser.argv.join(' ')
|
31
32
|
log = NoWhen::Model::Log.new(:log => log)
|
32
33
|
log.save
|
33
|
-
|
34
|
+
puts log.log
|
34
35
|
elsif !parser.argv.empty?
|
35
36
|
what = parser.argv[0].strip
|
36
37
|
tag = NoWhen::Model::Tag.new(:what => what)
|
@@ -44,6 +45,7 @@ module NoWhen
|
|
44
45
|
def self.when(argv)
|
45
46
|
parser = ArgsParser.parse argv do
|
46
47
|
arg :limit, 'tags count', :default => 40
|
48
|
+
arg :all, 'disable tag count limit'
|
47
49
|
arg :version, 'show version', :alias => :v
|
48
50
|
arg :help, 'show help', :alias => :h
|
49
51
|
end
|
@@ -54,7 +56,7 @@ module NoWhen
|
|
54
56
|
else
|
55
57
|
query = {}
|
56
58
|
query[:what] = parser.argv[0].strip unless parser.argv.empty?
|
57
|
-
query[:limit] = parser[:limit]
|
59
|
+
query[:limit] = parser[:limit] unless parser.has_option? :all
|
58
60
|
tags = NoWhen::Model::Tag.find query
|
59
61
|
tags.each do |tag|
|
60
62
|
puts tag
|
data/lib/nowhen/model.rb
CHANGED
@@ -6,7 +6,7 @@ require "fileutils"
|
|
6
6
|
|
7
7
|
module NoWhen
|
8
8
|
module Model
|
9
|
-
def self.init(db_path
|
9
|
+
def self.init(db_path)
|
10
10
|
FileUtils.mkdir_p File.dirname(db_path) unless File.exists? File.dirname(db_path)
|
11
11
|
DataMapper.setup(:default, {:adapter => :sqlite, :database => db_path})
|
12
12
|
DataMapper::Logger.new($stdout, :debug)
|
@@ -26,4 +26,4 @@ module NoWhen
|
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
|
-
NoWhen::Model.init
|
29
|
+
NoWhen::Model.init(ENV['NOWHEN_DB'] || "#{ENV['HOME']}/.nowhen.sqlite")
|
data/lib/nowhen/model/log.rb
CHANGED
@@ -7,7 +7,7 @@ module NoWhen
|
|
7
7
|
property :log, String, :required => true, :length => 0...2048
|
8
8
|
|
9
9
|
def self.find(query={})
|
10
|
-
{:order => [:created_at.asc]
|
10
|
+
{:order => [:created_at.asc]}.each do |k,v|
|
11
11
|
query[k] = v unless query.include? k
|
12
12
|
end
|
13
13
|
self.all query
|
data/lib/nowhen/model/tag.rb
CHANGED
data/lib/nowhen/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nowhen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sho Hashimoto
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-04-
|
11
|
+
date: 2013-04-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|