Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
64 changed files
with
1,381 additions
and
550 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.bundle/ | ||
log/*.log | ||
pkg/ | ||
test/dummy/db/*.sqlite3 | ||
test/dummy/log/*.log | ||
test/dummy/tmp/ | ||
test/dummy/.sass-cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
source "http://rubygems.org" | ||
|
||
# Declare your gem's dependencies in swf_fu.gemspec. | ||
# Bundler will treat runtime dependencies like base dependencies, and | ||
# development dependencies will be added by default to the :development group. | ||
gemspec | ||
|
||
# jquery-rails is used by the dummy application | ||
gem "jquery-rails" | ||
|
||
# Declare any dependencies that are still in development here instead of in | ||
# your gemspec. These might include edge Rails or gems from your path or | ||
# Git. Remember to move these dependencies to your gemspec before releasing | ||
# your gem to rubygems.org. | ||
|
||
# To use debugger | ||
# gem 'ruby-debug19', :require => 'ruby-debug' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
PATH | ||
remote: . | ||
specs: | ||
swf_fu (2.0.0) | ||
coffee-script | ||
rails (~> 3.1) | ||
|
||
GEM | ||
remote: http://rubygems.org/ | ||
specs: | ||
actionmailer (3.2.2) | ||
actionpack (= 3.2.2) | ||
mail (~> 2.4.0) | ||
actionpack (3.2.2) | ||
activemodel (= 3.2.2) | ||
activesupport (= 3.2.2) | ||
builder (~> 3.0.0) | ||
erubis (~> 2.7.0) | ||
journey (~> 1.0.1) | ||
rack (~> 1.4.0) | ||
rack-cache (~> 1.1) | ||
rack-test (~> 0.6.1) | ||
sprockets (~> 2.1.2) | ||
activemodel (3.2.2) | ||
activesupport (= 3.2.2) | ||
builder (~> 3.0.0) | ||
activerecord (3.2.2) | ||
activemodel (= 3.2.2) | ||
activesupport (= 3.2.2) | ||
arel (~> 3.0.2) | ||
tzinfo (~> 0.3.29) | ||
activeresource (3.2.2) | ||
activemodel (= 3.2.2) | ||
activesupport (= 3.2.2) | ||
activesupport (3.2.2) | ||
i18n (~> 0.6) | ||
multi_json (~> 1.0) | ||
arel (3.0.2) | ||
builder (3.0.0) | ||
coffee-script (2.2.0) | ||
coffee-script-source | ||
execjs | ||
coffee-script-source (1.2.0) | ||
erubis (2.7.0) | ||
execjs (1.3.0) | ||
multi_json (~> 1.0) | ||
hike (1.2.1) | ||
i18n (0.6.0) | ||
journey (1.0.3) | ||
jquery-rails (2.0.1) | ||
railties (>= 3.2.0, < 5.0) | ||
thor (~> 0.14) | ||
json (1.6.5) | ||
mail (2.4.4) | ||
i18n (>= 0.4.0) | ||
mime-types (~> 1.16) | ||
treetop (~> 1.4.8) | ||
mime-types (1.17.2) | ||
multi_json (1.1.0) | ||
polyglot (0.3.3) | ||
rack (1.4.1) | ||
rack-cache (1.2) | ||
rack (>= 0.4) | ||
rack-ssl (1.3.2) | ||
rack | ||
rack-test (0.6.1) | ||
rack (>= 1.0) | ||
rails (3.2.2) | ||
actionmailer (= 3.2.2) | ||
actionpack (= 3.2.2) | ||
activerecord (= 3.2.2) | ||
activeresource (= 3.2.2) | ||
activesupport (= 3.2.2) | ||
bundler (~> 1.0) | ||
railties (= 3.2.2) | ||
railties (3.2.2) | ||
actionpack (= 3.2.2) | ||
activesupport (= 3.2.2) | ||
rack-ssl (~> 1.3.2) | ||
rake (>= 0.8.7) | ||
rdoc (~> 3.4) | ||
thor (~> 0.14.6) | ||
rake (0.9.2.2) | ||
rdoc (3.12) | ||
json (~> 1.4) | ||
shoulda-context (1.0.0) | ||
sprockets (2.1.2) | ||
hike (~> 1.2) | ||
rack (~> 1.0) | ||
tilt (~> 1.1, != 1.3.0) | ||
sqlite3 (1.3.5) | ||
thor (0.14.6) | ||
tilt (1.3.3) | ||
treetop (1.4.10) | ||
polyglot | ||
polyglot (>= 0.3.1) | ||
tzinfo (0.3.32) | ||
|
||
PLATFORMS | ||
ruby | ||
|
||
DEPENDENCIES | ||
coffee-script | ||
jquery-rails | ||
shoulda-context | ||
sqlite3 | ||
swf_fu! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,38 @@ | ||
require 'rake' | ||
require 'rake/testtask' | ||
require 'rake/rdoctask' | ||
#!/usr/bin/env rake | ||
begin | ||
require 'bundler/setup' | ||
rescue LoadError | ||
puts 'You must `gem install bundler` and `bundle install` to run rake tasks' | ||
end | ||
begin | ||
require 'rdoc/task' | ||
rescue LoadError | ||
require 'rdoc/rdoc' | ||
require 'rake/rdoctask' | ||
RDoc::Task = Rake::RDocTask | ||
end | ||
|
||
RDoc::Task.new(:rdoc) do |rdoc| | ||
rdoc.rdoc_dir = 'rdoc' | ||
rdoc.title = 'Swf Fu' | ||
rdoc.options << '--line-numbers' | ||
rdoc.rdoc_files.include('README.rdoc') | ||
rdoc.rdoc_files.include('lib/**/*.rb') | ||
end | ||
|
||
|
||
desc 'Default: run unit tests.' | ||
task :default => :test | ||
|
||
desc 'Test the swf_fu plugin.' | ||
|
||
Bundler::GemHelper.install_tasks | ||
|
||
require 'rake/testtask' | ||
|
||
Rake::TestTask.new(:test) do |t| | ||
t.libs << 'lib' | ||
t.libs << 'test' | ||
t.pattern = 'test/**/*_test.rb' | ||
t.verbose = true | ||
t.verbose = false | ||
end | ||
|
||
desc 'Generate documentation for the swf_fu plugin.' | ||
Rake::RDocTask.new(:rdoc) do |rdoc| | ||
rdoc.rdoc_dir = 'rdoc' | ||
rdoc.title = 'Swf Fu' | ||
rdoc.options << '--line-numbers' << '--inline-source' << '-m README.rdoc' | ||
rdoc.rdoc_files.include('*.rdoc') | ||
rdoc.rdoc_files.include('lib/**/*.rb') | ||
end | ||
|
||
task :default => :test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#= require_tree . | ||
|
||
@SwfFu = | ||
setup: (object, klass, init_args) -> | ||
object extends klass.prototype | ||
object.initialize?(init_args...) | ||
null |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
module SwfFuHelper | ||
# Returns a set of tags that display a Flash object within an | ||
# HTML page. | ||
# | ||
# Options: | ||
# * <tt>:id</tt> - the DOM +id+ of the flash +object+ element that is used to contain the Flash object; defaults to the name of the swf in +source+ | ||
# * <tt>:width, :height</tt> - the width & height of the Flash object. Defaults to "100%". These could also specified using :size | ||
# * <tt>:size</tt> - the size of the Flash object, in the form "400x300". | ||
# * <tt>:mode</tt> - Either :dynamic (default) or :static. Refer to SWFObject's doc[http://code.google.com/p/swfobject/wiki/documentation#Should_I_use_the_static_or_dynamic_publishing_method?] | ||
# * <tt>:flashvars</tt> - a Hash of variables that are passed to the swf. Can also be a string like <tt>"foo=bar&hello=world"</tt> | ||
# * <tt>:parameters</tt> - a Hash of configuration parameters for the swf. See Adobe's doc[http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_12701#optional] | ||
# * <tt>:alt</tt> - HTML text that is displayed when the Flash player is not available. Defaults to a "Get Flash" image pointing to Adobe Flash's installation page. | ||
# * <tt>:flash_version</tt> - the version of the Flash player that is required (e.g. "7" (default) or "8.1.0") | ||
# * <tt>:auto_install</tt> - a swf file that will upgrade flash player if needed (defaults to "expressInstall" which was installed by swf_fu) | ||
# * <tt>:javascript_class</tt> - specify a javascript class (e.g. "MyFlash") for your flash object. The initialize method will be called when the flash object is ready. | ||
# * <tt>:initialize</tt> - arguments to pass to the initialization method of your javascript class. | ||
# * <tt>:div_id</tt> - the DOM +id+ of the containing div itself. Defaults to <tt>"#{option[:id]}"_div</tt> | ||
# | ||
def swf_tag(source, options={}, &block) | ||
::SwfFu::Generator.new(source, options, self).generate(&block) | ||
end | ||
|
||
|
||
# Computes the path to an swf asset in the public 'swfs' directory. | ||
# Full paths from the document root will be passed through. | ||
# Used internally by +swf_tag+ to build the swf path. | ||
# | ||
# ==== Examples | ||
# swf_path("example") # => /swfs/example.swf | ||
# swf_path("example.swf") # => /swfs/example.swf | ||
# swf_path("fonts/optima") # => /swfs/fonts/optima.swf | ||
# swf_path("/fonts/optima") # => /fonts/optima.swf | ||
# swf_path("http://www.example.com/game.swf") # => http://www.example.com/game.swf | ||
# | ||
# It takes into account the global setting +asset_host+, like any other asset: | ||
# | ||
# ActionController::Base.asset_host = "http://assets.example.com" | ||
# image_path("logo.jpg") # => http://assets.example.com/images/logo.jpg | ||
# swf_path("fonts/optima") # => http://assets.example.com/swfs/fonts/optima.swf | ||
def swf_path(source) | ||
asset_paths.compute_public_path(source, 'swfs', :ext => 'swf') | ||
end | ||
alias_method :path_to_swf, :swf_path # aliased to avoid conflicts with an image_path named route | ||
|
||
# Computes the full URL to a swf asset in the public swf directory. | ||
# This will use +swf_path+ internally, so most of their behaviors will be the same. | ||
def swf_url(source) | ||
URI.join(current_host, path_to_swf(source)).to_s | ||
end | ||
alias_method :url_to_swf, :swf_url # aliased to avoid conflicts with an swf_url named route | ||
end |
Oops, something went wrong.