Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fill out the templates and add ERB variable
Add content to the template files and add a @class_name_underscore variable to the ERB processing. Now, you pass a ConstantStyle name to the executable and it will convert it to an underscored format where needed.
- Loading branch information
Tim Harvey
committed
Feb 8, 2012
1 parent
7398a62
commit 8bad2be
Showing
6 changed files
with
59 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,16 @@ | ||
Class: <%= @class_name %> | ||
# <%= @class_name %> | ||
|
||
Description and usage: | ||
|
||
require '<%= @class_name_underscore %>' | ||
<%= @class_name %>.new | ||
|
||
# Running the tests | ||
|
||
Install the rspec gem | ||
|
||
gem install rspec | ||
|
||
Run the spec | ||
|
||
rspec <%= @class_name_underscore %>_spec.rb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
Gem::Specification.new do |s| | ||
s.name = '<%= @class_name_underscore %>' | ||
s.summary = '' | ||
s.description = '' | ||
s.version = '0.0.1' | ||
s.platform = Gem::Platform::RUBY | ||
|
||
s.files = ['<%= @class_name_underscore %>.rb'] | ||
s.require_path = '.' | ||
|
||
s.author = '' | ||
s.email = '' | ||
s.homepage = '' | ||
|
||
s.test_file = '<%= @class_name_underscore %>_spec.rb' | ||
s.add_development_dependency('rspec', ["~> 2.8"]) | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class <%= @class_name %> | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
require File.expand_path('<%= @class_name_underscore %>') | ||
|
||
describe <%= @class_name %> do | ||
it 'should have tests' do | ||
pending | ||
end | ||
end |
This comment has been minimized.
Sorry, something went wrong.
trucktankJan 25, 2020