Skip to content

Instantly share code, notes, and snippets.

Mitch VanDuyn catmando

Block or report user

Report or block catmando

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@catmando
catmando / gist:d283739ef34e9368518c
Created Jun 15, 2015
Changing opal-rspec directory (useful if you cannot upgrade to opal-rails > 7.0)
View gist:d283739ef34e9368518c

opal-rspec does not currently have a means to change the spec directory location, which you really need to do if you are going to have mixed opal and regular (server) ruby code testing.

The following assumes normal specs will go into the the spec directory, and opal specs will go into spec-opal directory.

To get this to work, you have to change the Opal::Server path to end with spec-opal instead of spec which is what opal-rspec normally does. Then you have to change the Opal::Server main file (the sprockets_runner.rb.erb) file to be a copy which pulls in your specs.

In your rake file do this:

require 'opal/rspec/rake_task'
@catmando
catmando / gist:096c29d0fb06873ad978
Last active Sep 27, 2017
Carrierwave Custom Version
View gist:096c29d0fb06873ad978
class CustomUploader < CarrierWave::Uploader::Base
# complete example of custom carrierwave version generator that does not use manipulate with hopefully helpful comments
# in this case we are uploading a .psd (photoshop file) and then rendering to a png. We want to
# save the original psd, so we create a png version.
storage :file
version :png do # tells carrierwave to generate a new version of the upload in this case a "png"
You can’t perform that action at this time.