rubysl-pathname 2.1.0 → 2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 54a2bc4f3f622b955a0b81c1cd46a2133043d828
4
- data.tar.gz: 5e2e1ac68be016180cb4958ccb94a6d21d8b4e82
3
+ metadata.gz: 1711bc330655a4c67642ea15561a4ece6a132bd4
4
+ data.tar.gz: 336e6b7e565abe4669d0536eacd2b23d0d8b7d54
5
5
  SHA512:
6
- metadata.gz: 72bb5b43513ae64e507938200d46e6f1fb464171b2d6903c68609c7b35a5ebd21e04701e6b048001be2429caf39f4b6c7dad0c32401e7a9f4722733bc559c0fe
7
- data.tar.gz: 8dc631055ee12d3a0f588106853d9893d83d51d6874a4f6e18269f557824a94303c846c34d6090652107cc68991e67324da89cd3e6bee8a91ea255dfb13b0733
6
+ metadata.gz: d293d3b8944be8a1bb20a0df55a66c55d72335d0852d14af73a23a93b3ae4b8045220e3f805329b42dafe97a048dfca9b4d22fd7cb198f2adb4b33dc4acc02e6
7
+ data.tar.gz: 395241e9f0a18c8e4f401616bdb0370d75046ff86dee7939fcdcc716ed56bb3d48b7d35d84af5e7be0246891a446a3fb275062d06132121c24cf4ea8244dd442
data/.travis.yml CHANGED
@@ -1,12 +1,27 @@
1
+ ---
1
2
  language: ruby
3
+ before_install:
4
+ - gem install bundler
2
5
  env:
3
- - RUBYLIB=lib:.
6
+ - RUBYLIB=lib
7
+ - RUBYLIB=
4
8
  script: mspec spec
5
- branches:
6
- only:
7
- - 1.0
8
- - 2.0
9
9
  rvm:
