law 0.1.6 → 0.1.7

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
  SHA256:
3
- metadata.gz: e67ef53ed650ad660d2b3f09d31dffdeab041efabbef8b92806a9b097e461ae7
4
- data.tar.gz: 199118b8857009f2a95d8236ccecbb5b1ed3a0419bcf1587f83e309c42bee56e
3
+ metadata.gz: fc69dc5d1f320859b6bdf0790ca7f6cda5f2cd360a1914b0ac8a0ee64fb55ded
4
+ data.tar.gz: 63809c047c647f20f484b18fcc4d533d744acf5ce45752c4b29b862fc2884110
5
5
  SHA512:
6
- metadata.gz: c046693f76fa2d2c9cc08b6dc3846f40e092d4b2b883157b9ff04a7b33a9babc84f84de63b073edea6c6dba27fa210aecba5c2e90fc02055c6bfbbdf252402df
7
- data.tar.gz: 79ee249005e98819df978ebdada33295591f3cbed3b945316b23699c50fea2281ec92bb25bc1c874b001ce88d57b0a526da56118155ecd4d0360497f88c6d5b4
6
+ metadata.gz: 14a075af23f0f27219ea367bac150b86502e84ae04ee3c3d1935a722c52c6a552337ee6881e7f180332b41c05af55d23b560d51edf1b8d826d94ea79c763b367
7
+ data.tar.gz: 271db0565571b6872c5b00d8766146db0d466b9c480be9087f24fe98c2ba34fad3c4f01874e8e3a2d8ac1d72cf842b68dddcb9c11b9e78f646cf400649f5658e
@@ -0,0 +1,9 @@
1
+ Description:
2
+ Stub a Law with a test.
3
+
4
+ Example:
5
+ `rails generate law foo`
6
+
7
+ Generates:
8
+ Law: app/laws/foo_law.rb
9
+ Test: spec/laws/foo_law_spec.rb
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Law
4
+ module Generators
5
+ class LawGenerator < Rails::Generators::NamedBase
6
+ source_root File.expand_path("templates", __dir__)
7
+
8
+ hook_for :test_framework
9
+
10
+ def create_law
11
+ template "law.rb.erb", File.join("app/laws/", class_path, "#{file_name}_law.rb")
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,9 @@
1
+ Description:
2
+ Stub a Regulation with a test.
3
+
4
+ Example:
5
+ `rails generate law:regulation foo`
6
+
7
+ Generates:
8
+ Regulation: app/regulations/foo_regulation.rb
9
+ Test: spec/regulations/foo_regulation_spec.rb
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Law
4
+ module Generators
5
+ class RegulationGenerator < Rails::Generators::NamedBase
6
+ source_root File.expand_path("templates", __dir__)
7
+
8
+ hook_for :test_framework
9
+
10
+ def create_regulation
11
+ template "regulation.rb.erb", File.join("app/regulations/", class_path, "#{file_name}_regulation.rb")
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ class <%= class_name %>Regulation < ApplicationRegulation
4
+ end
@@ -0,0 +1,9 @@
1
+ Description:
2
+ Stub a Statute with a test.
3
+
4
+ Example:
5
+ `rails generate law:statute foo`
6
+
7
+ Generates:
8
+ Statute: app/statutes/foo_statute.rb
9
+ Test: spec/statutes/foo_statute_spec.rb
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Law
4
+ module Generators
5
+ class StatuteGenerator < Rails::Generators::NamedBase
6
+ source_root File.expand_path("templates", __dir__)
7
+
8
+ hook_for :test_framework
9
+
10
+ def create_statute
11
+ template "statute.rb.erb", File.join("app/statutes/", class_path, "#{file_name}_statute.rb")
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ class <%= class_name %>Statute < ApplicationStatute
4
+ end
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ class <%= class_name %>Law < ApplicationLaw
4
+ end
@@ -0,0 +1,9 @@
1
+
2
+ Description:
3
+ Stub a Law test.
4
+
5
+ Example:
6
+ `rails generate rspec:law foo`
7
+
8
+ Generates:
9
+ Test: spec/laws/foo_law_spec.rb
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Rspec
4
+ module Generators
5
+ class LawGenerator < Rails::Generators::NamedBase
6
+ source_root File.expand_path("templates", __dir__)
7
+
8
+ def create_spec_file
9
+ template "law_spec.rb.erb", File.join("spec/laws/", class_path, "#{file_name}_law_spec.rb")
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "rails_helper"
4
+
5
+ RSpec.describe <%= class_name %>Law, type: :law do
6
+ it { is_expected.to inherit_from ApplicationLaw }
7
+ end
@@ -0,0 +1,9 @@
1
+
2
+ Description:
3
+ Stub a Regulation test.
4
+
5
+ Example:
6
+ `rails generate rspec:regulation foo`
7
+
8
+ Generates:
9
+ Test: spec/regulations/foo_regulation_spec.rb
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Rspec
4
+ module Generators
5
+ class RegulationGenerator < Rails::Generators::NamedBase
6
+ source_root File.expand_path("templates", __dir__)
7
+
8
+ def create_spec_file
9
+ template "regulation_spec.rb.erb", File.join("spec/regulations/", class_path, "#{file_name}_regulation_spec.rb")
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "rails_helper"
4
+
5
+ RSpec.describe <%= class_name %>Regulation, type: :regulation do
6
+ it { is_expected.to inherit_from ApplicationRegulation }
7
+ end
@@ -0,0 +1,9 @@
1
+
2
+ Description:
3
+ Stub a Statute test.
4
+
5
+ Example:
6
+ `rails generate rspec:statute foo`
7
+
8
+ Generates:
9
+ Test: spec/statutes/foo_statute_spec.rb
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Rspec
4
+ module Generators
5
+ class StatuteGenerator < Rails::Generators::NamedBase
6
+ source_root File.expand_path("templates", __dir__)
7
+
8
+ def create_spec_file
9
+ template "statute_spec.rb.erb", File.join("spec/statutes/", class_path, "#{file_name}_statute_spec.rb")
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "rails_helper"
4
+
5
+ RSpec.describe <%= class_name %>Statute, type: :statute do
6
+ it { is_expected.to inherit_from ApplicationStatute }
7
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Law
4
- VERSION = "0.1.6"
4
+ VERSION = "0.1.7"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: law
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Garside
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-04-02 00:00:00.000000000 Z
12
+ date: 2020-04-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -180,6 +180,24 @@ extra_rdoc_files: []
180
180
  files:
