hoe-bundler 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,31 +5,49 @@ class Hoe #:nodoc:
5
5
  # * <tt>bundler:gemfile</tt>
6
6
  #
7
7
  module Bundler
8
- VERSION = "1.1.0" #:nodoc:
8
+ VERSION = "1.2.0" #:nodoc:
9
9
 
10
10
  def define_bundler_tasks
11
11
  desc "generate a bundler Gemfile from your Hoe.spec dependencies"
12
12
  task "bundler:gemfile" do
13
13
  File.open("Gemfile","w") do |gemfile|
14
- gemfile.puts "# -*- ruby -*-"
15
- gemfile.puts
16
- gemfile.puts "# DO NOT EDIT THIS FILE. Instead, edit Rakefile, and run `rake bundler:gemfile`."
17
- gemfile.puts
18
- gemfile.puts "source :gemcutter"
19
- gemfile.puts
20
- self.extra_deps.each do |name, version|
21
- version ||= ">=0"
22
- gemfile.puts %Q{gem "#{name}", "#{version.gsub(/ /,'')}"}
23
- end
24
- gemfile.puts
25
- self.extra_dev_deps.each do |name, version|
26
- version ||= ">=0"
27
- gemfile.puts %Q{gem "#{name}", "#{version.gsub(/ /,'')}", :group => [:development, :test]}
28
- end
29
- gemfile.puts
30
- gemfile.puts "# vim: syntax=ruby"
14
+ gemfile.print hoe_bundler_contents
31
15
  end
32
16
  end
33
17
  end
18
+
19
+ def hoe_bundler_contents
20
+ gemfile = StringIO.new
21
+ gemfile.puts "# -*- ruby -*-"
22
+ gemfile.puts
23
+ gemfile.puts "# DO NOT EDIT THIS FILE. Instead, edit Rakefile, and run `rake bundler:gemfile`."
24
+ gemfile.puts
25
+ gemfile.puts "source \"https://rubygems.org/\""
26
+ gemfile.puts
27
+
28
+ extra_deps = {}
29
+ self.extra_deps.each do |name, version|
30
+ version ||= ">=0"
31
+ extra_deps[name] = version unless extra_deps.key?(name)
32
+ end
33
+ extra_deps.each do |name, version|
34
+ gemfile.puts %Q{gem "#{name}", "#{version.gsub(/ /,'')}"}
35
+ end
36
+ gemfile.puts
37
+
38
+ extra_dev_deps = {}
39
+ self.extra_dev_deps.each do |name, version|
40
+ version ||= ">=0"
41
+ extra_dev_deps[name] = version unless extra_dev_deps.key?(name)
42
+ end
43
+ extra_dev_deps.each do |name, version|
44
+ gemfile.puts %Q{gem "#{name}", "#{version.gsub(/ /,'')}", :group => [:development, :test]}
45
+ end
46
+ gemfile.puts
47
+ gemfile.puts "# vim: syntax=ruby"
48
+
49
+ gemfile.rewind
50
+ gemfile.read
51
+ end
34
52
  end
35
53
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  # DO NOT EDIT THIS FILE. Instead, edit Rakefile, and run `rake bundler:gemfile`.
4
4
 
5
- source :gemcutter
5
+ source "https://rubygems.org/"
6
6
 
7
7
  gem "xxx", ">=0"
8
8
  gem "yyy", ">=0"
@@ -11,6 +11,6 @@ gem "zzz", "<1.5.0"
11
11
  gem "aaa", ">=0", :group => [:development, :test]
12
12
  gem "bbb", ">=2.2.0", :group => [:development, :test]
13
13
  gem "ccc", ">=0", :group => [:development, :test]
14
- gem "hoe", ">=2.9.1", :group => [:development, :test]
14
+ gem "hoe", "~>2.12", :group => [:development, :test]
15
15
 
16
16
  # vim: syntax=ruby
@@ -1,6 +1,9 @@
1
1
  require "test/unit"
2
2
  require "fileutils"
3
3
 
4
+ require "hoe"
5
+ Hoe.plugin :bundler
6
+
4
7
  class TestHoeBundler < Test::Unit::TestCase
