polisher 0.10.2 → 0.11.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/binary_gem_resolver.rb +2 -2
- data/bin/bundler2yum.rb +51 -0
- data/bin/check_ruby_spec.rb +32 -0
- data/bin/gem_dependency_checker.rb +13 -242
- data/bin/gem_mapper.rb +27 -0
- data/bin/gems2update.rb +27 -0
- data/bin/git_gem_diff.rb +48 -0
- data/bin/git_gem_updater.rb +3 -3
- data/bin/missing_deps.rb +29 -0
- data/bin/polisher-config.rb +17 -0
- data/bin/ruby_rpm_spec_updater.rb +23 -2
- data/lib/polisher.rb +5 -12
- data/lib/polisher/adaptors/checker_loader.rb +78 -0
- data/lib/polisher/{upstream.rb → adaptors/upstream.rb} +1 -0
- data/lib/polisher/adaptors/version_checker.rb +57 -0
- data/lib/polisher/adaptors/version_checker/bodhi.rb +29 -0
- data/lib/polisher/adaptors/version_checker/errata.rb +29 -0
- data/lib/polisher/adaptors/version_checker/fedora.rb +29 -0
- data/lib/polisher/adaptors/version_checker/gem.rb +27 -0
- data/lib/polisher/adaptors/version_checker/git.rb +29 -0
- data/lib/polisher/adaptors/version_checker/koji.rb +29 -0
- data/lib/polisher/adaptors/version_checker/yum.rb +29 -0
- data/lib/polisher/cli/all.rb +22 -0
- data/lib/polisher/cli/bin/gem_dependency_checker.rb +85 -0
- data/lib/polisher/cli/bin/gem_mapper.rb +37 -0
- data/lib/polisher/cli/bin/gems2update.rb +86 -0
- data/lib/polisher/cli/bin/missing_deps.rb +35 -0
- data/lib/polisher/cli/conf.rb +18 -0
- data/lib/polisher/cli/default.rb +25 -0
- data/lib/polisher/cli/format.rb +130 -0
- data/lib/polisher/cli/sources.rb +106 -0
- data/lib/polisher/cli/specifier.rb +30 -0
- data/lib/polisher/cli/status.rb +50 -0
- data/lib/polisher/cli/targets.rb +88 -0
- data/lib/polisher/gem.rb +41 -338
- data/lib/polisher/gem/attributes.rb +20 -0
- data/lib/polisher/gem/dependencies.rb +63 -0
- data/lib/polisher/gem/diff.rb +39 -0
- data/lib/polisher/gem/files.rb +111 -0
- data/lib/polisher/gem/parser.rb +85 -0
- data/lib/polisher/gem/retriever.rb +137 -0
- data/lib/polisher/{gem_state.rb → gem/state.rb} +6 -6
- data/lib/polisher/gem/versions.rb +131 -0
- data/lib/polisher/gemfile.rb +20 -89
- data/lib/polisher/gemfile/attributes.rb +19 -0
- data/lib/polisher/gemfile/deps.rb +43 -0
- data/lib/polisher/gemfile/parser.rb +45 -0
- data/lib/polisher/git/pkg.rb +33 -238
- data/lib/polisher/git/pkg/attributes.rb +60 -0
- data/lib/polisher/git/pkg/builder.rb +47 -0
- data/lib/polisher/git/pkg/repo.rb +82 -0
- data/lib/polisher/git/pkg/updater.rb +53 -0
- data/lib/polisher/git/pkg/versions.rb +40 -0
- data/lib/polisher/git/project.rb +1 -1
- data/lib/polisher/git/repo.rb +79 -76
- data/lib/polisher/{vendor.rb → mixins/vendored_deps.rb} +4 -7
- data/lib/polisher/mixins/versioned_dependencies.rb +86 -0
- data/lib/polisher/record.rb +2 -0
- data/lib/polisher/rpm.rb +23 -0
- data/lib/polisher/rpm/patch.rb +10 -8
- data/lib/polisher/rpm/requirement.rb +33 -189
- data/lib/polisher/rpm/requirement/attributes.rb +43 -0
- data/lib/polisher/rpm/requirement/comparison.rb +97 -0
- data/lib/polisher/rpm/requirement/gem_reference.rb +46 -0
- data/lib/polisher/rpm/requirement/parser.rb +41 -0
- data/lib/polisher/rpm/spec.rb +97 -436
- data/lib/polisher/rpm/spec/check.rb +14 -0
- data/lib/polisher/rpm/spec/comparison.rb +64 -0
- data/lib/polisher/rpm/spec/files.rb +15 -0
- data/lib/polisher/rpm/spec/gem_files.rb +65 -0
- data/lib/polisher/rpm/spec/gem_reference.rb +59 -0
- data/lib/polisher/rpm/spec/gem_requirements.rb +73 -0
- data/lib/polisher/rpm/spec/parser.rb +106 -0
- data/lib/polisher/rpm/spec/requirements.rb +31 -0
- data/lib/polisher/rpm/spec/subpackages.rb +23 -0
- data/lib/polisher/rpm/spec/updater.rb +268 -0
- data/lib/polisher/specifier.rb +13 -0
- data/lib/polisher/targets.rb +36 -0
- data/lib/polisher/{apt.rb → targets/apt.rb} +1 -1
- data/lib/polisher/targets/bodhi.rb +43 -0
- data/lib/polisher/{bugzilla.rb → targets/bugzilla.rb} +1 -1
- data/lib/polisher/targets/errata.rb +55 -0
- data/lib/polisher/targets/errata/build.rb +24 -0
- data/lib/polisher/targets/fedora.rb +47 -0
- data/lib/polisher/targets/koji.rb +39 -0
- data/lib/polisher/targets/koji/builder.rb +38 -0
- data/lib/polisher/targets/koji/diff.rb +39 -0
- data/lib/polisher/targets/koji/rpc.rb +43 -0
- data/lib/polisher/targets/koji/versions.rb +67 -0
- data/lib/polisher/targets/rhn.rb +12 -0
- data/lib/polisher/targets/yum.rb +36 -0
- data/lib/polisher/{component.rb → util/component.rb} +3 -3
- data/lib/polisher/util/conf_helpers.rb +77 -0
- data/lib/polisher/util/config.rb +45 -0
- data/lib/polisher/util/core_ext.rb +59 -0
- data/lib/polisher/{error.rb → util/error.rb} +0 -0
- data/lib/polisher/{gem_cache.rb → util/gem_cache.rb} +1 -1
- data/lib/polisher/{git_cache.rb → util/git_cache.rb} +0 -0
- data/lib/polisher/{logger.rb → util/logger.rb} +2 -0
- data/lib/polisher/{tag_mapper.rb → util/tag_mapper.rb} +1 -1
- data/lib/polisher/version.rb +1 -1
- data/spec/{upstream_spec.rb → adaptors/upstream_spec.rb} +1 -1
- data/spec/{version_checker_spec.rb → adaptors/version_checker_spec.rb} +1 -6
- data/spec/data/activesupport-4.1.4.gem +0 -0
- data/spec/data/rubygem-activesupport-with-doc.spec +247 -0
- data/spec/data/rubygem-activesupport-without-requires.spec +232 -0
- data/spec/data/rubygem-activesupport.spec +0 -122
- data/spec/fixtures/gem_json.rb +49 -0
- data/spec/fixtures/gem_spec.rb +13 -0
- data/spec/fixtures/gemfile.rb +10 -0
- data/spec/fixtures/local_gem.rb +62 -0
- data/spec/fixtures/rpm_spec.rb +91 -0
- data/spec/gem/attributes_spec.rb +17 -0
- data/spec/gem/diff_spec.rb +80 -0
- data/spec/gem/files_spec.rb +171 -0
- data/spec/gem/parser_spec.rb +44 -0
- data/spec/gem/retriever_spec.rb +124 -0
- data/spec/gem/state_spec.rb +79 -0
- data/spec/gem/versions_spec.rb +148 -0
- data/spec/gem_spec.rb +5 -347
- data/spec/gemfile/deps_spec.rb +20 -0
- data/spec/gemfile/parser_spec.rb +26 -0
- data/spec/gemfile_spec.rb +0 -34
- data/spec/git/pkg/attributes_spec.rb +128 -0
- data/spec/git/pkg/builder_spec.rb +63 -0
- data/spec/git/pkg/repo_spec.rb +146 -0
- data/spec/git/pkg/updater_spec.rb +86 -0
- data/spec/git/pkg/versions_spec.rb +42 -0
- data/spec/git/pkg_spec.rb +21 -0
- data/spec/git/project_spec.rb +21 -0
- data/spec/git/repo_spec.rb +160 -0
- data/spec/{vendor_spec.rb → mixins/vendored_deps_spec.rb} +2 -4
- data/spec/mixins/versioned_dependencies_spec.rb +48 -0
- data/spec/rpm/patch_spec.rb +48 -0
- data/spec/rpm/requirement/attributes_spec.rb +34 -0
- data/spec/rpm/requirement/comparison_spec.rb +286 -0
- data/spec/rpm/requirement/gem_spec.rb +49 -0
- data/spec/rpm/requirement/parser_spec.rb +31 -0
- data/spec/rpm/requirement_spec.rb +8 -334
- data/spec/rpm/spec/check_spec.rb +25 -0
- data/spec/rpm/spec/comparison_spec.rb +55 -0
- data/spec/rpm/spec/files_spec.rb +17 -0
- data/spec/rpm/spec/gem_files_spec.rb +112 -0
- data/spec/rpm/spec/gem_reference_spec.rb +99 -0
- data/spec/rpm/spec/gem_requirement_spec.rb +38 -0
- data/spec/rpm/spec/parser_spec.rb +64 -0
- data/spec/rpm/spec/requirements_spec.rb +10 -0
- data/spec/rpm/spec/subpackages_spec.rb +38 -0
- data/spec/rpm/spec/updater_spec.rb +486 -0
- data/spec/rpm/spec_spec.rb +27 -174
- data/spec/spec_helper.rb +7 -107
- data/spec/support/coveralls.rb +10 -0
- data/spec/support/fixtures.rb +8 -0
- data/spec/support/paths.rb +20 -0
- data/spec/support/rspec.rb +20 -0
- data/spec/support/vcr.rb +11 -0
- data/spec/{bodhi_spec.rb → targets/bodhi_spec.rb} +3 -1
- data/spec/{errata_spec.rb → targets/errata_spec.rb} +2 -2
- data/spec/{fedora_spec.rb → targets/fedora_spec.rb} +3 -3
- data/spec/targets/koji/builder_spec.rb +48 -0
- data/spec/targets/koji/diff_spec.rb +36 -0
- data/spec/targets/koji/rpc_spec.rb +28 -0
- data/spec/{koji_spec.rb → targets/koji/versions_spec.rb} +1 -59
- data/spec/targets/koji_spec.rb +11 -0
- data/spec/{yum_spec.rb → targets/yum_spec.rb} +1 -1
- data/spec/{component_spec.rb → util/component_spec.rb} +1 -1
- data/spec/{core_spec.rb → util/core_ext_spec.rb} +2 -3
- metadata +278 -88
- data/lib/polisher/bodhi.rb +0 -23
- data/lib/polisher/config.rb +0 -32
- data/lib/polisher/core.rb +0 -101
- data/lib/polisher/errata.rb +0 -75
- data/lib/polisher/fedora.rb +0 -46
- data/lib/polisher/git.rb +0 -8
- data/lib/polisher/koji.rb +0 -159
- data/lib/polisher/rhn.rb +0 -15
- data/lib/polisher/version_checker.rb +0 -177
- data/lib/polisher/yum.rb +0 -37
- data/spec/git_spec.rb +0 -445
@@ -114,125 +114,3 @@ popd
|
|
114
114
|
|
115
115
|
* Tue Mar 19 2013 Vít Ondruch <vondruch@redhat.com> - 1:3.2.13-1
|
116
116
|
- Update to ActiveSupport 3.2.13.
|
117
|
-
|
118
|
-
* Fri Mar 01 2013 Vít Ondruch <vondruch@redhat.com> - 1:3.2.12-2
|
119
|
-
- Rebuild for https://fedoraproject.org/wiki/Features/Ruby_2.0.0
|
120
|
-
|
121
|
-
* Tue Feb 12 2013 Vít Ondruch <vondruch@redhat.com> - 1:3.2.12-1
|
122
|
-
- Update to ActiveSupport 3.2.12.
|
123
|
-
|
124
|
-
* Wed Jan 09 2013 Vít Ondruch <vondruch@redhat.com> - 1:3.2.11-1
|
125
|
-
- Update to ActiveSupport 3.2.11.
|
126
|
-
|
127
|
-
* Thu Jan 03 2013 Vít Ondruch <vondruch@redhat.com> - 1:3.2.10-1
|
128
|
-
- Update to ActiveSupport 3.2.10.
|
129
|
-
|
130
|
-
* Mon Aug 13 2012 Vít Ondruch <vondruch@redhat.com> - 1:3.2.8-1
|
131
|
-
- Update to ActiveSupport 3.2.8.
|
132
|
-
|
133
|
-
* Mon Jul 30 2012 Vít Ondruch <vondruch@redhat.com> - 1:3.2.7-1
|
134
|
-
- Update to ActiveSupport 3.2.7.
|
135
|
-
|
136
|
-
* Wed Jul 18 2012 Bohuslav Kabrda <bkabrda@redhat.com> - 1:3.2.6-1
|
137
|
-
- Update to ActiveSupport 3.2.6.
|
138
|
-
- Removed unneeded BuildRoot tag.
|
139
|
-
- Tests no longer fail with newer versions of Mocha, remove workaround.
|
140
|
-
|
141
|
-
* Fri Jun 15 2012 Vít Ondruch <vondruch@redhat.com> - 1:3.0.15-1
|
142
|
-
- Update to ActiveSupport 3.0.15.
|
143
|
-
|
144
|
-
* Fri Jun 01 2012 Vít Ondruch <vondruch@redhat.com> - 1:3.0.13-1
|
145
|
-
- Update to ActiveSupport 3.0.13.
|
146
|
-
|
147
|
-
* Wed Apr 18 2012 Bohuslav Kabrda <bkabrda@redhat.com> - 1:3.0.11-5
|
148
|
-
- Add the bigdecimal dependency to gemspec.
|
149
|
-
|
150
|
-
* Fri Mar 16 2012 Bohuslav Kabrda <bkabrda@redhat.com> - 1:3.0.11-4
|
151
|
-
- The CVE patch name now contains the CVE id.
|
152
|
-
|
153
|
-
* Mon Mar 05 2012 Bohuslav Kabrda <bkabrda@redhat.com> - 1:3.0.11-3
|
154
|
-
- Patch for CVE-2012-1098
|
155
|
-
|
156
|
-
* Tue Jan 24 2012 Bohuslav Kabrda <bkabrda@redhat.com> - 1:3.0.11-1
|
157
|
-
- Rebuilt for Ruby 1.9.3.
|
158
|
-
- Update to ActiveSupport 3.0.11.
|
159
|
-
|
160
|
-
* Mon Aug 22 2011 Vít Ondruch <vondruch@redhat.com> - 1:3.0.10-1
|
161
|
-
- Update to ActiveSupport 3.0.10
|
162
|
-
|
163
|
-
* Fri Jul 01 2011 Vít Ondruch <vondruch@redhat.com> - 1:3.0.9-1
|
164
|
-
- Update to ActiveSupport 3.0.9
|
165
|
-
- Changed %%define into %%global
|
166
|
-
- Removed unnecessary %%clean section
|
167
|
-
|
168
|
-
* Thu Jun 16 2011 Mo Morsi <mmorsi@redhat.com> - 1:3.0.5-3
|
169
|
-
- Reverting accidental change adding a few gem flags
|
170
|
-
|
171
|
-
* Thu Jun 16 2011 Mo Morsi <mmorsi@redhat.com> - 1:3.0.5-2
|
172
|
-
- Include fix for CVE-2011-2197
|
173
|
-
|
174
|
-
* Thu Mar 24 2011 Vít Ondruch <vondruch@redhat.com> - 1:3.0.5-1
|
175
|
-
- Update to ActiveSupport 3.0.5
|
176
|
-
- Remove Rake dependnecy
|
177
|
-
|
178
|
-
* Mon Feb 14 2011 Mohammed Morsi <mmorsi@redhat.com> - 1:3.0.3-4
|
179
|
-
- fix bad dates in the spec changelog
|
180
|
-
|
181
|
-
* Thu Feb 10 2011 Mohammed Morsi <mmorsi@redhat.com> - 1:3.0.3-3
|
182
|
-
- include i18n runtime dependency
|
183
|
-
|
184
|
-
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:3.0.3-2
|
185
|
-
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
|
186
|
-
|
187
|
-
* Mon Jan 10 2011 Mohammed Morsi <mmorsi@redhat.com> - 1:3.0.3-1
|
188
|
-
- update to rails 3
|
189
|
-
|
190
|
-
* Wed Aug 25 2010 Mohammed Morsi <mmorsi@redhat.com> - 1:2.3.8-2
|
191
|
-
- bumped version
|
192
|
-
|
193
|
-
* Wed Aug 04 2010 Mohammed Morsi <mmorsi@redhat.com> - 1:2.3.8-1
|
194
|
-
- Update to 2.3.8
|
195
|
-
- Added check section with rubygem-mocha dependency
|
196
|
-
- Added upsteam Rakefile and test suite to run tests
|
197
|
-
|
198
|
-
* Thu Jan 28 2010 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 1:2.3.5-1
|
199
|
-
- Update to 2.3.5
|
200
|
-
|
201
|
-
* Wed Oct 7 2009 David Lutterkort <lutter@redhat.com> - 1:2.3.4-2
|
202
|
-
- Bump Epoch to ensure upgrade path from F-11
|
203
|
-
|
204
|
-
* Mon Sep 7 2009 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp> - 2.3.4-1
|
205
|
-
- Update to 2.3.4 (bug 520843, CVE-2009-3009)
|
206
|
-
|
207
|
-
* Sun Jul 26 2009 Jeroen van Meeuwen <j.van.meeuwen@ogd.nl> - 2.3.3-1
|
208
|
-
- New upstream version
|
209
|
-
|
210
|
-
* Mon Mar 16 2009 Jeroen van Meeuwen <kanarip@fedoraproject.org> - 2.3.2-1
|
211
|
-
- New upstream version
|
212
|
-
|
213
|
-
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2.2-2
|
214
|
-
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
|
215
|
-
|
216
|
-
* Mon Nov 24 2008 Jeroen van Meeuwen <kanarip@fedoraproject.org> - 2.2.2-1
|
217
|
-
- New upstream version
|
218
|
-
|
219
|
-
* Tue Sep 16 2008 David Lutterkort <dlutter@redhat.com> - 2.1.1-1
|
220
|
-
- New version (fixes CVE-2008-4094)
|
221
|
-
|
222
|
-
* Thu Jul 31 2008 Michael Stahnke <stahnma@fedoraproject.org> - 2.1.0-1
|
223
|
-
- New Upstream
|
224
|
-
|
225
|
-
* Mon Apr 07 2008 David Lutterkort <dlutter@redhat.com> - 2.0.2-1
|
226
|
-
- New version
|
227
|
-
|
228
|
-
* Mon Dec 10 2007 David Lutterkort <dlutter@redhat.com> - 2.0.1-1
|
229
|
-
- New version
|
230
|
-
|
231
|
-
* Wed Nov 28 2007 David Lutterkort <dlutter@redhat.com> - 1.4.4-3
|
232
|
-
- Fix buildroot
|
233
|
-
|
234
|
-
* Tue Nov 13 2007 David Lutterkort <dlutter@redhat.com> - 1.4.4-2
|
235
|
-
- Install README and CHANGELOG in _docdir
|
236
|
-
|
237
|
-
* Tue Oct 30 2007 David Lutterkort <dlutter@redhat.com> - 1.4.4-1
|
238
|
-
- Initial package
|
@@ -0,0 +1,49 @@
|
|
1
|
+
module Polisher
|
2
|
+
module Test
|
3
|
+
module Fixtures
|
4
|
+
class GemJson
|
5
|
+
def url
|
6
|
+
@url ||="https://rubygems.org/api/v1/gems/rails.json"
|
7
|
+
end
|
8
|
+
|
9
|
+
def json_path
|
10
|
+
@json_path ||= "#{data_dir}/rails.json"
|
11
|
+
end
|
12
|
+
|
13
|
+
def json
|
14
|
+
@json ||= File.read(json_path)
|
15
|
+
end
|
16
|
+
|
17
|
+
def name
|
18
|
+
@name ||= 'rails'
|
19
|
+
end
|
20
|
+
|
21
|
+
def version
|
22
|
+
@version ||= '4.0.1'
|
23
|
+
end
|
24
|
+
|
25
|
+
def deps
|
26
|
+
@deps ||= [::Gem::Dependency.new("actionmailer", '= 4.0.1'),
|
27
|
+
::Gem::Dependency.new("actionpack", '= 4.0.1'),
|
28
|
+
::Gem::Dependency.new("activerecord", '= 4.0.1'),
|
29
|
+
::Gem::Dependency.new("activesupport", '= 4.0.1'),
|
30
|
+
::Gem::Dependency.new("bundler", "< 2.0", ">= 1.3.0"),
|
31
|
+
::Gem::Dependency.new("railties", '= 4.0.1'),
|
32
|
+
::Gem::Dependency.new("sprockets-rails", '~> 2.0.0')]
|
33
|
+
end
|
34
|
+
|
35
|
+
def dev_deps
|
36
|
+
@dev_deps ||= []
|
37
|
+
end
|
38
|
+
|
39
|
+
def [](key)
|
40
|
+
self.send(key.intern)
|
41
|
+
end
|
42
|
+
end # class GemJson
|
43
|
+
end # module Fixtures
|
44
|
+
|
45
|
+
def gem_json
|
46
|
+
@gem_json ||= Fixtures::GemJson.new
|
47
|
+
end
|
48
|
+
end # module Test
|
49
|
+
end # module Polisher
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module Polisher
|
2
|
+
module Test
|
3
|
+
GEM_SPEC = {
|
4
|
+
:path => "#{data_dir}/mysql-2.9.1.gemspec",
|
5
|
+
:name => 'mysql',
|
6
|
+
:version => '2.9.1',
|
7
|
+
:deps => [],
|
8
|
+
:dev_deps => [::Gem::Dependency.new('rdoc', '~> 3.10', :development),
|
9
|
+
::Gem::Dependency.new('rake-compiler', '~> 0.8.1', :development),
|
10
|
+
::Gem::Dependency.new('hoe', '~> 3.5', :development)]
|
11
|
+
}
|
12
|
+
end # module Test
|
13
|
+
end # module Polisher
|
@@ -0,0 +1,10 @@
|
|
1
|
+
module Polisher
|
2
|
+
module Test
|
3
|
+
GEMFILE = {
|
4
|
+
:path => "#{data_dir}/Gemfile",
|
5
|
+
:contents => File.read("#{data_dir}/Gemfile"),
|
6
|
+
:deps => [::Gem::Dependency.new("rubygems", ::Gem::Requirement.new([">= 0"]), :runtime),
|
7
|
+
::Gem::Dependency.new("cinch", ::Gem::Requirement.new([">= 0"]), :runtime)]
|
8
|
+
}
|
9
|
+
end # module Test
|
10
|
+
end # module Polisher
|
@@ -0,0 +1,62 @@
|
|
1
|
+
module Polisher
|
2
|
+
module Test
|
3
|
+
module Fixtures
|
4
|
+
class LocalGem
|
5
|
+
def name
|
6
|
+
@name ||= 'rspec'
|
7
|
+
end
|
8
|
+
|
9
|
+
def version
|
10
|
+
@version ||= '2.12.0'
|
11
|
+
end
|
12
|
+
|
13
|
+
def json_url
|
14
|
+
@json_url ||= "https://rubygems.org/api/v1/gems/#{name}.json"
|
15
|
+
end
|
16
|
+
|
17
|
+
def json_path
|
18
|
+
@json_path ||= "#{data_dir}/#{name}.json"
|
19
|
+
end
|
20
|
+
|
21
|
+
def json
|
22
|
+
@json ||= File.read(json_path)
|
23
|
+
end
|
24
|
+
|
25
|
+
def gem_path
|
26
|
+
@gem_contents_path ||= "#{data_dir}/#{name}-#{version}.gem"
|
27
|
+
end
|
28
|
+
|
29
|
+
def gem
|
30
|
+
@gem ||= File.read(local_gem_contents_path)
|
31
|
+
end
|
32
|
+
|
33
|
+
def url
|
34
|
+
@gem_url ||= "https://rubygems.org/gems/#{name}-#{version}.gem"
|
35
|
+
end
|
36
|
+
|
37
|
+
def deps
|
38
|
+
@deps ||= [::Gem::Dependency.new('rspec-core', '~> 2.14.0'),
|
39
|
+
::Gem::Dependency.new('rspec-expectations', '~> 2.14.0'),
|
40
|
+
::Gem::Dependency.new('rspec-mocks', '~> 2.14.0')]
|
41
|
+
end
|
42
|
+
|
43
|
+
def dev_deps
|
44
|
+
@dev_deps ||= []
|
45
|
+
end
|
46
|
+
|
47
|
+
def files
|
48
|
+
@files ||= ['License.txt', 'README.md', 'lib', 'lib/rspec',
|
49
|
+
'lib/rspec/version.rb', 'lib/rspec.rb']
|
50
|
+
end
|
51
|
+
|
52
|
+
def [](key)
|
53
|
+
self.send(key.intern)
|
54
|
+
end
|
55
|
+
end # class LocalGem
|
56
|
+
end # module Fixtures
|
57
|
+
|
58
|
+
def local_gem
|
59
|
+
@local_gem ||= Fixtures::LocalGem.new
|
60
|
+
end
|
61
|
+
end # module Test
|
62
|
+
end # module Polisher
|
@@ -0,0 +1,91 @@
|
|
1
|
+
require 'polisher/rpm/requirement'
|
2
|
+
|
3
|
+
module Polisher
|
4
|
+
module Test
|
5
|
+
module Fixtures
|
6
|
+
class RpmSpec
|
7
|
+
def path
|
8
|
+
@path ||= "#{data_dir}/rubygem-activesupport.spec"
|
9
|
+
end
|
10
|
+
|
11
|
+
def contents
|
12
|
+
@contents ||= File.read(path)
|
13
|
+
end
|
14
|
+
|
15
|
+
def name
|
16
|
+
@name ||= "activesupport"
|
17
|
+
end
|
18
|
+
|
19
|
+
def version
|
20
|
+
@version ||= "4.0.0"
|
21
|
+
end
|
22
|
+
|
23
|
+
def release
|
24
|
+
@release ||= "1%{?dist}"
|
25
|
+
end
|
26
|
+
|
27
|
+
def requires
|
28
|
+
@requires ||= [Polisher::RPM::Requirement.parse("ruby(rubygems)"),
|
29
|
+
Polisher::RPM::Requirement.parse("ruby(release)"),
|
30
|
+
Polisher::RPM::Requirement.parse("rubygem(bigdecimal)"),
|
31
|
+
Polisher::RPM::Requirement.parse("rubygem(dalli)"),
|
32
|
+
Polisher::RPM::Requirement.parse("rubygem(i18n) >= 0.6"),
|
33
|
+
Polisher::RPM::Requirement.parse("rubygem(i18n) < 1.0"),
|
34
|
+
Polisher::RPM::Requirement.parse("rubygem(minitest) >= 4.2"),
|
35
|
+
Polisher::RPM::Requirement.parse("rubygem(minitest) < 5"),
|
36
|
+
Polisher::RPM::Requirement.parse("rubygem(multi_json) >= 1.0"),
|
37
|
+
Polisher::RPM::Requirement.parse("rubygem(multi_json) < 2"),
|
38
|
+
Polisher::RPM::Requirement.parse("rubygem(rack)"),
|
39
|
+
Polisher::RPM::Requirement.parse("rubygem(thread_safe)"),
|
40
|
+
Polisher::RPM::Requirement.parse("rubygem(tzinfo) >= 0.3.37"),
|
41
|
+
Polisher::RPM::Requirement.parse("rubygem(tzinfo) < 0.4.0")]
|
42
|
+
end
|
43
|
+
|
44
|
+
def build_requires
|
45
|
+
@build_requires ||= [Polisher::RPM::Requirement.parse("rubygems-devel"),
|
46
|
+
Polisher::RPM::Requirement.parse("rubygem(bigdecimal)"),
|
47
|
+
Polisher::RPM::Requirement.parse("rubygem(builder)"),
|
48
|
+
Polisher::RPM::Requirement.parse("rubygem(dalli)"),
|
49
|
+
Polisher::RPM::Requirement.parse("rubygem(i18n) >= 0.6"),
|
50
|
+
Polisher::RPM::Requirement.parse("rubygem(i18n) < 1.0"),
|
51
|
+
Polisher::RPM::Requirement.parse("rubygem(minitest)"),
|
52
|
+
Polisher::RPM::Requirement.parse("rubygem(mocha)"),
|
53
|
+
Polisher::RPM::Requirement.parse("rubygem(multi_json) >= 1.0"),
|
54
|
+
Polisher::RPM::Requirement.parse("rubygem(multi_json) < 2"),
|
55
|
+
Polisher::RPM::Requirement.parse("rubygem(rack)"),
|
56
|
+
Polisher::RPM::Requirement.parse("rubygem(thread_safe)"),
|
57
|
+
Polisher::RPM::Requirement.parse("rubygem(tzinfo) >= 0.3.37"),
|
58
|
+
Polisher::RPM::Requirement.parse("rubygem(tzinfo) < 0.4.0")]
|
59
|
+
end
|
60
|
+
|
61
|
+
def changelog
|
62
|
+
@changelog ||= <<EOS
|
63
|
+
* Fri Aug 09 2013 Josef Stribny <jstribny@redhat.com> - 1:4.0.0-2
|
64
|
+
- Fix: add minitest to requires
|
65
|
+
|
66
|
+
* Tue Jul 30 2013 Josef Stribny <jstribny@redhat.com> - 1:4.0.0-1
|
67
|
+
- Update to ActiveSupport 4.0.0.
|
68
|
+
|
69
|
+
* Tue Mar 19 2013 Vít Ondruch <vondruch@redhat.com> - 1:3.2.13-1
|
70
|
+
- Update to ActiveSupport 3.2.13.
|
71
|
+
EOS
|
72
|
+
end
|
73
|
+
|
74
|
+
def files
|
75
|
+
@files ||= {"activesupport" => ["%dir %{gem_instdir}", "%doc %{gem_instdir}/CHANGELOG.md",
|
76
|
+
"%{gem_libdir}", "%doc %{gem_instdir}/MIT-LICENSE",
|
77
|
+
"%doc %{gem_instdir}/README.rdoc", "%doc %{gem_docdir}",
|
78
|
+
"%{gem_cache}", "%{gem_spec}", "%{gem_instdir}/test"]}
|
79
|
+
end
|
80
|
+
|
81
|
+
def [](key)
|
82
|
+
self.send(key.intern)
|
83
|
+
end
|
84
|
+
end # class RpmSpec
|
85
|
+
end # module Fixtures
|
86
|
+
|
87
|
+
def rpm_spec
|
88
|
+
@rpm_spec ||= Fixtures::RpmSpec.new
|
89
|
+
end
|
90
|
+
end # module Test
|
91
|
+
end # module Polisher
|
@@ -0,0 +1,17 @@
|
|
1
|
+
#
|
2
|
+
# Licensed under the MIT license
|
3
|
+
# Copyright (C) 2013-2014 Red Hat, Inc.
|
4
|
+
|
5
|
+
require 'polisher/gem'
|
6
|
+
|
7
|
+
module Polisher
|
8
|
+
describe Gem do
|
9
|
+
describe "#file_name" do
|
10
|
+
it "returns name-version.gem" do
|
11
|
+
expected = 'rails-4.0.0.gem'
|
12
|
+
Polisher::Gem.new(:name => 'rails', :version => '4.0.0')
|
13
|
+
.file_name.should == expected
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end # describe Gem
|
17
|
+
end # module Polisher
|
@@ -0,0 +1,80 @@
|
|
1
|
+
#
|
2
|
+
# Licensed under the MIT license
|
3
|
+
# Copyright (C) 2013-2014 Red Hat, Inc.
|
4
|
+
|
5
|
+
require 'polisher/gem'
|
6
|
+
require 'polisher/git/repo'
|
7
|
+
require 'awesome_spawn'
|
8
|
+
|
9
|
+
module Polisher
|
10
|
+
describe Gem do
|
11
|
+
describe "#diff" do
|
12
|
+
before(:each) do
|
13
|
+
@gem1 = described_class.new
|
14
|
+
@gem2 = described_class.new
|
15
|
+
@repo = Polisher::Git::Repo.new
|
16
|
+
@result = AwesomeSpawn::CommandResult.new '', 'diff_out', '', 0
|
17
|
+
end
|
18
|
+
|
19
|
+
it "requires awesome_spawn dependency" do
|
20
|
+
@gem1.should_receive(:require_dep!).with('awesome_spawn')
|
21
|
+
@gem1.diff(@gem2)
|
22
|
+
end
|
23
|
+
|
24
|
+
it "requires diff cmd" do
|
25
|
+
@gem1.should_receive(:require_cmd!).with(@gem1.diff_cmd)
|
26
|
+
@gem1.diff(@gem2)
|
27
|
+
end
|
28
|
+
|
29
|
+
it "runs diff against unpacked local and other gems and returns output" do
|
30
|
+
@gem1.should_receive(:unpack).and_return('dir1')
|
31
|
+
@gem2.should_receive(:unpack).and_return('dir2')
|
32
|
+
AwesomeSpawn.should_receive(:run)
|
33
|
+
.with("#{Polisher::Gem.diff_cmd} -r dir1 dir2")
|
34
|
+
.and_return(@result)
|
35
|
+
@gem1.diff(@gem2).should == @result.output
|
36
|
+
end
|
37
|
+
|
38
|
+
it "runs diff against unpacked local gem and git repo and returns output" do
|
39
|
+
@gem1.should_receive(:unpack).and_return('dir1')
|
40
|
+
@repo.should_receive(:path).and_return('dir2')
|
41
|
+
AwesomeSpawn.should_receive(:run)
|
42
|
+
.with("#{Polisher::Gem.diff_cmd} -r dir1 dir2")
|
43
|
+
.and_return(@result)
|
44
|
+
@gem1.diff(@repo).should == @result.output
|
45
|
+
end
|
46
|
+
|
47
|
+
it "replaces directories in output" do
|
48
|
+
@gem1.should_receive(:unpack).and_return('dir1')
|
49
|
+
@gem2.should_receive(:unpack).and_return('dir2')
|
50
|
+
@result = AwesomeSpawn::CommandResult.new '', 'dir1Adir2B', '', 0
|
51
|
+
AwesomeSpawn.should_receive(:run).and_return(@result)
|
52
|
+
@gem1.diff(@gem2).should == 'aAbB'
|
53
|
+
end
|
54
|
+
|
55
|
+
it "removes unpacked gem dirs" do
|
56
|
+
@gem1.should_receive(:unpack).and_return('dir1')
|
57
|
+
@gem2.should_receive(:unpack).and_return('dir2')
|
58
|
+
AwesomeSpawn.should_receive(:run).and_return(@result)
|
59
|
+
FileUtils.should_receive(:rm_rf).with('dir1')
|
60
|
+
FileUtils.should_receive(:rm_rf).with('dir2')
|
61
|
+
# XXX for the GemCache dir cleaning:
|
62
|
+
FileUtils.should_receive(:rm_rf).at_least(:once)
|
63
|
+
@gem1.diff(@gem2)
|
64
|
+
end
|
65
|
+
|
66
|
+
context "error during operations" do
|
67
|
+
it "removes unpacked gem dirs" do
|
68
|
+
@gem1.should_receive(:unpack).and_return('dir1')
|
69
|
+
@gem2.should_receive(:unpack).and_return('dir2')
|
70
|
+
AwesomeSpawn.should_receive(:run).
|
71
|
+
and_raise(AwesomeSpawn::CommandResultError.new('', ''))
|
72
|
+
FileUtils.should_receive(:rm_rf).with('dir1')
|
73
|
+
FileUtils.should_receive(:rm_rf).with('dir2')
|
74
|
+
FileUtils.should_receive(:rm_rf).at_least(:once)
|
75
|
+
@gem1.diff(@gem2)
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end # describe Gem
|
80
|
+
end # module Polisher
|