hexx-domains 0.0.1

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.
@@ -0,0 +1,16 @@
1
+ # encoding: utf-8
2
+ <% tabs = 0 %>
3
+ <% project.namespaces.each do |item| -%>
4
+
5
+ <%= " " * tabs %>module <%= item %>
6
+ <% tabs += 1 -%>
7
+ <% end -%>
8
+
9
+ <%= " " * tabs %># Namespace for the code of the '<%= project.file %>' gem
10
+ <%= " " * tabs %>module <%= project.const %>
11
+
12
+ <%= " " * tabs %>end # module <%= project.const %>
13
+ <% project.namespaces.reverse.each do |item| -%>
14
+ <% tabs -= 1 %>
15
+ <%= " " * tabs %>end # module <%= item %>
16
+ <% end -%>
@@ -0,0 +1,21 @@
1
+ The MIT License
2
+
3
+ Copyright (c) <%= year %> <%= author %> (<%= user %>), <%= email %>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,64 @@
1
+ # Hexx
2
+
3
+ [![Gem Version](https://img.shields.io/gem/v/<%= project.file %>.svg?style=flat)][gem]
4
+ [![Build Status](https://img.shields.io/travis/<%= user %>/<%= project.file %>/master.svg?style=flat)][travis]
5
+ [![Dependency Status](https://img.shields.io/gemnasium/<%= user %>/<%= project.file %>.svg?style=flat)][gemnasium]
6
+ [![Code Climate](https://img.shields.io/codeclimate/github/<%= user %>/<%= project.file %>.svg?style=flat)][codeclimate]
7
+ [![Coverage](https://img.shields.io/coveralls/<%= user %>/<%= project.file %>.svg?style=flat)][coveralls]
8
+ [![Inline docs](http://inch-ci.org/github/<%= user %>/<%= project.file %>.svg)][inch]
9
+
10
+ [codeclimate]: https://codeclimate.com/github/<%= user %>/<%= project.file %>
11
+ [coveralls]: https://coveralls.io/r/<%= user %>/<%= project.file %>
12
+ [gem]: https://rubygems.org/gems/<%= project.file %>
13
+ [gemnasium]: https://gemnasium.com/<%= user %>/<%= project.file %>
14
+ [travis]: https://travis-ci.org/<%= user %>/<%= project.file %>
15
+ [inch]: https://inch-ci.org/github/<%= user %>/<%= project.file %>
16
+
17
+ @todo Describe the module
18
+
19
+ ## Usage
20
+
21
+ @todo Describe the base usage of the module
22
+
23
+ ## Installation
24
+
25
+ Add this line to your application's Gemfile:
26
+
27
+ ```ruby
28
+ # Gemfile
29
+ gem "<%= project.file %>"
30
+ ```
31
+
32
+ Then execute:
33
+
34
+ ```
35
+ bundle
36
+ ```
37
+
38
+ Or add it manually:
39
+
40
+ ```
41
+ gem install <%= project.file %>
42
+ ```
43
+
44
+ ## Compatibility
45
+
46
+ Tested under rubies compatible to MRI <%= ruby %>+.
47
+
48
+ Uses [RSpec] 3.0+ for testing and [<%= project.file %>-suit] for dev/test tools collection.
49
+
50
+ ## Contributing
51
+
52
+ * Fork the project.
53
+ * Read the [STYLEGUIDE](config/metrics/STYLEGUIDE).
54
+ * Make your feature addition or bug fix.
55
+ * Add tests for it. This is important so I don't break it in a
56
+ future version unintentionally.
57
+ * Commit, do not mess with Rakefile or version
58
+ (if you want to have your own version, that is fine but bump version
59
+ in a commit by itself I can ignore when I pull)
60
+ * Send me a pull request. Bonus points for topic branches.
61
+
62
+ ## License
63
+
64
+ See the [MIT LICENSE](LICENSE).
@@ -0,0 +1,2 @@
1
+ ---
2
+ service_name: travis-ci
@@ -0,0 +1,9 @@
1
+ *.gem
2
+ *.lock
3
+ .bundle/
4
+ .yardoc/
5
+ coverage/
6
+ doc/
7
+ log/
8
+ pkg/
9
+ tmp/
@@ -0,0 +1,8 @@
1
+ ---
2
+ language: ruby
3
+ bundler_args: --without metrics
4
+ script: rake test:coverage:run
5
+ rvm:
6
+ <% rubies.each do |item| -%>
7
+ - <%= item %>
8
+ <% end -%>
@@ -0,0 +1,19 @@
1
+ # encoding: utf-8
2
+ <% tabs = 0 -%>
3
+ <% project.namespaces.each do |item| -%>
4
+
5
+ <%= " " * tabs %>module <%= item %>
6
+ <% tabs += 1 -%>
7
+ <% end -%>
8
+
9
+ <%= " " * tabs %>module <%= project.const %>
10
+
11
+ <%= " " * tabs %> # The semantic version of the module.
12
+ <%= " " * tabs %> # @see http://semver.org/ Semantic versioning 2.0
13
+ <%= " " * tabs %> VERSION = "0.0.1-alpha".freeze
14
+
15
+ <%= " " * tabs %>end # module <%= project.const %>
16
+ <% project.namespaces.reverse.each do |item| -%>
17
+ <% tabs -= 1 %>
18
+ <%= " " * tabs %>end # module <%= item %>
19
+ <% end -%>
@@ -0,0 +1,13 @@
1
+ # encoding: utf-8
2
+
3
+ module Hexx
4
+
5
+ module Domains
6
+
7
+ # The semantic version of the module.
8
+ # @see http://semver.org/ Semantic versioning 2.0
9
+ VERSION = "0.0.1".freeze
10
+
11
+ end # module Domains
12
+
13
+ end # module Hexx
@@ -0,0 +1,8 @@
1
+ # encoding: utf-8
2
+ require "hexx-rspec"
3
+
4
+ # Loads runtime metrics
5
+ Hexx::RSpec.load_metrics_for(self)
6
+
7
+ # Loads the code under test
8
+ require "hexx-domains"
@@ -0,0 +1,251 @@
1
+ # encoding: utf-8
2
+
3
+ describe Hexx::Domains::CLI, :sandbox do
4
+
5
+ shared_examples "adding an email" do |email|
6
+
7
+ it "[adds email to .gemspec]" do
8
+ content = read_in_sandbox "foo-bar/foo-bar.gemspec"
9
+ expect(content).to include email
10
+ end
11
+
12
+ it "[adds email to LICENSE]" do
13
+ content = read_in_sandbox "foo-bar/LICENSE"
14
+ expect(content).to include email
15
+ end
16
+
17
+ end # shared_examples
18
+
19
+ shared_examples "adding a user" do |user|
20
+
21
+ it "[adds user to .gemspec]" do
22
+ content = read_in_sandbox "foo-bar/foo-bar.gemspec"
23
+ expect(content).to include user
24
+ end
25
+
26
+ it "[adds user to README]" do
27
+ content = read_in_sandbox "foo-bar/README.md"
28
+ expect(content).to include user
29
+ end
30
+
31
+ it "[adds user to LICENSE]" do
32
+ content = read_in_sandbox "foo-bar/LICENSE"
33
+ expect(content).to include user
34
+ end
35
+
36
+ end # shared_examples
37
+
38
+ shared_examples "adding an author" do |author|
39
+
40
+ it "[adds author to .gemspec]" do
41
+ content = read_in_sandbox "foo-bar/foo-bar.gemspec"
42
+ expect(content).to include author
43
+ end
44
+
45
+ it "[adds author to LICENSE]" do
46
+ content = read_in_sandbox "foo-bar/LICENSE"
47
+ expect(content).to include author
48
+ end
49
+
50
+ end # shared_examples
51
+
52
+ shared_examples "creating a dummy app" do
53
+
54
+ it "[adds files]" do
55
+ %w(
56
+ foo-bar/lib/foo/bar/configurator.rb
57
+ foo-bar/spec/dummy/config/initializers/foo-bar.rb
58
+ foo-bar/spec/dummy/lib/dummy.rb
59
+ ).each { |file| expect(file).to be_present_in_sandbox }
60
+ end
61
+
62
+ it "[calls dummy app]" do
63
+ content = read_in_sandbox "foo-bar/spec/spec_helper.rb"
64
+ expect(content).to include "dummy/lib/dummy"
65
+ end
66
+
67
+ end # shared_examples
68
+
69
+ shared_examples "creating a gem" do
70
+
71
+ it "[adds files]" do
72
+ %w(
73
+ foo-bar/lib/foo-bar.rb
74
+ foo-bar/lib/foo/bar.rb
75
+ foo-bar/lib/foo/bar/version.rb
76
+ foo-bar/spec/spec_helper.rb
77
+ foo-bar/spec/tests
78
+ foo-bar/.coveralls.yml
79
+ foo-bar/.gitignore
80
+ foo-bar/.rspec
81
+ foo-bar/.travis.yml
82
+ foo-bar/.yardopts
83
+ foo-bar/Gemfile
84
+ foo-bar/Guardfile
85
+ foo-bar/LICENSE
86
+ foo-bar/README.md
87
+ foo-bar/Rakefile
88
+ foo-bar/foo-bar.gemspec
89
+ ).each { |file| expect(file).to be_present_in_sandbox }
90
+ end
91
+
92
+ end # shared_examples
93
+
94
+ shared_examples "initializing git repository" do
95
+
96
+ it "[has .git]" do
97
+ expect("foo-bar/.git").to be_present_in_sandbox
98
+ end
99
+
100
+ end # shared_examples
101
+
102
+ shared_examples "skipping a dummy app" do
103
+
104
+ it "[doesn't add files]" do
105
+ %w(
106
+ foo-bar/foo/bar/configurator.rb
107
+ foo-bar/spec/dummy/config/initializers/foo-bar.rb
108
+ foo-bar/spec/dummy/lib/dummy.rb
109
+ ).each { |file| expect(file).to be_absent_in_sandbox }
110
+ end
111
+
112
+ it "[calls lib]" do
113
+ content = read_in_sandbox "foo-bar/spec/spec_helper.rb"
114
+ expect(content).to include "require \"foo-bar\""
115
+ end
116
+
117
+ end # shared_examples
118
+
119
+ shared_examples "skipping git repository" do
120
+
121
+ it "[has no .git]" do
122
+ expect("foo-bar/.git").to be_absent_in_sandbox
123
+ end
124
+
125
+ end # shared_examples
126
+
127
+ shared_examples "supporting ruby" do |ruby|
128
+
129
+ it "[adds ruby to README]" do
130
+ content = read_in_sandbox "foo-bar/README.md"
131
+ expect(content).to include ruby
132
+ end
133
+
134
+ it "[adds rmv to .travis.yml]" do
135
+ versions = {
136
+ "1.9" => [
137
+ "1.9.3", "ruby-head",
138
+ "rbx-2 --1.9", "rbx-2 --2.0",
139
+ "jruby-1.7-19mode", "jruby-head-21mode"
140
+ ],
141
+ "2.0" => ["2.0", "ruby-head", "rbx-2 --2.0", "jruby-head-20mode"],
142
+ "2.1" => ["2.1", "ruby-head", "rbx-2 --2.0", "jruby-head-21mode"]
143
+ }
144
+ content = read_in_sandbox "foo-bar/.travis.yml"
145
+ versions[ruby].each { |version| expect(content).to include version }
146
+ end
147
+
148
+ end # shared_examples
149
+
150
+ describe ".start", :capture do
151
+
152
+ subject { try_in_sandbox { described_class.start params } }
153
+
154
+ context "foo-bar" do
155
+
156
+ let(:params) { %w(foo-bar) }
157
+ before { subject }
158
+
159
+ it_behaves_like "creating a gem"
160
+ it_behaves_like "adding an email", "@todo: email"
161
+ it_behaves_like "adding a user", "@todo: user"
162
+ it_behaves_like "adding an author", "@todo: author"
163
+ it_behaves_like "supporting ruby", "2.1"
164
+ it_behaves_like "skipping a dummy app"
165
+ it_behaves_like "skipping git repository"
166
+
167
+ end # context
168
+
169
+ context "foo-bar -u bar" do
170
+
171
+ let(:params) { %w(foo-bar -u bar) }
172
+ before { subject }
173
+
174
+ it_behaves_like "creating a gem"
175
+ it_behaves_like "adding a user", "bar"
176
+
177
+ end # context
178
+
179
+ context "foo-bar -a bar baz" do
180
+
181
+ let(:params) { %w(foo-bar -a bar baz) }
182
+ before { subject }
183
+
184
+ it_behaves_like "creating a gem"
185
+ it_behaves_like "adding an author", "Bar Baz"
186
+
187
+ end # context
188
+
189
+ context "foo-bar -e bar@baz.com" do
190
+
191
+ let(:params) { %w(foo-bar -e bar@baz.com) }
192
+ before { subject }
193
+
194
+ it_behaves_like "creating a gem"
195
+ it_behaves_like "adding an email", "bar@baz.com"
196
+
197
+ end # context
198
+
199
+ context "foo-bar -r 1.9" do
200
+
201
+ let(:params) { %w(foo-bar -r 1.9) }
202
+ before { subject }
203
+
204
+ it_behaves_like "creating a gem"
205
+ it_behaves_like "supporting ruby", "1.9"
206
+
207
+ end # context
208
+
209
+ context "foo-bar -r 2.0" do
210
+
211
+ let(:params) { %w(foo-bar -r 2.0) }
212
+ before { subject }
213
+
214
+ it_behaves_like "creating a gem"
215
+ it_behaves_like "supporting ruby", "2.0"
216
+
217
+ end # context
218
+
219
+ context "foo-bar -r 2.1" do
220
+
221
+ let(:params) { %w(foo-bar -r 2.1) }
222
+ before { subject }
223
+
224
+ it_behaves_like "creating a gem"
225
+ it_behaves_like "supporting ruby", "2.1"
226
+
227
+ end # context
228
+
229
+ context "foo-bar -d" do
230
+
231
+ let(:params) { %w(foo-bar -d) }
232
+ before { subject }
233
+
234
+ it_behaves_like "creating a gem"
235
+ it_behaves_like "creating a dummy app"
236
+
237
+ end # context
238
+
239
+ context "foo-bar -g" do
240
+
241
+ let(:params) { %w(foo-bar -g) }
242
+ before { subject }
243
+
244
+ it_behaves_like "creating a gem"
245
+ it_behaves_like "initializing git repository"
246
+
247
+ end # context
248
+
249
+ end # describe .start
250
+
251
+ end # describe Hexx::Domains::CLI
metadata ADDED
@@ -0,0 +1,135 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: hexx-domains
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Andrew Kozin
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-03-20 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: hexx-cli
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: hexx-dependencies
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '0.0'
34
+ - - ">="
35
+ - !ruby/object:Gem::Version
36
+ version: 0.0.3
37
+ type: :runtime
38
+ prerelease: false
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - "~>"
42
+ - !ruby/object:Gem::Version
43
+ version: '0.0'
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: 0.0.3
47
+ - !ruby/object:Gem::Dependency
48
+ name: hexx-suit
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '2.1'
54
+ type: :runtime
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - "~>"
59
+ - !ruby/object:Gem::Version
60
+ version: '2.1'
61
+ description: Scaffolds the domain model as a separate gem.
62
+ email: andrew.kozin@gmail.com
63
+ executables: []
64
+ extensions: []
65
+ extra_rdoc_files:
66
+ - README.md
67
+ - LICENSE
68
+ files:
69
+ - ".coveralls.yml"
70
+ - ".gitignore"
71
+ - ".metrics"
72
+ - ".rspec"
73
+ - ".rubocop.yml"
74
+ - ".travis.yml"
75
+ - ".yardopts"
76
+ - Gemfile
77
+ - Guardfile
78
+ - LICENSE
79
+ - README.md
80
+ - Rakefile
81
+ - config/metrics/STYLEGUIDE
82
+ - config/metrics/cane.yml
83
+ - config/metrics/churn.yml
84
+ - config/metrics/flay.yml
85
+ - config/metrics/metric_fu.yml
86
+ - config/metrics/reek.yml
87
+ - config/metrics/roodi.yml
88
+ - config/metrics/rubocop.yml
89
+ - config/metrics/saikuro.yml
90
+ - config/metrics/simplecov.yml
91
+ - config/metrics/yardstick.yml
92
+ - hexx-domains.gemspec
93
+ - lib/hexx-domains.rb
94
+ - lib/hexx/domains.rb
95
+ - lib/hexx/domains/cli.rb
96
+ - lib/hexx/domains/cli/gemspec.erb
97
+ - lib/hexx/domains/cli/lib.erb
98
+ - lib/hexx/domains/cli/module.erb
99
+ - lib/hexx/domains/cli/root/LICENSE.erb
100
+ - lib/hexx/domains/cli/root/README.md.erb
101
+ - lib/hexx/domains/cli/root/_.coveralls.yml
102
+ - lib/hexx/domains/cli/root/_.gitignore
103
+ - lib/hexx/domains/cli/root/_.travis.yml.erb
104
+ - lib/hexx/domains/cli/version.erb
105
+ - lib/hexx/domains/version.rb
106
+ - spec/spec_helper.rb
107
+ - spec/tests/cli_spec.rb
108
+ homepage: https://github.com/nepalez/hexx-domains
109
+ licenses:
110
+ - MIT
111
+ metadata: {}
112
+ post_install_message:
113
+ rdoc_options: []
114
+ require_paths:
115
+ - lib
116
+ required_ruby_version: !ruby/object:Gem::Requirement
117
+ requirements:
118
+ - - "~>"
119
+ - !ruby/object:Gem::Version
120
+ version: '2.0'
121
+ required_rubygems_version: !ruby/object:Gem::Requirement
122
+ requirements:
123
+ - - ">="
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
126
+ requirements: []
127
+ rubyforge_project:
128
+ rubygems_version: 2.4.6
129
+ signing_key:
130
+ specification_version: 4
131
+ summary: Domain model scaffolder.
132
+ test_files:
133
+ - spec/spec_helper.rb
134
+ - spec/tests/cli_spec.rb
135
+ has_rdoc: