earlgrey 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,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 46ff0c7e101aa31fa6d4d5c9604b4488561ecfca
4
+ data.tar.gz: 176c09aa8a9c05e5e3cedec7a29d3dd74d7f78e4
5
+ SHA512:
6
+ metadata.gz: b55724a388c4a51cef26f87695a8723630e7a7b93c2e25e52aed0d2d90df708a6d091e1bd46061bfb8a651fa3c5021498536cc4c5e1028c74cd834a946db786c
7
+ data.tar.gz: 17765b512b7894581951204ec174191eddac38e4c01ab4d7d10843a6f73729d24ecf104c93afef4079d912668a7515db4fdc454b41e950c5ec7c6d833bf6ea01
data/.gitignore ADDED
@@ -0,0 +1 @@
1
+ Gemfile.lock
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
4
+
5
+ gem 'thor' # enable: bundle exec thor spec
6
+ gem 'coveralls', require: false
data/LICENSE ADDED
@@ -0,0 +1,598 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ 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
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
203
+
204
+ --------------------------------------------------------------------------------------------
205
+
206
+ Attribution 4.0 International
207
+
208
+ =======================================================================
209
+
210
+ Creative Commons Corporation ("Creative Commons") is not a law firm and
211
+ does not provide legal services or legal advice. Distribution of
212
+ Creative Commons public licenses does not create a lawyer-client or
213
+ other relationship. Creative Commons makes its licenses and related
214
+ information available on an "as-is" basis. Creative Commons gives no
215
+ warranties regarding its licenses, any material licensed under their
216
+ terms and conditions, or any related information. Creative Commons
217
+ disclaims all liability for damages resulting from their use to the
218
+ fullest extent possible.
219
+
220
+ Using Creative Commons Public Licenses
221
+
222
+ Creative Commons public licenses provide a standard set of terms and
223
+ conditions that creators and other rights holders may use to share
224
+ original works of authorship and other material subject to copyright
225
+ and certain other rights specified in the public license below. The
226
+ following considerations are for informational purposes only, are not
227
+ exhaustive, and do not form part of our licenses.
228
+
229
+ Considerations for licensors: Our public licenses are
230
+ intended for use by those authorized to give the public
231
+ permission to use material in ways otherwise restricted by
232
+ copyright and certain other rights. Our licenses are
233
+ irrevocable. Licensors should read and understand the terms
234
+ and conditions of the license they choose before applying it.
235
+ Licensors should also secure all rights necessary before
236
+ applying our licenses so that the public can reuse the
237
+ material as expected. Licensors should clearly mark any
238
+ material not subject to the license. This includes other CC-
239
+ licensed material, or material used under an exception or
240
+ limitation to copyright. More considerations for licensors:
241
+ wiki.creativecommons.org/Considerations_for_licensors
242
+
243
+ Considerations for the public: By using one of our public
244
+ licenses, a licensor grants the public permission to use the
245
+ licensed material under specified terms and conditions. If
246
+ the licensor's permission is not necessary for any reason--for
247
+ example, because of any applicable exception or limitation to
248
+ copyright--then that use is not regulated by the license. Our
249
+ licenses grant only permissions under copyright and certain
250
+ other rights that a licensor has authority to grant. Use of
251
+ the licensed material may still be restricted for other
252
+ reasons, including because others have copyright or other
253
+ rights in the material. A licensor may make special requests,
254
+ such as asking that all changes be marked or described.
255
+ Although not required by our licenses, you are encouraged to
256
+ respect those requests where reasonable. More_considerations
257
+ for the public:
258
+ wiki.creativecommons.org/Considerations_for_licensees
259
+
260
+ =======================================================================
261
+
262
+ Creative Commons Attribution 4.0 International Public License
263
+
264
+ By exercising the Licensed Rights (defined below), You accept and agree
265
+ to be bound by the terms and conditions of this Creative Commons
266
+ Attribution 4.0 International Public License ("Public License"). To the
267
+ extent this Public License may be interpreted as a contract, You are
268
+ granted the Licensed Rights in consideration of Your acceptance of
269
+ these terms and conditions, and the Licensor grants You such rights in
270
+ consideration of benefits the Licensor receives from making the
271
+ Licensed Material available under these terms and conditions.
272
+
273
+
274
+ Section 1 -- Definitions.
275
+
276
+ a. Adapted Material means material subject to Copyright and Similar
277
+ Rights that is derived from or based upon the Licensed Material
278
+ and in which the Licensed Material is translated, altered,
279
+ arranged, transformed, or otherwise modified in a manner requiring
280
+ permission under the Copyright and Similar Rights held by the
281
+ Licensor. For purposes of this Public License, where the Licensed
282
+ Material is a musical work, performance, or sound recording,
283
+ Adapted Material is always produced where the Licensed Material is
284
+ synched in timed relation with a moving image.
285
+
286
+ b. Adapter's License means the license You apply to Your Copyright
287
+ and Similar Rights in Your contributions to Adapted Material in
288
+ accordance with the terms and conditions of this Public License.
289
+
290
+ c. Copyright and Similar Rights means copyright and/or similar rights
291
+ closely related to copyright including, without limitation,
292
+ performance, broadcast, sound recording, and Sui Generis Database
293
+ Rights, without regard to how the rights are labeled or
294
+ categorized. For purposes of this Public License, the rights
295
+ specified in Section 2(b)(1)-(2) are not Copyright and Similar
296
+ Rights.
297
+
298
+ d. Effective Technological Measures means those measures that, in the
299
+ absence of proper authority, may not be circumvented under laws
300
+ fulfilling obligations under Article 11 of the WIPO Copyright
301
+ Treaty adopted on December 20, 1996, and/or similar international
302
+ agreements.
303
+
304
+ e. Exceptions and Limitations means fair use, fair dealing, and/or
305
+ any other exception or limitation to Copyright and Similar Rights
306
+ that applies to Your use of the Licensed Material.
307
+
308
+ f. Licensed Material means the artistic or literary work, database,
309
+ or other material to which the Licensor applied this Public
310
+ License.
311
+
312
+ g. Licensed Rights means the rights granted to You subject to the
313
+ terms and conditions of this Public License, which are limited to
314
+ all Copyright and Similar Rights that apply to Your use of the
315
+ Licensed Material and that the Licensor has authority to license.
316
+
317
+ h. Licensor means the individual(s) or entity(ies) granting rights
318
+ under this Public License.
319
+
320
+ i. Share means to provide material to the public by any means or
321
+ process that requires permission under the Licensed Rights, such
322
+ as reproduction, public display, public performance, distribution,
323
+ dissemination, communication, or importation, and to make material
324
+ available to the public including in ways that members of the
325
+ public may access the material from a place and at a time
326
+ individually chosen by them.
327
+
328
+ j. Sui Generis Database Rights means rights other than copyright
329
+ resulting from Directive 96/9/EC of the European Parliament and of
330
+ the Council of 11 March 1996 on the legal protection of databases,
331
+ as amended and/or succeeded, as well as other essentially
332
+ equivalent rights anywhere in the world.
333
+
334
+ k. You means the individual or entity exercising the Licensed Rights
335
+ under this Public License. Your has a corresponding meaning.
336
+
337
+
338
+ Section 2 -- Scope.
339
+
340
+ a. License grant.
341
+
342
+ 1. Subject to the terms and conditions of this Public License,
343
+ the Licensor hereby grants You a worldwide, royalty-free,
344
+ non-sublicensable, non-exclusive, irrevocable license to
345
+ exercise the Licensed Rights in the Licensed Material to:
346
+
347
+ a. reproduce and Share the Licensed Material, in whole or
348
+ in part; and
349
+
350
+ b. produce, reproduce, and Share Adapted Material.
351
+
352
+ 2. Exceptions and Limitations. For the avoidance of doubt, where
353
+ Exceptions and Limitations apply to Your use, this Public
354
+ License does not apply, and You do not need to comply with
355
+ its terms and conditions.
356
+
357
+ 3. Term. The term of this Public License is specified in Section
358
+ 6(a).
359
+
360
+ 4. Media and formats; technical modifications allowed. The
361
+ Licensor authorizes You to exercise the Licensed Rights in
362
+ all media and formats whether now known or hereafter created,
363
+ and to make technical modifications necessary to do so. The
364
+ Licensor waives and/or agrees not to assert any right or
365
+ authority to forbid You from making technical modifications
366
+ necessary to exercise the Licensed Rights, including
367
+ technical modifications necessary to circumvent Effective
368
+ Technological Measures. For purposes of this Public License,
369
+ simply making modifications authorized by this Section 2(a)
370
+ (4) never produces Adapted Material.
371
+
372
+ 5. Downstream recipients.
373
+
374
+ a. Offer from the Licensor -- Licensed Material. Every
375
+ recipient of the Licensed Material automatically
376
+ receives an offer from the Licensor to exercise the
377
+ Licensed Rights under the terms and conditions of this
378
+ Public License.
379
+
380
+ b. No downstream restrictions. You may not offer or impose
381
+ any additional or different terms or conditions on, or
382
+ apply any Effective Technological Measures to, the
383
+ Licensed Material if doing so restricts exercise of the
384
+ Licensed Rights by any recipient of the Licensed
385
+ Material.
386
+
387
+ 6. No endorsement. Nothing in this Public License constitutes or
388
+ may be construed as permission to assert or imply that You
389
+ are, or that Your use of the Licensed Material is, connected
390
+ with, or sponsored, endorsed, or granted official status by,
391
+ the Licensor or others designated to receive attribution as
392
+ provided in Section 3(a)(1)(A)(i).
393
+
394
+ b. Other rights.
395
+
396
+ 1. Moral rights, such as the right of integrity, are not
397
+ licensed under this Public License, nor are publicity,
398
+ privacy, and/or other similar personality rights; however, to
399
+ the extent possible, the Licensor waives and/or agrees not to
400
+ assert any such rights held by the Licensor to the limited
401
+ extent necessary to allow You to exercise the Licensed
402
+ Rights, but not otherwise.
403
+
404
+ 2. Patent and trademark rights are not licensed under this
405
+ Public License.
406
+
407
+ 3. To the extent possible, the Licensor waives any right to
408
+ collect royalties from You for the exercise of the Licensed
409
+ Rights, whether directly or through a collecting society
410
+ under any voluntary or waivable statutory or compulsory
411
+ licensing scheme. In all other cases the Licensor expressly
412
+ reserves any right to collect such royalties.
413
+
414
+
415
+ Section 3 -- License Conditions.
416
+
417
+ Your exercise of the Licensed Rights is expressly made subject to the
418
+ following conditions.
419
+
420
+ a. Attribution.
421
+
422
+ 1. If You Share the Licensed Material (including in modified
423
+ form), You must:
424
+
425
+ a. retain the following if it is supplied by the Licensor
426
+ with the Licensed Material:
427
+
428
+ i. identification of the creator(s) of the Licensed
429
+ Material and any others designated to receive
430
+ attribution, in any reasonable manner requested by
431
+ the Licensor (including by pseudonym if
432
+ designated);
433
+
434
+ ii. a copyright notice;
435
+
436
+ iii. a notice that refers to this Public License;
437
+
438
+ iv. a notice that refers to the disclaimer of
439
+ warranties;
440
+
441
+ v. a URI or hyperlink to the Licensed Material to the
442
+ extent reasonably practicable;
443
+
444
+ b. indicate if You modified the Licensed Material and
445
+ retain an indication of any previous modifications; and
446
+
447
+ c. indicate the Licensed Material is licensed under this
448
+ Public License, and include the text of, or the URI or
449
+ hyperlink to, this Public License.
450
+
451
+ 2. You may satisfy the conditions in Section 3(a)(1) in any
452
+ reasonable manner based on the medium, means, and context in
453
+ which You Share the Licensed Material. For example, it may be
454
+ reasonable to satisfy the conditions by providing a URI or
455
+ hyperlink to a resource that includes the required
456
+ information.
457
+
458
+ 3. If requested by the Licensor, You must remove any of the
459
+ information required by Section 3(a)(1)(A) to the extent
460
+ reasonably practicable.
461
+
462
+ 4. If You Share Adapted Material You produce, the Adapter's
463
+ License You apply must not prevent recipients of the Adapted
464
+ Material from complying with this Public License.
465
+
466
+
467
+ Section 4 -- Sui Generis Database Rights.
468
+
469
+ Where the Licensed Rights include Sui Generis Database Rights that
470
+ apply to Your use of the Licensed Material:
471
+
472
+ a. for the avoidance of doubt, Section 2(a)(1) grants You the right
473
+ to extract, reuse, reproduce, and Share all or a substantial
474
+ portion of the contents of the database;
475
+
476
+ b. if You include all or a substantial portion of the database
477
+ contents in a database in which You have Sui Generis Database
478
+ Rights, then the database in which You have Sui Generis Database
479
+ Rights (but not its individual contents) is Adapted Material; and
480
+
481
+ c. You must comply with the conditions in Section 3(a) if You Share
482
+ all or a substantial portion of the contents of the database.
483
+
484
+ For the avoidance of doubt, this Section 4 supplements and does not
485
+ replace Your obligations under this Public License where the Licensed
486
+ Rights include other Copyright and Similar Rights.
487
+
488
+
489
+ Section 5 -- Disclaimer of Warranties and Limitation of Liability.
490
+
491
+ a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
492
+ EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
493
+ AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
494
+ ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
495
+ IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
496
+ WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
497
+ PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
498
+ ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
499
+ KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
500
+ ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
501
+
502
+ b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
503
+ TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
504
+ NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
505
+ INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
506
+ COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
507
+ USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
508
+ ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
509
+ DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
510
+ IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
511
+
512
+ c. The disclaimer of warranties and limitation of liability provided
513
+ above shall be interpreted in a manner that, to the extent
514
+ possible, most closely approximates an absolute disclaimer and
515
+ waiver of all liability.
516
+
517
+
518
+ Section 6 -- Term and Termination.
519
+
520
+ a. This Public License applies for the term of the Copyright and
521
+ Similar Rights licensed here. However, if You fail to comply with
522
+ this Public License, then Your rights under this Public License
523
+ terminate automatically.
524
+
525
+ b. Where Your right to use the Licensed Material has terminated under
526
+ Section 6(a), it reinstates:
527
+
528
+ 1. automatically as of the date the violation is cured, provided
529
+ it is cured within 30 days of Your discovery of the
530
+ violation; or
531
+
532
+ 2. upon express reinstatement by the Licensor.
533
+
534
+ For the avoidance of doubt, this Section 6(b) does not affect any
535
+ right the Licensor may have to seek remedies for Your violations
536
+ of this Public License.
537
+
538
+ c. For the avoidance of doubt, the Licensor may also offer the
539
+ Licensed Material under separate terms or conditions or stop
540
+ distributing the Licensed Material at any time; however, doing so
541
+ will not terminate this Public License.
542
+
543
+ d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
544
+ License.
545
+
546
+
547
+ Section 7 -- Other Terms and Conditions.
548
+
549
+ a. The Licensor shall not be bound by any additional or different
550
+ terms or conditions communicated by You unless expressly agreed.
551
+
552
+ b. Any arrangements, understandings, or agreements regarding the
553
+ Licensed Material not stated herein are separate from and
554
+ independent of the terms and conditions of this Public License.
555
+
556
+
557
+ Section 8 -- Interpretation.
558
+
559
+ a. For the avoidance of doubt, this Public License does not, and
560
+ shall not be interpreted to, reduce, limit, restrict, or impose
561
+ conditions on any use of the Licensed Material that could lawfully
562
+ be made without permission under this Public License.
563
+
564
+ b. To the extent possible, if any provision of this Public License is
565
+ deemed unenforceable, it shall be automatically reformed to the
566
+ minimum extent necessary to make it enforceable. If the provision
567
+ cannot be reformed, it shall be severed from this Public License
568
+ without affecting the enforceability of the remaining terms and
569
+ conditions.
570
+
571
+ c. No term or condition of this Public License will be waived and no
572
+ failure to comply consented to unless expressly agreed to by the
573
+ Licensor.
574
+
575
+ d. Nothing in this Public License constitutes or may be interpreted
576
+ as a limitation upon, or waiver of, any privileges and immunities
577
+ that apply to the Licensor or You, including from the legal
578
+ processes of any jurisdiction or authority.
579
+
580
+
581
+ =======================================================================
582
+
583
+ Creative Commons is not a party to its public licenses.
584
+ Notwithstanding, Creative Commons may elect to apply one of its public
585
+ licenses to material it publishes and in those instances will be
586
+ considered the "Licensor." Except for the limited purpose of indicating
587
+ that material is shared under a Creative Commons public license or as
588
+ otherwise permitted by the Creative Commons policies published at
589
+ creativecommons.org/policies, Creative Commons does not authorize the
590
+ use of the trademark "Creative Commons" or any other trademark or logo
591
+ of Creative Commons without its prior written consent including,
592
+ without limitation, in connection with any unauthorized modifications
593
+ to any of its public licenses or any other arrangements,
594
+ understandings, or agreements concerning use of licensed material. For
595
+ the avoidance of doubt, this paragraph does not form part of the public
596
+ licenses.
597
+
598
+ Creative Commons may be contacted at creativecommons.org.
data/README.md ADDED
@@ -0,0 +1 @@
1
+ # earlgrey
data/Thorfile ADDED
@@ -0,0 +1,7 @@
1
+ require 'rubygems'
2
+ require 'appium_thor'
3
+
4
+ Appium::Thor::Config.set do
5
+ gem_name 'earlgrey'
6
+ github_owner 'bootstraponline'
7
+ end
data/earlgrey.gemspec ADDED
@@ -0,0 +1,27 @@
1
+ require_relative 'lib/earlgrey/version'
2
+
3
+ Gem::Specification.new do |s|
4
+ s.required_ruby_version = '>= 2.1.9'
5
+
6
+ s.name = 'earlgrey'
7
+ s.version = EarlGrey::VERSION
8
+ s.date = EarlGrey::DATE
9
+ s.license = 'Apache-2.0'
10
+ s.description = s.summary = 'EarlGrey helper gem'
11
+ s.description += '.' # avoid identical warning
12
+ s.authors = s.email = ['code@bootstraponline.com']
13
+ s.homepage = 'https://github.com/bootstraponline/earlgrey'
14
+ s.require_paths = ['lib']
15
+
16
+ s.add_runtime_dependency 'colored', '>= 1.2'
17
+ s.add_runtime_dependency 'xcodeproj', '>= 0.28.2'
18
+
19
+ s.add_development_dependency 'rspec', '>= 3.4.0'
20
+ s.add_development_dependency 'appium_thor', '>= 1.0.1'
21
+ s.add_development_dependency 'rubocop', '>= 0.39.0'
22
+ s.add_development_dependency 'coveralls', '~> 0.8.13'
23
+
24
+ s.files = `git ls-files -z`.split("\x0").reject do |f|
25
+ f.match(%r{^(spec)/})
26
+ end
27
+ end
data/lib/earlgrey.rb ADDED
@@ -0,0 +1 @@
1
+ require_relative 'earlgrey/version'
@@ -0,0 +1,4 @@
1
+ module EarlGrey
2
+ VERSION = '0.0.1' unless defined? ::EarlGrey::VERSION
3
+ DATE = '2016-04-07' unless defined? ::EarlGrey::DATE
4
+ end
data/release_notes.md ADDED
File without changes
@@ -0,0 +1,194 @@
1
+ #!/usr/bin/ruby
2
+ #
3
+ # Copyright 2016 Google Inc.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ require 'xcodeproj'
18
+ EARLGREY_TARGET_NAME = 'EarlGrey'
19
+
20
+ def configure_for_earlgrey(project_name, test_target, scheme_file)
21
+ puts ("Checking and Updating " + project_name + " for EarlGrey.").blue
22
+ if (!File.exist?(project_name + '.xcodeproj'))
23
+ raise "The target's xcodeproj file could not be found. Please check if "\
24
+ "the correct PROJECT_NAME is being passed in the Podfile. Current "\
25
+ "PROJECT_NAME is: " + project_name
26
+ end
27
+
28
+ user_project = Xcodeproj::Project.open(project_name + '.xcodeproj')
29
+
30
+ # Add a Test Action to the User Project Scheme.
31
+ scheme = modify_scheme_for_actions(project_name, user_project, scheme_file)
32
+
33
+ # Add a Copy Files Build Phase for EarlGrey.framework to embed it into the app under test.
34
+ add_earlgrey_copy_files_script(user_project, test_target)
35
+
36
+ if not scheme.nil?
37
+ save_earlgrey_scheme_changes(scheme)
38
+ end
39
+ puts ("EarlGrey setup complete. You can use the Test Target : " + test_target +
40
+ " for EarlGrey testing.").blue
41
+ end
42
+
43
+ # Scheme changes to ensure that EarlGrey is correctly loaded before main() is called.
44
+ def modify_scheme_for_actions(project_name, user_project, scheme_filename)
45
+ # If you do not pass on a scheme name, we set it to the project name itself.
46
+ if scheme_filename.to_s == ''
47
+ scheme_filename = project_name
48
+ end
49
+
50
+ xcdata_dir = Xcodeproj::XCScheme.user_data_dir(user_project.path)
51
+ if not File.exist?(File.join(xcdata_dir, scheme_filename).to_s)
52
+ xcdata_dir = Xcodeproj::XCScheme.shared_data_dir(user_project.path)
53
+ end
54
+
55
+ if not File.exist?(File.join(xcdata_dir, scheme_filename).to_s)
56
+ raise "The required scheme \"" + scheme_filename +"\" could not be found."
57
+ " Please ensure that the required scheme file exists within your"\
58
+ " project directory."
59
+ end
60
+ scheme = Xcodeproj::XCScheme.new File.join(xcdata_dir, scheme_filename)
61
+ test_action_key = 'DYLD_INSERT_LIBRARIES'
62
+ test_action_value = '@executable_path/EarlGrey.framework/EarlGrey'
63
+ if not scheme.test_action.xml_element.to_s.include? test_action_value
64
+ scheme =
65
+ add_environment_variables_to_test_action_scheme(scheme_filename,
66
+ scheme,
67
+ test_action_key,
68
+ test_action_value)
69
+ end
70
+
71
+ return scheme
72
+ end
73
+
74
+ # Load the EarlGrey framework when the app binary is loaded by
75
+ # the dynamic loader, before the main() method is called.
76
+ def add_environment_variables_to_test_action_scheme(scheme_filename,
77
+ scheme,
78
+ test_action_key,
79
+ test_action_value)
80
+ test_action = scheme.test_action
81
+ if (scheme.test_action.xml_element.to_s.include? test_action_key) ||
82
+ (scheme.launch_action.xml_element.to_s.include? test_action_key)
83
+ puts ("\n//////////////////// EARLGREY SCHEME ISSUE ////////////////////\n"\
84
+ "EarlGrey failed to modify the Test Action part of the scheme: " + scheme_filename + "\n"\
85
+ + "for one of following reasons:\n\n"\
86
+ "1) DYLD_INSERT_LIBRARIES is already defined under Environment Variables of\n"\
87
+ "the Test Action.\n"\
88
+ "2) Run Action's environment variables are used for Test Action.\n\n"\
89
+ "To ensure correct functioning of EarlGrey, please manually add the\n"\
90
+ "following under Test Action's Environment Variables of the scheme:" + scheme_filename + "\n"\
91
+ "Environment Variables or EarlGrey's location will not be found.\n"\
92
+ "Name: DYLD_INSERT_LIBRARIES\n"\
93
+ "Value: @executable_path/EarlGrey.framework/EarlGrey\n"\
94
+ "///////////////////////////////////////////////////////////////\n\n").yellow
95
+ return
96
+ end
97
+ puts "Adding EarlGrey Framework Location as an Environment Variable "
98
+ "in the App Project's Test Target's Scheme Test Action."
99
+
100
+ # Check if the test action uses the run action's environment variables and arguments.
101
+ launch_action_env_args_present = false
102
+ if (scheme.test_action.xml_element.to_s.include? 'shouldUseLaunchSchemeArgsEnv') &&
103
+ ((scheme.launch_action.xml_element.to_s.include? '<EnvironmentVariables>') ||
104
+ (scheme.launch_action.xml_element.to_s.include? '<CommandLineArguments>'))
105
+ launch_action_env_args_present = true
106
+ end
107
+
108
+ test_action_isEnabled = 'YES'
109
+ test_action.should_use_launch_scheme_args_env = false
110
+
111
+ # If no environment variables are set, then create the element itself.
112
+ if not (scheme.test_action.xml_element.to_s.include? '<EnvironmentVariables>')
113
+ scheme.test_action.xml_element.add_element('EnvironmentVariables')
114
+ end
115
+
116
+ # If Launch Action Arguments are present and none are present in the test
117
+ # action, then please add them in.
118
+ if (scheme.launch_action.xml_element.to_s.include? '<CommandLineArguments>') &&
119
+ !(scheme.test_action.xml_element.to_s.include? '<CommandLineArguments>')
120
+ scheme.test_action.xml_element.add_element('CommandLineArguments')
121
+ end
122
+
123
+ # Create a new environment variable and add it to the Environment Variables.
124
+ test_action_env_vars = scheme.test_action.xml_element.elements['EnvironmentVariables']
125
+ test_action_args = scheme.test_action.xml_element.elements['CommandLineArguments']
126
+
127
+ earl_grey_environment_variable = REXML::Element.new "EnvironmentVariable"
128
+ earl_grey_environment_variable.attributes['key'] = test_action_key
129
+ earl_grey_environment_variable.attributes['value'] = test_action_value
130
+ earl_grey_environment_variable.attributes['isEnabled'] = test_action_isEnabled
131
+ test_action_env_vars.add_element(earl_grey_environment_variable)
132
+
133
+ # If any environment variables or arguments were being used in the test action by
134
+ # being copied from the launch (run) action then copy them over to the test action
135
+ # along with the EarlGrey environment variable.
136
+ if (launch_action_env_args_present)
137
+ launch_action_env_vars = scheme.launch_action.xml_element.elements['EnvironmentVariables']
138
+ launch_action_args = scheme.launch_action.xml_element.elements['CommandLineArguments']
139
+
140
+ # Add in the Environment Variables
141
+ launch_action_env_vars.elements.each('EnvironmentVariable') do |launch_action_env_var|
142
+ environment_variable = REXML::Element.new 'EnvironmentVariable'
143
+ environment_variable.attributes['key'] = launch_action_env_var.attributes['key']
144
+ environment_variable.attributes['value'] = launch_action_env_var.attributes['value']
145
+ environment_variable.attributes['isEnabled'] = launch_action_env_var.attributes['isEnabled']
146
+ test_action_env_vars.add_element(environment_variable)
147
+ end
148
+
149
+ #Add in the Arguments
150
+ launch_action_args.elements.each('CommandLineArgument') do |launch_action_arg|
151
+ argument = REXML::Element.new 'CommandLineArgument'
152
+ argument.attributes['argument'] = launch_action_arg.attributes['argument']
153
+ argument.attributes['isEnabled'] = launch_action_arg.attributes['isEnabled']
154
+ test_action_args.add_element(argument)
155
+ end
156
+
157
+ end
158
+ scheme.test_action = test_action
159
+ return scheme
160
+ end
161
+
162
+ # Generates a copy files build phase to embed the EarlGrey framework into
163
+ # the app under test.
164
+ def add_earlgrey_copy_files_script(user_project, test_target)
165
+ user_project.targets.each do |target|
166
+ earlgrey_copy_files_phase_name = 'EarlGrey Copy Files'
167
+ if target.name == test_target
168
+ earlgrey_copy_files_exists = false
169
+ target.copy_files_build_phases.each do |copy_files_phase|
170
+ if copy_files_phase.name = earlgrey_copy_files_phase_name
171
+ earlgrey_copy_files_exists = true
172
+ end
173
+ end
174
+
175
+ if earlgrey_copy_files_exists == false
176
+ new_copy_files_phase = target.new_copy_files_build_phase(earlgrey_copy_files_phase_name)
177
+ new_copy_files_phase.dst_path = '$(TEST_HOST)/../'
178
+ new_copy_files_phase.dst_subfolder_spec = '0'
179
+ file_ref =
180
+ user_project.products_group.new_file('${SRCROOT}/Pods/EarlGrey/EarlGrey-1.0.0/EarlGrey.framework')
181
+ file_ref.source_tree = 'SRCROOT'
182
+ build_file = new_copy_files_phase.add_file_reference(file_ref, true)
183
+ build_file.settings = { 'ATTRIBUTES' => ['CodeSignOnCopy'] }
184
+ user_project.save()
185
+ end
186
+ end
187
+ end
188
+ end
189
+
190
+ # Save the scheme changes. This is done here to prevent any irreversible changes in case
191
+ # of an exception being thrown.
192
+ def save_earlgrey_scheme_changes(scheme)
193
+ scheme.save!
194
+ end
@@ -0,0 +1,11 @@
1
+ require 'rubygems'
2
+ require 'xcodeproj'
3
+ require 'colored'
4
+ require_relative 'configure_earlgrey_pods.rb'
5
+
6
+ # xcodebuild -list # lists project/targets/scheme
7
+ PROJECT_NAME = 'Example'
8
+ TEST_TARGET_SWIFT = 'ExampleEarlGrey2'
9
+ SCHEME_FILE_SWIFT = 'ExampleEarlGrey2.xcscheme'
10
+
11
+ configure_for_earlgrey(PROJECT_NAME, TEST_TARGET_SWIFT, SCHEME_FILE_SWIFT)
metadata ADDED
@@ -0,0 +1,140 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: earlgrey
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - code@bootstraponline.com
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-04-07 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: colored
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '1.2'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '1.2'
27
+ - !ruby/object:Gem::Dependency
28
+ name: xcodeproj
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 0.28.2
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: 0.28.2
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: 3.4.0
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: 3.4.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: appium_thor
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: 1.0.1
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: 1.0.1
69
+ - !ruby/object:Gem::Dependency
70
+ name: rubocop
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: 0.39.0
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: 0.39.0
83
+ - !ruby/object:Gem::Dependency
84
+ name: coveralls
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: 0.8.13
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: 0.8.13
97
+ description: EarlGrey helper gem.
98
+ email:
99
+ - code@bootstraponline.com
100
+ executables: []
101
+ extensions: []
102
+ extra_rdoc_files: []
103
+ files:
104
+ - ".gitignore"
105
+ - Gemfile
106
+ - LICENSE
107
+ - README.md
108
+ - Thorfile
109
+ - earlgrey.gemspec
110
+ - lib/earlgrey.rb
111
+ - lib/earlgrey/version.rb
112
+ - release_notes.md
113
+ - todo/configure_earlgrey_pods.rb
114
+ - todo/swift_config.rb
115
+ homepage: https://github.com/bootstraponline/earlgrey
116
+ licenses:
117
+ - Apache-2.0
118
+ metadata: {}
119
+ post_install_message:
120
+ rdoc_options: []
121
+ require_paths:
122
+ - lib
123
+ required_ruby_version: !ruby/object:Gem::Requirement
124
+ requirements:
125
+ - - ">="
126
+ - !ruby/object:Gem::Version
127
+ version: 2.1.9
128
+ required_rubygems_version: !ruby/object:Gem::Requirement
129
+ requirements:
130
+ - - ">="
131
+ - !ruby/object:Gem::Version
132
+ version: '0'
133
+ requirements: []
134
+ rubyforge_project:
135
+ rubygems_version: 2.6.2
136
+ signing_key:
137
+ specification_version: 4
138
+ summary: EarlGrey helper gem
139
+ test_files: []
140
+ has_rdoc: