Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
initial
- Loading branch information
0 parents
commit 87c826c
Showing
9 changed files
with
137 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
*.gem | ||
.bundle | ||
Gemfile.lock | ||
pkg/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
source "http://rubygems.org" | ||
|
||
# Specify your gem's dependencies in rcqrs_generators.gemspec | ||
gemspec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Copyright (c) 2011 Chris Stefano | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining | ||
a copy of this software and associated documentation files (the | ||
"Software"), to deal in the Software without restriction, including | ||
without limitation the rights to use, copy, modify, merge, publish, | ||
distribute, sublicense, and/or sell copies of the Software, and to | ||
permit persons to whom the Software is furnished to do so, subject to | ||
the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# RCQRS Generators | ||
|
||
Additional Rails 3 generators for the RCQRS plugin | ||
|
||
# Copyright | ||
|
||
Copyright (c) 2011 Chris Stefano. See [LICENSE](https://github.com/virtualstaticvoid/rcqrs_generators/blob/master/LICENSE) for details. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
require 'bundler' | ||
Bundler::GemHelper.install_tasks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
require 'rails/generators/base' | ||
|
||
module Rcqrs | ||
module Generators | ||
class InstallGenerator < Rails::Generators::Base | ||
|
||
def add_gem_dependencies | ||
gem "uuidtools" | ||
gem "yajl-ruby", :require => 'yajl' | ||
gem "eventful" | ||
gem "rcqrs", :git => "git://github.com/virtualstaticvoid/rcqrs.git", :branch => "master" | ||
gem "rcqrs-rails", :git => "git://github.com/virtualstaticvoid/rcqrs-rails.git", :branch => "master" | ||
end | ||
|
||
def create_event_storage_db_config_file | ||
# just copy the existing one :-P | ||
copy_file File.join(destination_root, "config/database.yml"), "config/event_storage.yml" | ||
end | ||
|
||
def create_rcqrs_publish_initializer | ||
@snippet = <<CODE | ||
# define "global" publish method | ||
def publish(command) | ||
Rcqrs::Gateway.publish(command) | ||
end | ||
CODE | ||
|
||
initializer 'rcqrs_publish.rb', @snippet | ||
end | ||
|
||
def create_rcqrs_directories | ||
empty_directory_with_gitkeep "app/commands" | ||
empty_directory_with_gitkeep "app/commands/handlers" | ||
empty_directory_with_gitkeep "app/domain" | ||
empty_directory_with_gitkeep "app/events" | ||
empty_directory_with_gitkeep "app/events/handlers" | ||
end | ||
|
||
def create_rcqrs_autoload_paths_initializer | ||
@snippet = <<CODE | ||
# include command, events, handlers and domain classes in the application auto load paths | ||
config = Application.config | ||
config.autoload_paths += %W( | ||
#\{config.root\}/app/commands | ||
#\{config.root\}/app/commands/handlers | ||
#\{config.root\}/app/domain | ||
#\{config.root\}/app/events | ||
#\{config.root\}/app/events/handlers | ||
) | ||
CODE | ||
|
||
initializer 'rcqrs_autoload_paths.rb', @snippet | ||
end | ||
|
||
private | ||
|
||
def empty_directory_with_gitkeep(destination, config = {}) | ||
empty_directory(destination, config) | ||
create_file("#{destination}/.gitkeep") unless options[:skip_git] | ||
end | ||
|
||
end | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module RcqrsGenerators | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module RcqrsGenerators | ||
VERSION = "0.0.1" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# -*- encoding: utf-8 -*- | ||
$:.push File.expand_path("../lib", __FILE__) | ||
require "rcqrs_generators/version" | ||
|
||
Gem::Specification.new do |s| | ||
s.name = "rcqrs_generators" | ||
s.version = RcqrsGenerators::VERSION | ||
s.platform = Gem::Platform::RUBY | ||
s.authors = ["Chris Stefano"] | ||
s.email = ["virtualstaticvoid@gmail.com"] | ||
s.homepage = "" | ||
s.summary = %q{Rails 3 generators supporting the RCQRS Rails 3 plugin} | ||
|
||
s.rubyforge_project = "rcqrs_generators" | ||
|
||
s.files = `git ls-files`.split("\n") | ||
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") | ||
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } | ||
|
||
s.require_paths = ["lib"] | ||
|
||
s.extra_rdoc_files = [ | ||
'LICENSE', | ||
'README.md' | ||
] | ||
|
||
end | ||
|