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 +4 -4
- data/lib/generators/tablexi_dev/all_generator.rb +1 -1
- data/lib/generators/tablexi_dev/base_generator.rb +21 -0
- data/lib/generators/tablexi_dev/git_hook_generator.rb +4 -4
- data/lib/generators/tablexi_dev/rubocop_generator.rb +1 -6
- data/lib/generators/tablexi_dev/unicorn_generator.rb +1 -1
- data/lib/tablexi_dev/generators/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5940dd75a8db7b95ac1834305e2e5795688501c5
|
4
|
+
data.tar.gz: a4843b50e3000eb93c74c0d0d07b563d0fb27bb8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fec66033eea71e396c079336518c51ea4bfcaade5bb257a5ffbcd020339dfe9ffb7d4d4ed0e530b99aa523e449f160db54738dba7c2a39eaabfe8f015c35c7f8
|
7
|
+
data.tar.gz: cb4cbd2cac0fc2eb16d53eed4977d77f00288db682cd1fae446196ff4c6bd719f29ae9a046749f74eea4f15f632a6b2fce6c18f10b8076a5b97301c2e1711ad6
|
@@ -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 <
|
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
|
-
|
27
|
-
|
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
|
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 <
|
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
|
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.
|
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
|
+
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
|