181
181
  - LICENSE.txt
182
182
  - README.md
183
+ - lib/generators/law/USAGE
184
+ - lib/generators/law/law_generator.rb
185
+ - lib/generators/law/regulation/USAGE
186
+ - lib/generators/law/regulation/regulation_generator.rb
187
+ - lib/generators/law/regulation/templates/regulation.rb.erb
188
+ - lib/generators/law/statute/USAGE
189
+ - lib/generators/law/statute/statute_generator.rb
190
+ - lib/generators/law/statute/templates/statute.rb.erb
191
+ - lib/generators/law/templates/law.rb.erb
192
+ - lib/generators/rspec/law/USAGE
193
+ - lib/generators/rspec/law/law_generator.rb
194
+ - lib/generators/rspec/law/templates/law_spec.rb.erb
195
+ - lib/generators/rspec/regulation/USAGE
196
+ - lib/generators/rspec/regulation/regulation_generator.rb
197
+ - lib/generators/rspec/regulation/templates/regulation_spec.rb.erb
198
+ - lib/generators/rspec/statute/USAGE
199
+ - lib/generators/rspec/statute/statute_generator.rb
200
+ - lib/generators/rspec/statute/templates/statute_spec.rb.erb
183
201
  - lib/law.rb
184
202
  - lib/law/judgement.rb
185
203
  - lib/law/law_base.rb