columbus3 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.textile +14 -9
- data/exe/columbus3 +32 -4
- data/lib/columbus3/metadata/sidecar.rb +1 -1
- data/lib/columbus3/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: 8c00cb92f8e4ce111bc55fde1ba803980007527d
|
4
|
+
data.tar.gz: 095e7942545cb34f47ffa77b887478109f6bae04
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b1db031f90efc89a6de3ebb78eb94b536778c7577b5b8a7d8adc3abbf52bfbeb2d11305b96ab5c293b76fa0af217f70d7610ef49eaf8b000c53538958e95f81
|
7
|
+
data.tar.gz: f4447afbad97edb832345b01d2da52192967f2adeb72a2024fcf6e4438768b610c105cea0aa3d7a84c224571fd61f93f894db3e308a316c8f48d1029b7b07b78
|
data/README.textile
CHANGED
@@ -33,22 +33,27 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERN
|
|
33
33
|
|
34
34
|
h2. Version History
|
35
35
|
|
36
|
+
*0.4.0*
|
37
|
+
* Improved syntax for search:
|
38
|
+
** new option -r searches in sub-directories
|
39
|
+
** new option --fields allows to specify the fields to look for
|
40
|
+
|
36
41
|
*0.3.0*
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
42
|
+
* Added documentation for @search@ command; added this README file
|
43
|
+
* New command @graph@ plots data about a track (look for @_graph.html@ in the current directory)
|
44
|
+
* Added @--force@ option to @process@
|
45
|
+
* Internals: fixes to the @sidecar@ class
|
41
46
|
|
42
47
|
*0.2.1*
|
43
|
-
|
48
|
+
* Fixed bug in time parsing
|
44
49
|
|
45
50
|
*0.2.0*
|
46
|
-
|
47
|
-
|
48
|
-
|
51
|
+
* Fixes to syntax
|
52
|
+
* Print man page if not arguments are provided
|
53
|
+
* Added --filename option to *show* command
|
49
54
|
|
50
55
|
*0.1.0*
|
51
|
-
|
56
|
+
* Initial release
|
52
57
|
|
53
58
|
h2. License
|
54
59
|
|
data/exe/columbus3
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
require "slop"
|
4
4
|
require "columbus3"
|
5
|
+
require "find"
|
5
6
|
|
6
7
|
appname = "columbus3"
|
7
8
|
version = Columbus3::VERSION
|
@@ -58,10 +59,23 @@ Examples of simple searches
|
|
58
59
|
'max_speed > 120' any track with a max speed greater than 120 km/h
|
59
60
|
'min_height == 10' any track with a min height lower than 10 meters
|
60
61
|
|
61
|
-
|
62
|
+
Examples of complex searches
|
62
63
|
'location ~ "USA" and start_date >= 2015-01-01' tracks in the USA after or on Jan 1, 2015
|
63
64
|
'start_location ~ "Trenton" and end_location ~ "New York"' trips from Trenton to New York
|
64
65
|
|
66
|
+
List of supported fields in output
|
67
|
+
path -> relative path of the CSV file
|
68
|
+
filename -> basename of the CSV file
|
69
|
+
start_location -> start location
|
70
|
+
end_location -> end location
|
71
|
+
start_date -> start date (and time)
|
72
|
+
end_date -> end date (and time)
|
73
|
+
duration -> duration in seconds
|
74
|
+
min_speed -> minimum speed in km/h
|
75
|
+
max_speed -> maximum speed in km/h
|
76
|
+
min_height -> minimum height in meters
|
77
|
+
max_height -> maximum height in meters
|
78
|
+
|
65
79
|
VERSION
|
66
80
|
This is version #{version}
|
67
81
|
|
@@ -129,19 +143,33 @@ opts = Slop.parse :help => true do
|
|
129
143
|
|
130
144
|
##############################################################################
|
131
145
|
command :search do
|
132
|
-
banner "#{appname} search [--help] [--dir directory] query"
|
146
|
+
banner "#{appname} search [--help] [-r] [--dir directory] [--fields fields] query"
|
133
147
|
description "Search dir for tracks matching query"
|
134
148
|
|
135
149
|
on "--debug", "Show how the query is processed"
|
150
|
+
on "-r", "--recurse", "Recurse in subdirectories"
|
136
151
|
on "-d", "--dir=", "Directory with sidecar files"
|
152
|
+
on "-fields=", "Comma separated list of fields to show"
|
137
153
|
|
138
154
|
run do |opts, args|
|
139
155
|
cmd ="search"
|
140
156
|
|
141
157
|
debug = opts.to_hash[:debug]
|
142
158
|
directory = opts.to_hash[:dir] || "."
|
159
|
+
recurse = opts.to_hash[:recurse]
|
160
|
+
fields_opt = opts.to_hash[:fields]
|
161
|
+
|
162
|
+
if fields? then
|
163
|
+
fields = fields_opt.split(",").map { |x| x.to_sym }
|
164
|
+
else
|
165
|
+
fields = [:path, :filename, :start_location, :end_location, :start_date, :end_date, :duration, :min_speed, :max_speed, :min_height, :max_height]
|
166
|
+
end
|
143
167
|
|
144
|
-
|
168
|
+
if recurse then
|
169
|
+
files = Find.find(directory).select { |e| File.extname(e) == ".yaml" }
|
170
|
+
else
|
171
|
+
files = Dir.glob(File.join(directory, "*.yaml"))
|
172
|
+
end
|
145
173
|
query = QueryParser.new.parse(args.join(" "))
|
146
174
|
|
147
175
|
if debug then
|
@@ -153,7 +181,7 @@ opts = Slop.parse :help => true do
|
|
153
181
|
sidecar_search.load files
|
154
182
|
match = sidecar_search.search query
|
155
183
|
match.each do |m|
|
156
|
-
string =
|
184
|
+
string = fields.map { |x| "#{m[x]}"}.join("\t")
|
157
185
|
puts string
|
158
186
|
end
|
159
187
|
end
|
data/lib/columbus3/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: columbus3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adolfo Villafiorita
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08-
|
11
|
+
date: 2015-08-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|