escape 0.0.1 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/Readme CHANGED
@@ -1,7 +1,8 @@
1
- = __
1
+ = Escape
2
2
 
3
3
  [<b>Home page</b>:] http://__.rubyforge.org/
4
4
  [<b>Project site</b>:] http://rubyforge.org/projects/__
5
+ [<b>Gem install</b>:] <tt>gem install escape</tt>
5
6
  [<b>Wiki</b>:] http://wiki.qualitysmith.com/__
6
7
  [<b>Author</b>:] Your name
7
8
  [<b>Copyright</b>:] 2007 QualitySmith, Inc.
File without changes
metadata CHANGED
@@ -3,13 +3,13 @@ rubygems_version: 0.9.2
3
3
  specification_version: 1
4
4
  name: escape
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.0.1
7
- date: 2007-04-26 00:00:00 -07:00
6
+ version: 0.0.4
7
+ date: 2007-06-29 00:00:00 -07:00
8
8
  summary: ...
9
9
  require_paths:
10
- - .
10
+ - lib
11
11
  email:
12
- homepage: http://rdoc.qualitysmith.com/escape
12
+ homepage: http://www.a-k-r.org/escape/
13
13
  rubyforge_project: escape
14
14
  description: ...
15
15
  autorequire:
@@ -27,10 +27,9 @@ signing_key:
27
27
  cert_chain:
28
28
  post_install_message:
29
29
  authors:
30
- - ...
30
+ - Tanaka Akira
31
31
  files:
32
- - escape.rb
33
- - tasks/shared/shared_tasks.rb
32
+ - lib/escape.rb
34
33
  - doc_include/template/qualitysmith.rb
35
34
  - Readme
36
35
  test_files: []
