command_post 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +6 -0
- data/lib/command_post/command/command.rb +1 -4
- data/lib/command_post/config/app_config.rb +34 -0
- data/lib/command_post/event_sourcing/aggregate.rb +0 -4
- data/lib/command_post/event_sourcing/aggregate_event.rb +0 -1
- data/lib/command_post/identity/identity.rb +1 -0
- data/lib/command_post/identity/sequence_generator.rb +0 -2
- data/lib/command_post/persistence/auto_load.rb +0 -1
- data/lib/command_post/persistence/data_validation.rb +0 -2
- data/lib/command_post/persistence/persistence.rb +3 -10
- data/lib/command_post/persistence/schema_validation.rb +3 -1
- data/lib/command_post/util/hash_util.rb +0 -1
- data/lib/command_post/util/string_util.rb +1 -1
- data/lib/command_post/version.rb +3 -1
- data/lib/command_post.rb +8 -0
- data/spec/command_post/config/app_config_spec.rb +24 -0
- data/spec/command_post/identity/identity_lookup_value_aggregate_id_spec.rb +1 -2
- data/spec/command_post/identity/identity_lookup_value_checksum_spec.rb +1 -4
- data/spec/command_post/identity/identity_lookup_value_field_spec.rb +1 -2
- data/spec/command_post/persistence/data_validation_spec.rb +3 -1
- data/spec/command_post/persistence/indexing_spec.rb +1 -2
- data/spec/command_post/persistence/schema_validation_spec.rb +1 -3
- data/spec/command_post/persistence/scratch.rb +1 -1
- data/spec/spec_helper.rb +3 -0
- metadata +6 -5
- data/lib/command_post/command_post.rb +0 -5
- data/spec/command_post/require.rb +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 94022e90946d5610c0d667352783d73244e83da2
|
4
|
+
data.tar.gz: e30cb09fd2d836c8012b6d40e4394f0ccd03285e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2cb3dc6044d1fe45e73769d9bafc99ec7dc19422aa52f42fec8592c72587199639c950b7e21d7cf8ce170baadee85e566a6b18748d7fe0606040fc210cbf028a
|
7
|
+
data.tar.gz: 6ca34cdb22b8a11e8a65f80e1fd72bac80dc2ff952ff26f7e5fe6e489fb0345efb7ee46ea68d650cab9f159c3e26cd0c9481c24749516254693992ec0ed311d2
|
data/Gemfile.lock
CHANGED
@@ -25,6 +25,11 @@ GEM
|
|
25
25
|
coderay (~> 1.0.5)
|
26
26
|
method_source (~> 0.8)
|
27
27
|
slop (~> 3.4)
|
28
|
+
pry (0.9.12.2-x86-mingw32)
|
29
|
+
coderay (~> 1.0.5)
|
30
|
+
method_source (~> 0.8)
|
31
|
+
slop (~> 3.4)
|
32
|
+
win32console (~> 1.3)
|
28
33
|
pry-debugger (0.2.2)
|
29
34
|
debugger (~> 1.3)
|
30
35
|
pry (~> 0.9.10)
|
@@ -37,6 +42,7 @@ GEM
|
|
37
42
|
slop (3.4.6)
|
38
43
|
starting_blocks (0.0.31)
|
39
44
|
listen (>= 1.0)
|
45
|
+
win32console (1.3.2-x86-mingw32)
|
40
46
|
|
41
47
|
PLATFORMS
|
42
48
|
ruby
|
@@ -0,0 +1,34 @@
|
|
1
|
+
|
2
|
+
module AppConfig
|
3
|
+
# we don't want to instantiate this class - it's a singleton,
|
4
|
+
# so just keep it as a self-extended module
|
5
|
+
extend self
|
6
|
+
|
7
|
+
# Appdata provides a basic single-method DSL with .parameter method
|
8
|
+
# being used to define a set of available settings.
|
9
|
+
# This method takes one or more symbols, with each one being
|
10
|
+
# a name of the configuration option.
|
11
|
+
def parameter(*names)
|
12
|
+
names.each do |name|
|
13
|
+
attr_accessor name
|
14
|
+
|
15
|
+
# For each given symbol we generate accessor method that sets option's
|
16
|
+
# value being called with an argument, or returns option's current value
|
17
|
+
# when called without arguments
|
18
|
+
define_method name do |*values|
|
19
|
+
value = values.first
|
20
|
+
value ? self.send("#{name}=", value) : instance_variable_get("@#{name}")
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
# And we define a wrapper for the configuration block, that we'll use to set up
|
26
|
+
# our set of options
|
27
|
+
def config(&block)
|
28
|
+
instance_eval &block
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
|
33
|
+
|
34
|
+
|
@@ -1,14 +1,7 @@
|
|
1
|
+
require_relative './schema_validation'
|
2
|
+
require_relative './data_validation'
|
3
|
+
require_relative './auto_load'
|
1
4
|
|
2
|
-
require_relative '../event_sourcing/aggregate.rb'
|
3
|
-
require_relative '../event_sourcing/aggregate_event.rb'
|
4
|
-
require_relative '../persistence/persistence.rb'
|
5
|
-
require_relative './schema_validation.rb'
|
6
|
-
require_relative './data_validation.rb'
|
7
|
-
require_relative './auto_load.rb'
|
8
|
-
require_relative '../command/command.rb'
|
9
|
-
|
10
|
-
require 'pry'
|
11
|
-
require 'pry-debugger'
|
12
5
|
|
13
6
|
module CommandPost
|
14
7
|
|
data/lib/command_post/version.rb
CHANGED
data/lib/command_post.rb
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
2
|
+
|
3
|
+
|
4
|
+
describe AppConfig do
|
5
|
+
|
6
|
+
it 'should store a value in a property and then retrieve the same value.' do
|
7
|
+
|
8
|
+
AppConfig.config do
|
9
|
+
parameter :bounded_context_name
|
10
|
+
end
|
11
|
+
|
12
|
+
|
13
|
+
AppConfig.config do
|
14
|
+
bounded_context_name 'invoicing'
|
15
|
+
end
|
16
|
+
|
17
|
+
|
18
|
+
AppConfig.bounded_context_name.must_equal 'invoicing'
|
19
|
+
|
20
|
+
end
|
21
|
+
|
22
|
+
|
23
|
+
end
|
24
|
+
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: command_post
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joe Meirow
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-08-
|
11
|
+
date: 2013-08-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -65,8 +65,9 @@ files:
|
|
65
65
|
- README.md
|
66
66
|
- Rakefile
|
67
67
|
- command_post.gemspec
|
68
|
+
- lib/command_post.rb
|
68
69
|
- lib/command_post/command/command.rb
|
69
|
-
- lib/command_post/
|
70
|
+
- lib/command_post/config/app_config.rb
|
70
71
|
- lib/command_post/db/connection.rb
|
71
72
|
- lib/command_post/db/postgresql.sql
|
72
73
|
- lib/command_post/event_sourcing/aggregate.rb
|
@@ -82,6 +83,7 @@ files:
|
|
82
83
|
- lib/command_post/util/string_util.rb
|
83
84
|
- lib/command_post/version.rb
|
84
85
|
- spec/command_post/command/command_spec.rb
|
86
|
+
- spec/command_post/config/app_config_spec.rb
|
85
87
|
- spec/command_post/identity/identity_lookup_value_aggregate_id_spec.rb
|
86
88
|
- spec/command_post/identity/identity_lookup_value_checksum_spec.rb
|
87
89
|
- spec/command_post/identity/identity_lookup_value_field_spec.rb
|
@@ -91,7 +93,6 @@ files:
|
|
91
93
|
- spec/command_post/persistence/querying_spec.rb
|
92
94
|
- spec/command_post/persistence/schema_validation_spec.rb
|
93
95
|
- spec/command_post/persistence/scratch.rb
|
94
|
-
- spec/command_post/require.rb
|
95
96
|
- spec/spec_helper.rb
|
96
97
|
homepage: http://github.com/jmeirow/command_post
|
97
98
|
licenses:
|
@@ -119,6 +120,7 @@ specification_version: 4
|
|
119
120
|
summary: CommandPost - Object storage/retrieval, event sourcing, command pattern
|
120
121
|
test_files:
|
121
122
|
- spec/command_post/command/command_spec.rb
|
123
|
+
- spec/command_post/config/app_config_spec.rb
|
122
124
|
- spec/command_post/identity/identity_lookup_value_aggregate_id_spec.rb
|
123
125
|
- spec/command_post/identity/identity_lookup_value_checksum_spec.rb
|
124
126
|
- spec/command_post/identity/identity_lookup_value_field_spec.rb
|
@@ -128,5 +130,4 @@ test_files:
|
|
128
130
|
- spec/command_post/persistence/querying_spec.rb
|
129
131
|
- spec/command_post/persistence/schema_validation_spec.rb
|
130
132
|
- spec/command_post/persistence/scratch.rb
|
131
|
-
- spec/command_post/require.rb
|
132
133
|
- spec/spec_helper.rb
|
@@ -1,9 +0,0 @@
|
|
1
|
-
require 'date'
|
2
|
-
require 'minitest/autorun'
|
3
|
-
require 'minitest/spec'
|
4
|
-
require File.expand_path(File.dirname(__FILE__) + '/../../lib/command_post/persistence/persistence')
|
5
|
-
require File.expand_path(File.dirname(__FILE__) + '/../../lib/command_post/persistence/data_validation')
|
6
|
-
require File.expand_path(File.dirname(__FILE__) + '/../../lib/command_post/identity/identity')
|
7
|
-
require File.expand_path(File.dirname(__FILE__) + '/../../lib/command_post/event_sourcing/aggregate')
|
8
|
-
require File.expand_path(File.dirname(__FILE__) + '/../../lib/command_post/event_sourcing/aggregate_event')
|
9
|
-
require File.expand_path(File.dirname(__FILE__) + '/../../lib/command_post/identity/sequence_generator')
|