fake_dynamo 0.0.9 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -1
- data/bin/fake_dynamo +9 -3
- data/lib/fake_dynamo/storage.rb +3 -1
- data/lib/fake_dynamo/version.rb +1 -1
- data/spec/spec_helper.rb +2 -4
- metadata +8 -8
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# FakeDynamo ![Build Status](https://secure.travis-ci.org/ananthakumaran/fake_dynamo.png)
|
1
|
+
# FakeDynamo [![Build Status](https://secure.travis-ci.org/ananthakumaran/fake_dynamo.png)](http://travis-ci.org/ananthakumaran/fake_dynamo)
|
2
2
|
|
3
3
|
local hosted, inmemory dynamodb emulator.
|
4
4
|
|
data/bin/fake_dynamo
CHANGED
@@ -4,19 +4,25 @@ $:.unshift(File.dirname(__FILE__) + '/../lib')
|
|
4
4
|
require 'fake_dynamo'
|
5
5
|
require 'optparse'
|
6
6
|
|
7
|
-
options = {:port => 4567, :compact => false }
|
7
|
+
options = { :port => 4567, :compact => false, :db => '/usr/local/var/fake_dynamo/db.fdb' }
|
8
8
|
OptionParser.new do |opts|
|
9
9
|
opts.banner = "Usage: fake_dynamo [options]"
|
10
10
|
|
11
|
-
opts.on("-p", "--port PORT") do |v|
|
11
|
+
opts.on("-p", "--port PORT", "Default: #{options[:port]}") do |v|
|
12
12
|
options[:port] = v
|
13
13
|
end
|
14
14
|
|
15
|
-
opts.on("-
|
15
|
+
opts.on("-d", "--db PATH", "Default: #{options[:db]}") do |v|
|
16
|
+
options[:db] = v
|
17
|
+
end
|
18
|
+
|
19
|
+
opts.on("-c", "--compact", "Default: #{options[:compact]}") do |v|
|
16
20
|
options[:compact] = v
|
17
21
|
end
|
18
22
|
end.parse!
|
19
23
|
|
24
|
+
FakeDynamo::Storage.db_path = options[:db]
|
25
|
+
|
20
26
|
if options[:compact]
|
21
27
|
FakeDynamo::Storage.instance.load_aof
|
22
28
|
FakeDynamo::Storage.instance.compact!
|
data/lib/fake_dynamo/storage.rb
CHANGED
@@ -7,6 +7,8 @@ module FakeDynamo
|
|
7
7
|
attr_accessor :compacted, :loaded
|
8
8
|
|
9
9
|
class << self
|
10
|
+
attr_accessor :db_path
|
11
|
+
|
10
12
|
def instance
|
11
13
|
@storage ||= Storage.new
|
12
14
|
end
|
@@ -25,7 +27,7 @@ module FakeDynamo
|
|
25
27
|
end
|
26
28
|
|
27
29
|
def db_path
|
28
|
-
|
30
|
+
self.class.db_path
|
29
31
|
end
|
30
32
|
|
31
33
|
def init_db
|
data/lib/fake_dynamo/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fake_dynamo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-08-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sinatra
|
16
|
-
requirement: &
|
16
|
+
requirement: &70171554944060 !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: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70171554944060
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: activesupport
|
27
|
-
requirement: &
|
27
|
+
requirement: &70171554943600 !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: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70171554943600
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: json
|
38
|
-
requirement: &
|
38
|
+
requirement: &70171554943180 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70171554943180
|
47
47
|
description:
|
48
48
|
email:
|
49
49
|
- ananthakumaran@gmail.com
|