guard-annotate 1.1.0 → 2.0.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 7d24e99bd1e8658fbe1eaf6ee14e183e7e28f860
4
+ data.tar.gz: 19bb461e9c2ffd1674efe149cbddc717ffaefd32
5
+ SHA512:
6
+ metadata.gz: d1fe16beb1f12059eaf264900de497eee7696e2ab82a9a2b48f6dc51eaf0a1c7a68a7dcb5b58c6b1ef21987ce027f88d713307c165c47ef85fba3ed1bf8e6c46
7
+ data.tar.gz: d91b68c201771ab96b99b3c4ff5764572e5dbba0ff45a1d5a23b3fbc054c3ac5562d9029a190979e4aeb9736dfca2478d8bc900c3848d4cc928f28486aef2dab
data/README.rdoc CHANGED
@@ -49,9 +49,9 @@ You can customize the placement of the annotations with (default is 'before'):
49
49
  ...
50
50
  end
51
51
 
52
- You can choose to also annotate your routes file with (default is false):
52
+ You can choose to also annotate your routes file with true, false or 'before'/'after' (default is false):
53
53
 
54
- guard 'annotate', :routes => true do
54
+ guard 'annotate', :routes => 'before|after' do
55
55
  ...
56
56
  end
57
57
 
@@ -1,19 +1,20 @@
1
1
  # encoding: utf-8
2
2
  require 'guard'
3
- require 'guard/guard'
3
+ require 'guard/plugin'
4
4
  require 'guard/version'
5
5
 
6
6
  module Guard
7
- class Annotate < Guard
7
+ class Annotate < Plugin
8
8
 
9
9
  autoload :Notifier, 'guard/annotate/notifier'
10
10
 
11
- def initialize(watchers=[], options={})
11
+ def initialize(options={})
12
12
  super
13
13
 
14
14
  options[:notify] = true if options[:notify].nil?
15
15
  options[:position] = 'before' if options[:position].nil?
16
16
  options[:tests] = false if options[:tests].nil?
17
+ options[:sort] = false if options[:sort].nil?
17
18
  options[:routes] = false if options[:routes].nil?
18
19
  options[:run_at_start] = true if options[:run_at_start].nil?
19
20
  options[:show_indexes] = false if options[:show_indexes].nil?
@@ -41,7 +42,7 @@ module Guard
41
42
  def run_on_changes(paths=[])
42
43
  run_annotate
43
44
  end
44
- alias :run_on_change :run_on_changes if VERSION < '1.1.0'
45
+ alias :run_on_change :run_on_changes if Guard::AnnotateVersion::VERSION < '1.1.0'
45
46
 
46
47
  private
47
48
 
@@ -61,6 +62,10 @@ module Guard
61
62
  options[:tests] ? '' : '--exclude tests,fixtures'
62
63
  end
63
64
 
65
+ def annotate_sort_columns?
66
+ options[:sort]
67
+ end
68
+
64
69
  def show_indexes?
65
70
  options[:show_indexes]
66
71
  end
@@ -87,6 +92,7 @@ module Guard
87
92
  annotate_models_options, annotate_options = '', ''
88
93
 
89
94
  annotate_models_command = "bundle exec annotate #{annotate_tests_flags} -p #{annotation_position}"
95
+ annotate_models_options += ' --sort' if annotate_sort_columns?
90
96
  annotate_models_options += ' --show-indexes' if show_indexes?
91
97
  annotate_models_options += ' --simple-indexes' if simple_indexes?
92
98
  annotate_models_options += ' --show-migration' if show_migration?
@@ -98,7 +104,12 @@ module Guard
98
104
 
99
105
  if annotate_routes?
100
106
  started_at = Time.now
101
- annotate_routes_command = "bundle exec annotate -r -p #{annotation_position}"
107
+ position = if %w[after before].include? options[:routes].to_s
108
+ options[:routes]
109
+ else
110
+ annotation_position
111
+ end
112
+ annotate_routes_command = "bundle exec annotate -r -p #{position}"
102
113
 
103
114
  annotate_routes_command += annotate_options
104
115
  @result = system(annotate_routes_command)
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
  module Guard
3
3
  module AnnotateVersion
4
- VERSION = '1.1.0'
4
+ VERSION = '2.0.0'
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,96 +1,91 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard-annotate
3
3
  version: !ruby/object:Gem::Version
4
- prerelease:
5
- version: 1.1.0
4
+ version: 2.0.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Craig P Jolicoeur
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-04-18 00:00:00.000000000 Z
11
+ date: 2014-11-12 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
- version_requirements: !ruby/object:Gem::Requirement
14
+ name: guard
15
+ requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ! '>='
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.2.2
20
- none: false
21
- name: guard
19
+ version: '2.0'
22
20
  type: :runtime
23
21
  prerelease: false
24
- requirement: !ruby/object:Gem::Requirement
22
+ version_requirements: !ruby/object:Gem::Requirement
25
23
  requirements:
26
- - - ! '>='
24
+ - - "~>"
27
25
  - !ruby/object:Gem::Version
28
- version: 0.2.2
29
- none: false
26
+ version: '2.0'
30
27
  - !ruby/object:Gem::Dependency
