hello 0.0.0 → 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +12 -0
- data/README +31 -85
- data/Rakefile +50 -11
- data/THANKS +4 -0
- data/TODO +17 -2
- data/lib/hello.rb +57 -0
- metadata +10 -8
data/CHANGELOG
CHANGED
@@ -1,5 +1,15 @@
|
|
1
|
+
= Version 0.0.1
|
2
|
+
=== Sat May 12 15:56:51 CEST 2007
|
3
|
+
* rubygem doesn't play nice with Version 0.0.0 ...
|
1
4
|
|
2
5
|
= Version 0.0
|
6
|
+
=== Wed Oct 4 22:31:04 CEST 2006
|
7
|
+
* split up README into several smaller files.
|
8
|
+
* added inline docs to hello.rb
|
9
|
+
=== Sat Sep 16 20:00:00 CEST 2006
|
10
|
+
* added some notes about Rubyforge and rdoc.
|
11
|
+
* added THANKS
|
12
|
+
* added Rake Task to upload generated docs to Rubyforge.
|
3
13
|
=== Wed Sep 13 23:37:13 CEST 2006
|
4
14
|
* added gem task
|
5
15
|
* clean
|
@@ -7,3 +17,5 @@
|
|
7
17
|
|
8
18
|
* Started development
|
9
19
|
* Directory structure, README and CHANGELOG
|
20
|
+
|
21
|
+
back[link:files/README.html]
|
data/README
CHANGED
@@ -4,12 +4,20 @@
|
|
4
4
|
This package contains a hello project which is meant to provide
|
5
5
|
suggestions concerning how to structure and package ruby projects.
|
6
6
|
|
7
|
-
*
|
8
|
-
|
9
|
-
CHANGELOG, etc)
|
10
|
-
* providing source code documentation
|
11
|
-
|
12
|
-
*
|
7
|
+
* How to structure[link:files/doc/files_and_directories_rdoc.html]
|
8
|
+
project directories, which auxilliary files to
|
9
|
+
include in a distribution (README, CHANGELOG, etc)
|
10
|
+
* providing source code documentation[link:files/doc/rdoc_rdoc.html]
|
11
|
+
using +rdoc+ approriate unit test
|
12
|
+
* {Automating tasks}[link:files/doc/rake_rdoc.html] using +rake+
|
13
|
+
* {Functional testing}[link:files/doc/functional_testing_rdoc.html]
|
14
|
+
using +Test+::+Unit+ build support using +rake+
|
15
|
+
* {Packaging and distributing}[link:files/doc/rubygems_rdoc.html] your project using +rubygems+.
|
16
|
+
* {Configuration}[link:files/doc/config_rdoc.html] and resource files.
|
17
|
+
* Internationalizing[link:files/doc/i18n_rdoc.html] your application or library.
|
18
|
+
* Providing (and parsing) proper {command line options}[link:files/doc/commandline_rdoc.html]
|
19
|
+
* Handling {plattform specific}[link:files/doc/plattform_rdoc.html] issues.
|
20
|
+
* {Distributing and promoting}[link:files/doc/dist_rdoc.html] your project.
|
13
21
|
|
14
22
|
None of the suggestions here are set in stone, so feel free to do things
|
15
23
|
diffrently if you feel it makes more sense. (I prefer to indent using
|
@@ -17,105 +25,43 @@ tabs not spaces, which is the 'norm' in ruby). Consider this project to
|
|
17
25
|
be a template that might help you through the tedium of setting up a
|
18
26
|
project infrastructure to help you get coding real stuff quicker.
|
19
27
|
|
20
|
-
|
21
|
-
== Files and Directories
|
22
|
-
|
23
|
-
Providing the typical distribution files and directory structure that a
|
24
|
-
programmer expects make it easier for others to work with a freshly
|
25
|
-
unpacked package. Just imagine a world where everyhting is where you
|
26
|
-
expect it. Birds chirping peacefully be the stream, a README containing
|
27
|
-
all the information you need, and not long winded musings ...
|
28
|
-
|
29
|
-
* +README+ first stop for users of the package. Should contain
|
30
|
-
general information what the project is about, how to install, where
|
31
|
-
to get help.
|
32
|
-
|
33
|
-
* +CHANGELOG+ contains information about what changed between diffrent
|
34
|
-
revisions of the software. Some packages like to call this file
|
35
|
-
+RELEASES+.
|
36
|
-
|
37
|
-
* +LICENSE+ should contain information about the license
|
38
|
-
that the software is provided under. This file is sometimes called
|
39
|
-
+COPYING+, especially if it contains the GPL.
|
40
|
-
|
41
|
-
* +AUTHORS+ lists contributors to the project, a short description of
|
42
|
-
their contribution and how they can be reached.
|
43
|
-
|
44
|
-
* +TODO+ things left laying around. Stuff you never get around doing.
|
45
|
-
Boring crap.
|
46
|
-
|
47
|
-
* +Rakefile+ just like a +Makefile+, only for ruby. If you don't know what
|
48
|
-
either +make+ or +rake+ is: they're tools to automate tedious
|
49
|
-
repetitive stuff (called tasks) that need to be done during certain
|
50
|
-
stages of your project, like creating packages, uploading stuff to
|
51
|
-
repositories and to figure out if all dependancies for the task at
|
52
|
-
hand are met. But you either already knew that or if not most likely
|
53
|
-
still don't understand what +rake+ is about, so look around
|
54
|
-
here[http://rake.rubyforge.org/]. Actually that probably wouldn't
|
55
|
-
help much either, maybe try
|
56
|
-
this[http://jimweirich.umlcoop.net/index.cgi/Tech/Rake/Tutorial/RakeTutorialIntroduction.rdoc]
|
57
|
-
or this[http://docs.rubyrake.org/] or google around a little bit.
|
58
|
-
|
59
|
-
* +gemspec+ the specification for the +gem+ packaging is sometimes
|
60
|
-
maintained in a seperate file, but it's easiest to just pack it into
|
61
|
-
the +Rakefile+.
|
62
|
-
|
63
28
|
== Installing
|
64
29
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
30
|
+
Having a "Installing" section is a bit of a chicken or egg question.
|
31
|
+
Someone reading the README has, in all likelyhood already installed your
|
32
|
+
package. On the other hand, in case your project has a more involved
|
33
|
+
build process, it might be worthwhile to consider describing it in a
|
34
|
+
seperate INSTALL file.
|
69
35
|
|
70
|
-
|
36
|
+
It can't hurt to provide canonical instructions for installation,
|
37
|
+
though. You can install the +hello+ package by executing:
|
71
38
|
|
72
|
-
|
73
|
-
this, chances are you've already downloaded the package
|
74
|
-
here[http://www.kuriositaet.de/ruby/hello].
|
39
|
+
gem install hello -r
|
75
40
|
|
76
|
-
|
41
|
+
alternatively, you can download +.tar.gz+ or +.zip+ archives from
|
42
|
+
Rubyforge[http://rubyforge.org/frs/?group_id=2203].
|
77
43
|
|
78
|
-
== Tools
|
79
44
|
|
80
|
-
|
45
|
+
== Mailing List
|
81
46
|
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
here[http://www.ruby-doc.org/stdlib/libdoc/rdoc/rdoc/classes/RDoc.html].
|
88
|
-
|
89
|
-
=== Unit Testing using +runit+
|
47
|
+
In case you discover bugs, spelling errors, offer suggestions for
|
48
|
+
improvements or would like to help out with the project, you can contact
|
49
|
+
me directly (tim@kuriositaet.de) or through the mailing list
|
50
|
+
(hello-talk@rubyforge.org).
|
51
|
+
|
90
52
|
|
91
|
-
=== Build Support using +rake+
|
92
53
|
|
93
|
-
+rake+ belongs to the defacto standard toolset for ruby. It's basically
|
94
|
-
the ruby equivalent of +make+ in that it's a tool for dealing with
|
95
|
-
dependancies and automating routine tasks. The tasks typically expected
|
96
|
-
to be in a +Rakefile+ are:
|
97
54
|
|
98
|
-
* clean - remove all temporary, intermediary and generated files
|
99
|
-
* rdoc - generate +rdoc+ documentation
|
100
|
-
* test - run the packages test suite
|
101
|
-
* package - assemble all the necessary files into a package for
|
102
|
-
distribution
|
103
55
|
|
104
56
|
|
105
57
|
|
106
58
|
|
107
|
-
=== Packaging using +rubygems+
|
108
59
|
|
109
60
|
|
110
61
|
|
111
|
-
== Commandline usage
|
112
62
|
|
113
|
-
== Plattform Specific Issues
|
114
63
|
|
115
|
-
== Distributing and Promoting the Project
|
116
64
|
|
117
|
-
=== rubygems
|
118
|
-
=== rubyforge sourceforge
|
119
|
-
=== Ruby Application Archive
|
120
65
|
|
121
66
|
|
67
|
+
=
|
data/Rakefile
CHANGED
@@ -1,8 +1,20 @@
|
|
1
1
|
require "rake/rdoctask"
|
2
2
|
require "rake/gempackagetask"
|
3
|
+
require "rake/testtask"
|
3
4
|
require "rake/clean"
|
4
5
|
require "rubygems"
|
5
6
|
|
7
|
+
# Some definitions that you'll need to edit in case you reuse this
|
8
|
+
# Rakefile for your own project.
|
9
|
+
|
10
|
+
SHORTNAME ='hello' # this should be the rubyforge project name
|
11
|
+
DESC ='An example Ruby project'
|
12
|
+
PKG_VERSION ='0.0.1'
|
13
|
+
LONG_DESC = <<END_DESC
|
14
|
+
This is a short project description.
|
15
|
+
END_DESC
|
16
|
+
RUBYFORGE_USER ='a2800276'
|
17
|
+
|
6
18
|
# Specifies the default task to execute. This is often the "test" task
|
7
19
|
# and we'll change things around as soon as we have some tests.
|
8
20
|
|
@@ -32,12 +44,12 @@ Rake::RDocTask.new do |rd|
|
|
32
44
|
# documenation from.
|
33
45
|
rd.rdoc_files.include( "README", "AUTHORS", "LICENSE", "TODO",
|
34
46
|
"CHANGELOG", "bin/**/*", "lib/**/*.rb",
|
35
|
-
"examples/**/*rb","test/**/*.rb")
|
47
|
+
"examples/**/*rb","test/**/*.rb", "doc/*.rdoc")
|
36
48
|
# This one specifies the output directory ...
|
37
49
|
rd.rdoc_dir = "doc/html"
|
38
50
|
|
39
51
|
# Or the HTML title of the generated documentation set.
|
40
|
-
rd.title = "
|
52
|
+
rd.title = "#{SHORTNAME}: #{DESC}"
|
41
53
|
|
42
54
|
# These are options specifiying how source code inlined in the
|
43
55
|
# documentation should be formatted.
|
@@ -56,30 +68,57 @@ end
|
|
56
68
|
|
57
69
|
# First you'll need to assemble a gemspec
|
58
70
|
|
59
|
-
PKG_VERSION = "0.0.0"
|
60
71
|
PKG_FILES = FileList['lib/**/*.rb', 'bin/**/*', 'examples/**/*', '[A-Z]*', 'test/**/*'].to_a
|
61
72
|
|
62
73
|
spec = Gem::Specification.new do |s|
|
63
74
|
s.platform = Gem::Platform::RUBY
|
64
|
-
s.summary = "
|
65
|
-
s.name =
|
75
|
+
s.summary = "#{SHORTNAME}: #{DESC}"
|
76
|
+
s.name = SHORTNAME
|
66
77
|
s.version = PKG_VERSION
|
67
78
|
s.files = PKG_FILES
|
68
79
|
s.requirements << "none"
|
69
80
|
s.require_path = 'lib'
|
70
|
-
s.description =
|
71
|
-
This is a short description
|
72
|
-
END_DESC
|
81
|
+
s.description = LONG_DESC
|
73
82
|
end
|
74
83
|
|
75
|
-
|
84
|
+
# Adding a new GemPackageTask adds a task named `package`, which generates
|
85
|
+
# packages as gems, tarball and zip archives.
|
76
86
|
Rake::GemPackageTask.new(spec) do |pkg|
|
77
87
|
pkg.need_zip = true
|
78
88
|
pkg.need_tar_gz = true
|
79
89
|
end
|
80
90
|
|
81
|
-
|
82
|
-
|
91
|
+
|
92
|
+
# This task is used to demonstrate how to upload files to Rubyforge.
|
93
|
+
# Calling `upload_page` creates a current version of the +rdoc+
|
94
|
+
# documentation and uploads it to the Rubyforge homepage of the project,
|
95
|
+
# assuming it's hosted there and naming conventions haven't changed.
|
96
|
+
#
|
97
|
+
# This task uses `sh` to call the `scp` binary, which is plattform
|
98
|
+
# dependant and may not be installed on your computer if you're using
|
99
|
+
# Windows. I'm currently not aware of any pure ruby way to do scp
|
100
|
+
# transfers.
|
101
|
+
|
102
|
+
RubyForgeProject=SHORTNAME
|
103
|
+
|
104
|
+
desc "Upload the web pages to the web."
|
105
|
+
task :upload_pages => ["rdoc"] do
|
106
|
+
if RubyForgeProject then
|
107
|
+
path = "/var/www/gforge-projects/#{RubyForgeProject}"
|
108
|
+
sh "scp -r doc/html/* #{RUBYFORGE_USER}@rubyforge.org:#{path}"
|
109
|
+
sh "scp doc/images/*.png #{RUBYFORGE_USER}@rubyforge.org:#{path}/images"
|
110
|
+
end
|
83
111
|
end
|
84
112
|
|
113
|
+
# This task will run the unit tests provided in files called
|
114
|
+
# `test/test*.rb`. The task itself can be run with a call to `rake test`
|
115
|
+
|
116
|
+
Rake::TestTask.new do |t|
|
117
|
+
t.libs << "test"
|
118
|
+
t.libs << "lib"
|
119
|
+
t.test_files = FileList['test/*.rb']
|
120
|
+
t.verbose = true
|
121
|
+
end
|
122
|
+
|
123
|
+
|
85
124
|
|
data/THANKS
ADDED
data/TODO
CHANGED
@@ -1,8 +1,23 @@
|
|
1
|
-
There's so much left to do that I don't even know where to start.
|
1
|
+
There's so much left to do that I don't even know where to start. These are
|
2
|
+
just notes.
|
2
3
|
|
3
4
|
* Rakefile task for submitting to rubyforge.
|
4
|
-
|
5
|
+
xforge vs. rubyforge (...)
|
6
|
+
* Dealing with Version Control, automating tagging etc. in Rakefile
|
5
7
|
|
6
8
|
* source code commenting
|
7
9
|
* command line arguments
|
8
10
|
* dealing with c extensions
|
11
|
+
|
12
|
+
* unit testing (runit rcov)
|
13
|
+
* template for project structure.
|
14
|
+
|
15
|
+
* dealing with `data` files (e.g. ZIP code data)
|
16
|
+
* dealing with non ruby bits (sql, c)
|
17
|
+
|
18
|
+
* i18n figure out how to link between documentation files without silly
|
19
|
+
* link notation
|
20
|
+
* Release checklist (rubyforge stuff, packaging, updated documentation,
|
21
|
+
announcements: mailing lists/RAA/other listings)
|
22
|
+
|
23
|
+
|
data/lib/hello.rb
CHANGED
@@ -0,0 +1,57 @@
|
|
1
|
+
#--
|
2
|
+
# hello.rb: provide proper boilerplate docs in all sourcefiles
|
3
|
+
# specifing the author, license, and possibly some quick info about the
|
4
|
+
# file. You can surround the boilplate comments with '--' and '++' like
|
5
|
+
# we've done here to make sure it doesn't get included in the generated
|
6
|
+
# documentation.
|
7
|
+
#
|
8
|
+
#
|
9
|
+
# Copyright (c) 2006 by Tim Becker (tim@kuriositaet.de) All rights
|
10
|
+
# Reserved.
|
11
|
+
#
|
12
|
+
# This is free software. You may modify and redistribute this freely
|
13
|
+
# under your choice of the GNU General Public License or the Ruby
|
14
|
+
# License.
|
15
|
+
#
|
16
|
+
# See LICENSE for details
|
17
|
+
#
|
18
|
+
# BTW: The above does not constitute legal advice concerning how to
|
19
|
+
# handle code licensing issues.
|
20
|
+
#++
|
21
|
+
|
22
|
+
|
23
|
+
# Ruby Modules may be nested in order to provided namespaces.
|
24
|
+
module Well
|
25
|
+
# Each nested module can have it's own documenation.
|
26
|
+
module Tempered
|
27
|
+
# Lowest level of module nesting.
|
28
|
+
module Application
|
29
|
+
|
30
|
+
# Comments providing general descriptions of constructs like modules and
|
31
|
+
# classes should be provided where these are defined. The class Hello
|
32
|
+
# provides basically no functionality. It's only here to contain some
|
33
|
+
# demonstration code and in order for me to document it.
|
34
|
+
class Hello
|
35
|
+
# the constructor of the Hello class
|
36
|
+
#
|
37
|
+
def intialize name=nil
|
38
|
+
@name=name
|
39
|
+
end
|
40
|
+
|
41
|
+
# the namesake of the Hello class. Provides the well loved
|
42
|
+
# +helloworld+ functionality.
|
43
|
+
def hello
|
44
|
+
puts "Hello #{name?', ':''}#{@name}!"
|
45
|
+
end
|
46
|
+
|
47
|
+
|
48
|
+
end
|
49
|
+
|
50
|
+
# some function that does nothing. Located outside of the Hello class.
|
51
|
+
def some_function
|
52
|
+
|
53
|
+
end
|
54
|
+
|
55
|
+
end # module Application
|
56
|
+
end # module Tempered
|
57
|
+
end # module Well
|
metadata
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
|
-
rubygems_version: 0.
|
2
|
+
rubygems_version: 0.9.2
|
3
3
|
specification_version: 1
|
4
4
|
name: hello
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.0.
|
7
|
-
date:
|
8
|
-
summary: "hello:
|
6
|
+
version: 0.0.1
|
7
|
+
date: 2007-05-12 00:00:00 +02:00
|
8
|
+
summary: "hello: An example Ruby project"
|
9
9
|
require_paths:
|
10
10
|
- lib
|
11
11
|
email:
|
12
12
|
homepage:
|
13
13
|
rubyforge_project:
|
14
|
-
description: This is a short description
|
14
|
+
description: This is a short project description.
|
15
15
|
autorequire:
|
16
16
|
default_executable:
|
17
17
|
bindir: bin
|
@@ -25,17 +25,19 @@ required_ruby_version: !ruby/object:Gem::Version::Requirement
|
|
25
25
|
platform: ruby
|
26
26
|
signing_key:
|
27
27
|
cert_chain:
|
28
|
+
post_install_message:
|
28
29
|
authors: []
|
29
30
|
|
30
31
|
files:
|
31
32
|
- lib/hello.rb
|
33
|
+
- AUTHORS
|
32
34
|
- CHANGELOG
|
35
|
+
- COPYING
|
33
36
|
- LICENSE
|
34
37
|
- Rakefile
|
35
|
-
- AUTHORS
|
36
|
-
- TODO
|
37
|
-
- COPYING
|
38
38
|
- README
|
39
|
+
- THANKS
|
40
|
+
- TODO
|
39
41
|
test_files: []
|
40
42
|
|
41
43
|
rdoc_options: []
|