crate 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,59 @@
1
+ require 'tasks/config'
2
+
3
+ #-----------------------------------------------------------------------
4
+ # Rubyforge additions to the task library
5
+ #-----------------------------------------------------------------------
6
+ if rf_conf = Configuration.for_if_exist?("rubyforge") then
7
+
8
+ abort("rubyforge gem not installed 'gem install rubyforge'") unless Utils.try_require('rubyforge')
9
+
10
+ proj_conf = Configuration.for('project')
11
+
12
+ namespace :dist do
13
+ desc "Release files to rubyforge"
14
+ task :rubyforge => [:clean, :package ] do
15
+
16
+ rubyforge = RubyForge.new
17
+
18
+ config = {}
19
+ config["release_notes"] = proj_conf.description
20
+ config["release_changes"] = Utils.release_notes_from(proj_conf.history)[Crate::VERSION]
21
+ config["Prefomatted"] = true
22
+
23
+ rubyforge.configure config
24
+
25
+ # make sure this release doesn't already exist
26
+ releases = rubyforge.autoconfig['release_ids']
27
+ if releases.has_key?(Crate::GEM_SPEC.name) and releases[Crate::GEM_SPEC.name][Crate::VERSION] then
28
+ abort("Release #{Crate::VERSION} already exists! Unable to release.")
29
+ end
30
+
31
+ puts "Uploading to rubyforge..."
32
+ files = FileList[File.join("pkg","#{Crate::GEM_SPEC.name}-#{Crate::VERSION}*.*")].to_a
33
+ files.each do |f|
34
+ puts " * #{f}"
35
+ end
36
+ rubyforge.login
37
+ rubyforge.add_release(Crate::GEM_SPEC.rubyforge_project, Crate::GEM_SPEC.name, Crate::VERSION, *files)
38
+ puts "done."
39
+ end
40
+ end
41
+
42
+ namespace :announce do
43
+ desc "Post news of #{proj_conf.name} to #{rf_conf.project} on rubyforge"
44
+ task :rubyforge do
45
+ info = Utils.announcement
46
+
47
+ puts "Subject : #{info[:subject]}"
48
+ msg = "#{info[:title]}\n\n#{info[:urls]}\n\n#{info[:release_notes]}"
49
+ puts msg
50
+
51
+ rubyforge = RubyForge.new
52
+ rubyforge.configure
53
+ rubyforge.login
54
+ rubyforge.post_news(rf_conf.project, info[:subject], msg )
55
+ puts "Posted to rubyforge"
56
+ end
57
+
58
+ end
59
+ end
@@ -0,0 +1,80 @@
1
+ require 'crate/version'
2
+
3
+ #-------------------------------------------------------------------------------
4
+ # Additions to the Configuration class that are useful
5
+ #-------------------------------------------------------------------------------
6
+ class Configuration
7
+ class << self
8
+ def exist?( name )
9
+ Configuration::Table.has_key?( name )
10
+ end
11
+
12
+ def for_if_exist?( name )
13
+ if self.exist?( name ) then
14
+ self.for( name )
15
+ end
16
+ end
17
+ end
18
+ end
19
+
20
+ #-------------------------------------------------------------------------------
21
+ # some useful utilitiy methods for the tasks
22
+ #-------------------------------------------------------------------------------
23
+ module Utils
24
+ class << self
25
+
26
+ # Try to load the given _library_ using the built-in require, but do not
27
+ # raise a LoadError if unsuccessful. Returns +true+ if the _library_ was
28
+ # successfully loaded; returns +false+ otherwise.
29
+ #
30
+ def try_require( lib )
31
+ require lib
32
+ true
33
+ rescue LoadError
34
+ false
35
+ end
36
+
37
+ # partition an rdoc file into sections, and return the text of the section
38
+ # given.
39
+ def section_of(file, section_name)
40
+ File.read(file).split(/^(?==)/).each do |section|
41
+ lines = section.split("\n")
42
+ return lines[1..-1].join("\n").strip if lines.first =~ /#{section_name}/i
43
+ end
44
+ nil
45
+ end
46
+
47
+ # Get an array of all the changes in the application for a particular
48
+ # release. This is done by looking in the history file and grabbing the
49
+ # information for the most recent release. The history file is assumed to
50
+ # be in RDoc format and version release are 2nd tier sections separated by
51
+ # '== Version X.Y.Z'
52
+ #
53
+ # returns:: A hash of notes keyed by version number
54
+ #
55
+ def release_notes_from(history_file)
56
+ releases = {}
57
+ File.read(history_file).split(/^(?==)/).each do |section|
58
+ lines = section.split("\n")
59
+ md = %r{Version ((\w+\.)+\w+)}.match(lines.first)
60
+ next unless md
61
+ releases[md[1]] = lines[1..-1].join("\n").strip
62
+ end
63
+ return releases
64
+ end
65
+
66
+ # return a hash of useful information for the latest release
67
+ # urls, subject, title, description and latest release notes
68
+ #
69
+ def announcement
70
+ cfg = Configuration.for("project")
71
+ {
72
+ :subject => "#{cfg.name} #{Crate::VERSION} Released",
73
+ :title => "#{cfg.name} version #{Crate::VERSION} has been released.",
74
+ :urls => "#{cfg.homepage}",
75
+ :description => "#{cfg.description.rstrip}",
76
+ :release_notes => Utils.release_notes_from(cfg.history)[Crate::VERSION].rstrip
77
+ }
78
+ end
79
+ end
80
+ end # << self
metadata ADDED
@@ -0,0 +1,160 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: crate
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ platform: ruby
6
+ authors:
7
+ - Jeremy Hinegardner
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2008-12-01 00:00:00 -07:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: rake
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 0.8.1
24
+ version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: configuration
27
+ type: :runtime
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: 0.0.5
34
+ version:
35
+ - !ruby/object:Gem::Dependency
36
+ name: progressbar
37
+ type: :runtime
38
+ version_requirement:
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ version: "0"
44
+ version:
45
+ - !ruby/object:Gem::Dependency
46
+ name: archive-tar-minitar
47
+ type: :runtime
48
+ version_requirement:
49
+ version_requirements: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: "0"
54
+ version:
55
+ - !ruby/object:Gem::Dependency
56
+ name: amalgalite
57
+ type: :runtime
58
+ version_requirement:
59
+ version_requirements: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - ~>
62
+ - !ruby/object:Gem::Version
63
+ version: 0.5.0
64
+ version:
65
+ description: Crate is a developer tool to help package up your application as a custom static build of the ruby interpreter plus all dependedent binary extensions. All the pure ruby code (the ruby application, the ruby stdlib, etc ) is packed into one or more SQLite databases. The final distributable pieces are a single executable and a few SQLite databases which can be then wrapped up appropriately as an OS X App; a self extracting executable for Windows; a shar archive, rpm or tarball for Unixes.
66
+ email: jeremy@copiousfreetime.org
67
+ executables:
68
+ - crate
69
+ extensions: []
70
+
71
+ extra_rdoc_files:
72
+ - README
73
+ - HISTORY
74
+ - LICENSE
75
+ - lib/crate/dependency.rb
76
+ - lib/crate/digest.rb
77
+ - lib/crate/gem_integration.rb
78
+ - lib/crate/main.rb
79
+ - lib/crate/packing_list.rb
80
+ - lib/crate/project.rb
81
+ - lib/crate/ruby.rb
82
+ - lib/crate/utils.rb
83
+ - lib/crate/version.rb
84
+ - lib/crate.rb
85
+ files:
86
+ - bin/crate
87
+ - lib/crate/dependency.rb
88
+ - lib/crate/digest.rb
89
+ - lib/crate/gem_integration.rb
90
+ - lib/crate/main.rb
91
+ - lib/crate/packing_list.rb
92
+ - lib/crate/project.rb
93
+ - lib/crate/ruby.rb
94
+ - lib/crate/utils.rb
95
+ - lib/crate/version.rb
96
+ - lib/crate.rb
97
+ - spec/crate_spec.rb
98
+ - spec/spec_helper.rb
99
+ - data/application.rb
100
+ - data/crate_boot.c
101
+ - data/Makefile
102
+ - data/Rakefile
103
+ - data/recipes
104
+ - data/recipes/amalgalite
105
+ - data/recipes/amalgalite/amalgalite.rake
106
+ - data/recipes/arrayfields
107
+ - data/recipes/arrayfields/arrayfields.rake
108
+ - data/recipes/configuration
109
+ - data/recipes/configuration/configuration.rake
110
+ - data/recipes/openssl
111
+ - data/recipes/openssl/openssl.rake
112
+ - data/recipes/ruby
113
+ - data/recipes/ruby/ext-extmk.rb.patch
114
+ - data/recipes/ruby/ruby.rake
115
+ - data/recipes/rubygems
116
+ - data/recipes/rubygems/rubygems.rake
117
+ - data/recipes/zlib
118
+ - data/recipes/zlib/zlib.rake
119
+ - README
120
+ - HISTORY
121
+ - LICENSE
122
+ - tasks/announce.rake
123
+ - tasks/distribution.rake
124
+ - tasks/documentation.rake
125
+ - tasks/rspec.rake
126
+ - tasks/rubyforge.rake
127
+ - tasks/config.rb
128
+ - tasks/utils.rb
129
+ - gemspec.rb
130
+ has_rdoc: true
131
+ homepage: http://copiousfreetime.rubyforge.org/crate
132
+ post_install_message:
133
+ rdoc_options:
134
+ - --line-numbers
135
+ - --inline-source
136
+ - --main
137
+ - README
138
+ require_paths:
139
+ - lib
140
+ required_ruby_version: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - ">="
143
+ - !ruby/object:Gem::Version
144
+ version: "0"
145
+ version:
146
+ required_rubygems_version: !ruby/object:Gem::Requirement
147
+ requirements:
148
+ - - ">="
149
+ - !ruby/object:Gem::Version
150
+ version: "0"
151
+ version:
152
+ requirements: []
153
+
154
+ rubyforge_project: copiousfreetime
155
+ rubygems_version: 1.3.1
156
+ signing_key:
157
+ specification_version: 2
158
+ summary: Crate is a developer tool to help package up your application as a custom static build of the ruby interpreter plus all dependedent binary extensions
159
+ test_files: []
160
+