shopify-bundler 1.10.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (196) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +16 -0
  3. data/.rspec +3 -0
  4. data/.rubocop.yml +96 -0
  5. data/.rubocop_todo.yml +177 -0
  6. data/.travis.yml +104 -0
  7. data/CHANGELOG.md +2131 -0
  8. data/CODE_OF_CONDUCT.md +42 -0
  9. data/CONTRIBUTING.md +32 -0
  10. data/DEVELOPMENT.md +118 -0
  11. data/ISSUES.md +96 -0
  12. data/LICENSE.md +23 -0
  13. data/README.md +40 -0
  14. data/Rakefile +309 -0
  15. data/bin/rake +14 -0
  16. data/bin/rspec +10 -0
  17. data/bin/rubocop +11 -0
  18. data/bundler.gemspec +34 -0
  19. data/exe/bundle +21 -0
  20. data/exe/bundle_ruby +60 -0
  21. data/exe/bundler +21 -0
  22. data/lib/bundler.rb +499 -0
  23. data/lib/bundler/capistrano.rb +16 -0
  24. data/lib/bundler/cli.rb +435 -0
  25. data/lib/bundler/cli/binstubs.rb +37 -0
  26. data/lib/bundler/cli/cache.rb +34 -0
  27. data/lib/bundler/cli/check.rb +37 -0
  28. data/lib/bundler/cli/clean.rb +25 -0
  29. data/lib/bundler/cli/common.rb +56 -0
  30. data/lib/bundler/cli/config.rb +88 -0
  31. data/lib/bundler/cli/console.rb +37 -0
  32. data/lib/bundler/cli/exec.rb +51 -0
  33. data/lib/bundler/cli/gem.rb +208 -0
  34. data/lib/bundler/cli/init.rb +32 -0
  35. data/lib/bundler/cli/inject.rb +32 -0
  36. data/lib/bundler/cli/install.rb +188 -0
  37. data/lib/bundler/cli/lock.rb +35 -0
  38. data/lib/bundler/cli/open.rb +22 -0
  39. data/lib/bundler/cli/outdated.rb +86 -0
  40. data/lib/bundler/cli/package.rb +45 -0
  41. data/lib/bundler/cli/platform.rb +42 -0
  42. data/lib/bundler/cli/show.rb +74 -0
  43. data/lib/bundler/cli/update.rb +72 -0
  44. data/lib/bundler/cli/viz.rb +26 -0
  45. data/lib/bundler/constants.rb +5 -0
  46. data/lib/bundler/current_ruby.rb +218 -0
  47. data/lib/bundler/definition.rb +675 -0
  48. data/lib/bundler/dep_proxy.rb +45 -0
  49. data/lib/bundler/dependency.rb +119 -0
  50. data/lib/bundler/deployment.rb +62 -0
  51. data/lib/bundler/deprecate.rb +17 -0
  52. data/lib/bundler/dsl.rb +478 -0
  53. data/lib/bundler/endpoint_specification.rb +100 -0
  54. data/lib/bundler/env.rb +82 -0
  55. data/lib/bundler/environment.rb +41 -0
  56. data/lib/bundler/fetcher.rb +288 -0
  57. data/lib/bundler/fetcher/base.rb +26 -0
  58. data/lib/bundler/fetcher/dependency.rb +88 -0
  59. data/lib/bundler/fetcher/downloader.rb +60 -0
  60. data/lib/bundler/fetcher/index.rb +32 -0
  61. data/lib/bundler/friendly_errors.rb +92 -0
  62. data/lib/bundler/gem_helper.rb +191 -0
  63. data/lib/bundler/gem_helpers.rb +26 -0
  64. data/lib/bundler/gem_installer.rb +9 -0
  65. data/lib/bundler/gem_path_manipulation.rb +8 -0
  66. data/lib/bundler/gem_tasks.rb +5 -0
  67. data/lib/bundler/graph.rb +173 -0
  68. data/lib/bundler/index.rb +199 -0
  69. data/lib/bundler/injector.rb +62 -0
  70. data/lib/bundler/inline.rb +58 -0
  71. data/lib/bundler/installer.rb +242 -0
  72. data/lib/bundler/installer/parallel_installer.rb +122 -0
  73. data/lib/bundler/installer/standalone.rb +48 -0
  74. data/lib/bundler/lazy_specification.rb +82 -0
  75. data/lib/bundler/lockfile_parser.rb +199 -0
  76. data/lib/bundler/match_platform.rb +13 -0
  77. data/lib/bundler/psyched_yaml.rb +26 -0
  78. data/lib/bundler/remote_specification.rb +82 -0
  79. data/lib/bundler/resolver.rb +350 -0
  80. data/lib/bundler/retry.rb +60 -0
  81. data/lib/bundler/ruby_dsl.rb +11 -0
  82. data/lib/bundler/ruby_version.rb +116 -0
  83. data/lib/bundler/rubygems_ext.rb +175 -0
  84. data/lib/bundler/rubygems_integration.rb +674 -0
  85. data/lib/bundler/runtime.rb +285 -0
  86. data/lib/bundler/settings.rb +263 -0
  87. data/lib/bundler/setup.rb +26 -0
  88. data/lib/bundler/shared_helpers.rb +176 -0
  89. data/lib/bundler/similarity_detector.rb +61 -0
  90. data/lib/bundler/source.rb +35 -0
  91. data/lib/bundler/source/git.rb +286 -0
  92. data/lib/bundler/source/git/git_proxy.rb +190 -0
  93. data/lib/bundler/source/path.rb +224 -0
  94. data/lib/bundler/source/path/installer.rb +43 -0
  95. data/lib/bundler/source/rubygems.rb +436 -0
  96. data/lib/bundler/source/rubygems/remote.rb +38 -0
  97. data/lib/bundler/source_list.rb +101 -0
  98. data/lib/bundler/spec_set.rb +156 -0
  99. data/lib/bundler/ssl_certs/.document +1 -0
  100. data/lib/bundler/ssl_certs/AddTrustExternalCARoot-2048.pem +25 -0
  101. data/lib/bundler/ssl_certs/AddTrustExternalCARoot.pem +32 -0
  102. data/lib/bundler/ssl_certs/Class3PublicPrimaryCertificationAuthority.pem +14 -0
  103. data/lib/bundler/ssl_certs/DigiCertHighAssuranceEVRootCA.pem +23 -0
  104. data/lib/bundler/ssl_certs/EntrustnetSecureServerCertificationAuthority.pem +28 -0
  105. data/lib/bundler/ssl_certs/GeoTrustGlobalCA.pem +20 -0
  106. data/lib/bundler/ssl_certs/certificate_manager.rb +64 -0
  107. data/lib/bundler/stub_specification.rb +23 -0
  108. data/lib/bundler/templates/Executable +16 -0
  109. data/lib/bundler/templates/Executable.standalone +12 -0
  110. data/lib/bundler/templates/Gemfile +4 -0
  111. data/lib/bundler/templates/newgem/.travis.yml.tt +4 -0
  112. data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +22 -0
  113. data/lib/bundler/templates/newgem/Gemfile.tt +4 -0
  114. data/lib/bundler/templates/newgem/LICENSE.txt.tt +21 -0
  115. data/lib/bundler/templates/newgem/README.md.tt +41 -0
  116. data/lib/bundler/templates/newgem/Rakefile.tt +29 -0
  117. data/lib/bundler/templates/newgem/bin/console.tt +14 -0
  118. data/lib/bundler/templates/newgem/bin/setup.tt +8 -0
  119. data/lib/bundler/templates/newgem/exe/newgem.tt +3 -0
  120. data/lib/bundler/templates/newgem/ext/newgem/extconf.rb.tt +3 -0
  121. data/lib/bundler/templates/newgem/ext/newgem/newgem.c.tt +9 -0
  122. data/lib/bundler/templates/newgem/ext/newgem/newgem.h.tt +6 -0
  123. data/lib/bundler/templates/newgem/gitignore.tt +16 -0
  124. data/lib/bundler/templates/newgem/lib/newgem.rb.tt +12 -0
  125. data/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +7 -0
  126. data/lib/bundler/templates/newgem/newgem.gemspec.tt +43 -0
  127. data/lib/bundler/templates/newgem/rspec.tt +2 -0
  128. data/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +11 -0
  129. data/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +2 -0
  130. data/lib/bundler/templates/newgem/test/newgem_test.rb.tt +11 -0
  131. data/lib/bundler/templates/newgem/test/test_helper.rb.tt +4 -0
  132. data/lib/bundler/ui.rb +7 -0
  133. data/lib/bundler/ui/rg_proxy.rb +17 -0
  134. data/lib/bundler/ui/shell.rb +108 -0
  135. data/lib/bundler/ui/silent.rb +44 -0
  136. data/lib/bundler/vendor/molinillo/lib/molinillo.rb +5 -0
  137. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +277 -0
  138. data/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +69 -0
  139. data/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +3 -0
  140. data/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +99 -0
  141. data/lib/bundler/vendor/molinillo/lib/molinillo/modules/ui.rb +63 -0
  142. data/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +434 -0
  143. data/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb +43 -0
  144. data/lib/bundler/vendor/molinillo/lib/molinillo/state.rb +51 -0
  145. data/lib/bundler/vendor/net/http/faster.rb +26 -0
  146. data/lib/bundler/vendor/net/http/persistent.rb +1230 -0
  147. data/lib/bundler/vendor/net/http/persistent/ssl_reuse.rb +128 -0
  148. data/lib/bundler/vendor/thor/lib/thor.rb +484 -0
  149. data/lib/bundler/vendor/thor/lib/thor/actions.rb +319 -0
  150. data/lib/bundler/vendor/thor/lib/thor/actions/create_file.rb +103 -0
  151. data/lib/bundler/vendor/thor/lib/thor/actions/create_link.rb +59 -0
  152. data/lib/bundler/vendor/thor/lib/thor/actions/directory.rb +118 -0
  153. data/lib/bundler/vendor/thor/lib/thor/actions/empty_directory.rb +135 -0
  154. data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +316 -0
  155. data/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +107 -0
  156. data/lib/bundler/vendor/thor/lib/thor/base.rb +656 -0
  157. data/lib/bundler/vendor/thor/lib/thor/command.rb +133 -0
  158. data/lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +77 -0
  159. data/lib/bundler/vendor/thor/lib/thor/core_ext/io_binary_read.rb +10 -0
  160. data/lib/bundler/vendor/thor/lib/thor/core_ext/ordered_hash.rb +98 -0
  161. data/lib/bundler/vendor/thor/lib/thor/error.rb +32 -0
  162. data/lib/bundler/vendor/thor/lib/thor/group.rb +281 -0
  163. data/lib/bundler/vendor/thor/lib/thor/invocation.rb +178 -0
  164. data/lib/bundler/vendor/thor/lib/thor/line_editor.rb +17 -0
  165. data/lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb +35 -0
  166. data/lib/bundler/vendor/thor/lib/thor/line_editor/readline.rb +88 -0
  167. data/lib/bundler/vendor/thor/lib/thor/parser.rb +4 -0
  168. data/lib/bundler/vendor/thor/lib/thor/parser/argument.rb +73 -0
  169. data/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +175 -0
  170. data/lib/bundler/vendor/thor/lib/thor/parser/option.rb +125 -0
  171. data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +218 -0
  172. data/lib/bundler/vendor/thor/lib/thor/rake_compat.rb +71 -0
  173. data/lib/bundler/vendor/thor/lib/thor/runner.rb +322 -0
  174. data/lib/bundler/vendor/thor/lib/thor/shell.rb +81 -0
  175. data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +421 -0
  176. data/lib/bundler/vendor/thor/lib/thor/shell/color.rb +149 -0
  177. data/lib/bundler/vendor/thor/lib/thor/shell/html.rb +126 -0
  178. data/lib/bundler/vendor/thor/lib/thor/util.rb +267 -0
  179. data/lib/bundler/vendor/thor/lib/thor/version.rb +3 -0
  180. data/lib/bundler/vendored_molinillo.rb +2 -0
  181. data/lib/bundler/vendored_persistent.rb +11 -0
  182. data/lib/bundler/vendored_thor.rb +3 -0
  183. data/lib/bundler/version.rb +6 -0
  184. data/lib/bundler/vlad.rb +11 -0
  185. data/lib/bundler/worker.rb +72 -0
  186. data/man/bundle-config.ronn +187 -0
  187. data/man/bundle-exec.ronn +136 -0
  188. data/man/bundle-gem.ronn +77 -0
  189. data/man/bundle-install.ronn +398 -0
  190. data/man/bundle-package.ronn +66 -0
  191. data/man/bundle-platform.ronn +42 -0
  192. data/man/bundle-update.ronn +188 -0
  193. data/man/bundle.ronn +98 -0
  194. data/man/gemfile.5.ronn +495 -0
  195. data/man/index.txt +8 -0
  196. metadata +346 -0
