guard-annotate 2.2 → 2.3

This diff has not been reviewed by any users.
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 98a0532bcf1bd425c02936c5807b0d029ce89f4c
4
- data.tar.gz: b53058e186c29ea03dfc4ef3ea412e3386a680bc
3
+ metadata.gz: 36bebacaf5025571496eced14c294ab7c2add09d
4
+ data.tar.gz: 356a67a27ecb62c48df1832b9628e45efcadfdbf
5
5
  SHA512:
6
- metadata.gz: 547b8768f95eca595909bc2a805060cc76e10d079e40baf0ddbf1ec4e52a86251858785aed01e4527ef36f041c28df59f11044e385d5b6a95a9e0fd9c5d48f77
7
- data.tar.gz: e420e1b5fe990d54c2339f9d3a3bdef47a789df9f595b4831b389f82bb2eac332eb2ecef8867890d902b688a96b661230023da8e8ae12dbe9a660c2791ec45e3
6
+ metadata.gz: dc680e273a866a222fa56b9ff0039badf8034c180d47e6489451d0c05f76a75d1f5154e29f5187e9e4dfe703fe5e5d3883db6862c00cde6ef608530639dc54cc
7
+ data.tar.gz: 4028ddeece91c375e7da189ee02856996019292006a740ea6e042efe734443c462864c01d9c30958e157bd7faf99baf73f05a9ff3c45b570c203a47be2ad632c
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2011 Craig P Jolicoeur
1
+ Copyright (c) 2016 Craig P Jolicoeur
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
@@ -1,17 +1,24 @@
1
- = Guard::Annotate
1
+ ---
2
+
3
+ **NOTE: guard-annotate is currently looking for new maintainers. While I am still trying to accept and stay on top of new Pull Requests, I no longer personally actively use this guard plugin. If you are interested in becoming a maintainer, please contact me via email at cpjolicoeur@gmail.com**
4
+
5
+ ---
6
+
7
+ # Guard::Annotate
2
8
 
3
9
  Annotate guard runs the annotate gem when needed
4
10
 
5
11
  - Compatible with Annotate 2.4.x
6
- - Tested on Ruby 1.8.7, 1.9.x, 2.1.x
12
+ - Tested on Ruby 1.9.x, 2.0.x, 2.1.x, 2.2.x
7
13
 
8
- == Install
14
+ ## Install
9
15
 
10
16
  Install the gem:
11
17
 
12
18
  gem install guard-annotate
13
19
 
14
20
  Add the gem to your Gemfile:
21
+
15
22
  gem 'guard-annotate'
16
23
 
17
24
  Add guard definitions to your Guardfile by running:
@@ -19,13 +26,13 @@ Add guard definitions to your Guardfile by running:
19
26
  guard init annotate
20
27
 
21
28
 
22
- == Usage
29
+ ## Usage
23
30
 
