codgen 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/.idea/codgen.iml +5 -0
- data/.idea/workspace.xml +393 -252
- data/codgen.gemspec +2 -0
- data/lib/codgen/auto_style.rb +19 -23
- data/lib/codgen/template.rb +10 -2
- data/lib/codgen/template_provider.rb +96 -0
- data/lib/codgen/version.rb +1 -1
- data/test/data/Input/{CreateDatabase.sql → CreateDatabase.sql.mustache} +0 -0
- data/test/data/Input/{DbContextTemplate.cs → DbContextTemplate.cs.mustache} +0 -0
- data/test/data/Input/{ModelTemplate.cs → ModelTemplate.cs.mustache} +0 -0
- data/test/data/Input/example-data.json +1 -1
- data/test/data/Input/explicit_names.txt +21 -0
- data/test/data/Input/i_can_ride_my_bike_with_no.handlebars +27 -0
- data/test/data/Input/{model_template.rb.ctemp → model_template.rb.mustache} +0 -0
- data/test/data/Input/static_text.txt +1 -0
- data/test/data/config.json +18 -4
- data/test/data/expected_output/explicit_names.txt +21 -0
- data/test/data/expected_output/i_can_ride_my_bike_with_no +31 -0
- data/test/data/expected_output/static_text.txt +1 -0
- metadata +38 -31
- data/test/data/Input/test_conditionals +0 -7
- data/test/data/Input/test_escapes +0 -6
- data/test/data/Output/CreateMyBlogDatabase.sql +0 -17
- data/test/data/Output/MsMvc/MyBlog/DAL/MyBlogContext.cs +0 -17
- data/test/data/Output/MsMvc/MyBlog/Models/Comment.cs +0 -14
- data/test/data/Output/MsMvc/MyBlog/Models/Post.cs +0 -17
- data/test/data/Output/Ruby/my_blog/Models/comment.rb +0 -3
- data/test/data/Output/Ruby/my_blog/Models/post.rb +0 -3
- data/test/data/Output/package_hello_world.txt +0 -1
- data/test/data/Output/package_zip_hello_world.txt +0 -1
@@ -1,17 +0,0 @@
|
|
1
|
-
Create Database MyBlog
|
2
|
-
|
3
|
-
Create Table Posts (
|
4
|
-
PostId UniqueIdentifier
|
5
|
-
, ##:!IsLastTemplateInstance?
|
6
|
-
PostTitle varchar(200)
|
7
|
-
, ##:!IsLastTemplateInstance?
|
8
|
-
PostText text
|
9
|
-
, ##:!IsLastTemplateInstance?
|
10
|
-
)
|
11
|
-
|
12
|
-
Create Table Comments (
|
13
|
-
CommentId UniqueIdentifier
|
14
|
-
, ##:!IsLastTemplateInstance?
|
15
|
-
CommentText text
|
16
|
-
, ##:!IsLastTemplateInstance?
|
17
|
-
)
|
@@ -1,17 +0,0 @@
|
|
1
|
-
using MyBlog.Models;
|
2
|
-
using System.Data.Entity;
|
3
|
-
using System.Data.Entity.ModelConfiguration.Conventions;
|
4
|
-
|
5
|
-
namespace MyBlog.DAL
|
6
|
-
{
|
7
|
-
public class MyBlogContext : DbContext
|
8
|
-
{
|
9
|
-
public DbSet<Blog> Posts { get; set; }
|
10
|
-
public DbSet<Blog> Comments { get; set; }
|
11
|
-
|
12
|
-
protected override void OnModelCreating(DbModelBuilder modelBuilder)
|
13
|
-
{
|
14
|
-
|
15
|
-
}
|
16
|
-
}
|
17
|
-
}
|
@@ -1,14 +0,0 @@
|
|
1
|
-
using System;
|
2
|
-
using System.Collections.Generic;
|
3
|
-
using System.ComponentModel.DataAnnotations.Schema;
|
4
|
-
|
5
|
-
|
6
|
-
namespace MyBlog.Models
|
7
|
-
{
|
8
|
-
public class Comment
|
9
|
-
{
|
10
|
-
public Guid CommentId { get; set; }
|
11
|
-
public string CommentText { get; set; }
|
12
|
-
Post Post { get; set; }
|
13
|
-
}
|
14
|
-
}
|
@@ -1,17 +0,0 @@
|
|
1
|
-
using System;
|
2
|
-
using System.Collections.Generic;
|
3
|
-
using System.ComponentModel.DataAnnotations.Schema;
|
4
|
-
|
5
|
-
|
6
|
-
namespace MyBlog.Models
|
7
|
-
{
|
8
|
-
public class Post
|
9
|
-
{
|
10
|
-
public Guid PostId { get; set; }
|
11
|
-
[Required]
|
12
|
-
[StringLength(200)]
|
13
|
-
public string PostTitle { get; set; }
|
14
|
-
public string PostText { get; set; }
|
15
|
-
ICollection<Comment> Comments { get; set; }
|
16
|
-
}
|
17
|
-
}
|
@@ -1 +0,0 @@
|
|
1
|
-
Hello World
|
@@ -1 +0,0 @@
|
|
1
|
-
Hello World
|