31
- version_requirements: !ruby/object:Gem::Requirement
28
+ name: annotate
29
+ requirement: !ruby/object:Gem::Requirement
32
30
  requirements:
33
- - - ! '>='
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '2.4'
34
+ - - ">="
34
35
  - !ruby/object:Gem::Version
35
36
  version: 2.4.0
36
- none: false
37
- name: annotate
38
37
  type: :runtime
39
38
  prerelease: false
40
- requirement: !ruby/object:Gem::Requirement
39
+ version_requirements: !ruby/object:Gem::Requirement
41
40
  requirements:
42
- - - ! '>='
41
+ - - "~>"
42
+ - !ruby/object:Gem::Version
43
+ version: '2.4'
44
+ - - ">="
43
45
  - !ruby/object:Gem::Version
44
46
  version: 2.4.0
45
- none: false
46
47
  - !ruby/object:Gem::Dependency
47
- version_requirements: !ruby/object:Gem::Requirement
48
+ name: rspec
49
+ requirement: !ruby/object:Gem::Requirement
48
50
  requirements:
49
- - - ~>
51
+ - - "~>"
50
52
  - !ruby/object:Gem::Version
51
53
  version: 2.9.0
52
- none: false
53
- name: rspec
54
54
  type: :development
55
55
  prerelease: false
56
- requirement: !ruby/object:Gem::Requirement
56
+ version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
- - - ~>
58
+ - - "~>"
59
59
  - !ruby/object:Gem::Version
60
60
  version: 2.9.0
61
- none: false
62
61
  - !ruby/object:Gem::Dependency
63
- version_requirements: !ruby/object:Gem::Requirement
62
+ name: guard-rspec
63
+ requirement: !ruby/object:Gem::Requirement
64
64
  requirements:
65
- - - ~>
65
+ - - "~>"
66
66
  - !ruby/object:Gem::Version
67
67
  version: 0.6.0
68
- none: false
69
- name: guard-rspec
70
68
  type: :development
71
69
  prerelease: false
72
- requirement: !ruby/object:Gem::Requirement
70
+ version_requirements: !ruby/object:Gem::Requirement
73
71
  requirements:
74
- - - ~>
72
+ - - "~>"
75
73
  - !ruby/object:Gem::Version
76
74
  version: 0.6.0
77
- none: false
78
75
  - !ruby/object:Gem::Dependency
79
- version_requirements: !ruby/object:Gem::Requirement
76
+ name: rake
77
+ requirement: !ruby/object:Gem::Requirement
80
78
  requirements:
81
- - - ~>
79
+ - - "~>"
82
80
  - !ruby/object:Gem::Version
83
81
  version: 0.9.2.2
84
- none: false
85
- name: rake
86
82
  type: :development
87
83
  prerelease: false
88
- requirement: !ruby/object:Gem::Requirement
84
+ version_requirements: !ruby/object:Gem::Requirement
89
85
  requirements:
90
- - - ~>
86
+ - - "~>"
91
87
  - !ruby/object:Gem::Version
92
88
  version: 0.9.2.2
93
- none: false
94
89
  description: Guard::Annotate automatically runs the annotate gem when needed
95
90
  email:
96
91
  - cpjolicoeur@gmail.com
@@ -98,37 +93,37 @@ executables: []
98
93
  extensions: []
99
94
  extra_rdoc_files: []
100
95
  files:
96
+ - LICENSE
97
+ - README.rdoc
98
+ - lib/guard/annotate.rb
101
99
  - lib/guard/annotate/notifier.rb
102
100
  - lib/guard/annotate/templates/Guardfile
103
101
  - lib/guard/annotate/version.rb
104
- - lib/guard/annotate.rb
105
- - LICENSE
106
- - README.rdoc
107
102
  homepage: http://craigjolicoeur.com
108
- licenses: []
103
+ licenses:
104
+ - MIT
105
+ metadata: {}
109
106
  post_install_message:
110
107
  rdoc_options:
111
- - --charset=UTF-8
112
- - --main=README.rdoc
113
- - --exclude='(lib|test|spec)|(Gem|Guard|Rake)file'
108
+ - "--charset=UTF-8"
109
+ - "--main=README.rdoc"
110
+ - "--exclude='(lib|test|spec)|(Gem|Guard|Rake)file'"
114
111
  require_paths:
115
112
  - lib
116
113
  required_ruby_version: !ruby/object:Gem::Requirement
117
114
  requirements:
118
- - - ! '>='
115
+ - - ">="
119
116
  - !ruby/object:Gem::Version
120
117
  version: '0'
121
- none: false
122
118
  required_rubygems_version: !ruby/object:Gem::Requirement
123
119
  requirements:
124
- - - ! '>='
120
+ - - ">="
125
121
  - !ruby/object:Gem::Version
126
122
  version: '0'
127
- none: false
128
123
  requirements: []
129
124
  rubyforge_project: guard-annotate
130
- rubygems_version: 1.8.23
125
+ rubygems_version: 2.4.1
131
126
  signing_key:
132
- specification_version: 3
127
+ specification_version: 4
133
128
  summary: Guard gem for annotate
134
129
  test_files: []