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
| module Settings | |
| DISCRIMINATOR = :type | |
| TYPE_TO_CLASS = Hash[Setting.subclasses.map { |klass| [klass.name.underscore, klass] }].freeze | |
| class SettingRepresenter < Representable::Decorator | |
| include ::Representable::JSON | |
| property :name | |
| property DISCRIMINATOR, skip_parse: true, getter: lambda {|options| options[:represented].class.name.underscore } |
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
| User = Struct.new(:email) | |
| Post = Struct.new(:user, :text) | |
| class PostRepresenter < Representable::Decorator | |
| include Representable::JSON | |
| property :text | |
| property :user, populator: lambda { |input, options| options[:represented].user = User.new } | |
| end |
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
| @filenames, @urls = *product.images.map { |i| [i.original_filename, i.image_original_url] }.transpose.map(&:to_set) |
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
| using System; | |
| public interface FSM<S,E,T> { | |
| public void defineTransition(S oldState, E event, S newState, Action<T> action); | |
| public void consumeEvent(E event); | |
| public S getState(); | |
| public void setState(S newState); | |
| } |
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
| class None | |
| def map(&block) | |
| self | |
| end | |
| def flat_map(&block) | |
| self | |
| end | |
| def 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
| Name: sprockets | |
| Version: 2.2.3.backport2 | |
| Advisory: CVE-2014-7819 | |
| Criticality: Medium | |
| URL: https://groups.google.com/forum/#!topic/rubyonrails-security/doAVp0YaTqY | |
| Title: Arbitrary file existence disclosure in Sprockets | |
| Solution: upgrade to ~> 2.0.5, ~> 2.1.4, ~> 2.2.3, ~> 2.3.3, ~> 2.4.6, ~> 2.5.1, ~> 2.7.1, ~> 2.8.3, ~> 2.9.4, ~> 2.10.2, ~> 2.11.3, ~> 2.12.3, >= 3.0.0.beta.3 | |
| Name: actionpack | |
| Version: 3.2.22 |