codgen 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -0
  3. data/.idea/codgen.iml +5 -0
  4. data/.idea/workspace.xml +393 -252
  5. data/codgen.gemspec +2 -0
  6. data/lib/codgen/auto_style.rb +19 -23
  7. data/lib/codgen/template.rb +10 -2
  8. data/lib/codgen/template_provider.rb +96 -0
  9. data/lib/codgen/version.rb +1 -1
  10. data/test/data/Input/{CreateDatabase.sql → CreateDatabase.sql.mustache} +0 -0
  11. data/test/data/Input/{DbContextTemplate.cs → DbContextTemplate.cs.mustache} +0 -0
  12. data/test/data/Input/{ModelTemplate.cs → ModelTemplate.cs.mustache} +0 -0
  13. data/test/data/Input/example-data.json +1 -1
  14. data/test/data/Input/explicit_names.txt +21 -0
  15. data/test/data/Input/i_can_ride_my_bike_with_no.handlebars +27 -0
  16. data/test/data/Input/{model_template.rb.ctemp → model_template.rb.mustache} +0 -0
  17. data/test/data/Input/static_text.txt +1 -0
  18. data/test/data/config.json +18 -4
  19. data/test/data/expected_output/explicit_names.txt +21 -0
  20. data/test/data/expected_output/i_can_ride_my_bike_with_no +31 -0
  21. data/test/data/expected_output/static_text.txt +1 -0
  22. metadata +38 -31
  23. data/test/data/Input/test_conditionals +0 -7
  24. data/test/data/Input/test_escapes +0 -6
  25. data/test/data/Output/CreateMyBlogDatabase.sql +0 -17
  26. data/test/data/Output/MsMvc/MyBlog/DAL/MyBlogContext.cs +0 -17
  27. data/test/data/Output/MsMvc/MyBlog/Models/Comment.cs +0 -14
  28. data/test/data/Output/MsMvc/MyBlog/Models/Post.cs +0 -17
  29. data/test/data/Output/Ruby/my_blog/Models/comment.rb +0 -3
  30. data/test/data/Output/Ruby/my_blog/Models/post.rb +0 -3
  31. data/test/data/Output/package_hello_world.txt +0 -1
  32. data/test/data/Output/package_zip_hello_world.txt +0 -1
@@ -1,7 +0,0 @@
1
- <<< if a & b | c >>>
2
- if
3
- <<< elseif a & !b | c >>>
4
- elseif
5
- <<< else >>>
6
- else
7
- <<< endif >>>
@@ -1,6 +0,0 @@
1
- `{`{handleBarsVar`}`}
2
-
3
- ````
4
- ``{
5
- ```{
6
- ``{{codgenVar}}
@@ -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,3 +0,0 @@
1
- class Comment < ActiveRecord::Base
2
- belongs_to posts
3
- end
@@ -1,3 +0,0 @@
1
- class Post < ActiveRecord::Base
2
- has_many comments
3
- end
@@ -1 +0,0 @@
1
- Hello World
@@ -1 +0,0 @@
1
- Hello World