trek-automaton 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +4 -0
- data/License.txt +20 -0
- data/Manifest.txt +40 -0
- data/PostInstall.txt +7 -0
- data/README.txt +48 -0
- data/Rakefile +4 -0
- data/app_generators/automaton/USAGE +5 -0
- data/app_generators/automaton/automaton_generator.rb +63 -0
- data/bin/automaton +17 -0
- data/bin/automaton-course +17 -0
- data/config/hoe.rb +73 -0
- data/config/requirements.rb +15 -0
- data/generators/course/USAGE +5 -0
- data/generators/course/course_generator.rb +87 -0
- data/generators/course/templates/Info.plist +36 -0
- data/generators/course/templates/Info.strings +3 -0
- data/generators/course/templates/art.rb +43 -0
- data/generators/course/templates/template.plist +101 -0
- data/lib/automaton.rb +6 -0
- data/lib/automaton/version.rb +9 -0
- data/script/console +10 -0
- data/script/destroy +14 -0
- data/script/generate +14 -0
- data/script/txt2html +82 -0
- data/setup.rb +1585 -0
- data/spec/automaton_spec.rb +11 -0
- data/spec/spec.opts +1 -0
- data/spec/spec_helper.rb +10 -0
- data/tasks/deployment.rake +34 -0
- data/tasks/environment.rake +7 -0
- data/tasks/rspec.rake +21 -0
- data/tasks/website.rake +17 -0
- data/test/test_automaton_generator.rb +43 -0
- data/test/test_course_generator.rb +44 -0
- data/test/test_generator_helper.rb +29 -0
- data/website/index.html +11 -0
- data/website/index.txt +83 -0
- data/website/javascripts/rounded_corners_lite.inc.js +285 -0
- data/website/stylesheets/screen.css +138 -0
- data/website/template.html.erb +48 -0
- metadata +117 -0
data/History.txt
ADDED
data/License.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2008 FIXME full name
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Manifest.txt
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
History.txt
|
2
|
+
License.txt
|
3
|
+
Manifest.txt
|
4
|
+
PostInstall.txt
|
5
|
+
README.txt
|
6
|
+
Rakefile
|
7
|
+
app_generators/automaton/USAGE
|
8
|
+
app_generators/automaton/automaton_generator.rb
|
9
|
+
bin/automaton
|
10
|
+
bin/automaton-course
|
11
|
+
config/hoe.rb
|
12
|
+
config/requirements.rb
|
13
|
+
generators/course/USAGE
|
14
|
+
generators/course/course_generator.rb
|
15
|
+
generators/course/templates/Info.plist
|
16
|
+
generators/course/templates/Info.strings
|
17
|
+
generators/course/templates/art.rb
|
18
|
+
generators/course/templates/template.plist
|
19
|
+
lib/automaton.rb
|
20
|
+
lib/automaton/version.rb
|
21
|
+
script/console
|
22
|
+
script/destroy
|
23
|
+
script/generate
|
24
|
+
script/txt2html
|
25
|
+
setup.rb
|
26
|
+
spec/automaton_spec.rb
|
27
|
+
spec/spec.opts
|
28
|
+
spec/spec_helper.rb
|
29
|
+
tasks/deployment.rake
|
30
|
+
tasks/environment.rake
|
31
|
+
tasks/rspec.rake
|
32
|
+
tasks/website.rake
|
33
|
+
test/test_automaton_generator.rb
|
34
|
+
test/test_course_generator.rb
|
35
|
+
test/test_generator_helper.rb
|
36
|
+
website/index.html
|
37
|
+
website/index.txt
|
38
|
+
website/javascripts/rounded_corners_lite.inc.js
|
39
|
+
website/stylesheets/screen.css
|
40
|
+
website/template.html.erb
|
data/PostInstall.txt
ADDED
data/README.txt
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
= automaton
|
2
|
+
|
3
|
+
* FIX (url)
|
4
|
+
|
5
|
+
== DESCRIPTION:
|
6
|
+
|
7
|
+
FIX (describe your package)
|
8
|
+
|
9
|
+
== FEATURES/PROBLEMS:
|
10
|
+
|
11
|
+
* FIX (list of features or problems)
|
12
|
+
|
13
|
+
== SYNOPSIS:
|
14
|
+
|
15
|
+
FIX (code sample of usage)
|
16
|
+
|
17
|
+
== REQUIREMENTS:
|
18
|
+
|
19
|
+
* FIX (list of requirements)
|
20
|
+
|
21
|
+
== INSTALL:
|
22
|
+
|
23
|
+
* FIX (sudo gem install, anything else)
|
24
|
+
|
25
|
+
== LICENSE:
|
26
|
+
|
27
|
+
(The MIT License)
|
28
|
+
|
29
|
+
Copyright (c) 2008 FIXME full name
|
30
|
+
|
31
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
32
|
+
a copy of this software and associated documentation files (the
|
33
|
+
'Software'), to deal in the Software without restriction, including
|
34
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
35
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
36
|
+
permit persons to whom the Software is furnished to do so, subject to
|
37
|
+
the following conditions:
|
38
|
+
|
39
|
+
The above copyright notice and this permission notice shall be
|
40
|
+
included in all copies or substantial portions of the Software.
|
41
|
+
|
42
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
43
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
44
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
45
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
46
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
47
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
48
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
class AutomatonGenerator < RubiGen::Base
|
2
|
+
|
3
|
+
DEFAULT_SHEBANG = File.join(Config::CONFIG['bindir'],
|
4
|
+
Config::CONFIG['ruby_install_name'])
|
5
|
+
|
6
|
+
default_options :author => nil
|
7
|
+
|
8
|
+
attr_reader :name
|
9
|
+
|
10
|
+
def initialize(runtime_args, runtime_options = {})
|
11
|
+
super
|
12
|
+
puts args.inspect
|
13
|
+
usage if args.empty?
|
14
|
+
@destination_root = File.expand_path(args.shift)
|
15
|
+
@name = base_name
|
16
|
+
extract_options
|
17
|
+
end
|
18
|
+
|
19
|
+
def manifest
|
20
|
+
record do |m|
|
21
|
+
# Ensure appropriate folder(s) exists
|
22
|
+
m.directory ''
|
23
|
+
BASEDIRS.each { |path| m.directory path }
|
24
|
+
|
25
|
+
m.dependency "install_rubigen_scripts", [destination_root, 'automaton'],
|
26
|
+
:shebang => options[:shebang], :collision => :force
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
protected
|
31
|
+
def banner
|
32
|
+
<<-EOS
|
33
|
+
Creates a ...
|
34
|
+
|
35
|
+
USAGE: #{spec.name} name
|
36
|
+
EOS
|
37
|
+
end
|
38
|
+
|
39
|
+
def add_options!(opts)
|
40
|
+
opts.separator ''
|
41
|
+
opts.separator 'Options:'
|
42
|
+
# For each option below, place the default
|
43
|
+
# at the top of the file next to "default_options"
|
44
|
+
# opts.on("-a", "--author=\"Your Name\"", String,
|
45
|
+
# "Some comment about this option",
|
46
|
+
# "Default: none") { |options[:author]| }
|
47
|
+
opts.on("-v", "--version", "Show the #{File.basename($0)} version number and quit.")
|
48
|
+
end
|
49
|
+
|
50
|
+
def extract_options
|
51
|
+
# for each option, extract it into a local variable (and create an "attr_reader :author" at the top)
|
52
|
+
# Templates can access these value via the attr_reader-generated methods, but not the
|
53
|
+
# raw instance variable value.
|
54
|
+
# @author = options[:author]
|
55
|
+
end
|
56
|
+
|
57
|
+
# Installation skeleton. Intermediate directories are automatically
|
58
|
+
# created so don't sweat their absence here.
|
59
|
+
BASEDIRS = %w(
|
60
|
+
script
|
61
|
+
tmp
|
62
|
+
)
|
63
|
+
end
|
data/bin/automaton
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'rubigen'
|
5
|
+
|
6
|
+
if %w(-v --version).include? ARGV.first
|
7
|
+
require 'automaton/version'
|
8
|
+
puts "#{File.basename($0)} #{Automaton::VERSION::STRING}"
|
9
|
+
exit(0)
|
10
|
+
end
|
11
|
+
|
12
|
+
require 'rubigen/scripts/generate'
|
13
|
+
source = RubiGen::PathSource.new(:application,
|
14
|
+
File.join(File.dirname(__FILE__), "../app_generators"))
|
15
|
+
RubiGen::Base.reset_sources
|
16
|
+
RubiGen::Base.append_sources source
|
17
|
+
RubiGen::Scripts::Generate.new.run(ARGV, :generator => 'automaton')
|
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'rubigen'
|
5
|
+
|
6
|
+
if %w(-v --version).include? ARGV.first
|
7
|
+
require 'automaton/version'
|
8
|
+
puts "#{File.basename($0)} #{Automaton::VERSION::STRING}"
|
9
|
+
exit(0)
|
10
|
+
end
|
11
|
+
|
12
|
+
require 'rubigen/scripts/generate'
|
13
|
+
source = RubiGen::PathSource.new(:course,
|
14
|
+
File.join(File.dirname(__FILE__), "../generators"))
|
15
|
+
RubiGen::Base.reset_sources
|
16
|
+
RubiGen::Base.append_sources source
|
17
|
+
RubiGen::Scripts::Generate.new.run(ARGV, :generator => 'course')
|
data/config/hoe.rb
ADDED
@@ -0,0 +1,73 @@
|
|
1
|
+
require 'automaton/version'
|
2
|
+
|
3
|
+
AUTHOR = 'FIXME full name' # can also be an array of Authors
|
4
|
+
EMAIL = "FIXME email"
|
5
|
+
DESCRIPTION = "description of gem"
|
6
|
+
GEM_NAME = 'automaton' # what ppl will type to install your gem
|
7
|
+
RUBYFORGE_PROJECT = 'automaton' # The unix name for your project
|
8
|
+
HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.org"
|
9
|
+
DOWNLOAD_PATH = "http://rubyforge.org/projects/#{RUBYFORGE_PROJECT}"
|
10
|
+
EXTRA_DEPENDENCIES = [
|
11
|
+
# ['activesupport', '>= 1.3.1']
|
12
|
+
] # An array of rubygem dependencies [name, version]
|
13
|
+
|
14
|
+
@config_file = "~/.rubyforge/user-config.yml"
|
15
|
+
@config = nil
|
16
|
+
RUBYFORGE_USERNAME = "unknown"
|
17
|
+
def rubyforge_username
|
18
|
+
unless @config
|
19
|
+
begin
|
20
|
+
@config = YAML.load(File.read(File.expand_path(@config_file)))
|
21
|
+
rescue
|
22
|
+
puts <<-EOS
|
23
|
+
ERROR: No rubyforge config file found: #{@config_file}
|
24
|
+
Run 'rubyforge setup' to prepare your env for access to Rubyforge
|
25
|
+
- See http://newgem.rubyforge.org/rubyforge.html for more details
|
26
|
+
EOS
|
27
|
+
exit
|
28
|
+
end
|
29
|
+
end
|
30
|
+
RUBYFORGE_USERNAME.replace @config["username"]
|
31
|
+
end
|
32
|
+
|
33
|
+
|
34
|
+
REV = nil
|
35
|
+
# UNCOMMENT IF REQUIRED:
|
36
|
+
# REV = YAML.load(`svn info`)['Revision']
|
37
|
+
VERS = Automaton::VERSION::STRING + (REV ? ".#{REV}" : "")
|
38
|
+
RDOC_OPTS = ['--quiet', '--title', 'automaton documentation',
|
39
|
+
"--opname", "index.html",
|
40
|
+
"--line-numbers",
|
41
|
+
"--main", "README",
|
42
|
+
"--inline-source"]
|
43
|
+
|
44
|
+
class Hoe
|
45
|
+
def extra_deps
|
46
|
+
@extra_deps.reject! { |x| Array(x).first == 'hoe' }
|
47
|
+
@extra_deps
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
# Generate all the Rake tasks
|
52
|
+
# Run 'rake -T' to see list of generated tasks (from gem root directory)
|
53
|
+
$hoe = Hoe.new(GEM_NAME, VERS) do |p|
|
54
|
+
p.developer(AUTHOR, EMAIL)
|
55
|
+
p.description = DESCRIPTION
|
56
|
+
p.summary = DESCRIPTION
|
57
|
+
p.url = HOMEPATH
|
58
|
+
p.rubyforge_name = RUBYFORGE_PROJECT if RUBYFORGE_PROJECT
|
59
|
+
p.test_globs = ["test/**/test_*.rb"]
|
60
|
+
p.clean_globs |= ['**/.*.sw?', '*.gem', '.config', '**/.DS_Store'] #An array of file patterns to delete on clean.
|
61
|
+
|
62
|
+
# == Optional
|
63
|
+
p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
|
64
|
+
#p.extra_deps = EXTRA_DEPENDENCIES
|
65
|
+
|
66
|
+
#p.spec_extras = {} # A hash of extra values to set in the gemspec.
|
67
|
+
end
|
68
|
+
|
69
|
+
CHANGES = $hoe.paragraphs_of('History.txt', 0..1).join("\\n\\n")
|
70
|
+
PATH = (RUBYFORGE_PROJECT == GEM_NAME) ? RUBYFORGE_PROJECT : "#{RUBYFORGE_PROJECT}/#{GEM_NAME}"
|
71
|
+
$hoe.remote_rdoc_dir = File.join(PATH.gsub(/^#{RUBYFORGE_PROJECT}\/?/,''), 'rdoc')
|
72
|
+
$hoe.rsync_args = '-av --delete --ignore-errors'
|
73
|
+
$hoe.spec.post_install_message = File.open(File.dirname(__FILE__) + "/../PostInstall.txt").read rescue ""
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
include FileUtils
|
3
|
+
|
4
|
+
require 'rubygems'
|
5
|
+
%w[rake hoe newgem rubigen].each do |req_gem|
|
6
|
+
begin
|
7
|
+
require req_gem
|
8
|
+
rescue LoadError
|
9
|
+
puts "This Rakefile requires the '#{req_gem}' RubyGem."
|
10
|
+
puts "Installation: gem install #{req_gem} -y"
|
11
|
+
exit
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
$:.unshift(File.join(File.dirname(__FILE__), %w[.. lib]))
|
@@ -0,0 +1,87 @@
|
|
1
|
+
class CourseGenerator < RubiGen::Base
|
2
|
+
|
3
|
+
default_options :author => nil
|
4
|
+
|
5
|
+
attr_reader :name, :audio_tab, :video_tab
|
6
|
+
|
7
|
+
def initialize(runtime_args, runtime_options = {})
|
8
|
+
super
|
9
|
+
usage unless args.size == 3
|
10
|
+
@name, @audio_tab, @video_tab = args
|
11
|
+
extract_options
|
12
|
+
end
|
13
|
+
|
14
|
+
def manifest
|
15
|
+
record do |m|
|
16
|
+
# Ensure appropriate folder(s) exists
|
17
|
+
# the structure of a workflow bundle is
|
18
|
+
#
|
19
|
+
# Bundle Name.pwf
|
20
|
+
# Contents
|
21
|
+
# Info.plist
|
22
|
+
# Resources
|
23
|
+
# Compositions
|
24
|
+
# en.lproj
|
25
|
+
# InfoPlist.strings
|
26
|
+
# Images
|
27
|
+
# Movies
|
28
|
+
# template.plist
|
29
|
+
# Templates
|
30
|
+
# Tools
|
31
|
+
# art.rb
|
32
|
+
|
33
|
+
# Base bundle
|
34
|
+
m.directory "#{name}.pwf"
|
35
|
+
|
36
|
+
# The Bundles Contents folder
|
37
|
+
m.directory "#{name}.pwf/Contents"
|
38
|
+
|
39
|
+
# The require subdirectories and files of the Contents Folder
|
40
|
+
m.file "Info.plist", "#{name}.pwf/Contents/Info.plist"
|
41
|
+
m.directory "#{name}.pwf/Contents/Resources"
|
42
|
+
|
43
|
+
# The required structure inside of Resources
|
44
|
+
%w(Compositions en.lproj Images Movies Templates Tools).each do |folder|
|
45
|
+
m.directory "#{name}.pwf/Contents/Resources/#{folder}"
|
46
|
+
end
|
47
|
+
|
48
|
+
# Copy the art file
|
49
|
+
m.file "art.rb", "#{name}.pwf/Contents/Resources/Tools/art.rb"
|
50
|
+
|
51
|
+
# Copy the english trasnlation file and the podcast prodcuer workflow file
|
52
|
+
print "name #{name}"
|
53
|
+
print "audio tab #{audio_tab}"
|
54
|
+
print "video tab #{video_tab}"
|
55
|
+
m.template "Info.strings", "#{name}.pwf/Contents/Resources/en.lproj/InfoPlist.strings"
|
56
|
+
m.template "template.plist", "#{name}.pwf/Contents/Resources/template.plist"
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
protected
|
61
|
+
def banner
|
62
|
+
<<-EOS
|
63
|
+
Creates a new Profcast Workflow bundle. The workflow template caters directly to the UM School of
|
64
|
+
Dentistry's needs for each course to have an audio and video tab.
|
65
|
+
|
66
|
+
USAGE: #{$0} #{spec.name} name
|
67
|
+
EOS
|
68
|
+
end
|
69
|
+
|
70
|
+
def add_options!(opts)
|
71
|
+
# opts.separator ''
|
72
|
+
# opts.separator 'Options:'
|
73
|
+
# For each option below, place the default
|
74
|
+
# at the top of the file next to "default_options"
|
75
|
+
# opts.on("-a", "--author=\"Your Name\"", String,
|
76
|
+
# "Some comment about this option",
|
77
|
+
# "Default: none") { |options[:author]| }
|
78
|
+
# opts.on("-v", "--version", "Show the #{File.basename($0)} version number and quit.")
|
79
|
+
end
|
80
|
+
|
81
|
+
def extract_options
|
82
|
+
# for each option, extract it into a local variable (and create an "attr_reader :author" at the top)
|
83
|
+
# Templates can access these value via the attr_reader-generated methods, but not the
|
84
|
+
# raw instance variable value.
|
85
|
+
# @author = options[:author]
|
86
|
+
end
|
87
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
3
|
+
<plist version="1.0">
|
4
|
+
<dict>
|
5
|
+
<key>CFBundleDevelopmentRegion</key>
|
6
|
+
<string>English</string>
|
7
|
+
<key>CFBundleDisplayName</key>
|
8
|
+
<string>Name</string>
|
9
|
+
<key>CFBundleGetInfoString</key>
|
10
|
+
<string>Description</string>
|
11
|
+
<key>CFBundleIdentifier</key>
|
12
|
+
<string>com.apple.PodcastProducer.workflow.Workflow_0</string>
|
13
|
+
<key>CFBundleInfoDictionaryVersion</key>
|
14
|
+
<string>6.0</string>
|
15
|
+
<key>CFBundleName</key>
|
16
|
+
<string>Workflow 0</string>
|
17
|
+
<key>CFBundlePackageType</key>
|
18
|
+
<string>BNDL</string>
|
19
|
+
<key>CFBundleShortVersionString</key>
|
20
|
+
<string>10</string>
|
21
|
+
<key>CFBundleSignature</key>
|
22
|
+
<string>????</string>
|
23
|
+
<key>CFBundleVersion</key>
|
24
|
+
<string>74</string>
|
25
|
+
<key>Description</key>
|
26
|
+
<string>Description</string>
|
27
|
+
<key>NSHumanReadableCopyright</key>
|
28
|
+
<string>Copyright</string>
|
29
|
+
<key>Name</key>
|
30
|
+
<string>Name</string>
|
31
|
+
<key>Notes</key>
|
32
|
+
<string></string>
|
33
|
+
<key>PcastWorkflowVersion</key>
|
34
|
+
<string>1.0</string>
|
35
|
+
</dict>
|
36
|
+
</plist>
|