faussaire 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 714ee3f21dd5575ad01277d68a1ea579a30df7b291f179d668505c75f9bb3446
4
+ data.tar.gz: 165a13bca8e97fd6a21b9a6f7d85186ffa37591ecf49587e8a080c42f02311b1
5
+ SHA512:
6
+ metadata.gz: 9da106d7163b98fd9d1de4cf0e2e9f47bb3978a636ea0109e9d3c523e7ad260787d39737f43e6a48e8fc4893a76b14a7dc9dbe444205535a18265e084207f584
7
+ data.tar.gz: a601ca5524c1f5a982fad60d24743a6fa462ca53598971ff73376da4580d6b082f7c66d8ec2e8bcb16e4d91f78da60f93b11d77f7113867dec197adb59ab9b13
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,13 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.6
3
+
4
+ Style/StringLiterals:
5
+ Enabled: true
6
+ EnforcedStyle: double_quotes
7
+
8
+ Style/StringLiteralsInInterpolation:
9
+ Enabled: true
10
+ EnforcedStyle: double_quotes
11
+
12
+ Layout/LineLength:
13
+ Max: 120
data/CHANGELOG.md ADDED
@@ -0,0 +1,11 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - 2023-12-25
4
+
5
+ - Initial release
6
+
7
+ ## [Unreleased]
8
+
9
+ ## [0.1.1] - 2024-09-28
10
+
11
+ - Publishing attempt
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,251 @@
1
+ # Become a Faussaire: Contributing Guidelines
2
+
3
+ Bonjour mighty programmer! 👋 Thinking about contributing to Faussaire? That’s awesome! Whether you’re a seasoned dev or just a beginner looking to practice, we’re excited to see what you’ll come up with. To keep things running smoothly, we’ve got a few guidelines for you.
4
+
5
+ **_These are just guidelines—nothing here is set in stone._**
6
+
7
+ If you’ve got something cool to add, don’t be shy! Well-documented pull requests are always welcome, even if you don’t check every box below. We’re here to learn and have fun, after all! 😄
8
+
9
+
10
+ > [!NOTE]
11
+ > <p align="center">
12
+ > <a href="#Français" style="text-decoration:none;">
13
+ > <img src="bonjour.png" alt="Français" width="50" height="50">
14
+ > </a>
15
+ > <br>
16
+ > <a href="#Français" style="text-decoration:none;">
17
+ > Évidemment, vous pouvez aussi me lire en français. On est là pour ça, non ?
18
+ > </a>
19
+ > </p>
20
+
21
+ ## Guidelines
22
+
23
+ 1. **Tests, Tests, Tests:**
24
+ - Every new feature, bug fix, or data addition needs to come with tests.
25
+ - Make sure your tests cover all the important stuff and that they pass before you submit your pull request. We love seeing those green checkmarks! ✅
26
+
27
+ > [!IMPORTANT]
28
+ > Testing for duplicate values and data integrity is a must to ensure the gem runs smoothly.
29
+
30
+ 2. **Keep It Original:**
31
+ - Your contributions should be original and crafted with care. We put a lot of love into this project, and we hope you will too! 💖
32
+ - **No AI-generated data** and definitely **no direct copy-pasting** without some thoughtful formatting or adapting.
33
+
34
+ > [!TIP]
35
+ > Whatever you add should fit within the French vibe we’ve got going here. At the very least, it should be written in French. đŸ‡«đŸ‡·
36
+
37
+ 3. **Update the README:**
38
+ - Added something new? Awesome! Just don’t forget to update the `README.md` so others know how to use it (and that it exists!). 👀
39
+
40
+ > [!NOTE]
41
+ > Stick to the current format so everything stays neat and easy to follow.
42
+
43
+ 4. **Relevance:**
44
+ - We’ve had enough of lorem ipsum—Faussaire is both serious & fun but definitely not boring, and we’d love to keep it that way!
45
+ - If you’re looking to practice or contribute, we recommend focusing on cultural themes like poets, quotes, sentence generators, specific brands, etc. We’re all about fun, business, and art here at Faussaire (even if the "crew" is currently...shhh, don’t tell anyone).
46
+
47
+ > [!IMPORTANT]
48
+ > Got something interesting? Great! Just keep it in French... For now!
49
+
50
+ - While our main focus is on French, we’re open to all kinds of topics and languages. And who knows, maybe a Greek version is on the horizon! Wink wink!
51
+
52
+ 5. **Code Comments:**
53
+ - Your code should be well-commented to ensure clarity and maintainability.
54
+
55
+ > [!TIP]
56
+ > While we prefer code to be written in English (because it’s just good practice, and we actually love foreign languages), we’re totally cool with comments in French given the nature of the app.
57
+
58
+ ```ruby
59
+ require 'yaml'
60
+
61
+ module Faussaire
62
+ class Music
63
+ DATA_PATH = File.expand_path('../../../locale/fr.yml', __FILE__)
64
+
65
+ ##
66
+ # Fetches and samples data based on the provided key. If the fetched data is an array,
67
+ # it samples a single item, otherwise returns the data directly.
68
+ #
69
+ # @param key [String] The dot-separated key used to access the data.
70
+ # @return [Object, nil] The data fetched and optionally sampled.
71
+ #
72
+ def self.fetch(key)
73
+ data = YAML.load_file(DATA_PATH)
74
+ result = data.dig(*key.split('.'))
75
+ result.is_a?(Array) ? result.sample : result
76
+ end
77
+
78
+ ##
79
+ # Produces a random house song.
80
+ #
81
+ # @return [String]
82
+ #
83
+ # @example
84
+ # Faussaire::Music.house #=> "House is a feeling - LA Riots"
85
+ #
86
+ def self.house
87
+ fetch('fr.faussaire.music.house')
88
+ end
89
+
90
+ ##
91
+ # Produces a random French rap song.
92
+ #
93
+ # @return [String]
94
+ #
95
+ # @example
96
+ # Faussaire::Music.rap #=> "Onizuka - PNL"
97
+ #
98
+ def self.rap
99
+ fetch('fr.faussaire.music.rap')
100
+ end
101
+
102
+ ##
103
+ # Produces a random French variété song.
104
+ #
105
+ # @return [String]
106
+ #
107
+ # @example
108
+ # Faussaire::Music.variete #=> "Laisse tomber les filles - France Gall"
109
+ #
110
+ def self.variete
111
+ fetch('fr.faussaire.music.variete')
112
+ end
113
+ end
114
+ end
115
+ ```
116
+
117
+ ## How to Submit Your Contribution
118
+
119
+ 1. Fork the repository and create your feature branch: `git checkout -b a-great-idea-from-toi`
120
+ 2. Make your changes, ensuring you follow the guidelines above.
121
+ 3. Commit your changes: `git commit -am 'Added set of ridiculous quotes from French politicians and/or French fashion brands'`
122
+ 4. Push to the branch: `git push origin a-great-idea-from-toi`
123
+ 5. Submit a pull request.
124
+
125
+ > [!TIP]
126
+ > That’s it! We’re thrilled to see what you’ll add to Faussaire. Also, fun fact: The “Faussaire crew” currently consists of...well, just me. But hey, that means learning by doing is really a thing so keep going! Don't give up!
127
+
128
+ Merci beaucoup for helping out and making Faussaire even better!
129
+
130
+ <a name="Français"></a>
131
+
132
+ # Devenir un Faussaire : Guide de Contribution
133
+
134
+ Bonjour, monde ! 👋 Vous rejoignez le navire en contribuant Ă  Faussaire ? Mais c'est gĂ©nial !
135
+
136
+ Que vous soyez un(e) dev expérimenté(e) ou un(e) débutant(e) cherchant à pratiquer, on a hùte de voir ce que vous allez proposer. Pour que tout se passe bien, voici quelques rÚgles simples à suivre.
137
+
138
+ > [!NOTE]
139
+ > Ce ne sont QUE des lignes directrices—rien de plus. Si vous avez une super idĂ©e, n’hĂ©sitez pas ! Les pull requests bien documentĂ©es sont toujours les bienvenues, mĂȘme si vous ne cochez pas toutes les "cases" ci-dessous. On est ici pour apprendre et s’amuser, aprĂšs tout ! 😄
140
+
141
+
142
+ ## Les fameuses lignes directrices
143
+
144
+ 1. **Tests, Tests, Tests :**
145
+ - Chaque nouvelle fonctionnalitĂ©, correction de bug ou ajout de donnĂ©es doit ĂȘtre accompagnĂ© de tests.
146
+ - Assurez-vous que vos tests couvrent bien tout ce qui est important et qu’ils passent avant de soumettre votre pull request. On aime voir du vert dans le terminal ! ✅
147
+
148
+ > [!IMPORTANT]
149
+ > Les tests pour Ă©viter les doublons et vĂ©rifier l’intĂ©gritĂ© des donnĂ©es sont essentiels pour que la gem fonctionne correctement. C'est pour ça qu'on a dĂ©cidĂ© de les rendre obligatoires.
150
+
151
+ 2. **Restez Original(e) :**
152
+ - Vos contributions doivent ĂȘtre originales et mijotĂ©es aux petits oignons. On met beaucoup de 💖 dans ce projet, et on espĂšre que vous en ferez autant !
153
+ - **Pas de donnĂ©es gĂ©nĂ©rĂ©es par IA** et surtout **pas de copier-coller direct** sans une petite touche perso ou un minimum d’adaptation.
154
+
155
+ > [!TIP]
156
+ > Ce que vous ajoutez doit s’inscrire dans l’esprit que l’on cultive ici: drîle et/ou culturellement enrichissant.
157
+
158
+ 3. **Mise Ă  jour du README :**
159
+ - Vous avez envoyĂ© la sauce ? Super ! N’oubliez pas de mettre Ă  jour le `README.md` pour que les autres sachent oĂč la trouver (et qu'elle existe !). 👀
160
+
161
+ > [!NOTE]
162
+ > Respectez le format actuel pour que tout reste bien organisé et facile à suivre.
163
+
164
+ 4. **Pertinence :**
165
+ - On en a assez du lorem ipsum—Faussaire, c’est sĂ©rieux & fun, mais surtout pas ennuyeux, et on veut que ça reste comme ça !
166
+ - Si vous cherchez à pratiquer la programmation et/ou à contribuer, on vous conseille de vous concentrer sur des thÚmes comme la poésie, les citations, les générateurs de phrases (un peu plus corsé), les marques, etc...
167
+ - MĂȘme si notre prioritĂ© reste le français, on est ouverts Ă  d’autres sujets et langues. Et qui sait, peut-ĂȘtre qu’une version grecque est en prĂ©paration ! Clin d’Ɠil, clin d’Ɠil !
168
+ - Chez Faussaire, on adore rire donc lĂąchez vous.
169
+
170
+ ![Karine Lemarchand adore rire](jadore-rire.gif)
171
+
172
+ 5. **Commentaires :**
173
+ - Votre code doit ĂȘtre bien commentĂ© pour ĂȘtre clair et facile Ă  maintenir.
174
+
175
+ > [!TIP]
176
+ > MĂȘme si on prĂ©fĂšre que le code soit Ă©crit en anglais (c’est pĂŽ juste mais c'est partout pareil), les commentaires en français sont parfaitement OK, vu la nature de l’appli.
177
+
178
+ ```ruby
179
+ require 'yaml'
180
+
181
+ module Faussaire
182
+ class Music
183
+ DATA_PATH = File.expand_path('../../../locale/fr.yml', __FILE__)
184
+
185
+ ##
186
+ # RécupÚre et échantillonne les données en fonction de la clé fournie. Si les données récupérées sont un tableau,
187
+ # il en échantillonne un seul élément, sinon il retourne les données directement.
188
+ #
189
+ # @param key [String] La clé utilisée pour accéder aux données.
190
+ # @return [Object, nil] Les données récupérées et éventuellement échantillonnées.
191
+ #
192
+ def self.fetch(key)
193
+ data = YAML.load_file(DATA_PATH)
194
+ result = data.dig(*key.split('.'))
195
+ result.is_a?(Array) ? result.sample : result
196
+ end
197
+
198
+ ##
199
+ # GénÚre une chanson de house aléatoire.
200
+ #
201
+ # @return [String]
202
+ #
203
+ # @example
204
+ # Faussaire::Music.house #=> "House is a feeling - LA Riots"
205
+ #
206
+ def self.house
207
+ fetch('fr.faussaire.music.house')
208
+ end
209
+
210
+ ##
211
+ # GénÚre une chanson de rap français aléatoire.
212
+ #
213
+ # @return [String]
214
+ #
215
+ # @example
216
+ # Faussaire::Music.rap #=> "Onizuka - PNL"
217
+ #
218
+ def self.rap
219
+ fetch('fr.faussaire.music.rap')
220
+ end
221
+
222
+ ##
223
+ # GénÚre une chanson de variété française aléatoire.
224
+ #
225
+ # @return [String]
226
+ #
227
+ # @example
228
+ # Faussaire::Music.variete #=> "Laisse tomber les filles - France Gall"
229
+ #
230
+ def self.variete
231
+ fetch('fr.faussaire.music.variete')
232
+ end
233
+ end
234
+ end
235
+ ```
236
+
237
+ ## Comment Soumettre Votre Contribution
238
+
239
+ 1. Forkez le dépÎt et créez votre branche : `git checkout -b une-super-idee-de-toi`
240
+ 2. Apportez vos modifications/additions en suivant les recommandations ci-dessus.
241
+ 3. Commitez vos changements : `git commit -am 'Ajout d'un ensemble de citations ridicules de politiciens français et/ou de marques de luxe françaises'`
242
+ 4. Poussez sur votre branche : `git push origin une-super-idee-de-toi`
243
+ 5. Balancez une pull request.
244
+
245
+ > [!TIP]
246
+ > Et voilĂ  ! On a hĂąte de dĂ©couvrir ce que vous allez ajouter Ă  Faussaire. D'ailleurs vous allez rire : "on", la "team Faussaire"... c'est personne, il n'y a que moi. Oui, j'aime la danse, la forĂȘt et la solitude.
247
+
248
+
249
+ Mais bon, ça prouve que l’apprentissage par la pratique, ça marche vraiment, alors continuez ! Ne lñchez rien ! 😉
250
+
251
+ ![Cuphead saying thank you](CUPHEAD.gif)
data/CUPHEAD.gif ADDED
Binary file
data/LICENSE.txt ADDED
@@ -0,0 +1,35 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2023-2024 Ikrame Saadi (@ikramagix)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
22
+
23
+ ----
24
+
25
+ Additional Terms on Data Ownership & Usage
26
+
27
+ The dataset included in this software, including but not limited to the `fr.yml` file and other data files (the "Dataset"), is the property of the original creator and is protected under applicable intellectual property laws. The following additional terms apply specifically to the Dataset:
28
+
29
+ 1. Educational Use Only: The Dataset may be used, modified, and distributed for educational purposes only as part of copies or substantial portions of the Software. Any other use of the Dataset is strictly prohibited without prior written authorization from the copyright holder.
30
+
31
+ 2. Restricted Use for Other Projects: The Dataset, including the `fr.yml` file, may not be extracted, used, or incorporated into other projects or software without explicit prior authorization from the copyright holder. This restriction applies regardless of whether the other project is for commercial or non-commercial purposes.
32
+
33
+ 3. Authorization Required: For any use of the Dataset outside the scope of these terms, including but not limited to commercial use or incorporation into other software, explicit authorization must be obtained from the copyright holder. Please contact [hello@ikramagix.com] for inquiries and permissions.
34
+
35
+ These additional terms do not modify the MIT License as it applies to the Software itself. The Software remains available under the terms of the MIT License, while the Dataset is subject to the above restrictions.