active_generator 2.2.4 → 2.2.5

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: c17e28c7354ac6f48431bed5b6e2e33d1edea862
4
- data.tar.gz: 58986d1bc335ebc6951e7f6817186da03fed4519
3
+ metadata.gz: be9f82b23248e0bdc190eedaa53813f4f3f7578b
4
+ data.tar.gz: 4971159e830272571bfd66173a766b6e15bd6156
5
5
  SHA512:
6
- metadata.gz: a6b498fc5c0dc2528b9af943cff81a0e119d994e9a4bc78f7c7db631fdb108269b7bf426edc8151397f858eef606c5a2a2e1a2b13a19db3f20275d80ddb9d623
7
- data.tar.gz: bc626000cf55ee043dd5d5e4d2e13cc80df5bf13c45971689d4d9146a5c25963ae66758f8a61a17713baf55f0907a05da81b982bc844a8955508e1a3e2f9362f
6
+ metadata.gz: 0bb5d098d3449c23d6d636c95b3782948beaf5a86347009843d96e2983d000dafc5e997e692d9d3c3879f8a3dc11f9fd24ae094a20f9b3118f4e94728ef9ec36
7
+ data.tar.gz: f0475cd4f9175a8e176555f853e3a071b2f85c14c31eaceeef4d8207aea9eda02289c05d063fee1ffd727f92deac8406048dcfe727d765317ce046512f56ab09
data/README.md CHANGED
@@ -61,6 +61,7 @@ ActiveGenerator.configure do |config|
61
61
  config.autoload_service_generator_locale = true
62
62
  config.autoload_task_generator_locale = true
63
63
  config.autoload_view_generator_locale = true
64
+ config.test_framework = "test_unit"
64
65
  end
65
66
  ```
66
67
 
@@ -7,7 +7,8 @@ class ActiveGenerator::Configuration
7
7
  :autoload_model_generator_locale,
8
8
  :autoload_service_generator_locale,
9
9
  :autoload_task_generator_locale,
10
- :autoload_view_generator_locale
10
+ :autoload_view_generator_locale,
11
+ :test_framework
11
12
 
12
13
  def initialize
13
14
  @autoload_controller_generator_locale = true
@@ -18,6 +19,7 @@ class ActiveGenerator::Configuration
18
19
  @autoload_service_generator_locale = true
19
20
  @autoload_task_generator_locale = true
20
21
  @autoload_view_generator_locale = true
22
+ @test_framework = :test_unit
21
23
  end
22
24
 
23
25
  end
@@ -1,3 +1,3 @@
1
1
  module ActiveGenerator
2
- VERSION = "2.2.4"
2
+ VERSION = "2.2.5"
3
3
  end
@@ -9,6 +9,12 @@ module Erb
9
9
  invoke("locale:view", [name]) if ActiveGenerator.configuration.autoload_view_generator_locale
10
10
  end
11
11
 
12
+ def generate_test_file
13
+ unless ["test_unit", nil].include?(ActiveGenerator.configuration.test_framework)
14
+ invoke("#{ActiveGenerator.configuration.test_framework}:view", [name]) rescue nil
15
+ end
16
+ end
17
+
12
18
  end
13
19
  end
14
20
  end
@@ -21,6 +27,12 @@ module Rails
21
27
  invoke("locale:controller", [name]) if ActiveGenerator.configuration.autoload_controller_generator_locale
22
28
  end
23
29
 
30
+ def generate_test_file
31
+ unless ActiveGenerator.configuration.test_framework.nil?
32
+ invoke("#{ActiveGenerator.configuration.test_framework}:controller", [name]) rescue nil
33
+ end
34
+ end
35
+
24
36
  end
25
37
  end
26
38
  end
@@ -9,7 +9,9 @@ module Rails
9
9
  end
10
10
 
11
11
  def generate_test_file
12
- invoke("rspec:helper", [name])
12
+ unless ActiveGenerator.configuration.test_framework.nil?
13
+ invoke("#{ActiveGenerator.configuration.test_framework}:helper", [name]) rescue nil
14
+ end
13
15
  end
14
16
 
15
17
  end
@@ -8,6 +8,12 @@ module Rails
8
8
  invoke("locale:job", [name]) if ActiveGenerator.configuration.autoload_job_generator_locale
9
9
  end
10
10
 
11
+ def generate_test_file
12
+ unless ActiveGenerator.configuration.test_framework.nil?
13
+ invoke("#{ActiveGenerator.configuration.test_framework}:job", [name]) rescue nil
14
+ end
15
+ end
16
+
11
17
  end
12
18
  end
13
19
  end
@@ -9,6 +9,12 @@ module Erb
9
9
  invoke("locale:view", [name]) if ActiveGenerator.configuration.autoload_view_generator_locale
10
10
  end
11
11
 
12
+ def generate_test_file
13
+ unless ["test_unit", nil].include?(ActiveGenerator.configuration.test_framework)
14
+ invoke("#{ActiveGenerator.configuration.test_framework}:view", [name]) rescue nil
15
+ end
16
+ end
17
+
12
18
  end
13
19
  end
14
20
  end
@@ -21,6 +27,12 @@ module Rails
21
27
  invoke("locale:mailer", [name]) if ActiveGenerator.configuration.autoload_mailer_generator_locale
22
28
  end
23
29
 
30
+ def generate_test_file
31
+ unless ActiveGenerator.configuration.test_framework.nil?
32
+ invoke("#{ActiveGenerator.configuration.test_framework}:mailer", [name]) rescue nil
33
+ end
34
+ end
35
+
24
36
  end
25
37
  end
26
38
  end
@@ -14,6 +14,12 @@ module ActiveRecord
14
14
  invoke("locale:model", [name]) if ActiveGenerator.configuration.autoload_model_generator_locale
15
15
  end
16
16
 
17
+ def generate_test_file
18
+ unless ActiveGenerator.configuration.test_framework.nil?
19
+ invoke("#{ActiveGenerator.configuration.test_framework}:model", [name]) rescue nil
20
+ end
21
+ end
22
+
17
23
  end
18
24
  end
19
25
  end
@@ -8,6 +8,12 @@ module Erb
8
8
  invoke("locale:view", [name]) if ActiveGenerator.configuration.autoload_view_generator_locale
9
9
  end
10
10
 
11
+ def generate_test_file
12
+ unless ActiveGenerator.configuration.test_framework.nil?
13
+ invoke("#{ActiveGenerator.configuration.test_framework}:view", [name]) rescue nil
14
+ end
15
+ end
16
+
11
17
  end
12
18
  end
13
19
  end
@@ -20,4 +20,10 @@ class ViewGenerator < Rails::Generators::NamedBase
20
20
  invoke("locale:view", [name]) if ActiveGenerator.configuration.autoload_view_generator_locale
21
21
  end
22
22
 
23
+ def generate_test_file
24
+ unless ["test_unit", nil].include?(ActiveGenerator.configuration.test_framework)
25
+ invoke("#{ActiveGenerator.configuration.test_framework}:view", [name]) rescue nil
26
+ end
27
+ end
28
+
23
29
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_generator
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.4
4
+ version: 2.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Gomez