jeweler2 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (160) hide show
  1. data/.document +8 -0
  2. data/ChangeLog.markdown +177 -0
  3. data/Gemfile +18 -0
  4. data/Gemfile.lock +47 -0
  5. data/LICENSE.txt +20 -0
  6. data/README.markdown +217 -0
  7. data/Rakefile +80 -0
  8. data/bin/jeweler +5 -0
  9. data/features/generator/cucumber.feature +103 -0
  10. data/features/generator/directory_layout.feature +86 -0
  11. data/features/generator/dotdocument.feature +13 -0
  12. data/features/generator/env_options.feature +9 -0
  13. data/features/generator/gemfile.feature +71 -0
  14. data/features/generator/git.feature +102 -0
  15. data/features/generator/license.feature +20 -0
  16. data/features/generator/rakefile.feature +158 -0
  17. data/features/generator/readme.feature +12 -0
  18. data/features/generator/test.feature +54 -0
  19. data/features/generator/test_helper.feature +149 -0
  20. data/features/placeholder.feature +5 -0
  21. data/features/step_definitions/debug_steps.rb +6 -0
  22. data/features/step_definitions/filesystem_steps.rb +70 -0
  23. data/features/step_definitions/generator_steps.rb +380 -0
  24. data/features/step_definitions/task_steps.rb +6 -0
  25. data/features/support/env.rb +42 -0
  26. data/features/tasks/build_gem.feature +9 -0
  27. data/features/tasks/version.feature +31 -0
  28. data/features/tasks/version_bumping.feature +49 -0
  29. data/jeweler.gemspec +245 -0
  30. data/jeweler2.gemspec +233 -0
  31. data/lib/jeweler/commands/build_gem.rb +36 -0
  32. data/lib/jeweler/commands/check_dependencies.rb +66 -0
  33. data/lib/jeweler/commands/install_gem.rb +31 -0
  34. data/lib/jeweler/commands/release_gemspec.rb +82 -0
  35. data/lib/jeweler/commands/release_to_git.rb +59 -0
  36. data/lib/jeweler/commands/release_to_rubygems.rb +28 -0
  37. data/lib/jeweler/commands/validate_gemspec.rb +30 -0
  38. data/lib/jeweler/commands/version/base.rb +55 -0
  39. data/lib/jeweler/commands/version/bump_major.rb +13 -0
  40. data/lib/jeweler/commands/version/bump_minor.rb +12 -0
  41. data/lib/jeweler/commands/version/bump_patch.rb +14 -0
  42. data/lib/jeweler/commands/version/write.rb +12 -0
  43. data/lib/jeweler/commands/write_gemspec.rb +39 -0
  44. data/lib/jeweler/commands.rb +20 -0
  45. data/lib/jeweler/errors.rb +8 -0
  46. data/lib/jeweler/gemcutter_tasks.rb +8 -0
  47. data/lib/jeweler/gemspec_helper.rb +87 -0
  48. data/lib/jeweler/generator/application.rb +61 -0
  49. data/lib/jeweler/generator/bacon_mixin.rb +43 -0
  50. data/lib/jeweler/generator/github_mixin.rb +29 -0
  51. data/lib/jeweler/generator/micronaut_mixin.rb +41 -0
  52. data/lib/jeweler/generator/minitest_mixin.rb +42 -0
  53. data/lib/jeweler/generator/options.rb +163 -0
  54. data/lib/jeweler/generator/rdoc_mixin.rb +9 -0
  55. data/lib/jeweler/generator/riot_mixin.rb +42 -0
  56. data/lib/jeweler/generator/rspec_mixin.rb +42 -0
  57. data/lib/jeweler/generator/shindo_mixin.rb +44 -0
  58. data/lib/jeweler/generator/shoulda_mixin.rb +42 -0
  59. data/lib/jeweler/generator/testspec_mixin.rb +42 -0
  60. data/lib/jeweler/generator/testunit_mixin.rb +39 -0
  61. data/lib/jeweler/generator/yard_mixin.rb +14 -0
  62. data/lib/jeweler/generator.rb +295 -0
  63. data/lib/jeweler/rubyforge_tasks.rb +95 -0
  64. data/lib/jeweler/rubygems_dot_org_tasks.rb +38 -0
  65. data/lib/jeweler/rubygems_tasks.rb +38 -0
  66. data/lib/jeweler/specification.rb +110 -0
  67. data/lib/jeweler/tasks.rb +224 -0
  68. data/lib/jeweler/templates/.document +5 -0
  69. data/lib/jeweler/templates/.gitignore +48 -0
  70. data/lib/jeweler/templates/Gemfile +12 -0
  71. data/lib/jeweler/templates/LICENSE.txt +20 -0
  72. data/lib/jeweler/templates/README.rdoc +19 -0
  73. data/lib/jeweler/templates/Rakefile +9 -0
  74. data/lib/jeweler/templates/bacon/flunking.rb +7 -0
  75. data/lib/jeweler/templates/bacon/helper.rb +9 -0
  76. data/lib/jeweler/templates/bundler_setup.erb +10 -0
  77. data/lib/jeweler/templates/features/default.feature +9 -0
  78. data/lib/jeweler/templates/features/support/env.rb +10 -0
  79. data/lib/jeweler/templates/jeweler_tasks.erb +31 -0
  80. data/lib/jeweler/templates/micronaut/flunking.rb +7 -0
  81. data/lib/jeweler/templates/micronaut/helper.rb +18 -0
  82. data/lib/jeweler/templates/minitest/flunking.rb +7 -0
  83. data/lib/jeweler/templates/minitest/helper.rb +12 -0
  84. data/lib/jeweler/templates/other_tasks.erb +86 -0
  85. data/lib/jeweler/templates/riot/flunking.rb +11 -0
  86. data/lib/jeweler/templates/riot/helper.rb +4 -0
  87. data/lib/jeweler/templates/rspec/.rspec +1 -0
  88. data/lib/jeweler/templates/rspec/flunking.rb +7 -0
  89. data/lib/jeweler/templates/rspec/helper.rb +12 -0
  90. data/lib/jeweler/templates/shindo/flunking.rb +8 -0
  91. data/lib/jeweler/templates/shindo/helper.rb +6 -0
  92. data/lib/jeweler/templates/shoulda/flunking.rb +7 -0
  93. data/lib/jeweler/templates/shoulda/helper.rb +11 -0
  94. data/lib/jeweler/templates/testspec/flunking.rb +7 -0
  95. data/lib/jeweler/templates/testspec/helper.rb +7 -0
  96. data/lib/jeweler/templates/testunit/flunking.rb +7 -0
  97. data/lib/jeweler/templates/testunit/helper.rb +10 -0
  98. data/lib/jeweler/version.rb +10 -0
  99. data/lib/jeweler/version_helper.rb +141 -0
  100. data/lib/jeweler.rb +177 -0
  101. data/test/fixtures/bar/VERSION.yml +4 -0
  102. data/test/fixtures/bar/bin/foo_the_ultimate_bin +1 -0
  103. data/test/fixtures/bar/hey_include_me_in_gemspec +0 -0
  104. data/test/fixtures/bar/lib/foo_the_ultimate_lib.rb +1 -0
  105. data/test/fixtures/existing-project-with-version-constant/.document +5 -0
  106. data/test/fixtures/existing-project-with-version-constant/.gitignore +5 -0
  107. data/test/fixtures/existing-project-with-version-constant/LICENSE.txt +20 -0
  108. data/test/fixtures/existing-project-with-version-constant/README.rdoc +7 -0
  109. data/test/fixtures/existing-project-with-version-constant/Rakefile +85 -0
  110. data/test/fixtures/existing-project-with-version-constant/existing-project-with-version.gemspec +29 -0
  111. data/test/fixtures/existing-project-with-version-constant/lib/existing_project_with_version.rb +0 -0
  112. data/test/fixtures/existing-project-with-version-constant/test/existing_project_with_version_test.rb +7 -0
  113. data/test/fixtures/existing-project-with-version-constant/test/test_helper.rb +10 -0
  114. data/test/fixtures/existing-project-with-version-plaintext/.document +5 -0
  115. data/test/fixtures/existing-project-with-version-plaintext/.gitignore +5 -0
  116. data/test/fixtures/existing-project-with-version-plaintext/LICENSE.txt +20 -0
  117. data/test/fixtures/existing-project-with-version-plaintext/README.rdoc +7 -0
  118. data/test/fixtures/existing-project-with-version-plaintext/Rakefile +84 -0
  119. data/test/fixtures/existing-project-with-version-plaintext/VERSION +1 -0
  120. data/test/fixtures/existing-project-with-version-plaintext/existing-project-with-version.gemspec +29 -0
  121. data/test/fixtures/existing-project-with-version-plaintext/lib/existing_project_with_version.rb +0 -0
  122. data/test/fixtures/existing-project-with-version-plaintext/test/existing_project_with_version_test.rb +7 -0
  123. data/test/fixtures/existing-project-with-version-plaintext/test/test_helper.rb +10 -0
  124. data/test/fixtures/existing-project-with-version-yaml/.document +5 -0
  125. data/test/fixtures/existing-project-with-version-yaml/.gitignore +5 -0
  126. data/test/fixtures/existing-project-with-version-yaml/LICENSE.txt +20 -0
  127. data/test/fixtures/existing-project-with-version-yaml/README.rdoc +7 -0
  128. data/test/fixtures/existing-project-with-version-yaml/Rakefile +84 -0
  129. data/test/fixtures/existing-project-with-version-yaml/VERSION.yml +4 -0
  130. data/test/fixtures/existing-project-with-version-yaml/bin/foo_the_ultimate_bin +0 -0
  131. data/test/fixtures/existing-project-with-version-yaml/existing-project-with-version.gemspec +29 -0
  132. data/test/fixtures/existing-project-with-version-yaml/lib/existing_project_with_version.rb +0 -0
  133. data/test/fixtures/existing-project-with-version-yaml/test/existing_project_with_version_test.rb +7 -0
  134. data/test/fixtures/existing-project-with-version-yaml/test/test_helper.rb +10 -0
  135. data/test/geminstaller.yml +12 -0
  136. data/test/jeweler/commands/test_build_gem.rb +103 -0
  137. data/test/jeweler/commands/test_install_gem.rb +35 -0
  138. data/test/jeweler/commands/test_release_to_gemcutter.rb +39 -0
  139. data/test/jeweler/commands/test_release_to_git.rb +198 -0
  140. data/test/jeweler/commands/test_release_to_github.rb +390 -0
  141. data/test/jeweler/commands/test_validate_gemspec.rb +27 -0
  142. data/test/jeweler/commands/test_write_gemspec.rb +101 -0
  143. data/test/jeweler/commands/version/test_base.rb +32 -0
  144. data/test/jeweler/commands/version/test_bump_major.rb +22 -0
  145. data/test/jeweler/commands/version/test_bump_minor.rb +19 -0
  146. data/test/jeweler/commands/version/test_bump_patch.rb +20 -0
  147. data/test/jeweler/commands/version/test_write.rb +22 -0
  148. data/test/jeweler/generator/test_application.rb +120 -0
  149. data/test/jeweler/generator/test_options.rb +225 -0
  150. data/test/jeweler/test_gemspec_helper.rb +44 -0
  151. data/test/jeweler/test_generator.rb +141 -0
  152. data/test/jeweler/test_generator_initialization.rb +164 -0
  153. data/test/jeweler/test_generator_mixins.rb +23 -0
  154. data/test/jeweler/test_specification.rb +237 -0
  155. data/test/jeweler/test_tasks.rb +50 -0
  156. data/test/jeweler/test_version_helper.rb +214 -0
  157. data/test/shoulda_macros/jeweler_macros.rb +35 -0
  158. data/test/test_helper.rb +178 -0
  159. data/test/test_jeweler.rb +175 -0
  160. metadata +343 -0
