tagz 0.0.4 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. data/README +240 -0
  2. data/README.tmpl +240 -0
  3. data/install.rb +4 -0
  4. data/lib/tagz.rb +146 -351
  5. data/test/tagz.rb +226 -191
  6. metadata +3 -106
  7. data/lib/tagz/rails.rb +0 -198
  8. data/rails/README +0 -182
  9. data/rails/Rakefile +0 -10
  10. data/rails/app/controllers/application.rb +0 -7
  11. data/rails/app/controllers/tagz_controller.rb +0 -51
  12. data/rails/app/helpers/application_helper.rb +0 -3
  13. data/rails/app/helpers/tagz_helper.rb +0 -2
  14. data/rails/app/views/layouts/layout.rb +0 -16
  15. data/rails/app/views/tagz/b.rb +0 -19
  16. data/rails/app/views/tagz/c.rb +0 -9
  17. data/rails/app/views/tagz/d.rhtml +0 -17
  18. data/rails/app/views/tagz/e.rb +0 -3
  19. data/rails/config/boot.rb +0 -45
  20. data/rails/config/database.yml +0 -36
  21. data/rails/config/environment.rb +0 -65
  22. data/rails/config/environments/development.rb +0 -21
  23. data/rails/config/environments/production.rb +0 -18
  24. data/rails/config/environments/test.rb +0 -19
  25. data/rails/config/lighttpd.conf +0 -54
  26. data/rails/config/routes.rb +0 -23
  27. data/rails/doc/README_FOR_APP +0 -2
  28. data/rails/log/development.log +0 -6713
  29. data/rails/log/fastcgi.crash.log +0 -103
  30. data/rails/log/lighttpd.access.log +0 -171
  31. data/rails/log/lighttpd.error.log +0 -116
  32. data/rails/log/production.log +0 -0
  33. data/rails/log/server.log +0 -0
  34. data/rails/log/test.log +0 -0
  35. data/rails/public/404.html +0 -30
  36. data/rails/public/500.html +0 -30
  37. data/rails/public/dispatch.cgi +0 -10
  38. data/rails/public/dispatch.fcgi +0 -24
  39. data/rails/public/dispatch.rb +0 -10
  40. data/rails/public/favicon.ico +0 -0
  41. data/rails/public/images/rails.png +0 -0
  42. data/rails/public/index.html +0 -277
  43. data/rails/public/javascripts/application.js +0 -2
  44. data/rails/public/javascripts/controls.js +0 -833
  45. data/rails/public/javascripts/dragdrop.js +0 -942
  46. data/rails/public/javascripts/effects.js +0 -1088
  47. data/rails/public/javascripts/prototype.js +0 -2515
  48. data/rails/public/robots.txt +0 -1
  49. data/rails/script/about +0 -3
  50. data/rails/script/breakpointer +0 -3
  51. data/rails/script/console +0 -3
  52. data/rails/script/destroy +0 -3
  53. data/rails/script/generate +0 -3
  54. data/rails/script/performance/benchmarker +0 -3
  55. data/rails/script/performance/profiler +0 -3
  56. data/rails/script/plugin +0 -3
  57. data/rails/script/process/inspector +0 -3
  58. data/rails/script/process/reaper +0 -3
  59. data/rails/script/process/spawner +0 -3
  60. data/rails/script/runner +0 -3
  61. data/rails/script/server +0 -4
  62. data/rails/test/functional/tagz_controller_test.rb +0 -18
  63. data/rails/test/test_helper.rb +0 -28
  64. data/rails/tmp/cache/index.html-gzip-1958902-7552-1181801882 +0 -0
  65. data/rails/tmp/cache/javascripts/effects.js-gzip-1958907-38200-1181801882 +0 -0
  66. data/rails/tmp/cache/javascripts/prototype.js-gzip-1958906-71260-1181801882 +0 -0
  67. data/rails/tmp/sessions/ruby_sess.365e696810aa7418 +0 -0
  68. data/rails/tmp/sessions/ruby_sess.3ab0cb2f589d3855 +0 -0
  69. data/rails/tmp/sessions/ruby_sess.c812e68d96a6e99f +0 -0
  70. data/rails/tmp/sessions/ruby_sess.e0a954440a7e27d7 +0 -0
