mushin 0.31.0 → 0.32.0
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/exe/generator.rb +29 -21
- data/lib/mushin/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 593e8d3ee443223ad5a9632c9a42a04d9f9aeff5
|
4
|
+
data.tar.gz: 22caec9d5f7cf20e0c33811ae4ae4c96eddb6617
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 563418f8f6b291394e820242fc7e267f91bf1f2808c604c27b48c8bec8e8abca242733cfa076e2b95404b8f5985f6a757ac30cf4c26f34ea9d934a4569713af3
|
7
|
+
data.tar.gz: df5ce4d3b9fdcfbc13d00228d749b7bdf1ec499761124759764b032faec0f814c954a24b2a3968fbfe434baf3a108479f3de7720267666a29267245ddadb4edb
|
data/exe/generator.rb
CHANGED
@@ -34,34 +34,32 @@ module Mushin
|
|
34
34
|
|
35
35
|
file = "#{name.to_s}/lib/#{name.to_s}.rb"
|
36
36
|
@require_gem = <<-FOO
|
37
|
-
require 'mushin'
|
38
|
-
require_relative '#{name}/version'
|
37
|
+
require 'mushin'
|
38
|
+
require_relative '#{name}/version'
|
39
39
|
FOO
|
40
40
|
gsub_file file, /^.*\b(version)\b.*$/ do |match|
|
41
41
|
match = @require_gem
|
42
42
|
end
|
43
43
|
|
44
44
|
@content = <<-FOO
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
45
|
+
class Ext < Mushin::Ext
|
46
|
+
def initialize app=nil, opts={}, params={}
|
47
|
+
@app = app
|
48
|
+
@opts = opts
|
49
|
+
@params = params
|
50
|
+
end
|
51
|
+
def call env
|
52
|
+
env ||= Hash.new
|
53
|
+
# write inbound code
|
54
|
+
if @opts[:cqrs] == :cqrs_query then
|
55
|
+
# write your code here if it is a cqrs query
|
56
|
+
else
|
57
|
+
# write your code here if it is a cqrs command
|
58
|
+
end
|
59
|
+
@app.call(env)
|
60
|
+
# write outbound code
|
61
|
+
end
|
59
62
|
end
|
60
|
-
|
61
|
-
@app.call(env)
|
62
|
-
# write outbound code
|
63
|
-
end
|
64
|
-
end
|
65
63
|
FOO
|
66
64
|
gsub_file file, '# Your code goes here...' do |match|
|
67
65
|
match = @content
|
@@ -77,6 +75,11 @@ end
|
|
77
75
|
match = @gemspec
|
78
76
|
end
|
79
77
|
|
78
|
+
gsub_file gemspec_file, /"#{name}"/ do |match|
|
79
|
+
match = "'#{name.sub(/::/, "_")}'"
|
80
|
+
end
|
81
|
+
|
82
|
+
|
80
83
|
gsub_file gemspec_file, /%q{TODO: Write a short summary, because Rubygems requires one.}/ do |match|
|
81
84
|
match = "%q{#{summary}}"
|
82
85
|
end
|
@@ -152,6 +155,11 @@ end
|
|
152
155
|
match = @gemspec
|
153
156
|
end
|
154
157
|
|
158
|
+
gsub_file gemspec_file, /"#{name}"/ do |match|
|
159
|
+
match = "'#{name.sub(/::/, "_")}'"
|
160
|
+
end
|
161
|
+
|
162
|
+
|
155
163
|
gsub_file gemspec_file, /%q{TODO: Write a short summary, because Rubygems requires one.}/ do |match|
|
156
164
|
match = "%q{#{summary}}"
|
157
165
|
end
|
data/lib/mushin/version.rb
CHANGED