paperclip_waveform 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/README.rdoc +27 -0
  3. data/Rakefile +38 -0
  4. data/lib/paperclip_processors/waveform.rb +28 -0
  5. data/lib/paperclip_waveform.rb +6 -0
  6. data/lib/paperclip_waveform/version.rb +3 -0
  7. data/lib/tasks/paperclip_waveform_tasks.rake +4 -0
  8. data/test/dummy/README.rdoc +261 -0
  9. data/test/dummy/Rakefile +7 -0
  10. data/test/dummy/app/assets/javascripts/application.js +15 -0
  11. data/test/dummy/app/assets/stylesheets/application.css +13 -0
  12. data/test/dummy/app/controllers/application_controller.rb +3 -0
  13. data/test/dummy/app/helpers/application_helper.rb +2 -0
  14. data/test/dummy/app/models/audio.rb +6 -0
  15. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  16. data/test/dummy/config.ru +4 -0
  17. data/test/dummy/config/application.rb +59 -0
  18. data/test/dummy/config/boot.rb +10 -0
  19. data/test/dummy/config/database.yml +25 -0
  20. data/test/dummy/config/environment.rb +5 -0
  21. data/test/dummy/config/environments/development.rb +37 -0
  22. data/test/dummy/config/environments/production.rb +67 -0
  23. data/test/dummy/config/environments/test.rb +37 -0
  24. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  25. data/test/dummy/config/initializers/inflections.rb +15 -0
  26. data/test/dummy/config/initializers/mime_types.rb +5 -0
  27. data/test/dummy/config/initializers/secret_token.rb +7 -0
  28. data/test/dummy/config/initializers/session_store.rb +8 -0
  29. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  30. data/test/dummy/config/locales/en.yml +5 -0
  31. data/test/dummy/config/routes.rb +58 -0
  32. data/test/dummy/db/development.sqlite3 +0 -0
  33. data/test/dummy/db/migrate/20121209211921_create_audios.rb +8 -0
  34. data/test/dummy/db/schema.rb +21 -0
  35. data/test/dummy/db/test.sqlite3 +0 -0
  36. data/test/dummy/log/development.log +24 -0
  37. data/test/dummy/log/test.log +900 -0
  38. data/test/dummy/public/404.html +26 -0
  39. data/test/dummy/public/422.html +26 -0
  40. data/test/dummy/public/500.html +25 -0
  41. data/test/dummy/public/favicon.ico +0 -0
  42. data/test/dummy/script/rails +6 -0
  43. data/test/fixtures/Example.ogg +0 -0
  44. data/test/fixtures/LICENSE +3 -0
  45. data/test/paperclip_waveform_test.rb +7 -0
  46. data/test/support/db.rb +4 -0
  47. data/test/test_helper.rb +17 -0
  48. data/test/unit/audio_test.rb +14 -0
  49. metadata +207 -0
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/404.html -->
21
+ <div class="dialog">
22
+ <h1>The page you were looking for doesn't exist.</h1>
23
+ <p>You may have mistyped the address or the page may have moved.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/422.html -->
21
+ <div class="dialog">
22
+ <h1>The change you wanted was rejected.</h1>
23
+ <p>Maybe you tried to change something you didn't have access to.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,25 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/500.html -->
21
+ <div class="dialog">
22
+ <h1>We're sorry, but something went wrong.</h1>
23
+ </div>
24
+ </body>
25
+ </html>
File without changes
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3
+
4
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
5
+ require File.expand_path('../../config/boot', __FILE__)
6
+ require 'rails/commands'
Binary file
@@ -0,0 +1,3 @@
1
+ This file is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported license.
2
+ Attribution: JesseW
3
+ http://en.wikipedia.org/wiki/File:Example.ogg
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class PaperclipWaveformTest < ActiveSupport::TestCase
4
+ test "truth" do
5
+ assert_kind_of Module, PaperclipWaveform
6
+ end
7
+ end
@@ -0,0 +1,4 @@
1
+ ActiveRecord::Base.connection.create_table :audios, :force => true do |t|
2
+ end
3
+
4
+ ActiveRecord::Base.connection.add_attachment :audios, :file
@@ -0,0 +1,17 @@
1
+ # Configure Rails Environment
2
+ ENV["RAILS_ENV"] = "test"
3
+
4
+ require 'mocha'
5
+
6
+ require File.expand_path("../dummy/config/environment.rb", __FILE__)
7
+ require "rails/test_help"
8
+
9
+ Rails.backtrace_cleaner.remove_silencers!
10
+
11
+ # Load support files
12
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
13
+
14
+ # Load fixtures from the engine
15
+ if ActiveSupport::TestCase.method_defined?(:fixture_path=)
16
+ ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
17
+ end
@@ -0,0 +1,14 @@
1
+ require 'test_helper'
2
+
3
+ class AudioTest < ActiveSupport::TestCase
4
+ def test_normal_paperclip_functioning
5
+ audio = Audio.new file: File.open("#{File.dirname(__FILE__)}/../fixtures/Example.ogg")
6
+ assert audio.file.post_processing
7
+ assert audio.save
8
+ assert File.exists?(audio.file.path)
9
+ assert File.exists?(audio.file.path(:waveform))
10
+
11
+ # Delete waveform file
12
+ audio.destroy
13
+ end
14
+ end
metadata ADDED
@@ -0,0 +1,207 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: paperclip_waveform
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Antonio Tapiador
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-12-26 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: paperclip
16
+ requirement: &81933410 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *81933410
25
+ - !ruby/object:Gem::Dependency
26
+ name: waveform
27
+ requirement: &81932870 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ~>
31
+ - !ruby/object:Gem::Version
32
+ version: 0.1.2
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: *81932870
36
+ - !ruby/object:Gem::Dependency
37
+ name: rails
38
+ requirement: &81931910 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ type: :development
45
+ prerelease: false
46
+ version_requirements: *81931910
47
+ - !ruby/object:Gem::Dependency
48
+ name: sqlite3
49
+ requirement: &81943440 !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ type: :development
56
+ prerelease: false
57
+ version_requirements: *81943440
58
+ - !ruby/object:Gem::Dependency
59
+ name: mocha
60
+ requirement: &81942860 !ruby/object:Gem::Requirement
61
+ none: false
62
+ requirements:
63
+ - - ! '>='
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
66
+ type: :development
67
+ prerelease: false
68
+ version_requirements: *81942860
69
+ - !ruby/object:Gem::Dependency
70
+ name: debugger
71
+ requirement: &81942450 !ruby/object:Gem::Requirement
72
+ none: false
73
+ requirements:
74
+ - - ! '>='
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ type: :development
78
+ prerelease: false
79
+ version_requirements: *81942450
80
+ description: Paperclip Waveform is a Paperclip post-processor that creates a png file
81
+ with the waveform of the audio attachment .
82
+ email:
83
+ - atapiador@dit.upm.es
84
+ executables: []
85
+ extensions: []
86
+ extra_rdoc_files: []
87
+ files:
88
+ - lib/paperclip_processors/waveform.rb
89
+ - lib/paperclip_waveform.rb
90
+ - lib/paperclip_waveform/version.rb
91
+ - lib/tasks/paperclip_waveform_tasks.rake
92
+ - MIT-LICENSE
93
+ - Rakefile
94
+ - README.rdoc
95
+ - test/fixtures/Example.ogg
96
+ - test/fixtures/LICENSE
97
+ - test/support/db.rb
98
+ - test/unit/audio_test.rb
99
+ - test/dummy/config.ru
100
+ - test/dummy/script/rails
101
+ - test/dummy/db/schema.rb
102
+ - test/dummy/db/development.sqlite3
103
+ - test/dummy/db/test.sqlite3
104
+ - test/dummy/db/migrate/20121209211921_create_audios.rb
105
+ - test/dummy/config/locales/en.yml
106
+ - test/dummy/config/boot.rb
107
+ - test/dummy/config/environments/development.rb
108
+ - test/dummy/config/environments/test.rb
109
+ - test/dummy/config/environments/production.rb
110
+ - test/dummy/config/application.rb
111
+ - test/dummy/config/routes.rb
112
+ - test/dummy/config/initializers/session_store.rb
113
+ - test/dummy/config/initializers/wrap_parameters.rb
114
+ - test/dummy/config/initializers/mime_types.rb
115
+ - test/dummy/config/initializers/secret_token.rb
116
+ - test/dummy/config/initializers/backtrace_silencers.rb
117
+ - test/dummy/config/initializers/inflections.rb
118
+ - test/dummy/config/database.yml
119
+ - test/dummy/config/environment.rb
120
+ - test/dummy/Rakefile
121
+ - test/dummy/log/development.log
122
+ - test/dummy/log/test.log
123
+ - test/dummy/app/assets/stylesheets/application.css
124
+ - test/dummy/app/assets/javascripts/application.js
125
+ - test/dummy/app/controllers/application_controller.rb
126
+ - test/dummy/app/helpers/application_helper.rb
127
+ - test/dummy/app/models/audio.rb
128
+ - test/dummy/app/views/layouts/application.html.erb
129
+ - test/dummy/README.rdoc
130
+ - test/dummy/public/404.html
131
+ - test/dummy/public/500.html
132
+ - test/dummy/public/favicon.ico
133
+ - test/dummy/public/422.html
134
+ - test/test_helper.rb
135
+ - test/paperclip_waveform_test.rb
136
+ homepage: https://github.com/atd/paperclip_waveform
137
+ licenses: []
138
+ post_install_message:
139
+ rdoc_options: []
140
+ require_paths:
141
+ - lib
142
+ required_ruby_version: !ruby/object:Gem::Requirement
143
+ none: false
144
+ requirements:
145
+ - - ! '>='
146
+ - !ruby/object:Gem::Version
147
+ version: '0'
148
+ segments:
149
+ - 0
150
+ hash: 893440787
151
+ required_rubygems_version: !ruby/object:Gem::Requirement
152
+ none: false
153
+ requirements:
154
+ - - ! '>='
155
+ - !ruby/object:Gem::Version
156
+ version: '0'
157
+ segments:
158
+ - 0
159
+ hash: 893440787
160
+ requirements: []
161
+ rubyforge_project:
162
+ rubygems_version: 1.8.10
163
+ signing_key:
164
+ specification_version: 3
165
+ summary: Paperclip post-processor that generates a waveform image from audio files.
166
+ test_files:
167
+ - test/fixtures/Example.ogg
168
+ - test/fixtures/LICENSE
169
+ - test/support/db.rb
170
+ - test/unit/audio_test.rb
171
+ - test/dummy/config.ru
172
+ - test/dummy/script/rails
173
+ - test/dummy/db/schema.rb
174
+ - test/dummy/db/development.sqlite3
175
+ - test/dummy/db/test.sqlite3
176
+ - test/dummy/db/migrate/20121209211921_create_audios.rb
177
+ - test/dummy/config/locales/en.yml
178
+ - test/dummy/config/boot.rb
179
+ - test/dummy/config/environments/development.rb
180
+ - test/dummy/config/environments/test.rb
181
+ - test/dummy/config/environments/production.rb
182
+ - test/dummy/config/application.rb
183
+ - test/dummy/config/routes.rb
184
+ - test/dummy/config/initializers/session_store.rb
185
+ - test/dummy/config/initializers/wrap_parameters.rb
186
+ - test/dummy/config/initializers/mime_types.rb
187
+ - test/dummy/config/initializers/secret_token.rb
188
+ - test/dummy/config/initializers/backtrace_silencers.rb
189
+ - test/dummy/config/initializers/inflections.rb
190
+ - test/dummy/config/database.yml
191
+ - test/dummy/config/environment.rb
192
+ - test/dummy/Rakefile
193
+ - test/dummy/log/development.log
194
+ - test/dummy/log/test.log
195
+ - test/dummy/app/assets/stylesheets/application.css
196
+ - test/dummy/app/assets/javascripts/application.js
197
+ - test/dummy/app/controllers/application_controller.rb
198
+ - test/dummy/app/helpers/application_helper.rb
199
+ - test/dummy/app/models/audio.rb
200
+ - test/dummy/app/views/layouts/application.html.erb
201
+ - test/dummy/README.rdoc
202
+ - test/dummy/public/404.html
203
+ - test/dummy/public/500.html
204
+ - test/dummy/public/favicon.ico
205
+ - test/dummy/public/422.html
206
+ - test/test_helper.rb
207
+ - test/paperclip_waveform_test.rb