Module: SocialiteJs::Source
- Defined in:
- lib/socialite_js/source.rb,
lib/socialite_js/source/version.rb
Constant Summary collapse
- VERSION =
"0.0.2"
Class Method Summary collapse
- .bundled_minimized_path ⇒ Object
- .bundled_path ⇒ Object
- .method_missing(method_sym, *args, &block) ⇒ Object
- .respond_to?(method_sym, include_private = false) ⇒ Boolean
- .respond_to_socialite_extension?(method_str) ⇒ Boolean
- .supported_extensions ⇒ Object
- .vendor_path ⇒ Object
Class Method Details
.bundled_minimized_path ⇒ Object
13 14 15 |
# File 'lib/socialite_js/source.rb', line 13 def self.bundled_minimized_path "#{vendor_path}/socialite.min.js" end |
.bundled_path ⇒ Object
9 10 11 |
# File 'lib/socialite_js/source.rb', line 9 def self.bundled_path "#{vendor_path}/socialite.js" end |
.method_missing(method_sym, *args, &block) ⇒ Object
41 42 43 44 45 46 47 |
# File 'lib/socialite_js/source.rb', line 41 def self.method_missing(method_sym, *args, &block) if match = (method_sym.to_s) "#{vendor_path}/extensions/socialite.#{match['extension_name']}.js" else super end end |
.respond_to?(method_sym, include_private = false) ⇒ Boolean
33 34 35 36 37 38 39 |
# File 'lib/socialite_js/source.rb', line 33 def self.respond_to?(method_sym, include_private = false) if method_sym.to_s true else super end end |
.respond_to_socialite_extension?(method_str) ⇒ Boolean
51 52 53 54 55 56 57 58 59 60 |
# File 'lib/socialite_js/source.rb', line 51 def method_str # NOTE: not checking if the file actually exists. but checking # from a master list of supported extensions if (match = method_str.match(/\A(?<extension_name>(.)+)_extension_path\z/)) && supported_extensions.include?(match['extension_name']) match else false end end |
.supported_extensions ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/socialite_js/source.rb', line 17 def self.supported_extensions %w[bufferapp extension-template facebook github googleplus hackernews linkedin pinterest spotify twitter vkontakte weibo icefy] end |
.vendor_path ⇒ Object
5 6 7 |
# File 'lib/socialite_js/source.rb', line 5 def self.vendor_path File.("../vendor/assets/javascript", __FILE__) end |