Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
Currently the gem provider will match gemname$, for example with bundler
this will return quite a long list of anything ending with bundler. When
a match returns a longer list, it will actually connect and try to pull
the latest gem again, thus increasing the WAN usage and rubygems.org
usage when not necessary.
The proposed fix adds a ^ in front of the name var to ensure it begins
with the gemname.
|
|
Moving the implementation of join_options into the base package provider.
This gives a consistent behavior between all package providers that support install_options.
|
|
The spec had an example which was expecting a nil
install_options by checking the 6th element in an array.
With the change to not append the install_options
unless specified, the example was passing but the
functionality no longer matched the example.
Changing the example to ensure 5 elements were
passed to execute instead of the previous 6.
|
|
Checks nil install_options.
Checks plain values and hash key-pairs.
|
|
|
|
Without this patch applied the gem package provider will always pass the
`--include-dependencies` flag to the gem command. This flag has been
deprecated in Rubygems for quite some time. The behavior of including
dependencies when installing a gem has been the default for some time,
so this patch does not change behavior for any recent version of
Rubygems since 0.9.5.
Here is the comment from the pull request:
This is a good explanation about the option: rubygems/rubygems#385
It was already deprecated since rubygems 0.9.5 and was the default
option since then.
Unless someone is using a version of rubygems from mid 2007, this option
is never being used
https://github.com/rubygems/rubygems/blob/a00fc76fb6b959385331715c500af1eb25590405/History.txt#L1451
|
|
Without this patch Ruby 1.9 is still complaining loudly about trying to
parse the spec files. The previous attempt to clean up this problem in
edc3ddf works for Ruby 1.8 but not 1.9.
I'd prefer to remove the shebang lines entirely, but doing so will cause
encoding errors in Ruby 1.9. This patch strives for a happy middle
ground of convincing Ruby it is actually working with Ruby while not
confusing it to think it should exec() to rspec.
This patch is the result of the following command run against the source
tree:
find spec -type f -print0 | \
xargs -0 perl -pl -i -e 's,^\#\!\s?/(.*)rspec,\#! /usr/bin/env ruby,'
|
|
* 2.7.x:
(#15346) Add spec test for --source when checking latest
(#15346) add --source to the gem list command
(Maint) Add logging for when Puppet is enabled/disabled.
(#15521) Convert to using host stub wrapper
Conflicts:
acceptance/tests/modules/install/nonexistent_directory.rb
acceptance/tests/modules/search/by_description.rb
acceptance/tests/modules/search/by_keyword.rb
acceptance/tests/modules/search/by_module_name.rb
acceptance/tests/modules/search/communication_error.rb
acceptance/tests/modules/search/formatting.rb
acceptance/tests/modules/search/multiple_search_terms.rb
acceptance/tests/modules/search/no_results.rb
lib/puppet/agent/locker.rb
|
|
This patch adds a single spec test to ensure checking the latest version
of the gem honors the source attribute and passes this as an option to
the gemlist method.
|
|
Without this patch some spec files are using `ruby -S rspec` and others
are using `rspec`.
We should standardize on a single form of the interpreter used for spec
files.
`ruby -S rspec` is the best choice because it correctly informs editors
such as Vim with Syntastic that the file is a Ruby file rather than an
Rspec file.
|
|
Previously, when the output of the gem command contained a line that didn't
match it was returned as `nil` - but the rest of the provider didn't handle
that value at all!
That led to any mismatch causing various failures to dereference `nil` as a
hash, and general failure.
This fixes this to behave significantly better by just omitting that entry in
the result, returning only the expected content.
Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
|
|
As of 2.7.12, if you had "ensure=>latest" for any gem package
resource, puppet would not correctly detect that the gem
was already installed and would attempt to install it on
every run. (This was because the "latest" method on the
gem provider was always returning an array, when it should
always be returning a single value.)
|
|
Ruby gems can have multiple versions installed, and the current
implementation of the gem provider only reads the very latest installed
version when self.instances is called. This leads to Puppet potentially
reinstalling the gem on every run if the Puppet manifest specifies a gem
that *is* installed, but is not the latest version installed.
This does require a change to how the package type checks if ensure is
insync? to handle multiple versions for the 'is' ensure value, but the
change is backward compatible with the providers that specify single
versions.
|
|
In the next commit I want to extend the specs, and I'm not confident
that the mocked resource does a good job of testing the changes I'm
about to make.
|
|
We now use a shebang of: #!/usr/bin/env rspec
This enables the direct execution of spec tests again, which was lost earlier
during the transition to more directly using the rspec2 runtime environment.
|
|
rspec2 automatically sets a bunch of load-path stuff we were by hand, so we
can just stop. As a side-effect we can now avoid a whole pile of stupid things
to try and include the spec_helper.rb file...
...and then we can stop protecting spec_helper from evaluating twice, since we
now require it with a consistent name. Yay.
Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>
|
|
* 2.6.x:
(maint) Indentation fixes
(#6490) Add plugin initialization callback system to core
Fix #4339 - Locally save the last report to $lastrunreport
Fix #4339 - Save a last run report summary to $statedir/last_run_summary.yaml
Fixed #3127 - removed legacy debug code
Fixed #3127 - Fixed gem selection regex
(#5437) Invalidate cached TypeCollection when there was an error parsing
(#6937) Adjust formatting of recurse's desc
(#6937) Document the recurse parameter of File type.
(#6893) Document the cron type in the case of specials.
(#5670) Don't trigger refresh from a failed resource
Fixed #6554 - Missing $haveftool if/else conditional in install.rb breaking Ruby 1.9
Conflicts (Manually resolved):
lib/puppet/application/agent.rb
lib/puppet/application/apply.rb
lib/puppet/configurer.rb
lib/puppet/resource/type_collection.rb
lib/puppet/type/file.rb
spec/integration/configurer_spec.rb
spec/unit/application/agent_spec.rb
spec/unit/application/apply_spec.rb
spec/unit/configurer_spec.rb
spec/unit/indirector/report/yaml_spec.rb
spec/unit/resource/type_collection_spec.rb
Paired-with: Nick Lewis
|
|
Previously if the gem json_pure was installed and you requested the
gem json then the regex matched too soon and falshly indicated that
the json gem was already installed.
Also updated to add the --no-ri and no-rdoc options and fix tests.
|
|
Doing a require to a relative path can cause files to be required more
than once when they're required from different relative paths. If you
expand the path fully, this won't happen. Ruby 1.9 also requires that
you use expand_path when doing these requires.
Paired-with: Jesse Wolfe
|
|
Replaced 106806 occurances of ^( +)(.*$) with
The ruby community almost universally (i.e. everyone but Luke, Markus, and the other eleven people
who learned ruby in the 1900s) uses two-space indentation.
3 Examples:
The code:
end
# Tell getopt which arguments are valid
def test_get_getopt_args
element = Setting.new :name => "foo", :desc => "anything", :settings => Puppet::Util::Settings.new
assert_equal([["--foo", GetoptLong::REQUIRED_ARGUMENT]], element.getopt_args, "Did not produce appropriate getopt args")
becomes:
end
# Tell getopt which arguments are valid
def test_get_getopt_args
element = Setting.new :name => "foo", :desc => "anything", :settings => Puppet::Util::Settings.new
assert_equal([["--foo", GetoptLong::REQUIRED_ARGUMENT]], element.getopt_args, "Did not produce appropriate getopt args")
The code:
assert_equal(str, val)
assert_instance_of(Float, result)
end
# Now test it with a passed object
becomes:
assert_equal(str, val)
assert_instance_of(Float, result)
end
# Now test it with a passed object
The code:
end
assert_nothing_raised do
klass[:Yay] = "boo"
klass["Cool"] = :yayness
end
becomes:
end
assert_nothing_raised do
klass[:Yay] = "boo"
klass["Cool"] = :yayness
end
|
|
Part 2 re-did the change on the spec files, which it shouldn't have.
|
|
Some spec files like active_record.rb had names that would confuse the
load path and get loaded instead of the intended implentation when the
spec was run from the same directory as the file.
Author: Matt Robinson <matt@puppetlabs.com>
Date: Fri Jun 11 15:29:33 2010 -0700
|
|
Some spec files like active_record.rb had names that would confuse the
load path and get loaded instead of the intended implentation when the
spec was run from the same directory as the file.
Author: Matt Robinson <matt@puppetlabs.com>
Date: Fri Jun 11 15:29:33 2010 -0700
|