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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 860fe4cf62e3c2f38fad7c3d5611c276a3ab67af
4
- data.tar.gz: d4f67830f1725e227697511b7f127b26aa57598c
3
+ metadata.gz: 94022e90946d5610c0d667352783d73244e83da2
4
+ data.tar.gz: e30cb09fd2d836c8012b6d40e4394f0ccd03285e
5
5
  SHA512:
6
- metadata.gz: d5174a62436e5ef7d4b8c735f04c77a3429e3425f375a4030412af550d162f9f798109be82b10f37fb49b2bbb045c4d01c5f6d4c4e3a04e116e5ea4d8ebbfca4
7
- data.tar.gz: fd0db270fce1df7f026a71fed32d96b2d2ca1d0f6ee711d3d5e014cf164fe36dd24b6d01399290f1915b971ec9d67207c277b724cc0cc0bbdb599db5c24fa253
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
@@ -1,7 +1,4 @@
1
- require 'pp'
2
- require File.expand_path(File.dirname(__FILE__) + '/../util/string_util')
3
- require File.expand_path(File.dirname(__FILE__) + '/../identity/identity')
4
- require File.expand_path(File.dirname(__FILE__) + '/../event_sourcing/aggregate_event')
1
+
5
2
 
6
3
 
7
4
 
@@ -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
+
@@ -3,10 +3,6 @@ require 'securerandom'
3
3
  require 'json'
4
4
  require 'sequel'
5
5
 
6
- require_relative '../db/connection'
7
- require_relative '../identity/sequence_generator'
8
- require_relative '../util/hash_util'
9
-
10
6
  module CommandPost
11
7
 
12
8
 
@@ -1,4 +1,3 @@
1
- require_relative './aggregate.rb'
2
1
 
3
2
 
4
3
  module CommandPost
@@ -1,4 +1,5 @@
1
1
 
2
+
2
3
  module CommandPost
3
4
 
4
5
 
@@ -2,8 +2,6 @@ require 'securerandom'
2
2
  require 'sequel'
3
3
 
4
4
 
5
- require_relative '../db/connection.rb'
6
-
7
5
 
8
6
  module CommandPost
9
7
 
@@ -1,4 +1,3 @@
1
- require_relative '../util/hash_util'
2
1
 
3
2
  module CommandPost
4
3
 
@@ -1,6 +1,4 @@
1
1
 
2
-
3
-
4
2
  module CommandPost
5
3
 
6
4
  module DataValidation
@@ -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
 
@@ -1,4 +1,5 @@
1
- require 'pp'
1
+
2
+ module CommandPost
2
3
 
3
4
  module SchemaValidation
4
5
 
@@ -135,3 +136,4 @@ require 'pp'
135
136
 
136
137
 
137
138
  end
139
+ end
@@ -1,4 +1,3 @@
1
-
2
1
 
3
2
 
4
3
  class HashUtil
@@ -1,4 +1,4 @@
1
-
1
+ #require File.expand_path(File.dirname(__FILE__) + '/../../command_post')
2
2
 
3
3
  module CommandPost
4
4
  class StringUtil
@@ -1,3 +1,5 @@
1
1
  module CommandPost
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
4
+
5
+ # $ gem build command_post-0.0.5.gem
@@ -0,0 +1,8 @@
1
+ Dir.glob(File.expand_path(File.dirname(__FILE__) + '/command_post/*/*.rb')).each {|file| require file }
2
+
3
+ module CommandPost
4
+
5
+ end
6
+
7
+
8
+
@@ -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
+
@@ -1,5 +1,4 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/../../command_post/require')
2
-
1
+ require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
3
2
 
4
3
  class Test003Person < CommandPost::Persistence
5
4
  include CommandPost::Identity
@@ -1,7 +1,4 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/../../command_post/require')
2
-
3
-
4
-
1
+ require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
5
2
 
6
3
 
7
4
  class Test002Person < CommandPost::Persistence
@@ -1,5 +1,4 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/../../command_post/require')
2
-
1
+ require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
3
2
 
4
3
 
5
4
 
@@ -1,4 +1,6 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/../../command_post/require')
1
+ require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
2
+
3
+
2
4
 
3
5
  class SomeClass < CommandPost::Persistence
4
6
  include CommandPost::Identity
@@ -1,7 +1,6 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/../../command_post/require')
2
-
3
1
  require 'faker'
4
2
  require 'securerandom'
3
+ require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
5
4
 
6
5
 
7
6
 
@@ -1,6 +1,4 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/../../command_post/require')
2
-
3
-
1
+ require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
4
2
 
5
3
  describe CommandPost::Persistence do
6
4
 
@@ -1,5 +1,5 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/../../command_post/require')
2
1
  require 'pp'
2
+ require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
3
3
 
4
4
 
5
5
 
data/spec/spec_helper.rb CHANGED
@@ -0,0 +1,3 @@
1
+ require 'minitest/spec'
2
+ require 'minitest/autorun'
3
+ require './lib/command_post.rb'
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
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-23 00:00:00.000000000 Z
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/command_post.rb
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,5 +0,0 @@
1
- require "command_post/version"
2
-
3
- module CommandPost
4
-
5
- end
@@ -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')