10
- - 2.1.0
11
- - rbx-2
12
-
10
+ - 2.3
11
+ - rbx
12
+ matrix:
13
+ exclude:
14
+ - rvm: 2.3
15
+ env: RUBYLIB=lib
16
+ - rvm: rbx
17
+ env: RUBYLIB=
18
+ - rvm: 2.3
19
+ os: osx
20
+ os:
21
+ - linux
22
+ - osx
23
+ sudo: false
24
+ notifications:
25
+ email:
26
+ on_success: change
27
+ on_failure: change
data/LICENSE CHANGED
@@ -1,25 +1,364 @@
1
- Copyright (c) 2013, Brian Shirai
2
- All rights reserved.
3
-
4
- Redistribution and use in source and binary forms, with or without
5
- modification, are permitted provided that the following conditions are met:
6
-
7
- 1. Redistributions of source code must retain the above copyright notice, this
8
- list of conditions and the following disclaimer.
9
- 2. Redistributions in binary form must reproduce the above copyright notice,
10
- this list of conditions and the following disclaimer in the documentation
11
- and/or other materials provided with the distribution.
12
- 3. Neither the name of the library nor the names of its contributors may be
13
- used to endorse or promote products derived from this software without
14
- specific prior written permission.
15
-
16
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19
- DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT,
20
- INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21
- BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
23
- OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
24
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
25
- EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1
+ Copyright (c) 2016, Rubinius, Inc.
2
+
3
+ Mozilla Public License, version 2.0
4
+
5
+ 1. Definitions
6
+
7
+ 1.1. "Contributor"
8
+
9
+ means each individual or legal entity that creates, contributes to the
10
+ creation of, or owns Covered Software.
11
+
12
+ 1.2. "Contributor Version"
13
+
14
+ means the combination of the Contributions of others (if any) used by a
15
+ Contributor and that particular Contributor's Contribution.
16
+
17
+ 1.3. "Contribution"
18
+
19
+ means Covered Software of a particular Contributor.
20
+
21
+ 1.4. "Covered Software"
22
+
23
+ means Source Code Form to which the initial Contributor has attached the
24
+ notice in Exhibit A, the Executable Form of such Source Code Form, and
25
+ Modifications of such Source Code Form, in each case including portions
26
+ thereof.
27
+
28
+ 1.5. "Incompatible With Secondary Licenses"
29
+ means
30
+
31
+ a. that the initial Contributor has attached the notice described in
32
+ Exhibit B to the Covered Software; or
33
+
34
+ b. that the Covered Software was made available under the terms of
35
+ version 1.1 or earlier of the License, but not also under the terms of
36
+ a Secondary License.
37
+
38
+ 1.6. "Executable Form"
39
+
40
+ means any form of the work other than Source Code Form.
41
+
42
+ 1.7. "Larger Work"
43
+
44
+ means a work that combines Covered Software with other material, in a
45
+ separate file or files, that is not Covered Software.
46
+
47
+ 1.8. "License"
48
+
49
+ means this document.
50
+
51
+ 1.9. "Licensable"
52
+
53
+ means having the right to grant, to the maximum extent possible, whether
54
+ at the time of the initial grant or subsequently, any and all of the
55
+ rights conveyed by this License.
56
+
57
+ 1.10. "Modifications"
58
+
59
+ means any of the following:
60
+
61
+ a. any file in Source Code Form that results from an addition to,
62
+ deletion from, or modification of the contents of Covered Software; or
63
+
64
+ b. any new file in Source Code Form that contains any Covered Software.
65
+
66
+ 1.11. "Patent Claims" of a Contributor
67
+
68
+ means any patent claim(s), including without limitation, method,
69
+ process, and apparatus claims, in any patent Licensable by such
70
+ Contributor that would be infringed, but for the grant of the License,
71
+ by the making, using, selling, offering for sale, having made, import,
72
+ or transfer of either its Contributions or its Contributor Version.
73
+
74
+ 1.12. "Secondary License"
75
+
76
+ means either the GNU General Public License, Version 2.0, the GNU Lesser
77
+ General Public License, Version 2.1, the GNU Affero General Public
78
+ License, Version 3.0, or any later versions of those licenses.
79
+
80
+ 1.13. "Source Code Form"
81
+
82
+ means the form of the work preferred for making modifications.
83
+
84
+ 1.14. "You" (or "Your")
85
+
86
+ means an individual or a legal entity exercising rights under this
87
+ License. For legal entities, "You" includes any entity that controls, is
88
+ controlled by, or is under common control with You. For purposes of this
89
+ definition, "control" means (a) the power, direct or indirect, to cause
90
+ the direction or management of such entity, whether by contract or
91
+ otherwise, or (b) ownership of more than fifty percent (50%) of the
92
+ outstanding shares or beneficial ownership of such entity.
93
+
94
+
95
+ 2. License Grants and Conditions
96
+
97
+ 2.1. Grants
98
+
99
+ Each Contributor hereby grants You a world-wide, royalty-free,
100
+ non-exclusive license:
101
+
102
+ a. under intellectual property rights (other than patent or trademark)
103
+ Licensable by such Contributor to use, reproduce, make available,
104
+ modify, display, perform, distribute, and otherwise exploit its
105
+ Contributions, either on an unmodified basis, with Modifications, or
106
+ as part of a Larger Work; and
107
+
108
+ b. under Patent Claims of such Contributor to make, use, sell, offer for
109
+ sale, have made, import, and otherwise transfer either its
110
+ Contributions or its Contributor Version.
111
+
112
+ 2.2. Effective Date
113
+
114
+ The licenses granted in Section 2.1 with respect to any Contribution
115
+ become effective for each Contribution on the date the Contributor first
116
+ distributes such Contribution.
117
+
118
+ 2.3. Limitations on Grant Scope
119
+
120
+ The licenses granted in this Section 2 are the only rights granted under
121
+ this License. No additional rights or licenses will be implied from the
122
+ distribution or licensing of Covered Software under this License.
123
+ Notwithstanding Section 2.1(b) above, no patent license is granted by a
124
+ Contributor:
125
+
126
+ a. for any code that a Contributor has removed from Covered Software; or
127
+
128
+ b. for infringements caused by: (i) Your and any other third party's
129
+ modifications of Covered Software, or (ii) the combination of its
130
+ Contributions with other software (except as part of its Contributor
131
+ Version); or
132
+
133
+ c. under Patent Claims infringed by Covered Software in the absence of
134
+ its Contributions.
135
+
136
+ This License does not grant any rights in the trademarks, service marks,
137
+ or logos of any Contributor (except as may be necessary to comply with
138
+ the notice requirements in Section 3.4).
139
+
140
+ 2.4. Subsequent Licenses
141
+
142
+ No Contributor makes additional grants as a result of Your choice to
143
+ distribute the Covered Software under a subsequent version of this
144
+ License (see Section 10.2) or under the terms of a Secondary License (if
145
+ permitted under the terms of Section 3.3).
146
+
147
+ 2.5. Representation
148
+
149
+ Each Contributor represents that the Contributor believes its
150
+ Contributions are its original creation(s) or it has sufficient rights to
151
+ grant the rights to its Contributions conveyed by this License.
152
+
153
+ 2.6. Fair Use
154
+
155
+ This License is not intended to limit any rights You have under
156
+ applicable copyright doctrines of fair use, fair dealing, or other
157
+ equivalents.
158
+
159
+ 2.7. Conditions
160
+
161
+ Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in
162
+ Section 2.1.
163
+
164
+
165
+ 3. Responsibilities
166
+
167
+ 3.1. Distribution of Source Form
168
+
169
+ All distribution of Covered Software in Source Code Form, including any
170
+ Modifications that You create or to which You contribute, must be under
171
+ the terms of this License. You must inform recipients that the Source
172
+ Code Form of the Covered Software is governed by the terms of this
173
+ License, and how they can obtain a copy of this License. You may not
174
+ attempt to alter or restrict the recipients' rights in the Source Code
175
+ Form.
176
+
177
+ 3.2. Distribution of Executable Form
178
+
179
+ If You distribute Covered Software in Executable Form then:
180
+
181
+ a. such Covered Software must also be made available in Source Code Form,
182
+ as described in Section 3.1, and You must inform recipients of the
183
+ Executable Form how they can obtain a copy of such Source Code Form by
184
+ reasonable means in a timely manner, at a charge no more than the cost
185
+ of distribution to the recipient; and
186
+
187
+ b. You may distribute such Executable Form under the terms of this
188
+ License, or sublicense it under different terms, provided that the
189
+ license for the Executable Form does not attempt to limit or alter the
190
+ recipients' rights in the Source Code Form under this License.
191
+
192
+ 3.3. Distribution of a Larger Work
193
+
194
+ You may create and distribute a Larger Work under terms of Your choice,
195
+ provided that You also comply with the requirements of this License for
196
+ the Covered Software. If the Larger Work is a combination of Covered
197
+ Software with a work governed by one or more Secondary Licenses, and the
198
+ Covered Software is not Incompatible With Secondary Licenses, this
199
+ License permits You to additionally distribute such Covered Software
200
+ under the terms of such Secondary License(s), so that the recipient of
201
+ the Larger Work may, at their option, further distribute the Covered
202
+ Software under the terms of either this License or such Secondary
203
+ License(s).
204
+
205
+ 3.4. Notices
206
+
207
+ You may not remove or alter the substance of any license notices
208
+ (including copyright notices, patent notices, disclaimers of warranty, or
209
+ limitations of liability) contained within the Source Code Form of the
210
+ Covered Software, except that You may alter any license notices to the
211
+ extent required to remedy known factual inaccuracies.
212
+
213
+ 3.5. Application of Additional Terms
214
+
215
+ You may choose to offer, and to charge a fee for, warranty, support,
216
+ indemnity or liability obligations to one or more recipients of Covered
217
+ Software. However, You may do so only on Your own behalf, and not on
218
+ behalf of any Contributor. You must make it absolutely clear that any
219
+ such warranty, support, indemnity, or liability obligation is offered by
220
+ You alone, and You hereby agree to indemnify every Contributor for any
221
+ liability incurred by such Contributor as a result of warranty, support,
222
+ indemnity or liability terms You offer. You may include additional
223
+ disclaimers of warranty and limitations of liability specific to any
224
+ jurisdiction.
225
+
226
+ 4. Inability to Comply Due to Statute or Regulation
227
+
228
+ If it is impossible for You to comply with any of the terms of this License
229
+ with respect to some or all of the Covered Software due to statute,
230
+ judicial order, or regulation then You must: (a) comply with the terms of
231
+ this License to the maximum extent possible; and (b) describe the
232
+ limitations and the code they affect. Such description must be placed in a
233
+ text file included with all distributions of the Covered Software under
234
+ this License. Except to the extent prohibited by statute or regulation,
235
+ such description must be sufficiently detailed for a recipient of ordinary
236
+ skill to be able to understand it.
237
+
238
+ 5. Termination
239
+
240
+ 5.1. The rights granted under this License will terminate automatically if You
241
+ fail to comply with any of its terms. However, if You become compliant,
242
+ then the rights granted under this License from a particular Contributor
243
+ are reinstated (a) provisionally, unless and until such Contributor
244
+ explicitly and finally terminates Your grants, and (b) on an ongoing
245
+ basis, if such Contributor fails to notify You of the non-compliance by
246
+ some reasonable means prior to 60 days after You have come back into
247
+ compliance. Moreover, Your grants from a particular Contributor are
248
+ reinstated on an ongoing basis if such Contributor notifies You of the
249
+ non-compliance by some reasonable means, this is the first time You have
250
+ received notice of non-compliance with this License from such
251
+ Contributor, and You become compliant prior to 30 days after Your receipt
252
+ of the notice.
253
+
254
+ 5.2. If You initiate litigation against any entity by asserting a patent
255
+ infringement claim (excluding declaratory judgment actions,
256
+ counter-claims, and cross-claims) alleging that a Contributor Version
257
+ directly or indirectly infringes any patent, then the rights granted to
258
+ You by any and all Contributors for the Covered Software under Section
259
+ 2.1 of this License shall terminate.
260
+
261
+ 5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user
262
+ license agreements (excluding distributors and resellers) which have been
263
+ validly granted by You or Your distributors under this License prior to
264
+ termination shall survive termination.
265
+
266
+ 6. Disclaimer of Warranty
267
+
268
+ Covered Software is provided under this License on an "as is" basis,
269
+ without warranty of any kind, either expressed, implied, or statutory,
270
+ including, without limitation, warranties that the Covered Software is free
271
+ of defects, merchantable, fit for a particular purpose or non-infringing.
272
+ The entire risk as to the quality and performance of the Covered Software
273
+ is with You. Should any Covered Software prove defective in any respect,
274
+ You (not any Contributor) assume the cost of any necessary servicing,
275
+ repair, or correction. This disclaimer of warranty constitutes an essential
276
+ part of this License. No use of any Covered Software is authorized under
277
+ this License except under this disclaimer.
278
+
279
+ 7. Limitation of Liability
280
+
281
+ Under no circumstances and under no legal theory, whether tort (including
282
+ negligence), contract, or otherwise, shall any Contributor, or anyone who
283
+ distributes Covered Software as permitted above, be liable to You for any
284
+ direct, indirect, special, incidental, or consequential damages of any
285
+ character including, without limitation, damages for lost profits, loss of
286
+ goodwill, work stoppage, computer failure or malfunction, or any and all
287
+ other commercial damages or losses, even if such party shall have been
288
+ informed of the possibility of such damages. This limitation of liability
289
+ shall not apply to liability for death or personal injury resulting from
290
+ such party's negligence to the extent applicable law prohibits such
291
+ limitation. Some jurisdictions do not allow the exclusion or limitation of
292
+ incidental or consequential damages, so this exclusion and limitation may
293
+ not apply to You.
294
+
295
+ 8. Litigation
296
+
297
+ Any litigation relating to this License may be brought only in the courts
298
+ of a jurisdiction where the defendant maintains its principal place of
299
+ business and such litigation shall be governed by laws of that
300
+ jurisdiction, without reference to its conflict-of-law provisions. Nothing
301
+ in this Section shall prevent a party's ability to bring cross-claims or
302
+ counter-claims.
303
+
304
+ 9. Miscellaneous
305
+
306
+ This License represents the complete agreement concerning the subject
307
+ matter hereof. If any provision of this License is held to be
308
+ unenforceable, such provision shall be reformed only to the extent
309
+ necessary to make it enforceable. Any law or regulation which provides that
310
+ the language of a contract shall be construed against the drafter shall not
311
+ be used to construe this License against a Contributor.
312
+
313
+
314
+ 10. Versions of the License
315
+
316
+ 10.1. New Versions
317
+
318
+ Mozilla Foundation is the license steward. Except as provided in Section
319
+ 10.3, no one other than the license steward has the right to modify or
320
+ publish new versions of this License. Each version will be given a
321
+ distinguishing version number.
322
+
323
+ 10.2. Effect of New Versions
324
+
325
+ You may distribute the Covered Software under the terms of the version
326
+ of the License under which You originally received the Covered Software,
327
+ or under the terms of any subsequent version published by the license
328
+ steward.
329
+
330
+ 10.3. Modified Versions
331
+
332
+ If you create software not governed by this License, and you want to
333
+ create a new license for such software, you may create and use a
334
+ modified version of this License if you rename the license and remove
335
+ any references to the name of the license steward (except to note that
336
+ such modified license differs from this License).
337
+
338
+ 10.4. Distributing Source Code Form that is Incompatible With Secondary
339
+ Licenses If You choose to distribute Source Code Form that is
340
+ Incompatible With Secondary Licenses under the terms of this version of
341
+ the License, the notice described in Exhibit B of this License must be
342
+ attached.
343
+
344
+ Exhibit A - Source Code Form License Notice
345
+
346
+ This Source Code Form is subject to the
347
+ terms of the Mozilla Public License, v.
348
+ 2.0. If a copy of the MPL was not
349
+ distributed with this file, You can
350
+ obtain one at
351
+ http://mozilla.org/MPL/2.0/.
352
+
353
+ If it is not possible or desirable to put the notice in a particular file,
354
+ then You may include the notice in a location (such as a LICENSE file in a
355
+ relevant directory) where a recipient would be likely to look for such a
356
+ notice.
357
+
358
+ You may add additional accurate notices of copyright ownership.
359
+
360
+ Exhibit B - "Incompatible With Secondary Licenses" Notice
361
+
362
+ This Source Code Form is "Incompatible
363
+ With Secondary Licenses", as defined by
364
+ the Mozilla Public License, v. 2.0.
data/MRI_LICENSE ADDED
@@ -0,0 +1,56 @@
1
+ Ruby is copyrighted free software by Yukihiro Matsumoto <matz@netlab.jp>.
2
+ You can redistribute it and/or modify it under either the terms of the
3
+ 2-clause BSDL (see the file BSDL), or the conditions below:
4
+
5
+ 1. You may make and give away verbatim copies of the source form of the
6
+ software without restriction, provided that you duplicate all of the
7
+ original copyright notices and associated disclaimers.
8
+
9
+ 2. You may modify your copy of the software in any way, provided that
10
+ you do at least ONE of the following:
11
+
12
+ a) place your modifications in the Public Domain or otherwise
13
+ make them Freely Available, such as by posting said
14
+ modifications to Usenet or an equivalent medium, or by allowing
15
+ the author to include your modifications in the software.
16
+
17
+ b) use the modified software only within your corporation or
18
+ organization.
19
+
20
+ c) give non-standard binaries non-standard names, with
21
+ instructions on where to get the original software distribution.
22
+
23
+ d) make other distribution arrangements with the author.
24
+
25
+ 3. You may distribute the software in object code or binary form,
26
+ provided that you do at least ONE of the following:
27
+
28
+ a) distribute the binaries and library files of the software,
29
+ together with instructions (in the manual page or equivalent)
30
+ on where to get the original distribution.
31
+
32
+ b) accompany the distribution with the machine-readable source of
33
+ the software.
34
+
35
+ c) give non-standard binaries non-standard names, with
36
+ instructions on where to get the original software distribution.
37
+
38
+ d) make other distribution arrangements with the author.
39
+
40
+ 4. You may modify and include the part of the software into any other
41
+ software (possibly commercial). But some files in the distribution
42
+ are not written by the author, so that they are not under these terms.
43
+
44
+ For the list of those files and their copying conditions, see the
45
+ file LEGAL.
46
+
47
+ 5. The scripts and library files supplied as input to or produced as
48
+ output from the software do not automatically fall under the
49
+ copyright of the software, but belong to whomever generated them,
50
+ and may be sold commercially, and may be aggregated with this
51
+ software.
52
+
53
+ 6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
54
+ IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
55
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
56
+ PURPOSE.
data/README.md CHANGED
@@ -1,29 +1,57 @@
1
- # Rubysl::Pathname
1
+ # rubysl-pathname
2
2
 
