Permalink
Browse files

Remove unnecessary references to 'self'

  • Loading branch information...
1 parent 7e55960 commit d4c213c706e209a4143e98ebeb4a905b7c65fe44 @reagent committed Mar 22, 2011
View
@@ -25,13 +25,13 @@ def generate_structure
generate_subdirectories
generate_file('gitignore.erb', '.gitignore')
generate_file('rvmrc.erb', '.rvmrc')
- generate_file('lib.rb.erb', "lib/#{self.ruby_name}.rb")
- generate_file('lib_version.rb.erb', "lib/#{self.ruby_name}/version.rb")
+ generate_file('lib.rb.erb', "lib/#{ruby_name}.rb")
+ generate_file('lib_version.rb.erb', "lib/#{ruby_name}/version.rb")
generate_file('Rakefile.erb', 'Rakefile')
generate_file('Gemfile.erb', 'Gemfile')
generate_file('README.rdoc.erb', 'README.rdoc')
generate_file('test_helper.rb.erb', 'test/test_helper.rb')
- generate_file('test.rb.erb', "test/unit/#{self.ruby_name}_test.rb")
+ generate_file('test.rb.erb', "test/unit/#{ruby_name}_test.rb")
end
def generate_gemspec
@@ -41,15 +41,15 @@ def generate_gemspec
private
def transform_name(glue = nil, &block)
- self.name.split(/[_-]/).map {|part| block.call(part) }.join(glue)
+ name.split(/[_-]/).map {|part| block.call(part) }.join(glue)
end
def generate_gem_directory
FileUtils.mkdir(gem_path)
end
def generate_subdirectories
- ['lib', 'test', "lib/#{self.ruby_name}", 'test/unit'].each do |dir|
+ ['lib', 'test', "lib/#{ruby_name}", 'test/unit'].each do |dir|
FileUtils.mkdir(path_to(dir))
end
end
@@ -1,16 +1,16 @@
-= <%= self.module_name %>
+= <%= module_name %>
== Description
Describe your gem here ...
== Installation
- gem install <%= self.name %>
+ gem install <%= name %>
== Usage
- require '<%= self.ruby_name %>'
+ require '<%= ruby_name %>'
== License
@@ -2,11 +2,11 @@ require 'rubygems'
require 'rake/gempackagetask'
require 'rake/testtask'
-require File.join(File.dirname(__FILE__), %w(lib <%= self.ruby_name %> version))
+require File.join(File.dirname(__FILE__), %w(lib <%= ruby_name %> version))
spec = Gem::Specification.new do |s|
- s.name = '<%= self.name %>'
- s.version = <%= self.module_name %>::Version.to_s
+ s.name = '<%= name %>'
+ s.version = <%= module_name %>::Version.to_s
s.has_rdoc = true
s.extra_rdoc_files = %w(README.rdoc)
s.rdoc_options = %w(--main README.rdoc)
@@ -15,7 +15,7 @@ spec = Gem::Specification.new do |s|
s.email = 'user@example.com'
s.homepage = 'http://my-site.net'
s.files = %w(README.rdoc Rakefile) + Dir.glob("{lib,test}/**/*")
- # s.executables = ['<%= self.name %>']
+ # s.executables = ['<%= name %>']
# s.add_dependency('gem_name', '~> 0.0.1')
@@ -1,3 +1,3 @@
$:.unshift File.dirname(__FILE__)
-# require '<%= self.ruby_name %>/...'
+# require '<%= ruby_name %>/...'
@@ -1,13 +1,13 @@
-module <%= self.module_name %>
+module <%= module_name %>
module Version
-
+
MAJOR = 0
MINOR = 1
TINY = 0
-
+
def self.to_s # :nodoc:
[MAJOR, MINOR, TINY].join('.')
end
-
+
end
end
View
@@ -1 +1 @@
-rvm 1.9.2@<%= self.name %> --create
+rvm 1.9.2@<%= name %> --create
@@ -1,13 +1,13 @@
require File.expand_path(File.join(File.dirname(__FILE__), %w(.. test_helper)))
-class <%= self.module_name %>Test < Test::Unit::TestCase
+class <%= module_name %>Test < Test::Unit::TestCase
- context "An instance of the <%= self.module_name %> class" do
+ context "An instance of the <%= module_name %> class" do
should "flunk" do
flunk "Please provide some tests"
end
-
+
end
end
@@ -5,4 +5,4 @@ require 'rubygems'
require 'test/unit'
require 'shoulda'
-require File.dirname(__FILE__) + '/../lib/<%= self.ruby_name %>'
+require File.dirname(__FILE__) + '/../lib/<%= ruby_name %>'

0 comments on commit d4c213c

Please sign in to comment.