ad_agency 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (9) hide show
  1. data/.document +5 -0
  2. data/.gitignore +21 -0
  3. data/History.txt +2 -0
  4. data/LICENSE +20 -0
  5. data/README.rdoc +68 -0
  6. data/Rakefile +51 -0
  7. data/VERSION +1 -0
  8. data/lib/ad_agency.rb +49 -0
  9. metadata +86 -0
data/.document ADDED
@@ -0,0 +1,5 @@
1
+ README.rdoc
2
+ lib/**/*.rb
3
+ bin/*
4
+ features/**/*.feature
5
+ LICENSE
data/.gitignore ADDED
@@ -0,0 +1,21 @@
1
+ ## MAC OS
2
+ .DS_Store
3
+
4
+ ## TEXTMATE
5
+ *.tmproj
6
+ tmtags
7
+
8
+ ## EMACS
9
+ *~
10
+ \#*
11
+ .\#*
12
+
13
+ ## VIM
14
+ *.swp
15
+
16
+ ## PROJECT::GENERAL
17
+ coverage
18
+ rdoc
19
+ pkg
20
+
21
+ ## PROJECT::SPECIFIC
data/History.txt ADDED
@@ -0,0 +1,2 @@
1
+ === 0.1.0 Initial Release
2
+ Basic generation of announce email - see README.rdoc
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2009 Rick DeNatale
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,68 @@
1
+ = ad_agency
2
+
3
+ With the transition from RubyForge to Gemcutter, I along with many other rubyists made the transition from using hoe to jeweler.
4
+
5
+ One of the features of hoe I missed was the ability to produce announcement emails when releasing gems.
6
+
7
+ Ad_agency is a simple gem to help fill that hole.
8
+
9
+
10
+ == Usage
11
+
12
+ In your rake file for a jeweler project you should have something like:
13
+
14
+ begin
15
+ require 'jeweler'
16
+ Jeweler::Tasks.new do |gem|
17
+ # ruby code to initialize your gem spec
18
+ end
19
+ Jeweler::GemcutterTasks.new
20
+ rescue LoadError
21
+ puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
22
+ end
23
+
24
+ Add the following after the line requiring jeweler
25
+ require 'lib/ad_agency'
26
+
27
+ or you can replace that line since ad_agency requires jeweler itself
28
+
29
+ To produce an announcement run the rake task:
30
+
31
+ rake advertize:email_body -s
32
+
33
+ Running this task prints an announcement to stdout, the -s option supresses noise from rake.
34
+
35
+ I don't (yet?) support actually sending the email, for my use (on a Mac) I pipe the output into pbcopy and paste it as an email body in my email client.
36
+
37
+ == Output
38
+
39
+ The output is in the following form:
40
+
41
+ Announcing <<gem name>> version <<major>>.<<minor>>.<<patch>>
42
+ <<gem summary>>
43
+
44
+ <<gem description>>
45
+
46
+ Changes:
47
+
48
+ === <<major>>.<<minor>>.<<patch>> <<comments>>
49
+ <<comments>>
50
+
51
+ === <<major>>.<<minor>>.<<patch>> <<comments>>
52
+ <<comments>>
53
+ ...
54
+ ------ End of output -----
55
+
56
+ <<gem name>>, <<gem summary>>, and <<gem description>> are those set by the gem specification in your RAKEFILE.
57
+
58
+ <<major>>, <<minor>>, and <<patch>> are set from the contents of your VERSION file, which is managed by the jeweler version rake tasks.
59
+
60
+ If you have a History.txt file in your project it will be used to produce the changes section. It expects the sections of the History.txt file to be separated by lines which match the regular expression:
61
+
62
+ /^=+\s\d+\.d+\.d+/
63
+
64
+ Or one or more initial equal signs followed by a major.minor.patch version number. The History.txt file is copied to the announcement up to but not including the first separator line with a different major and minor version from the current version.
65
+
66
+ == Copyright
67
+
68
+ Copyright (c) 2010 Rick DeNatale. See LICENSE for details.
data/Rakefile ADDED
@@ -0,0 +1,51 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+
4
+ begin
5
+ require 'ad_agency'
6
+ Jeweler::Tasks.new do |gem|
7
+ gem.name = "ad_agency"
8
+ gem.summary = %Q{An extension to Jeweler for generating announcements}
9
+ gem.description = %Q{
10
+ One of the facilities I missed in moving from hoe to jeweler was the ability to easily
11
+ announce new versions of gems.
12
+
13
+ ad_agency fills that hole.
14
+ }
15
+ gem.email = "rick.denatale@gmail.com"
16
+ gem.homepage = "http://github.com/rubyredrick/ad_agency"
17
+ gem.authors = ["Rick DeNatale"]
18
+ gem.add_development_dependency "rspec", ">= 1.2.9"
19
+ # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
20
+ end
21
+ Jeweler::GemcutterTasks.new
22
+ Jeweler::AdAgencyTasks.new
23
+ rescue LoadError
24
+ puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
25
+ end
26
+
27
+ require 'spec/rake/spectask'
28
+ Spec::Rake::SpecTask.new(:spec) do |spec|
29
+ spec.libs << 'lib' << 'spec'
30
+ spec.spec_files = FileList['spec/**/*_spec.rb']
31
+ end
32
+
33
+ Spec::Rake::SpecTask.new(:rcov) do |spec|
34
+ spec.libs << 'lib' << 'spec'
35
+ spec.pattern = 'spec/**/*_spec.rb'
36
+ spec.rcov = true
37
+ end
38
+
39
+ task :spec => :check_dependencies
40
+
41
+ task :default => :spec
42
+
43
+ require 'rake/rdoctask'
44
+ Rake::RDocTask.new do |rdoc|
45
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
46
+
47
+ rdoc.rdoc_dir = 'rdoc'
48
+ rdoc.title = "ad_agency #{version}"
49
+ rdoc.rdoc_files.include('README*')
50
+ rdoc.rdoc_files.include('lib/**/*.rb')
51
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.1.0
data/lib/ad_agency.rb ADDED
@@ -0,0 +1,49 @@
1
+ require 'rake'
2
+ require 'rake/tasklib'
3
+ require 'jeweler'
4
+
5
+ class Jeweler
6
+ # Rake tasks for announcing a Jeweler gem.
7
+ #
8
+ # Jeweler::Tasks.new needs to be used before this.
9
+ #
10
+ # Basic usage:
11
+ #
12
+ # Jeweler::AdAgencyTasks.new
13
+ #
14
+ # Easy enough, right?
15
+ class AdAgencyTasks < ::Rake::TaskLib
16
+ attr_accessor :jeweler
17
+
18
+ def initialize
19
+ self.jeweler = Rake.application.jeweler
20
+ define
21
+ end
22
+
23
+ def define
24
+ namespace :advertize do
25
+ desc "generate an announcement email body"
26
+ task :email_body do
27
+ spec = jeweler.gemspec
28
+ version = File.readlines("VERSION").first.chomp
29
+ maj_min = version[/^\d+\.\d+/]
30
+ puts "Announcing #{spec.name} version #{version}"
31
+ puts spec.summary
32
+ puts
33
+ puts spec.description
34
+ puts
35
+ if File.exist?("History.txt")
36
+ puts "Changes:"
37
+ puts
38
+ File.readlines("History.txt").each do |line|
39
+ if line =~ /^=+\s+(\d+\.\d+)\./
40
+ break unless $1 == maj_min
41
+ end
42
+ puts line
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
metadata ADDED
@@ -0,0 +1,86 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ad_agency
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 1
8
+ - 0
9
+ version: 0.1.0
10
+ platform: ruby
11
+ authors:
12
+ - Rick DeNatale
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2010-04-17 00:00:00 -04:00
18
+ default_executable:
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: rspec
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ segments:
28
+ - 1
29
+ - 2
30
+ - 9
31
+ version: 1.2.9
32
+ type: :development
33
+ version_requirements: *id001
34
+ description: "\n\
35
+ One of the facilities I missed in moving from hoe to jeweler was the ability to easily\n\
36
+ announce new versions of gems.\n\n\
37
+ ad_agency fills that hole.\n "
38
+ email: rick.denatale@gmail.com
39
+ executables: []
40
+
41
+ extensions: []
42
+
43
+ extra_rdoc_files:
44
+ - LICENSE
45
+ - README.rdoc
46
+ files:
47
+ - .document
48
+ - .gitignore
49
+ - History.txt
50
+ - LICENSE
51
+ - README.rdoc
52
+ - Rakefile
53
+ - VERSION
54
+ - lib/ad_agency.rb
55
+ has_rdoc: true
56
+ homepage: http://github.com/rubyredrick/ad_agency
57
+ licenses: []
58
+
59
+ post_install_message:
60
+ rdoc_options:
61
+ - --charset=UTF-8
62
+ require_paths:
63
+ - lib
64
+ required_ruby_version: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ segments:
69
+ - 0
70
+ version: "0"
71
+ required_rubygems_version: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ segments:
76
+ - 0
77
+ version: "0"
78
+ requirements: []
79
+
80
+ rubyforge_project:
81
+ rubygems_version: 1.3.6
82
+ signing_key:
83
+ specification_version: 3
84
+ summary: An extension to Jeweler for generating announcements
85
+ test_files: []
86
+