@@ -1,10 +0,0 @@
1
- # Add your own tasks in files placed in lib/tasks ending in .rake,
2
- # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
-
4
- require(File.join(File.dirname(__FILE__), 'config', 'boot'))
5
-
6
- require 'rake'
7
- require 'rake/testtask'
8
- require 'rake/rdoctask'
9
-
10
- require 'tasks/rails'
@@ -1,7 +0,0 @@
1
- # Filters added to this controller apply to all controllers in the application.
2
- # Likewise, all the methods added will be available for all controllers.
3
-
4
- class ApplicationController < ActionController::Base
5
- # Pick a unique cookie name to distinguish our session data from others'
6
- session :session_key => '_rails_session_id'
7
- end
@@ -1,51 +0,0 @@
1
- class TagzController < ApplicationController
2
- include Tagz
3
- helper{ include Tagz }
4
-
5
- ### menu
6
- def index
7
- menu = %w( a b c d e ).map{|action| "<br><a href='#{ action }'>#{ action }</a>"}
8
- render :text => "<html> <body> #{ menu } </body> </html>"
9
- end
10
-
11
- ### setup a little data
12
- def initialize
13
- @title = 'tagz!'
14
- @list = %w( a b c )
15
- end
16
-
17
- ### just using tagz inline
18
- def a
19
- text = tagz {
20
- html_{
21
- head_{ title_{ @title } }
22
-
23
- body_{
24
- ul_{ @list.each{|elem| li_{ elem } } }
25
- }
26
- }
27
- }
28
-
29
- render :text => text
30
- end
31
-
32
- ### using a simple template : app/views/tagz/b.rb
33
- def b
34
- render
35
- end
36
-
37
- ### using content_for : app/views/layouts/layout.rb app/views/tagz/c.rb
38
- def c
39
- render :layout => 'layout'
40
- end
41
-
42
- ### mixing erb and tagz
43
- def d
44
- render
45
- end
46
-
47
- ### rendering fubar content see app/views/tagz/e.rb
48
- def e
49
- render
50
- end
51
- end
@@ -1,3 +0,0 @@
1
- # Methods added to this helper will be available to all templates in the application.
2
- module ApplicationHelper
3
- end
@@ -1,2 +0,0 @@
1
- module TagzHelper
2
- end
@@ -1,16 +0,0 @@
1
- %( <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> ) +
2
-
3
- html_( 'xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"' ){
4
- head_{ title_{ @title } }
5
-
6
- body_{ |body|
7
- hr_!
8
- body << yield(:foo)
9
-
10
- hr_!
11
- body << yield
12
-
13
- hr_!
14
- body << "bar : #{ @bar }"
15
- }
16
- }
@@ -1,19 +0,0 @@
1
- html_{
2
- head_{ title_{ @title } }
3
-
4
- body_{
5
- ul_{
6
- @list.each{|elem| li_{ elem } }
7
- }
8
-
9
- hr_!
10
-
11
- em_{ 'this gets added automatically to the em tag' }
12
-
13
- hr_!
14
-
15
- self << 'more content into the body'
16
-
17
- hr_!
18
- }
19
- }
@@ -1,9 +0,0 @@
1
- @bar = 42
2
-
3
- content_for :foo do
4
- div_(:id => :foo){ 'foo' }
5
- end
6
-
7
- em_{
8
- div_{ "this here is content for the layout" }
9
- }
@@ -1,17 +0,0 @@
1
- <html>
2
- <head>
3
- <title> <%= @title %> </title>
4
- </head>
5
-
6
- <body>
7
- <%=
8
-
9
- tagz {
10
-
11
- ul_{ @list.each{|element| li_{ element } } }
12
-
13
- }
14
-
15
- %>
16
- </body>
17
- </html>
@@ -1,3 +0,0 @@
1
- a_ 'foo'
2
- b_ 'bar'
3
- c_ 'foobar'
@@ -1,45 +0,0 @@
1
- # Don't change this file. Configuration is done in config/environment.rb and config/environments/*.rb
2
-
3
- unless defined?(RAILS_ROOT)
4
- root_path = File.join(File.dirname(__FILE__), '..')
5
-
6
- unless RUBY_PLATFORM =~ /(:?mswin|mingw)/
7
- require 'pathname'
8
- root_path = Pathname.new(root_path).cleanpath(true).to_s
9
- end
10
-
11
- RAILS_ROOT = root_path
12
- end
13
-
14
- unless defined?(Rails::Initializer)
15
- if File.directory?("#{RAILS_ROOT}/vendor/rails")
16
- require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
17
- else
18
- require 'rubygems'
19
-
20
- environment_without_comments = IO.readlines(File.dirname(__FILE__) + '/environment.rb').reject { |l| l =~ /^#/ }.join
21
- environment_without_comments =~ /[^#]RAILS_GEM_VERSION = '([\d.]+)'/
22
- rails_gem_version = $1
23
-
24
- if version = defined?(RAILS_GEM_VERSION) ? RAILS_GEM_VERSION : rails_gem_version
25
- # Asking for 1.1.6 will give you 1.1.6.5206, if available -- makes it easier to use beta gems
26
- rails_gem = Gem.cache.search('rails', "~>#{version}.0").sort_by { |g| g.version.version }.last
27
-
28
- if rails_gem
29
- gem "rails", "=#{rails_gem.version.version}"
30
- require rails_gem.full_gem_path + '/lib/initializer'
31
- else
32
- STDERR.puts %(Cannot find gem for Rails ~>#{version}.0:
33
- Install the missing gem with 'gem install -v=#{version} rails', or
34
- change environment.rb to define RAILS_GEM_VERSION with your desired version.
35
- )
36
- exit 1
37
- end
38
- else
39
- gem "rails"
40
- require 'initializer'
41
- end
42
- end
43
-
44
- Rails::Initializer.run(:set_load_path)
45
- end
@@ -1,36 +0,0 @@
1
- # MySQL (default setup). Versions 4.1 and 5.0 are recommended.
2
- #
3
- # Install the MySQL driver:
4
- # gem install mysql
5
- # On MacOS X:
6
- # gem install mysql -- --include=/usr/local/lib
7
- # On Windows:
8
- # gem install mysql
9
- # Choose the win32 build.
10
- # Install MySQL and put its /bin directory on your path.
11
- #
12
- # And be sure to use new-style password hashing:
13
- # http://dev.mysql.com/doc/refman/5.0/en/old-client.html
14
- development:
15
- adapter: mysql
16
- database: rails_development
17
- username: root
18
- password:
19
- host: localhost
20
-
21
- # Warning: The database defined as 'test' will be erased and
22
- # re-generated from your development database when you run 'rake'.
23
- # Do not set this db to the same as development or production.
24
- test:
25
- adapter: mysql
26
- database: rails_test
27
- username: root
28
- password:
29
- host: localhost
30
-
31
- production:
32
- adapter: mysql
33
- database: rails_production
34
- username: root
35
- password:
36
- host: localhost
@@ -1,65 +0,0 @@
1
- # Be sure to restart your web server when you modify this file.
2
-
3
- # Uncomment below to force Rails into production mode when
4
- # you don't control web/app server and can't set it the proper way
5
- # ENV['RAILS_ENV'] ||= 'production'
6
-
7
- # Specifies gem version of Rails to use when vendor/rails is not present
8
- RAILS_GEM_VERSION = '1.2.3' unless defined? RAILS_GEM_VERSION
9
-
10
- # Bootstrap the Rails environment, frameworks, and default configuration
11
- require File.join(File.dirname(__FILE__), 'boot')
12
-
13
- Rails::Initializer.run do |config|
14
- # Settings in config/environments/* take precedence over those specified here
15
-
16
- # Skip frameworks you're not going to use (only works if using vendor/rails)
17
- # config.frameworks -= [ :action_web_service, :action_mailer ]
18
-
19
- # Only load the plugins named here, by default all plugins in vendor/plugins are loaded
20
- # config.plugins = %W( exception_notification ssl_requirement )
21
-
22
- # Add additional load paths for your own custom dirs
23
- # config.load_paths += %W( #{RAILS_ROOT}/extras )
24
-
25
- # Force all environments to use the same logger level
26
- # (by default production uses :info, the others :debug)
27
- # config.log_level = :debug
28
-
29
- # Use the database for sessions instead of the file system
30
- # (create the session table with 'rake db:sessions:create')
31
- # config.action_controller.session_store = :active_record_store
32
-
33
- # Use SQL instead of Active Record's schema dumper when creating the test database.
34
- # This is necessary if your schema can't be completely dumped by the schema dumper,
35
- # like if you have constraints or database-specific column types
36
- # config.active_record.schema_format = :sql
37
-
38
- # Activate observers that should always be running
39
- # config.active_record.observers = :cacher, :garbage_collector
40
-
41
- # Make Active Record use UTC-base instead of local time
42
- # config.active_record.default_timezone = :utc
43
-
44
- # See Rails::Configuration for more options
45
- end
46
-
47
- # Add new inflection rules using the following format
48
- # (all these examples are active by default):
49
- # Inflector.inflections do |inflect|
50
- # inflect.plural /^(ox)$/i, '\1en'
51
- # inflect.singular /^(ox)en/i, '\1'
52
- # inflect.irregular 'person', 'people'
53
- # inflect.uncountable %w( fish sheep )
54
- # end
55
-
56
- # Add new mime types for use in respond_to blocks:
57
- # Mime::Type.register "text/richtext", :rtf
58
- # Mime::Type.register "application/x-mobile", :mobile
59
-
60
- # Include your application configuration below
61
- dirname = File.dirname __FILE__
62
- libdir = File.join '..', '..', 'lib'
63
- $LOAD_PATH.unshift libdir
64
-
65
- require 'tagz.rb'
@@ -1,21 +0,0 @@
1
- # Settings specified here will take precedence over those in config/environment.rb
2
-
3
- # In the development environment your application's code is reloaded on
4
- # every request. This slows down response time but is perfect for development
5
- # since you don't have to restart the webserver when you make code changes.
6
- config.cache_classes = false
7
-
8
- # Log error messages when you accidentally call methods on nil.
9
- config.whiny_nils = true
10
-
11
- # Enable the breakpoint server that script/breakpointer connects to
12
- config.breakpoint_server = true
13
-
14
- # Show full error reports and disable caching
15
- config.action_controller.consider_all_requests_local = true
16
- config.action_controller.perform_caching = false
17
- config.action_view.cache_template_extensions = false
18
- config.action_view.debug_rjs = true
19
-
20
- # Don't care if the mailer can't send
21
- config.action_mailer.raise_delivery_errors = false
@@ -1,18 +0,0 @@
1
- # Settings specified here will take precedence over those in config/environment.rb
2
-
3
- # The production environment is meant for finished, "live" apps.
4
- # Code is not reloaded between requests
5
- config.cache_classes = true
6
-
7
- # Use a different logger for distributed setups
8
- # config.logger = SyslogLogger.new
9
-
10
- # Full error reports are disabled and caching is turned on
11
- config.action_controller.consider_all_requests_local = false
12
- config.action_controller.perform_caching = true
13
-
14
- # Enable serving of images, stylesheets, and javascripts from an asset server
15
- # config.action_controller.asset_host = "http://assets.example.com"
16
-
17
- # Disable delivery errors, bad email addresses will be ignored
18
- # config.action_mailer.raise_delivery_errors = false
@@ -1,19 +0,0 @@
1
- # Settings specified here will take precedence over those in config/environment.rb
2
-
3
- # The test environment is used exclusively to run your application's
4
- # test suite. You never need to work with it otherwise. Remember that
5
- # your test database is "scratch space" for the test suite and is wiped
6
- # and recreated between test runs. Don't rely on the data there!
7
- config.cache_classes = true
8
-
9
- # Log error messages when you accidentally call methods on nil.
10
- config.whiny_nils = true
11
-
12
- # Show full error reports and disable caching
13
- config.action_controller.consider_all_requests_local = true
14
- config.action_controller.perform_caching = false
15
-
16
- # Tell ActionMailer not to deliver emails to the real world.
17
- # The :test delivery method accumulates sent emails in the
18
- # ActionMailer::Base.deliveries array.
19
- config.action_mailer.delivery_method = :test
@@ -1,54 +0,0 @@
1
- # Default configuration file for the lighttpd web server
2
- # Start using ./script/server lighttpd
3
-
4
- server.bind = "0.0.0.0"
5
- server.port = 3000
6
-
7
- server.modules = ( "mod_rewrite", "mod_accesslog", "mod_fastcgi", "mod_compress", "mod_expire" )
8
-
9
- server.error-handler-404 = "/dispatch.fcgi"
10
- server.pid-file = CWD + "/tmp/pids/lighttpd.pid"
11
- server.document-root = CWD + "/public/"
12
-
13
- server.errorlog = CWD + "/log/lighttpd.error.log"
14
- accesslog.filename = CWD + "/log/lighttpd.access.log"
15
-
16
- url.rewrite = ( "^/$" => "index.html", "^([^.]+)$" => "$1.html" )
17
-
18
- compress.filetype = ( "text/plain", "text/html", "text/css", "text/javascript" )
19
- compress.cache-dir = CWD + "/tmp/cache"
20
-
21
- expire.url = ( "/favicon.ico" => "access 3 days",
22
- "/images/" => "access 3 days",
23
- "/stylesheets/" => "access 3 days",
24
- "/javascripts/" => "access 3 days" )
25
-
26
-
27
- # Change *-procs to 2 if you need to use Upload Progress or other tasks that
28
- # *need* to execute a second request while the first is still pending.
29
- fastcgi.server = ( ".fcgi" => ( "localhost" => (
30
- "min-procs" => 1,
31
- "max-procs" => 1,
32
- "socket" => CWD + "/tmp/sockets/fcgi.socket",
33
- "bin-path" => CWD + "/public/dispatch.fcgi",
34
- "bin-environment" => ( "RAILS_ENV" => "development" )
35
- ) ) )
36
-
37
- mimetype.assign = (
38
- ".css" => "text/css",
39
- ".gif" => "image/gif",
40
- ".htm" => "text/html",
41
- ".html" => "text/html",
42
- ".jpeg" => "image/jpeg",
43
- ".jpg" => "image/jpeg",
44
- ".js" => "text/javascript",
45
- ".png" => "image/png",
46
- ".swf" => "application/x-shockwave-flash",
47
- ".txt" => "text/plain"
48
- )
49
-
50
- # Making sure file uploads above 64k always work when using IE or Safari
51
- # For more information, see http://trac.lighttpd.net/trac/ticket/360
52
- $HTTP["useragent"] =~ "^(.*MSIE.*)|(.*AppleWebKit.*)$" {
53
- server.max-keep-alive-requests = 0
54
- }
@@ -1,23 +0,0 @@
1
- ActionController::Routing::Routes.draw do |map|
2
- # The priority is based upon order of creation: first created -> highest priority.
3
-
4
- # Sample of regular route:
5
- # map.connect 'products/:id', :controller => 'catalog', :action => 'view'
6
- # Keep in mind you can assign values other than :controller and :action
7
-
8
- # Sample of named route:
9
- # map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase'
10
- # This route can be invoked with purchase_url(:id => product.id)
11
-
12
- # You can have the root of your site routed by hooking up ''
13
- # -- just remember to delete public/index.html.
14
- # map.connect '', :controller => "welcome"
15
-
16
- # Allow downloading Web Service WSDL as a file with an extension
17
- # instead of a file named 'wsdl'
18
- map.connect ':controller/service.wsdl', :action => 'wsdl'
19
-
20
- # Install the default route as the lowest priority.
21
- map.connect ':controller/:action/:id.:format'
22
- map.connect ':controller/:action/:id'
23
- end