Skip to content
This repository was archived by the owner on Sep 1, 2022. It is now read-only.

Commit f09d23b

Browse files
committed
Add automatic bootstrapping script makenew.sh
1 parent 60a0d86 commit f09d23b

15 files changed

Lines changed: 153 additions & 83 deletions

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
source 'https://rubygems.org'
22

3-
# Specify your gem's dependencies in replace_gemname.gemspec.
3+
# Specify your gem's dependencies in makenew-ruby_gem.gemspec.
44
gemspec

Guardfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ end
1616
group :unit do
1717
guard :rspec, cmd: 'bundle exec rspec --color --format Fuubar' do
1818
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
19-
watch(%r{^lib/replace_gemname/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
19+
watch(%r{^lib/makenew/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
2020
watch(%r{^spec/.+_spec\.rb$})
2121
watch('spec/spec_helper.rb') { 'spec' }
2222
end

LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) replace_yyyy replace_name_of_copyright_owner
3+
Copyright (c) 2016 Evan Sosenko
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy of
66
this software and associated documentation files (the "Software"), to deal in

README.md

Lines changed: 37 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
# Ruby Gem Skeleton
22

3-
<!--
4-
[![Gem](https://img.shields.io/gem/v/replace_gemname.svg)](https://rubygems.org/gems/replace_gemname)
5-
-->
3+
[![Gem](https://img.shields.io/gem/v/makenew-ruby_gem.svg)](https://rubygems.org/gems/makenew-ruby_gem)
64
[![GitHub license](https://img.shields.io/github/license/makenew/ruby-gem.svg)](./LICENSE.txt)
75
[![Gemnasium](https://img.shields.io/gemnasium/makenew/ruby-gem.svg)](https://gemnasium.com/makenew/ruby-gem)
86
[![Travis](https://img.shields.io/travis/makenew/ruby-gem.svg)](https://travis-ci.org/makenew/ruby-gem)
97
[![Codecov](https://img.shields.io/codecov/c/github/makenew/ruby-gem.svg)](https://codecov.io/github/makenew/ruby-gem)
108
[![Code Climate](https://img.shields.io/codeclimate/github/makenew/ruby-gem.svg)](https://codeclimate.com/github/makenew/ruby-gem)
119

12-
Use this project freely as a base for your testable Ruby gems.
13-
1410
## Description
1511

12+
Bootstrap a new [Ruby] gem in less than a minute.
13+
14+
[Ruby]: https://www.ruby-lang.org/
15+
1616
### Features
1717

1818
* [Rake] and [Guard] tasks for included tools.
@@ -35,43 +35,23 @@ Use this project freely as a base for your testable Ruby gems.
3535
[Travis CI]: https://travis-ci.org/
3636
[YARD]: http://yardoc.org/index.html
3737

38-
### Usage
39-
40-
This software can be used freely, see [The Unlicense].
41-
The MIT License text appearing in this software is for
42-
demonstration purposes only and does not apply to this software.
38+
### Bootstrapping a New Project
4339

4440
1. Clone this repository or download a [release][Releases].
4541

46-
2. Customize this README.
47-
- Set the title and summary text.
48-
- Replace the Description section.
49-
- Update the Contributing section.
50-
- Remove or update the badges.
42+
2. Run `./makenew.sh` and follow the prompts.
43+
This will replace the boilerplate, delete itself,
44+
and stage changes for commit.
45+
This script assumes the project repository will be hosted on GitHub.
46+
For an alternative location, you must update the URLs manually.
5147

52-
3. Everything else that should be filled in before using this skeleton
53-
has been marked with the terms `replace` or `Replace`.
54-
You can replace the placeholder gem name with your own using
48+
3. Fill in the README Description section.
5549

56-
```
57-
$ git mv replace_gemname.gemspec your_gemname.gemspec
58-
$ git mv lib/replace_gemname.rb lib/your_gemname.rb
59-
$ git mv lib/replace_gemname lib/your_gemname
60-
$ git ls-files -z | xargs -0 sed -i 's/replace_gemname/your_gemname/g'
61-
$ git ls-files -z | xargs -0 sed -i 's/ReplaceGemname/YourGemname/g'
62-
```
63-
64-
To see a list of what else still needs to be replaced, run
65-
66-
```
67-
$ grep -Ri replace
68-
$ find . -name "*replace*"
69-
```
70-
71-
Note that `CHANGELOG.md` is just a template for this skeleton.
72-
The actual changes for this project are documented in the commit history
73-
and summarized under [Releases].
50+
4. If [choosing a license][Choose a license] other than the one provided:
51+
update `LICENSE.txt`, the README License section, and the gemspec file
52+
with your chosen license.
7453

54+
[Choose a license]: http://choosealicense.com/
7555
[Releases]: https://github.com/makenew/ruby-gem/releases
7656
[The Unlicense]: http://unlicense.org/UNLICENSE
7757

@@ -102,12 +82,18 @@ $ git fetch upstream
10282
$ git merge upstream/master
10383
```
10484

85+
#### Changelog
86+
87+
Note that `CHANGELOG.md` is just a template for this skeleton.
88+
The actual changes for this project are documented in the commit history
89+
and summarized under [Releases].
90+
10591
## Installation
10692

10793
Add this line to your application's [Gemfile][Bundler]
10894

10995
```ruby
110-
gem 'replace_gemname'
96+
gem 'makenew-ruby_gem'
11197
```
11298

11399
and update your bundle with
@@ -119,7 +105,7 @@ $ bundle
119105
Or install it yourself with
120106

121107
```
122-
$ gem install replace_gemname
108+
$ gem install makenew-ruby_gem
123109
```
124110

125111
[Bundler]: http://bundler.io/
@@ -129,28 +115,28 @@ $ gem install replace_gemname
129115
- [YARD documentation][RubyDoc] is hosted by RubyDoc.info.
130116
- [Interactive documentation][Omniref] is hosted by Omniref.
131117

132-
[RubyDoc]: http://www.rubydoc.info/gems/replace_gemname
133-
[Omniref]: https://www.omniref.com/ruby/gems/replace_gemname
118+
[RubyDoc]: http://www.rubydoc.info/gems/makenew-ruby_gem
119+
[Omniref]: https://www.omniref.com/ruby/gems/makenew-ruby_gem
134120

135121
## Development and Testing
136122

137123
### Source Code
138124

139-
The [replace_gemname source] is hosted on GitHub.
125+
The [makenew-ruby_gem source] is hosted on GitHub.
140126
Clone the project with
141127

142128
```
143-
$ git clone https://github.com/replace_username/replace_gemname.git
129+
$ git clone https://github.com/makenew/ruby-gem.git
144130
```
145131

146-
[replace_gemname source]: https://github.com/replace_username/replace_gemname
132+
[makenew-ruby_gem source]: https://github.com/makenew/ruby-gem
147133

148134
### Rake
149135

150136
Run `$ rake -T` to see all Rake tasks.
151137

152138
```
153-
rake build # Build replace_gemname-0.0.0.gem into the pkg directory
139+
rake build # Build makenew-ruby_gem-2.0.0.gem into the pkg directory
154140
rake bump:current[tag] # Show current gem version
155141
rake bump:major[tag] # Bump major part of gem version
156142
rake bump:minor[tag] # Bump minor part of gem version
@@ -159,9 +145,9 @@ rake bump:pre[tag] # Bump pre part of gem version
159145
rake bump:set # Sets the version number using the VERSION environment variable
160146
rake clean # Remove any temporary products
161147
rake clobber # Remove any generated files
162-
rake install # Build and install replace_gemname-0.0.0.gem into system gems
163-
rake install:local # Build and install replace_gemname-0.0.0.gem into system gems without network access
164-
rake release[remote] # Create tag v0.0.0 and build and push replace_gemname-0.0.0.gem to Rubygems
148+
rake install # Build and install makenew-ruby_gem-2.0.0.gem into system gems
149+
rake install:local # Build and install makenew-ruby_gem-2.0.0.gem into system gems without network access
150+
rake release[remote] # Create tag v2.0.0 and build and push makenew-ruby_gem-2.0.0.gem to Rubygems
165151
rake rubocop # Run RuboCop
166152
rake rubocop:auto_correct # Auto-correct RuboCop offenses
167153
rake spec # Run RSpec code examples
@@ -190,6 +176,10 @@ To submit a patch:
190176

191177
## License
192178

179+
This software can be used freely, see [The Unlicense].
180+
The copyright text appearing below and elsewhere in this repository
181+
is for demonstration purposes only and does not apply to this software.
182+
193183
This Ruby gem is licensed under the MIT license.
194184

195185
## Warranty

lib/makenew.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
require 'makenew/version'
2+
require 'makenew/ruby_gem'

lib/makenew/ruby_gem.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module Makenew
2+
# Primary class for this module.
3+
class RubyGem
4+
end
5+
end

lib/makenew/version.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# frozen_string_literal: true
2+
# Primary module for this gem.
3+
module Makenew
4+
# Current Makenew version.
5+
VERSION = '2.0.0'.freeze
6+
end

lib/replace_gemname.rb

Lines changed: 0 additions & 2 deletions
This file was deleted.

lib/replace_gemname/replace_cls.rb

Lines changed: 0 additions & 5 deletions
This file was deleted.

lib/replace_gemname/version.rb

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)