bundler-verbose 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 684fdcb7d9c09c0a70bbfe50956f4c1bbef67d60
4
+ data.tar.gz: e1c979f8bb51b55661e4d8e9167c45152b65ed80
5
+ SHA512:
6
+ metadata.gz: 6188f29f4c1bea8976700caf26487c0e2acc5d146fcad5c84822894c31b9de923bf5836eb744347d3804126a533e83194b455b802423178d6fc9783a06589ee9
7
+ data.tar.gz: dee139a03eb40ba426883a42717ea3a0b4cb3c49458528c57f866ae7186793c904030231b841f1d3f1c061bc23bc9553cde901ee18799fd36c61ede36c56ffce
data/.gitignore ADDED
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.gem
11
+
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
data/.travis.yml ADDED
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.2.3
4
+ before_install: gem install bundler -v 1.10.6
@@ -0,0 +1,13 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4
+
5
+ We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
6
+
7
+ Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
8
+
9
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
10
+
11
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
12
+
13
+ This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in bundler-verbose.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Nikolay Bienko
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
13
+ all 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
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,31 @@
1
+ # Bundler::Verbose
2
+
3
+ Simple plugin for Bundler to generate verbose Gemfile with description of each gem. It may be useful for novice Ruby developers or when you start diving into new Ruby project.
4
+
5
+ ## Installation and usage
6
+
7
+ Install gem:
8
+
9
+ $ gem install bundler-verbose
10
+
11
+ Alternately, add it to Gemfile:
12
+
13
+ ```ruby
14
+ gem 'bundler-verbose'
15
+ ```
16
+
17
+ And then execute command in your project directory:
18
+
19
+ $ bundle verbose
20
+
21
+ The generated Gemfile.verbose you can add to your VCS and check it out when you forget what some of your gems is doing.
22
+
23
+ ## Contributing
24
+
25
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/bundler-verbose. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
26
+
27
+
28
+ ## License
29
+
30
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
31
+
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'bundler/verbose'
4
+
5
+ Bundler::Verbose.verbose
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "bundler/verbose"
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
data/bin/setup ADDED
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,26 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'bundler/verbose/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "bundler-verbose"
8
+ spec.version = Bundler::Verbose::VERSION
9
+ spec.authors = ["Nikolay Bienko"]
10
+ spec.email = ["bikolya@gmail.com"]
11
+
12
+ spec.summary = %q{Simple plugin for Bundler to generate verbose Gemfile with descriptions}
13
+ spec.description = %q{Simple plugin for Bundler to generate verbose Gemfile with description of each gem. It may be useful for novice Ruby developers or when you start diving into the new Ruby project.}
14
+ spec.homepage = "http://github.com/bikolya/bundler-verbose"
15
+ spec.license = "MIT"
16
+
17
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(spec)/}) }
18
+ spec.bindir = "bin"
19
+ spec.executables = ["bundler-verbose"]
20
+ spec.require_paths = ["lib"]
21
+
22
+ spec.add_development_dependency "bundler", "~> 1.10"
23
+ spec.add_development_dependency "rake", "~> 10.0"
24
+ spec.add_development_dependency "rspec", "~> 3.0"
25
+ spec.add_development_dependency "pry"
26
+ end
@@ -0,0 +1,18 @@
1
+ require "bundler/verbose/version"
2
+ require "bundler/verbose/gemfile_parser"
3
+ require "bundler/verbose/gem_info"
4
+ require "bundler/verbose/gemfile_line"
5
+
6
+ module Bundler
7
+ module Verbose
8
+ def self.verbose(gemfile = "Gemfile")
9
+ lines = GemfileParser.get_lines(gemfile)
10
+
11
+ File.open(gemfile + ".verbose", "w") do |f|
12
+ f.puts lines
13
+ end
14
+
15
+ puts "Gemfile.verbose was successfully generated!"
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,28 @@
1
+ require "bundler/verbose/gem_null_specification"
2
+
3
+ module Bundler
4
+ module Verbose
5
+ class GemInfo < SimpleDelegator
6
+ def initialize(name)
7
+ super(get_specification(name))
8
+ end
9
+
10
+ def info
11
+ [description, summary, ""].find { |s| !s.nil? }
12
+ end
13
+
14
+ def prettify(spaces)
15
+ return if info.empty?
16
+ info.split("\n").map { |line| "#{spaces}# #{line}" }.join("\n") + "\n"
17
+ end
18
+
19
+ private
20
+
21
+ def get_specification(name)
22
+ Gem::Specification.find_all_by_name(name.to_s).first || Gem::NullSpecification.new
23
+ rescue Gem::LoadError
24
+ Gem::NullSpecification.new
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,13 @@
1
+ module Bundler
2
+ module Verbose
3
+ class Gem::NullSpecification
4
+ def description
5
+ ""
6
+ end
7
+
8
+ def summary
9
+ ""
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,41 @@
1
+ module Bundler
2
+ module Verbose
3
+ class GemfileLine
4
+ GEM_NAME_REGEX = /\Agem[\s]*["'](.*?)["']/
5
+
6
+ attr_accessor :raw
7
+
8
+ def initialize(line)
9
+ @raw = line.rstrip
10
+ end
11
+
12
+ def to_s
13
+ verbosed
14
+ end
15
+
16
+ def name
17
+ @name ||= get_name
18
+ end
19
+
20
+ def info
21
+ @info ||= GemInfo.new(name)
22
+ end
23
+
24
+ def verbosed
25
+ [raw, info.prettify(spaces_at_beginning)].compact.join("\n") + "\n"
26
+ end
27
+
28
+ private
29
+
30
+ def spaces_at_beginning
31
+ raw[/\A */]
32
+ end
33
+
34
+ def get_name
35
+ match = raw.lstrip.match(GEM_NAME_REGEX)
36
+ match && match[1]
37
+ end
38
+ end
39
+ end
40
+ end
41
+
@@ -0,0 +1,11 @@
1
+ module Bundler
2
+ module Verbose
3
+ class GemfileParser
4
+ def self.get_lines(path)
5
+ File.readlines(path).map do |line|
6
+ GemfileLine.new(line)
7
+ end
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,5 @@
1
+ module Bundler
2
+ module Verbose
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
metadata ADDED
@@ -0,0 +1,122 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: bundler-verbose
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Nikolay Bienko
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-12-20 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.10'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.10'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: pry
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description: Simple plugin for Bundler to generate verbose Gemfile with description
70
+ of each gem. It may be useful for novice Ruby developers or when you start diving
71
+ into the new Ruby project.
72
+ email:
73
+ - bikolya@gmail.com
74
+ executables:
75
+ - bundler-verbose
76
+ extensions: []
77
+ extra_rdoc_files: []
78
+ files:
79
+ - ".gitignore"
80
+ - ".rspec"
81
+ - ".travis.yml"
82
+ - CODE_OF_CONDUCT.md
83
+ - Gemfile
84
+ - LICENSE.txt
85
+ - README.md
86
+ - Rakefile
87
+ - bin/bundler-verbose
88
+ - bin/console
89
+ - bin/setup
90
+ - bundler-verbose.gemspec
91
+ - lib/bundler/verbose.rb
92
+ - lib/bundler/verbose/gem_info.rb
93
+ - lib/bundler/verbose/gem_null_specification.rb
94
+ - lib/bundler/verbose/gemfile_line.rb
95
+ - lib/bundler/verbose/gemfile_parser.rb
96
+ - lib/bundler/verbose/version.rb
97
+ homepage: http://github.com/bikolya/bundler-verbose
98
+ licenses:
99
+ - MIT
100
+ metadata: {}
101
+ post_install_message:
102
+ rdoc_options: []
103
+ require_paths:
104
+ - lib
105
+ required_ruby_version: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ required_rubygems_version: !ruby/object:Gem::Requirement
111
+ requirements:
112
+ - - ">="
113
+ - !ruby/object:Gem::Version
114
+ version: '0'
115
+ requirements: []
116
+ rubyforge_project:
117
+ rubygems_version: 2.4.5.1
118
+ signing_key:
119
+ specification_version: 4
120
+ summary: Simple plugin for Bundler to generate verbose Gemfile with descriptions
121
+ test_files: []
122
+ has_rdoc: