rcqrs_generators 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +4 -0
- data/Gemfile +4 -0
- data/LICENSE +20 -0
- data/README.md +22 -0
- data/Rakefile +2 -0
- data/lib/generators/rcqrs/install/install_generator.rb +65 -0
- data/lib/rcqrs_generators/version.rb +3 -0
- data/lib/rcqrs_generators.rb +3 -0
- data/rcqrs_generators.gemspec +30 -0
- metadata +58 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2011 Chris Stefano
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# RCQRS Generators
|
2
|
+
|
3
|
+
Additional Rails 3 generators for the RCQRS plugin
|
4
|
+
|
5
|
+
# Installation
|
6
|
+
|
7
|
+
Add the `rcqrs-generators` gem to the development group in your Gemfile, and run `bundle install`.
|
8
|
+
|
9
|
+
gem "rcqrs-generators", :group => :development
|
10
|
+
|
11
|
+
# Generators
|
12
|
+
|
13
|
+
## Install
|
14
|
+
|
15
|
+
Installs RCQRS into your Rails application
|
16
|
+
|
17
|
+
rails generate rcqrs:install
|
18
|
+
|
19
|
+
# Copyright
|
20
|
+
|
21
|
+
Copyright (c) 2011 Chris Stefano. See [LICENSE](https://github.com/virtualstaticvoid/rcqrs_generators/blob/master/LICENSE) for details.
|
22
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
require 'rails/generators/base'
|
2
|
+
|
3
|
+
module Rcqrs
|
4
|
+
module Generators
|
5
|
+
class InstallGenerator < Rails::Generators::Base
|
6
|
+
|
7
|
+
def add_gem_dependencies
|
8
|
+
gem "uuidtools"
|
9
|
+
gem "yajl-ruby", :require => 'yajl'
|
10
|
+
gem "eventful"
|
11
|
+
gem "rcqrs", :git => "git://github.com/virtualstaticvoid/rcqrs.git", :branch => "master"
|
12
|
+
gem "rcqrs-rails", :git => "git://github.com/virtualstaticvoid/rcqrs-rails.git", :branch => "master"
|
13
|
+
end
|
14
|
+
|
15
|
+
def create_event_storage_db_config_file
|
16
|
+
# just copy the existing one :-P
|
17
|
+
copy_file File.join(destination_root, "config/database.yml"), "config/event_storage.yml"
|
18
|
+
end
|
19
|
+
|
20
|
+
def create_rcqrs_publish_initializer
|
21
|
+
@snippet = <<CODE
|
22
|
+
# define "global" publish method
|
23
|
+
def publish(command)
|
24
|
+
Rcqrs::Gateway.publish(command)
|
25
|
+
end
|
26
|
+
CODE
|
27
|
+
|
28
|
+
initializer 'rcqrs_publish.rb', @snippet
|
29
|
+
end
|
30
|
+
|
31
|
+
def create_rcqrs_directories
|
32
|
+
empty_directory_with_gitkeep "app/commands"
|
33
|
+
empty_directory_with_gitkeep "app/commands/handlers"
|
34
|
+
empty_directory_with_gitkeep "app/domain"
|
35
|
+
empty_directory_with_gitkeep "app/events"
|
36
|
+
empty_directory_with_gitkeep "app/events/handlers"
|
37
|
+
end
|
38
|
+
|
39
|
+
def create_rcqrs_autoload_paths_initializer
|
40
|
+
@snippet = <<CODE
|
41
|
+
# include command, events, handlers and domain classes in the application auto load paths
|
42
|
+
config = Application.config
|
43
|
+
config.autoload_paths += %W(
|
44
|
+
#\{config.root\}/app/commands
|
45
|
+
#\{config.root\}/app/commands/handlers
|
46
|
+
#\{config.root\}/app/domain
|
47
|
+
#\{config.root\}/app/events
|
48
|
+
#\{config.root\}/app/events/handlers
|
49
|
+
)
|
50
|
+
CODE
|
51
|
+
|
52
|
+
initializer 'rcqrs_autoload_paths.rb', @snippet
|
53
|
+
end
|
54
|
+
|
55
|
+
private
|
56
|
+
|
57
|
+
def empty_directory_with_gitkeep(destination, config = {})
|
58
|
+
empty_directory(destination, config)
|
59
|
+
create_file("#{destination}/.gitkeep") unless options[:skip_git]
|
60
|
+
end
|
61
|
+
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "rcqrs_generators/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "rcqrs_generators"
|
7
|
+
s.version = RcqrsGenerators::VERSION
|
8
|
+
s.platform = Gem::Platform::RUBY
|
9
|
+
s.authors = ["Chris Stefano"]
|
10
|
+
s.email = ["virtualstaticvoid@gmail.com"]
|
11
|
+
s.homepage = ""
|
12
|
+
s.summary = %q{Rails 3 generators supporting the RCQRS Rails 3 plugin}
|
13
|
+
s.description = "See README for more information."
|
14
|
+
s.homepage = "https://github.com/virtualstaticvoid/rcqrs-generators"
|
15
|
+
|
16
|
+
s.rubyforge_project = "rcqrs_generators"
|
17
|
+
|
18
|
+
s.files = `git ls-files`.split("\n")
|
19
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
20
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
21
|
+
|
22
|
+
s.require_paths = ["lib"]
|
23
|
+
|
24
|
+
s.extra_rdoc_files = [
|
25
|
+
'LICENSE',
|
26
|
+
'README.md'
|
27
|
+
]
|
28
|
+
|
29
|
+
end
|
30
|
+
|
metadata
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rcqrs_generators
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Chris Stefano
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2011-05-06 00:00:00.000000000 +02:00
|
13
|
+
default_executable:
|
14
|
+
dependencies: []
|
15
|
+
description: See README for more information.
|
16
|
+
email:
|
17
|
+
- virtualstaticvoid@gmail.com
|
18
|
+
executables: []
|
19
|
+
extensions: []
|
20
|
+
extra_rdoc_files:
|
21
|
+
- LICENSE
|
22
|
+
- README.md
|
23
|
+
files:
|
24
|
+
- .gitignore
|
25
|
+
- Gemfile
|
26
|
+
- LICENSE
|
27
|
+
- README.md
|
28
|
+
- Rakefile
|
29
|
+
- lib/generators/rcqrs/install/install_generator.rb
|
30
|
+
- lib/rcqrs_generators.rb
|
31
|
+
- lib/rcqrs_generators/version.rb
|
32
|
+
- rcqrs_generators.gemspec
|
33
|
+
has_rdoc: true
|
34
|
+
homepage: https://github.com/virtualstaticvoid/rcqrs-generators
|
35
|
+
licenses: []
|
36
|
+
post_install_message:
|
37
|
+
rdoc_options: []
|
38
|
+
require_paths:
|
39
|
+
- lib
|
40
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
47
|
+
none: false
|
48
|
+
requirements:
|
49
|
+
- - ! '>='
|
50
|
+
- !ruby/object:Gem::Version
|
51
|
+
version: '0'
|
52
|
+
requirements: []
|
53
|
+
rubyforge_project: rcqrs_generators
|
54
|
+
rubygems_version: 1.6.2
|
55
|
+
signing_key:
|
56
|
+
specification_version: 3
|
57
|
+
summary: Rails 3 generators supporting the RCQRS Rails 3 plugin
|
58
|
+
test_files: []
|