hen 0.4.6 → 0.4.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 4386f412e1f6442e3932176d2ded0ce75ca29089
4
+ data.tar.gz: 40c21cef3077fe57135618443199aa3146eb843c
5
+ SHA512:
6
+ metadata.gz: a8073e2e200bb5a8488d49011ddeb0f43701d94fcc1c0af647bd463a8cbe717246b229d5bf198426a53c0c63a192913462fc5fdb0a9f40da1f51d237fd38652d
7
+ data.tar.gz: 6b2c7e07c05a87081cf1f66441fb79e99f5d78d73d69b0c81cab40feb1366564004a624773e09152b26502b5d5587f54d2b8be42d09ace8f7fa5e91b1b180fe6
data/ChangeLog CHANGED
@@ -1,5 +1,9 @@
1
1
  = Revision history for hen
2
2
 
3
+ == 0.4.7 [unreleased]
4
+
5
+ * Optionally specify Git remote with environment variable +HEN_REMOTE+.
6
+
3
7
  == 0.4.6 [2012-04-05]
4
8
 
5
9
  * Fixed `hen version`.
data/README CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  == VERSION
4
4
 
5
- This documentation refers to hen version 0.4.6
5
+ This documentation refers to hen version 0.4.7
6
6
 
7
7
 
8
8
  == DESCRIPTION
@@ -66,7 +66,7 @@ RubyGem:: <http://rubygems.org/gems/hen>
66
66
 
67
67
  == AUTHORS
68
68
 
69
- * Jens Wille <mailto:jens.wille@uni-koeln.de>
69
+ * Jens Wille <mailto:jens.wille@gmail.com>
70
70
 
71
71
 
72
72
  == LICENSE AND COPYRIGHT
@@ -74,6 +74,8 @@ RubyGem:: <http://rubygems.org/gems/hen>
74
74
  Copyright (C) 2007-2012 University of Cologne,
75
75
  Albertus-Magnus-Platz, 50923 Cologne, Germany
76
76
 
77
+ Copyright (C) 2013 Jens Wille
78
+
77
79
  hen is free software: you can redistribute it and/or modify it under the
78
80
  terms of the GNU Affero General Public License as published by the Free
79
81
  Software Foundation, either version 3 of the License, or (at your option)
data/Rakefile CHANGED
@@ -13,7 +13,7 @@ Hen.lay! {{
13
13
  :summary => "Hoe or Echoe? No, thanks! Just a Rake " <<
14
14
  "helper that fits my own personal style.",
15
15
  :author => %q{Jens Wille},
16
- :email => %q{jens.wille@uni-koeln.de},
16
+ :email => %q{jens.wille@gmail.com},
17
17
  :extra_files => FileList['lib/hens/*.rake'].to_a,
18
18
  :dependencies => [['ruby-nuggets', '>= 0.8.4'], 'highline']
19
19
  }
data/bin/hen CHANGED
@@ -5,12 +5,14 @@
5
5
  # #
6
6
  # hen -- Just a Rake helper #
7
7
  # #
8
- # Copyright (C) 2007-2011 University of Cologne, #
8
+ # Copyright (C) 2007-2012 University of Cologne, #
9
9
  # Albertus-Magnus-Platz, #
10
10
  # 50923 Cologne, Germany #
11
11
  # #
12
+ # Copyright (C) 2013 Jens Wille #
13
+ # #
12
14
  # Authors: #
13
- # Jens Wille <jens.wille@uni-koeln.de> #
15
+ # Jens Wille <jens.wille@gmail.com> #
14
16
  # #
15
17
  # hen is free software; you can redistribute it and/or modify it under the #
16
18
  # terms of the GNU Affero General Public License as published by the Free #
data/lib/hen.rb CHANGED
@@ -3,12 +3,14 @@
3
3
  # #
4
4
  # hen -- Just a Rake helper #
5
5
  # #
6
- # Copyright (C) 2007-2011 University of Cologne, #
6
+ # Copyright (C) 2007-2012 University of Cologne, #
7
7
  # Albertus-Magnus-Platz, #
8
8
  # 50923 Cologne, Germany #
9
9
  # #
10
+ # Copyright (C) 2013 Jens Wille #
11
+ # #
10
12
  # Authors: #
11
- # Jens Wille <jens.wille@uni-koeln.de> #
13
+ # Jens Wille <jens.wille@gmail.com> #
12
14
  # #
13
15
  # hen is free software; you can redistribute it and/or modify it under the #
14
16
  # terms of the GNU Affero General Public License as published by the Free #
@@ -7,8 +7,10 @@
7
7
  # Albertus-Magnus-Platz, #
8
8
  # 50923 Cologne, Germany #
9
9
  # #
10
+ # Copyright (C) 2013 Jens Wille #
11
+ # #
10
12
  # Authors: #
11
- # Jens Wille <jens.wille@uni-koeln.de> #
13
+ # Jens Wille <jens.wille@gmail.com> #
12
14
  # #
13
15
  # hen is free software; you can redistribute it and/or modify it under the #
14
16
  # terms of the GNU Affero General Public License as published by the Free #
@@ -7,8 +7,10 @@
7
7
  # Albertus-Magnus-Platz, #
8
8
  # 50923 Cologne, Germany #
9
9
  # #
10
+ # Copyright (C) 2013 Jens Wille #
11
+ # #
10
12
  # Authors: #
11
- # Jens Wille <jens.wille@uni-koeln.de> #
13
+ # Jens Wille <jens.wille@gmail.com> #
12
14
  # #
13
15
  # hen is free software; you can redistribute it and/or modify it under the #
14
16
  # terms of the GNU Affero General Public License as published by the Free #
@@ -126,6 +128,19 @@ class Hen
126
128
  }
