This file contains hidden or 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
# Usage | |
# | |
# class Rectangle | |
# include TypeCast | |
# | |
# ... | |
# | |
# attr_accessor :width, :height, :fill | |
# type_cast :width, :height, :method => :to_f | |
# type_cast :fill, :allow_nil => false, :method => lambda { |value| !!value } |
This file contains hidden or 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
# | |
# Put this file into spec/support/ folder. | |
# | |
# Helper +action+ allows you to write something like | |
# | |
# describe "GET index" do | |
# action { get :index } | |
# | |
# context 'if user signed in' do | |
# before { sign_in user } |
This file contains hidden or 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
# ./spec/spec_helper.rb | |
# | |
# Dir[File.dirname(__FILE__) + "/support/**/*.rb"].each {|f| require f} | |
# | |
# | |
# Usage: | |
# | |
# its(:updated_at) { should be_the_same_time_as updated_at } | |
# | |
# |
This file contains hidden or 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
require 'rubygems' | |
require 'json' | |
def save_settings(settings) | |
`gsettings set com.canonical.Unity.Panel systray-whitelist "#{settings.to_json.gsub('"', "'")}"` | |
end | |
def current_settings |
NewerOlder