theme_generator 1.2.1 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/MIT-LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2005 Tobias Luetke
2
+
3
+ Theme Generator additions Copyright (c) 2005 Matthew McCray
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWAR
data/Rakefile ADDED
@@ -0,0 +1,207 @@
1
+ #!/usr/bin/env ruby
2
+ require 'rubygems'
3
+ require 'rake'
4
+ require 'rake/testtask'
5
+ require 'rake/rdoctask'
6
+ require 'rake/gempackagetask'
7
+ require 'rake/contrib/rubyforgepublisher'
8
+
9
+ PKG_VERSION = "1.2.2"
10
+ PKG_NAME = "theme_generator"
11
+ PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
12
+ PKG_SUMMARY = "[Rails] Theme generator adds support for themes into Rails applications"
13
+
14
+ PKG_FILES = FileList[
15
+ "templates/*", "[A-Z]*", "theme_generator.rb"
16
+ ].exclude(/\bCVS\b|~$|\.svn/)
17
+
18
+ desc "Default Task"
19
+ task :default => [ :lines ]
20
+
21
+ desc "Delete tar.gz / zip / rdoc"
22
+ task :cleanup => [ :rm_packages, :clobber_rdoc ]
23
+
24
+ task :install => [:package] do
25
+ `gem install pkg/#{PKG_FILE_NAME}.gem`
26
+ end
27
+
28
+ task :syntax do
29
+ filelist = Dir.glob('**/*.rb')
30
+ filelist.each do |file|
31
+ output = `ruby -c #{file}`
32
+ unless output =~ /Syntax OK/
33
+ puts "#{file}:"
34
+ puts " #{output}"
35
+ return
36
+ end
37
+ end
38
+ puts 'Syntax OK'
39
+ end
40
+
41
+ # Genereate the RDoc documentation
42
+ # NEEDS TO BE MOD'ED
43
+ Rake::RDocTask.new { |rdoc|
44
+ rdoc.rdoc_dir = 'doc'
45
+ rdoc.title = "Theme Generator"
46
+ rdoc.options << '--line-numbers --inline-source'
47
+ rdoc.rdoc_files.include('templates/*.rb')
48
+ }
49
+
50
+ task :lines do
51
+ lines = 0
52
+ codelines = 0
53
+ Dir.foreach("templates") { |file_name|
54
+ next unless file_name =~ /.*rb/
55
+
56
+ f = File.open("templates/" + file_name)
57
+
58
+ while line = f.gets
59
+ lines += 1
60
+ next if line =~ /^\s*$/
61
+ next if line =~ /^\s*#/
62
+ codelines += 1
63
+ end
64
+ }
65
+ puts "Lines #{lines}, LOC #{codelines}"
66
+ end
67
+
68
+ spec = Gem::Specification.new do |s|
69
+ s.name = PKG_NAME
70
+ s.version = PKG_VERSION
71
+ s.summary = PKG_SUMMARY
72
+ s.has_rdoc = true
73
+ s.files = PKG_FILES #Dir['lib/**/*']
74
+
75
+ s.author = 'M@ McCray'
76
+ s.email = 'darthapo@gmail.com'
77
+ s.homepage = 'http://www.mattmccray.com'
78
+ end
79
+
80
+ Rake::GemPackageTask.new(spec) do |p|
81
+ #puts " File List:"
82
+ #puts " - #{PKG_FILES.join("\n - ")}"
83
+
84
+ p.gem_spec = spec
85
+ p.need_tar = true
86
+ p.need_zip = true
87
+ end
88
+
89
+ # --- Ruby forge release manager by florian gross -------------------------------------------------
90
+ RUBY_FORGE_PROJECT = 'theme-generator'
91
+ RUBY_FORGE_USER = 'darthapo'
92
+ RELEASE_NAME = "REL #{PKG_VERSION}"
93
+
94
+ desc "Publish the release files to RubyForge."
95
+ task :release => [:gem] do
96
+ files = ["gem"].map { |ext| "pkg/#{PKG_FILE_NAME}.#{ext}" }
97
+
98
+ if RUBY_FORGE_PROJECT then
99
+ require 'net/http'
100
+ require 'open-uri'
101
+
102
+ project_uri = "http://rubyforge.org/projects/#{RUBY_FORGE_PROJECT}/"
103
+ project_data = open(project_uri) { |data| data.read }
104
+ group_id = project_data[/[?&]group_id=(\d+)/, 1]
105
+ raise "Couldn't get group id" unless group_id
106
+
107
+ # This echos password to shell which is a bit sucky
108
+ if ENV["RUBY_FORGE_PASSWORD"]
109
+ password = ENV["RUBY_FORGE_PASSWORD"]
110
+ else
111
+ print "#{RUBY_FORGE_USER}@rubyforge.org's password: "
112
+ password = STDIN.gets.chomp
113
+ end
114
+
115
+ login_response = Net::HTTP.start("rubyforge.org", 80) do |http|
116
+ data = [
117
+ "login=1",
118
+ "form_loginname=#{RUBY_FORGE_USER}",
119
+ "form_pw=#{password}"
120
+ ].join("&")
121
+ http.post("/account/login.php", data)
122
+ end
123
+
124
+ cookie = login_response["set-cookie"]
125
+ raise "Login failed" unless cookie
126
+ headers = { "Cookie" => cookie }
127
+
128
+ release_uri = "http://rubyforge.org/frs/admin/?group_id=#{group_id}"
129
+ release_data = open(release_uri, headers) { |data| data.read }
130
+ package_id = release_data[/[?&]package_id=(\d+)/, 1]
131
+ raise "Couldn't get package id" unless package_id
132
+
133
+ first_file = true
134
+ release_id = ""
135
+
136
+ files.each do |filename|
137
+ basename = File.basename(filename)
138
+ file_ext = File.extname(filename)
139
+ file_data = File.open(filename, "rb") { |file| file.read }
140
+
141
+ puts "Releasing #{basename}..."
142
+
143
+ release_response = Net::HTTP.start("rubyforge.org", 80) do |http|
144
+ release_date = Time.now.strftime("%Y-%m-%d %H:%M")
145
+ type_map = {
146
+ ".zip" => "3000",
147
+ ".tgz" => "3110",
148
+ ".gz" => "3110",
149
+ ".gem" => "1400"
150
+ }; type_map.default = "9999"
151
+ type = type_map[file_ext]
152
+ boundary = "rubyqMY6QN9bp6e4kS21H4y0zxcvoor"
153
+
154
+ query_hash = if first_file then
155
+ {
156
+ "group_id" => group_id,
157
+ "package_id" => package_id,
158
+ "release_name" => RELEASE_NAME,
159
+ "release_date" => release_date,
160
+ "type_id" => type,
161
+ "processor_id" => "8000", # Any
162
+ "release_notes" => "",
163
+ "release_changes" => "",
164
+ "preformatted" => "1",
165
+ "submit" => "1"
166
+ }
167
+ else
168
+ {
169
+ "group_id" => group_id,
170
+ "release_id" => release_id,
171
+ "package_id" => package_id,
172
+ "step2" => "1",
173
+ "type_id" => type,
174
+ "processor_id" => "8000", # Any
175
+ "submit" => "Add This File"
176
+ }
177
+ end
178
+
179
+ query = "?" + query_hash.map do |(name, value)|
180
+ [name, URI.encode(value)].join("=")
181
+ end.join("&")
182
+
183
+ data = [
184
+ "--" + boundary,
185
+ "Content-Disposition: form-data; name=\"userfile\"; filename=\"#{basename}\"",
186
+ "Content-Type: application/octet-stream",
187
+ "Content-Transfer-Encoding: binary",
188
+ "", file_data, ""
189
+ ].join("\x0D\x0A")
190
+
191
+ release_headers = headers.merge(
192
+ "Content-Type" => "multipart/form-data; boundary=#{boundary}"
193
+ )
194
+
195
+ target = first_file ? "/frs/admin/qrs.php" : "/frs/admin/editrelease.php"
196
+ http.post(target + query, data, release_headers)
197
+ end
198
+
199
+ if first_file then
200
+ release_id = release_response.body[/release_id=(\d+)/, 1]
201
+ raise("Couldn't get release id") unless release_id
202
+ end
203
+
204
+ first_file = false
205
+ end
206
+ end
207
+ end
data/templates/README CHANGED
@@ -81,6 +81,8 @@ running:
81
81
 