24
- Please read the {Guard usage docs}[https://github.com/guard/guard#readme]
31
+ Please read the [Guard usage docs][1]
25
32
 
26
- == Guardfile
33
+ ## Guardfile
27
34
 
28
- === Standard Ruby on Rails project
35
+ ### Standard Ruby on Rails project
29
36
 
30
37
  guard 'annotate' do
31
38
  watch( 'db/schema.rb' )
@@ -35,13 +42,17 @@ Please read the {Guard usage docs}[https://github.com/guard/guard#readme]
35
42
  end
36
43
 
37
44
 
38
- == Options
45
+ ## Options
46
+
47
+ ### Desktop notifications
39
48
 
40
49
  You can disable desktop notifications with (default is notifications are enabled):
41
50
 
42
51
  guard 'annotate', :notify => false do
43
52
  ...
44
53
  end
54
+
55
+ ### Placement
45
56
 
46
57
  You can customize the placement of the annotations with (default is 'before'):
47
58
 
@@ -49,17 +60,39 @@ You can customize the placement of the annotations with (default is 'before'):
49
60
  ...
50
61
  end
51
62
 
63
+ ### Routes
64
+
52
65
  You can choose to also annotate your routes file with true, false or 'before'/'after' (default is false):
53
66
 
54
67
  guard 'annotate', :routes => 'before|after' do
55
68
  ...
56
69
  end
70
+
71
+ ### Tests Annotation
57
72
 
58
73
  You can annotate your tests and fixtures files with (default is false):
59
74
 
60
75
  guard 'annotate', :tests => true do
61
76
  ...
62
77
  end
78
+
79
+ ### Factory Exclusion
80
+
81
+ You can exclude annotations in factory files with (default is true):
82
+
83
+ guard 'annotate', :factories => false do
84
+ ...
85
+ end
86
+
87
+ ### Serializers
88
+
89
+ You can exclude annotations in serializers with (default is true):
90
+
91
+ guard 'annotate', :serializers => false do
92
+ ...
93
+ end
94
+
95
+ ### Run at start
63
96
 
64
97
  You can disable run at start with (default is true):
65
98
 
@@ -67,35 +100,56 @@ You can disable run at start with (default is true):
67
100
  ...
68
101
  end
69
102
 
103
+ ### Indexes
104
+
70
105
  You can annotate indexes on your models with (default is false):
71
106
 
72
107
  guard 'annotate', :show_indexes => true do
73
108
  ...
74
109
  end
75
110
 
111
+ ### Simple Indexes
112
+
76
113
  You can add simple indexes to the column information (default is false):
77
114
 
78
115
  guard 'annotate', :simple_indexes => true do
79
116
  ...
80
117
  end
81
118
 
119
+
120
+ ### Foreign Keys
121
+
122
+ You can show foreign keys (default is false):
123
+
124
+ guard 'annotate', :show_foreign_keys => true do
125
+ ...
126
+ end
127
+
128
+ ### Migration version number
82
129
  You can show migration version number in the annotation (default is false):
83
130
 
84
131
  guard 'annotate', :show_migration => true do
85
132
  ...
86
133
  end
87
134
 
135
+ ### Annotation Format
136
+
88
137
  You can annotate in three different formats: :bare, :rdoc and :markdown (default is :bare):
89
138
 
90
139
  guard 'annotate', :format => :rdoc do
91
140
  ...
92
141
  end
93
142
 
94
- == Development
143
+ ## Development
144
+
145
+ - Source hosed at [GitHub][2]
146
+ - Issue/Bug/Question/Feature requests via [GitHub Issues][3]
95
147
 
96
- - Source hosed at {GitHub}[https://github.com/cpjolicoeur/guard-annotate]
97
- - Issue/Bug/Question/Feature requests via {GitHub Issues}[http://github.com/cpjolicoeur/guard-annotate/issues]
148
+ ## Authors
98
149
 
99
- == Authors
150
+ [Craig P Jolicoeur][4]
100
151
 
101
- {Craig P Jolicoeur}[https://github.com/cpjolicoeur]
152
+ [1]: https://github.com/guard/guard#readme]
153
+ [2]: https://github.com/guard/guard-annotate
154
+ [3]: http://github.com/guard/guard-annotate/issues
155
+ [4]: https://github.com/cpjolicoeur
@@ -13,11 +13,14 @@ module Guard
13
13
  options[:notify] = true if options[:notify].nil?
14
14
  options[:position] = 'before' if options[:position].nil?
15
15
  options[:tests] = false if options[:tests].nil?
16
+ options[:factories] = true if options[:factories].nil?
17
+ options[:serializers] = true if options[:serializers].nil?
16
18
  options[:sort] = false if options[:sort].nil?
17
19
  options[:routes] = false if options[:routes].nil?
18
20
  options[:run_at_start] = true if options[:run_at_start].nil?
19
21
  options[:show_indexes] = false if options[:show_indexes].nil?
20
22
  options[:simple_indexes] = false if options[:simple_indexes].nil?
23
+ options[:show_foreign_keys] = false if options[:show_foreign_keys].nil?
21
24
  options[:show_migration] = false if options[:show_migration].nil?
22
25
  options[:format] = nil if options[:format].nil? or not [:bare, :markdown, :rdoc].include? options[:format].to_sym
23
26
  end
@@ -57,8 +60,13 @@ module Guard
57
60
  options[:routes]
58
61
  end
59
62
 
60
- def annotate_tests_flags
61
- options[:tests] ? '' : '--exclude tests,fixtures'
63
+ def annotate_excludes
64
+ excludes = []
65
+ excludes << 'tests' << 'fixtures' unless options[:tests]
66
+ excludes << 'factories' unless options[:factories]
67
+ excludes << 'serializers' unless options[:serializers]
68
+
69
+ excludes.empty? ? '' : "--exclude #{excludes.join(',')}"
62
70
  end
63
71
 
64
72
  def annotate_sort_columns?
@@ -84,17 +92,22 @@ module Guard
84
92
  def show_migration?
85
93
  options[:show_migration]
86
94
  end
95
+
96
+ def show_foreign_keys?
97
+ options[:show_foreign_keys]
98
+ end
87
99
 
88
100
  def run_annotate
89
101
  Compat::UI.info 'Running annotate', :reset => true
90
102
  started_at = Time.now
91
103
  annotate_models_options, annotate_options = '', ''
92
104
 
93
- annotate_models_command = "bundle exec annotate #{annotate_tests_flags} -p #{annotation_position}"
105
+ annotate_models_command = "bundle exec annotate #{annotate_excludes} -p #{annotation_position}"
94
106
  annotate_models_options += ' --sort' if annotate_sort_columns?
95
107
  annotate_models_options += ' --show-indexes' if show_indexes?
96
108
  annotate_models_options += ' --simple-indexes' if simple_indexes?
97
109
  annotate_models_options += ' --show-migration' if show_migration?
110
+ annotate_models_options += ' --show-foreign-keys' if show_foreign_keys?
98
111
  annotate_options += " --format=#{annotate_format}" if annotate_format?
99
112
 
100
113
  annotate_models_command += annotate_models_options + annotate_options
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
  module Guard
3
3
  module AnnotateVersion
4
- VERSION = '2.2'
4
+ VERSION = '2.3'
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard-annotate
3
3
  version: !ruby/object:Gem::Version
4
- version: '2.2'
4
+ version: '2.3'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Craig P Jolicoeur
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-21 00:00:00.000000000 Z
11
+ date: 2015-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: guard-compat
@@ -72,7 +72,7 @@ extensions: []
72
72
  extra_rdoc_files: []
73
73
  files:
74
74
  - LICENSE
75
- - README.rdoc
75
+ - README.md
76
76
  - lib/guard/annotate.rb
77
77
  - lib/guard/annotate/notifier.rb
78
78
  - lib/guard/annotate/templates/Guardfile
@@ -84,11 +84,10 @@ metadata: {}
84
84
  post_install_message: |-
85
85
  ** guard-annotate is looking for maintainers. While I am still trying
86
86
  to accept and stay on top of new Pull Requests, I no longer personally actively use this guard
87
- plugin. If you are interested in becoming a maintainer please contact me via GitHub Issues at
88
- https://github.com/guard/guard-annotate. **
87
+ plugin. If you are interested in becoming a maintainer please contact me via email at cpjolicoeur@gmail.com. **
89
88
  rdoc_options:
90
89
  - "--charset=UTF-8"
91
- - "--main=README.rdoc"
90
+ - "--main=README.md"
92
91
  - "--exclude='(lib|test|spec)|(Gem|Guard|Rake)file'"
93
92
  require_paths:
94
93
  - lib
@@ -104,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
104
103
  version: '0'
105
104
  requirements: []
106
105
  rubyforge_project: guard-annotate
107
- rubygems_version: 2.2.2
106
+ rubygems_version: 2.4.5.1
108
107
  signing_key:
109
108
  specification_version: 4
110
109
  summary: Guard gem for annotate