bounded_context 0.18.2 → 0.19.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 725bb3c48d1726368786e76ea2d0327fb4e6f5a5
4
- data.tar.gz: 273b1d52fad0aa3a03badc001a22e0920e43c626
3
+ metadata.gz: f4c104063ffce5d2202d1279c62c4fcc858d3851
4
+ data.tar.gz: 0d9486c65f29a250b163fe9f79d0ecaca538d1aa
5
5
  SHA512:
6
- metadata.gz: bf2371e2a9aca2807110113e7bf41bf6dbd4c0994c518199dbe7cdb79bd1cf8944d2e02ac7f323189f3ce3a9a08bfa5663b2bb377f99d985f3afb14985795eb6
7
- data.tar.gz: 208ece1f50b83e9c364cc82e9868c02d6ef1fad677b50725a094386cd4ae588cf0278e4a9327d608d924402fd365d202a406f4484b414f1b59f62e3aecfc3c62
6
+ metadata.gz: 2abab85049407c6596125f4b473b7d672bd8f572d2b50b2eb9806891317f764e32fef6b19012472b6e1265506750060945019e8a6a617bcac0e8437d357e009b
7
+ data.tar.gz: bc47b89c2977a8bd727a6db3d709827820984058da217d0958720c894176f6e33df3090f6748a8fcb74941d6c679b716552398f7a8cced313284970c19a86282
@@ -1,27 +1,27 @@
1
1
 