@@ -0,0 +1,7 @@
1
+ require 'helper'
2
+
3
+ class Test<%= constant_name %> < 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,10 @@
1
+ require 'rubygems'
2
+ <%= render_template 'bundler_setup.erb' %>
3
+ require 'test/unit'
4
+
5
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
6
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
7
+ require '<%= require_name %>'
8
+
9
+ class Test::Unit::TestCase
10
+ end
@@ -0,0 +1,10 @@
1
+ class Jeweler
2
+ module Version
3
+ MAJOR = 2
4
+ MINOR = 0
5
+ PATCH = 0
6
+ BUILD = nil
7
+
8
+ STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
9
+ end
10
+ end
@@ -0,0 +1,141 @@
1
+ begin
2
+ require 'psych'
3
+ rescue ::LoadError
4
+ end
5
+
6
+ require 'yaml'
7
+
8
+ class Jeweler
9
+ class VersionHelper
10
+ attr_accessor :base_dir
11
+ attr_reader :major, :minor, :patch, :build
12
+
13
+ module YamlExtension
14
+ def write
15
+ File.open(yaml_path, 'w+') do |f|
16
+ YAML.dump(self.to_hash, f)
17
+ end
18
+ end
19
+
20
+ def to_hash
21
+ {
22
+ :major => major,
23
+ :minor => minor,
24
+ :patch => patch,
25
+ :build => build
26
+ }
27
+ end
28
+
29
+ def refresh
30
+ parse_yaml
31
+ end
32
+
33
+ def parse_yaml
34
+ yaml = read_yaml
35
+ @major = (yaml['major'] || yaml[:major]).to_i
36
+ @minor = (yaml['minor'] || yaml[:minor]).to_i
37
+ @patch = (yaml['patch'] || yaml[:patch]).to_i
38
+ @build = (yaml['build'] || yaml[:build])
39
+ end
40
+
41
+ def read_yaml
42
+ if File.exists?(yaml_path)
43
+ YAML.load_file(yaml_path)
44
+ else
45
+ raise VersionYmlError, "#{yaml_path} does not exist!"
46
+ end
47
+ end
48
+
49
+ def path
50
+ yaml_path
51
+ end
52
+ end
53
+
54
+ module PlaintextExtension
55
+ def write
56
+ File.open(plaintext_path, 'w') do |file|
57
+ file.write to_s
58
+ end
59
+ end
60
+
61
+ def parse_plaintext
62
+ plaintext = read_plaintext.chomp
63
+ # http://rubular.com/regexes/10467 -> 3.5.4.a1
64
+ # http://rubular.com/regexes/10468 -> 3.5.4
65
+ if plaintext =~ /^(\d+)\.(\d+)\.(\d+)(?:\.(.*?))?$/
66
+ @major = $1.to_i
67
+ @minor = $2.to_i
68
+ @patch = $3.to_i
69
+ @build = $4
70
+ end
71
+ end
72
+
73
+ def read_plaintext
74
+ File.read(plaintext_path)
75
+ end
76
+
77
+ def refresh
78
+ parse_plaintext
79
+ end
80
+
81
+ def path
82
+ plaintext_path
83
+ end
84
+ end
85
+
86
+ def initialize(base_dir)
87
+ self.base_dir = base_dir
88
+
89
+ if File.exists?(yaml_path)
90
+ extend YamlExtension
91
+ parse_yaml
92
+ else
93
+ extend PlaintextExtension
94
+ if File.exists?(plaintext_path)
95
+ parse_plaintext
96
+ end
97
+ end
98
+ end
99
+
100
+ def bump_major
101
+ @major += 1
102
+ @minor = 0
103
+ @patch = 0
104
+ @build = nil
105
+ end
106
+
107
+ def bump_minor
108
+ @minor += 1
109
+ @patch = 0
110
+ @build = nil
111
+ end
112
+
113
+ def bump_patch
114
+ @patch += 1
115
+ @build = nil
116
+ end
117
+
118
+ def update_to(major, minor, patch, build=nil)
119
+ @major = major
120
+ @minor = minor
121
+ @patch = patch
122
+ @build = build
123
+ end
124
+
125
+ def to_s
126
+ [major, minor, patch, build].compact.join('.')
127
+ end
128
+
129
+ def yaml_path
130
+ denormalized_path = File.join(@base_dir, 'VERSION.yml')
131
+ absolute_path = File.expand_path(denormalized_path)
132
+ absolute_path.gsub(Dir.getwd + File::SEPARATOR, '')
133
+ end
134
+
135
+ def plaintext_path
136
+ denormalized_path = File.join(@base_dir, 'VERSION')
137
+ absolute_path = File.expand_path(denormalized_path)
138
+ absolute_path.gsub(Dir.getwd + File::SEPARATOR, '')
139
+ end
140
+ end
141
+ end
data/lib/jeweler.rb ADDED
@@ -0,0 +1,177 @@
1
+ require 'pathname'
2
+ require 'date'
3
+ require_relative 'jeweler/version'
4
+
5
+ # A Jeweler helps you craft the perfect Rubygem. Give him a gemspec, and he takes care of the rest.
6
+ #
7
+ # See Jeweler::Tasks for examples of how to get started. Additionally, resources are available on the wiki:
8
+ #
9
+ # * http://wiki.github.com/technicalpickles/jeweler/create-a-new-project
10
+ # * http://wiki.github.com/technicalpickles/jeweler/configure-an-existing-project
11
+ class Jeweler
12
+ require_relative 'jeweler/errors'
13
+ require 'rubygems/user_interaction'
14
+
15
+ require_relative 'jeweler/generator'
16
+
17
+ require_relative 'jeweler/commands'
18
+
19
+ require_relative 'jeweler/version_helper'
20
+ require_relative 'jeweler/gemspec_helper'
21
+
22
+ require_relative 'jeweler/tasks'
23
+ require_relative 'jeweler/rubygems_dot_org_tasks'
24
+ require_relative 'jeweler/gemcutter_tasks'
25
+ require_relative 'jeweler/rubyforge_tasks'
26
+ require_relative 'jeweler/specification'
27
+
28
+ attr_reader :gemspec, :gemspec_helper, :version_helper
29
+ attr_accessor :base_dir, :output, :repo, :commit
30
+
31
+ def initialize(gemspec, base_dir = '.')
32
+ raise(GemspecError, "Can't create a Jeweler with a nil gemspec") if gemspec.nil?
33
+
34
+ @gemspec = gemspec
35
+ @gemspec.extend(Specification)
36
+ @gemspec.set_jeweler_defaults(base_dir, git_base_dir)
37
+
38
+ @base_dir = base_dir
39
+ @repo = Git.open(git_base_dir) if in_git_repo?
40
+ @version_helper = Jeweler::VersionHelper.new(base_dir)
41
+ @output = $stdout
42
+ @commit = true
43
+ @gemspec_helper = GemSpecHelper.new(gemspec, base_dir)
44
+ end
45
+
46
+ # Major version, as defined by the gemspec's Version module.
47
+ # For 1.5.3, this would return 1.
48
+ def major_version
49
+ @version_helper.major
50
+ end
51
+
52
+ # Minor version, as defined by the gemspec's Version module.
53
+ # For 1.5.3, this would return 5.
54
+ def minor_version
55
+ @version_helper.minor
56
+ end
57
+
58
+ # Patch version, as defined by the gemspec's Version module.
59
+ # For 1.5.3, this would return 5.
60
+ def patch_version
61
+ @version_helper.patch
62
+ end
63
+
64
+ # Human readable version, which is used in the gemspec.
65
+ def version
66
+ @gemspec.version || @version_helper.to_s
67
+ end
68
+
69
+ # Writes out the gemspec
70
+ def write_gemspec
71
+ Jeweler::Commands::WriteGemspec.build_for(self).run
72
+ end
73
+
74
+ # Validates the project's gemspec from disk in an environment similar to how
75
+ # GitHub would build from it. See http://gist.github.com/16215
76
+ def validate_gemspec
77
+ Jeweler::Commands::ValidateGemspec.build_for(self).run
78
+ end
79
+
80
+ # is the project's gemspec from disk valid?
81
+ def valid_gemspec?
82
+ gemspec_helper.valid?
83
+ end
84
+
85
+ # Build a gem using the project's latest Gem::Specification
86
+ def build_gem
87
+ Jeweler::Commands::BuildGem.build_for(self).run
88
+ end
89
+
90
+ # Install a previously built gem
91
+ def install_gem
92
+ Jeweler::Commands::InstallGem.build_for(self).run
93
+ end
94
+
95
+ # Bumps the patch version.
96
+ #
97
+ # 1.5.1 -> 1.5.2
98
+ def bump_patch_version()
99
+ Jeweler::Commands::Version::BumpPatch.build_for(self).run
100
+ end
101
+
102
+ # Bumps the minor version.
103
+ #
104
+ # 1.5.1 -> 1.6.0
105
+ def bump_minor_version()
106
+ Jeweler::Commands::Version::BumpMinor.build_for(self).run
107
+ end
108
+
109
+ # Bumps the major version.
110
+ #
111
+ # 1.5.1 -> 2.0.0
112
+ def bump_major_version()
113
+ Jeweler::Commands::Version::BumpMajor.build_for(self).run
114
+ end
115
+
116
+ # Bumps the version, to the specific major/minor/patch version, writing out the appropriate version.rb, and then reloads it.
117
+ def write_version(major, minor, patch, build, options = {})
118
+ command = Jeweler::Commands::Version::Write.build_for(self)
119
+ command.major = major
120
+ command.minor = minor
121
+ command.patch = patch
122
+ command.build = build
123
+
124
+ command.run
125
+ end
126
+
127
+ def release_gemspec
128
+ Jeweler::Commands::ReleaseGemspec.build_for(self).run
129
+ end
130
+
131
+ def release_to_git
132
+ Jeweler::Commands::ReleaseToGit.build_for(self).run
133
+ end
134
+
135
+ def release_gem_to_rubygems
136
+ Jeweler::Commands::ReleaseToRubygems.build_for(self).run
137
+ end
138
+
139
+ def release_gem_to_rubyforge
140
+ # no-op
141
+ end
142
+
143
+ def setup_rubyforge
144
+ # no-op
145
+ end
146
+
147
+ def check_dependencies(type = nil)
148
+ command = Jeweler::Commands::CheckDependencies.build_for(self)
149
+ command.type = type
150
+
151
+ command.run
152
+ end
153
+
154
+ def git_base_dir(base_dir = nil)
155
+ if base_dir
156
+ base_dir = File.dirname(base_dir)
157
+ else
158
+ base_dir = File.expand_path(self.base_dir || ".")
159
+ end
160
+ return nil if base_dir==File.dirname("/")
161
+ return base_dir if File.exists?(File.join(base_dir, '.git'))
162
+ return git_base_dir(base_dir)
163
+ end
164
+
165
+ def in_git_repo?
166
+ git_base_dir
167
+ end
168
+
169
+ def version_file_exists?
170
+ File.exists?(@version_helper.plaintext_path) || File.exists?(@version_helper.yaml_path)
171
+ end
172
+
173
+ def expects_version_file?
174
+ gemspec.version.nil?
175
+ end
176
+
177
+ end
@@ -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,85 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+
4
+ begin
5
+ require 'jeweler'
6
+ Jeweler::Tasks.new do |gem|
7
+ gem.version = "1.0.0"
8
+ gem.name = "existing-project-with-version"
9
+ gem.summary = %Q{Summarize your gem}
10
+ gem.email = "josh@technicalpickles.com"
11
+ gem.homepage = "http://github.com/technicalpickles/existing-project-with-version"
12
+ gem.authors = ["Josh Nichols"]
13
+ # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
14
+ end
15
+ rescue LoadError
16
+ puts "Jeweler not available. Install it with: gem install technicalpickles-jeweler -s http://gems.github.com"
17
+ end
18
+
19
+ require 'rake/testtask'
20
+ Rake::TestTask.new(:test) do |test|
21
+ test.libs << 'lib' << 'test'
22
+ test.pattern = 'test/**/*_test.rb'
23
+ test.verbose = false
24
+ end
25
+
26
+ begin
27
+ require 'rcov/rcovtask'
28
+ Rcov::RcovTask.new do |test|
29
+ test.libs << 'test'
30
+ test.pattern = 'test/**/*_test.rb'
31
+ test.verbose = true
32
+ end
33
+ rescue LoadError
34
+ task :rcov do
35
+ abort "RCov is not available. In order to run rcov, you must: gem install spicycode-rcov"
36
+ end
37
+ end
38
+
39
+
40
+ task :default => :test
41
+
42
+ require 'rake/rdoctask'
43
+ Rake::RDocTask.new do |rdoc|
44
+ if File.exist?('VERSION.yml')
45
+ require 'yaml'
46
+ config = YAML.load(File.read('VERSION.yml'))
47
+ version = "#{config[:major]}.#{config[:minor]}.#{config[:patch]}"
48
+ else
49
+ version = ""
50
+ end
51
+
52
+ rdoc.rdoc_dir = 'rdoc'
53
+ rdoc.title = "existing-project-with-version #{version}"
54
+ rdoc.options << '--line-numbers' << '--inline-source'
55
+ rdoc.rdoc_files.include('README*')
56
+ rdoc.rdoc_files.include('lib/**/*.rb')
57
+ end
58
+
59
+ # Rubyforge documentation task
60
+ begin
61
+ require 'rake/contrib/sshpublisher'
62
+ namespace :rubyforge do
63
+
64
+ desc "Release gem and RDoc documentation to RubyForge"
65
+ task :release => ["rubyforge:release:gem", "rubyforge:release:docs"]
66
+
67
+ namespace :release do
68
+ desc "Publish RDoc to RubyForge."
69
+ task :docs => [:rdoc] do
70
+ require 'yaml'
71
+ config = YAML.load(
72
+ File.read(File.expand_path('~/.rubyforge/user-config.yml'))
73
+ )
74
+
75
+ host = "#{config['username']}@rubyforge.org"
76
+ remote_dir = "/var/www/gforge-projects/existing-project-with-version/"
77
+ local_dir = 'rdoc'
78
+
79
+ Rake::SshDirPublisher.new(host, remote_dir, local_dir).upload
80
+ end
81
+ end
82
+ end
83
+ rescue LoadError
84
+ puts "Rake SshDirPublisher is unavailable or your rubyforge environment is not configured."
85
+ 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{Summarize your gem}
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.
@@ -0,0 +1,84 @@
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{Summarize your gem}
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: 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: 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
+ require 'yaml'
45
+ config = YAML.load(File.read('VERSION.yml'))
46
+ version = "#{config[:major]}.#{config[:minor]}.#{config[:patch]}"
47
+ else
48
+ version = ""
49
+ end
50
+
51
+ rdoc.rdoc_dir = 'rdoc'
52
+ rdoc.title = "existing-project-with-version #{version}"
53
+ rdoc.options << '--line-numbers' << '--inline-source'
54
+ rdoc.rdoc_files.include('README*')
55
+ rdoc.rdoc_files.include('lib/**/*.rb')
56
+ end
57
+
58
+ # Rubyforge documentation task
59
+ begin
60
+ require 'rake/contrib/sshpublisher'
61
+ namespace :rubyforge do
62
+
63
+ desc "Release gem and RDoc documentation to RubyForge"
64
+ task :release => ["rubyforge:release:gem", "rubyforge:release:docs"]
65
+
66
+ namespace :release do
67
+ desc "Publish RDoc to RubyForge."
68
+ task :docs => [:rdoc] do
69
+ require 'yaml'
70
+ config = YAML.load(
71
+ File.read(File.expand_path('~/.rubyforge/user-config.yml'))
72
+ )
73
+
74
+ host = "#{config['username']}@rubyforge.org"
75
+ remote_dir = "/var/www/gforge-projects/existing-project-with-version/"
76
+ local_dir = 'rdoc'
77
+
78
+ Rake::SshDirPublisher.new(host, remote_dir, local_dir).upload
79
+ end
80
+ end
81
+ end
82
+ rescue LoadError
83
+ puts "Rake SshDirPublisher is unavailable or your rubyforge environment is not configured."
84
+ end