stickler-mirror 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,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NWUwZGQzNzIzMDYzNGE3MWVmMTNmNDZkNGUzY2VkZDA0YzRlMjAwMA==
5
+ data.tar.gz: !binary |-
6
+ NWQ2ZDNlYTEyN2MyODU5MjI3M2FhYzE2ZDVlZTc1YTFlNGQzYTBlOA==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ NjNlMmMzZmM5NjFmOTE0NzVlM2YyZjBjY2JiMWE5Mjc5MWNlZWU5NzU4Y2Fi
10
+ YTEwMGJjZWExNmQ5NGRhMzg3MjhiMTkxNzAxYjEyN2ZjN2Q1MTM4ZjVmMDBm
11
+ NDdlYjQwNjJiNzcyMjIwMGEzZjdiMTUxOWZkZDJkNzJiNzIwYWM=
12
+ data.tar.gz: !binary |-
13
+ NmNkYTJhYTI4ODQ1OTZkYjJmOTQ4OGM3YjcyNWE1MmFkMjkzYzA2NWYwNzQ2
14
+ MWZmOTgwMmVjNjY1MDNkNzcxZGU4YTc0M2ZkODE2N2E3MzdlNzQyOTY5OTBm
15
+ NzIzMTY5NTc5NzAwZDZkM2RmMTMwZjVlOTY4NmRmZjgwNmI0NzU=
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in stickler-mirror.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,193 @@
1
+ Copyright (c) 2013 Sebastian Schulze
2
+
3
+ Apache License
4
+ Version 2.0, January 2004
5
+ http://www.apache.org/licenses/
6
+
7
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
8
+
9
+ 1. Definitions.
10
+
11
+ "License" shall mean the terms and conditions for use, reproduction, and
12
+ distribution as defined by Sections 1 through 9 of this document.
13
+
14
+ "Licensor" shall mean the copyright owner or entity authorized by the copyright
15
+ owner that is granting the License.
16
+
17
+ "Legal Entity" shall mean the union of the acting entity and all other entities
18
+ that control, are controlled by, or are under common control with that entity.
19
+ For the purposes of this definition, "control" means (i) the power, direct or
20
+ indirect, to cause the direction or management of such entity, whether by
21
+ contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity exercising
25
+ permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications, including
28
+ but not limited to software source code, documentation source, and configuration
29
+ files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical transformation or
32
+ translation of a Source form, including but not limited to compiled object code,
33
+ generated documentation, and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or Object form, made
36
+ available under the License, as indicated by a copyright notice that is included
37
+ in or attached to the work (an example is provided in the Appendix below).
38
+
39
+ "Derivative Works" shall mean any work, whether in Source or Object form, that
40
+ is based on (or derived from) the Work and for which the editorial revisions,
41
+ annotations, elaborations, or other modifications represent, as a whole, an
42
+ original work of authorship. For the purposes of this License, Derivative Works
43
+ shall not include works that remain separable from, or merely link (or bind by
44
+ name) to the interfaces of, the Work and Derivative Works thereof.
45
+
46
+ "Contribution" shall mean any work of authorship, including the original version
47
+ of the Work and any modifications or additions to that Work or Derivative Works
48
+ thereof, that is intentionally submitted to Licensor for inclusion in the Work
49
+ by the copyright owner or by an individual or Legal Entity authorized to submit
50
+ on behalf of the copyright owner. For the purposes of this definition,
51
+ "submitted" means any form of electronic, verbal, or written communication sent
52
+ to the Licensor or its representatives, including but not limited to
53
+ communication on electronic mailing lists, source code control systems, and
54
+ issue tracking systems that are managed by, or on behalf of, the Licensor for
55
+ the purpose of discussing and improving the Work, but excluding communication
56
+ that is conspicuously marked or otherwise designated in writing by the copyright
57
+ owner as "Not a Contribution."
58
+
59
+ "Contributor" shall mean Licensor and any individual or Legal Entity on behalf
60
+ of whom a Contribution has been received by Licensor and subsequently
61
+ incorporated within the Work.
62
+
63
+ 2. Grant of Copyright License.
64
+
65
+ Subject to the terms and conditions of this License, each Contributor hereby
66
+ grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
67
+ irrevocable copyright license to reproduce, prepare Derivative Works of,
68
+ publicly display, publicly perform, sublicense, and distribute the Work and such
69
+ Derivative Works in Source or Object form.
70
+
71
+ 3. Grant of Patent License.
72
+
73
+ Subject to the terms and conditions of this License, each Contributor hereby
74
+ grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
75
+ irrevocable (except as stated in this section) patent license to make, have
76
+ made, use, offer to sell, sell, import, and otherwise transfer the Work, where
77
+ such license applies only to those patent claims licensable by such Contributor
78
+ that are necessarily infringed by their Contribution(s) alone or by combination
79
+ of their Contribution(s) with the Work to which such Contribution(s) was
80
+ submitted. If You institute patent litigation against any entity (including a
81
+ cross-claim or counterclaim in a lawsuit) alleging that the Work or a
82
+ Contribution incorporated within the Work constitutes direct or contributory
83
+ patent infringement, then any patent licenses granted to You under this License
84
+ for that Work shall terminate as of the date such litigation is filed.
85
+
86
+ 4. Redistribution.
87
+
88
+ You may reproduce and distribute copies of the Work or Derivative Works thereof
89
+ in any medium, with or without modifications, and in Source or Object form,
90
+ provided that You meet the following conditions:
91
+
92
+ You must give any other recipients of the Work or Derivative Works a copy of
93
+ this License; and
94
+ You must cause any modified files to carry prominent notices stating that You
95
+ changed the files; and
96
+ You must retain, in the Source form of any Derivative Works that You distribute,
97
+ all copyright, patent, trademark, and attribution notices from the Source form
98
+ of the Work, excluding those notices that do not pertain to any part of the
99
+ Derivative Works; and
100
+ If the Work includes a "NOTICE" text file as part of its distribution, then any
101
+ Derivative Works that You distribute must include a readable copy of the
102
+ attribution notices contained within such NOTICE file, excluding those notices
103
+ that do not pertain to any part of the Derivative Works, in at least one of the
104
+ following places: within a NOTICE text file distributed as part of the
105
+ Derivative Works; within the Source form or documentation, if provided along
106
+ with the Derivative Works; or, within a display generated by the Derivative
107
+ Works, if and wherever such third-party notices normally appear. The contents of
108
+ the NOTICE file are for informational purposes only and do not modify the
109
+ License. You may add Your own attribution notices within Derivative Works that
110
+ You distribute, alongside or as an addendum to the NOTICE text from the Work,
111
+ provided that such additional attribution notices cannot be construed as
112
+ modifying the License.
113
+ You may add Your own copyright statement to Your modifications and may provide
114
+ additional or different license terms and conditions for use, reproduction, or
115
+ distribution of Your modifications, or for any such Derivative Works as a whole,
116
+ provided Your use, reproduction, and distribution of the Work otherwise complies
117
+ with the conditions stated in this License.
118
+
119
+ 5. Submission of Contributions.
120
+
121
+ Unless You explicitly state otherwise, any Contribution intentionally submitted
122
+ for inclusion in the Work by You to the Licensor shall be under the terms and
123
+ conditions of this License, without any additional terms or conditions.
124
+ Notwithstanding the above, nothing herein shall supersede or modify the terms of
125
+ any separate license agreement you may have executed with Licensor regarding
126
+ such Contributions.
127
+
128
+ 6. Trademarks.
129
+
130
+ This License does not grant permission to use the trade names, trademarks,
131
+ service marks, or product names of the Licensor, except as required for
132
+ reasonable and customary use in describing the origin of the Work and
133
+ reproducing the content of the NOTICE file.
134
+
135
+ 7. Disclaimer of Warranty.
136
+
137
+ Unless required by applicable law or agreed to in writing, Licensor provides the
138
+ Work (and each Contributor provides its Contributions) on an "AS IS" BASIS,
139
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
140
+ including, without limitation, any warranties or conditions of TITLE,
141
+ NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
142
+ solely responsible for determining the appropriateness of using or
143
+ redistributing the Work and assume any risks associated with Your exercise of
144
+ permissions under this License.
145
+
146
+ 8. Limitation of Liability.
147
+
148
+ In no event and under no legal theory, whether in tort (including negligence),
149
+ contract, or otherwise, unless required by applicable law (such as deliberate
150
+ and grossly negligent acts) or agreed to in writing, shall any Contributor be
151
+ liable to You for damages, including any direct, indirect, special, incidental,
152
+ or consequential damages of any character arising as a result of this License or
153
+ out of the use or inability to use the Work (including but not limited to
154
+ damages for loss of goodwill, work stoppage, computer failure or malfunction, or
155
+ any and all other commercial damages or losses), even if such Contributor has
156
+ been advised of the possibility of such damages.
157
+
158
+ 9. Accepting Warranty or Additional Liability.
159
+
160
+ While redistributing the Work or Derivative Works thereof, You may choose to
161
+ offer, and charge a fee for, acceptance of support, warranty, indemnity, or
162
+ other liability obligations and/or rights consistent with this License. However,
163
+ in accepting such obligations, You may act only on Your own behalf and on Your
164
+ sole responsibility, not on behalf of any other Contributor, and only if You
165
+ agree to indemnify, defend, and hold each Contributor harmless for any liability
166
+ incurred by, or claims asserted against, such Contributor by reason of your
167
+ accepting any such warranty or additional liability.
168
+
169
+ END OF TERMS AND CONDITIONS
170
+
171
+ APPENDIX: How to apply the Apache License to your work
172
+
173
+ To apply the Apache License to your work, attach the following boilerplate
174
+ notice, with the fields enclosed by brackets "{}" replaced with your own
175
+ identifying information. (Don't include the brackets!) The text should be
176
+ enclosed in the appropriate comment syntax for the file format. We also
177
+ recommend that a file or class name and description of purpose be included on
178
+ the same "printed page" as the copyright notice for easier identification within
179
+ third-party archives.
180
+
181
+ Copyright {yyyy} {name of copyright owner}
182
+
183
+ Licensed under the Apache License, Version 2.0 (the "License");
184
+ you may not use this file except in compliance with the License.
185
+ You may obtain a copy of the License at
186
+
187
+ http://www.apache.org/licenses/LICENSE-2.0
188
+
189
+ Unless required by applicable law or agreed to in writing, software
190
+ distributed under the License is distributed on an "AS IS" BASIS,
191
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
192
+ See the License for the specific language governing permissions and
193
+ limitations under the License.
data/README.md ADDED
@@ -0,0 +1,37 @@
1
+ # Stickler::Mirror
2
+
3
+ Stickler mirror is a small addition to [stickler](https://github.com/copiousfreetime/stickler),
4
+ which takes care of the chore of mirroring your *complete* Gemfile with all dependencies in
5
+ a local stickler installation. This code is extracted from a [pull request](https://github.com/copiousfreetime/stickler/issues/28)
6
+ from the official stickler repository.
7
+
8
+
9
+ ## Requirements
10
+
11
+ * Bundler
12
+ * A working Stickler configuration
13
+
14
+ ## Installation
15
+
16
+ Just install it via:
17
+
18
+ $ gem install stickler-mirror
19
+
20
+ ## Usage
21
+
22
+ $ bundle
23
+ $ stickler-mirror
24
+
25
+ Mirroring trollop-2.0...
26
+ Asking http://localhost:6789/ to mirror trollop-2.0 from rubygems.org : OK -> http://localhost:6789/gems/trollop-2.0.gem
27
+
28
+ Mirroring tilt-1.4.1...
29
+ Asking http://localhost:6789/ to mirror tilt-1.4.1 from rubygems.org : OK -> http://localhost:6789/gems/tilt-1.4.1.gem
30
+
31
+ ## Contributing
32
+
33
+ 1. Fork it
34
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
35
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
36
+ 4. Push to the branch (`git push origin my-new-feature`)
37
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'trollop'
4
+ require 'bundler/setup'
5
+ require 'stickler/mirror'
6
+
7
+ opts = Trollop::options do
8
+ version "Stickler Mirror #{Stickler::Mirror::VERSION}"
9
+ banner <<-EOL
10
+
11
+ stickler-mirror
12
+
13
+ Firing up stickler-mirror will get a list of required gems from your
14
+ current Gemfile.lock and try to ask stickler to mirror all of them.
15
+
16
+ Please make sure to set up stickler before trying stickler-mirror!
17
+
18
+ Usage: stickler-mirror
19
+ EOL
20
+
21
+ end
22
+
23
+ Stickler::Mirror.run
@@ -0,0 +1,26 @@
1
+ require "stickler/mirror/version"
2
+
3
+ module Stickler
4
+ module Mirror
5
+ def self.run
6
+ # Fetch current Gemset from Bundler
7
+ gem_environment = Bundler.environment.specs.to_hash
8
+
9
+ # Iterate through this nasty "gem-hash"
10
+ gems = gem_environment.collect{ |gem| gem[1][0] }
11
+
12
+ # Call stickler for each parsed gem
13
+ gems.each do |gem|
14
+ name, version = gem.name, gem.version
15
+
16
+ puts "\nMirroring #{name}-#{version}..."
17
+ result = system("stickler mirror #{name} --gem-version #{version}")
18
+
19
+ if result.nil?
20
+ puts "I am sorry. Something went wrong mirroring #{name}."
21
+ puts "Don't hesitate to file a bug report. :-)\n\n"
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,5 @@
1
+ module Stickler
2
+ module Mirror
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
@@ -0,0 +1,25 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'stickler/mirror/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "stickler-mirror"
8
+ spec.version = Stickler::Mirror::VERSION
9
+ spec.authors = ["Sebastian Schulze"]
10
+ spec.email = ["rubygems.org@bascht.com"]
11
+ spec.description = "Mirror a bunch of gems via stickler"
12
+ spec.summary = "Reads your current Gemfile and pushes all gems to stickler"
13
+ spec.homepage = "https://github.com/bascht/"
14
+ spec.license = "Apache v2 License"
15
+
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.3"
22
+ spec.add_development_dependency "rake"
23
+ spec.add_development_dependency "stickler"
24
+ spec.add_development_dependency "trollop"
25
+ end
metadata ADDED
@@ -0,0 +1,111 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: stickler-mirror
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Sebastian Schulze
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-09-12 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.3'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.3'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ! '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ! '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: stickler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ! '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: trollop
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: Mirror a bunch of gems via stickler
70
+ email:
71
+ - rubygems.org@bascht.com
72
+ executables:
73
+ - stickler-mirror
74
+ extensions: []
75
+ extra_rdoc_files: []
76
+ files:
77
+ - .gitignore
78
+ - Gemfile
79
+ - LICENSE.txt
80
+ - README.md
81
+ - Rakefile
82
+ - bin/stickler-mirror
83
+ - lib/stickler/mirror.rb
84
+ - lib/stickler/mirror/version.rb
85
+ - stickler-mirror.gemspec
86
+ homepage: https://github.com/bascht/
87
+ licenses:
88
+ - Apache v2 License
89
+ metadata: {}
90
+ post_install_message:
91
+ rdoc_options: []
92
+ require_paths:
93
+ - lib
94
+ required_ruby_version: !ruby/object:Gem::Requirement
95
+ requirements:
96
+ - - ! '>='
97
+ - !ruby/object:Gem::Version
98
+ version: '0'
99
+ required_rubygems_version: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ! '>='
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ requirements: []
105
+ rubyforge_project:
106
+ rubygems_version: 2.0.3
107
+ signing_key:
108
+ specification_version: 4
109
+ summary: Reads your current Gemfile and pushes all gems to stickler
110
+ test_files: []
111
+ has_rdoc: