trifle 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/trifle +13 -19
- data/lib/trifle/version.rb +1 -1
- metadata +9 -9
data/bin/trifle
CHANGED
@@ -2,36 +2,30 @@
|
|
2
2
|
require "redis"
|
3
3
|
require "trifle"
|
4
4
|
|
5
|
-
if ARGV.count <
|
6
|
-
puts "Syntax: `trifle
|
7
|
-
puts "e.g. `trifle
|
8
|
-
puts "Options include the usual Redis options (--scheme, --host, --port, etc)"
|
9
|
-
puts "and an extra option to override the `--key`"
|
5
|
+
if ARGV.count < 2
|
6
|
+
puts "Syntax: `trifle redis filenames --key=your_key"
|
7
|
+
puts "e.g. `trifle redis://127.0.0.1:6379/6 filename1 filename2 --key=my_key"
|
10
8
|
exit(1)
|
11
9
|
end
|
12
10
|
|
13
|
-
|
14
|
-
|
11
|
+
redis = Redis.new(url: ARGV[0])
|
12
|
+
ARGV.shift
|
13
|
+
|
15
14
|
filenames = []
|
15
|
+
options = {}
|
16
16
|
|
17
17
|
ARGV.each do |arg|
|
18
18
|
if arg.match(/^--/)
|
19
|
-
|
20
|
-
key =
|
21
|
-
|
22
|
-
value =
|
23
|
-
|
24
|
-
if key == "key"
|
25
|
-
trifle_options[key] = value
|
26
|
-
else
|
27
|
-
redis_config[key] = value
|
28
|
-
end
|
19
|
+
option = arg.split("=")
|
20
|
+
key = option[0].gsub("--")
|
21
|
+
option.shift
|
22
|
+
value = option.join("=")
|
23
|
+
options[key] = value
|
29
24
|
else
|
30
25
|
filenames << arg
|
31
26
|
end
|
32
27
|
end
|
33
28
|
|
34
|
-
redis = Redis.new redis_config
|
35
29
|
puts "Loading #{filenames.join(", ")}"
|
36
|
-
Trifle.new(redis,
|
30
|
+
Trifle.new(redis, options).load(filenames: filenames)
|
37
31
|
puts "Trifle loaded"
|
data/lib/trifle/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trifle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-06-21 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
|
-
requirement: &
|
16
|
+
requirement: &70309726715860 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70309726715860
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rujitsu
|
27
|
-
requirement: &
|
27
|
+
requirement: &70309726715260 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70309726715260
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: active_support
|
38
|
-
requirement: &
|
38
|
+
requirement: &70309726714540 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70309726714540
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: fakeredis
|
49
|
-
requirement: &
|
49
|
+
requirement: &70309726713980 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,7 +54,7 @@ dependencies:
|
|
54
54
|
version: 0.3.0
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70309726713980
|
58
58
|
description: Stores the GeoIP databases in Redis and gives it a simple way to lookup
|
59
59
|
IPs and map them to countries
|
60
60
|
email:
|