82
82
  == Changelog
83
83
 
84
+ 1.2.2 - More Bug-fixes.
85
+
84
86
  1.2.1 - Bug-fixes and documentation clean up.
85
87
 
86
88
  1.2.0 - Updated actionview_ex with the new render_file additions from
data/templates/init.rb CHANGED
@@ -7,7 +7,6 @@ begin
7
7
  require 'liquid_helpers'
8
8
  rescue
9
9
  # I guess Liquid isn't being used...
10
- puts "Liquid helpers weren't loaded: #{$!}"
11
10
  end
12
11
 
13
12
  ActionController::Routing::Routes.install_theme_routes
@@ -16,8 +16,8 @@ end
16
16
 
17
17
  desc "Removes the cached (public) theme folders"
18
18
  task :theme_remove_cache do
19
- puts "Creating #{RAILS_ROOT}/public/themes/#{theme_name}"
20
- FileUtils.rm_r Dir.glob("#{RAILS_ROOT}/public/themes/*")
19
+ puts "Creating #{RAILS_ROOT}/public/themes"
20
+ #FileUtils.rm_r Dir.glob("#{RAILS_ROOT}/public/themes/*")
21
21
  FileUtils.rm_r "#{RAILS_ROOT}/public/themes", :force => true
22
22
  end
