waldo 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +138 -11
- data/lib/waldo.rb +2 -2
- data/lib/waldo/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: acbcf92e048786f3910e1a3b67f144f110aa03d8
|
4
|
+
data.tar.gz: 65aee7a6d20d80b3265f437e94eced1f653c519e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 37fa1320e7268f5b04c334064c65751d0e71534382e71bea391221998bc84a2ebf0b355e234809cd7423f2600ef9c92c6b141d00f2b9c90c2f165d31928b4cc1
|
7
|
+
data.tar.gz: ed24f345139004b1249fa635d257d5a7fb468e95556b0ef84d90864f37e9ec3016d0c3ef9f5549c769188e9f7aead704fb2b04c8fc7e9f37dba73e9d527ebf96
|
data/README.md
CHANGED
@@ -1,15 +1,49 @@
|
|
1
1
|
# Waldo
|
2
2
|
|
3
|
-
Waldo is a repo meant to show you the process of making your own Ruby gem
|
3
|
+
Waldo is a repo meant to show you the process of making your own Ruby gem. In this scenario we're making
|
4
|
+
the gem called waldo. When you go about making your own, your name will have to be unique, and you'll need
|
5
|
+
to swap out the information that is unique to yourself and your gem. Overall I wanted to be as transparent
|
6
|
+
as I could about the process to show that it's not something to stress about and to give it a try!
|
7
|
+
|
8
|
+
# Make GitHub and RubyGems account
|
9
|
+
|
10
|
+
If you haven't done so already, this would be a great time to make yourself a GitHub account
|
11
|
+
and a RubyGems.org account. These will be used later in the tutorial.
|
4
12
|
|
5
13
|
# Process
|
6
14
|
|
15
|
+
## Install bundler
|
16
|
+
|
17
|
+
This step is optional if you already have it, but will be required for this tutorial.
|
18
|
+
|
19
|
+
$ gem install bundler
|
20
|
+
|
7
21
|
## Generate the gem
|
8
22
|
|
9
|
-
|
23
|
+
```
|
24
|
+
$ bundle gem waldo
|
25
|
+
|
26
|
+
Creating gem 'waldo'...
|
27
|
+
MIT License enabled in config
|
28
|
+
Code of conduct enabled in config
|
29
|
+
create waldo/Gemfile
|
30
|
+
create waldo/.gitignore
|
31
|
+
create waldo/lib/waldo.rb
|
32
|
+
create waldo/lib/waldo/version.rb
|
33
|
+
create waldo/waldo.gemspec
|
34
|
+
create waldo/Rakefile
|
35
|
+
create waldo/README.md
|
36
|
+
create waldo/bin/console
|
37
|
+
create waldo/bin/setup
|
38
|
+
create waldo/LICENSE.txt
|
39
|
+
create waldo/CODE_OF_CONDUCT.md
|
40
|
+
Initializing git repo in /waldo
|
41
|
+
```
|
10
42
|
|
11
43
|
## Edit the gemspec file
|
12
44
|
|
45
|
+
Modify the gemspec to your specifications
|
46
|
+
|
13
47
|
```
|
14
48
|
# coding: utf-8
|
15
49
|
lib = File.expand_path('../lib', __FILE__)
|
@@ -20,7 +54,7 @@ Gem::Specification.new do |spec|
|
|
20
54
|
spec.name = "waldo"
|
21
55
|
spec.version = Waldo::VERSION
|
22
56
|
spec.authors = ["Austin Trout"]
|
23
|
-
spec.email = ["trouta23@gmail.com"]
|
57
|
+
spec.email = ["[trouta23@gmail.com]"]
|
24
58
|
|
25
59
|
spec.summary = %q{Waldo is used to learn about making your own gem}
|
26
60
|
spec.homepage = "https://github.com/trouta23/waldo"
|
@@ -53,19 +87,25 @@ end
|
|
53
87
|
|
54
88
|
## Add your code
|
55
89
|
|
56
|
-
|
90
|
+
For example, in `lib/waldo.rb`:
|
57
91
|
|
58
|
-
|
92
|
+
```ruby
|
93
|
+
require "waldo/version"
|
59
94
|
|
60
|
-
|
95
|
+
module Waldo
|
96
|
+
def self.where_are_you
|
97
|
+
puts "It's a secret!"
|
98
|
+
end
|
99
|
+
end
|
100
|
+
```
|
61
101
|
|
62
|
-
##
|
102
|
+
## Deploy to GitHub
|
63
103
|
|
64
|
-
|
104
|
+
Create a new repo, and follow the steps to push to the new GitHub repo.
|
65
105
|
|
66
|
-
|
106
|
+
The exact steps to do so are not in this tutorial.
|
67
107
|
|
68
|
-
|
108
|
+
This is what you'll see initially:
|
69
109
|
|
70
110
|
---
|
71
111
|
|
@@ -105,7 +145,94 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
105
145
|
|
106
146
|
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/waldo. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
107
147
|
|
108
|
-
|
109
148
|
## License
|
110
149
|
|
111
150
|
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
151
|
+
|
152
|
+
---
|
153
|
+
|
154
|
+
# Testing out your new gem
|
155
|
+
|
156
|
+
## Build your gem
|
157
|
+
|
158
|
+
```
|
159
|
+
$ gem build waldo.gemspec
|
160
|
+
|
161
|
+
Successfully built RubyGem
|
162
|
+
Name: waldo
|
163
|
+
Version: 0.1.0
|
164
|
+
File: waldo-0.1.0.gem
|
165
|
+
```
|
166
|
+
|
167
|
+
## Install your gem
|
168
|
+
|
169
|
+
You'll want to base it off your File name seen in the gemspec
|
170
|
+
|
171
|
+
```
|
172
|
+
$ gem install ./waldo-0.1.0.gem
|
173
|
+
|
174
|
+
Successfully installed waldo-0.1.0
|
175
|
+
Parsing documentation for waldo-0.1.0
|
176
|
+
Installing ri documentation for waldo-0.1.0
|
177
|
+
Done installing documentation for waldo after 0 seconds
|
178
|
+
1 gem installed
|
179
|
+
```
|
180
|
+
|
181
|
+
## Test it in irb
|
182
|
+
|
183
|
+
```
|
184
|
+
$ irb
|
185
|
+
|
186
|
+
>> require 'waldo'
|
187
|
+
=> true
|
188
|
+
>> Waldo.where_are_you
|
189
|
+
It's a secret!
|
190
|
+
```
|
191
|
+
|
192
|
+
# Cutting a release
|
193
|
+
|
194
|
+
## Setup RubyGems API access
|
195
|
+
|
196
|
+
On your RubyGems profile, go to the edit view and down under the API ACCESS section you'll see a version of the command below:
|
197
|
+
|
198
|
+
$ curl -u {username} https://rubygems.org/api/v1/api_key.yaml > ~/.gem/credentials; chmod 0600 ~/.gem/credentials
|
199
|
+
|
200
|
+
Run this command as this will give you access to gem commands from the command line.
|
201
|
+
Located here: http://guides.rubygems.org/command-reference/
|
202
|
+
|
203
|
+
When you run this command you'll get prompted for your key which will also be located under API ACCESS and say:
|
204
|
+
|
205
|
+
`Your API key is {your_key_here}.`
|
206
|
+
|
207
|
+
## Bundle local gemfile
|
208
|
+
|
209
|
+
```
|
210
|
+
$ bundle install
|
211
|
+
|
212
|
+
Fetching gem metadata from https://rubygems.org/
|
213
|
+
Fetching version metadata from https://rubygems.org/
|
214
|
+
Resolving dependencies...
|
215
|
+
Installing rake 10.5.0
|
216
|
+
Using bundler 1.12.5
|
217
|
+
Using waldo 0.1.0 from source at `.`
|
218
|
+
Bundle complete! 3 Gemfile dependencies, 3 gems now installed.
|
219
|
+
Use `bundle show [gemname]` to see where a bundled gem is installed.
|
220
|
+
```
|
221
|
+
|
222
|
+
## Generate and deploy to RubyGems.org
|
223
|
+
|
224
|
+
```
|
225
|
+
$ bundle exec rake release
|
226
|
+
|
227
|
+
waldo 0.1.0 built to pkg/waldo-0.1.0.gem.
|
228
|
+
Tagged v0.1.0.
|
229
|
+
Pushed git commits and tags.
|
230
|
+
Pushed waldo 0.1.0 to rubygems.org.
|
231
|
+
```
|
232
|
+
|
233
|
+
# You're officially good to go!
|
234
|
+
|
235
|
+
Go check out your new gem on RubyGems.org!
|
236
|
+
|
237
|
+
As more details are found that would be useful and not too advanced they'll be added
|
238
|
+
to the repo. Also feel free to submit your own!
|
data/lib/waldo.rb
CHANGED
data/lib/waldo/version.rb
CHANGED