guard-annotate_gem 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 3e18304b59c1c57f9d8480ed57a40719a335e223
4
+ data.tar.gz: 2112ed9b27d4b3c1fd116e7c0aafa9611f1b9f5c
5
+ SHA512:
6
+ metadata.gz: 0d33c4ce73d575ee167840b4965e3d5d2d2ee82ce21c28956cf033309161d840e4f68f3991f1333fda76168e4ba5ba450df32ee689fd2733c619456b98f490db
7
+ data.tar.gz: 9de70696578168a421b16d960f9d7b0f46453366c8fc08a0e63eb7b110044c20336cc3dd1335a716de43e0a4ed68544c13dd757638e45bc4b62c9244bef6899f
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in guard-annotate_gem.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 Daniel Marchlík
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,57 @@
1
+ # Guard::AnnotateGem
2
+ Guard plugin for [annotate_gem](https://github.com/ivantsepp/annotate_gem) gem.
3
+ Guard::AnnotateGem automatically annotate your gems on update.
4
+
5
+ ## Installation
6
+
7
+ Please ensure you have [Guard](http://github.com/guard/guard) installed before you continue.
8
+
9
+ Add the following to your application's Gemfile:
10
+ ```ruby
11
+ group :development do
12
+ gem 'guard-annotate_gem', require: false
13
+ end
14
+ ```
15
+
16
+ And then execute:
17
+ ```
18
+ $ bundle
19
+ ```
20
+
21
+ Add Guard::AnnotateGem to your Guardfile by running:
22
+ ```
23
+ $ guard init annotate_gem
24
+ ```
25
+
26
+ Alternatively, install it without bundler:
27
+ ```
28
+ $ gem install guard-annotate_gem
29
+ ```
30
+
31
+ ## Usage
32
+
33
+ Please refer to the [Guard usage doc](http://github.com/guard/guard#readme)
34
+
35
+ ## Example Guardfile
36
+
37
+ ```ruby
38
+ guard 'annotate_gem', inline: true do
39
+ watch('Gemfile.lock')
40
+ end
41
+ ```
42
+
43
+ ## Options
44
+
45
+ ### List of available options
46
+
47
+ ```ruby
48
+ inline: true # put comments inline, instead of an above the gem line
49
+ ```
50
+
51
+ ## Contributing
52
+
53
+ 1. Fork it ( https://github.com/unodor/guard-annotate_gem/fork )
54
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
55
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
56
+ 4. Push to the branch (`git push origin my-new-feature`)
57
+ 5. Create a new Pull Request
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+ task :default => :spec
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "guard/annotate_gem"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,27 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'guard/annotate_gem/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'guard-annotate_gem'
8
+ spec.version = Guard::AnnotateGemVersion::VERSION
9
+ spec.authors = ['Daniel Marchlik']
10
+ spec.email = ['marchlik@unodor.cz']
11
+ spec.homepage = 'https://github.com/unodor/guard-annotate_gem'
12
+ spec.summary = 'Guard plugin for annotate_gem'
13
+ spec.description = 'Guard::AnnotateGem automatically annotate your gems on update.'
14
+ spec.license = 'MIT'
15
+
16
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+
19
+ spec.require_paths = ['lib']
20
+
21
+ spec.add_dependency 'guard', '~> 2.0'
22
+ spec.add_dependency 'guard-compat', '~> 1.1'
23
+ spec.add_dependency 'annotate_gem', '~> 0.0.8'
24
+
25
+ spec.add_development_dependency 'bundler', '~> 1.11'
26
+ spec.add_development_dependency 'rake', '~> 10.0'
27
+ end
@@ -0,0 +1,42 @@
1
+ require 'guard/compat/plugin'
2
+
3
+ module Guard
4
+ class AnnotateGem < Plugin
5
+ def run_on_modifications(paths)
6
+ annotate
7
+ end
8
+
9
+ def inline?
10
+ options[:inline] == true
11
+ end
12
+
13
+ private
14
+
15
+ def annotate
16
+ result = annotate_gem
17
+ case result
18
+ when :gems_annotated
19
+ Guard::Compat::UI.info 'Gems annotated', reset: true
20
+ else
21
+ Guard::Compat::UI.info "Gems can't be annotated -- Please check manually", reset: true
22
+ end
23
+
24
+ result
25
+ end
26
+
27
+ def annotate_gem
28
+ Guard::Compat::UI.info 'Annotating gems...', reset: true
29
+ ::Bundler.with_clean_env do
30
+ system("bundle exec annotate_gem #{options_flags}")
31
+ end
32
+ $CHILD_STATUS == 0 ? :gems_annotated : false
33
+ end
34
+
35
+ def options_flags
36
+ output = ''
37
+ output += ' --inline' if inline?
38
+
39
+ output
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,3 @@
1
+ guard 'annotate_gem', inline: true do
2
+ watch('Gemfile.lock')
3
+ end
@@ -0,0 +1,5 @@
1
+ module Guard
2
+ module AnnotateGemVersion
3
+ VERSION = '0.1.0'.freeze
4
+ end
5
+ end
metadata ADDED
@@ -0,0 +1,128 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: guard-annotate_gem
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Daniel Marchlik
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-05-20 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: guard
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '2.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '2.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: guard-compat
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.1'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.1'
41
+ - !ruby/object:Gem::Dependency
42
+ name: annotate_gem
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 0.0.8
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 0.0.8
55
+ - !ruby/object:Gem::Dependency
56
+ name: bundler
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '1.11'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '1.11'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rake
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '10.0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '10.0'
83
+ description: Guard::AnnotateGem automatically annotate your gems on update.
84
+ email:
85
+ - marchlik@unodor.cz
86
+ executables:
87
+ - console
88
+ - setup
89
+ extensions: []
90
+ extra_rdoc_files: []
91
+ files:
92
+ - ".gitignore"
93
+ - Gemfile
94
+ - LICENSE
95
+ - README.md
96
+ - Rakefile
97
+ - bin/console
98
+ - bin/setup
99
+ - guard-annotate_gem.gemspec
100
+ - lib/guard/annotate_gem.rb
101
+ - lib/guard/annotate_gem/templates/Guardfile
102
+ - lib/guard/annotate_gem/version.rb
103
+ homepage: https://github.com/unodor/guard-annotate_gem
104
+ licenses:
105
+ - MIT
106
+ metadata: {}
107
+ post_install_message:
108
+ rdoc_options: []
109
+ require_paths:
110
+ - lib
111
+ required_ruby_version: !ruby/object:Gem::Requirement
112
+ requirements:
113
+ - - ">="
114
+ - !ruby/object:Gem::Version
115
+ version: '0'
116
+ required_rubygems_version: !ruby/object:Gem::Requirement
117
+ requirements:
118
+ - - ">="
119
+ - !ruby/object:Gem::Version
120
+ version: '0'
121
+ requirements: []
122
+ rubyforge_project:
123
+ rubygems_version: 2.5.1
124
+ signing_key:
125
+ specification_version: 4
126
+ summary: Guard plugin for annotate_gem
127
+ test_files: []
128
+ has_rdoc: