modulate 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -13,8 +13,8 @@ class ModulateGenerator < Rails::Generators::Base
13
13
  end
14
14
 
15
15
  def copy_view_files
16
- template "_modulate_documents.html.haml", "app/views/#{model_name.underscore}s/_modulate_#{model_name.underscore}_documents.html.haml"
17
- template "_modulate_attachments.html.haml", "app/views/#{model_name.underscore}s/_modulate_attachments.html.haml"
16
+ template "_modulate_documents.html.haml", "#{folder_name}s/_modulate_#{partial_name}_documents.html.haml"
17
+ template "_modulate_attachments.html.haml", "#{folder_name}s/_modulate_attachments.html.haml"
18
18
  end
19
19
 
20
20
  def copy_initializer
@@ -29,5 +29,24 @@ class ModulateGenerator < Rails::Generators::Base
29
29
  File.open(path, 'wb') { |file| file.write(content) }
30
30
  end
31
31
 
32
+ def partial_name
33
+ name.join("_")
34
+ end
35
+
36
+ def name
37
+ model_name.downcase.split('::')
38
+ end
39
+
40
+ def folder_name
41
+ array = name.tap{
42
+ last = name.last
43
+ new = last + 's'
44
+ name.pop
45
+ name.push new
46
+ }
47
+ tail = array.join("/")
48
+ "app/views/#{tail}"
49
+ end
50
+
32
51
  end
33
52
 
@@ -1,3 +1,3 @@
1
1
  module Modulate
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -3858,3 +3858,21 @@ Served asset /application.js - 304 Not Modified (1ms)
3858
3858
  Connecting to database specified by database.yml
3859
3859
  Connecting to database specified by database.yml
3860
3860
  Connecting to database specified by database.yml
3861
+ Connecting to database specified by database.yml
3862
+ Connecting to database specified by database.yml
3863
+ Connecting to database specified by database.yml
3864
+ Connecting to database specified by database.yml
3865
+ Connecting to database specified by database.yml
3866
+ Connecting to database specified by database.yml
3867
+ Connecting to database specified by database.yml
3868
+ Connecting to database specified by database.yml
3869
+ Connecting to database specified by database.yml
3870
+ Connecting to database specified by database.yml
3871
+ Connecting to database specified by database.yml
3872
+ Connecting to database specified by database.yml
3873
+ Connecting to database specified by database.yml
3874
+ Connecting to database specified by database.yml
3875
+ Connecting to database specified by database.yml
3876
+ Connecting to database specified by database.yml
3877
+ Connecting to database specified by database.yml
3878
+ Connecting to database specified by database.yml
@@ -360,3 +360,97 @@ Processing by AccountsController#index as HTML
360
360
  Account Load (0.3ms) SELECT `accounts`.* FROM `accounts` 
361
361
  Rendered accounts/index.html.haml within layouts/application (1.2ms)
362
362
  Completed 200 OK in 11ms (Views: 4.7ms | ActiveRecord: 0.3ms)
363
+ Connecting to database specified by database.yml
364
+  (0.1ms) BEGIN
365
+ SQL (2.1ms) INSERT INTO `accounts` (`created_at`, `name`, `updated_at`) VALUES ('2013-03-27 18:25:49', 'test_account', '2013-03-27 18:25:49')
366
+  (0.4ms) COMMIT
367
+ Started GET "/accounts/36" for 127.0.0.1 at 2013-03-27 14:25:49 -0400
368
+ Processing by AccountsController#show as HTML
369
+ Parameters: {"id"=>"36"}
370
+ Account Load (0.3ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 36 LIMIT 1
371
+ Rendered accounts/_modulate_attachments.html.haml (15.8ms)
372
+ Rendered accounts/show.html.erb within layouts/application (24.8ms)
373
+ Completed 500 Internal Server Error in 100ms
374
+ Connecting to database specified by database.yml
375
+  (0.1ms) BEGIN
376
+ SQL (2.2ms) INSERT INTO `accounts` (`created_at`, `name`, `updated_at`) VALUES ('2013-03-27 19:26:09', 'test_account', '2013-03-27 19:26:09')
377
+  (0.4ms) COMMIT
378
+ Started GET "/accounts/37" for 127.0.0.1 at 2013-03-27 15:26:09 -0400
379
+ Processing by AccountsController#show as HTML
380
+ Parameters: {"id"=>"37"}
381
+ Account Load (0.3ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 37 LIMIT 1
382
+ Rendered accounts/_modulate_attachments.html.haml (15.6ms)
383
+ Rendered accounts/show.html.erb within layouts/application (25.6ms)
384
+ Completed 500 Internal Server Error in 47ms
385
+ Connecting to database specified by database.yml
386
+  (0.1ms) BEGIN
387
+ SQL (2.2ms) INSERT INTO `accounts` (`created_at`, `name`, `updated_at`) VALUES ('2013-03-27 19:26:50', 'test_account', '2013-03-27 19:26:50')
388
+  (0.4ms) COMMIT
389
+ Started GET "/accounts/38" for 127.0.0.1 at 2013-03-27 15:26:51 -0400
390
+ Processing by AccountsController#show as HTML
391
+ Parameters: {"id"=>"38"}
392
+ Account Load (0.3ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 38 LIMIT 1
393
+ Rendered accounts/_modulate_attachments.html.haml (16.2ms)
394
+ Rendered accounts/show.html.erb within layouts/application (25.6ms)
395
+ Completed 500 Internal Server Error in 100ms
396
+ Connecting to database specified by database.yml
397
+  (0.1ms) BEGIN
398
+ SQL (2.4ms) INSERT INTO `accounts` (`created_at`, `name`, `updated_at`) VALUES ('2013-03-27 19:27:35', 'test_account', '2013-03-27 19:27:35')
399
+  (0.4ms) COMMIT
400
+ Started GET "/accounts/39" for 127.0.0.1 at 2013-03-27 15:27:35 -0400
401
+ Processing by AccountsController#show as HTML
402
+ Parameters: {"id"=>"39"}
403
+ Account Load (0.3ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 39 LIMIT 1
404
+ Rendered accounts/show.html.erb within layouts/application (16.4ms)
405
+ Completed 500 Internal Server Error in 90ms
406
+ Connecting to database specified by database.yml
407
+  (0.1ms) BEGIN
408
+ SQL (2.2ms) INSERT INTO `accounts` (`created_at`, `name`, `updated_at`) VALUES ('2013-03-27 19:28:24', 'test_account', '2013-03-27 19:28:24')
409
+  (0.4ms) COMMIT
410
+ Started GET "/accounts/40" for 127.0.0.1 at 2013-03-27 15:28:25 -0400
411
+ Processing by AccountsController#show as HTML
412
+ Parameters: {"id"=>"40"}
413
+ Account Load (0.3ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 40 LIMIT 1
414
+ Rendered accounts/show.html.erb within layouts/application (16.4ms)
415
+ Completed 500 Internal Server Error in 88ms
416
+ Connecting to database specified by database.yml
417
+  (0.1ms) BEGIN
418
+ SQL (42.4ms) INSERT INTO `accounts` (`created_at`, `name`, `updated_at`) VALUES ('2013-03-27 19:30:24', 'test_account', '2013-03-27 19:30:24')
419
+  (0.4ms) COMMIT
420
+ Started GET "/accounts/41" for 127.0.0.1 at 2013-03-27 15:30:24 -0400
421
+ Processing by AccountsController#show as HTML
422
+ Parameters: {"id"=>"41"}
423
+ Account Load (0.3ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 41 LIMIT 1
424
+ Rendered accounts/_modulate_attachments.html.haml (15.5ms)
425
+ Rendered accounts/show.html.erb within layouts/application (25.5ms)
426
+ Completed 500 Internal Server Error in 98ms
427
+ Connecting to database specified by database.yml
428
+  (0.1ms) BEGIN
429
+ SQL (2.5ms) INSERT INTO `accounts` (`created_at`, `name`, `updated_at`) VALUES ('2013-03-27 19:34:42', 'test_account', '2013-03-27 19:34:42')
430
+  (0.4ms) COMMIT
431
+ Started GET "/accounts/42" for 127.0.0.1 at 2013-03-27 15:34:42 -0400
432
+ Processing by AccountsController#show as HTML
433
+ Parameters: {"id"=>"42"}
434
+ Account Load (0.3ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 42 LIMIT 1
435
+  (0.2ms) SELECT COUNT(*) FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 42 AND `modulate_documents`.`attachable_type` = 'Account'
436
+ Rendered accounts/_modulate_account_documents.html.haml (55.2ms)
437
+ Rendered accounts/_modulate_attachments.html.haml (315.7ms)
438
+ Rendered accounts/show.html.erb within layouts/application (325.2ms)
439
+ Completed 200 OK in 400ms (Views: 391.0ms | ActiveRecord: 3.1ms)
440
+ Started PUT "/accounts/42" for 127.0.0.1 at 2013-03-27 15:34:43 -0400
441
+ Processing by AccountsController#update as HTML
442
+ Parameters: {"utf8"=>"✓", "account"=>{"modulate_documents_attributes"=>[{"attachment"=>#<ActionDispatch::Http::UploadedFile:0x007f9d243926a0 @original_filename="test.txt", @content_type="text/plain", @headers="Content-Disposition: form-data; name=\"account[modulate_documents_attributes][][attachment]\"; filename=\"test.txt\"\r\nContent-Type: text/plain\r\nContent-Length: 25\r\n", @tempfile=#<File:/var/folders/lb/j1c12jc524zfb75l84v94qr40000gn/T/RackMultipart20130327-95496-nsw8h7>>}]}, "button"=>"", "id"=>"42"}
443
+ Account Load (0.3ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 42 LIMIT 1
444
+ Modulate::Document Load (0.3ms) SELECT `modulate_documents`.* FROM `modulate_documents` WHERE `modulate_documents`.`attachable_id` = 42 AND `modulate_documents`.`attachable_type` = 'Account'
445
+  (0.1ms) BEGIN
446
+ CACHE (0.0ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 42 LIMIT 1
447
+ Modulate::Document Exists (0.3ms) SELECT 1 AS one FROM `modulate_documents` WHERE (`modulate_documents`.`key` = BINARY '42-test.txt' AND `modulate_documents`.`bucket` = 'Dummy::Account') LIMIT 1
448
+ SQL (0.3ms) INSERT INTO `modulate_documents` (`attachable_id`, `attachable_type`, `attached_by_id`, `attachment`, `bucket`, `content_type`, `created_at`, `filename`, `key`, `label`, `public`, `updated_at`) VALUES (42, 'Account', 1, '42-test.txt', 'Dummy::Account', 'text/plain', '2013-03-27 19:34:43', 'test.txt', '42-test.txt', NULL, 0, '2013-03-27 19:34:43')
449
+  (0.5ms) COMMIT
450
+ Redirected to http://www.example.com/accounts
451
+ Completed 302 Found in 113ms (ActiveRecord: 1.8ms)
452
+ Started GET "/accounts" for 127.0.0.1 at 2013-03-27 15:34:43 -0400
453
+ Processing by AccountsController#index as HTML
454
+ Account Load (0.5ms) SELECT `accounts`.* FROM `accounts` 
455
+ Rendered accounts/index.html.haml within layouts/application (1.2ms)
456
+ Completed 200 OK in 12ms (Views: 4.8ms | ActiveRecord: 0.5ms)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: modulate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -191,7 +191,6 @@ files:
191
191
  - spec/dummy/app/views/layouts/application.html.erb
192
192
  - spec/dummy/config/application.rb
193
193
  - spec/dummy/config/boot.rb
194
- - spec/dummy/config/carrierwave.rb
195
194
  - spec/dummy/config/database.yml
196
195
  - spec/dummy/config/database.yml.example
197
196
  - spec/dummy/config/environment.rb
@@ -289,7 +288,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
289
288
  version: '0'
290
289
  segments:
291
290
  - 0
292
- hash: -3947230191988836994
291
+ hash: -2141877784016317984
293
292
  required_rubygems_version: !ruby/object:Gem::Requirement
294
293
  none: false
295
294
  requirements:
@@ -298,7 +297,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
298
297
  version: '0'
299
298
  segments:
300
299
  - 0
301
- hash: -3947230191988836994
300
+ hash: -2141877784016317984
302
301
  requirements: []
303
302
  rubyforge_project:
304
303
  rubygems_version: 1.8.24
@@ -319,7 +318,6 @@ test_files:
319
318
  - spec/dummy/app/views/layouts/application.html.erb
320
319
  - spec/dummy/config/application.rb
321
320
  - spec/dummy/config/boot.rb
322
- - spec/dummy/config/carrierwave.rb
323
321
  - spec/dummy/config/database.yml
324
322
  - spec/dummy/config/database.yml.example
325
323
  - spec/dummy/config/environment.rb
@@ -1,5 +0,0 @@
1
- CarrierWave.configure do |config|
2
- config.storage = :riak
3
- config.riak_host = 'localhost'
4
- config.riak_port = 8098
5
- end