annotate_gem 0.0.11 → 0.0.12
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 +4 -4
- data/.gitignore +0 -1
- data/.travis.yml +9 -5
- data/Gemfile +4 -1
- data/Gemfile.lock +37 -0
- data/README.md +16 -1
- data/lib/annotate_gem/gemfile.rb +3 -2
- data/lib/annotate_gem/version.rb +1 -1
- data/test/annotate_gem/cli_test.rb +1 -1
- data/test/annotate_gem/gemfile_test.rb +10 -0
- data/test/fixtures/Gemfile +11 -0
- data/test/fixtures/Gemfile_annotated +17 -4
- data/test/test_helper.rb +2 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 221ee1efe615b9d08342f4bebda6f9291b43a367
|
4
|
+
data.tar.gz: c836a268b5f2b66f24d8223f985e52b1dfa922d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9d942ff8449bb8cb7f0b9c62fd90080055c6804126e698536188bfe8d04e78de5af12f9da648302bcc613718e16735d217d3c25ccae6b615b3b7d6b312d7321b
|
7
|
+
data.tar.gz: d6ed4a336f2fdf8fbac4c54e41a4fcb829fc53c6d2b85f6ce299aa603090483096bb56306b178c513c3c644583632748182e0be809196ab9fa313810e76b6529
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
@@ -1,14 +1,18 @@
|
|
1
1
|
language: ruby
|
2
|
-
before_install:
|
2
|
+
before_install:
|
3
|
+
- find /home/travis/.rvm/rubies -wholename '*default/bundler-*.gemspec' -delete
|
4
|
+
- gem install bundler -v $BUNDLER_VERSION
|
3
5
|
install: bundle _${BUNDLER_VERSION}_ install --jobs=3 --retry=3
|
4
6
|
script: bundle _${BUNDLER_VERSION}_ exec rake test
|
5
7
|
matrix:
|
6
8
|
include:
|
9
|
+
- rvm: 2.5
|
10
|
+
env: BUNDLER_VERSION=1.16.1
|
11
|
+
- rvm: 2.4
|
12
|
+
env: BUNDLER_VERSION=1.16.1
|
7
13
|
- rvm: 2.2
|
8
14
|
env: BUNDLER_VERSION=1.12.1
|
9
15
|
- rvm: 2.2
|
10
|
-
env: BUNDLER_VERSION=1.5.3
|
11
|
-
- rvm: 1.9
|
12
16
|
env: BUNDLER_VERSION=1.12.1
|
13
|
-
- rvm:
|
14
|
-
env: BUNDLER_VERSION=1.
|
17
|
+
- rvm: 2.0
|
18
|
+
env: BUNDLER_VERSION=1.12.1
|
data/Gemfile
CHANGED
@@ -1,7 +1,10 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
2
|
|
3
|
-
# Specify your gem's dependencies in
|
3
|
+
# Specify your gem's dependencies in annotate_gem.gemspec
|
4
4
|
gemspec
|
5
5
|
|
6
|
+
# Fast debugging with Pry. (https://github.com/deivid-rodriguez/pry-byebug)
|
7
|
+
gem "pry-byebug", :platforms => "ruby_22"
|
8
|
+
|
6
9
|
# An IRB alternative and runtime developer console (http://pryrepl.org)
|
7
10
|
gem "pry"
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
annotate_gem (0.0.11)
|
5
|
+
bundler (~> 1.1)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
byebug (10.0.2)
|
11
|
+
coderay (1.1.2)
|
12
|
+
metaclass (0.0.4)
|
13
|
+
method_source (0.9.0)
|
14
|
+
minitest (5.11.3)
|
15
|
+
mocha (1.5.0)
|
16
|
+
metaclass (~> 0.0.1)
|
17
|
+
pry (0.11.3)
|
18
|
+
coderay (~> 1.1.0)
|
19
|
+
method_source (~> 0.9.0)
|
20
|
+
pry-byebug (3.6.0)
|
21
|
+
byebug (~> 10.0)
|
22
|
+
pry (~> 0.10)
|
23
|
+
rake (10.5.0)
|
24
|
+
|
25
|
+
PLATFORMS
|
26
|
+
ruby
|
27
|
+
|
28
|
+
DEPENDENCIES
|
29
|
+
annotate_gem!
|
30
|
+
minitest (~> 5.0)
|
31
|
+
mocha (~> 1.1)
|
32
|
+
pry
|
33
|
+
pry-byebug
|
34
|
+
rake (~> 10.0)
|
35
|
+
|
36
|
+
BUNDLED WITH
|
37
|
+
1.16.1
|
data/README.md
CHANGED
@@ -47,7 +47,22 @@ source 'https://rubygems.org'
|
|
47
47
|
gem "pry"
|
48
48
|
```
|
49
49
|
|
50
|
-
`annotate-gem` has several options
|
50
|
+
`annotate-gem` has several options:
|
51
|
+
|
52
|
+
```
|
53
|
+
$ annotate_gem --help
|
54
|
+
Add comments to your Gemfile with each dependency's description.
|
55
|
+
Usage: annotate_gem [options]
|
56
|
+
annotate_gem [gem name]
|
57
|
+
--website-only Only output the website
|
58
|
+
--description-only Only output the description
|
59
|
+
--new-comments-only Only add a comment to gemfile if there isn't a comment already (for non-inline comments)
|
60
|
+
--inline Inline the comment
|
61
|
+
-h, --help Show this message
|
62
|
+
-v, --version Show version
|
63
|
+
```
|
64
|
+
|
65
|
+
`annotate-gem` also works with specifying a single gem name:
|
51
66
|
|
52
67
|
```
|
53
68
|
$ annotate-gem aasm
|
data/lib/annotate_gem/gemfile.rb
CHANGED
@@ -13,9 +13,10 @@ module AnnotateGem
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def parse
|
16
|
-
self.source = File.readlines(gemfile_path)
|
16
|
+
self.source = File.readlines(gemfile_path, :encoding => 'UTF-8')
|
17
17
|
source.each_with_index do |line, i|
|
18
|
-
|
18
|
+
match = GEM_LINE_REGEX.match(line)
|
19
|
+
if match
|
19
20
|
prev_line = source[i - 1] if i > 0
|
20
21
|
prev_line_comment = prev_line if is_line_a_comment?(prev_line)
|
21
22
|
self.gem_lines << GemLine.new(
|
data/lib/annotate_gem/version.rb
CHANGED
@@ -6,7 +6,7 @@ class AnnotateGem::CLITest < Minitest::Test
|
|
6
6
|
|
7
7
|
def test_run_for_gemfile
|
8
8
|
with_gemfile(File.read(gemfile_path)) do |path|
|
9
|
-
Bundler.expects(:default_gemfile).returns(path)
|
9
|
+
Bundler.expects(:default_gemfile).returns(Pathname.new(path)).at_least_once
|
10
10
|
out, _ = capture_io do
|
11
11
|
AnnotateGem::CLI.new.run_for_gemfile
|
12
12
|
end
|
@@ -36,6 +36,16 @@ class AnnotateGem::GemfileTest < Minitest::Test
|
|
36
36
|
assert_equal 2, gemfile.gem_lines.length
|
37
37
|
end
|
38
38
|
|
39
|
+
def test_parses_non_ascii_symbols
|
40
|
+
gemfile_content=unindent(<<-GEMFILE)
|
41
|
+
# Non ASCII 鋸 набор סמלים
|
42
|
+
GEMFILE
|
43
|
+
|
44
|
+
gemfile = gemfile_for(gemfile_content.force_encoding('ASCII'))
|
45
|
+
|
46
|
+
assert_equal 0, gemfile.gem_lines.length
|
47
|
+
end
|
48
|
+
|
39
49
|
def test_write_comments
|
40
50
|
with_gemfile("gem 'rails'") do |path|
|
41
51
|
gemfile = AnnotateGem::Gemfile.new(path)
|
data/test/fixtures/Gemfile
CHANGED
@@ -23,9 +23,20 @@ gem 'sdoc', '~> 0.4.0', group: :doc
|
|
23
23
|
# Use Capistrano for deployment
|
24
24
|
# gem 'capistrano-rails', group: :development
|
25
25
|
|
26
|
+
# Non ASCII 鋸 набор סמלים
|
27
|
+
|
28
|
+
gem 'nokogiri', '1.8.2'
|
29
|
+
|
26
30
|
group :development, :test do
|
27
31
|
gem 'byebug'
|
28
32
|
gem 'web-console', '~> 2.0'
|
29
33
|
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
|
30
34
|
gem 'spring'
|
31
35
|
end
|
36
|
+
|
37
|
+
# test ruby code in Gemfile
|
38
|
+
if ENV['wisper']
|
39
|
+
gem 'wisper-activejob',
|
40
|
+
git: 'https://github.com/cambridgebrainsciences/wisper-activejob.git',
|
41
|
+
branch: 'rails5'
|
42
|
+
end
|
@@ -13,14 +13,14 @@ gem 'coffee-rails', '~> 4.1.0'
|
|
13
13
|
# See https://github.com/rails/execjs#readme for more supported runtimes
|
14
14
|
# gem 'therubyracer', platforms: :ruby
|
15
15
|
|
16
|
-
# Use jQuery with Rails 4+ (
|
16
|
+
# Use jQuery with Rails 4+ (https://github.com/rails/jquery-rails)
|
17
17
|
gem 'jquery-rails'
|
18
|
-
# Turbolinks makes navigating your web application faster (https://github.com/turbolinks/turbolinks
|
18
|
+
# Turbolinks makes navigating your web application faster (https://github.com/turbolinks/turbolinks)
|
19
19
|
gem 'turbolinks'
|
20
20
|
# Create JSON structures via a Builder-style DSL (https://github.com/rails/jbuilder)
|
21
21
|
gem 'jbuilder', '~> 2.0'
|
22
22
|
# bundle exec rake doc:rails generates the API under doc/api.
|
23
|
-
# rdoc html with javascript search index. (
|
23
|
+
# rdoc html with javascript search index. (https://github.com/zzak/sdoc)
|
24
24
|
gem 'sdoc', '~> 0.4.0', group: :doc
|
25
25
|
|
26
26
|
# Use ActiveModel has_secure_password
|
@@ -32,8 +32,13 @@ gem 'sdoc', '~> 0.4.0', group: :doc
|
|
32
32
|
# Use Capistrano for deployment
|
33
33
|
# gem 'capistrano-rails', group: :development
|
34
34
|
|
35
|
+
# Non ASCII 鋸 набор סמלים
|
36
|
+
|
37
|
+
# Nokogiri (鋸) is an HTML, XML, SAX, and Reader parser (http://nokogiri.org)
|
38
|
+
gem 'nokogiri', '1.8.2'
|
39
|
+
|
35
40
|
group :development, :test do
|
36
|
-
# Ruby
|
41
|
+
# Ruby fast debugger - base + CLI (http://github.com/deivid-rodriguez/byebug)
|
37
42
|
gem 'byebug'
|
38
43
|
# A debugging tool for your Ruby on Rails applications. (https://github.com/rails/web-console)
|
39
44
|
gem 'web-console', '~> 2.0'
|
@@ -41,3 +46,11 @@ group :development, :test do
|
|
41
46
|
# Rails application preloader (https://github.com/rails/spring)
|
42
47
|
gem 'spring'
|
43
48
|
end
|
49
|
+
|
50
|
+
# test ruby code in Gemfile
|
51
|
+
if ENV['wisper']
|
52
|
+
# Provides Wisper with asynchronous event publishing using ActiveJob (https://github.com/krisleech/wisper-activejob)
|
53
|
+
gem 'wisper-activejob',
|
54
|
+
git: 'https://github.com/cambridgebrainsciences/wisper-activejob.git',
|
55
|
+
branch: 'rails5'
|
56
|
+
end
|
data/test/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: annotate_gem
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ivan Tse
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-05-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -79,6 +79,7 @@ files:
|
|
79
79
|
- ".gitignore"
|
80
80
|
- ".travis.yml"
|
81
81
|
- Gemfile
|
82
|
+
- Gemfile.lock
|
82
83
|
- LICENSE.txt
|
83
84
|
- README.md
|
84
85
|
- Rakefile
|
@@ -119,7 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
119
120
|
version: '0'
|
120
121
|
requirements: []
|
121
122
|
rubyforge_project:
|
122
|
-
rubygems_version: 2.
|
123
|
+
rubygems_version: 2.5.1
|
123
124
|
signing_key:
|
124
125
|
specification_version: 4
|
125
126
|
summary: Add comments to your Gemfile with each dependency's description.
|