juwelier 2.1.3 → 2.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.semver +2 -2
- data/.travis.yml +6 -3
- data/README.org +395 -0
- data/Rakefile +1 -1
- data/juwelier.gemspec +61 -55
- data/lib/juwelier/generator.rb +7 -2
- data/lib/juwelier/generator/options.rb +9 -0
- data/lib/juwelier/templates/.semver +5 -0
- data/lib/juwelier/templates/README.markdown +27 -0
- data/lib/juwelier/templates/README.org +18 -0
- data/lib/juwelier/templates/README.rdoc +0 -1
- data/lib/juwelier/templates/Rakefile +1 -7
- data/lib/juwelier/templates/juwelier_tasks.erb +1 -1
- data/lib/juwelier/templates/semver_tasks.erb +8 -0
- metadata +10 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b968ee5780a8194cf756c5cda002f6c0e7456e19
|
4
|
+
data.tar.gz: 0224647caa74d482a28d8398af1e979294837689
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 56eda5bb651dc73bf49fa140f342b2f51e7ae0b0f17aeeb9b48c4cd317c539661d19b31aea34be7e9df428d3de837863a95058f9831da73a7de494000346a25a
|
7
|
+
data.tar.gz: 3d28e368e1080c533279ed65ff542d3e9224fdcb6e50387fdaaa615dfbef882ae9da1140f6e70f32f71ab78b9671e7210af7cfbf4f0f0ac87b36a0cfbf7869f0
|
data/.semver
CHANGED
data/.travis.yml
CHANGED
data/README.org
ADDED
@@ -0,0 +1,395 @@
|
|
1
|
+
* Juwelier: Craft the perfect RubyGem for Ruby 2.3.x and Beyond
|
2
|
+
|
3
|
+
Provides the noble ruby developer with two primary features:
|
4
|
+
|
5
|
+
- a library or managing and releasing RubyGem projects
|
6
|
+
- a scaffold generator for starting new RubyGem projects
|
7
|
+
|
8
|
+
PLEASE NOTE that I have recently taken over the original Jeweler and
|
9
|
+
will be maintaining both repos for a while, and eventually converge them
|
10
|
+
to one. In the mean time, all new features shall be added to Juwelier,
|
11
|
+
while keeping the origial Jeweler up-to-date with the latest Ruby
|
12
|
+
releases.
|
13
|
+
|
14
|
+
[[https://travis-ci.org/flajann2/juwelier][[[https://travis-ci.org/flajann2/juwelier.png]]]]
|
15
|
+
[[https://coveralls.io/r/flajann2/juwelier][[[https://coveralls.io/repos/flajann2/juwelier/badge.png]]]]
|
16
|
+
[[https://www.versioneye.com/ruby/juwelier/2.2.1][[[https://www.versioneye.com/ruby/juwelier/2.2.1/badge.png]]]]1
|
17
|
+
|
18
|
+
(NOTE: If you see the aboved lines malformed, it is because of a bug in the formatting tool, not
|
19
|
+
in the Orgmode syntax, which is as specified.)
|
20
|
+
|
21
|
+
"Juwelier" is pronounced "you-ve-LEER" (with German inflection! :))
|
22
|
+
|
23
|
+
Note that his has been forked from the old Jeweler by Josh Nichols due
|
24
|
+
to lack of maintenance. I need this to work alread with the latest Ruby,
|
25
|
+
so I've taken it over. All is cool because sometimes we move on and
|
26
|
+
loose interest. I wish to thank Josh and others who were behind the
|
27
|
+
original Jeweler for creating this awesome tool.
|
28
|
+
|
29
|
+
Note that if you have a preexisting project created with Jeweler, you
|
30
|
+
may have some issues. Eventally I will provide a migration option, but
|
31
|
+
in the meantime, you may wish to run this bash script from the root
|
32
|
+
directory of your project:
|
33
|
+
|
34
|
+
#+BEGIN_SRC bash
|
35
|
+
for f in $(grep -irl jeweler *)
|
36
|
+
do
|
37
|
+
sed -i 's/jeweler/juwelier/g' $f
|
38
|
+
sed -i 's/Jeweler/Juwelier/g' $f
|
39
|
+
done
|
40
|
+
bundle update
|
41
|
+
#+END_SRC
|
42
|
+
|
43
|
+
As you know, "Juwelier" is "Jeweler" in German. Since I have made
|
44
|
+
Germany my new home, it only seemed approporiate.
|
45
|
+
|
46
|
+
** Hello, world
|
47
|
+
|
48
|
+
Use RubyGems to install the heck out of juwelier to get started:
|
49
|
+
|
50
|
+
#+BEGIN_SRC bash
|
51
|
+
$ gem install juwelier
|
52
|
+
#+END_SRC
|
53
|
+
|
54
|
+
With juwelier installed, you can use the =juwelier= command to generate
|
55
|
+
a new project. For the most basic use, just give it a name:
|
56
|
+
|
57
|
+
#+BEGIN_EXAMPLE
|
58
|
+
$ juwelier hello-gem
|
59
|
+
#+END_EXAMPLE
|
60
|
+
|
61
|
+
This requires some Git configuration (like name, email, GitHub account,
|
62
|
+
etc), but =juwelier= will prompt along the way.
|
63
|
+
|
64
|
+
Your new =hello-gem= gem is ready in the =hello-gem= directory. Take a
|
65
|
+
peek, and you'll see several files and directories
|
66
|
+
|
67
|
+
- =Rakefile= setup for juwelier, running tests, generating
|
68
|
+
documentation, and releasing to
|
69
|
+
[[http://rubygems.org/][rubygems.org]]
|
70
|
+
- =README.rdoc= with contribution guidelines and copyright info
|
71
|
+
crediting you
|
72
|
+
- =LICENSE= with the MIT licensed crediting you
|
73
|
+
- =Gemfile= with development dependencies filled in
|
74
|
+
- =lib/hello-gem.rb= waiting for you to code
|
75
|
+
- =test/= containing a (failing) shoulda test suite
|
76
|
+
[[http://github.com/thoughtbot/shoulda][shoulda]]
|
77
|
+
|
78
|
+
*** More =juwelier= options
|
79
|
+
|
80
|
+
The =juwelier= command supports a lot of options. Mostly, they are for
|
81
|
+
generating baked in support for this test framework, or that.
|
82
|
+
|
83
|
+
Check out =juwelier --help= for the most up to date options.
|
84
|
+
|
85
|
+
** Hello, rake tasks
|
86
|
+
|
87
|
+
Beyond just editing source code, you'll be interacting with your gem
|
88
|
+
using =rake= a lot. To see all the tasks available with a brief
|
89
|
+
description, you can run:
|
90
|
+
|
91
|
+
#+BEGIN_EXAMPLE
|
92
|
+
$ rake -T
|
93
|
+
#+END_EXAMPLE
|
94
|
+
|
95
|
+
You'll need a version before you can start installing your gem locally.
|
96
|
+
The easiest way is with the =version:write= Rake task. Let's imagine you
|
97
|
+
start with 0.1.0
|
98
|
+
|
99
|
+
#+BEGIN_EXAMPLE
|
100
|
+
$ rake version:write MAJOR=0 MINOR=1 PATCH=0
|
101
|
+
#+END_EXAMPLE
|
102
|
+
|
103
|
+
You can now go forth and develop, now that there's an initial version
|
104
|
+
defined. Eventually, you should install and test the gem:
|
105
|
+
|
106
|
+
#+BEGIN_EXAMPLE
|
107
|
+
$ rake install
|
108
|
+
#+END_EXAMPLE
|
109
|
+
|
110
|
+
The =install= rake task builds the gem and =gem install=s it. You're all
|
111
|
+
set if you're using [[http://rvm.beginrescueend.com/][RVM]], but you may
|
112
|
+
need to run it with sudo if you have a system-installed ruby:
|
113
|
+
|
114
|
+
#+BEGIN_EXAMPLE
|
115
|
+
$ sudo rake install
|
116
|
+
#+END_EXAMPLE
|
117
|
+
|
118
|
+
*** Releasing
|
119
|
+
|
120
|
+
At last, it's time to [[http://shipitsquirrel.github.com/][ship it]]!
|
121
|
+
Make sure you have everything committed and pushed, then go wild:
|
122
|
+
|
123
|
+
#+BEGIN_EXAMPLE
|
124
|
+
$ rake release
|
125
|
+
#+END_EXAMPLE
|
126
|
+
|
127
|
+
This will automatically:
|
128
|
+
|
129
|
+
/Juwelier Generate =hello-gem.gemspec= and commit it / Use =git= to tag
|
130
|
+
=v0.1.0= and push it * Build =hello-gem-0.1.0.gem= and push it to
|
131
|
+
[[http://rubygems.org/gems/][rubygems.org]]
|
132
|
+
|
133
|
+
=rake release= accepts REMOTE(default: =origin=), LOCAL\_BRANCH(default:
|
134
|
+
=master=), REMOTE\_BRANCH(default: =master=) and BRANCH(default:
|
135
|
+
master)as options.
|
136
|
+
|
137
|
+
#+BEGIN_EXAMPLE
|
138
|
+
$ rake release REMOTE=upstream LOCAL_BRANCH=critical-security-fix REMOTE_BRANCH=v3
|
139
|
+
#+END_EXAMPLE
|
140
|
+
|
141
|
+
This will tag and push the commits on your local branch named
|
142
|
+
=critical-security-fix= to branch named =v3= in remote named =upstream=
|
143
|
+
(if you have commit rights on =upstream=) and release the gem.
|
144
|
+
|
145
|
+
#+BEGIN_EXAMPLE
|
146
|
+
$ rake release BRANCH=v3
|
147
|
+
#+END_EXAMPLE
|
148
|
+
|
149
|
+
If both remote and local branches are the same, use =BRANCH= option to
|
150
|
+
simplify. This will tag and push the commits on your local branch named
|
151
|
+
=v3= to branch named =v3= in remote named =origin= (if you have commit
|
152
|
+
rights on =origin=) and release the gem.
|
153
|
+
|
154
|
+
*** Version bumping
|
155
|
+
|
156
|
+
It feels good to release code. Do it, do it often. But before that, bump
|
157
|
+
the version. Then release it. There's a few ways to update the version:
|
158
|
+
|
159
|
+
#+BEGIN_EXAMPLE
|
160
|
+
# version:write like before
|
161
|
+
$ rake version:write MAJOR=0 MINOR=3 PATCH=0
|
162
|
+
|
163
|
+
# bump just major, ie 0.1.0 -> 1.0.0
|
164
|
+
$ rake version:bump:major
|
165
|
+
|
166
|
+
# bump just minor, ie 0.1.0 -> 0.2.0
|
167
|
+
$ rake version:bump:minor
|
168
|
+
|
169
|
+
# bump just patch, ie 0.1.0 -> 0.1.1
|
170
|
+
$ rake version:bump:patch
|
171
|
+
#+END_EXAMPLE
|
172
|
+
|
173
|
+
Then it's the same =release= we used before:
|
174
|
+
|
175
|
+
#+BEGIN_EXAMPLE
|
176
|
+
$ rake release
|
177
|
+
#+END_EXAMPLE
|
178
|
+
|
179
|
+
** Customizing your gem
|
180
|
+
|
181
|
+
If you've been following along so far, your gem is just a blank slate.
|
182
|
+
You're going to need to make it colorful and full of metadata.
|
183
|
+
|
184
|
+
You can customize your gem by updating your =Rakefile=. With a newly
|
185
|
+
generated project, it will look something like this:
|
186
|
+
|
187
|
+
Juwelier require 'juwelier' ::Tasks.new do |gem| # gem is a
|
188
|
+
Gem::Specification... see
|
189
|
+
http://guides.rubygems.org/specification-reference/ for more options
|
190
|
+
gem.name = "whatwhatwhat" gem.summary = %Q{TODO: one-line summary of
|
191
|
+
your gem} gem.description = %Q{TODO: longer description of your gem}
|
192
|
+
gem.email = "fred.mitchell@gmx.com" gem.homepage =
|
193
|
+
"http://github.com/flajann2/whatwhatwhat" Juwelier gem.authors =
|
194
|
+
["Joshua Nichols"] end JuwelierJuwelier ::RubygemsDotOrgTasks.new
|
195
|
+
|
196
|
+
It's crucial to understand the =gem= object is just a
|
197
|
+
Gem::Specification. You can read up about it at
|
198
|
+
[[http://guides.rubygems.org/specification-reference/][guides.rubygems.org/specification-reference]].
|
199
|
+
This is the most basic way of specifying a gem, -managed or not. just
|
200
|
+
exposes this to you, in addition to providing some reasonable defaults,
|
201
|
+
which we'll explore now.
|
202
|
+
|
203
|
+
*** Project information
|
204
|
+
|
205
|
+
#+BEGIN_EXAMPLE
|
206
|
+
gem.name = "whatwhatwhat"
|
207
|
+
#+END_EXAMPLE
|
208
|
+
|
209
|
+
Every gem has a name. Among other things, the gem name is how you are
|
210
|
+
able to =gem install= it.
|
211
|
+
[[http://guides.rubygems.org/specification-reference/#name][Reference]]
|
212
|
+
|
213
|
+
#+BEGIN_EXAMPLE
|
214
|
+
gem.summary = %Q{TODO: one-line summary of your gem}
|
215
|
+
#+END_EXAMPLE
|
216
|
+
|
217
|
+
This is a one line summary of your gem. This is displayed, for example,
|
218
|
+
when you use =gem list --details= or view it on
|
219
|
+
[[http://rubygems.org/gems/][rubygems.org]].
|
220
|
+
|
221
|
+
#+BEGIN_EXAMPLE
|
222
|
+
gem.description = %Q{TODO: longer description of your gem}
|
223
|
+
#+END_EXAMPLE
|
224
|
+
|
225
|
+
Description is a longer description. Scholars ascertain that knowledge
|
226
|
+
of where the description is used was lost centuries ago.
|
227
|
+
|
228
|
+
#+BEGIN_EXAMPLE
|
229
|
+
gem.email = "fred.mitchell@gmx.com"
|
230
|
+
#+END_EXAMPLE
|
231
|
+
|
232
|
+
This should be a way to get a hold of you regarding the gem.
|
233
|
+
|
234
|
+
#+BEGIN_EXAMPLE
|
235
|
+
gem.homepage = "http://github.com/flajann2/whatwhatwhat"
|
236
|
+
#+END_EXAMPLE
|
237
|
+
|
238
|
+
The homepage should have more information about your gem. The juwelier
|
239
|
+
generator guesses this based on the assumption your code lives on
|
240
|
+
[[http://github.com/][GitHub]], using your Git configuration to find
|
241
|
+
your GitHub username. This is displayed by =gem list --details= and on
|
242
|
+
rubygems.org.
|
243
|
+
|
244
|
+
#+BEGIN_EXAMPLE
|
245
|
+
gem.authors = ["Joshua Nichols"]
|
246
|
+
#+END_EXAMPLE
|
247
|
+
|
248
|
+
Hey, this is you, the author (or me in this case). The =juwelier=
|
249
|
+
generator also guesses this from your Git configuration. This is
|
250
|
+
displayed by =gem list --details= and on rubygems.org.
|
251
|
+
|
252
|
+
** Juwelier# Files
|
253
|
+
|
254
|
+
ThJuweliere quickest way to add more files is to =git add= them. uses
|
255
|
+
your Git repository to populate your gem's files by including added and
|
256
|
+
committed and excluding =.gitignore=d. In most cases, this is reasonable
|
257
|
+
enough.
|
258
|
+
|
259
|
+
If you need to tweak the files, that's cool. populates =gem.files= as a
|
260
|
+
=Rake::FileList=. It's like a normal array, except you can =include= and
|
261
|
+
=exclude= file globs:
|
262
|
+
|
263
|
+
#+BEGIN_EXAMPLE
|
264
|
+
gem.files.exclude 'tmp' # exclude temporary directory
|
265
|
+
gem.files.include 'lib/foo/bar.rb' # explicitly include lib/foo/bar.rb
|
266
|
+
#+END_EXAMPLE
|
267
|
+
|
268
|
+
If that's not enough, you can just set =gem.files= outright
|
269
|
+
|
270
|
+
#+BEGIN_EXAMPLE
|
271
|
+
gem.files = Dir.glob('lib/**/*.rb')
|
272
|
+
#+END_EXAMPLE
|
273
|
+
|
274
|
+
*** Dependencies
|
275
|
+
|
276
|
+
Dependencies let you define other gems that your gem needs to function.
|
277
|
+
=gem install your-gem= will install your-gem's dependencies along with
|
278
|
+
it, and when you use your-gem in an application, the dependencies will
|
279
|
+
be made available. Use =gem.add_dependency= to register them.
|
280
|
+
[[http://guides.rubygems.org/specification-reference/#add_development_dependency][Reference]]
|
281
|
+
|
282
|
+
#+BEGIN_EXAMPLE
|
283
|
+
gem.add_dependency 'nokogiri'
|
284
|
+
#+END_EXAMPLE
|
285
|
+
|
286
|
+
This will ensure a version of =nokogiri= is installed, but it doesn't
|
287
|
+
require anything more than that. You can provide extra args to be more
|
288
|
+
specific:
|
289
|
+
|
290
|
+
#+BEGIN_EXAMPLE
|
291
|
+
gem.add_dependency 'nokogiri', '= 1.2.1' # exactly version 1.2.1
|
292
|
+
gem.add_dependency 'nokogiri', '>= 1.2.1' # greater than or equal to 1.2.1, ie, 1.2.1, 1.2.2, 1.3.0, 2.0.0, etc
|
293
|
+
gem.add_dependency 'nokogiri', '>= 1.2.1', '< 1.3.0' # greater than or equal to 1.2.1, but less than 1.3.0
|
294
|
+
gem.add_dependency 'nokogiri', '~> 1.2.1' # same thing, but more concise
|
295
|
+
#+END_EXAMPLE
|
296
|
+
|
297
|
+
When specifying which version is required, there's a bit of the
|
298
|
+
condunrum. You want to allow the most versions possible, but you want to
|
299
|
+
be sure they are compatible. Using =>= 1.2.1= is fine most of the time,
|
300
|
+
except until the point that 2.0.0 comes out and totally breaks backwards
|
301
|
+
the API. That's when it's good to use =~> 1.2.1=, which requires any
|
302
|
+
version in the =1.2= family, starting with =1.2.1=.
|
303
|
+
|
304
|
+
** Juwelier# Executables
|
305
|
+
|
306
|
+
Executables let your gem install shell commands. Just put any executable
|
307
|
+
scripts in the =bin/= directory, make sure they are added using =git=,
|
308
|
+
and will take care of the rest.
|
309
|
+
|
310
|
+
When you need more finely grained control over it, you can set it
|
311
|
+
yourself:
|
312
|
+
|
313
|
+
#+BEGIN_EXAMPLE
|
314
|
+
gem.executables = ['foo'] # note, it's the file name relative to `bin/`, not the project root
|
315
|
+
#+END_EXAMPLE
|
316
|
+
|
317
|
+
*** Versioning
|
318
|
+
|
319
|
+
WeJuwelierJuwelier discussed earlier how to bump the version. The rake
|
320
|
+
tasks are really just convience methods for manipulating the =VERSION=
|
321
|
+
file. It just contains a version string, like =1.2.3=.
|
322
|
+
|
323
|
+
=VERSION= is a convention used by , and is used to populate
|
324
|
+
=gem.version=. You can actually set this yourself, and won't try to
|
325
|
+
override it:
|
326
|
+
|
327
|
+
#+BEGIN_EXAMPLE
|
328
|
+
gem.version = '1.2.3'
|
329
|
+
#+END_EXAMPLE
|
330
|
+
|
331
|
+
A common pattern is to have this in a version constant in your library.
|
332
|
+
This is convenient, because users of the library can query the version
|
333
|
+
they are using at runtime.
|
334
|
+
|
335
|
+
#+BEGIN_EXAMPLE
|
336
|
+
# in lib/foo/version.rb
|
337
|
+
class Foo
|
338
|
+
module Version
|
339
|
+
MAJOR = 1
|
340
|
+
MINOR = 2
|
341
|
+
PATCH = 3
|
342
|
+
BUILD = 'pre3'
|
343
|
+
|
344
|
+
STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
|
345
|
+
end
|
346
|
+
end
|
347
|
+
|
348
|
+
# in Rakefile
|
349
|
+
#+END_EXAMPLE
|
350
|
+
|
351
|
+
Juwelier require 'juwelier' require './lib/foo/version.rb' ::Tasks.new
|
352
|
+
do |gem| # snip gem.version = Foo::Version::STRING end
|
353
|
+
|
354
|
+
** Juwelier# Rake tasks
|
355
|
+
|
356
|
+
lives inside of Rake. As a result, they are dear friends. But, that
|
357
|
+
friendship doesn't interfere with typical Rake operations.
|
358
|
+
|
359
|
+
The Juwelier Rake means you can define your own namespaces, tasks, or
|
360
|
+
use third party Rake libraries without cause for concern.
|
361
|
+
|
362
|
+
** Release Notes
|
363
|
+
| Version | Date | Notes |
|
364
|
+
|---------+------------+-------------------------------------------------------------------------------|
|
365
|
+
| 2.2.0 | 2016-11-19 | Bugs with --semver fixed, new options for using .org and .markdown for README |
|
366
|
+
| 2.1.3 | 2016-11-19 | Problems with --semver, --required-version |
|
367
|
+
|
368
|
+
** Known Issues
|
369
|
+
| Date | Issue |
|
370
|
+
|------------+------------------------------------------------------------------------------------------------|
|
371
|
+
| 2016-11-19 | On generation of the Markdown, the initial title does not linefeed before the header sequence. |
|
372
|
+
|
373
|
+
** Contributing to
|
374
|
+
|
375
|
+
- Check out the latest master to make sure the feature hasn't been
|
376
|
+
implemented or the bug hasn't been fixed yet
|
377
|
+
- Ask on the [[http://groups.google.com/group/juwelier-rb][mailing
|
378
|
+
list]] for feedback on your proposal, to see if somebody else has
|
379
|
+
done it.
|
380
|
+
- Check out the [[http://github.com/flajann2/juwelier/issues][issue
|
381
|
+
tracker]] to make sure someone already hasn't requested it and/or
|
382
|
+
contributed it
|
383
|
+
- Fork the project
|
384
|
+
- Start a feature/bugfix branch
|
385
|
+
- Commit and push until you are happy with your contribution
|
386
|
+
- Make sure to add tests for the feature/bugfix. This is important so I
|
387
|
+
don't break it in a future version unintentionally.
|
388
|
+
- Please try not to mess with the Rakefile, version, or history. If you
|
389
|
+
want to have your own version, or is otherwise necessary, that is
|
390
|
+
fine, but please isolate it to its own commit so I can cherry-pick
|
391
|
+
around it.
|
392
|
+
|
393
|
+
** Copyright
|
394
|
+
|
395
|
+
Copyright (c) 2016 Fred Mitchell. See LICENSE for details.
|
data/Rakefile
CHANGED
@@ -23,7 +23,7 @@ require 'juwelier'
|
|
23
23
|
Juwelier::Tasks.new do |gem|
|
24
24
|
gem.name = "juwelier"
|
25
25
|
gem.version = s_version
|
26
|
-
gem.required_ruby_version = '>= 2.
|
26
|
+
gem.required_ruby_version = '>= 2.2.2'
|
27
27
|
gem.homepage = "http://github.com/flajann2/juwelier"
|
28
28
|
gem.summary = "Powerful and Opinionated tool for creating and managing RubyGem projects"
|
29
29
|
gem.description = "Simple and opinionated helper for creating Rubygem projects on GitHub"
|
data/juwelier.gemspec
CHANGED
@@ -2,23 +2,24 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: juwelier 2.1
|
5
|
+
# stub: juwelier 2.2.1 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
|
-
s.name = "juwelier"
|
9
|
-
s.version = "2.1
|
8
|
+
s.name = "juwelier".freeze
|
9
|
+
s.version = "2.2.1"
|
10
10
|
|
11
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
|
-
s.require_paths = ["lib"]
|
13
|
-
s.authors = ["Fred Mitchell", "Josh Nichols", "Yusuke Murata"]
|
14
|
-
s.date = "2016-
|
15
|
-
s.description = "Simple and opinionated helper for creating Rubygem projects on GitHub"
|
16
|
-
s.email = ["fred.mitchell@gmx.de", "fred.mitchell@gmx.com", "info@muratayusuke.com"]
|
17
|
-
s.executables = ["juwelier"]
|
11
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
|
+
s.require_paths = ["lib".freeze]
|
13
|
+
s.authors = ["Fred Mitchell".freeze, "Josh Nichols".freeze, "Yusuke Murata".freeze]
|
14
|
+
s.date = "2016-11-19"
|
15
|
+
s.description = "Simple and opinionated helper for creating Rubygem projects on GitHub".freeze
|
16
|
+
s.email = ["fred.mitchell@gmx.de".freeze, "fred.mitchell@gmx.com".freeze, "info@muratayusuke.com".freeze]
|
17
|
+
s.executables = ["juwelier".freeze]
|
18
18
|
s.extra_rdoc_files = [
|
19
19
|
"ChangeLog.markdown",
|
20
20
|
"LICENSE.txt",
|
21
|
-
"README.markdown"
|
21
|
+
"README.markdown",
|
22
|
+
"README.org"
|
22
23
|
]
|
23
24
|
s.files = [
|
24
25
|
".coveralls.yml",
|
@@ -30,6 +31,7 @@ Gem::Specification.new do |s|
|
|
30
31
|
"Gemfile",
|
31
32
|
"LICENSE.txt",
|
32
33
|
"README.markdown",
|
34
|
+
"README.org",
|
33
35
|
"Rakefile",
|
34
36
|
"bin/juwelier",
|
35
37
|
"features/generator/cucumber.feature",
|
@@ -93,8 +95,11 @@ Gem::Specification.new do |s|
|
|
93
95
|
"lib/juwelier/tasks.rb",
|
94
96
|
"lib/juwelier/templates/.document",
|
95
97
|
"lib/juwelier/templates/.gitignore",
|
98
|
+
"lib/juwelier/templates/.semver",
|
96
99
|
"lib/juwelier/templates/Gemfile",
|
97
100
|
"lib/juwelier/templates/LICENSE.txt",
|
101
|
+
"lib/juwelier/templates/README.markdown",
|
102
|
+
"lib/juwelier/templates/README.org",
|
98
103
|
"lib/juwelier/templates/README.rdoc",
|
99
104
|
"lib/juwelier/templates/Rakefile",
|
100
105
|
"lib/juwelier/templates/bacon/flunking.rb",
|
@@ -113,6 +118,7 @@ Gem::Specification.new do |s|
|
|
113
118
|
"lib/juwelier/templates/rspec/.rspec",
|
114
119
|
"lib/juwelier/templates/rspec/flunking.rb",
|
115
120
|
"lib/juwelier/templates/rspec/helper.rb",
|
121
|
+
"lib/juwelier/templates/semver_tasks.erb",
|
116
122
|
"lib/juwelier/templates/shindo/flunking.rb",
|
117
123
|
"lib/juwelier/templates/shindo/helper.rb",
|
118
124
|
"lib/juwelier/templates/shoulda/flunking.rb",
|
@@ -185,58 +191,58 @@ Gem::Specification.new do |s|
|
|
185
191
|
"test/test_helper.rb",
|
186
192
|
"test/test_juwelier.rb"
|
187
193
|
]
|
188
|
-
s.homepage = "http://github.com/flajann2/juwelier"
|
189
|
-
s.licenses = ["MIT"]
|
190
|
-
s.required_ruby_version = Gem::Requirement.new(">= 2.
|
191
|
-
s.rubygems_version = "2.
|
192
|
-
s.summary = "Powerful and Opinionated tool for creating and managing RubyGem projects"
|
194
|
+
s.homepage = "http://github.com/flajann2/juwelier".freeze
|
195
|
+
s.licenses = ["MIT".freeze]
|
196
|
+
s.required_ruby_version = Gem::Requirement.new(">= 2.2.2".freeze)
|
197
|
+
s.rubygems_version = "2.6.7".freeze
|
198
|
+
s.summary = "Powerful and Opinionated tool for creating and managing RubyGem projects".freeze
|
193
199
|
|
194
200
|
if s.respond_to? :specification_version then
|
195
201
|
s.specification_version = 4
|
196
202
|
|
197
203
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
198
|
-
s.add_runtime_dependency(%q<rake
|
199
|
-
s.add_runtime_dependency(%q<git
|
200
|
-
s.add_runtime_dependency(%q<nokogiri
|
201
|
-
s.add_runtime_dependency(%q<github_api
|
202
|
-
s.add_runtime_dependency(%q<highline
|
203
|
-
s.add_runtime_dependency(%q<bundler
|
204
|
-
s.add_runtime_dependency(%q<rdoc
|
205
|
-
s.add_runtime_dependency(%q<builder
|
206
|
-
s.add_runtime_dependency(%q<semver
|
207
|
-
s.add_development_dependency(%q<yard
|
208
|
-
s.add_development_dependency(%q<bluecloth
|
209
|
-
s.add_development_dependency(%q<cucumber
|
210
|
-
s.add_development_dependency(%q<simplecov
|
204
|
+
s.add_runtime_dependency(%q<rake>.freeze, [">= 0"])
|
205
|
+
s.add_runtime_dependency(%q<git>.freeze, [">= 1.2.5"])
|
206
|
+
s.add_runtime_dependency(%q<nokogiri>.freeze, [">= 1.5.10"])
|
207
|
+
s.add_runtime_dependency(%q<github_api>.freeze, [">= 0"])
|
208
|
+
s.add_runtime_dependency(%q<highline>.freeze, [">= 1.6.15"])
|
209
|
+
s.add_runtime_dependency(%q<bundler>.freeze, [">= 1.13"])
|
210
|
+
s.add_runtime_dependency(%q<rdoc>.freeze, [">= 0"])
|
211
|
+
s.add_runtime_dependency(%q<builder>.freeze, [">= 0"])
|
212
|
+
s.add_runtime_dependency(%q<semver>.freeze, [">= 0"])
|
213
|
+
s.add_development_dependency(%q<yard>.freeze, [">= 0.8.5"])
|
214
|
+
s.add_development_dependency(%q<bluecloth>.freeze, [">= 0"])
|
215
|
+
s.add_development_dependency(%q<cucumber>.freeze, [">= 1.1.4"])
|
216
|
+
s.add_development_dependency(%q<simplecov>.freeze, [">= 0"])
|
211
217
|
else
|
212
|
-
s.add_dependency(%q<rake
|
213
|
-
s.add_dependency(%q<git
|
214
|
-
s.add_dependency(%q<nokogiri
|
215
|
-
s.add_dependency(%q<github_api
|
216
|
-
s.add_dependency(%q<highline
|
217
|
-
s.add_dependency(%q<bundler
|
218
|
-
s.add_dependency(%q<rdoc
|
219
|
-
s.add_dependency(%q<builder
|
220
|
-
s.add_dependency(%q<semver
|
221
|
-
s.add_dependency(%q<yard
|
222
|
-
s.add_dependency(%q<bluecloth
|
223
|
-
s.add_dependency(%q<cucumber
|
224
|
-
s.add_dependency(%q<simplecov
|
218
|
+
s.add_dependency(%q<rake>.freeze, [">= 0"])
|
219
|
+
s.add_dependency(%q<git>.freeze, [">= 1.2.5"])
|
220
|
+
s.add_dependency(%q<nokogiri>.freeze, [">= 1.5.10"])
|
221
|
+
s.add_dependency(%q<github_api>.freeze, [">= 0"])
|
222
|
+
s.add_dependency(%q<highline>.freeze, [">= 1.6.15"])
|
223
|
+
s.add_dependency(%q<bundler>.freeze, [">= 1.13"])
|
224
|
+
s.add_dependency(%q<rdoc>.freeze, [">= 0"])
|
225
|
+
s.add_dependency(%q<builder>.freeze, [">= 0"])
|
226
|
+
s.add_dependency(%q<semver>.freeze, [">= 0"])
|
227
|
+
s.add_dependency(%q<yard>.freeze, [">= 0.8.5"])
|
228
|
+
s.add_dependency(%q<bluecloth>.freeze, [">= 0"])
|
229
|
+
s.add_dependency(%q<cucumber>.freeze, [">= 1.1.4"])
|
230
|
+
s.add_dependency(%q<simplecov>.freeze, [">= 0"])
|
225
231
|
end
|
226
232
|
else
|
227
|
-
s.add_dependency(%q<rake
|
228
|
-
s.add_dependency(%q<git
|
229
|
-
s.add_dependency(%q<nokogiri
|
230
|
-
s.add_dependency(%q<github_api
|
231
|
-
s.add_dependency(%q<highline
|
232
|
-
s.add_dependency(%q<bundler
|
233
|
-
s.add_dependency(%q<rdoc
|
234
|
-
s.add_dependency(%q<builder
|
235
|
-
s.add_dependency(%q<semver
|
236
|
-
s.add_dependency(%q<yard
|
237
|
-
s.add_dependency(%q<bluecloth
|
238
|
-
s.add_dependency(%q<cucumber
|
239
|
-
s.add_dependency(%q<simplecov
|
233
|
+
s.add_dependency(%q<rake>.freeze, [">= 0"])
|
234
|
+
s.add_dependency(%q<git>.freeze, [">= 1.2.5"])
|
235
|
+
s.add_dependency(%q<nokogiri>.freeze, [">= 1.5.10"])
|
236
|
+
s.add_dependency(%q<github_api>.freeze, [">= 0"])
|
237
|
+
s.add_dependency(%q<highline>.freeze, [">= 1.6.15"])
|
238
|
+
s.add_dependency(%q<bundler>.freeze, [">= 1.13"])
|
239
|
+
s.add_dependency(%q<rdoc>.freeze, [">= 0"])
|
240
|
+
s.add_dependency(%q<builder>.freeze, [">= 0"])
|
241
|
+
s.add_dependency(%q<semver>.freeze, [">= 0"])
|
242
|
+
s.add_dependency(%q<yard>.freeze, [">= 0.8.5"])
|
243
|
+
s.add_dependency(%q<bluecloth>.freeze, [">= 0"])
|
244
|
+
s.add_dependency(%q<cucumber>.freeze, [">= 1.1.4"])
|
245
|
+
s.add_dependency(%q<simplecov>.freeze, [">= 0"])
|
240
246
|
end
|
241
247
|
end
|
242
248
|
|
data/lib/juwelier/generator.rb
CHANGED
@@ -55,7 +55,7 @@ class Juwelier
|
|
55
55
|
:should_setup_rubyforge, :should_use_reek, :should_use_roodi,
|
56
56
|
:development_dependencies, :production_dependencies,
|
57
57
|
:options, :require_ruby_version, :should_create_bin,
|
58
|
-
:git_remote
|
58
|
+
:git_remote, :use_readme_format
|
59
59
|
|
60
60
|
def initialize(options = {})
|
61
61
|
self.options = options
|
@@ -105,6 +105,7 @@ class Juwelier
|
|
105
105
|
self.should_use_semver = options[:use_semver]
|
106
106
|
self.require_ruby_version = options[:use_required_version]
|
107
107
|
self.should_create_bin = options[:create_bin]
|
108
|
+
self.use_readme_format = options[:readme_format]
|
108
109
|
|
109
110
|
development_dependencies << ["cucumber", ">= 0"] if should_use_cucumber
|
110
111
|
|
@@ -201,12 +202,16 @@ class Juwelier
|
|
201
202
|
output_template_in_target 'Rakefile'
|
202
203
|
output_template_in_target 'Gemfile' if should_use_bundler
|
203
204
|
output_template_in_target 'LICENSE.txt'
|
204
|
-
output_template_in_target
|
205
|
+
output_template_in_target "README.#{use_readme_format}"
|
205
206
|
output_template_in_target '.document'
|
206
207
|
|
207
208
|
mkdir_in_target lib_dir
|
208
209
|
touch_in_target File.join(lib_dir, lib_filename)
|
209
210
|
|
211
|
+
if should_use_semver
|
212
|
+
output_template_in_target '.semver'
|
213
|
+
end
|
214
|
+
|
210
215
|
if should_create_bin
|
211
216
|
mkdir_in_target bin_dir
|
212
217
|
touch_in_target File.join(bin_dir, bin_filename)
|
@@ -9,6 +9,7 @@ class Juwelier
|
|
9
9
|
@orig_args = args.clone
|
10
10
|
self[:testing_framework] = :shoulda
|
11
11
|
self[:documentation_framework] = :rdoc
|
12
|
+
self[:readme_format] = :rdoc
|
12
13
|
self[:use_bundler] = true
|
13
14
|
|
14
15
|
self[:user_name] = ENV['GIT_AUTHOR_NAME'] || ENV['GIT_COMMITTER_NAME'] || git_config['user.name']
|
@@ -142,6 +143,14 @@ class Juwelier
|
|
142
143
|
o.on('--rdoc', 'use rdoc for documentation') do
|
143
144
|
self[:documentation_framework] = :rdoc
|
144
145
|
end
|
146
|
+
|
147
|
+
o.on('--org', 'use Orgmode for the readme') do
|
148
|
+
self[:readme_format] = :org
|
149
|
+
end
|
150
|
+
|
151
|
+
o.on('--markdown', 'use Markdown for the readme') do
|
152
|
+
self[:readme_format] = :markdown
|
153
|
+
end
|
145
154
|
|
146
155
|
o.on('-v', '--version', 'show version') do
|
147
156
|
self[:show_version] = true
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<%= project_name %>
|
2
|
+
===================
|
3
|
+
|
4
|
+
Description goes here.
|
5
|
+
|
6
|
+
Contributing to <%= project_name %>
|
7
|
+
------------------------------------------
|
8
|
+
|
9
|
+
- Check out the latest master to make sure the feature hasn't been
|
10
|
+
implemented or the bug hasn't been fixed yet.
|
11
|
+
- Check out the issue tracker to make sure someone already hasn't
|
12
|
+
requested it and/or contributed it.
|
13
|
+
- Fork the project.
|
14
|
+
- Start a feature/bugfix branch.
|
15
|
+
- Commit and push until you are happy with your contribution.
|
16
|
+
- Make sure to add tests for it. This is important so I don't break it
|
17
|
+
in a future version unintentionally.
|
18
|
+
- Please try not to mess with the Rakefile, version, or history. If
|
19
|
+
you want to have your own version, or is otherwise necessary, that
|
20
|
+
is fine, but please isolate to its own commit so I can cherry-pick
|
21
|
+
around it.
|
22
|
+
|
23
|
+
Copyright
|
24
|
+
---------
|
25
|
+
|
26
|
+
Copyright (c) <%= Time.now.year %> <%= user_name %>. See
|
27
|
+
LICENSE.txt for further details.
|
@@ -0,0 +1,18 @@
|
|
1
|
+
* <%= project_name %>
|
2
|
+
|
3
|
+
Description goes here.
|
4
|
+
|
5
|
+
** Contributing to <%= project_name %>
|
6
|
+
|
7
|
+
- Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
|
8
|
+
- Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
|
9
|
+
- Fork the project.
|
10
|
+
- Start a feature/bugfix branch.
|
11
|
+
- Commit and push until you are happy with your contribution.
|
12
|
+
- Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
13
|
+
- Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
14
|
+
|
15
|
+
** Copyright
|
16
|
+
|
17
|
+
Copyright (c) <%= Time.now.year %> <%= user_name %>. See LICENSE.txt for
|
18
|
+
further details.
|
@@ -3,13 +3,7 @@
|
|
3
3
|
require 'rubygems'
|
4
4
|
<%= render_template 'bundler_setup.erb' %>
|
5
5
|
require 'rake'
|
6
|
-
|
7
|
-
require 'semver'
|
8
|
-
|
9
|
-
def s_version
|
10
|
-
SemVer.find.format "%M.%m.%p%s"
|
11
|
-
end
|
12
|
-
<% end %>
|
6
|
+
<%= render_template 'semver_tasks.erb' %>
|
13
7
|
|
14
8
|
<%= render_template 'juwelier_tasks.erb' %>
|
15
9
|
|
@@ -12,7 +12,7 @@ Juwelier::Tasks.new do |gem|
|
|
12
12
|
gem.version = s_version
|
13
13
|
<% end %>
|
14
14
|
<% if require_ruby_version %>
|
15
|
-
gem.required_ruby_version = '>=
|
15
|
+
gem.required_ruby_version = '>= <%= require_ruby_version %>'
|
16
16
|
<% end %>
|
17
17
|
|
18
18
|
<% if should_setup_rubyforge %>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: juwelier
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1
|
4
|
+
version: 2.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fred Mitchell
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2016-
|
13
|
+
date: 2016-11-19 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rake
|
@@ -206,6 +206,7 @@ extra_rdoc_files:
|
|
206
206
|
- ChangeLog.markdown
|
207
207
|
- LICENSE.txt
|
208
208
|
- README.markdown
|
209
|
+
- README.org
|
209
210
|
files:
|
210
211
|
- ".coveralls.yml"
|
211
212
|
- ".document"
|
@@ -216,6 +217,7 @@ files:
|
|
216
217
|
- Gemfile
|
217
218
|
- LICENSE.txt
|
218
219
|
- README.markdown
|
220
|
+
- README.org
|
219
221
|
- Rakefile
|
220
222
|
- bin/juwelier
|
221
223
|
- features/generator/cucumber.feature
|
@@ -279,8 +281,11 @@ files:
|
|
279
281
|
- lib/juwelier/tasks.rb
|
280
282
|
- lib/juwelier/templates/.document
|
281
283
|
- lib/juwelier/templates/.gitignore
|
284
|
+
- lib/juwelier/templates/.semver
|
282
285
|
- lib/juwelier/templates/Gemfile
|
283
286
|
- lib/juwelier/templates/LICENSE.txt
|
287
|
+
- lib/juwelier/templates/README.markdown
|
288
|
+
- lib/juwelier/templates/README.org
|
284
289
|
- lib/juwelier/templates/README.rdoc
|
285
290
|
- lib/juwelier/templates/Rakefile
|
286
291
|
- lib/juwelier/templates/bacon/flunking.rb
|
@@ -299,6 +304,7 @@ files:
|
|
299
304
|
- lib/juwelier/templates/rspec/.rspec
|
300
305
|
- lib/juwelier/templates/rspec/flunking.rb
|
301
306
|
- lib/juwelier/templates/rspec/helper.rb
|
307
|
+
- lib/juwelier/templates/semver_tasks.erb
|
302
308
|
- lib/juwelier/templates/shindo/flunking.rb
|
303
309
|
- lib/juwelier/templates/shindo/helper.rb
|
304
310
|
- lib/juwelier/templates/shoulda/flunking.rb
|
@@ -382,7 +388,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
382
388
|
requirements:
|
383
389
|
- - ">="
|
384
390
|
- !ruby/object:Gem::Version
|
385
|
-
version:
|
391
|
+
version: 2.2.2
|
386
392
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
387
393
|
requirements:
|
388
394
|
- - ">="
|
@@ -390,7 +396,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
390
396
|
version: '0'
|
391
397
|
requirements: []
|
392
398
|
rubyforge_project:
|
393
|
-
rubygems_version: 2.
|
399
|
+
rubygems_version: 2.6.7
|
394
400
|
signing_key:
|
395
401
|
specification_version: 4
|
396
402
|
summary: Powerful and Opinionated tool for creating and managing RubyGem projects
|