swf_fu 1.3.2 → 1.3.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -10,11 +10,37 @@ SWFObject's project can be found at http://code.google.com/p/swfobject
10
10
 
11
11
  == Install
12
12
 
13
- Assuming you have git[http://git-scm.com/] installed (check with <q>git version</q>), it is easy to install from your applications directory:
13
+ Assuming you have git[http://git-scm.com/] installed (check with <q>git version</q>), it is easy to install from your applications directory
14
14
 
15
- rails plugin install git://github.com/marcandre/swf_fu.git # rails 3
15
+ As a plugin:
16
16
 
17
- script/plugin install git://github.com/marcandre/swf_fu.git # rails 2 (starting at 2.0.2)
17
+ # rails 3
18
+ rails plugin install git://github.com/marcandre/swf_fu.git
19
+
20
+ # rails 2 (starting at 2.0.2)
21
+ script/plugin install git://github.com/marcandre/swf_fu.git
22
+
23
+ As a gem:
24
+
25
+ [sudo] gem install swf_fu
26
+
27
+ In rails:
28
+
29
+ # Using bundler (Rails 3.0 or 2.3.x)
30
+ gem 'swf_fu', ‘>=1.3.2', :require => “swf_fu”
31
+
32
+ # Rails 2.3.x
33
+ config.gem 'swf_fu', :lib => 'swf_fu', :version => '>=1.3.2', :source => 'http://gemcutter.org/‘
34
+
35
+ Because gems don't have install/uninstall hooks like plugins, there is some additional setup:
36
+
37
+ # Rakefile add
38
+ require 'swf_fu/tasks'
39
+
40
+ Install/uninstall swf_fu assets:
41
+
42
+ rake swf:install # Install swf_fu assets into your rails application
43
+ rake swf:uninstall # Uninstall swf_fu assets from your rails application
18
44
 
19
45
  For older versions of +rails+ or without +git+, you can always download
20
46
  +swf_fu+ from github[http://github.com/marcandre/swf_fu/archives/master] and then install it manually:
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.3.2
1
+ 1.3.3
data/lib/swf_fu/tasks.rb CHANGED
@@ -13,12 +13,10 @@ namespace :swf do
13
13
  if defined?(RAILS_ROOT)
14
14
  # Some paths
15
15
  src = File.dirname(__FILE__) + "/../../assets"
16
- puts RAILS_ROOT + "/public"
17
16
  dest = RAILS_ROOT + "/public"
18
17
 
19
- filename = "#{dest}/javascripts/swfobject.js"
20
- unless File.exist?(filename)
21
- FileUtils.cp "#{src}/javascripts/swfobject.js", filename
18
+ unless File.exist?("#{dest}/javascripts/swfobject.js")
19
+ FileUtils.cp "#{src}/javascripts/swfobject.js", "#{dest}/javascripts/swfobject.js"
22
20
  puts "Copying 'swfobject.js'"
23
21
  end
24
22
 
@@ -27,38 +25,48 @@ namespace :swf do
27
25
  puts "Creating new 'swfs' directory for swf assets"
28
26
  end
29
27
 
30
- filename = "#{dest}/swfs/expressInstall.swf"
31
- unless File.exist?(filename)
32
- FileUtils.cp "#{src}/swfs/expressInstall.swf", filename
28
+ unless File.exist?("#{dest}/swfs/expressInstall.swf")
29
+ FileUtils.cp "#{src}/swfs/expressInstall.swf", "#{dest}/swfs/expressInstall.swf"
33
30
  puts "Copying 'expressInstall.swf', the default flash auto-installer."
34
31
  end
32
+
35
33
  puts "Installation done."
36
34
  else
37
35
  puts "Unable to do installation. We need to be in the root of a Rails Application."
38
36
  end
39
37
  end
40
38
 
41
- desc "Uninstall swf_fu assets from your rails application"
42
- task :uninstall => :app_env do
39
+ task :rm_swfobject do
43
40
  if defined?(RAILS_ROOT)
44
- dest = RAILS_ROOT + "/public"
45
41
  begin
46
- FileUtils.rm "#{dest}/javascripts/swfobject.js"
42
+ FileUtils.rm "#{RAILS_ROOT}/public/javascripts/swfobject.js"
47
43
  rescue Exception => e
48
44
  puts "Warning: swfobject.js could not be deleted"
49
45
  end
46
+ end
47
+ end
48
+
49
+ task :rm_express_install do
50
+ if defined?(RAILS_ROOT)
50
51
  begin
51
- FileUtils.rm "#{dest}/swfs/expressInstall.swf"
52
+ FileUtils.rm "#{RAILS_ROOT}/public/swfs/expressInstall.swf"
52
53
  rescue Exception => e
53
54
  puts "Warning: expressInstall.swf could not be deleted"
54
55
  end
56
+ end
57
+ end
58
+
59
+ task :rm_swf_dir do
60
+ if defined?(RAILS_ROOT)
55
61
  begin
56
- Dir.rmdir "#{dest}/swfs/"
62
+ Dir.rmdir "#{RAILS_ROOT}/public/swfs/"
57
63
  rescue Exception => e
58
64
  puts "Don't remove swf directory if directory is not empty"
59
65
  end
60
- else
61
- puts "Unable to do uninstal. We need to be in the root of a Rails Application."
62
66
  end
63
67
  end
68
+
69
+ desc "Uninstall swf_fu assets from your rails application"
70
+ task :uninstall => [:app_env, :rm_swfobject, :rm_express_install, :rm_swf_dir]
71
+
64
72
  end
data/lib/swf_fu.rb CHANGED
@@ -1,2 +1,2 @@
1
- require 'action_view/helpers/swf_fu_helper'
2
- require 'action_view/helpers/asset_tag_helper/swf_asset'
1
+ require File.join(File.dirname(__FILE__), '/action_view/helpers/swf_fu_helper')
2
+ require File.join(File.dirname(__FILE__), '/action_view/helpers/asset_tag_helper/swf_asset')
data/rails/init.rb CHANGED
@@ -1,12 +1,9 @@
1
- Dir[File.join(File.dirname(__FILE__), '../vendor/*/lib')].each do |path|
2
- $LOAD_PATH.unshift path
3
- end
4
-
5
1
  require 'action_view/helpers/asset_tag_helper'
6
2
 
7
3
  require 'swf_fu'
8
4
 
9
- # ActionView::Helpers is for recent rails version, ActionView::Base for older ones (in which case ActionView::Helpers::AssetTagHelper is also needed for tests...)
5
+ # ActionView::Helpers is for recent rails version, ActionView::Base for older ones
6
+ # (in which case ActionView::Helpers::AssetTagHelper is also needed for tests...)
10
7
  ActionView::Helpers.class_eval { include ActionView::Helpers::SwfFuHelper } # For recent rails version...
11
8
  ActionView::Base.class_eval { include ActionView::Helpers::SwfFuHelper } # ...and for older ones
12
9
  ActionView::TestCase.class_eval { include ActionView::Helpers::SwfFuHelper } if defined? ActionView::TestCase # ...for tests in older versions
metadata CHANGED
@@ -1,34 +1,44 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: swf_fu
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2
4
+ prerelease: false
5
+ segments:
6
+ - 1
7
+ - 3
8
+ - 3
9
+ version: 1.3.3
5
10
  platform: ruby
6
11
  authors:
7
12
  - "Marc-Andr\xC3\xA9 Lafortune"
13
+ - Marcus Wyatt
8
14
  autorequire:
9
15
  bindir: bin
10
16
  cert_chain: []
11
17
 
12
- date: 2010-02-19 00:00:00 +13:00
18
+ date: 2010-02-24 00:00:00 +13:00
13
19
  default_executable:
14
20
  dependencies:
15
21
  - !ruby/object:Gem::Dependency
16
- name: thoughtbot-shoulda
17
- type: :development
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
22
+ name: shoulda
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
20
25
  requirements:
21
26
  - - ">="
22
27
  - !ruby/object:Gem::Version
23
- version: "0"
24
- version:
28
+ segments:
29
+ - 2
30
+ - 10
31
+ - 3
32
+ version: 2.10.3
33
+ type: :development
34
+ version_requirements: *id001
25
35
  description: |-
26
36
  swf_fu (pronounced "swif-fu", bonus joke for french speakers) uses SWFObject 2.2 to embed swf objects in HTML and supports all its options.
27
37
  SWFObject 2 is such a nice library that Adobe now uses it as the official way to embed swf!
28
38
  SWFObject's project can be found at http://code.google.com/p/swfobject
29
39
 
30
40
  swf_fu has been tested with rails v2.0 up to v3.0b and has decent test coverage so <tt>rake test:plugins</tt> should reveal any incompatibility. Comments and pull requests welcome: http://github.com/marcandre/swf_fu
31
- email: marcus.wyatt@visfleet.com
41
+ email: gemcutter@marc-andre.ca marcus.wyatt@visfleet.com
32
42
  executables: []
33
43
 
34
44
  extensions: []
@@ -70,18 +80,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
70
80
  requirements:
71
81
  - - ">="
72
82
  - !ruby/object:Gem::Version
83
+ segments:
84
+ - 0
73
85
  version: "0"
74
- version:
75
86
  required_rubygems_version: !ruby/object:Gem::Requirement
76
87
  requirements:
77
88
  - - ">="
78
89
  - !ruby/object:Gem::Version
90
+ segments:
91
+ - 0
79
92
  version: "0"
80
- version:
81
93
  requirements: []
82
94
 
83
95
  rubyforge_project:
84
- rubygems_version: 1.3.5
96
+ rubygems_version: 1.3.6
85
97
  signing_key:
86
98
  specification_version: 3
87
99
  summary: With the swf_fu gem, rails treats your swf files like any other asset (images, javascripts, etc...).