aam 0.0.13 → 0.0.14

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 916499d13ede92b2380ca245157b0899f3ff71c32a8508461f540d07d30053b7
4
- data.tar.gz: 0b012bbe95747089e3f1f00abb7a354ef1778b5442b2dd99c3d72b8945fff6e7
3
+ metadata.gz: 4f2e237766cc4aebb981ae843b061980f73a5a19aea5e981df784a1a4fa96f7a
4
+ data.tar.gz: db1533ca813417f4cfc3066328959a6aa7e00c594211a11854c826ede9872ca2
5
5
  SHA512:
6
- metadata.gz: e682b10b803d6995da0ecd53d3cd1f2025d8043b3b264490d982f3fda80220c2f9e6186ce6e9d1304306cfb75e999a735dcb628a19d4e3c9b14740a896c7613b
7
- data.tar.gz: a74c2f74ee0d15213f111e326ff702720cad2c03f862debc7d0b3bff3946a4a9c728fed9d5474b24366e168d34895820fd8b8bf098cc980ad9bb7d25c236d398
6
+ metadata.gz: 6bc66294cb01e90c72bc2982632770d1e7e8f25e994e57e24af8490524dcb3053958ae1cd328f04ad7fb6d1b1784e4e5eb1a4535feda16efc70d0b7d0d433bdb
7
+ data.tar.gz: 17730f79a62f99ec2eebb246a505bcc9e8210a3c186440342f33455fcbf3b052f2ce41d4f78fc7d7c2775bf13d5f498492ff98ed876c6a4a4a5c300490fd6ed0
@@ -63,7 +63,7 @@ puts Aam::Generator.new(SubArticle).generate
63
63
  # >> # |------+------+---------+-------------+------+-------|
64
64
  # >> # | id | Id | integer | NOT NULL PK | | |
65
65
  # >> # | name | Name | string | | | A! |
66
- # >> # | flag | Flag | boolean | DEFAULT(f) | | |
66
+ # >> # | flag | Flag | boolean | DEFAULT(0) | | |
67
67
  # >> # |------+------+---------+-------------+------+-------|
68
68
  # >> # == Schema Information ==
69
69
  # >> #
@@ -78,10 +78,10 @@ puts Aam::Generator.new(SubArticle).generate
78
78
  # >> # | foo_id | Foo | integer | | => (foo_type)#id | |
79
79
  # >> # |----------+----------+---------+-------------+----------------------------+-------|
80
80
  # >> #
81
- # >> #- Remarks ----------------------------------------------------------------------
81
+ # >> # - Remarks ----------------------------------------------------------------------
82
82
  # >> # User.has_many :articles
83
83
  # >> # [Warning: Need to add index] create_articles マイグレーションに add_index :articles, [:foo_id, :foo_type] を追加してください
84
- # >> #--------------------------------------------------------------------------------
84
+ # >> # --------------------------------------------------------------------------------
85
85
  # >> # == Schema Information ==
86
86
  # >> #
87
87
  # >> # Blog (blogs as Blog)
@@ -105,8 +105,8 @@ puts Aam::Generator.new(SubArticle).generate
105
105
  # >> # | foo_id | Foo | integer | | :blog => Blog#id と => (foo_type)#id | |
106
106
  # >> # |----------+----------+---------+-------------+--------------------------------------+-------|
107
107
  # >> #
108
- # >> #- Remarks ----------------------------------------------------------------------
108
+ # >> # - Remarks ----------------------------------------------------------------------
109
109
  # >> # Blog.has_many :sub_articles, foreign_key: :foo_id
110
110
  # >> # User.has_many :articles
111
111
  # >> # [Warning: Need to add index] create_articles マイグレーションに add_index :articles, [:foo_id, :foo_type] を追加してください
112
- # >> #--------------------------------------------------------------------------------
112
+ # >> # --------------------------------------------------------------------------------
@@ -122,7 +122,7 @@ module Aam
122
122
  if body.match(regexp)
123
123
  body = body.sub(regexp, schema_info)
