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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 761211469f9d3ff25f2fbc5f28401fbbaf5440c1
4
- data.tar.gz: d749c7dbfdff6598e6da2cb993c84c65ac7d112d
3
+ metadata.gz: e83ec10f8a9dba314302778c8f32e21cd3664631
4
+ data.tar.gz: 641c07b9cc5c9c73fa4c0f288b163e2c34528c35
5
5
  SHA512:
6
- metadata.gz: 3c345022db55ef23c7de1ea869af21e45c719362fba4371cf7676d539b2212d3164e01f549ba1cb8bfc5bed07c21bedf2e1314ecd846d7e4778868e95adf1f06
7
- data.tar.gz: 87eec4440b020845f53893e55b6f8b65504cbe56675a94b115226a3a9a927ddd1bd9217425aa82a28a1b665ca3436a1008c4d8e8f57a1c33d70c1dc1d12ffb98
6
+ metadata.gz: cbec1d6eb76858f9c9bdd45e8629fa6541b97e7d26cfeac1505eb81c8f0e58ca6b14bca3bd38f2179bd14d08d3105df73033259443d1592ebc3d0cf5dd6e0255
7
+ data.tar.gz: 63a90315a024548072c148f32246013d1acb914d60a8aa908a99c2b344c01575821894aeafcf4b8577b3be4cecfc69d3c18cfab46f6eeb9f53cec5e602748935
@@ -1,3 +1,8 @@
1
+ === 0.0.3 2013-04-29
2
+
3
+ * when --all
4
+ * set DB path ENV['NOWHEN_DB']
5
+
1
6
  === 0.0.2 2013-04-29
2
7
 
3
8
  * upgrade database : now --db_upgrade
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
  ------------
@@ -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
- p log
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
@@ -6,7 +6,7 @@ require "fileutils"
6
6
 
7
7
  module NoWhen
8
8
  module Model
9
- def self.init(db_path="#{ENV['HOME']}/.nowhen.sqlite")
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")
@@ -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], :limit => 40}.each do |k,v|
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
@@ -10,7 +10,7 @@ module NoWhen
10
10
  property :longitude, Float
11
11
 
12
12
  def self.find(query={})
13
- {:order => [:created_at.asc], :limit => 40}.each do |k,v|
13
+ {:order => [:created_at.asc]}.each do |k,v|
14
14
  query[k] = v unless query.include? k
15
15
  end
16
16
  self.all query
@@ -1,3 +1,3 @@
1
1
  module NoWhen
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
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.2
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-28 00:00:00.000000000 Z
11
+ date: 2013-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler