pivotal-jeweler 1.0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. data/.gitignore +7 -0
  2. data/ChangeLog.markdown +85 -0
  3. data/LICENSE +20 -0
  4. data/README.markdown +170 -0
  5. data/ROADMAP +12 -0
  6. data/Rakefile +106 -0
  7. data/VERSION.yml +2 -0
  8. data/bin/jeweler +8 -0
  9. data/features/generator/cucumber.feature +83 -0
  10. data/features/generator/directory_layout.feature +76 -0
  11. data/features/generator/dotdocument.feature +14 -0
  12. data/features/generator/env_options.feature +9 -0
  13. data/features/generator/git.feature +94 -0
  14. data/features/generator/license.feature +11 -0
  15. data/features/generator/rakefile.feature +110 -0
  16. data/features/generator/readme.feature +12 -0
  17. data/features/generator/test.feature +41 -0
  18. data/features/generator/test_helper.feature +49 -0
  19. data/features/placeholder.feature +5 -0
  20. data/features/step_definitions/debug_steps.rb +6 -0
  21. data/features/step_definitions/filesystem_steps.rb +65 -0
  22. data/features/step_definitions/generator_steps.rb +251 -0
  23. data/features/step_definitions/task_steps.rb +6 -0
  24. data/features/support/env.rb +19 -0
  25. data/features/tasks/build_gem.feature +9 -0
  26. data/features/tasks/version.feature +24 -0
  27. data/features/tasks/version_bumping.feature +33 -0
  28. data/jeweler.gemspec +204 -0
  29. data/lib/jeweler/commands/build_gem.rb +31 -0
  30. data/lib/jeweler/commands/install_gem.rb +26 -0
  31. data/lib/jeweler/commands/release.rb +83 -0
  32. data/lib/jeweler/commands/release_to_rubyforge.rb +51 -0
  33. data/lib/jeweler/commands/setup_rubyforge.rb +38 -0
  34. data/lib/jeweler/commands/validate_gemspec.rb +30 -0
  35. data/lib/jeweler/commands/version/base.rb +41 -0
  36. data/lib/jeweler/commands/version/bump_major.rb +13 -0
  37. data/lib/jeweler/commands/version/bump_minor.rb +12 -0
  38. data/lib/jeweler/commands/version/bump_patch.rb +14 -0
  39. data/lib/jeweler/commands/version/write.rb +12 -0
  40. data/lib/jeweler/commands/write_gemspec.rb +39 -0
  41. data/lib/jeweler/commands.rb +12 -0
  42. data/lib/jeweler/errors.rb +20 -0
  43. data/lib/jeweler/gemspec_helper.rb +76 -0
  44. data/lib/jeweler/generator/application.rb +54 -0
  45. data/lib/jeweler/generator/bacon_mixin.rb +39 -0
  46. data/lib/jeweler/generator/micronaut_mixin.rb +38 -0
  47. data/lib/jeweler/generator/minitest_mixin.rb +39 -0
  48. data/lib/jeweler/generator/options.rb +77 -0
  49. data/lib/jeweler/generator/rspec_mixin.rb +39 -0
  50. data/lib/jeweler/generator/shoulda_mixin.rb +39 -0
  51. data/lib/jeweler/generator/testunit_mixin.rb +39 -0
  52. data/lib/jeweler/generator.rb +284 -0
  53. data/lib/jeweler/rubyforge_tasks.rb +46 -0
  54. data/lib/jeweler/specification.rb +65 -0
  55. data/lib/jeweler/tasks.rb +125 -0
  56. data/lib/jeweler/templates/.document +5 -0
  57. data/lib/jeweler/templates/.gitignore +5 -0
  58. data/lib/jeweler/templates/LICENSE +20 -0
  59. data/lib/jeweler/templates/README.rdoc +7 -0
  60. data/lib/jeweler/templates/Rakefile +102 -0
  61. data/lib/jeweler/templates/bacon/flunking.rb +7 -0
  62. data/lib/jeweler/templates/bacon/helper.rb +8 -0
  63. data/lib/jeweler/templates/features/default.feature +9 -0
  64. data/lib/jeweler/templates/features/support/env.rb +8 -0
  65. data/lib/jeweler/templates/micronaut/flunking.rb +7 -0
  66. data/lib/jeweler/templates/micronaut/helper.rb +17 -0
  67. data/lib/jeweler/templates/minitest/flunking.rb +7 -0
  68. data/lib/jeweler/templates/minitest/helper.rb +11 -0
  69. data/lib/jeweler/templates/rspec/flunking.rb +7 -0
  70. data/lib/jeweler/templates/rspec/helper.rb +9 -0
  71. data/lib/jeweler/templates/shoulda/flunking.rb +7 -0
  72. data/lib/jeweler/templates/shoulda/helper.rb +10 -0
  73. data/lib/jeweler/templates/testunit/flunking.rb +7 -0
  74. data/lib/jeweler/templates/testunit/helper.rb +9 -0
  75. data/lib/jeweler/version_helper.rb +134 -0
  76. data/lib/jeweler.rb +140 -0
  77. data/test/fixtures/bar/VERSION.yml +4 -0
  78. data/test/fixtures/bar/bin/foo_the_ultimate_bin +1 -0
  79. data/test/fixtures/bar/hey_include_me_in_gemspec +0 -0
  80. data/test/fixtures/bar/lib/foo_the_ultimate_lib.rb +1 -0
  81. data/test/fixtures/existing-project-with-version-plaintext/.document +5 -0
  82. data/test/fixtures/existing-project-with-version-plaintext/.gitignore +5 -0
  83. data/test/fixtures/existing-project-with-version-plaintext/LICENSE +20 -0
  84. data/test/fixtures/existing-project-with-version-plaintext/README.rdoc +7 -0
  85. data/test/fixtures/existing-project-with-version-plaintext/Rakefile +82 -0
  86. data/test/fixtures/existing-project-with-version-plaintext/VERSION +1 -0
  87. data/test/fixtures/existing-project-with-version-plaintext/existing-project-with-version.gemspec +29 -0
  88. data/test/fixtures/existing-project-with-version-plaintext/lib/existing_project_with_version.rb +0 -0
  89. data/test/fixtures/existing-project-with-version-plaintext/test/existing_project_with_version_test.rb +7 -0
  90. data/test/fixtures/existing-project-with-version-plaintext/test/test_helper.rb +10 -0
  91. data/test/fixtures/existing-project-with-version-yaml/.document +5 -0
  92. data/test/fixtures/existing-project-with-version-yaml/.gitignore +5 -0
  93. data/test/fixtures/existing-project-with-version-yaml/LICENSE +20 -0
  94. data/test/fixtures/existing-project-with-version-yaml/README.rdoc +7 -0
  95. data/test/fixtures/existing-project-with-version-yaml/Rakefile +82 -0
  96. data/test/fixtures/existing-project-with-version-yaml/VERSION.yml +4 -0
  97. data/test/fixtures/existing-project-with-version-yaml/existing-project-with-version.gemspec +29 -0
  98. data/test/fixtures/existing-project-with-version-yaml/lib/existing_project_with_version.rb +0 -0
  99. data/test/fixtures/existing-project-with-version-yaml/test/existing_project_with_version_test.rb +7 -0
  100. data/test/fixtures/existing-project-with-version-yaml/test/test_helper.rb +10 -0
  101. data/test/geminstaller.yml +12 -0
  102. data/test/jeweler/commands/test_build_gem.rb +72 -0
  103. data/test/jeweler/commands/test_install_gem.rb +21 -0
  104. data/test/jeweler/commands/test_release.rb +405 -0
  105. data/test/jeweler/commands/test_release_to_rubyforge.rb +157 -0
  106. data/test/jeweler/commands/test_setup_rubyforge.rb +88 -0
  107. data/test/jeweler/commands/test_validate_gemspec.rb +27 -0
  108. data/test/jeweler/commands/test_write_gemspec.rb +92 -0
  109. data/test/jeweler/commands/version/test_base.rb +32 -0
  110. data/test/jeweler/commands/version/test_bump_major.rb +22 -0
  111. data/test/jeweler/commands/version/test_bump_minor.rb +19 -0
  112. data/test/jeweler/commands/version/test_bump_patch.rb +20 -0
  113. data/test/jeweler/commands/version/test_write.rb +21 -0
  114. data/test/shoulda_macros/jeweler_macros.rb +35 -0
  115. data/test/test_application.rb +139 -0
  116. data/test/test_gemspec_helper.rb +40 -0
  117. data/test/test_generator.rb +154 -0
  118. data/test/test_generator_initialization.rb +113 -0
  119. data/test/test_generator_mixins.rb +18 -0
  120. data/test/test_helper.rb +133 -0
  121. data/test/test_jeweler.rb +172 -0
  122. data/test/test_options.rb +116 -0
  123. data/test/test_specification.rb +61 -0
  124. data/test/test_tasks.rb +51 -0
  125. data/test/test_version_helper.rb +151 -0
  126. metadata +228 -0
@@ -0,0 +1,8 @@
1
+ $LOAD_PATH.unshift(File.dirname(__FILE__) + '/../../lib')
2
+ require '<%= require_name %>'
3
+
4
+ require '<%= feature_support_require %>'
5
+ <% if feature_support_extend %>
6
+
7
+ World(<%= feature_support_extend %>)
8
+ <% end %>
@@ -0,0 +1,7 @@
1
+ require 'example_helper'
2
+
3
+ describe "<%= constant_name %>" do
4
+ it "fails" do
5
+ fail "hey buddy, you should probably rename this file and start specing for real"
6
+ end
7
+ end
@@ -0,0 +1,17 @@
1
+ require 'rubygems'
2
+ require 'micronaut'
3
+
4
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
5
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
6
+
7
+ require '<%= require_name %>'
8
+
9
+ def not_in_editor?
10
+ !(ENV.has_key?('TM_MODE') || ENV.has_key?('EMACS') || ENV.has_key?('VIM'))
11
+ end
12
+
13
+ Micronaut.configure do |c|
14
+ c.color_enabled = not_in_editor?
15
+ c.filter_run :focused => true
16
+ end
17
+
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class <%= constant_name %>Test < Mini::Test::TestCase
4
+ def test_something_for_real
5
+ flunk "hey buddy, you should probably rename this file and start testing for real"
6
+ end
7
+ end
@@ -0,0 +1,11 @@
1
+ require 'rubygems'
2
+ require 'mini/test'
3
+
4
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
5
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
6
+ require '<%= require_name %>'
7
+
8
+ class Mini::Test::TestCase
9
+ end
10
+
11
+ Mini::Test.autorun
@@ -0,0 +1,7 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
+
3
+ describe "<%= constant_name %>" do
4
+ it "fails" do
5
+ fail "hey buddy, you should probably rename this file and start specing for real"
6
+ end
7
+ end
@@ -0,0 +1,9 @@
1
+ require 'spec'
2
+
3
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
4
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
5
+ require '<%= require_name %>'
6
+
7
+ Spec::Runner.configure do |config|
8
+
9
+ end
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class <%= constant_name %>Test < Test::Unit::TestCase
4
+ should "probably rename this file and start testing for real" do
5
+ flunk "hey buddy, you should probably rename this file and start testing for real"
6
+ end
7
+ end
@@ -0,0 +1,10 @@
1
+ require 'rubygems'
2
+ require 'test/unit'
3
+ require 'shoulda'
4
+
5
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
6
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
7
+ require '<%= require_name %>'
8
+
9
+ class Test::Unit::TestCase
10
+ end
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class <%= constant_name %>Test < Test::Unit::TestCase
4
+ def test_something_for_real
5
+ flunk "hey buddy, you should probably rename this file and start testing for real"
6
+ end
7
+ end
@@ -0,0 +1,9 @@
1
+ require 'rubygems'
2
+ require 'test/unit'
3
+
4
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
5
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
6
+ require '<%= require_name %>'
7
+
8
+ class Test::Unit::TestCase
9
+ end
@@ -0,0 +1,134 @@
1
+ require 'yaml'
2
+
3
+ class Jeweler
4
+ class VersionHelper
5
+ attr_accessor :base_dir
6
+ attr_reader :version
7
+
8
+ module YamlExtension
9
+ def write
10
+ File.open(yaml_path, 'w+') do |f|
11
+ YAML.dump(self.to_hash, f)
12
+ end
13
+ end
14
+
15
+ def to_hash
16
+ {
17
+ :version => version
18
+ }
19
+ end
20
+
21
+ def refresh
22
+ parse_yaml
23
+ end
24
+
25
+ def parse_yaml
26
+ yaml = read_yaml
27
+ update_to(yaml['version'] || yaml[:version])
28
+ end
29
+
30
+ def read_yaml
31
+ if File.exists?(yaml_path)
32
+ YAML.load_file(yaml_path)
33
+ else
34
+ raise VersionYmlError, "#{yaml_path} does not exist!"
35
+ end
36
+ end
37
+
38
+ def path
39
+ yaml_path
40
+ end
41
+ end
42
+
43
+ module PlaintextExtension
44
+ def write
45
+ File.open(plaintext_path, 'w') do |file|
46
+ file.puts to_s
47
+ end
48
+ end
49
+
50
+ def parse_plaintext
51
+ update_to(read_plaintext.chomp)
52
+ end
53
+
54
+ def read_plaintext
55
+ File.read(plaintext_path)
56
+ end
57
+
58
+ def refresh
59
+ parse_plaintext
60
+ end
61
+
62
+ def path
63
+ plaintext_path
64
+ end
65
+ end
66
+
67
+ def initialize(base_dir)
68
+ self.base_dir = base_dir
69
+
70
+ if File.exists?(yaml_path)
71
+ extend YamlExtension
72
+ parse_yaml
73
+ else
74
+ extend PlaintextExtension
75
+ if File.exists?(plaintext_path)
76
+ parse_plaintext
77
+ end
78
+ end
79
+ end
80
+
81
+ def major
82
+ version_parts[0]
83
+ end
84
+
85
+ def minor
86
+ version_parts[1]
87
+ end
88
+
89
+ def patch
90
+ version_parts[2]
91
+ end
92
+
93
+ def bump_major
94
+ @version = "#{major + 1}.0.0"
95
+ end
96
+
97
+ def bump_minor
98
+ @version = "#{major}.#{minor+1}.0"
99
+ end
100
+
101
+ def bump_patch
102
+ @version = "#{major}.#{minor}.#{patch + 1}"
103
+ end
104
+
105
+ def update_to(version)
106
+ @version = version
107
+ end
108
+
109
+ def to_s
110
+ version
111
+ end
112
+
113
+ def yaml_path
114
+ denormalized_path = File.join(@base_dir, 'VERSION.yml')
115
+ absolute_path = File.expand_path(denormalized_path)
116
+ absolute_path.gsub(Dir.getwd + File::SEPARATOR, '')
117
+ end
118
+
119
+ def plaintext_path
120
+ denormalized_path = File.join(@base_dir, 'VERSION')
121
+ absolute_path = File.expand_path(denormalized_path)
122
+ absolute_path.gsub(Dir.getwd + File::SEPARATOR, '')
123
+ end
124
+
125
+ protected
126
+
127
+ def version_parts
128
+ version.split(".").map do |part|
129
+ part.to_i
130
+ end
131
+ end
132
+
133
+ end
134
+ end
data/lib/jeweler.rb ADDED
@@ -0,0 +1,140 @@
1
+ require 'date'
2
+ require 'rubygems/user_interaction'
3
+ require 'rubygems/builder'
4
+ require 'rubyforge'
5
+
6
+ require 'jeweler/errors'
7
+ require 'jeweler/version_helper'
8
+ require 'jeweler/gemspec_helper'
9
+ require 'jeweler/generator'
10
+ require 'jeweler/generator/options'
11
+ require 'jeweler/generator/application'
12
+
13
+ require 'jeweler/commands'
14
+
15
+ require 'jeweler/tasks'
16
+ require 'jeweler/rubyforge_tasks'
17
+
18
+ require 'jeweler/specification'
19
+
20
+ # A Jeweler helps you craft the perfect Rubygem. Give him a gemspec, and he takes care of the rest.
21
+ class Jeweler
22
+
23
+ attr_reader :gemspec, :gemspec_helper, :version_helper
24
+ attr_accessor :base_dir, :output, :repo, :commit, :rubyforge
25
+
26
+ def initialize(gemspec, base_dir = '.')
27
+ raise(GemspecError, "Can't create a Jeweler with a nil gemspec") if gemspec.nil?
28
+
29
+ @gemspec = gemspec
30
+ @gemspec.extend(Specification)
31
+ @gemspec.set_jeweler_defaults(base_dir)
32
+
33
+ @base_dir = base_dir
34
+ @repo = Git.open(base_dir) if in_git_repo?
35
+ @version_helper = Jeweler::VersionHelper.new(base_dir)
36
+ @output = $stdout
37
+ @commit = true
38
+ @gemspec_helper = GemSpecHelper.new(gemspec, base_dir)
39
+ @rubyforge = RubyForge.new
40
+ end
41
+
42
+ # Major version, as defined by the gemspec's Version module.
43
+ # For 1.5.3, this would return 1.
44
+ def major_version
45
+ @version_helper.major
46
+ end
47
+
48
+ # Minor version, as defined by the gemspec's Version module.
49
+ # For 1.5.3, this would return 5.
50
+ def minor_version
51
+ @version_helper.minor
52
+ end
53
+
54
+ # Patch version, as defined by the gemspec's Version module.
55
+ # For 1.5.3, this would return 5.
56
+ def patch_version
57
+ @version_helper.patch
58
+ end
59
+
60
+ # Human readable version, which is used in the gemspec.
61
+ def version
62
+ @version_helper.to_s
63
+ end
64
+
65
+ # Writes out the gemspec
66
+ def write_gemspec
67
+ Jeweler::Commands::WriteGemspec.build_for(self).run
68
+ end
69
+
70
+ # Validates the project's gemspec from disk in an environment similar to how
71
+ # GitHub would build from it. See http://gist.github.com/16215
72
+ def validate_gemspec
73
+ Jeweler::Commands::ValidateGemspec.build_for(self).run
74
+ end
75
+
76
+ # is the project's gemspec from disk valid?
77
+ def valid_gemspec?
78
+ gemspec_helper.valid?
79
+ end
80
+
81
+ def build_gem
82
+ Jeweler::Commands::BuildGem.build_for(self).run
83
+ end
84
+
85
+ def install_gem
86
+ Jeweler::Commands::InstallGem.build_for(self).run
87
+ end
88
+
89
+ # Bumps the patch version.
90
+ #
91
+ # 1.5.1 -> 1.5.2
92
+ def bump_patch_version()
93
+ Jeweler::Commands::Version::BumpPatch.build_for(self).run
94
+ end
95
+
96
+ # Bumps the minor version.
97
+ #
98
+ # 1.5.1 -> 1.6.0
99
+ def bump_minor_version()
100
+ Jeweler::Commands::Version::BumpMinor.build_for(self).run
101
+ end
102
+
103
+ # Bumps the major version.
104
+ #
105
+ # 1.5.1 -> 2.0.0
106
+ def bump_major_version()
107
+ Jeweler::Commands::Version::BumpMajor.build_for(self).run
108
+ end
109
+
110
+ # Bumps the version, to the specific major/minor/patch version, writing out the appropriate version.rb, and then reloads it.
111
+ def write_version(version, options = {})
112
+ command = Jeweler::Commands::Version::Write.build_for(self)
113
+ command.version = version
114
+
115
+ command.run
116
+ end
117
+
118
+ def release
119
+ Jeweler::Commands::Release.build_for(self).run
120
+ end
121
+
122
+ def release_gem_to_rubyforge
123
+ Jeweler::Commands::ReleaseToRubyforge.build_for(self).run
124
+ end
125
+
126
+ def setup_rubyforge
127
+ Jeweler::Commands::SetupRubyforge.build_for(self).run
128
+ end
129
+
130
+
131
+ def in_git_repo?
132
+ File.exists?(File.join(self.base_dir, '.git'))
133
+ end
134
+
135
+ def version_exists?
136
+ File.exists?(@version_helper.plaintext_path) || File.exists?(@version_helper.yaml_path)
137
+ end
138
+
139
+ end
140
+
@@ -0,0 +1,4 @@
1
+ ---
2
+ major: 1
3
+ minor: 5
4
+ patch: 2
@@ -0,0 +1 @@
1
+ # You betcha!
File without changes
@@ -0,0 +1 @@
1
+ # Uhuh
@@ -0,0 +1,5 @@
1
+ README.rdoc
2
+ lib/**/*.rb
3
+ bin/*
4
+ features/**/*.feature
5
+ LICENSE
@@ -0,0 +1,5 @@
1
+ *.sw?
2
+ .DS_Store
3
+ coverage
4
+ rdoc
5
+ pkg
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2009 Josh Nichols
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,7 @@
1
+ = existing-project-with-version
2
+
3
+ Description goes here.
4
+
5
+ == Copyright
6
+
7
+ Copyright (c) 2009 Josh Nichols. See LICENSE for details.
@@ -0,0 +1,82 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+
4
+ begin
5
+ require 'jeweler'
6
+ Jeweler::Tasks.new do |gem|
7
+ gem.name = "existing-project-with-version"
8
+ gem.summary = %Q{TODO}
9
+ gem.email = "josh@technicalpickles.com"
10
+ gem.homepage = "http://github.com/technicalpickles/existing-project-with-version"
11
+ gem.authors = ["Josh Nichols"]
12
+ # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
13
+ end
14
+ rescue LoadError
15
+ puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
16
+ end
17
+
18
+ require 'rake/testtask'
19
+ Rake::TestTask.new(:test) do |test|
20
+ test.libs << 'lib' << 'test'
21
+ test.pattern = 'test/**/*_test.rb'
22
+ test.verbose = false
23
+ end
24
+
25
+ begin
26
+ require 'rcov/rcovtask'
27
+ Rcov::RcovTask.new do |test|
28
+ test.libs << 'test'
29
+ test.pattern = 'test/**/*_test.rb'
30
+ test.verbose = true
31
+ end
32
+ rescue LoadError
33
+ task :rcov do
34
+ abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
35
+ end
36
+ end
37
+
38
+
39
+ task :default => :test
40
+
41
+ require 'rake/rdoctask'
42
+ Rake::RDocTask.new do |rdoc|
43
+ if File.exist?('VERSION.yml')
44
+ config = YAML.load(File.read('VERSION.yml'))
45
+ version = "#{config[:major]}.#{config[:minor]}.#{config[:patch]}"
46
+ else
47
+ version = ""
48
+ end
49
+
50
+ rdoc.rdoc_dir = 'rdoc'
51
+ rdoc.title = "existing-project-with-version #{version}"
52
+ rdoc.options << '--line-numbers' << '--inline-source'
53
+ rdoc.rdoc_files.include('README*')
54
+ rdoc.rdoc_files.include('lib/**/*.rb')
55
+ end
56
+
57
+ # Rubyforge documentation task
58
+ begin
59
+ require 'rake/contrib/sshpublisher'
60
+ namespace :rubyforge do
61
+
62
+ desc "Release gem and RDoc documentation to RubyForge"
63
+ task :release => ["rubyforge:release:gem", "rubyforge:release:docs"]
64
+
65
+ namespace :release do
66
+ desc "Publish RDoc to RubyForge."
67
+ task :docs => [:rdoc] do
68
+ config = YAML.load(
69
+ File.read(File.expand_path('~/.rubyforge/user-config.yml'))
70
+ )
71
+
72
+ host = "#{config['username']}@rubyforge.org"
73
+ remote_dir = "/var/www/gforge-projects/existing-project-with-version/"
74
+ local_dir = 'rdoc'
75
+
76
+ Rake::SshDirPublisher.new(host, remote_dir, local_dir).upload
77
+ end
78
+ end
79
+ end
80
+ rescue LoadError
81
+ puts "Rake SshDirPublisher is unavailable or your rubyforge environment is not configured."
82
+ end
@@ -0,0 +1,29 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = %q{existing-project-with-version}
5
+ s.version = "1.5.3"
6
+
7
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
+ s.authors = ["Josh Nichols"]
9
+ s.date = %q{2009-03-13}
10
+ s.email = %q{josh@technicalpickles.com}
11
+ s.extra_rdoc_files = ["README.rdoc", "LICENSE"]
12
+ s.files = ["README.rdoc", "VERSION.yml", "lib/existing_project_with_version.rb", "test/existing_project_with_version_test.rb", "test/test_helper.rb", "LICENSE"]
13
+ s.has_rdoc = true
14
+ s.homepage = %q{http://github.com/technicalpickles/existing-project-with-version}
15
+ s.rdoc_options = ["--inline-source", "--charset=UTF-8"]
16
+ s.require_paths = ["lib"]
17
+ s.rubygems_version = %q{1.3.1}
18
+ s.summary = %q{TODO}
19
+
20
+ if s.respond_to? :specification_version then
21
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
22
+ s.specification_version = 2
23
+
24
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
25
+ else
26
+ end
27
+ else
28
+ end
29
+ end
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class ExistingProjectWithVersionTest < Test::Unit::TestCase
4
+ should "probably rename this file and start testing for real" do
5
+ flunk "hey buddy, you should probably rename this file and start testing for real"
6
+ end
7
+ end
@@ -0,0 +1,10 @@
1
+ require 'rubygems'
2
+ require 'test/unit'
3
+ require 'shoulda'
4
+
5
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
6
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
7
+ require 'existing_project_with_version'
8
+
9
+ class Test::Unit::TestCase
10
+ end
@@ -0,0 +1,5 @@
1
+ README.rdoc
2
+ lib/**/*.rb
3
+ bin/*
4
+ features/**/*.feature
5
+ LICENSE
@@ -0,0 +1,5 @@
1
+ *.sw?
2
+ .DS_Store
3
+ coverage
4
+ rdoc
5
+ pkg
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2009 Josh Nichols
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,7 @@
1
+ = existing-project-with-version
2
+
3
+ Description goes here.
4
+
5
+ == Copyright
6
+
7
+ Copyright (c) 2009 Josh Nichols. See LICENSE for details.