hoe-bundler 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,23 @@
1
+ # -*- ruby -*-
2
+
3
+ require 'autotest/restart'
4
+
5
+ # Autotest.add_hook :initialize do |at|
6
+ # at.extra_files << "../some/external/dependency.rb"
7
+ #
8
+ # at.libs << ":../some/external"
9
+ #
10
+ # at.add_exception 'vendor'
11
+ #
12
+ # at.add_mapping(/dependency.rb/) do |f, _|
13
+ # at.files_matching(/test_.*rb$/)
14
+ # end
15
+ #
16
+ # %w(TestA TestB).each do |klass|
17
+ # at.extra_class_map[klass] = "test/test_misc.rb"
18
+ # end
19
+ # end
20
+
21
+ # Autotest.add_hook :run_command do |at|
22
+ # system "rake build"
23
+ # end
@@ -0,0 +1,6 @@
1
+ === 1.0.0 / 2010-07-21
2
+
3
+ * 1 major enhancement
4
+
5
+ * Birthday!
6
+
@@ -0,0 +1,14 @@
1
+ .autotest
2
+ CHANGELOG.rdoc
3
+ Manifest.txt
4
+ README.rdoc
5
+ Rakefile
6
+ lib/hoe/bundler.rb
7
+ test/fixture_project/Gemfile
8
+ test/fixture_project/History.txt
9
+ test/fixture_project/Manifest.txt
10
+ test/fixture_project/README.txt
11
+ test/fixture_project/Rakefile
12
+ test/fixture_project/lib/fixture_project.rb
13
+ test/fixture_project/test/test_fixture_project.rb
14
+ test/test_hoe_bundler.rb
@@ -0,0 +1,61 @@
1
+ = hoe-bundler
2
+
3
+ * http://github.com/flavorjones/hoe-bundler
4
+
5
+ == DESCRIPTION:
6
+
7
+ Generate a Gemfile based on a Hoe spec's declared dependencies.
8
+
9
+ == FEATURES/PROBLEMS:
10
+
11
+ Creates a rake task to generate a bundler Gemfile based on your declared hoe dependencies.
12
+
13
+ * `bundler:gemfile`
14
+
15
+ Why would you want to do this? I mean, why would anyone want to use bundler to test their gem?
16
+
17
+ * to make sure you've declared all your dependencies in your Hoe.spec.
18
+ * to make sure you're testing against the exact versions of dependencies that you're claiming in your Hoe.spec.
19
+
20
+ == SYNOPSIS:
21
+
22
+ Just add the following line to your Rakefile before you call `Hoe.spec`:
23
+
24
+ Hoe.plugin :bundler
25
+
26
+ And then run the following command to generate a Gemfile:
27
+
28
+ rake bundler:gemfile
29
+
30
+ == REQUIREMENTS:
31
+
32
+ * hoe >= 2.2.0
33
+
34
+ == INSTALL:
35
+
36
+ * gem install hoe-bundler
37
+
38
+ == LICENSE:
39
+
40
+ (The MIT License)
41
+
42
+ Copyright (c) 2010 Mike Dalessio
43
+
44
+ Permission is hereby granted, free of charge, to any person obtaining
45
+ a copy of this software and associated documentation files (the
46
+ 'Software'), to deal in the Software without restriction, including
47
+ without limitation the rights to use, copy, modify, merge, publish,
48
+ distribute, sublicense, and/or sell copies of the Software, and to
49
+ permit persons to whom the Software is furnished to do so, subject to
50
+ the following conditions:
51
+
52
+ The above copyright notice and this permission notice shall be
53
+ included in all copies or substantial portions of the Software.
54
+
55
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
56
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
57
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
58
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
59
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
60
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
61
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,20 @@
1
+ # -*- ruby -*-
2
+
3
+ require 'rubygems'
4
+ require 'hoe'
5
+
6
+ Hoe.plugin :git
7
+
8
+ Hoe.spec 'hoe-bundler' do
9
+ developer('Mike Dalessio', 'mike.dalessio@gmail.com')
10
+
11
+ self.extra_rdoc_files = FileList["*.rdoc"]
12
+ self.history_file = "CHANGELOG.rdoc"
13
+ self.readme_file = "README.rdoc"
14
+ self.test_globs = ["test/test_*.rb"]
15
+
16
+ extra_deps << ["hoe", ">=2.2.0"]
17
+ extra_dev_deps << ["rake", ">=0"]
18
+ end
19
+
20
+ # vim: syntax=ruby
@@ -0,0 +1,31 @@
1
+ class Hoe #:nodoc:
2
+ #
3
+ # Rake task to generate a bundler Gemfile based on your declared hoe dependencies.
4
+ #
5
+ # * <tt>bundler:gemfile</tt>
6
+ #
7
+ module Bundler
8
+ VERSION = "1.0.0" #:nodoc:
9
+
10
+ def define_bundler_tasks
11
+ desc "generate a bundler Gemfile from your Hoe.spec dependencies"
12
+ task "bundler:gemfile" do
13
+ File.open("Gemfile","w") do |gemfile|
14
+ gemfile.puts "# -*- ruby -*-"
15
+ gemfile.puts
16
+ gemfile.puts "source :gemcutter"
17
+ gemfile.puts
18
+ self.extra_deps.each do |name, version|
19
+ gemfile.puts %Q{gem "#{name}", "#{version.gsub(/ /,'')}"}
20
+ end
21
+ gemfile.puts
22
+ self.extra_dev_deps.each do |name, version|
23
+ gemfile.puts %Q{gem "#{name}", "#{version.gsub(/ /,'')}", :group => [:development, :test]}
24
+ end
25
+ gemfile.puts
26
+ gemfile.puts "# vim: syntax=ruby"
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,13 @@
1
+ # -*- ruby -*-
2
+
3
+ source :gemcutter
4
+
5
+ gem "yyy", ">=0"
6
+ gem "zzz", "<1.5.0"
7
+
8
+ gem "rubyforge", ">=2.0.4", :group => [:development, :test]
9
+ gem "aaa", ">=0", :group => [:development, :test]
10
+ gem "bbb", ">=2.2.0", :group => [:development, :test]
11
+ gem "hoe", ">=2.6.1", :group => [:development, :test]
12
+
13
+ # vim: syntax=ruby
@@ -0,0 +1,6 @@
1
+ === 1.0.0 / 2010-07-21
2
+
3
+ * 1 major enhancement
4
+
5
+ * Birthday!
6
+
@@ -0,0 +1,8 @@
1
+ .autotest
2
+ History.txt
3
+ Manifest.txt
4
+ README.txt
5
+ Rakefile
6
+ bin/fixture_project
7
+ lib/fixture_project.rb
8
+ test/test_fixture_project.rb
@@ -0,0 +1,57 @@
1
+ = fixture_project
2
+
3
+ * FIX (url)
4
+
5
+ == DESCRIPTION:
6
+
7
+ FIX (describe your package)
8
+
9
+ == FEATURES/PROBLEMS:
10
+
11
+ * FIX (list of features or problems)
12
+
13
+ == SYNOPSIS:
14
+
15
+ FIX (code sample of usage)
16
+
17
+ == REQUIREMENTS:
18
+
19
+ * FIX (list of requirements)
20
+
21
+ == INSTALL:
22
+
23
+ * FIX (sudo gem install, anything else)
24
+
25
+ == DEVELOPERS:
26
+
27
+ After checking out the source, run:
28
+
29
+ $ rake newb
30
+
31
+ This task will install any missing dependencies, run the tests/specs,
32
+ and generate the RDoc.
33
+
34
+ == LICENSE:
35
+
36
+ (The MIT License)
37
+
38
+ Copyright (c) 2010 FIX
39
+
40
+ Permission is hereby granted, free of charge, to any person obtaining
41
+ a copy of this software and associated documentation files (the
42
+ 'Software'), to deal in the Software without restriction, including
43
+ without limitation the rights to use, copy, modify, merge, publish,
44
+ distribute, sublicense, and/or sell copies of the Software, and to
45
+ permit persons to whom the Software is furnished to do so, subject to
46
+ the following conditions:
47
+
48
+ The above copyright notice and this permission notice shall be
49
+ included in all copies or substantial portions of the Software.
50
+
51
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
52
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
53
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
54
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
55
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
56
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
57
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,11 @@
1
+ require 'rubygems'
2
+ require 'hoe'
3
+ $: << File.expand_path(File.join(File.dirname(__FILE__),"../../lib"))
4
+ Hoe.plugin :bundler
5
+ Hoe.spec "fixture_project" do
6
+ developer("MCA","mca@example.com")
7
+ extra_deps << ["yyy", ">=0"]
8
+ extra_deps << ["zzz", "< 1.5.0"]
9
+ extra_dev_deps << ["aaa", ">=0"]
10
+ extra_dev_deps << ["bbb", ">= 2.2.0"]
11
+ end
@@ -0,0 +1,3 @@
1
+ class FixtureProject
2
+ VERSION = '1.0.0'
3
+ end
@@ -0,0 +1,8 @@
1
+ require "test/unit"
2
+ require "fixture_project"
3
+
4
+ class TestFixtureProject < Test::Unit::TestCase
5
+ def test_sanity
6
+ flunk "write tests or I will kneecap you"
7
+ end
8
+ end
@@ -0,0 +1,24 @@
1
+ require "test/unit"
2
+ require "fileutils"
3
+
4
+ class TestHoeBundler < Test::Unit::TestCase
5
+ def test_output
6
+ gemfile = nil
7
+ Dir.chdir(File.join(File.dirname(__FILE__), "fixture_project")) do
8
+ FileUtils.rm_f "Gemfile"
9
+ begin
10
+ system "rake bundler:gemfile"
11
+ gemfile = File.read "Gemfile"
12
+ end
13
+ end
14
+
15
+ assert_match %r{^# -\*- ruby -\*-$}, gemfile
16
+ assert_match %r{^source :gemcutter$}, gemfile
17
+ assert_match %r{^gem "yyy", ">=0"$}, gemfile
18
+ assert_match %r{^gem "zzz", "<1.5.0"$}, gemfile
19
+ assert_match %r{^gem "aaa", ">=0", :group => \[:development, :test\]$}, gemfile
20
+ assert_match %r{^gem "bbb", ">=2.2.0", :group => \[:development, :test\]$}, gemfile
21
+ assert_match %r{^gem "hoe", ">=\d\.\d\.\d", :group => \[:development, :test\]$}, gemfile
22
+ assert_match %r{^# vim: syntax=ruby$}, gemfile
23
+ end
24
+ end
metadata ADDED
@@ -0,0 +1,145 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: hoe-bundler
3
+ version: !ruby/object:Gem::Version
4
+ hash: 23
5
+ prerelease: false
6
+ segments:
7
+ - 1
8
+ - 0
9
+ - 0
10
+ version: 1.0.0
11
+ platform: ruby
12
+ authors:
13
+ - Mike Dalessio
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2010-07-21 00:00:00 -04:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: hoe
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ hash: 7
30
+ segments:
31
+ - 2
32
+ - 2
33
+ - 0
34
+ version: 2.2.0
35
+ type: :runtime
36
+ version_requirements: *id001
37
+ - !ruby/object:Gem::Dependency
38
+ name: rubyforge
39
+ prerelease: false
40
+ requirement: &id002 !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ hash: 7
46
+ segments:
47
+ - 2
48
+ - 0
49
+ - 4
50
+ version: 2.0.4
51
+ type: :development
52
+ version_requirements: *id002
53
+ - !ruby/object:Gem::Dependency
54
+ name: rake
55
+ prerelease: false
56
+ requirement: &id003 !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ hash: 3
62
+ segments:
63
+ - 0
64
+ version: "0"
65
+ type: :development
66
+ version_requirements: *id003
67
+ - !ruby/object:Gem::Dependency
68
+ name: hoe
69
+ prerelease: false
70
+ requirement: &id004 !ruby/object:Gem::Requirement
71
+ none: false
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ hash: 21
76
+ segments:
77
+ - 2
78
+ - 6
79
+ - 1
80
+ version: 2.6.1
81
+ type: :development
82
+ version_requirements: *id004
83
+ description: Generate a Gemfile based on a Hoe spec's declared dependencies.
84
+ email:
85
+ - mike.dalessio@gmail.com
86
+ executables: []
87
+
88
+ extensions: []
89
+
90
+ extra_rdoc_files:
91
+ - Manifest.txt
92
+ - CHANGELOG.rdoc
93
+ - README.rdoc
94
+ files:
95
+ - .autotest
96
+ - CHANGELOG.rdoc
97
+ - Manifest.txt
98
+ - README.rdoc
99
+ - Rakefile
100
+ - lib/hoe/bundler.rb
101
+ - test/fixture_project/Gemfile
102
+ - test/fixture_project/History.txt
103
+ - test/fixture_project/Manifest.txt
104
+ - test/fixture_project/README.txt
105
+ - test/fixture_project/Rakefile
106
+ - test/fixture_project/lib/fixture_project.rb
107
+ - test/fixture_project/test/test_fixture_project.rb
108
+ - test/test_hoe_bundler.rb
109
+ has_rdoc: true
110
+ homepage: http://github.com/flavorjones/hoe-bundler
111
+ licenses: []
112
+
113
+ post_install_message:
114
+ rdoc_options:
115
+ - --main
116
+ - README.rdoc
117
+ require_paths:
118
+ - lib
119
+ required_ruby_version: !ruby/object:Gem::Requirement
120
+ none: false
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ hash: 3
125
+ segments:
126
+ - 0
127
+ version: "0"
128
+ required_rubygems_version: !ruby/object:Gem::Requirement
129
+ none: false
130
+ requirements:
131
+ - - ">="
132
+ - !ruby/object:Gem::Version
133
+ hash: 3
134
+ segments:
135
+ - 0
136
+ version: "0"
137
+ requirements: []
138
+
139
+ rubyforge_project: hoe-bundler
140
+ rubygems_version: 1.3.7
141
+ signing_key:
142
+ specification_version: 3
143
+ summary: Generate a Gemfile based on a Hoe spec's declared dependencies.
144
+ test_files:
145
+ - test/test_hoe_bundler.rb