2
- lib = File.expand_path("../lib", __FILE__)
2
+ lib = File.expand_path('../lib', __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require "bounded_context/version"
4
+ require 'bounded_context/version'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
- spec.name = "bounded_context"
7
+ spec.name = 'bounded_context'
8
8
  spec.version = BoundedContext::VERSION
9
- spec.authors = ["Paweł Pacana"]
10
- spec.email = ["pawel.pacana@gmail.com"]
9
+ spec.licenses = ['MIT']
10
+ spec.authors = ['Arkency']
11
+ spec.email = ['dev@arkency.com']
11
12
 
12
13
  spec.summary = %q{Generate opinionated component structure.}
13
14
 
14
15
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
15
16
  f.match(%r{^(test|spec|features)/})
16
17
  end
17
- spec.bindir = "exe"
18
+ spec.bindir = 'exe'
18
19
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
- spec.require_paths = ["lib"]
20
+ spec.require_paths = ['lib']
20
21
 
21
- spec.add_development_dependency "bundler", "~> 1.15"
22
- spec.add_development_dependency "rake", "~> 10.0"
23
- spec.add_development_dependency "rspec", "~> 3.6"
24
- spec.add_development_dependency "rails", "~> 4.2"
25
- spec.add_development_dependency "fakefs", "~> 0.11.2"
22
+ spec.add_development_dependency 'bundler', '~> 1.15'
23
+ spec.add_development_dependency 'rake', '~> 10.0'
24
+ spec.add_development_dependency 'rspec', '~> 3.6'
25
+ spec.add_development_dependency 'rails', '~> 5.1'
26
26
  spec.add_development_dependency 'mutant-rspec', '~> 0.8.14'
27
27
  end
@@ -2,4 +2,3 @@ module BoundedContext
2
2
  end
3
3
 
4
4
  require "bounded_context/version"
5
- require "bounded_context/generator"
@@ -1,3 +1,3 @@
1
1
  module BoundedContext
2
- VERSION = "0.18.2"
2
+ VERSION = "0.19.0"
3
3
  end
@@ -0,0 +1,28 @@
1
+ require 'rails/generators'
2
+
3
+ module BoundedContext
4
+ module Generators
5
+ class BoundedContextGenerator < Rails::Generators::NamedBase
6
+ source_root File.expand_path(File.join(File.dirname(__FILE__), '../templates'))
7
+ hook_for :test_framework
8
+
9
+ def create_bounded_context
10
+ template "module.rb", "#{bounded_context_name}/lib/#{bounded_context_name}.rb"
11
+
12
+ application do
13
+ "config.paths.add '#{bounded_context_name}/lib', eager_load: true"
14
+ end
15
+ end
16
+
17
+ private
18
+
19
+ def bounded_context_namespace
20
+ name.camelize
21
+ end
22
+
23
+ def bounded_context_name
24
+ name.underscore
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,31 @@
1
+ require 'rails/generators'
2
+
3
+ module BoundedContext
4
+ module Generators
5
+ class RspecGenerator < Rails::Generators::NamedBase
6
+ source_root File.expand_path(File.join(File.dirname(__FILE__), '../templates'))
7
+
8
+ def spec_helper
9
+ template "spec_helper.rb", "#{bounded_context_name}/spec/spec_helper.rb"
10
+ end
11
+
12
+ def bc_spec
13
+ template "bc_spec.rb", "#{bounded_context_name}/spec/#{bounded_context_name}_spec.rb"
14
+ end
15
+
16
+ def require_bc_spec
17
+ template "require_bc_spec.rb", "spec/#{bounded_context_name}_spec.rb"
18
+ end
19
+
20
+ private
21
+
22
+ def bounded_context_namespace
23
+ name.camelize
24
+ end
25
+
26
+ def bounded_context_name
27
+ name.underscore
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,19 @@
1
+ require 'rails/generators'
2
+
3
+ module BoundedContext
4
+ module Generators
5
+ class TestUnitGenerator < Rails::Generators::NamedBase
6
+ source_root File.expand_path(File.join(File.dirname(__FILE__), '../templates'))
7
+
8
+ def test_helper
9
+ template "test_helper.rb", "#{bounded_context_name}/test/test_helper.rb"
10
+ end
11
+
12
+ private
13
+
14
+ def bounded_context_name
15
+ name.underscore
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,4 @@
1
+ require_relative 'spec_helper'
2
+
3
+ RSpec.describe <%= bounded_context_namespace %> do
4
+ end
@@ -0,0 +1,6 @@
1
+ require 'rails_helper'
2
+
3
+ path = Rails.root.join('<%= bounded_context_name %>/spec')
4
+ Dir.glob("#{path}/**/*_spec.rb") do |file|
5
+ require file
6
+ end
@@ -0,0 +1,7 @@
1
+ ENV['RAILS_ENV'] = 'test'
2
+
3
+ $LOAD_PATH.push File.expand_path('../../../spec', __FILE__)
4
+ require File.expand_path('../../../config/environment', __FILE__)
5
+ require File.expand_path('../../../spec/rails_helper', __FILE__)
6
+
7
+ require_relative '../lib/<%= bounded_context_name %>'
@@ -0,0 +1 @@
1
+ require_relative '../lib/<%= bounded_context_name %>'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bounded_context
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.18.2
4
+ version: 0.19.0
5
5
  platform: ruby
6
6
  authors:
7
- - Paweł Pacana
7
+ - Arkency
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-10-18 00:00:00.000000000 Z
11
+ date: 2017-11-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -58,28 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '4.2'
61
+ version: '5.1'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '4.2'
69
- - !ruby/object:Gem::Dependency
70
- name: fakefs
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - "~>"
74
- - !ruby/object:Gem::Version
75
- version: 0.11.2
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - "~>"
81
- - !ruby/object:Gem::Version
82
- version: 0.11.2
68
+ version: '5.1'
83
69
  - !ruby/object:Gem::Dependency
84
70
  name: mutant-rspec
85
71
  requirement: !ruby/object:Gem::Requirement
@@ -96,7 +82,7 @@ dependencies:
96
82
  version: 0.8.14
97
83
  description:
98
84
  email:
99
- - pawel.pacana@gmail.com
85
+ - dev@arkency.com
100
86
  executables: []
101
87
  extensions: []
102
88
  extra_rdoc_files: []
@@ -106,11 +92,18 @@ files:
106
92
  - README.md
107
93
  - bounded_context.gemspec
108
94
  - lib/bounded_context.rb
109
- - lib/bounded_context/generator.rb
110
- - lib/bounded_context/templates/module.rb
111
95
  - lib/bounded_context/version.rb
96
+ - lib/generators/bounded_context/bounded_context_generator.rb
97
+ - lib/generators/bounded_context/rspec_generator.rb
98
+ - lib/generators/bounded_context/test_unit_generator.rb
99
+ - lib/generators/templates/bc_spec.rb
100
+ - lib/generators/templates/module.rb
101
+ - lib/generators/templates/require_bc_spec.rb
102
+ - lib/generators/templates/spec_helper.rb
103
+ - lib/generators/templates/test_helper.rb
112
104
  homepage:
113
- licenses: []
105
+ licenses:
106
+ - MIT
114
107
  metadata: {}
115
108
  post_install_message:
116
109
  rdoc_options: []
@@ -1,25 +0,0 @@
1
- require 'rails/generators'
2
-
3
- module BoundedContext
4
- class Generator < Rails::Generators::NamedBase
5
- source_root File.expand_path(File.join(File.dirname(__FILE__), 'templates'))
6
-
7
- def create_bounded_context
8
- template "module.rb", "#{bounded_context_name}/lib/#{bounded_context_name}.rb"
9
-
10
- application do
11
- "config.paths.add '#{bounded_context_name}/lib', eager_load: true"
12
- end
13
- end
14
-
15
- private
16
-
17
- def bounded_context_namespace
18
- name.camelize
19
- end
20
-
21
- def bounded_context_name
22
- name.underscore
23
- end
24
- end
25
- end