tablexi_dev-generators 0.1.0 → 0.1.2

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: 56152f0209f0fc9d78f53fc96e874842beb38b3c
4
- data.tar.gz: 57e1da7ecb905db9a828752d0dc0c77f3addeea5
3
+ metadata.gz: 5940dd75a8db7b95ac1834305e2e5795688501c5
4
+ data.tar.gz: a4843b50e3000eb93c74c0d0d07b563d0fb27bb8
5
5
  SHA512:
6
- metadata.gz: 59f41aac68253ffba890d70abf74568f6797156ff22163c0539afd8120d0e6cc1a8a75b7419d54c91e38f0067fa7b6e6c52c34d00604a2f9a9be591622764cdd
7
- data.tar.gz: 0a41f308c023d0630fb1b38bf88222526f6ab6568eaf32d7b0f043262178d8f2b3f48680089d0dee51be98b70b5e97b64bedcea8d2c058a1fb815c50c29d488c
6
+ metadata.gz: fec66033eea71e396c079336518c51ea4bfcaade5bb257a5ffbcd020339dfe9ffb7d4d4ed0e530b99aa523e449f160db54738dba7c2a39eaabfe8f015c35c7f8
7
+ data.tar.gz: cb4cbd2cac0fc2eb16d53eed4977d77f00288db682cd1fae446196ff4c6bd719f29ae9a046749f74eea4f15f632a6b2fce6c18f10b8076a5b97301c2e1711ad6
@@ -4,7 +4,7 @@ module TablexiDev
4
4
 
5
5
  module Generators
6
6
 
7
- class AllGenerator < Rails::Generators::Base
7
+ class AllGenerator < BaseGenerator
8
8
 
9
9
  GENERATORS = %i[
10
10
  git_hook
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module TablexiDev
4
+
5
+ module Generators
6
+
7
+ # All other TablexiDev generators should inherit this base generator
8
+ class BaseGenerator < Rails::Generators::Base
9
+
10
+ protected
11
+
12
+ def copy_file_and_set_executable(source_file, target_file)
13
+ copy_file source_file, target_file
14
+ chmod target_file, 0o755
15
+ end
16
+
17
+ end
18
+
19
+ end
20
+
21
+ end
@@ -4,7 +4,7 @@ module TablexiDev
4
4
 
5
5
  module Generators
6
6
 
7
- class GitHookGenerator < Rails::Generators::Base
7
+ class GitHookGenerator < BaseGenerator
8
8
 
9
9
  source_root File.expand_path("../git_hook_generator/files/", __FILE__)
10
10
 
@@ -23,12 +23,12 @@ module TablexiDev
23
23
  general_path = ".git/hooks/pre-#{type}"
24
24
 
25
25
  # Copy files from this generator into the project
26
- copy_and_set_executable("rubocop-pre-#{type}", rubocop_path)
27
- copy_and_set_executable("general-pre-#{type}", general_path) unless File.exist?(general_path)
26
+ copy_file_and_set_executable "rubocop-pre-#{type}", rubocop_path
27
+ copy_file_and_set_executable "general-pre-#{type}", general_path unless File.exist?(general_path)
28
28
 
29
29
  # Ensure we do not append to the general hook file more than once
30
30
  unless File.readlines(general_path).grep(/rubocop-pre-#{type}/).size > 0
31
- append_to_file(general_path, "exec #{rubocop_path}")
31
+ append_to_file general_path, "exec #{rubocop_path}"
32
32
  end
33
33
  end
34
34
 
@@ -4,7 +4,7 @@ module TablexiDev
4
4
 
5
5
  module Generators
6
6
 
7
- class RubocopGenerator < Rails::Generators::Base
7
+ class RubocopGenerator < BaseGenerator
8
8
 
9
9
  source_root File.expand_path("../rubocop_generator/files/", __FILE__)
10
10
 
@@ -37,11 +37,6 @@ module TablexiDev
37
37
  end
38
38
  end
39
39
 
40
- def copy_and_set_executable(source_file, target_file)
41
- copy_file source_file, target_file
42
- chmod target_file, 0o755
43
- end
44
-
45
40
  end
46
41
 
47
42
  end
@@ -4,7 +4,7 @@ module TablexiDev
4
4
 
5
5
  module Generators
6
6
 
7
- class UnicornGenerator < Rails::Generators::Base
7
+ class UnicornGenerator < BaseGenerator
8
8
 
9
9
  source_root File.expand_path("../unicorn_generator/templates", __FILE__)
10
10
 
@@ -4,7 +4,7 @@ module TablexiDev
4
4
 
5
5
  module Generators
6
6
 
7
- VERSION = "0.1.0"
7
+ VERSION = "0.1.2"
8
8
 
9
9
  end
10
10
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tablexi_dev-generators
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Table XI
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-11 00:00:00.000000000 Z
11
+ date: 2018-06-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -63,6 +63,7 @@ files:
63
63
  - README.md
64
64
  - Rakefile
65
65
  - lib/generators/tablexi_dev/all_generator.rb
66
+ - lib/generators/tablexi_dev/base_generator.rb
66
67
  - lib/generators/tablexi_dev/git_hook_generator.rb
67
68
  - lib/generators/tablexi_dev/git_hook_generator/files/general-pre-commit
68
69
  - lib/generators/tablexi_dev/git_hook_generator/files/general-pre-push