5
8
  def test_output
6
9
  gemfile = nil
@@ -14,14 +17,32 @@ class TestHoeBundler < Test::Unit::TestCase
14
17
 
15
18
  assert_match %r{^# -\*- ruby -\*-$}, gemfile
16
19
  assert_match %r{^# DO NOT EDIT THIS FILE. Instead, edit Rakefile, and run `rake bundler:gemfile`.}, gemfile
17
- assert_match %r{^source :gemcutter$}, gemfile
20
+ assert_match %r{^source "https://rubygems.org/"$}, gemfile
18
21
  assert_match %r{^gem "xxx", ">=0"$}, gemfile
19
22
  assert_match %r{^gem "yyy", ">=0"$}, gemfile
20
23
  assert_match %r{^gem "zzz", "<1.5.0"$}, gemfile
21
24
  assert_match %r{^gem "aaa", ">=0", :group => \[:development, :test\]$}, gemfile
22
25
  assert_match %r{^gem "bbb", ">=2.2.0", :group => \[:development, :test\]$}, gemfile
23
26
  assert_match %r{^gem "ccc", ">=0", :group => \[:development, :test\]$}, gemfile
24
- assert_match %r{^gem "hoe", ">=\d\.\d\.\d", :group => \[:development, :test\]$}, gemfile
27
+ assert_match %r{^gem "hoe", .* :group => \[:development, :test\]$}, gemfile
25
28
  assert_match %r{^# vim: syntax=ruby$}, gemfile
26
29
  end
30
+
31
+ def test_handles_duplicate_dependencies_like_gemspec
32
+ Dir.chdir(File.join(File.dirname(__FILE__), "fixture_project")) do
33
+ hoe = Hoe.spec "foo" do
34
+ developer("MCA","mca@example.com")
35
+ extra_deps << ["yyy", ">=0"]
36
+ extra_deps << ["yyy", ">=1"]
37
+ extra_dev_deps << ["bbb", ">= 1"]
38
+ extra_dev_deps << ["bbb", ">= 0"]
39
+ end
40
+
41
+ lines = hoe.hoe_bundler_contents.split("\n")
42
+ assert_equal 1, lines.grep(/yyy/).length
43
+ assert_match(/>=0/, lines.grep(/yyy/).first)
44
+ assert_equal 1, lines.grep(/bbb/).length
45
+ assert_match(/>=1/, lines.grep(/bbb/).first)
46
+ end
47
+ end
27
48
  end
metadata CHANGED
@@ -1,102 +1,74 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: hoe-bundler
3
- version: !ruby/object:Gem::Version
4
- hash: 19
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.2.0
5
5
  prerelease:
6
- segments:
7
- - 1
8
- - 1
9
- - 0
10
- version: 1.1.0
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Mike Dalessio
14
9
  autorequire:
15
10
  bindir: bin
16
- cert_chain:
17
- - |
18
- -----BEGIN CERTIFICATE-----
19
- MIIDPDCCAiSgAwIBAgIBADANBgkqhkiG9w0BAQUFADBEMRYwFAYDVQQDDA1taWtl
20
- LmRhbGVzc2lvMRUwEwYKCZImiZ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nTjy13J3nD30uxy9a1g==
37
- -----END CERTIFICATE-----
38
-
39
- date: 2011-03-20 00:00:00 -04:00
40
- default_executable:
41
- dependencies:
42
- - !ruby/object:Gem::Dependency
11
+ cert_chain: []
12
+ date: 2012-09-26 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
43
15
  name: hoe
44
- prerelease: false
45
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
46
17
  none: false
47
- requirements:
48
- - - ">="
49
- - !ruby/object:Gem::Version
50
- hash: 7
51
- segments:
52
- - 2
53
- - 2
54
- - 0
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
55
21
  version: 2.2.0
56
22
  type: :runtime
57
- version_requirements: *id001
58
- - !ruby/object:Gem::Dependency
59
- name: rake
60
23
  prerelease: false
61
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 2.2.0
30
+ - !ruby/object:Gem::Dependency
31
+ name: rdoc
32
+ requirement: !ruby/object:Gem::Requirement
62
33
  none: false
63
- requirements:
64
- - - ">="
65
- - !ruby/object:Gem::Version
66
- hash: 3
67
- segments:
68
- - 0
69
- version: "0"
34
+ requirements:
35
+ - - ~>
36
+ - !ruby/object:Gem::Version
37
+ version: '3.10'
70
38
  type: :development
71
- version_requirements: *id002
72
- - !ruby/object:Gem::Dependency
73
- name: hoe
74
39
  prerelease: false
75
- requirement: &id003 !ruby/object:Gem::Requirement
40
+ version_requirements: !ruby/object:Gem::Requirement
76
41
  none: false
77
- requirements:
78
- - - ">="
79
- - !ruby/object:Gem::Version
80
- hash: 41
81
- segments:
82
- - 2
83
- - 9
84
- - 1
85
- version: 2.9.1
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: '3.10'
46
+ - !ruby/object:Gem::Dependency
47
+ name: rake
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
86
54
  type: :development
87
- version_requirements: *id003
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
88
62
  description: Generate a Gemfile based on a Hoe spec's declared dependencies.
89
- email:
63
+ email:
90
64
  - mike.dalessio@gmail.com
91
65
  executables: []
92
-
93
66
  extensions: []
94
-
95
- extra_rdoc_files:
96
- - Manifest.txt
67
+ extra_rdoc_files:
97
68
  - CHANGELOG.rdoc
69
+ - Manifest.txt
98
70
  - README.rdoc
99
- files:
71
+ files:
100
72
  - .autotest
101
73
  - CHANGELOG.rdoc
102
74
  - Manifest.txt
@@ -112,40 +84,31 @@ files:
112
84
  - test/fixture_project/test/test_fixture_project.rb
113
85
  - test/test_hoe_bundler.rb
114
86
  - .gemtest
115
- has_rdoc: true
116
87
  homepage: http://github.com/flavorjones/hoe-bundler
117
88
  licenses: []
118
-
119
89
  post_install_message:
120
- rdoc_options:
90
+ rdoc_options:
121
91
  - --main
122
92
  - README.rdoc
123
- require_paths:
93
+ require_paths:
124
94
  - lib
125
- required_ruby_version: !ruby/object:Gem::Requirement
95
+ required_ruby_version: !ruby/object:Gem::Requirement
126
96
  none: false
127
- requirements:
128
- - - ">="
129
- - !ruby/object:Gem::Version
130
- hash: 3
131
- segments:
132
- - 0
133
- version: "0"
134
- required_rubygems_version: !ruby/object:Gem::Requirement
97
+ requirements:
98
+ - - ! '>='
99
+ - !ruby/object:Gem::Version
100
+ version: '0'
101
+ required_rubygems_version: !ruby/object:Gem::Requirement
135
102
  none: false
136
- requirements:
137
- - - ">="
138
- - !ruby/object:Gem::Version
139
- hash: 3
140
- segments:
141
- - 0
142
- version: "0"
103
+ requirements:
104
+ - - ! '>='
105
+ - !ruby/object:Gem::Version
106
+ version: '0'
143
107
  requirements: []
144
-
145
108
  rubyforge_project: hoe-bundler
146
- rubygems_version: 1.6.0
109
+ rubygems_version: 1.8.24
147
110
  signing_key:
148
111
  specification_version: 3
149
112
  summary: Generate a Gemfile based on a Hoe spec's declared dependencies.
150
- test_files:
113
+ test_files:
151
114
  - test/test_hoe_bundler.rb
data.tar.gz.sig DELETED
Binary file
metadata.gz.sig DELETED
@@ -1,2 +0,0 @@
1
- 1�m�g!}B�M�"�ݖ�is�[i%��<hd��+���0���*Sp����QE�T�B�p(����;�]��=��Z0<�,h�� ���� ��f>��.���Knq��E_c;(�����T�gj&�$�t�&��B�jC&2>6S�˺��`
2
- ������,��S����#�U�f;