Skip to content

Commit 68a6d8f

Browse files
author
Sven Fuchs
committed
whitespace
1 parent 6aa4a9e commit 68a6d8f

19 files changed

+55
-56
lines changed

lib/gem_release/command_options.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ def option(key, short, description)
2020
add_option(*args) { |value, options| options[key] = value }
2121
end
2222
end
23-
end
23+
end

lib/gem_release/gemspec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def initialize(options = {})
1313
@description ||= '[description]'
1414
@strategy = options[:strategy]
1515
end
16-
16+
1717
def files
1818
case @strategy
1919
when 'git'
@@ -22,7 +22,7 @@ def files
2222
'Dir.glob("lib/**/**")'
2323
end
2424
end
25-
25+
2626
def filename
2727
"#{name}.gemspec"
2828
end

lib/gem_release/template.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ def template
3030
File.new(File.expand_path("../templates/#{template_name}", __FILE__)).read
3131
end
3232
end
33-
end
33+
end

lib/gem_release/templates/gemspec.erb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,4 @@ Gem::Specification.new do |s|
1616
s.platform = Gem::Platform::RUBY
1717
s.require_path = 'lib'
1818
s.rubyforge_project = '[none]'
19-
s.required_rubygems_version = '>= 1.3.6'
2019
end

lib/gem_release/templates/version.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module <%= module_name %>
22
VERSION = <%= version.inspect %>
3-
end
3+
end

lib/gem_release/version.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ def initialize(options = {})
1212
def filename
1313
"lib/#{module_path}/version.rb"
1414
end
15-
15+
1616
def template_name
1717
'version.erb'
1818
end
1919
end if defined?(Template)
20-
end
20+
end