127
129
  end
128
130
 
131
+ # Map +options+ hash to array of command line arguments.
132
+ def map_options(options)
133
+ options.map { |option, value|
134
+ option = '--' << option.to_s.tr('_', '-')
135
+
136
+ case value
137
+ when Array then value.map { |_value| [option, _value] }
138
+ when String then [option, value]
139
+ else value ? option : nil
140
+ end
141
+ }.compact.flatten
142
+ end
143
+
129
144
  # Encapsulates tasks targeting at RubyForge, skipping those if no
130
145
  # RubyForge project is defined. Yields the RubyForge configuration
131
146
  # hash and, optionally, a proc to obtain RubyForge objects from (via
@@ -264,16 +279,30 @@ class Hen
264
279
  %x{git #{args.unshift(cmd.to_s.tr('_', '-')).join(' ')}}
265
280
  end
266
281
 
267
- def remote_for_branch(branch) # :nodoc:
268
- run(:branch, '-r')[%r{(\S+)/#{Regexp.escape(branch)}$}, 1]
282
+ def remote_for_branch(branch, default = 'origin') # :nodoc:
283
+ remotes = run(:branch, '-r').scan(%r{(\S+)/#{Regexp.escape(branch)}$})
284
+ remotes.flatten!
285
+
286
+ if env_remote = ENV['HEN_REMOTE']
287
+ env_remote if remotes.include?(env_remote)
288
+ else
289
+ remotes.include?(default) ? default : remotes.first
290
+ end
269
291
  end
270
292
 
271
293
  def url_for_remote(remote) # :nodoc:
272
294
  run(:remote, '-v')[%r{^#{Regexp.escape(remote)}\s+(\S+)}, 1]
273
295
  end
274
296
 
275
- def find_remote(regexp) # :nodoc:
276
- run(:remote, '-v').split($/).grep(regexp).first
297
+ def find_remote(regexp, default = 'origin') # :nodoc:
298
+ remotes = run(:remote, '-v').split($/).grep(regexp)
299
+ remotes.map! { |x| x.split[0..1] }
300
+
301
+ if env_remote = ENV['HEN_REMOTE']
302
+ remotes.assoc(env_remote)
303
+ else
304
+ remotes.assoc(default) || remotes.first
305
+ end
277
306
  end
278
307
 
279
308
  def easy_clone(url, dir = '.', remote = 'origin') # :nodoc:
@@ -4,7 +4,7 @@ class Hen
4
4
 
5
5
  MAJOR = 0
6
6
  MINOR = 4
7
- TINY = 6
7
+ TINY = 7
8
8
 
9
9
  class << self
10
10
 
@@ -58,23 +58,20 @@ Hen :rdoc do
58
58
 
59
59
  ### rdoc_options
60
60
 
61
- rdoc_options = rdoc_options.map { |option, value|
62
- option = '--' << option.to_s.tr('_', '-')
63
- value.is_a?(String) ? [option, value] : value ? option : nil
64
- }.compact.flatten
61
+ rdoc_opts = map_options(rdoc_options)
65
62
 
66
63
  # Make settings available to other hens
67
64
  RDOC_OPTIONS = {
68
65
  :rdoc_dir => rdoc_dir,
69
66
  :rdoc_files => rdoc_files,
70
- :options => rdoc_options
67
+ :options => rdoc_opts
71
68
  }
72
69
 
73
70
  unless rdoc_files.empty?
74
71
  rdoc_task = rdoc_klass.new(:doc) { |rdoc|
75
72
  rdoc.rdoc_dir = rdoc_dir
76
73
  rdoc.rdoc_files = rdoc_files
77
- rdoc.options = rdoc_options
74
+ rdoc.options = rdoc_opts
78
75
  }
79
76
  else
80
77
  task :doc do
@@ -86,7 +83,7 @@ Hen :rdoc do
86
83
  rdoc_klass.new('doc:local') { |rdoc|
87
84
  rdoc.rdoc_dir = rdoc_dir + '.local'
88
85
  rdoc.rdoc_files = rdoc_files_local
89
- rdoc.options = rdoc_options
86
+ rdoc.options = rdoc_opts
90
87
 
91
88
  extend_object(rdoc) {
92
89
  def local_description(desc); "#{desc} (including unmanaged files)"; end
@@ -108,13 +105,13 @@ Hen :rdoc do
108
105
  pages_url = git.url_for_remote(git_remote)
109
106
  clone_dir = ".#{git_branch}"
110
107
  elsif git_remote = git.find_remote(/git@github\.com:/)
111
- git_remote, clone_url = git_remote.split[0..1]
108
+ git_remote, clone_url = git_remote
112
109
  clone_dir = ".clone-#{$$}-#{rand(100)}"
113
110
  end
114
111
 
115
112
  if pages_url # inside git repo and found gh-pages branch
116
113
 
117
- desc "Publish RDoc to GitHub pages"
114
+ desc "Publish RDoc to GitHub pages on #{git_remote}"
118
115
  task 'doc:publish:github' => :doc do
119
116
  rm_rf clone_dir
120
117
 
@@ -26,15 +26,24 @@ Hen :spec do
26
26
 
27
27
  if spec_helper && File.readable?(spec_helper)
28
28
  spec_files.delete(spec_helper)
29
- spec_files.unshift(spec_helper)
29
+
30
+ begin
31
+ require 'rspec/core/version'
32
+
33
+ # RSpec began sorting test files in version 2.12.0 (c76c1e6)
34
+ curr_version = Gem::Version.new(RSpec::Core::Version::STRING)
35
+ sort_version = Gem::Version.new('2.12.0')
36
+
37
+ raise LoadError if curr_version < sort_version
38
+
39
+ (spec_options[:require] ||= []) << File.basename(spec_helper, '.rb')
40
+ rescue LoadError, NameError
41
+ spec_files.unshift(spec_helper)
42
+ end
30
43
  end
31
44
 
32
45
  opts_file = spec_options.delete(:options)
33
-
34
- spec_opts = spec_options.map { |option, value|
35
- option = '--' << option.to_s.tr('_', '-')
36
- value.is_a?(String) ? [option, value] : value ? option : nil
37
- }.compact.flatten
46
+ spec_opts = map_options(spec_options)
38
47
 
39
48
  if opts_file && File.readable?(opts_file)
40
49
  File.readlines(opts_file).each { |l| spec_opts << l.chomp }
metadata CHANGED
@@ -1,124 +1,105 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: hen
3
- version: !ruby/object:Gem::Version
4
- hash: 3
5
- prerelease:
6
- segments:
7
- - 0
8
- - 4
9
- - 6
10
- version: 0.4.6
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.4.7
11
5
  platform: ruby
12
- authors:
6
+ authors:
13
7
  - Jens Wille
14
8
  autorequire:
15
9
  bindir: bin
16
10
  cert_chain: []
17
-
18
- date: 2012-04-05 00:00:00 Z
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
11
+ date: 2013-04-05 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
21
14
  name: ruby-nuggets
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
24
- none: false
25
- requirements:
26
- - - ">="
27
- - !ruby/object:Gem::Version
28
- hash: 55
29
- segments:
30
- - 0
31
- - 8
32
- - 4
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
33
19
  version: 0.8.4
34
20
  type: :runtime
35
- version_requirements: *id001
36
- - !ruby/object:Gem::Dependency
37
- name: highline
38
21
  prerelease: false
39
- requirement: &id002 !ruby/object:Gem::Requirement
40
- none: false
41
- requirements:
42
- - - ">="
43
- - !ruby/object:Gem::Version
44
- hash: 3
45
- segments:
46
- - 0
47
- version: "0"
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: 0.8.4
27
+ - !ruby/object:Gem::Dependency
28
+ name: highline
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
48
34
  type: :runtime
49
- version_requirements: *id002
50
- description: Hoe or Echoe? No, thanks! Just a Rake helper that fits my own personal style.
51
- email: jens.wille@uni-koeln.de
52
- executables:
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description: Hoe or Echoe? No, thanks! Just a Rake helper that fits my own personal
42
+ style.
43
+ email: jens.wille@gmail.com
44
+ executables:
53
45
  - hen
54
46
  extensions: []
55
-
56
- extra_rdoc_files:
47
+ extra_rdoc_files:
57
48
  - README
58
49
  - COPYING
59
50
  - ChangeLog
60
- files:
51
+ files:
52
+ - lib/hen.rb
53
+ - lib/hen/cli.rb
61
54
  - lib/hen/dsl.rb
62
55
  - lib/hen/version.rb
63
- - lib/hen/cli.rb
64
- - lib/hen.rb
65
56
  - bin/hen
66
- - lib/hens/rdoc.rake
67
- - lib/hens/test.rake
68
57
  - lib/hens/gem.rake
58
+ - lib/hens/rdoc.rake
69
59
  - lib/hens/spec.rake
70
- - ChangeLog
60
+ - lib/hens/test.rake
71
61
  - COPYING
62
+ - ChangeLog
72
63
  - README
73
64
  - Rakefile
74
- - example/hens/sample.rake
75
65
  - example/_henrc
76
- - example/project/ChangeLog
77
- - example/project/_gitignore
66
+ - example/hens/sample.rake
78
67
  - example/project/COPYING
79
- - example/project/lib/__progname__/version.rb
80
- - example/project/lib/__progname__.rb
68
+ - example/project/ChangeLog
81
69
  - example/project/README
82
70
  - example/project/Rakefile
71
+ - example/project/_gitignore
72
+ - example/project/lib/__progname__.rb
73
+ - example/project/lib/__progname__/version.rb
83
74
  homepage: http://prometheus.rubyforge.org/hen
84
75
  licenses: []
85
-
76
+ metadata: {}
86
77
  post_install_message:
87
- rdoc_options:
88
- - --main
89
- - README
78
+ rdoc_options:
90
79
  - --charset
91
80
  - UTF-8
92
- - --title
93
- - hen Application documentation (v0.4.6)
94
- - --all
95
81
  - --line-numbers
96
- require_paths:
82
+ - --all
83
+ - --title
84
+ - hen Application documentation (v0.4.7)
85
+ - --main
86
+ - README
87
+ require_paths:
97
88
  - lib
98
- required_ruby_version: !ruby/object:Gem::Requirement
99
- none: false
100
- requirements:
101
- - - ">="
102
- - !ruby/object:Gem::Version
103
- hash: 3
104
- segments:
105
- - 0
106
- version: "0"
107
- required_rubygems_version: !ruby/object:Gem::Requirement
108
- none: false
109
- requirements:
110
- - - ">="
111
- - !ruby/object:Gem::Version
112
- hash: 3
113
- segments:
114
- - 0
115
- version: "0"
89
+ required_ruby_version: !ruby/object:Gem::Requirement
90
+ requirements:
91
+ - - '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ required_rubygems_version: !ruby/object:Gem::Requirement
95
+ requirements:
96
+ - - '>='
97
+ - !ruby/object:Gem::Version
98
+ version: '0'
116
99
  requirements: []
117
-
118
100
  rubyforge_project: prometheus
119
- rubygems_version: 1.8.21
101
+ rubygems_version: 2.0.3
120
102
  signing_key:
121
- specification_version: 3
103
+ specification_version: 4
122
104
  summary: Hoe or Echoe? No, thanks! Just a Rake helper that fits my own personal style.
123
105
  test_files: []
124
-