hoe-hg 1.0.0
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.
- data/CHANGELOG.rdoc +2 -0
- data/README.rdoc +68 -0
- data/Rakefile +19 -0
- data/lib/hoe/hg.rb +70 -0
- metadata +103 -0
data/CHANGELOG.rdoc
ADDED
data/README.rdoc
ADDED
@@ -0,0 +1,68 @@
|
|
1
|
+
= Hoe Loves Mercurial
|
2
|
+
|
3
|
+
* http://bitbucket.org/mml/hoe-hg
|
4
|
+
|
5
|
+
== Description
|
6
|
+
|
7
|
+
A set of Hoe plugins for tighter Mercurial integration. Provides tasks to
|
8
|
+
automate release tagging and pushing and changelog generation. I
|
9
|
+
expect it'll learn a few more tricks in the future.
|
10
|
+
|
11
|
+
== Examples
|
12
|
+
|
13
|
+
# in your Rakefile
|
14
|
+
Hoe.plugin :hg
|
15
|
+
|
16
|
+
If this plugin doesn't see a .hg directory at the root of your
|
17
|
+
project, it'll silently deactivate itself.
|
18
|
+
|
19
|
+
=== Generating the Manifest
|
20
|
+
|
21
|
+
$ rake hg:manifest
|
22
|
+
|
23
|
+
This will regenerate <tt>Manifest.txt</tt> using <tt>hg
|
24
|
+
ls-files</tt>. It does not respect Hoe's manifest sort order and excludes!
|
25
|
+
|
26
|
+
=== Tagging and Sanity Checking a Release
|
27
|
+
|
28
|
+
$ rake release VERSION=1.0.0
|
29
|
+
|
30
|
+
In addition to the normal RubyForge release process, this will create
|
31
|
+
and push a <tt>v1.0.0</tt> tag. It'll also abort the release if your
|
32
|
+
index is dirty, or if there are untracked files present.
|
33
|
+
|
34
|
+
== Dependencies
|
35
|
+
|
36
|
+
Hoe and Mercurial, obviously. I wouldn't be surprised if things don't quite
|
37
|
+
work for ancient hg versions < 1.4.1
|
38
|
+
|
39
|
+
== Installation
|
40
|
+
|
41
|
+
$ gem install hoe-hg
|
42
|
+
|
43
|
+
== TODO
|
44
|
+
|
45
|
+
* I bailed on the auto-generated changelog.
|
46
|
+
|
47
|
+
== License
|
48
|
+
|
49
|
+
Copyright 2009 McClain Looney (m@loonsoft.com)
|
50
|
+
|
51
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
52
|
+
a copy of this software and associated documentation files (the
|
53
|
+
'Software'), to deal in the Software without restriction, including
|
54
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
55
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
56
|
+
permit persons to whom the Software is furnished to do so, subject to
|
57
|
+
the following conditions:
|
58
|
+
|
59
|
+
The above copyright notice and this permission notice shall be
|
60
|
+
included in all copies or substantial portions of the Software.
|
61
|
+
|
62
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
63
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
64
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
65
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
66
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
67
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
68
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
$: << "lib"
|
2
|
+
require 'rake/clean'
|
3
|
+
CLEAN.include %w(**/*~ **/*.orig)
|
4
|
+
require "rubygems"
|
5
|
+
require "hoe"
|
6
|
+
require "hoe/hg"
|
7
|
+
|
8
|
+
ENV['VERSION']=Hoe::Hg::VERSION
|
9
|
+
Hoe.plugin :doofus, :hg
|
10
|
+
|
11
|
+
Hoe.spec "hoe-hg" do
|
12
|
+
developer "McClain Looney", "m@loonsoft.com"
|
13
|
+
|
14
|
+
self.extra_rdoc_files = FileList["*.rdoc"]
|
15
|
+
self.history_file = "CHANGELOG.rdoc"
|
16
|
+
self.readme_file = "README.rdoc"
|
17
|
+
|
18
|
+
extra_deps << ["hoe", ">= 2.2.0"]
|
19
|
+
end
|
data/lib/hoe/hg.rb
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
class Hoe #:nodoc:
|
2
|
+
|
3
|
+
# This module is a Hoe plugin. You can set its attributes in your
|
4
|
+
# Rakefile Hoe spec, like this:
|
5
|
+
#
|
6
|
+
# Hoe.plugin :hg
|
7
|
+
#
|
8
|
+
# Hoe.spec "myproj" do
|
9
|
+
# self.hg_release_tag_prefix = "REL_"
|
10
|
+
# self.hg_repo = "ssh://hg@bigbucket.org/me/myrepo"
|
11
|
+
# self.hg_release_branch = "default"
|
12
|
+
# end
|
13
|
+
#
|
14
|
+
#
|
15
|
+
# === Tasks
|
16
|
+
#
|
17
|
+
# hg:manifest:: Update the manifest with Hg's file list.
|
18
|
+
# hg:tag:: Create and push a tag.
|
19
|
+
|
20
|
+
module Hg
|
21
|
+
|
22
|
+
VERSION = "1.0.0"
|
23
|
+
|
24
|
+
attr_accessor :hg_release_tag_prefix
|
25
|
+
attr_accessor :hg_repo, :hg_release_branch
|
26
|
+
|
27
|
+
def initialize_hg #:nodoc:
|
28
|
+
self.hg_release_tag_prefix = "r"
|
29
|
+
self.hg_release_branch = "default"
|
30
|
+
end
|
31
|
+
|
32
|
+
def define_hg_tasks #:nodoc:
|
33
|
+
return unless File.exist? ".hg"
|
34
|
+
|
35
|
+
desc "Update the manifest with Hg's file list."
|
36
|
+
task "hg:manifest" do
|
37
|
+
with_config do |config, _|
|
38
|
+
files = `hg manifest`.split "\n"
|
39
|
+
File.open "Manifest.txt", "w" do |f|
|
40
|
+
f.puts files.sort.join("\n")
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
desc "Create and push a TAG (default #{hg_release_tag_prefix}#{version})."
|
46
|
+
|
47
|
+
task "hg:tag" do
|
48
|
+
tag = ENV["TAG"]
|
49
|
+
tag ||= "#{hg_release_tag_prefix}#{ENV["VERSION"] || version}"
|
50
|
+
|
51
|
+
hg_tag_and_push tag
|
52
|
+
end
|
53
|
+
|
54
|
+
task :release_sanity do
|
55
|
+
puts 'doing sanity checks'
|
56
|
+
unless `hg status`.strip.length==0
|
57
|
+
abort "Won't release: Dirty index or untracked files present!"
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
task :release => "hg:tag"
|
62
|
+
end
|
63
|
+
|
64
|
+
def hg_tag_and_push branch
|
65
|
+
sh "hg tag -m 'tagging #{tag} for release'"
|
66
|
+
sh "hg push #{hg_repo} -r #{tag}"
|
67
|
+
end
|
68
|
+
|
69
|
+
end
|
70
|
+
end
|
metadata
ADDED
@@ -0,0 +1,103 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: hoe-hg
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- McClain Looney
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2010-01-15 00:00:00 -06:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: hoe
|
17
|
+
type: :runtime
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 2.2.0
|
24
|
+
version:
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: rubyforge
|
27
|
+
type: :development
|
28
|
+
version_requirement:
|
29
|
+
version_requirements: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 2.0.3
|
34
|
+
version:
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: gemcutter
|
37
|
+
type: :development
|
38
|
+
version_requirement:
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: 0.3.0
|
44
|
+
version:
|
45
|
+
- !ruby/object:Gem::Dependency
|
46
|
+
name: hoe
|
47
|
+
type: :development
|
48
|
+
version_requirement:
|
49
|
+
version_requirements: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 2.5.0
|
54
|
+
version:
|
55
|
+
description: |-
|
56
|
+
A set of Hoe plugins for tighter Mercurial integration. Provides tasks to
|
57
|
+
automate release tagging and pushing and changelog generation. I
|
58
|
+
expect it'll learn a few more tricks in the future.
|
59
|
+
email:
|
60
|
+
- m@loonsoft.com
|
61
|
+
executables: []
|
62
|
+
|
63
|
+
extensions: []
|
64
|
+
|
65
|
+
extra_rdoc_files:
|
66
|
+
- CHANGELOG.rdoc
|
67
|
+
- README.rdoc
|
68
|
+
files:
|
69
|
+
- lib/hoe/hg.rb
|
70
|
+
- CHANGELOG.rdoc
|
71
|
+
- README.rdoc
|
72
|
+
- Rakefile
|
73
|
+
has_rdoc: true
|
74
|
+
homepage: http://bitbucket.org/mml/hoe-hg
|
75
|
+
licenses: []
|
76
|
+
|
77
|
+
post_install_message:
|
78
|
+
rdoc_options:
|
79
|
+
- --main
|
80
|
+
- README.rdoc
|
81
|
+
require_paths:
|
82
|
+
- lib
|
83
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
84
|
+
requirements:
|
85
|
+
- - ">="
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: "0"
|
88
|
+
version:
|
89
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
90
|
+
requirements:
|
91
|
+
- - ">="
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: "0"
|
94
|
+
version:
|
95
|
+
requirements: []
|
96
|
+
|
97
|
+
rubyforge_project: hoe-hg
|
98
|
+
rubygems_version: 1.3.5
|
99
|
+
signing_key:
|
100
|
+
specification_version: 3
|
101
|
+
summary: A set of Hoe plugins for tighter Mercurial integration
|
102
|
+
test_files: []
|
103
|
+
|