3
- TODO: Write a gem description
3
+ An implementation of the Ruby Pathname standard library for Rubinius. Currently
4
+ this Gem is mostly (if not entirely) just a copy of MRI's Pathname
5
+ implementation.
6
+
7
+ Please note that **only** Rubinius is officially supported. While other Ruby
8
+ implementations are free to use rubysl-pathname according to its license we do
9
+ not provide any support for this.
10
+
11
+ ## Target
12
+
13
+ The 2.0 branch of rubysl-pathname targets Ruby 2.x, other Ruby versions are
14
+ currently not supported.
15
+
16
+ ## Requirements
17
+
18
+ * Rubinius 2.10 or newer
4
19
 
5
20
  ## Installation
6
21
 
7
- Add this line to your application's Gemfile:
22
+ By default rubysl-pathname is already installed when you install Rubinius.
23
+ Currently updating rubysl-pathname requires re-installing Rubinius, in the future
24
+ you can simply update rubysl-pathname by running `gem update rubysl-pathname`.
25
+
26
+ ## Contributing
8
27
 
9
- gem 'rubysl-pathname'
28
+ In general the contributing guidelines are the same as Rubinius
29
+ (<http://rubinius.com/doc/en/contributing/>).
10
30
 
11
- And then execute:
31
+ To get started, clone the directory and install all Gems:
12
32
 
13
- $ bundle
33
+ bundle install
14
34
 
15
- Or install it yourself as:
35
+ You'll want to do this for both your local MRI and Rubinius installations.
16
36
 
17
- $ gem install rubysl-pathname
37
+ Running the specs under MRI works as following:
18
38
 
19
- ## Usage
39
+ mspec spec/path/to/file_spec.rb
20
40
 
21
- TODO: Write usage instructions here
41
+ Running the specs under Rubinius requires an extra environment variable so
42
+ Rubinius loads the local rubysl-pathname copy instead of the installed one:
22
43
 
23
- ## Contributing
44
+ RUBYLIB=.:lib mspec spec/path/to/file_spec.rb
45
+
46
+ All specs **must** pass on both MRI and Rubinius.
47
+
48
+ ## License
49
+
50
+ All source code in this repository is subject to the terms of the Mozilla Public
51
+ License, version 2.0 unless stated otherwise. A copy of this license can be
52
+ found the file "LICENSE" or at <https://www.mozilla.org/MPL/2.0/>.
53
+
54
+ The following files use a different license:
24
55
 
25
- 1. Fork it
26
- 2. Create your feature branch (`git checkout -b my-new-feature`)
27
- 3. Commit your changes (`git commit -am 'Add some feature'`)
28
- 4. Push to the branch (`git push origin my-new-feature`)
29
- 5. Create new Pull Request
56
+ * `lib/rubysl/pathname/pathname.rb`: MRI license, found in the file
57
+ "MRI_LICENSE"
@@ -192,13 +192,8 @@
192
192
  #
193
193
  class Pathname
194
194
 
195
- # :stopdoc:
196
- if RUBY_VERSION < "1.9"
197
- TO_PATH = :to_str
198
- else
199
- # to_path is implemented so Pathname objects are usable with File.open, etc.
200
- TO_PATH = :to_path
201
- end
195
+ # to_path is implemented so Pathname objects are usable with File.open, etc.
196
+ TO_PATH = :to_path
202
197
 
203
198
  SAME_PATHS = if File::FNM_SYSCASE.nonzero?
204
199
  proc {|a, b| a.casecmp(b).zero?}
@@ -1001,6 +996,8 @@ class Pathname # * Find *
1001
996
  # Pathname#find is an iterator to traverse a directory tree in a depth first
1002
997
  # manner. It yields a Pathname for each file under "this" directory.
1003
998
  #
999
+ # Returns an Enumerator if no block is given.
1000
+ #
1004
1001
  # Since it is implemented by <tt>find.rb</tt>, <tt>Find.prune</tt> can be used
1005
1002
  # to control the traverse.
1006
1003
  #
@@ -1008,6 +1005,7 @@ class Pathname # * Find *
1008
1005
  # current directory, not <tt>./</tt>.
1009
1006
  #
1010
1007
  def find(&block) # :yield: pathname
1008
+ return to_enum(__method__) unless block_given?
1011
1009
  require 'find'
1012
1010
  if @path == '.'
1013
1011
  Find.find(@path) {|f| yield self.class.new(f.sub(%r{\A\./}, '')) }
@@ -1,5 +1,5 @@
1
1
  module RubySL
2
2
  module Pathname
3
- VERSION = "2.1.0"
3
+ VERSION = '2.2'
4
4
  end
5
5
  end
data/spec/find_spec.rb ADDED
@@ -0,0 +1,29 @@
1
+ require 'pathname'
2
+
3
+ describe 'Pathname#find' do
4
+ before do
5
+ @directory = File.expand_path('..', __FILE__)
6
+ end
7
+
8
+ describe 'with a block' do
9
+ it 'yields Pathname instances to the block' do
10
+ Pathname.new(@directory).find do |path|
11
+ path.should be_an_instance_of(Pathname)
12
+ end
13
+ end
14
+ end
15
+
16
+ describe 'without a block' do
17
+ it 'returns an Enumerator' do
18
+ enum = Pathname.new(@directory).find
19
+
20
+ enum.should be_an_instance_of(Enumerator)
21
+ end
22
+
23
+ it 'uses #find for the Enumerator' do
24
+ enum = Pathname.new(@directory).find
25
+
26
+ enum.count.should > 0
27
+ end
28
+ end
29
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubysl-pathname
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: '2.2'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Shirai
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-24 00:00:00.000000000 Z
11
+ date: 2016-02-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -77,6 +77,7 @@ files:
77
77
  - ".travis.yml"
78
78
  - Gemfile
79
79
  - LICENSE
80
+ - MRI_LICENSE
80
81
  - README.md
81
82
  - Rakefile
82
83
  - lib/pathname.rb
@@ -86,6 +87,7 @@ files:
86
87
  - rubysl-pathname.gemspec
87
88
  - spec/absolute_spec.rb
88
89
  - spec/equal_value_spec.rb
90
+ - spec/find_spec.rb
89
91
  - spec/hash_spec.rb
90
92
  - spec/kernel_spec.rb
91
93
  - spec/new_spec.rb
@@ -113,13 +115,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
113
115
  version: '0'
114
116
  requirements: []
115
117
  rubyforge_project:
116
- rubygems_version: 2.2.2
118
+ rubygems_version: 2.5.1
117
119
  signing_key:
118
120
  specification_version: 4
119
121
  summary: Ruby standard library pathname.
120
122
  test_files:
121
123
  - spec/absolute_spec.rb
122
124
  - spec/equal_value_spec.rb
125
+ - spec/find_spec.rb
123
126
  - spec/hash_spec.rb
124
127
  - spec/kernel_spec.rb
125
128
  - spec/new_spec.rb
@@ -127,3 +130,4 @@ test_files:
127
130
  - spec/relative_spec.rb
128
131
  - spec/root_spec.rb
129
132
  - spec/sub_spec.rb
133
+ has_rdoc: