liquigen 0.0.4 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/README.md +20 -0
- data/bin/liquigen +50 -1
- data/lib/liquigen.rb +50 -1
- data/lib/liquigen/handlers/base.rb +2 -4
- data/lib/liquigen/scaffold/base.rb +61 -0
- data/lib/liquigen/scaffold/config.rb +25 -0
- data/lib/liquigen/scaffold/controller.rb +45 -0
- data/lib/liquigen/scaffold/entity.rb +50 -0
- data/lib/liquigen/scaffold/repository.rb +31 -0
- data/lib/liquigen/type_map.rb +17 -0
- data/lib/liquigen/version.rb +1 -1
- data/spec/liquigen/change_set_spec.rb +1 -1
- data/spec/liquigen/scaffold/controller_spec.rb +18 -0
- data/spec/liquigen/scaffold/entity_spec.rb +22 -0
- data/spec/liquigen/scaffold/repository_spec.rb +18 -0
- data/spec/liquigen_spec.rb +25 -0
- metadata +11 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d0d16f3716ac42fa44b15400554b51c938036fed31b37c32672db386ab7d0312
|
4
|
+
data.tar.gz: d1257fdaa9d7ab05bbd9b28254ffcba14b32f41bf921aa0685ac60a3e21f55d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d9827759f31f7078d784128ea525e39b437dfb6228bec425c26ae11c12d98406cfa7586ddf281882bd1603ba41a97eb4777a0db71b95b101f2c55e051c91ca8
|
7
|
+
data.tar.gz: ad268de9cecdfc004858e4d8bedae5562ab4d0df2ec8dda9fdc995a41a65282c8ad550edc5f52cb8da3c4941fc7c01186fbbe4855e704fd61df004455d730abd
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
liquigen (0.0
|
4
|
+
liquigen (0.1.0)
|
5
5
|
activesupport
|
6
6
|
gli (= 2.18.0)
|
7
7
|
|
@@ -24,7 +24,7 @@ GEM
|
|
24
24
|
builder (3.2.3)
|
25
25
|
childprocess (0.9.0)
|
26
26
|
ffi (~> 1.0, >= 1.0.11)
|
27
|
-
concurrent-ruby (1.
|
27
|
+
concurrent-ruby (1.1.3)
|
28
28
|
contracts (0.16.0)
|
29
29
|
cucumber (3.1.2)
|
30
30
|
builder (>= 2.1.2)
|
data/README.md
CHANGED
@@ -161,6 +161,26 @@ liquigen add_index -t user name:string email:string
|
|
161
161
|
liquigen sql "update users set column=true" "update customers set x = 1"
|
162
162
|
```
|
163
163
|
|
164
|
+
## config
|
165
|
+
Which is used for scaffolding java codes. In your application directory, one file called '.liquigen' will be added.
|
166
|
+
```bash
|
167
|
+
liquigen config
|
168
|
+
```
|
169
|
+
|
170
|
+
Please specify your custom name and path:
|
171
|
+
* package_name=com.yourpackage
|
172
|
+
* java_codes_root=src/main/java
|
173
|
+
* migration_path=src/main/resources/db/migrations
|
174
|
+
* controller_package_name=
|
175
|
+
* entity_package_name=
|
176
|
+
* repository_package_name=
|
177
|
+
|
178
|
+
## scaffold
|
179
|
+
```bash
|
180
|
+
liquigen scaffold -t table --controller --repository id:integer name:string email:string
|
181
|
+
# Get help by typing liquigen scaffold --help
|
182
|
+
```
|
183
|
+
|
164
184
|
## How to let the liquibase use migration directory
|
165
185
|
|
166
186
|
* In your java project, open application.yml, add the following lines:
|
data/bin/liquigen
CHANGED
@@ -20,8 +20,16 @@ class App
|
|
20
20
|
subcommand_option_handling :normal
|
21
21
|
arguments :strict
|
22
22
|
|
23
|
+
desc 'Edit config file'
|
24
|
+
arg_name 'no argument'
|
25
|
+
command :config do |c|
|
26
|
+
c.action do
|
27
|
+
Liquigen::Scaffold::Config.new.process
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
23
31
|
desc 'add table script'
|
24
|
-
arg_name '
|
32
|
+
arg_name 'properties pair like id:integer'
|
25
33
|
long_desc %{
|
26
34
|
Example
|
27
35
|
liquigen add_table -t user id:integer name:string
|
@@ -134,12 +142,53 @@ class App
|
|
134
142
|
end
|
135
143
|
end
|
136
144
|
|
145
|
+
desc 'Ping the current config'
|
146
|
+
arg_name 'No argument'
|
147
|
+
command :ping do |c|
|
148
|
+
c.action do
|
149
|
+
p "package name: #{Liquigen.package_name}"
|
150
|
+
p "controller_package_name: #{Liquigen.controller_package_name}"
|
151
|
+
p "entity_package_name: #{Liquigen.entity_package_name}"
|
152
|
+
p "repository_package_name: #{Liquigen.repository_package_name}"
|
153
|
+
p "java_codes_root: #{Liquigen.java_codes_root}"
|
154
|
+
p "migration_path: #{Liquigen.migration_path}"
|
155
|
+
end
|
156
|
+
end
|
157
|
+
|
158
|
+
desc 'Scaffod the java classes'
|
159
|
+
arg_name 'properties like id:integer, name:string'
|
160
|
+
command :scaffold do |c|
|
161
|
+
c.desc 'model name'
|
162
|
+
c.default_value 'model'
|
163
|
+
c.flag :n
|
164
|
+
|
165
|
+
c.desc 'generating the entity'
|
166
|
+
c.default_value true
|
167
|
+
c.switch :entity
|
168
|
+
|
169
|
+
c.desc 'generating the controller'
|
170
|
+
c.default_value false
|
171
|
+
c.switch :controller
|
172
|
+
|
173
|
+
c.desc 'generating the repository'
|
174
|
+
c.default_value false
|
175
|
+
c.switch :repository
|
176
|
+
|
177
|
+
c.action do |_, options, args|
|
178
|
+
Liquigen::Scaffold::Entity.new(options[:n], args).process if options[:entity]
|
179
|
+
Liquigen::Scaffold::Controller.new(options[:n], args).process if options[:controller]
|
180
|
+
Liquigen::Scaffold::Repository.new(options[:n], args).process if options[:repository]
|
181
|
+
end
|
182
|
+
end
|
183
|
+
|
137
184
|
pre do |global, command, options, args|
|
138
185
|
# Pre logic here
|
139
186
|
# Return true to proceed; false to abort and not call the
|
140
187
|
# chosen command
|
141
188
|
# Use skips_pre before a command to skip this block
|
142
189
|
# on that command only
|
190
|
+
Liquigen.load
|
191
|
+
|
143
192
|
true
|
144
193
|
end
|
145
194
|
|
data/lib/liquigen.rb
CHANGED
@@ -27,5 +27,54 @@ require 'liquigen/handlers/sql'
|
|
27
27
|
require 'liquigen/handlers/add_index'
|
28
28
|
require 'liquigen/handlers/drop_table'
|
29
29
|
|
30
|
+
require 'liquigen/scaffold/config'
|
31
|
+
require 'liquigen/scaffold/base'
|
32
|
+
require 'liquigen/scaffold/controller'
|
33
|
+
require 'liquigen/scaffold/entity'
|
34
|
+
require 'liquigen/scaffold/repository'
|
35
|
+
|
30
36
|
# Add requires for other files you add to your project here, so
|
31
|
-
# you just need to require this one file in your bin file
|
37
|
+
# you just need to require this one file in your bin file
|
38
|
+
|
39
|
+
module Liquigen
|
40
|
+
class << self
|
41
|
+
attr_accessor :package_name
|
42
|
+
# default value: #{package_name}.controller
|
43
|
+
attr_accessor :controller_package_name
|
44
|
+
# default value: #{package_name}.model
|
45
|
+
attr_accessor :entity_package_name
|
46
|
+
# default value: #{package_name}.repository
|
47
|
+
attr_accessor :repository_package_name
|
48
|
+
# default value: src/main/java
|
49
|
+
attr_accessor :java_codes_root
|
50
|
+
# default value: src/main/resources/db/migrations
|
51
|
+
attr_accessor :migration_path
|
52
|
+
|
53
|
+
def load_default
|
54
|
+
self.package_name ||= 'com.package'
|
55
|
+
self.controller_package_name ||= "#{package_name}.controller"
|
56
|
+
self.entity_package_name ||= "#{package_name}.model"
|
57
|
+
self.repository_package_name ||= "#{package_name}.repository"
|
58
|
+
self.java_codes_root ||= 'src/main/java'
|
59
|
+
self.migration_path ||= 'src/main/resources/db/migrations'
|
60
|
+
end
|
61
|
+
|
62
|
+
def load
|
63
|
+
load_lines File.readlines(Liquigen::Scaffold::CONFIG_FILE) if File.exist?(Liquigen::Scaffold::CONFIG_FILE)
|
64
|
+
|
65
|
+
load_default
|
66
|
+
end
|
67
|
+
|
68
|
+
def load_lines(lines)
|
69
|
+
lines.each do |line|
|
70
|
+
next if line.strip.start_with? '#'
|
71
|
+
next if line.strip.size.zero?
|
72
|
+
|
73
|
+
assignment = line.split('=')
|
74
|
+
name = "#{assignment[0]&.strip}="
|
75
|
+
|
76
|
+
Liquigen.send(name, assignment[1]&.strip) if Liquigen.singleton_methods.include?(name.to_sym)
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
@@ -48,11 +48,9 @@ module Liquigen::Handlers
|
|
48
48
|
end
|
49
49
|
|
50
50
|
def build_file_name
|
51
|
-
|
51
|
+
FileUtils.mkdir_p(Liquigen.migration_path)
|
52
52
|
|
53
|
-
|
54
|
-
|
55
|
-
"#{dir}/#{id}.yaml"
|
53
|
+
"#{Liquigen.migration_path}/#{id}.yaml"
|
56
54
|
end
|
57
55
|
|
58
56
|
def process_lines(file_path)
|
@@ -0,0 +1,61 @@
|
|
1
|
+
module Liquigen::Scaffold
|
2
|
+
class Base
|
3
|
+
attr_accessor :name
|
4
|
+
attr_accessor :props
|
5
|
+
|
6
|
+
def initialize(name, props)
|
7
|
+
self.name = name
|
8
|
+
self.props = props
|
9
|
+
end
|
10
|
+
|
11
|
+
def process
|
12
|
+
file = "#{directory}/#{file_name}"
|
13
|
+
return if File.exist? file
|
14
|
+
|
15
|
+
lines = []
|
16
|
+
lines += import_lines
|
17
|
+
lines += []
|
18
|
+
lines += class_lines
|
19
|
+
lines += []
|
20
|
+
lines += methods_lines
|
21
|
+
lines += ['}']
|
22
|
+
|
23
|
+
File.open(file, 'w') do |f|
|
24
|
+
f.write lines.join("\n")
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def current_package
|
29
|
+
Liquigen.package_name
|
30
|
+
end
|
31
|
+
|
32
|
+
def directory
|
33
|
+
"#{Liquigen.java_codes_root}/#{current_package.split('.').join('/')}"
|
34
|
+
end
|
35
|
+
|
36
|
+
def file_name
|
37
|
+
"#{name.singularize.camelize}#{file_append}.java"
|
38
|
+
end
|
39
|
+
|
40
|
+
def file_append
|
41
|
+
''
|
42
|
+
end
|
43
|
+
|
44
|
+
def write_lines(file, lines = [])
|
45
|
+
file.write lines.join("\n")
|
46
|
+
file.write("\n")
|
47
|
+
end
|
48
|
+
|
49
|
+
def import_lines
|
50
|
+
[]
|
51
|
+
end
|
52
|
+
|
53
|
+
def class_lines
|
54
|
+
[]
|
55
|
+
end
|
56
|
+
|
57
|
+
def methods_lines
|
58
|
+
[]
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module Liquigen::Scaffold
|
2
|
+
CONFIG_FILE = '.liquigen'.freeze
|
3
|
+
class Config
|
4
|
+
# write config file
|
5
|
+
def process
|
6
|
+
# if not exist the .liquigen file create it
|
7
|
+
File.write(CONFIG_FILE, prepare_default_content.join("\n")) unless File.exist?(CONFIG_FILE)
|
8
|
+
|
9
|
+
# then open the vim editor
|
10
|
+
system('vi ' + CONFIG_FILE)
|
11
|
+
end
|
12
|
+
|
13
|
+
def prepare_default_content
|
14
|
+
contents = []
|
15
|
+
contents << '# You can remove the # to set your custom value'
|
16
|
+
contents << '# package_name=your-package-name, required'
|
17
|
+
contents << '# java_codes_root=src/main/java'
|
18
|
+
contents << '# migration_path=src/main/resources/db/migrations'
|
19
|
+
contents << '# controller_package_name='
|
20
|
+
contents << '# entity_package_name='
|
21
|
+
contents << '# repository_package_name='
|
22
|
+
contents << ''
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
module Liquigen::Scaffold
|
2
|
+
class Controller < Base
|
3
|
+
def current_package
|
4
|
+
Liquigen.controller_package_name
|
5
|
+
end
|
6
|
+
|
7
|
+
def file_append
|
8
|
+
'Controller'
|
9
|
+
end
|
10
|
+
|
11
|
+
def file_name
|
12
|
+
"#{name.pluralize.camelize}#{file_append}.java"
|
13
|
+
end
|
14
|
+
|
15
|
+
def import_lines
|
16
|
+
[
|
17
|
+
"package #{current_package};",
|
18
|
+
'',
|
19
|
+
"import #{Liquigen.entity_package_name}.#{name.singularize.camelize};",
|
20
|
+
"import #{Liquigen.repository_package_name}.#{name.camelize}Repository;",
|
21
|
+
'import org.springframework.beans.factory.annotation.Autowired;',
|
22
|
+
'import org.springframework.web.bind.annotation.RequestMapping;',
|
23
|
+
'import org.springframework.web.bind.annotation.RestController;',
|
24
|
+
''
|
25
|
+
]
|
26
|
+
end
|
27
|
+
|
28
|
+
def class_lines
|
29
|
+
[
|
30
|
+
'@RestController',
|
31
|
+
"@RequestMapping(\"/#{name.underscore.pluralize}\")",
|
32
|
+
"public class #{name.pluralize.camelize}#{file_append} extends ControllerBase<#{name.singularize.camelize}, #{name.singularize.camelize}Repository> {"
|
33
|
+
]
|
34
|
+
end
|
35
|
+
|
36
|
+
def methods_lines
|
37
|
+
[
|
38
|
+
'@Autowired',
|
39
|
+
"public #{name.pluralize.camelize}#{file_append}(#{name.singularize.camelize}Repository repository) {",
|
40
|
+
'this.repository = repository;',
|
41
|
+
'}'
|
42
|
+
]
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
require 'liquigen/type_map'
|
2
|
+
|
3
|
+
module Liquigen::Scaffold
|
4
|
+
class Entity < Base
|
5
|
+
def current_package
|
6
|
+
Liquigen.entity_package_name
|
7
|
+
end
|
8
|
+
|
9
|
+
def import_lines
|
10
|
+
[
|
11
|
+
"package #{current_package};",
|
12
|
+
'import com.fasterxml.jackson.annotation.*;',
|
13
|
+
'import com.fasterxml.jackson.databind.annotation.JsonDeserialize;',
|
14
|
+
'import lombok.Getter;',
|
15
|
+
'import lombok.Setter;',
|
16
|
+
'import lombok.experimental.Accessors;',
|
17
|
+
'import javax.persistence.*;',
|
18
|
+
'import java.util.List;',
|
19
|
+
''
|
20
|
+
]
|
21
|
+
end
|
22
|
+
|
23
|
+
def class_lines
|
24
|
+
[
|
25
|
+
'@Entity',
|
26
|
+
'@Getter',
|
27
|
+
'@Setter',
|
28
|
+
'@Accessors(chain = true)',
|
29
|
+
"@Table(name = \"#{name.underscore.pluralize}\")",
|
30
|
+
"public class #{name.singularize.camelize} extends ModelBase {"
|
31
|
+
]
|
32
|
+
end
|
33
|
+
|
34
|
+
def methods_lines
|
35
|
+
lines = []
|
36
|
+
skip_ones = %w[id created_time updated_time]
|
37
|
+
props.map do |property|
|
38
|
+
key, value = property.split(':')
|
39
|
+
next if skip_ones.include?(key.underscore)
|
40
|
+
|
41
|
+
lines += [
|
42
|
+
'@Column(nullable = false)',
|
43
|
+
'@JsonProperty',
|
44
|
+
"private #{Liquigen::TypeMap.new(value).java_type} #{key.camelize};",
|
45
|
+
''
|
46
|
+
]
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module Liquigen::Scaffold
|
2
|
+
class Repository < Base
|
3
|
+
def current_package
|
4
|
+
Liquigen.repository_package_name
|
5
|
+
end
|
6
|
+
|
7
|
+
def file_append
|
8
|
+
'Repository'
|
9
|
+
end
|
10
|
+
|
11
|
+
def import_lines
|
12
|
+
[
|
13
|
+
"package #{current_package};",
|
14
|
+
"import #{Liquigen.entity_package_name}.#{name.singularize.camelize};",
|
15
|
+
'import org.springframework.stereotype.Repository;',
|
16
|
+
''
|
17
|
+
]
|
18
|
+
end
|
19
|
+
|
20
|
+
def class_lines
|
21
|
+
[
|
22
|
+
'@Repository',
|
23
|
+
"public interface #{name.singularize.camelize}#{file_append} extends IRepository<#{name.singularize.camelize}, Long> {"
|
24
|
+
]
|
25
|
+
end
|
26
|
+
|
27
|
+
def methods_lines
|
28
|
+
[]
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
data/lib/liquigen/type_map.rb
CHANGED
@@ -2,6 +2,7 @@ module Liquigen
|
|
2
2
|
class TypeMap
|
3
3
|
attr_accessor :rails_type
|
4
4
|
attr_accessor :map
|
5
|
+
attr_accessor :java_map
|
5
6
|
|
6
7
|
def set_map
|
7
8
|
# Only for mysql
|
@@ -17,6 +18,18 @@ module Liquigen
|
|
17
18
|
binary: 'blob',
|
18
19
|
boolean: 'tinyint(1)'
|
19
20
|
}
|
21
|
+
|
22
|
+
self.java_map = {
|
23
|
+
integer: 'Long',
|
24
|
+
long: 'Long',
|
25
|
+
string: 'String',
|
26
|
+
text: 'String',
|
27
|
+
float: 'Float',
|
28
|
+
decimal: 'BigDecimal',
|
29
|
+
datetime: 'Date',
|
30
|
+
binary: 'Object',
|
31
|
+
boolean: 'boolean'
|
32
|
+
}
|
20
33
|
end
|
21
34
|
|
22
35
|
def initialize(type)
|
@@ -27,5 +40,9 @@ module Liquigen
|
|
27
40
|
def db_type
|
28
41
|
map[rails_type.to_sym]
|
29
42
|
end
|
43
|
+
|
44
|
+
def java_type
|
45
|
+
java_map[rails_type.to_sym]
|
46
|
+
end
|
30
47
|
end
|
31
48
|
end
|
data/lib/liquigen/version.rb
CHANGED
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
RSpec.describe Liquigen::Scaffold::Controller, type: :model do
|
4
|
+
let(:name) { 'user' }
|
5
|
+
let(:props) { ['id:integer', 'name:string'] }
|
6
|
+
let(:package) { 'com.hongshu.io.controller' }
|
7
|
+
|
8
|
+
before do
|
9
|
+
Liquigen.java_codes_root = 'src/main/java'
|
10
|
+
allow_any_instance_of(Liquigen::Scaffold::Entity).to receive(:current_package).and_return(package)
|
11
|
+
end
|
12
|
+
|
13
|
+
let(:entity) { described_class.new name, props }
|
14
|
+
|
15
|
+
describe '#filename' do
|
16
|
+
specify { expect(entity.file_name).to eq 'UsersController.java' }
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
RSpec.describe Liquigen::Scaffold::Entity, type: :model do
|
4
|
+
let(:name) { 'user' }
|
5
|
+
let(:props) { ['id:integer', 'name:string'] }
|
6
|
+
let(:package) { 'com.hongshu.io.entity' }
|
7
|
+
|
8
|
+
before do
|
9
|
+
Liquigen.java_codes_root = 'src/main/java'
|
10
|
+
allow_any_instance_of(Liquigen::Scaffold::Entity).to receive(:current_package).and_return(package)
|
11
|
+
end
|
12
|
+
|
13
|
+
let(:entity) { described_class.new name, props }
|
14
|
+
|
15
|
+
describe '#location' do
|
16
|
+
specify { expect(entity.directory).to eq 'src/main/java/com/hongshu/io/entity' }
|
17
|
+
end
|
18
|
+
|
19
|
+
describe '#filename' do
|
20
|
+
specify { expect(entity.file_name).to eq 'User.java' }
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
RSpec.describe Liquigen::Scaffold::Repository, type: :model do
|
4
|
+
let(:name) { 'user' }
|
5
|
+
let(:props) { ['id:integer', 'name:string'] }
|
6
|
+
let(:package) { 'com.hongshu.io.repository' }
|
7
|
+
|
8
|
+
before do
|
9
|
+
Liquigen.java_codes_root = 'src/main/java'
|
10
|
+
allow_any_instance_of(Liquigen::Scaffold::Entity).to receive(:current_package).and_return(package)
|
11
|
+
end
|
12
|
+
|
13
|
+
let(:entity) { described_class.new name, props }
|
14
|
+
|
15
|
+
describe '#filename' do
|
16
|
+
specify { expect(entity.file_name).to eq 'UserRepository.java' }
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
RSpec.describe Liquigen do
|
4
|
+
describe 'module variable' do
|
5
|
+
let(:package_name) { 'com.liquigen.example' }
|
6
|
+
before { Liquigen.package_name = package_name }
|
7
|
+
specify { expect(Liquigen.package_name).to eq package_name }
|
8
|
+
end
|
9
|
+
|
10
|
+
describe '#load_lines' do
|
11
|
+
let(:lines) do
|
12
|
+
[
|
13
|
+
'package_name=com.hongshu.io',
|
14
|
+
'java_codes_root=src/main/java',
|
15
|
+
''
|
16
|
+
]
|
17
|
+
end
|
18
|
+
|
19
|
+
before { Liquigen.load_lines lines }
|
20
|
+
before { Liquigen.load_default }
|
21
|
+
specify { expect(Liquigen.package_name).to eq('com.hongshu.io') }
|
22
|
+
specify { expect(Liquigen.controller_package_name).to eq('com.hongshu.io.controller') }
|
23
|
+
specify { expect(Liquigen.java_codes_root).to eq('src/main/java') }
|
24
|
+
end
|
25
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: liquigen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Cui
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-11-
|
11
|
+
date: 2018-11-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -133,6 +133,11 @@ files:
|
|
133
133
|
- lib/liquigen/modify_data_type.rb
|
134
134
|
- lib/liquigen/rename_column.rb
|
135
135
|
- lib/liquigen/rename_table.rb
|
136
|
+
- lib/liquigen/scaffold/base.rb
|
137
|
+
- lib/liquigen/scaffold/config.rb
|
138
|
+
- lib/liquigen/scaffold/controller.rb
|
139
|
+
- lib/liquigen/scaffold/entity.rb
|
140
|
+
- lib/liquigen/scaffold/repository.rb
|
136
141
|
- lib/liquigen/sql.rb
|
137
142
|
- lib/liquigen/type_map.rb
|
138
143
|
- lib/liquigen/version.rb
|
@@ -147,6 +152,10 @@ files:
|
|
147
152
|
- spec/liquigen/handlers/rename_column_spec.rb
|
148
153
|
- spec/liquigen/handlers/rename_table_spec.rb
|
149
154
|
- spec/liquigen/handlers/sql_spec.rb
|
155
|
+
- spec/liquigen/scaffold/controller_spec.rb
|
156
|
+
- spec/liquigen/scaffold/entity_spec.rb
|
157
|
+
- spec/liquigen/scaffold/repository_spec.rb
|
158
|
+
- spec/liquigen_spec.rb
|
150
159
|
- spec/spec_helper.rb
|
151
160
|
homepage: http://github.com/jerecui/liquigen
|
152
161
|
licenses: []
|