Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 193
- Log:
First stage commit of Typo 4.1, modified for the ROOL site.
Includes all local modifications but a final pass needs to be
made to delete any files left over from earlier Typo versions
that shouldn't be here anymore. See the 'tags' section of the
repository for a clean Typo 4.1 tree.Note that symlinks to shared files in the RISC OS Open theme
directory have been deliberately included this time around; I
decided that on balance it was better to leave them in as
placeholders, since unlike symlinks in app/views/shared, the
Typo theme structure is not a standard Rails concept.
- Author:
- rool
- Date:
- Wed Apr 04 18:51:02 +0100 2007
- Size:
- 5631 Bytes
1 | require 'rake/gempackagetask' |
2 | require 'rake/contrib/rubyforgepublisher' |
3 | |
4 | PKG_VERSION = "4.1" |
5 | PKG_NAME = "typo" |
6 | PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}" |
7 | RUBY_FORGE_PROJECT = 'typo' |
8 | RUBY_FORGE_USER = 'fdevillamil' |
9 | RELEASE_NAME = "#{PKG_NAME}-#{PKG_VERSION}" |
10 | |
11 | spec = Gem::Specification.new do |s| |
12 | s.name = PKG_NAME |
13 | s.version = PKG_VERSION |
14 | s.summary = "Modern weblog engine." |
15 | s.has_rdoc = false |
16 | |
17 | s.files = Dir.glob('**/*', File::FNM_DOTMATCH).reject do |f| |
18 | [ /\.$/, /config\/database.yml$/, /config\/database.yml-/, |
19 | /database\.sqlite/, |
20 | /\.log$/, /^pkg/, /\.svn/, /^vendor\/rails/, |
21 | /^public\/(files|xml|articles|pages|index.html)/, |
22 | /^public\/(stylesheets|javascripts|images)\/theme/, /\~$/, |
23 | /\/\._/, /\/#/ ].any? {|regex| f =~ regex } |
24 | end |
25 | s.require_path = '.' |
26 | s.author = "Tobias Luetke" |
27 | s.email = "tobi@leetsoft.com" |
28 | s.homepage = "http://www.typosphere.org" |
29 | s.rubyforge_project = "typo" |
30 | s.platform = Gem::Platform::RUBY |
31 | s.executables = ['typo'] |
32 | |
33 | s.add_dependency("rails", "= 1.2") |
34 | s.add_dependency("mongrel", ">= 0.3.13.3") |
35 | s.add_dependency("mongrel_cluster", ">= 0.2.0") |
36 | s.add_dependency("sqlite3-ruby", ">= 1.1.0") |
37 | s.add_dependency("rails-app-installer", ">= 0.2.0") |
38 | end |
39 | |
40 | Rake::GemPackageTask.new(spec) do |p| |
41 | p.gem_spec = spec |
42 | p.need_tar = true |
43 | p.need_zip = true |
44 | end |
45 | |
46 | desc "Publish the zip/tgz" |
47 | task :leetsoft_upload => [:package] do |
48 | # Rake::SshFilePublisher.new("leetsoft.com", "dist/pkg", "pkg", "#{PKG_FILE_NAME}.zip").upload |
49 | # Rake::SshFilePublisher.new("leetsoft.com", "dist/pkg", "pkg", "#{PKG_FILE_NAME}.tgz").upload |
50 | end |
51 | |
52 | desc "Publish the release files to RubyForge." |
53 | task :tag_svn do |
54 | system("svn cp http://svn.typosphere.org/typo/trunk http://svn.typosphere.org/typo/tags/release_#{PKG_VERSION.gsub(/\./,'_')} -m 'tag release #{PKG_VERSION}'") |
55 | end |
56 | |
57 | desc "Publish the release files to RubyForge." |
58 | task :rubyforge_upload => [:package] do |
59 | files = ["tgz", "zip"].map { |ext| "pkg/#{PKG_FILE_NAME}.#{ext}" } |
60 | |
61 | if RUBY_FORGE_PROJECT then |
62 | require 'net/http' |
63 | require 'open-uri' |
64 | |
65 | project_uri = "http://rubyforge.org/projects/#{RUBY_FORGE_PROJECT}/" |
66 | project_data = open(project_uri) { |data| data.read } |
67 | group_id = project_data[/[?&]group_id=(\d+)/, 1] |
68 | raise "Couldn't get group id" unless group_id |
69 | |
70 | # This echos password to shell which is a bit sucky |
71 | if ENV["RUBY_FORGE_PASSWORD"] |
72 | password = ENV["RUBY_FORGE_PASSWORD"] |
73 | else |
74 | print "#{RUBY_FORGE_USER}@rubyforge.org's password: " |
75 | password = STDIN.gets.chomp |
76 | end |
77 | |
78 | login_response = Net::HTTP.start("rubyforge.org", 80) do |http| |
79 | data = [ |
80 | "login=1", |
81 | "form_loginname=#{RUBY_FORGE_USER}", |
82 | "form_pw=#{password}" |
83 | ].join("&") |
84 | http.post("/account/login.php", data) |
85 | end |
86 | |
87 | cookie = login_response["set-cookie"] |
88 | raise "Login failed" unless cookie |
89 | headers = { "Cookie" => cookie } |
90 | |
91 | release_uri = "http://rubyforge.org/frs/admin/?group_id=#{group_id}" |
92 | release_data = open(release_uri, headers) { |data| data.read } |
93 | package_id = release_data[/[?&]package_id=(\d+)/, 1] |
94 | raise "Couldn't get package id" unless package_id |
95 | |
96 | first_file = true |
97 | release_id = "" |
98 | |
99 | files.each do |filename| |
100 | basename = File.basename(filename) |
101 | file_ext = File.extname(filename) |
102 | file_data = File.open(filename, "rb") { |file| file.read } |
103 | |
104 | puts "Releasing #{basename}..." |
105 | |
106 | release_response = Net::HTTP.start("rubyforge.org", 80) do |http| |
107 | release_date = Time.now.strftime("%Y-%m-%d %H:%M") |
108 | type_map = { |
109 | ".zip" => "3000", |
110 | ".tgz" => "3110", |
111 | ".gz" => "3110", |
112 | ".gem" => "1400" |
113 | }; type_map.default = "9999" |
114 | type = type_map[file_ext] |
115 | boundary = "rubyqMY6QN9bp6e4kS21H4y0zxcvoor" |
116 | |
117 | query_hash = if first_file then |
118 | { |
119 | "group_id" => group_id, |
120 | "package_id" => package_id, |
121 | "release_name" => RELEASE_NAME, |
122 | "release_date" => release_date, |
123 | "type_id" => type, |
124 | "processor_id" => "8000", # Any |
125 | "release_notes" => "", |
126 | "release_changes" => "", |
127 | "preformatted" => "1", |
128 | "submit" => "1" |
129 | } |
130 | else |
131 | { |
132 | "group_id" => group_id, |
133 | "release_id" => release_id, |
134 | "package_id" => package_id, |
135 | "step2" => "1", |
136 | "type_id" => type, |
137 | "processor_id" => "8000", # Any |
138 | "submit" => "Add This File" |
139 | } |
140 | end |
141 | |
142 | query = "?" + query_hash.map do |(name, value)| |
143 | [name, URI.encode(value)].join("=") |
144 | end.join("&") |
145 | |
146 | data = [ |
147 | "--" + boundary, |
148 | "Content-Disposition: form-data; name=\"userfile\"; filename=\"#{basename}\"", |
149 | "Content-Type: application/octet-stream", |
150 | "Content-Transfer-Encoding: binary", |
151 | "", file_data, "" |
152 | ].join("\x0D\x0A") |
153 | |
154 | release_headers = headers.merge( |
155 | "Content-Type" => "multipart/form-data; boundary=#{boundary}" |
156 | ) |
157 | |
158 | target = first_file ? "/frs/admin/qrs.php" : "/frs/admin/editrelease.php" |
159 | http.post(target + query, data, release_headers) |
160 | end |
161 | |
162 | if first_file then |
163 | release_id = release_response.body[/release_id=(\d+)/, 1] |
164 | raise("Couldn't get release id") unless release_id |
165 | end |
166 | |
167 | first_file = false |
168 | end |
169 | end |
170 | end |
171 | |
172 | desc "Upload the package to leetsoft, rubyforge and tag the release in svn" |
173 | task :release => [:sweep_cache, :package, :rubyforge_upload, :tag_svn ] |
174 |