@@ -1,213 +0,0 @@
1
- require 'rake'
2
- require 'rake/testtask'
3
- require 'rake/rdoctask'
4
-
5
- # *Audience*: World, QualitySmith
6
-
7
- module SharedTasks
8
- #---------------------------------------------------------------------------------------------------------------------------------
9
- # Tests
10
-
11
- # Lets you very concisely create a test task using some common default options. A block may be provided if you want to set additional options.
12
- # *Example*:
13
- # SharedTasks.normal_test_task
14
- # *Audience*: World
15
- def self.normal_test_task()
16
- module_eval do
17
- desc 'Run tests'
18
- Rake::TestTask.new(:test) do |task|
19
- task.libs << 'lib'
20
- task.pattern = 'test/**/*_test.rb'
21
- task.verbose = true
22
- # To do: autorequire color library? Could do something like this once we switch to gem dependencies...
23
- #task.ruby_opts << "-r /home/tyler/code/gemables/test_extensions/lib/test_helper.rb"
24
- yield task if block_given?
25
- end
26
- end
27
- end
28
- #---------------------------------------------------------------------------------------------------------------------------------
29
- # Documentation
30
-
31
- # Generates an RDoc task for you with common options enabled, including a nicer template than the default.
32
- # Pass it a block if you need to customize it.
33
- # Example:
34
- # SharedTasks.rdoc_task do |rdoc|
35
- # rdoc.title = Project::PrettyName
36
- # end
37
- # *Audience*: World
38
- def self.rdoc_task(&block)
39
- module_eval do
40
- #-------------------------------------------------------------------------------------------
41
- desc 'Generate RDoc'
42
- Rake::RDocTask.new(:rdoc) do |rdoc|
43
- rdoc.rdoc_dir = 'doc'
44
- rdoc.options <<
45
- '--line-numbers' << # Include line numbers in the source code
46
- '--inline-source' << # Causes "Show source" link to display source inline rather than as a popup
47
- '--all' << # Include private methods
48
- '--diagram' << # Include diagrams showing modules and classes.
49
- '--accessor' << 'mattr_accessor' << # So that attributes defined with mattr_accessor will be listed
50
- '--extension' << 'rake=rb' # Treat .rake files as files that contain Ruby code
51
- rdoc.template = './doc_include/template/qualitysmith.rb'
52
- rdoc.rdoc_files.include(
53
- 'Readme',
54
- 'lib/**/*.rb'
55
- )
56
- yield rdoc
57
- end
58
- end
59
- end
60
-
61
- # Put images and stuff under doc_include and you can refer to them with links such as Screenshot[link:include/screenshot1.png]
62
- task :doc_include do
63
- mkdir 'doc' rescue nil
64
- cp_r 'doc_include', target = 'doc/include'
65
-
66
- # Remove those pesky .svn directories
67
- require 'find'
68
- require 'fileutils'
69
- Find.find(target) do |path|
70
- if File.basename(path) == '.svn'
71
- FileUtils.remove_dir(path, true)
72
- Find.prune
73
- end
74
- end
75
- end
76
-
77
- # Well, I'd rather make :doc_includes a "postrequisite" for :rdoc, but unfortunately Rake doesn't seem to provide a way to specify postrequisites.
78
- # and :clobber_rdoc (lib/rake/rdoctask.rb) does a rm_r rdoc_dir so anything we do to the directory *before* :rdoc will get wiped out.
79
- # So... we are left with making :doc_include a prerequisite for the publishing tasks. Unless you have a better idea??
80
- task :publish_rdoc_local => :rerdoc
81
- task :publish_rdoc_local => :doc_include
82
-
83
-
84
- #---------------------------------------------------------------------------------------------------------------------------------
85
- # Packaging (creating a new version/release)
86
-
87
- require 'rake/gempackagetask'
88
-
89
- def release_notes; "doc_include/ReleaseNotes-#{Project::Version}"; end
90
-
91
- def self.package_task(specification, &block)
92
- module_eval do
93
- Rake::GemPackageTask.new(specification) do |package|
94
- package.need_zip = true
95
- package.need_tar = true
96
- end
97
- end
98
- end
99
-
100
- def self.inc_version(file)
101
- module_eval do
102
- desc "Increment version number and create release notes"
103
- task :inc_version do
104
- # This will be easier once we change to a YAML-based ProjectInfo file...
105
- require 'facets/core/file/self/open_as_string'
106
- new_version = Project::Version
107
- File.open_as_string(file) do |contents|
108
- contents.gsub!(/(Version *=.*?)(\d+\.\d+\.\d+)(.*)$/) do
109
- before, version, after = $1, $2, $3
110
- version = version.split('.')
111
- new_version = version[0] + '.' + version[1] + '.' + (version[2].to_i+1).to_s
112
- new_text = before + new_version + after
113
- puts new_text
114
- new_text
115
- end
116
- end
117
- Project.const_set(:Version, new_version)
118
-
119
- system(%(vim #{release_notes}))
120
- sh %(svn add #{release_notes})
121
- puts "When you're ready to commit, you can use this:"
122
- puts "svn ci -F #{release_notes}"
123
- end
124
- end
125
- end
126
-
127
- desc "Test installing the gem locally"
128
- # Use rake clean to force rebuilding of gem. Otherwise it may see that it has already built a gem file with that name and just try to reinstall the one we've already got.
129
- task :gem_install => [:clean, :gem] do
130
- # :todo:
131
- # This should give a loud warning and require confirmation if this version already installed.
132
- # Ask if they want to increment the version number instead (default). It doesn't cost anything to just increment the version number,
133
- # and it's bad practice to use the same version number for two versions that are actually *different*.
134
- # It would be okay to reinstall (--force) the current version if one is just testing something *prior* to official release.
135
- # But once a version is released, it should never be changed. So I guess rather than checking if this version is installed locally,
136
- # we should check some flag that we keep in ProjectVersion containing the last version number that has been published and refuse to
137
- # rebuild a gem version that has already been released...
138
- sh %{sudo gem install --force pkg/#{Project::Name}-#{Project::Version}.gem }
139
- end
140
-
141
- desc "Remove generated directories."
142
- task :clean do
143
- sh %(rm -rf doc/ pkg/)
144
- end
145
-
146
-
147
- #---------------------------------------------------------------------------------------------------------------------------------
148
- # Publishing
149
-
150
- require 'rake/contrib/sshpublisher'
151
-
152
- def self.publish_task()
153
- module_eval do
154
- desc "Upload RDoc to RubyForge"
155
- task :publish_rdoc => [:publish_rdoc_local] do
156
- Rake::SshDirPublisher.new("#{ENV['RUBYFORGE_USER']}@rubyforge.org", "/var/www/gforge-projects/#{Project::RubyForgeName}", "doc").upload
157
- end
158
-
159
- # This can be invoked from the command line:
160
- # rake release RUBYFORGE_USER=myuser \
161
- # RUBYFORGE_PASSWORD=mypassword
162
- task :verify_user do
163
- raise "RUBYFORGE_USER environment variable not set!" unless ENV['RUBYFORGE_USER']
164
- end
165
- task :verify_password do
166
- raise "RUBYFORGE_PASSWORD environment variable not set!" unless ENV['RUBYFORGE_PASSWORD']
167
- end
168
-
169
- desc "Publish package files on RubyForge."
170
- task :publish_packages => [:verify_user, :verify_password, :package] do
171
- require 'meta_project'
172
- require 'rake/contrib/xforge'
173
- release_files = FileList[
174
- "pkg/#{Project::Name}-#{Project::Version}.gem",
175
- "pkg/#{Project::Name}-#{Project::Version}.tgz",
176
- "pkg/#{Project::Name}-#{Project::Version}.zip"
177
- ]
178
-
179
- Rake::XForge::Release.new(MetaProject::Project::XForge::RubyForge.new(Project::RubyForgeName)) do |release|
180
- release.user_name = ENV['RUBYFORGE_USER']
181
- release.password = ENV['RUBYFORGE_PASSWORD']
182
- release.files = release_files.to_a
183
- release.package_name = "#{Project::Name}"
184
- release.release_name = "#{Project::Name} #{Project::Version}"
185
- release.release_changes = ''
186
- release.release_notes = File.read(release_notes) # Probably want to put them somewhere else, but for now...
187
- end
188
- end
189
- end
190
- end
191
-
192
- # *Audience*: Qualitysmith
193
- desc "Upload RDoc to rdoc.QualitySmith.com"
194
- task :publish_rdoc_local do
195
- sh %{ssh commodore mkdir -p /var/www/html/rdoc/#{Project::Name} }
196
- sh %{ssh commodore sudo chown :users -R /var/www/html/rdoc/#{Project::Name} }
197
- sh %{ssh commodore sudo chmod g+w -R /var/www/html/rdoc/#{Project::Name} }
198
- Rake::SshDirPublisher.new("#{ENV['USER']}@commodore", "/var/www/html/rdoc/#{Project::Name}", "doc").upload
199
- end
200
-
201
-
202
- #---------------------------------------------------------------------------------------------------------------------------------
203
- # Announcing
204
-
205
- task :commits_since_last_release do
206
- # Look at last release number/revision
207
- # Display log messages for all revisions since then
208
- # Can use it to write the release notes for you
209
- end
210
-
211
- end # SharedTasks
212
-
213
- include SharedTasks