mushin 0.43.0 → 0.44.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 -12
- 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: 8fd1297217799f74fa73b653add4ba0ceb2185fd
|
4
|
+
data.tar.gz: 0525d0fd8d498ea5c8ca3b9d8e07aa12220e0e2d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c5f27c244d10ae8ad1d81b2bf6fa962534d769e371f89475423e0a6039d3d3cef120876e5fcac50ae911bcc0787648193fb4ff3216a6b6fababd5fb5e297c52
|
7
|
+
data.tar.gz: e83416c237c630c2fb7d3d40cbc2ef05abbd6ea9f536aff662b97e22a33d96b50afb553c5f0438fdf75d61f83c1e0b82a31af1a11ed10cbb31fcfaabc1dad7a6
|
data/exe/generator.rb
CHANGED
@@ -32,7 +32,7 @@ module Mushin
|
|
32
32
|
|
33
33
|
system("bundle gem #{name}")
|
34
34
|
|
35
|
-
file = "#{name.to_s}/lib/#{name
|
35
|
+
file = "#{name.to_s}/lib/#{name}.rb"
|
36
36
|
@require_gem = <<-FOO
|
37
37
|
require 'mushin'
|
38
38
|
require_relative '#{name}/version'
|
@@ -72,6 +72,7 @@ module Mushin
|
|
72
72
|
spec.add_dependency 'mushin'
|
73
73
|
end
|
74
74
|
FOO
|
75
|
+
puts "adding `mushin` gem as a dependency"
|
75
76
|
gemspec_file = "#{name.to_s}/#{name.to_s}.gemspec"
|
76
77
|
gsub_file gemspec_file, /\s(\w+)\Z/ do |match|
|
77
78
|
match = @gemspec
|
@@ -79,27 +80,33 @@ end
|
|
79
80
|
|
80
81
|
puts "amending gemspec with gem name #{"mushin_ext_" + name.downcase}"
|
81
82
|
gsub_file gemspec_file, /"#{name}"/ do |match|
|
82
|
-
#match = "'#{name.downcase}'"
|
83
83
|
match = "'#{"mushin_ext_" + name.downcase}'"
|
84
84
|
end
|
85
85
|
|
86
|
-
|
86
|
+
puts "amending gemspec with gem summary"
|
87
87
|
gsub_file gemspec_file, /%q{TODO: Write a short summary, because Rubygems requires one.}/ do |match|
|
88
88
|
match = "%q{#{summary}}"
|
89
89
|
end
|
90
90
|
|
91
|
+
puts "amending gemspec with description"
|
91
92
|
gsub_file gemspec_file, /%q{TODO: Write a longer description or delete this line.}/ do |match|
|
92
93
|
match = "%q{#{description}}"
|
93
94
|
end
|
94
95
|
|
96
|
+
puts "amending gemspec with homepage"
|
95
97
|
gsub_file gemspec_file, /"TODO: Put your gem's website or public repo URL here."/ do |match|
|
96
98
|
match = "'#{homepage}'"
|
97
99
|
end
|
98
100
|
|
101
|
+
puts "amending gemspec with license"
|
99
102
|
gsub_file gemspec_file, /"MIT"/ do |match|
|
100
103
|
match = "'#{license}'"
|
101
104
|
end
|
102
105
|
|
106
|
+
#NOTE renaming lib/name.rb file to be able to require the gem with the same name
|
107
|
+
puts "renaming lib/#{name}.rb to lib/mushin_ext_#{name.downcase}.rb "
|
108
|
+
system("mv ./#{name}/lib/#{name}.rb ./#{name}/lib/mushin_ext_#{name.downcase}.rb")
|
109
|
+
|
103
110
|
readme_file = "#{name.to_s}/README.md"
|
104
111
|
gsub_file readme_file, /#{name}/ do |match|
|
105
112
|
match = "#{"mushin_ext_" + name.downcase}"
|
@@ -119,26 +126,25 @@ end
|
|
119
126
|
|
120
127
|
system("bundle gem #{name}")
|
121
128
|
|
122
|
-
#remove_file "./#{name}/lib/#{name}.rb"
|
123
|
-
#create_file "./#{name}/lib/#{name}.rb"
|
124
129
|
|
125
130
|
file = "#{name.to_s}/lib/#{name.gsub("-", "/")}.rb"
|
126
131
|
|
127
132
|
@require_gem = <<-FOO
|
128
133
|
require 'mushin'
|
129
|
-
require_relative '#{name
|
134
|
+
require_relative '#{name}/version'
|
130
135
|
FOO
|
136
|
+
puts "requiring `mushin`"
|
131
137
|
gsub_file file, /^.*\b(version)\b.*$/ do |match|
|
132
138
|
match = @require_gem
|
133
139
|
end
|
134
140
|
|
135
|
-
@
|
141
|
+
@snippet = <<-FOO
|
136
142
|
# Usage:
|
137
|
-
# #{name
|
138
|
-
# # use your #{name
|
143
|
+
# #{name}::Domain.new do
|
144
|
+
# # use your #{name} DSL here
|
139
145
|
# end
|
140
146
|
class Domain
|
141
|
-
# Define your #{name
|
147
|
+
# Define your #{name} DSL here
|
142
148
|
using Mushin::Domain
|
143
149
|
context :change_me do
|
144
150
|
construct :change_me do
|
@@ -150,8 +156,9 @@ class Domain
|
|
150
156
|
end
|
151
157
|
FOO
|
152
158
|
|
159
|
+
puts "adding a DSF code snippet"
|
153
160
|
gsub_file file, '# Your code goes here...' do |match|
|
154
|
-
match = @
|
161
|
+
match = @snippet
|
155
162
|
end
|
156
163
|
|
157
164
|
@gemspec = <<-FOO
|
@@ -159,6 +166,7 @@ end
|
|
159
166
|
spec.add_dependency 'mushin'
|
160
167
|
end
|
161
168
|
FOO
|
169
|
+
puts "adding `mushin` gem as a dependency"
|
162
170
|
gemspec_file = "#{name.to_s}/#{name.to_s}.gemspec"
|
163
171
|
gsub_file gemspec_file, /\s(\w+)\Z/ do |match|
|
164
172
|
match = @gemspec
|
@@ -196,7 +204,16 @@ end
|
|
196
204
|
match = "#{"mushin_dsf_" + name.downcase}"
|
197
205
|
end
|
198
206
|
|
199
|
-
|
207
|
+
#remove_file "./#{name}/lib/#{name}.rb"
|
208
|
+
#create_file "./#{name}/lib/#{name}.rb"
|
209
|
+
|
210
|
+
#NOTE renaming lib/name.rb file to be able to require the gem with the same name
|
211
|
+
puts "renaming lib/#{name}.rb to lib/mushin_ext_#{name.downcase}.rb "
|
212
|
+
system("mv ./#{name}/lib/#{name}.rb ./#{name}/lib/mushin_ext_#{name.downcase}.rb")
|
213
|
+
|
214
|
+
#NOTE creates an empty /ext dir in the generated DSF for experimental extensions before extracting them into gems
|
215
|
+
puts "creating an empty /ext dir for experimental extenstions"
|
216
|
+
empty_directory "./#{name}/lib/#{name}/ext"
|
200
217
|
end
|
201
218
|
end
|
202
219
|
end
|
data/lib/mushin/version.rb
CHANGED