124
124
  elsif body.include?(MAGIC_COMMENT_LINE)
125
- body = body.sub(/#{Regexp.escape(MAGIC_COMMENT_LINE)}\s*/) {MAGIC_COMMENT_LINE + schema_info}
125
+ body = body.sub(/#{Regexp.escape(MAGIC_COMMENT_LINE)}\s*/) { MAGIC_COMMENT_LINE + "\n" + schema_info }
126
126
  else
127
127
  body = body.sub(/^\s*/, schema_info)
128
128
  end
data/lib/aam/generator.rb CHANGED
@@ -34,9 +34,9 @@ module Aam
34
34
  out << rows.to_t.lines.collect { |e| "# #{e}" }.join
35
35
  if @memos.present?
36
36
  out << "#\n"
37
- out << "# - Remarks ---------------------------------------------------------------------\n"
37
+ out << "# - Remarks ----------------------------------------------------------------------\n"
38
38
  out << @memos.sort.collect { |row| "# #{row}\n" }.join
39
- out << "# -------------------------------------------------------------------------------\n"
39
+ out << "# --------------------------------------------------------------------------------\n"
40
40
  end
41
41
  out.join
42
42
  end
data/lib/aam/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Aam
2
- VERSION = "0.0.13"
2
+ VERSION = "0.0.14"
3
3
  end
data/test/test_aam.rb CHANGED
@@ -76,11 +76,11 @@ EOT
76
76
  # | xxx_id | Xxx | integer | | => (xxx_type)#id | |
77
77
  # |----------+----------+---------+-------------+----------------------------+-------|
78
78
  #
79
- #- Remarks ----------------------------------------------------------------------
79
+ # - Remarks ----------------------------------------------------------------------
80
80
  # User.has_many :articles
81
81
  # [Warning: Need to add index] create_articles マイグレーションに add_index :articles, :user_id を追加してください
82
82
  # [Warning: Need to add index] create_articles マイグレーションに add_index :articles, [:xxx_id, :xxx_type] を追加してください
83
- #--------------------------------------------------------------------------------
83
+ # --------------------------------------------------------------------------------
84
84
  EOT
85
85
  Aam::Generator.new(SubArticle).generate == <<-EOT.strip_heredoc
86
86
  # == Schema Information ==
@@ -96,10 +96,10 @@ EOT
96
96
  # | xxx_id | Xxx | integer | | :blog => Blog#id と => (xxx_type)#id | |
97
97
  # |----------+----------+---------+-------------+--------------------------------------+-------|
98
98
  #
99
- #- 備考 -------------------------------------------------------------------------
99
+ # - 備考 -------------------------------------------------------------------------
100
100
  # ・[Warning: Need to add index] create_articles マイグレーションに add_index :articles, :user_id を追加してください
101
101
  # ・[Warning: Need to add index] create_articles マイグレーションに add_index :articles, [:xxx_id, :xxx_type] を追加してください
102
- #--------------------------------------------------------------------------------
102
+ # --------------------------------------------------------------------------------
103
103
  EOT
104
104
  end
105
105
 
@@ -136,12 +136,12 @@ EOT
136
136
  # | xxx_id | Xxx | integer | | | |
137
137
  # |----------+----------+---------+-------------+------+-------|
138
138
  #
139
- #- Remarks ----------------------------------------------------------------------
139
+ # - Remarks ----------------------------------------------------------------------
140
140
  # [Warning: Need to add index] create_foos マイグレーションに add_index :foos, :user_id を追加してください
141
141
  # [Warning: Need to add index] create_foos マイグレーションに add_index :foos, [:xxx_id, :xxx_type] を追加してください
142
142
  # [Warning: Need to add relation] Foo モデルに belongs_to :user を追加してください
143
143
  # [Warning: Need to add relation] Foo モデルに belongs_to :xxx, polymorphic: true を追加してください
144
- #--------------------------------------------------------------------------------
144
+ # --------------------------------------------------------------------------------
145
145
  EOT
146
146
  end
147
147
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aam
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.13
4
+ version: 0.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - akicho8