lib/gem_release/version_file.rb

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,54 @@
11
module GemRelease
22
class VersionFile
33
include GemRelease::Helpers
4-
4+
55
VERSION_PATTERN = /(VERSION\s*=\s*(?:"|'))(\d+\.\d+\.\d+)("|')/
66
NUMBER_PATTERN = /(\d+)\.(\d+)\.(\d+)/
7-
7+
88
attr_reader :target
9-
9+
1010
def initialize(options = {})
1111
@target = options[:target] || :patch
1212
end
13-
13+
1414
def bump!
1515
File.open(filename, 'w+') { |f| f.write(bumped_content) }
1616
end
17-
17+
1818
def new_number
1919
@new_number ||= old_number.sub(NUMBER_PATTERN) do
2020
respond_to?(target) ? send(target, $1, $2, $3) : target
2121
end
2222
end
23-
23+
2424
def old_number
2525
@old_number ||= content =~ VERSION_PATTERN && $2
2626
end
27-
27+
2828
def filename
2929
File.expand_path("lib/#{gem_module_path}/version.rb")
3030
end
31-
31+
3232
protected
33-
33+
3434
def major(major, minor, patch)
3535
"#{major.to_i + 1}.0.0"
3636
end
37-
37+
3838
def minor(major, minor, patch)
3939
"#{major}.#{minor.to_i + 1}.0"
4040
end
41-
41+
4242
def patch(major, minor, patch)
4343
"#{major}.#{minor}.#{patch.to_i + 1}"
4444
end
45-
45+
4646
def content
4747
@content ||= File.read(filename)
4848
end
49-
49+
5050
def bumped_content
5151
content.sub(VERSION_PATTERN) { "#{$1}#{new_number}#{$3}"}
5252
end
5353
end
54-
end
54+
end

lib/rubygems/commands/bootstrap_command.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class Gem::Commands::BootstrapCommand < Gem::Command
88
OPTIONS = { :gemspec => true, :strategy => 'git', :scaffold => false, :github => false }
99

1010
attr_reader :arguments, :usage
11-
11+
1212
def initialize
1313
super 'bootstrap', 'Bootstrap a new gem source repository', OPTIONS
1414

@@ -35,7 +35,7 @@ def write_scaffold
3535
write_version
3636
write_rakefile
3737
end
38-
38+
3939
def write_version
4040
version = Version.new(options)
4141
say "Creating #{version.filename}"
@@ -61,22 +61,22 @@ def write_rakefile
6161
def create_repo
6262
options = { :login => github_user, :token => github_token, :name => gem_name }
6363
options = options.map { |name, value| "-F '#{name}=#{value}'" }.join(' ')
64-
64+
6565
say 'Bootstrapializing git repository'
6666
`git init`
67-
67+
6868
say 'Staging files'
6969
`git add .`
70-
70+
7171
say 'Creating initial commit'
7272
`git commit -m 'initial commit'`
73-
73+
7474
say "Adding remote origin [email protected]:#{github_user}/#{gem_name}.git"
7575
`git remote add origin [email protected]:#{github_user}/#{gem_name}.git`
7676

7777
say 'Creating repository on Github'
7878
silence { `curl #{options} http://github.com/api/v2/yaml/repos/create` }
79-
79+
8080
say 'Pushing to Github'
8181
`git push origin master`
8282
end

lib/rubygems/commands/gemspec_command.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ def execute
1717
say "Creating #{gemspec.filename}"
1818
gemspec.write
1919
end
20-
end
20+
end

lib/rubygems/commands/release_command.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class Gem::Commands::ReleaseCommand < Gem::Command
1111
attr_reader :arguments, :usage
1212

1313
def initialize
14-
super 'release', 'Build a gem from a gemspec and push to rubygems.org'
14+
super 'release', 'Build gem from a gemspec and push to rubygems.org'
1515
option :tag, '-t', 'Create a git tag and push --tags to origin'
1616
@arguments = "gemspec - optional gemspec file name, will use the first *.gemspec if not specified"
1717
@usage = "#{program_name} [gemspec]"
@@ -43,4 +43,4 @@ def remove
4343
def tag
4444
TagCommand.new.invoke
4545
end
46-
end
46+
end

lib/rubygems/commands/tag_command.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def execute
1212
tag
1313
push
1414
end
15-
15+
1616
protected
1717

1818
def tag
@@ -24,8 +24,8 @@ def push
2424
say "Pushing --tags to origin git repository"
2525
`git push --tags origin`
2626
end
27-
27+
2828
def tag_name
2929
"v#{gem_version}"
3030
end
31-
end
31+
end

test/all.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
Dir[File.dirname(__FILE__) + '/**/*_test.rb'].each do |filename|
22
require filename
3-
end
3+
end

test/bootstrap_command_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@ def teardown
4949

5050
command.send(:create_repo)
5151
end
52-
end
52+
end

test/gemspec_command_test.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ def setup
99
stub_command(GemspecCommand, :say)
1010
stub_command(BootstrapCommand, :say)
1111
end
12-
12+
1313
def teardown
1414
teardown_sandbox
1515
end
16-
16+
1717
test "gemspec_command" do
1818
GemspecCommand.new.invoke
1919

@@ -23,4 +23,4 @@ def teardown
2323
BootstrapCommand.new.send(:write_version) # so it can be required by .gemspec
2424
assert_equal 'foo-bar', eval(File.read(filename)).name
2525
end
26-
end
26+
end

test/gemspec_test.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
class GemspecTest < Test::Unit::TestCase
77
include Gem::Commands
8-
8+
99
test 'scaffolds a gemspec with default values' do
1010
source = GemRelease::Gemspec.new.render
1111
gemspec = eval(source)
@@ -22,17 +22,17 @@ class GemspecTest < Test::Unit::TestCase
2222
assert_equal "http://github.com/#{github_user}/gem-release", gemspec.homepage
2323
assert_equal '[summary]', gemspec.summary
2424
assert_equal '[description]', gemspec.description
25-
25+
2626
assert_match %r(require 'gem_release/version'), source
2727
assert_match %r(files\s*=\s*Dir.glob\(\"lib\/\*\*\/\*\*\"\)), source
2828
end
29-
29+
3030
test 'scaffolds a gemspec with glob strategy' do
3131
source = GemRelease::Gemspec.new(:strategy => 'glob').render
3232
gemspec = eval(source)
3333
assert_match %r(files\s*=\s*Dir.glob\(\"lib\/\*\*\/\*\*\"\)), source
3434
end
35-
35+
3636
test 'scaffolds a gemspec with git strategy' do
3737
source = GemRelease::Gemspec.new(:strategy => 'git').render
3838
gemspec = eval(source)

test/helpers_test.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44

55
class HelpersTest < Test::Unit::TestCase
66
include Gem::Commands
7-
7+
88
test "gems_filename" do
99
assert_match /gem-release-\d+\.\d+\.\d+\.gem/, ReleaseCommand.new.gem_filename
1010
end
11-
11+
1212
test "gems_version" do
1313
assert_match /^\d+\.\d+\.\d+$/, ReleaseCommand.new.gem_version
1414
end
15-
15+
1616
test "gemspec_filename with an cmdline argument given" do
1717
command = ReleaseCommand.new
1818
command.handle_options(['path/to/some.gemspec'])

test/release_command_test.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,32 @@
55

66
class ReleaseCommandTest < Test::Unit::TestCase
77
include Gem::Commands
8-
8+
99
def setup
1010
stub_command(BuildCommand, :execute)
1111
stub_command(PushCommand, :execute)
1212
stub_command(TagCommand, :execute)
1313
stub_command(ReleaseCommand, :remove, :say)
1414
GemRelease::VERSION.replace('0.0.1')
1515
end
16-
16+
1717
test "build executes BuildCommand with the current gemspec filename" do
1818
command = BuildCommand.new
1919
command.expects(:execute)
2020
ReleaseCommand.new.send(:build)
2121
assert_equal ['gem-release.gemspec'], command.options[:args]
2222
end
23-
23+
2424
test "push executes PushCommand with the current gem filename" do
2525
command = PushCommand.new
2626
command.stubs(:gem_filename).returns('gem-release-0.0.1.gem')
2727
command.expects(:execute)
2828
ReleaseCommand.new.send(:push)
2929
assert_equal ['gem-release-0.0.1.gem'], command.options[:args]
3030
end
31-
31+
3232
test "tag executes TagCommand if --tag option was given" do
3333
TagCommand.new.expects(:execute)
3434
ReleaseCommand.new.invoke('--tag')
3535
end
36-
end
36+
end

test/tag_command_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
class TagCommandTest < Test::Unit::TestCase
66
include Gem::Commands
7-
7+
88
def setup
99
stub_command(TagCommand, :say)
1010
end
@@ -16,4 +16,4 @@ def setup
1616
command.expects(:`).with("git push --tags origin")
1717
command.execute
1818
end
19-
end
19+
end

test/test_helper.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def stub_command(command_class, *methods)
2828
methods.each { |method| command.stubs(method) }
2929
command_class.stubs(:new).returns(command)
3030
end
31-
31+
3232
def capture_io
3333
require 'stringio'
3434

@@ -43,4 +43,4 @@ def capture_io
4343
$stdout = orig_stdout
4444
$stderr = orig_stderr
4545
end
46-
end
46+
end

0 commit comments

Comments
 (0)