diff options
author | Aditya Prakash <aditya.prakash132@gmail.com> | 2016-03-08 11:50:15 +0530 |
---|---|---|
committer | Aditya Prakash <aditya.prakash132@gmail.com> | 2016-03-09 07:51:32 +0530 |
commit | 4eefb1ee2b8e2c2ba005ec27003bbf83b174f374 (patch) | |
tree | 638a46a55a2e6cf1221b1512647b56c6d6347207 | |
parent | feb41629b7cf0267e624857393f7cf198c764755 (diff) | |
download | bundler-4eefb1ee2b8e2c2ba005ec27003bbf83b174f374.tar.gz |
Add test for checking langauge of sentences used in source code
-rw-r--r-- | lib/bundler.rb | 2 | ||||
-rw-r--r-- | lib/bundler/capistrano.rb | 2 | ||||
-rw-r--r-- | lib/bundler/cli.rb | 8 | ||||
-rw-r--r-- | lib/bundler/cli/exec.rb | 2 | ||||
-rw-r--r-- | lib/bundler/cli/install.rb | 2 | ||||
-rw-r--r-- | lib/bundler/cli/update.rb | 2 | ||||
-rw-r--r-- | lib/bundler/definition.rb | 2 | ||||
-rw-r--r-- | lib/bundler/dsl.rb | 2 | ||||
-rw-r--r-- | lib/bundler/fetcher/compact_index.rb | 2 | ||||
-rw-r--r-- | lib/bundler/fetcher/dependency.rb | 2 | ||||
-rw-r--r-- | lib/bundler/friendly_errors.rb | 2 | ||||
-rw-r--r-- | lib/bundler/installer.rb | 4 | ||||
-rw-r--r-- | lib/bundler/installer/gem_installer.rb | 2 | ||||
-rw-r--r-- | lib/bundler/mirror.rb | 2 | ||||
-rw-r--r-- | lib/bundler/psyched_yaml.rb | 2 | ||||
-rw-r--r-- | lib/bundler/source/git.rb | 2 | ||||
-rw-r--r-- | lib/bundler/source/rubygems.rb | 2 | ||||
-rw-r--r-- | lib/bundler/vlad.rb | 2 | ||||
-rw-r--r-- | spec/quality_spec.rb | 13 |
19 files changed, 35 insertions, 22 deletions
diff --git a/lib/bundler.rb b/lib/bundler.rb index dcb151b058..8288f839e1 100644 --- a/lib/bundler.rb +++ b/lib/bundler.rb @@ -85,7 +85,7 @@ module Bundler end def setup(*groups) - # Just return if all groups are already loaded + # Return if all groups are already loaded return @setup if defined?(@setup) definition.validate_ruby! diff --git a/lib/bundler/capistrano.rb b/lib/bundler/capistrano.rb index 2a4954d964..7b0bbbd6d2 100644 --- a/lib/bundler/capistrano.rb +++ b/lib/bundler/capistrano.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true # Capistrano task for Bundler. # -# Just add "require 'bundler/capistrano'" in your Capistrano deploy.rb, and +# Add "require 'bundler/capistrano'" in your Capistrano deploy.rb, and # Bundler will be activated after each new deployment. require "bundler/deployment" require "capistrano/version" diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb index 82ca1cdb26..9834277cd8 100644 --- a/lib/bundler/cli.rb +++ b/lib/bundler/cli.rb @@ -259,7 +259,7 @@ module Bundler desc "cache [OPTIONS]", "Cache all the gems to vendor/cache", :hide => true method_option "all", :type => :boolean, :banner => "Include all sources (including path and git)." - method_option "all-platforms", :type => :boolean, :banner => "Include gems for all platforms present in the lockfile, not just the current one" + method_option "all-platforms", :type => :boolean, :banner => "Include gems for all platforms present in the lockfile, not only the current one" method_option "no-prune", :type => :boolean, :banner => "Don't remove stale gems from the cache." def cache require "bundler/cli/cache" @@ -268,11 +268,11 @@ module Bundler desc "package [OPTIONS]", "Locks and then caches all of the gems into vendor/cache" method_option "all", :type => :boolean, :banner => "Include all sources (including path and git)." - method_option "all-platforms", :type => :boolean, :banner => "Include gems for all platforms present in the lockfile, not just the current one" + method_option "all-platforms", :type => :boolean, :banner => "Include gems for all platforms present in the lockfile, not only the current one" method_option "cache-path", :type => :string, :banner => "Specify a different cache path than the default (vendor/cache)." method_option "gemfile", :type => :string, :banner => "Use the specified gemfile instead of Gemfile" - method_option "no-install", :type => :boolean, :banner => "Don't actually install the gems, just package." + method_option "no-install", :type => :boolean, :banner => "Don't install the gems, only the package." method_option "no-prune", :type => :boolean, :banner => "Don't remove stale gems from the cache." method_option "path", :type => :string, :banner => "Specify a different path than the system default ($BUNDLE_PATH or $GEM_HOME). Bundler will remember this value for future installs on this machine" @@ -390,7 +390,7 @@ module Bundler desc "clean [OPTIONS]", "Cleans up unused gems in your bundler directory" method_option "dry-run", :type => :boolean, :default => false, :banner => - "Only print out changes, do not actually clean gems" + "Only print out changes, do not clean gems" method_option "force", :type => :boolean, :default => false, :banner => "Forces clean even if --path is not set" def clean diff --git a/lib/bundler/cli/exec.rb b/lib/bundler/cli/exec.rb index 9162d54913..3ef2492c2f 100644 --- a/lib/bundler/cli/exec.rb +++ b/lib/bundler/cli/exec.rb @@ -25,7 +25,7 @@ module Bundler # First, try to exec directly to something in PATH kernel_exec([bin_path, cmd], *args) else - # Just exec using the given command + # exec using the given command kernel_exec(cmd, *args) end end diff --git a/lib/bundler/cli/install.rb b/lib/bundler/cli/install.rb index 8f27f7cfcc..da201ec5d9 100644 --- a/lib/bundler/cli/install.rb +++ b/lib/bundler/cli/install.rb @@ -42,7 +42,7 @@ module Bundler ENV["RB_USER_INSTALL"] = "1" if Bundler::FREEBSD - # Just disable color in deployment mode + # Disable color in deployment mode Bundler.ui.shell = Thor::Shell::Basic.new if options[:deployment] check_for_options_conflicts diff --git a/lib/bundler/cli/update.rb b/lib/bundler/cli/update.rb index 1a76a88c3d..037da2915e 100644 --- a/lib/bundler/cli/update.rb +++ b/lib/bundler/cli/update.rb @@ -21,7 +21,7 @@ module Bundler raise GemfileLockNotFound, "This Bundle hasn't been installed yet. " \ "Run `bundle install` to update and install the bundled gems." end - # cycle through the requested gems, just to make sure they exist + # cycle through the requested gems, to make sure they exist names = Bundler.locked_gems.specs.map(&:name) gems.each do |g| next if names.include?(g) diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb index 944b8089c1..3dcac64191 100644 --- a/lib/bundler/definition.rb +++ b/lib/bundler/definition.rb @@ -572,7 +572,7 @@ module Bundler next if s.source.nil? || @unlock[:sources].include?(s.name) # If the spec is from a path source and it doesn't exist anymore - # then we just unlock it. + # then we unlock it. # Path sources have special logic if s.source.instance_of?(Source::Path) diff --git a/lib/bundler/dsl.rb b/lib/bundler/dsl.rb index b3b6bfdcce..224e642bd4 100644 --- a/lib/bundler/dsl.rb +++ b/lib/bundler/dsl.rb @@ -103,7 +103,7 @@ module Bundler else Bundler.ui.warn "Your Gemfile lists the gem #{current.name} (#{current.requirement}) more than once.\n" \ "You should probably keep only one of them.\n" \ - "While it's not a problem now, it could cause errors if you change the version of just one of them later." + "While it's not a problem now, it could cause errors if you change the version of one of them later." end if current.source != dep.source diff --git a/lib/bundler/fetcher/compact_index.rb b/lib/bundler/fetcher/compact_index.rb index f249ec1835..c1beee6c75 100644 --- a/lib/bundler/fetcher/compact_index.rb +++ b/lib/bundler/fetcher/compact_index.rb @@ -16,7 +16,7 @@ module Bundler rescue NetworkDownError, CompactIndexClient::Updater::MisMatchedChecksumError => e raise HTTPError, e.message rescue AuthenticationRequiredError - # We got a 401 from the server. Just fail. + # Fail since we got a 401 from the server. raise rescue HTTPError => e Bundler.ui.trace(e) diff --git a/lib/bundler/fetcher/dependency.rb b/lib/bundler/fetcher/dependency.rb index 274b34eefd..8b41fe9999 100644 --- a/lib/bundler/fetcher/dependency.rb +++ b/lib/bundler/fetcher/dependency.rb @@ -10,7 +10,7 @@ module Bundler rescue NetworkDownError => e raise HTTPError, e.message rescue AuthenticationRequiredError - # We got a 401 from the server. Just fail. + # Fail since we got a 401 from the server. raise rescue HTTPError false diff --git a/lib/bundler/friendly_errors.rb b/lib/bundler/friendly_errors.rb index b453e8e625..f7a10d0035 100644 --- a/lib/bundler/friendly_errors.rb +++ b/lib/bundler/friendly_errors.rb @@ -63,7 +63,7 @@ module Bundler - What happened instead? - Instead, what actually happened was... + Instead, what happened was... Error details diff --git a/lib/bundler/installer.rb b/lib/bundler/installer.rb index 10ba3005d1..509b7b0cba 100644 --- a/lib/bundler/installer.rb +++ b/lib/bundler/installer.rb @@ -146,9 +146,9 @@ module Bundler private # the order that the resolver provides is significant, since - # dependencies might actually affect the installation of a gem. + # dependencies might affect the installation of a gem. # that said, it's a rare situation (other than rake), and parallel - # installation is just SO MUCH FASTER. so we let people opt in. + # installation is SO MUCH FASTER. so we let people opt in. def install(options) force = options["force"] jobs = 1 diff --git a/lib/bundler/installer/gem_installer.rb b/lib/bundler/installer/gem_installer.rb index 441c72108f..a91990d5f5 100644 --- a/lib/bundler/installer/gem_installer.rb +++ b/lib/bundler/installer/gem_installer.rb @@ -39,7 +39,7 @@ module Bundler end def handle_exception(e) - # if install hook failed or gem signature is bad, just die + # Die if install hook failed or gem signature is bad. raise e if e.is_a?(Bundler::InstallHookError) || e.is_a?(Bundler::SecurityError) # other failure, likely a native extension build failure Bundler.ui.info "" diff --git a/lib/bundler/mirror.rb b/lib/bundler/mirror.rb index 4978462bb3..cc427d7314 100644 --- a/lib/bundler/mirror.rb +++ b/lib/bundler/mirror.rb @@ -177,7 +177,7 @@ module Bundler # a given mirror. # # One mirror may correspond to many different addresses, both - # because of it having many dns entries or just because + # because of it having many dns entries or because # the network interface is both ipv4 and ipv5 class MirrorSockets def initialize(mirror) diff --git a/lib/bundler/psyched_yaml.rb b/lib/bundler/psyched_yaml.rb index 2c85cb0a53..69d2ae78c5 100644 --- a/lib/bundler/psyched_yaml.rb +++ b/lib/bundler/psyched_yaml.rb @@ -5,7 +5,7 @@ begin rescue LoadError end if defined?(gem) -# Psych could just be in the stdlib +# Psych could be in the stdlib # but it's too late if Syck is already loaded begin require "psych" unless defined?(Syck) diff --git a/lib/bundler/source/git.rb b/lib/bundler/source/git.rb index 228ab61a67..7926a7b50a 100644 --- a/lib/bundler/source/git.rb +++ b/lib/bundler/source/git.rb @@ -146,7 +146,7 @@ module Bundler changed end - # TODO: actually cache git specs + # TODO: cache git specs def specs(*) set_local!(app_cache_path) if has_app_cache? && !local? diff --git a/lib/bundler/source/rubygems.rb b/lib/bundler/source/rubygems.rb index cebb68a700..d8ca36e3f9 100644 --- a/lib/bundler/source/rubygems.rb +++ b/lib/bundler/source/rubygems.rb @@ -343,7 +343,7 @@ module Bundler # because ensuring we have all the gems we need involves downloading # the gemspecs of those gems, if the non-api sites contain more than - # about 100 gems, we just treat all sites as non-api for speed. + # about 100 gems, we treat all sites as non-api for speed. allow_api = idx.size < API_REQUEST_LIMIT && dependency_names.size < API_REQUEST_LIMIT Bundler.ui.debug "Need to query more than #{API_REQUEST_LIMIT} gems." \ " Downloading full index instead..." unless allow_api diff --git a/lib/bundler/vlad.rb b/lib/bundler/vlad.rb index d017ca475a..db78f84baa 100644 --- a/lib/bundler/vlad.rb +++ b/lib/bundler/vlad.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true # Vlad task for Bundler. # -# Just add "require 'bundler/vlad'" in your Vlad deploy.rb, and +# Add "require 'bundler/vlad'" in your Vlad deploy.rb, and # include the vlad:bundle:install task in your vlad:deploy task. require "bundler/deployment" diff --git a/spec/quality_spec.rb b/spec/quality_spec.rb index 8fccdbba99..ce03839c17 100644 --- a/spec/quality_spec.rb +++ b/spec/quality_spec.rb @@ -110,6 +110,19 @@ describe "The library itself" do expect(error_messages.compact).to be_well_formed end + it "maintains language quality of sentences used in source code" do + error_messages = [] + exempt = /vendor/ + Dir.chdir(File.expand_path("../../lib", __FILE__)) do + `git ls-files -z`.split("\x0").each do |filename| + next if filename =~ exempt + error_messages << check_for_expendable_words(filename) + error_messages << check_for_specific_pronouns(filename) + end + end + expect(error_messages.compact).to be_well_formed + end + it "can still be built" do Dir.chdir(root) do `gem build bundler.gemspec` |