hoe-telicopter 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.autotest +23 -0
- data/History.txt +6 -0
- data/Manifest.txt +8 -0
- data/README.txt +89 -0
- data/Rakefile +16 -0
- data/lib/hoe/email.rb +66 -0
- data/lib/hoe/hotelicopter_gemcutter.rb +43 -0
- data/lib/hoe/telicopter.rb +13 -0
- metadata +88 -0
data/.autotest
ADDED
@@ -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
|
data/History.txt
ADDED
data/Manifest.txt
ADDED
data/README.txt
ADDED
@@ -0,0 +1,89 @@
|
|
1
|
+
= hoe-telicopter
|
2
|
+
|
3
|
+
* https://github.com/g1nn13/hoe-telicopter
|
4
|
+
|
5
|
+
== DESCRIPTION:
|
6
|
+
|
7
|
+
Hoe plugins providing tasks used by seattle.rb including minitest,
|
8
|
+
perforce, and email providing full front-to-back release/annouce
|
9
|
+
automation.
|
10
|
+
|
11
|
+
== FEATURES/PROBLEMS:
|
12
|
+
|
13
|
+
* hoe/email - automates sending release email.
|
14
|
+
* hoe/telicopter - activates all the telicopter plugins.
|
15
|
+
|
16
|
+
== SYNOPSIS:
|
17
|
+
|
18
|
+
require 'rubygems'
|
19
|
+
require 'hoe'
|
20
|
+
|
21
|
+
Hoe.plugin :seattlerb
|
22
|
+
|
23
|
+
Hoe.spec 'blah' do
|
24
|
+
developer 'Ryan Davis', 'ryand-ruby@zenspider.com'
|
25
|
+
|
26
|
+
email_to << 'blah@mailing_list.com'
|
27
|
+
end
|
28
|
+
|
29
|
+
== USING EMAIL PLUGIN:
|
30
|
+
|
31
|
+
Once you activate the email plugin you should run:
|
32
|
+
|
33
|
+
% rake config_hoe
|
34
|
+
|
35
|
+
A new section called email will be created at the bottom of the file.
|
36
|
+
Fill this out as appropriate for your email host. An example gmail
|
37
|
+
config is below:
|
38
|
+
|
39
|
+
email:
|
40
|
+
user: user.name
|
41
|
+
pass: xxxx
|
42
|
+
auth: plain
|
43
|
+
port: submission
|
44
|
+
to:
|
45
|
+
- ruby-talk@ruby-lang.org
|
46
|
+
host: smtp.gmail.com
|
47
|
+
|
48
|
+
== REQUIREMENTS:
|
49
|
+
|
50
|
+
* gemcutter
|
51
|
+
* hoe
|
52
|
+
|
53
|
+
== INSTALL:
|
54
|
+
|
55
|
+
* sudo gem install hoe-telicopter
|
56
|
+
|
57
|
+
== DEVELOPERS:
|
58
|
+
|
59
|
+
After checking out the source, run:
|
60
|
+
|
61
|
+
$ rake newb
|
62
|
+
|
63
|
+
This task will install any missing dependencies, run the tests/specs,
|
64
|
+
and generate the RDoc.
|
65
|
+
|
66
|
+
== LICENSE:
|
67
|
+
|
68
|
+
(The MIT License)
|
69
|
+
|
70
|
+
Copyright (c) 2010 FIX
|
71
|
+
|
72
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
73
|
+
a copy of this software and associated documentation files (the
|
74
|
+
'Software'), to deal in the Software without restriction, including
|
75
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
76
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
77
|
+
permit persons to whom the Software is furnished to do so, subject to
|
78
|
+
the following conditions:
|
79
|
+
|
80
|
+
The above copyright notice and this permission notice shall be
|
81
|
+
included in all copies or substantial portions of the Software.
|
82
|
+
|
83
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
84
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
85
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
86
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
87
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
88
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
89
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
# -*- ruby -*-
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'hoe'
|
5
|
+
|
6
|
+
##
|
7
|
+
# we are publishing to gemcutter straight-away with this gem
|
8
|
+
Hoe.plugins.delete :rubyforge
|
9
|
+
|
10
|
+
Hoe.spec 'hoe-telicopter' do
|
11
|
+
developer('jim nist', 'jim@hotelicopter.com')
|
12
|
+
|
13
|
+
# self.rubyforge_name = 'hoe_telicopterx' # if different than 'hoe_telicopter'
|
14
|
+
end
|
15
|
+
|
16
|
+
# vim: syntax=ruby
|
data/lib/hoe/email.rb
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
##
|
2
|
+
# code taken from hoe-seattlerb
|
3
|
+
#
|
4
|
+
module Hoe::Email
|
5
|
+
|
6
|
+
Hoe::DEFAULT_CONFIG["email"] = {
|
7
|
+
"to" => [],
|
8
|
+
"user" => nil,
|
9
|
+
"pass" => nil,
|
10
|
+
"host" => nil,
|
11
|
+
"port" => "smtp",
|
12
|
+
"auth" => nil,
|
13
|
+
"tls" => nil,
|
14
|
+
}
|
15
|
+
|
16
|
+
attr_reader :email_to
|
17
|
+
|
18
|
+
def initialize_email
|
19
|
+
with_config do |config, _|
|
20
|
+
@email_to = config["email"]["to"] rescue nil
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def define_email_tasks
|
25
|
+
require 'net/smtp'
|
26
|
+
begin
|
27
|
+
require 'smtp_tls'
|
28
|
+
rescue LoadError
|
29
|
+
end
|
30
|
+
|
31
|
+
# attach to announcements
|
32
|
+
task :announce => :send_email
|
33
|
+
|
34
|
+
desc "Send an announcement email."
|
35
|
+
task :send_email do
|
36
|
+
warn "sending email"
|
37
|
+
message = generate_email :full
|
38
|
+
|
39
|
+
with_config do |conf, _|
|
40
|
+
host = conf["email"]["host"]
|
41
|
+
port = conf["email"]["port"]
|
42
|
+
user = conf["email"]["user"]
|
43
|
+
pass = conf["email"]["pass"]
|
44
|
+
auth = conf["email"]["auth"]
|
45
|
+
tls = conf["email"]["tls"]
|
46
|
+
|
47
|
+
port = Socket.getservbyname port unless Integer === port
|
48
|
+
|
49
|
+
tls = port != 25 if tls.nil?
|
50
|
+
|
51
|
+
start_args = [Socket.gethostname, user, pass, auth].compact
|
52
|
+
|
53
|
+
raise 'gem install smtp_tls' if tls and
|
54
|
+
not Net::SMTP.method_defined? :starttls
|
55
|
+
|
56
|
+
smtp = Net::SMTP.new(host, port)
|
57
|
+
smtp.set_debug_output $stderr if $DEBUG
|
58
|
+
smtp.enable_starttls if tls
|
59
|
+
smtp.start(*start_args) do |server|
|
60
|
+
server.send_message message, Array(email).first, *email_to
|
61
|
+
end
|
62
|
+
end
|
63
|
+
warn "...done"
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
##
|
2
|
+
# this is used to publish gems for hotelicopter that we have forked from other
|
3
|
+
# gems. it adds the 'g1nn13-' prefix to the gem before publishing, leaving the
|
4
|
+
# insides of the gem the unchanged as is the current custom.
|
5
|
+
#
|
6
|
+
# note however, that this custom may change in the near future to support the
|
7
|
+
# idea of 'namespaces' in gems. TODO: change this when and if it makes sense.
|
8
|
+
#
|
9
|
+
# this file is 'based' on the lib/hoe/gemcutter.rb from the hoe gem.
|
10
|
+
#
|
11
|
+
|
12
|
+
require 'rake'
|
13
|
+
gem "gemcutter" # lame. gemcutter doesn't have a VERSION const.
|
14
|
+
|
15
|
+
module Hoe::HotelicopterGemcutter
|
16
|
+
|
17
|
+
GEM_PREFIX = 'g1nn13'
|
18
|
+
|
19
|
+
def initialize_hoteliocpter_gemcutter
|
20
|
+
version = Gem.loaded_specs['gemcutter'].version
|
21
|
+
dependency_target << ['gemcutter', ">= #{version}"]
|
22
|
+
end
|
23
|
+
|
24
|
+
def define_gemcutter_tasks
|
25
|
+
desc "Push g1nn13- gem to gemcutter."
|
26
|
+
task :release_to_hotelicopter_gemcutter => [:clean, :package, :release_sanity] do
|
27
|
+
pkg = "pkg/#{spec.name}-#{spec.version}"
|
28
|
+
gems = Dir["#{pkg}*.gem"]
|
29
|
+
|
30
|
+
gems.each do |g|
|
31
|
+
new_file = "#{GEM_PREFIX}-#{g}"
|
32
|
+
puts new_file # TODO: remove
|
33
|
+
# pre-append the prefix before publishing
|
34
|
+
File.rename(g, new_file)
|
35
|
+
# TODO - once gemcutter supports command invocation, use it.
|
36
|
+
# We could still fail here due to --format executable
|
37
|
+
#sh Gem.ruby, "-S", "gem", "push", new_file
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
task :release_to => :release_to_hotelicopter_gemcutter
|
42
|
+
end
|
43
|
+
end unless defined? Hoe::HotelicopterGemcutter
|
metadata
ADDED
@@ -0,0 +1,88 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: hoe-telicopter
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- jim nist
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2010-01-22 00:00:00 -05:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: gemcutter
|
17
|
+
type: :development
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 0.3.0
|
24
|
+
version:
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: hoe
|
27
|
+
type: :development
|
28
|
+
version_requirement:
|
29
|
+
version_requirements: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 2.5.0
|
34
|
+
version:
|
35
|
+
description: |-
|
36
|
+
Hoe plugins providing tasks used by seattle.rb including minitest,
|
37
|
+
perforce, and email providing full front-to-back release/annouce
|
38
|
+
automation.
|
39
|
+
email:
|
40
|
+
- jim@hotelicopter.com
|
41
|
+
executables: []
|
42
|
+
|
43
|
+
extensions: []
|
44
|
+
|
45
|
+
extra_rdoc_files:
|
46
|
+
- History.txt
|
47
|
+
- Manifest.txt
|
48
|
+
- README.txt
|
49
|
+
files:
|
50
|
+
- .autotest
|
51
|
+
- History.txt
|
52
|
+
- Manifest.txt
|
53
|
+
- README.txt
|
54
|
+
- Rakefile
|
55
|
+
- lib/hoe/email.rb
|
56
|
+
- lib/hoe/hotelicopter_gemcutter.rb
|
57
|
+
- lib/hoe/telicopter.rb
|
58
|
+
has_rdoc: true
|
59
|
+
homepage: https://github.com/g1nn13/hoe-telicopter
|
60
|
+
licenses: []
|
61
|
+
|
62
|
+
post_install_message:
|
63
|
+
rdoc_options:
|
64
|
+
- --main
|
65
|
+
- README.txt
|
66
|
+
require_paths:
|
67
|
+
- lib
|
68
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
69
|
+
requirements:
|
70
|
+
- - ">="
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: "0"
|
73
|
+
version:
|
74
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
75
|
+
requirements:
|
76
|
+
- - ">="
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: "0"
|
79
|
+
version:
|
80
|
+
requirements: []
|
81
|
+
|
82
|
+
rubyforge_project: hoe-telicopter
|
83
|
+
rubygems_version: 1.3.5
|
84
|
+
signing_key:
|
85
|
+
specification_version: 3
|
86
|
+
summary: Hoe plugins providing tasks used by seattle.rb including minitest, perforce, and email providing full front-to-back release/annouce automation.
|
87
|
+
test_files: []
|
88
|
+
|