@@ -0,0 +1,23 @@
1
+ require "bundler/remote_specification"
2
+
3
+ module Bundler
4
+ class StubSpecification < RemoteSpecification
5
+ def self.from_stub(stub)
6
+ spec = new(stub.name, stub.version, stub.platform, nil)
7
+ spec.stub = stub
8
+ spec
9
+ end
10
+
11
+ attr_accessor :stub
12
+
13
+ def to_yaml
14
+ _remote_specification.to_yaml
15
+ end
16
+
17
+ private
18
+
19
+ def _remote_specification
20
+ stub.to_spec
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env <%= Bundler.settings[:shebang] || RbConfig::CONFIG['ruby_install_name'] %>
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application '<%= executable %>' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require "pathname"
10
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../<%= relative_gemfile_path %>",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require "rubygems"
14
+ require "bundler/setup"
15
+
16
+ load Gem.bin_path("<%= spec.name %>", "<%= executable %>")
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env <%= Bundler.settings[:shebang] || RbConfig::CONFIG['ruby_install_name'] %>
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application '<%= executable %>' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ $:.unshift File.expand_path '../<%= standalone_path %>', __FILE__
10
+
11
+ require 'bundler/setup'
12
+ load File.expand_path '../<%= executable_path %>', __FILE__
@@ -0,0 +1,4 @@
1
+ # A sample Gemfile
2
+ source "https://rubygems.org"
3
+
4
+ # gem "rails"
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - <%= RUBY_VERSION %>
4
+ before_install: gem install bundler -v <%= Bundler::VERSION %>
@@ -0,0 +1,22 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, 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, religion, or nationality.
6
+
7
+ Examples of unacceptable behavior by participants include:
8
+
9
+ * The use of sexualized language or imagery
10
+ * Personal attacks
11
+ * Trolling or insulting/derogatory comments
12
+ * Public or private harassment
13
+ * Publishing other's private information, such as physical or electronic addresses, without explicit permission
14
+ * Other unethical or unprofessional conduct.
15
+
16
+ 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. By adopting this Code of Conduct, project maintainers commit themselves to fairly and consistently applying these principles to every aspect of managing this project. Project maintainers who do not follow or enforce the Code of Conduct may be permanently removed from the project team.
17
+
18
+ This code of conduct applies both within project spaces and in public spaces when an individual is representing the project or its community.
19
+
20
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
21
+
22
+ This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0, available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/)
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in <%=config[:name]%>.gemspec
4
+ gemspec
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) <%=Time.now.year%> <%=config[:author]%>
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.
@@ -0,0 +1,41 @@
1
+ # <%=config[:constant_name]%>
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/<%=config[:namespaced_path]%>`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem '<%=config[:name]%>'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install <%=config[:name]%>
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies.<% if config[:test] %> Then, run `rake <%= config[:test].sub('mini', '').sub('rspec', 'spec') %>` to run the tests.<% end %> You can also run `bin/console` for an interactive prompt that will allow you to experiment.<% if config[:bin] %> Run `bundle exec <%= config[:name] %>` to use the gem in this directory, ignoring other installed copies of this gem.<% end %>
30
+
31
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/<%= config[:name] %>.<% if config[:coc] %> This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.<% end %>
36
+ <% if config[:mit] %>
37
+
38
+ ## License
39
+
40
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
41
+ <% end %>
@@ -0,0 +1,29 @@
1
+ require "bundler/gem_tasks"
2
+ <% if config[:test] == 'minitest' -%>
3
+ require "rake/testtask"
4
+
5
+ Rake::TestTask.new(:test) do |t|
6
+ t.libs << "test"
7
+ t.libs << "lib"
8
+ t.test_files = FileList['test/**/*_test.rb']
9
+ end
10
+
11
+ <% elsif config[:test] == 'rspec' -%>
12
+ require "rspec/core/rake_task"
13
+
14
+ RSpec::Core::RakeTask.new(:spec)
15
+
16
+ <% end -%>
17
+ <% if config[:ext] -%>
18
+ require "rake/extensiontask"
19
+
20
+ task :build => :compile
21
+
22
+ Rake::ExtensionTask.new("<%=config[:underscored_name]%>") do |ext|
23
+ ext.lib_dir = "lib/<%=config[:namespaced_path]%>"
24
+ end
25
+
26
+ task :default => [:clobber, :compile, :<%= config[:test_task] %>]
27
+ <% else -%>
28
+ task :default => :<%= config[:test_task] %>
29
+ <% end -%>
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "<%= config[:namespaced_path] %>"
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,3 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "<%= config[:namespaced_path] %>"
@@ -0,0 +1,3 @@
1
+ require "mkmf"
2
+
3
+ create_makefile(<%= config[:makefile_path].inspect %>)
@@ -0,0 +1,9 @@
1
+ #include "<%=config[:underscored_name]%>.h"
2
+
3
+ VALUE rb_m<%=config[:constant_array].join%>;
4
+
5
+ void
6
+ Init_<%=config[:underscored_name]%>(void)
7
+ {
8
+ rb_m<%=config[:constant_array].join%> = rb_define_module(<%=config[:constant_name].inspect%>);
9
+ }
@@ -0,0 +1,6 @@
1
+ #ifndef <%=config[:underscored_name].upcase%>_H
2
+ #define <%=config[:underscored_name].upcase%>_H 1
3
+
4
+ #include "ruby.h"
5
+
6
+ #endif /* <%=config[:underscored_name].upcase%>_H */
@@ -0,0 +1,16 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ <%- if config[:ext] -%>
11
+ *.bundle
12
+ *.so
13
+ *.o
14
+ *.a
15
+ mkmf.log
16
+ <%- end -%>
@@ -0,0 +1,12 @@
1
+ require "<%=config[:namespaced_path]%>/version"
2
+ <%- if config[:ext] -%>
3
+ require "<%=config[:namespaced_path]%>/<%=config[:underscored_name]%>"
4
+ <%- end -%>
5
+
6
+ <%- config[:constant_array].each_with_index do |c,i| -%>
7
+ <%= ' '*i %>module <%= c %>
8
+ <%- end -%>
9
+ <%= ' '*config[:constant_array].size %># Your code goes here...
10
+ <%- (config[:constant_array].size-1).downto(0) do |i| -%>
11
+ <%= ' '*i %>end
12
+ <%- end -%>
@@ -0,0 +1,7 @@
1
+ <%- config[:constant_array].each_with_index do |c,i| -%>
2
+ <%= ' '*i %>module <%= c %>
3
+ <%- end -%>
4
+ <%= ' '*config[:constant_array].size %>VERSION = "0.1.0"
5
+ <%- (config[:constant_array].size-1).downto(0) do |i| -%>
6
+ <%= ' '*i %>end
7
+ <%- end -%>
@@ -0,0 +1,43 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require '<%=config[:namespaced_path]%>/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = <%=config[:name].inspect%>
8
+ spec.version = <%=config[:constant_name]%>::VERSION
9
+ spec.authors = [<%=config[:author].inspect%>]
10
+ spec.email = [<%=config[:email].inspect%>]
11
+
12
+ spec.summary = %q{TODO: Write a short summary, because Rubygems requires one.}
13
+ spec.description = %q{TODO: Write a longer description or delete this line.}
14
+ spec.homepage = "TODO: Put your gem's website or public repo URL here."
15
+ <%- if config[:mit] -%>
16
+ spec.license = "MIT"
17
+ <%- end -%>
18
+
19
+ # Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
20
+ # delete this section to allow pushing this gem to any host.
21
+ if spec.respond_to?(:metadata)
22
+ spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
23
+ else
24
+ raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
25
+ end
26
+
27
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
28
+ spec.bindir = "exe"
29
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
30
+ spec.require_paths = ["lib"]
31
+ <%- if config[:ext] -%>
32
+ spec.extensions = ["ext/<%=config[:underscored_name]%>/extconf.rb"]
33
+ <%- end -%>
34
+
35
+ spec.add_development_dependency "bundler", "~> <%= config[:bundler_version] %>"
36
+ spec.add_development_dependency "rake", "~> 10.0"
37
+ <%- if config[:ext] -%>
38
+ spec.add_development_dependency "rake-compiler"
39
+ <%- end -%>
40
+ <%- if config[:test] -%>
41
+ spec.add_development_dependency "<%=config[:test]%>", "~> <%=config[:test_framework_version]%>"
42
+ <%- end -%>
43
+ end
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
@@ -0,0 +1,11 @@
1
+ require 'spec_helper'
2
+
3
+ describe <%= config[:constant_name] %> do
4
+ it 'has a version number' do
5
+ expect(<%= config[:constant_name] %>::VERSION).not_to be nil
6
+ end
7
+
8
+ it 'does something useful' do
9
+ expect(false).to eq(true)
10
+ end
11
+ end
@@ -0,0 +1,2 @@
1
+ $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
2
+ require '<%= config[:namespaced_path] %>'
@@ -0,0 +1,11 @@
1
+ require 'test_helper'
2
+
3
+ class <%= config[:constant_name] %>Test < Minitest::Test
4
+ def test_that_it_has_a_version_number
5
+ refute_nil ::<%= config[:constant_name] %>::VERSION
6
+ end
7
+
8
+ def test_it_does_something_useful
9
+ assert false
10
+ end
11
+ end
@@ -0,0 +1,4 @@
1
+ $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
2
+ require '<%= config[:namespaced_path] %>'
3
+
4
+ require 'minitest/autorun'
@@ -0,0 +1,7 @@
1
+ module Bundler
2
+ module UI
3
+ autoload :RGProxy, "bundler/ui/rg_proxy"
4
+ autoload :Shell, "bundler/ui/shell"
5
+ autoload :Silent, "bundler/ui/silent"
6
+ end
7
+ end
@@ -0,0 +1,17 @@
1
+ require "bundler/ui"
2
+ require "rubygems/user_interaction"
3
+
4
+ module Bundler
5
+ module UI
6
+ class RGProxy < ::Gem::SilentUI
7
+ def initialize(ui)
8
+ @ui = ui
9
+ super()
10
+ end
11
+
12
+ def say(message)
13
+ @ui && @ui.debug(message)
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,108 @@
1
+ require "bundler/vendored_thor"
2
+
3
+ module Bundler
4
+ module UI
5
+ class Shell
6
+ LEVELS = %w(silent error warn confirm info debug)
7
+
8
+ attr_writer :shell
9
+
10
+ def initialize(options = {})
11
+ if options["no-color"] || !STDOUT.tty?
12
+ Thor::Base.shell = Thor::Shell::Basic
13
+ end
14
+ @shell = Thor::Base.shell.new
15
+ @level = ENV["DEBUG"] ? "debug" : "info"
16
+ @warning_history = []
17
+ end
18
+
19
+ def info(msg, newline = nil)
20
+ tell_me(msg, nil, newline) if level("info")
21
+ end
22
+
23
+ def confirm(msg, newline = nil)
24
+ tell_me(msg, :green, newline) if level("confirm")
25
+ end
26
+
27
+ def warn(msg, newline = nil)
28
+ return if @warning_history.include? msg
29
+ @warning_history << msg
30
+ tell_me(msg, :yellow, newline) if level("warn")
31
+ end
32
+
33
+ def error(msg, newline = nil)
34
+ tell_me(msg, :red, newline) if level("error")
35
+ end
36
+
37
+ def debug(msg, newline = nil)
38
+ tell_me(msg, nil, newline) if level("debug")
39
+ end
40
+
41
+ def debug?
42
+ # needs to be false instead of nil to be newline param to other methods
43
+ level("debug")
44
+ end
45
+
46
+ def quiet?
47
+ LEVELS.index(@level) <= LEVELS.index("warn")
48
+ end
49
+
50
+ def ask(msg)
51
+ @shell.ask(msg)
52
+ end
53
+
54
+ def yes?(msg)
55
+ @shell.yes?(msg)
56
+ end
57
+
58
+ def no?
59
+ @shell.no?(msg)
60
+ end
61
+
62
+ def level=(level)
63
+ raise ArgumentError unless LEVELS.include?(level.to_s)
64
+ @level = level
65
+ end
66
+
67
+ def level(name = nil)
68
+ name ? LEVELS.index(name) <= LEVELS.index(@level) : @level
69
+ end
70
+
71
+ def trace(e, newline = nil, force = false)
72
+ return unless debug? || force
73
+ msg = "#{e.class}: #{e.message}\n#{e.backtrace.join("\n ")}"
74
+ tell_me(msg, nil, newline)
75
+ end
76
+
77
+ def silence
78
+ old_level, @level = @level, "silent"
79
+ yield
80
+ ensure
81
+ @level = old_level
82
+ end
83
+
84
+ private
85
+
86
+ # valimism
87
+ def tell_me(msg, color = nil, newline = nil)
88
+ msg = word_wrap(msg) if newline.is_a?(Hash) && newline[:wrap]
89
+ if newline.nil?
90
+ @shell.say(msg, color)
91
+ else
92
+ @shell.say(msg, color, newline)
93
+ end
94
+ end
95
+
96
+ def strip_leading_spaces(text)
97
+ spaces = text[/\A\s+/, 0]
98
+ spaces ? text.gsub(/#{spaces}/, "") : text
99
+ end
100
+
101
+ def word_wrap(text, line_width = @shell.terminal_width)
102
+ strip_leading_spaces(text).split("\n").collect do |line|
103
+ line.length > line_width ? line.gsub(/(.{1,#{line_width}})(\s+|$)/, "\\1\n").strip : line
104
+ end * "\n"
105
+ end
106
+ end
107
+ end
108
+ end