23
23
 
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
3
3
  specification_version: 1
4
4
  name: theme_generator
5
5
  version: !ruby/object:Gem::Version
6
- version: 1.2.1
7
- date: 2005-11-11 00:00:00 -06:00
6
+ version: 1.2.2
7
+ date: 2005-11-12 00:00:00 -06:00
8
8
  summary: "[Rails] Theme generator adds support for themes into Rails applications"
9
9
  require_paths:
10
10
  - lib
@@ -15,7 +15,7 @@ description:
15
15
  autorequire:
16
16
  default_executable:
17
17
  bindir: bin
18
- has_rdoc: false
18
+ has_rdoc: true
19
19
  required_ruby_version: !ruby/object:Gem::Version::Requirement
20
20
  requirements:
21
21
  -
@@ -29,21 +29,23 @@ cert_chain:
29
29
  authors:
30
30
  - M@ McCray
31
31
  files:
32
- - templates/README
33
- - templates/actionview_ex.rb
34
- - templates/preview.png
35
- - templates/theme.rb
36
32
  - templates/about.markdown
37
- - templates/init.rb
38
- - templates/routeset_ex.rb
39
- - templates/theme_controller.rb
40
33
  - templates/actioncontroller_ex.rb
41
- - templates/layout.rhtml
34
+ - templates/actionview_ex.rb
35
+ - templates/init.rb
42
36
  - templates/layout.liquid
37
+ - templates/layout.rhtml
43
38
  - templates/liquid_helpers.rb
39
+ - templates/preview.png
40
+ - templates/README
41
+ - templates/routeset_ex.rb
44
42
  - templates/theme.css
43
+ - templates/theme.rb
44
+ - templates/theme_controller.rb
45
45
  - templates/theme_helpers.rb
46
46
  - templates/themes.rake
47
+ - MIT-LICENSE
48
+ - Rakefile
47
49
  - USAGE
48
50
  - theme_generator.rb
49
51
  test_files: []
@@ -52,14 +54,4 @@ extra_rdoc_files: []
52
54
  executables: []
53
55
  extensions: []
54
56
  requirements: []
55
- dependencies:
56
- - !ruby/object:Gem::Dependency
57
- name: rails
58
- version_requirement:
59
- version_requirements: !ruby/object:Gem::Version::Requirement
60
- requirements:
61
- -
62
- - ">"
63
- - !ruby/object:Gem::Version
64
- version: 0.0.0
65
- version:
57
+ dependencies: []