repo stringlengths 5 92 | file_url stringlengths 80 287 | file_path stringlengths 5 197 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:37:27 2026-01-04 17:58:21 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/net/stubbable.rb | flow/net/stubbable.rb | module Net
class Request
module Stubbable
def stub!(&callback)
if response = Expectation.response_for(self)
callback.call(response)
true
end
end
end
end
end
| ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/net/cocoa/reachability.rb | flow/net/cocoa/reachability.rb | module Net
class Reachability
def initialize(hostname, &block)
@internal_callback = Proc.new do |target, flags, pointer|
block.call(reachable_with_flags?(flags))
end
block.weak!
@reachability = SCNetworkReachabilityCreateWithName(KCFAllocatorDefault,
... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/net/cocoa/request.rb | flow/net/cocoa/request.rb | module Net
class Request
extend Actions
include Request::Stubbable
attr_reader :configuration, :session, :base_url
def initialize(url, options = {}, session = nil)
@base_url = url
@url = NSURL.URLWithString(url)
@options = options
@session = session
@configuration = {}
... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/net/cocoa/response_proxy.rb | flow/net/cocoa/response_proxy.rb | module Net
class ResponseProxy
def self.build_response(raw_body, response)
new(raw_body, response).response
end
def initialize(raw_body, response)
@raw_body = raw_body
@response = response
end
def response
Response.new({
status_code: status_code,
status_me... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/net/android/cookies.rb | flow/net/android/cookies.rb | module Net
def self.setup_cookies
@setup_cookies ||= begin
Java::Net::CookieHandler.setDefault(Java::Net::CookieManager.new)
true
end
end
end
| ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/net/android/reachability.rb | flow/net/android/reachability.rb | class ReachabilityDelegate < Android::Net::ConnectivityManager::NetworkCallback
def initialize(hostname, block)
@hostname = hostname
@block = block
end
def onAvailable(network)
begin
sockaddr = Java::Net::InetSocketAddress.new(@hostname, 80)
sock = Java::Net::Socket.new
sock.connect... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/net/android/request.rb | flow/net/android/request.rb | module Net
class Request
extend Actions
include Request::Stubbable
attr_reader :configuration, :session, :base_url
def initialize(url, options = {}, session = nil)
Net.setup_cookies
@base_url = url
@url = Java::Net::URL.new(url)
@options = options
@session = session
... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/net/android/response_proxy.rb | flow/net/android/response_proxy.rb | module Net
class ResponseProxy
def self.build_response(connection, response)
new(connection, response).response
end
def initialize(connection, response)
@connection = connection
@response = response
end
def response
Response.new({
status_code: status_code,
... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/base64/cocoa/base64.rb | flow/base64/cocoa/base64.rb | class Base64
def self.encode(string)
data = string.dataUsingEncoding(NSUTF8StringEncoding)
data.base64EncodedStringWithOptions(0)
end
def self.decode(string)
data = NSData.alloc.initWithBase64EncodedString(string, options: 0)
NSString.alloc.initWithData(data, encoding: NSUTF8StringEncoding)
end... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/base64/android/base64.rb | flow/base64/android/base64.rb | class Base64
def self.encode(string)
bytes = Java::Lang::String.new(string).getBytes("UTF-8")
Android::Util::Base64.encodeToString(bytes, Android::Util::Base64::NO_WRAP)
end
def self.decode(string)
java_string = Java::Lang::String.new(string)
bytes = Android::Util::Base64.decode(java_string, Andr... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/location/location.rb | flow/location/location.rb | class Location
attr_accessor :latitude, :longitude, :altitude, :time, :speed, :accuracy
attr_accessor :name, :address, :locality, :postal_code, :sub_area, :area, :country
def self.monitor_enabled?
Location::Monitor.enabled?
end
def self.monitor(options={}, &block)
options[:distance_filter] ||= 0
... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/location/cocoa/location_services.rb | flow/location/cocoa/location_services.rb | class Location
attr_accessor :_cllocation
def self._from_cllocation(cllocation)
obj = Location.new
obj._cllocation = cllocation
obj.latitude = cllocation.coordinate.latitude
obj.longitude = cllocation.coordinate.longitude
obj.altitude = cllocation.altitude
obj.time = cllocation.timestamp
... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/location/android/location_services.rb | flow/location/android/location_services.rb | class MonitorDelegate
def initialize(callback)
@callback = callback
end
def onLocationChanged(location)
@callback.call(Location._from_jlocation(location), nil)
end
def onProviderDisabled(provider)
end
def onProviderEnabled(provider)
end
def onStatusChanged(provider, status, extra)
end
en... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/digest/cocoa/digest.rb | flow/digest/cocoa/digest.rb | module Digest
class Base
def initialize(algo)
@digest = FlowDigest.digestWithAlgo(algo)
end
def update(str)
@digest.update(str.dataUsingEncoding(NSUTF8StringEncoding))
self
end
def reset
@digest.reset
self
end
def digest
data = @digest.digest
pt... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/digest/android/digest.rb | flow/digest/android/digest.rb | module Digest
class Base
def initialize(algo)
@digest = Java::Security::MessageDigest.getInstance(algo)
end
def update(str)
@digest.update(str.chars.map { |x| x.ord })
self
end
def reset
@digest.reset
self
end
def digest
@digest.digest.map { |x| Strin... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/task/task.rb | flow/task/task.rb | class Task
def self.every(interval, &block)
Task::Timer.new(interval, true, block)
end
def self.after(delay, &block)
Task::Timer.new(delay, false, block)
end
def self.main(&block)
Task::Queue.schedule_on_main(block)
end
def self.background(&block)
Task::Queue.schedule_on_background(bloc... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/task/cocoa/task.rb | flow/task/cocoa/task.rb | class Task
def self.main?
NSThread.isMainThread
end
class Timer
def initialize(interval, repeats, block)
queue = Dispatch::Queue.current
@timer = Dispatch::Source.timer(interval, interval, 0.0, queue) do |src|
begin
block.call
ensure
stop unless repeats
... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/task/android/task.rb | flow/task/android/task.rb | class Task
def self.main?
Android::Os::Looper.myLooper == Android::Os::Looper.getMainLooper
end
class Timer
def initialize(interval, repeats, block)
interval *= 1000
if interval <= 0
raise ArgError, "negative or too small interval"
end
handle = Android::Os::Handler.new
... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/ui/font.rb | flow/ui/font.rb | module UI
def self.Font(font)
case font
when UI::Font
self
when Hash
name = (font[:name] or raise ":name expected")
size = (font[:size] or raise ":size expected")
trait = (font[:trait] or :normal)
extension = (font[:extension] or :ttf)
UI::Font.new(name,... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/ui/view.rb | flow/ui/view.rb | module UI
class View < CSSNode
def added?
parent != nil
end
def on_swipe_left(&block)
on_swipe [:left], &block
end
def on_swipe_right(&block)
on_swipe [:right], &block
end
def on_swipe_up(&block)
on_swipe [:up], &block
end
def on_swipe_down(&block)
... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/ui/list_row.rb | flow/ui/list_row.rb | module UI
class ListRow < UI::View
def initialize
super
self.flex_direction = :row
@label = UI::Label.new
@label.flex = 1
@label.margin = [10, 15]
@label.padding = 5
self.add_child(@label)
end
def update(data)
@label.text = data
end
end
end
| ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/ui/color.rb | flow/ui/color.rb | module UI
def self.Color(color)
if UI::Color._native?(color)
UI::Color.new(color)
else
case color
when UI::Color
self
when String
UI::Color.hex(color)
when Symbol
UI::Color.symbol(color)
when Array
case color.size
... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/ui/eventable.rb | flow/ui/eventable.rb | module UI
# Simple placeholder implementation
# will need to be rewrite/improved
module Eventable
def on(event, action = nil, &block)
if action
__events__[event.to_sym] ||= action
elsif block
__events__[event.to_sym] ||= block
end
end
def trigger(event, *args)
... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/ui/alert.rb | flow/ui/alert.rb | module UI
def self.alert(opt={}, &block)
alert = UI::Alert.new
alert.title = (opt[:title] or raise ":title needed")
alert.message = (opt[:message] or raise ":message needed")
buttons = [:cancel, :default]
has_button = false
buttons.each do |button|
if title = opt[button]
alert.s... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/ui/cocoa/shared_text.rb | flow/ui/cocoa/shared_text.rb | module UI
module SharedText
def text_alignment
UI::TEXT_ALIGNMENT.key(proxy.textAlignment)
end
def text_alignment=(text_alignment)
proxy.textAlignment = UI::TEXT_ALIGNMENT.fetch(text_alignment) do
raise "Incorrect value, expected one of: #{UI::TEXT_ALIGNMENT.keys.join(',')}"
end... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/ui/cocoa/gradient.rb | flow/ui/cocoa/gradient.rb | module UI
class Gradient
def colors=(colors)
raise ArgError, "must receive an array of 2 or 3 colors" if colors.size < 2 or colors.size > 3
proxy.colors = colors.map { |x| UI::Color(x).proxy.CGColor }
end
def proxy
@proxy ||= CAGradientLayer.layer
end
end
end
| ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/ui/cocoa/ui.rb | flow/ui/cocoa/ui.rb | module UI
TEXT_ALIGNMENT = {
left: NSTextAlignmentLeft,
center: NSTextAlignmentCenter,
right: NSTextAlignmentRight,
justify: NSTextAlignmentJustified
}
def self.resource_str(name)
if md = name.match(/(.*)\.(.*)$/)
if path = NSBundle.mainBundle.pathForResource(md[1], ofType:md[... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/ui/cocoa/application.rb | flow/ui/cocoa/application.rb | module UI
class Application
attr_reader :navigation
@@instance = nil
def initialize(navigation, context)
@navigation = navigation
context.window = proxy
@@instance = self
end
def self.instance
@@instance
end
def start
proxy.rootViewController = @navigation.... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/ui/cocoa/text.rb | flow/ui/cocoa/text.rb | class FlowUITextView < UITextView
# Flow text views are not selectable at the moment.
def canBecomeFirstResponder
false
end
end
module UI
class Text < View
include UI::SharedText
include Eventable
def editable=(flag)
proxy.editable = flag
end
def editable?
proxy.editable
... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/ui/cocoa/font.rb | flow/ui/cocoa/font.rb | module UI
class Font
def self._wrap(font)
new(font, nil, nil)
end
def initialize(obj, size, trait=nil, extension=nil)
if obj.is_a?(UIFont)
@proxy = obj
else
desc = UIFontDescriptor.fontDescriptorWithFontAttributes(UIFontDescriptorNameAttribute => obj)
case trait
... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/ui/cocoa/view.rb | flow/ui/cocoa/view.rb | module UI
class View < CSSNode
ANIMATION_OPTIONS = {
ease_out: UIViewAnimationOptionCurveEaseOut,
ease_in: UIViewAnimationOptionCurveEaseIn,
linear: UIViewAnimationOptionCurveLinear
}
attr_accessor :_previous_width, :_previous_height
def animate(options = {}, &block)
anima... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/ui/cocoa/button.rb | flow/ui/cocoa/button.rb | module UI
class Button < Control
include Eventable
def initialize
super
calculate_measure(true)
end
def measure(width, height)
self.proxy.sizeToFit
[
width.nan? ? self.proxy.frame.size.width : width,
height.nan? ? self.proxy.frame.size.height : height
]... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/ui/cocoa/color.rb | flow/ui/cocoa/color.rb | module UI
class Color
def self._native?(color)
color.is_a?(UIColor)
end
def self.rgba(r, g, b, a)
new UIColor.colorWithRed(r/255.0, green:g/255.0, blue:b/255.0, alpha:a/255.0)
end
def to_a
@ary_values ||= begin
red_ptr = Pointer.new(:double)
green_ptr = Pointer.... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/ui/cocoa/navigation.rb | flow/ui/cocoa/navigation.rb | module UI
class Navigation
attr_reader :root_screen
def initialize(root_screen)
root_screen.navigation = self
@root_screen = root_screen
@current_screens = [@root_screen]
end
def screen
@current_screens.last
end
def _height_of_navigation_bar
rect = proxy.naviga... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/ui/cocoa/list.rb | flow/ui/cocoa/list.rb | module UI
class List < View
include Eventable
class CustomListCell < UITableViewCell
IDENTIFIER = "CustomListCell"
attr_reader :content_view
def content_view=(content_view)
if @content_view != content_view
@content_view = content_view
self.contentView.addSubvie... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/ui/cocoa/control.rb | flow/ui/cocoa/control.rb | module UI
class Control < View
CONTROL_EVENTS = {
touch: UIControlEventTouchUpInside,
editing_changed: UIControlEventEditingChanged,
editing_did_begin: UIControlEventEditingDidBegin,
editing_did_end: UIControlEventEditingDidEnd
}
CONTROL_STATES = {
normal... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/ui/cocoa/activity_indicator.rb | flow/ui/cocoa/activity_indicator.rb | module UI
class ActivityIndicator < UI::View
def start
proxy.startAnimating
end
def stop
proxy.stopAnimating
end
def animating?
proxy.animating?
end
def color=(color)
proxy.color = UI::Color(color).proxy
end
def proxy
@proxy ||= begin
view ... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/ui/cocoa/web.rb | flow/ui/cocoa/web.rb | module UI
class Web < View
attr_accessor :configuration
def initialize(configuration = nil)
super()
@configuration = configuration || WKWebViewConfiguration.new
end
def load_html(string)
proxy.loadHTMLString(string, baseURL: NSBundle.mainBundle.bundleURL)
end
def proxy
... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/ui/cocoa/camera.rb | flow/ui/cocoa/camera.rb | module UI
class Camera < View
include Eventable
attr_accessor :detect_barcode_types, :facing
def start
barcode_formats = (@detect_barcode_types or []).map do |format|
case format
when :aztec
AVMetadataObjectTypeAztecCode
when :code_128
AVMetadata... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/ui/cocoa/screen.rb | flow/ui/cocoa/screen.rb | module UI
class Controller < UIViewController
include Eventable
attr_accessor :navigation
def initWithScreen(screen)
if init
@screen = screen
on(:view_did_load) { @screen.before_on_load }
on(:view_will_appear) { @screen.before_on_show }
on(:view_did_appear) { @scree... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/ui/cocoa/text_input.rb | flow/ui/cocoa/text_input.rb | class FlowTextField < UITextField
attr_accessor :_input_offset
def textRectForBounds(bounds)
_padded_rect(bounds)
end
def editingRectForBounds(bounds)
_padded_rect(bounds)
end
def _padded_rect(rect)
@_input_offset ? CGRectInset(rect, @_input_offset, 0) : rect
end
end
module UI
class Text... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/ui/cocoa/gesture.rb | flow/ui/cocoa/gesture.rb | module UI
class SwipeGesture
def initialize(view, args, block)
obj = UISwipeGestureRecognizer.alloc.initWithTarget(self, action:"_swipe:")
obj.direction = (args || [:right]).inject(0) do |m, sym|
m | (case sym
when :right then UISwipeGestureRecognizerDirectionRight
when :le... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/ui/cocoa/image.rb | flow/ui/cocoa/image.rb | module UI
class Image < View
attr_reader :source
def source=(source)
if @source != source
@source = source
image = case source
when String
UIImage.imageNamed(source)
when NSData
UIImage.imageWithData(source)
else
raise "... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/ui/cocoa/alert.rb | flow/ui/cocoa/alert.rb | module UI
class Alert
def title=(title)
proxy.title = title
end
def message=(message)
proxy.message = message
end
def set_button(title, type)
@buttons ||= {}
pos = proxy.addButtonWithTitle(title)
if type == :cancel
proxy.cancelButtonIndex = pos
end
... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/ui/cocoa/label.rb | flow/ui/cocoa/label.rb | module UI
class Label < View
include UI::SharedText
def initialize
super
calculate_measure(true)
end
def height=(val)
super
calculate_measure(false)
end
def measure(width, height)
#https://developer.apple.com/reference/foundation/nsattributedstring/1524971-draw... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/ui/android/shared_text.rb | flow/ui/android/shared_text.rb | module UI
module SharedText
def text_proxy; proxy; end
def text_alignment
case (text_proxy.gravity & Android::View::Gravity::HORIZONTAL_GRAVITY_MASK)
when Android::View::Gravity::LEFT
:left
when Android::View::Gravity::RIGHT
:right
else
:center
... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/ui/android/gradient.rb | flow/ui/android/gradient.rb | module UI
class Gradient
attr_reader :colors
def colors=(colors)
raise ArgError, "must receive an array of 2 or 3 colors" if colors.size < 2 or colors.size > 3
@colors = colors.map { |x| UI::Color(x).proxy }
end
end
end
| ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/ui/android/ui.rb | flow/ui/android/ui.rb | module UI
def self.context
@context or raise "Context missing"
end
def self.context=(context)
@context = context
end
def self.density
@density ||= UI.context.resources.displayMetrics.density
end
def self.status_bar_height
@status_bar_height ||= begin
resource_id = UI.context.resou... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/ui/android/application.rb | flow/ui/android/application.rb | class UI::Application
attr_reader :navigation
@@instance = nil
def initialize(navigation, context)
UI.context = context
@navigation = navigation
UI.context.contentView = proxy
UI.context.supportActionBar.elevation = UI.density # one bottom border line
@@instance = self
end
def self.insta... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/ui/android/text.rb | flow/ui/android/text.rb | class FlowUITextViewSpan < Android::Text::Style::ClickableSpan
def initialize(view, link)
@view, @link = view, link
end
def onClick(view)
@view.trigger :link, @link
end
end
module UI
class Text < UI::View
include UI::SharedText
def text_proxy; proxy; @text_proxy; end
include Eventable
... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/ui/android/font.rb | flow/ui/android/font.rb | module UI
class Font
def self._wrap(font, size)
new(font, size, nil)
end
BuiltinFonts = {
'ComingSoon' => 'casual',
'DancingScript-Regular' => 'cursive',
'DroidSansMono' => 'monospace',
'Roboto-Regular' => 'sans-serif',
'Roboto-Black' => 'sans-serif-black',
'Robo... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/ui/android/view.rb | flow/ui/android/view.rb | class FlowUIViewLayoutChangeListener
def initialize(view)
@view = view
end
def onLayoutChange(view, left, top, right, bottom, old_left, old_top, old_right, old_bottom)
if (right - left) != (old_right - old_left) or (top - bottom) != (old_top - old_bottom)
@view.update_layout
end
end
end
modu... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/ui/android/button.rb | flow/ui/android/button.rb | class FlowUIButtonClickListener
def initialize(view)
@view = view
end
def onClick(button)
@view.trigger :tap
end
end
module UI
class Button < UI::Control
include Eventable
def initialize
super
calculate_measure(true)
end
def height=(val)
super
calculate_meas... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/ui/android/color.rb | flow/ui/android/color.rb | module UI
class Color
def self._native?(color)
color.is_a?(Fixnum)
end
def self.rgba(r, g, b, a)
new Android::Graphics::Color.argb(a, r, g, b)
end
def red
Android::Graphics::Color.red(proxy)
end
def green
Android::Graphics::Color.green(proxy)
end
def blu... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/ui/android/navigation.rb | flow/ui/android/navigation.rb | class UI::Navigation
attr_reader :root_screen
def initialize(root_screen)
@root_screen = root_screen
@root_screen.navigation = self
@current_screens = []
end
def screen
@current_screens.last
end
def hide_bar
bar = UI.context.supportActionBar
if bar.isShowing
bar.hide
T... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/ui/android/list.rb | flow/ui/android/list.rb | class FlowUIListViewAdapter < Android::Widget::BaseAdapter
def initialize(list)
@list = list
@cached_rows = {}
end
def getCount
@list.data_source.size
end
def getItem(pos)
@list.data_source[pos]
end
def getItemId(pos)
pos
end
def getView(pos, convert_view, parent_view)
data... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/ui/android/control.rb | flow/ui/android/control.rb | module UI
class Control < UI::View
def blur
proxy.clearFocus
end
def focus
proxy.requestFocus
end
def focus?
proxy.hasFocus
end
end
end
| ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/ui/android/activity_indicator.rb | flow/ui/android/activity_indicator.rb | module UI
class ActivityIndicator < UI::View
def initialize
super
self.hidden = true
end
def start
self.hidden = false
end
def stop
self.hidden = true
end
def animating?
!hidden?
end
def color=(color)
proxy.indeterminateDrawable.tint = UI::Co... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/ui/android/web.rb | flow/ui/android/web.rb | module UI
class Web < UI::View
def load_html(str)
proxy.loadData(str, 'text/html', nil)
end
def proxy
@proxy ||= begin
web_view = Android::Webkit::WebView.new(UI.context)
web_view.settings.javaScriptEnabled = true
web_view
end
end
end
end
| ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/ui/android/camera.rb | flow/ui/android/camera.rb | class FlowUICameraSurfaceHolderCallback
def initialize(view)
@view = view
end
def surfaceCreated(holder)
@view._surface_created
end
def surfaceChanged(holder, format, width, height)
# Do nothing.
end
def surfaceDestroyed(holder)
@view._surface_destroyed
end
end
class FlowUICameraDete... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/ui/android/screen.rb | flow/ui/android/screen.rb | class FlowUIFragment < Android::App::Fragment
def initialize(screen)
@screen = screen
end
def onCreateView(inflater, proxy, savedInstanceState)
@view ||= begin
@screen.before_on_load
@screen.view.proxy
end
end
def onResume
super
@screen.before_on_show
@screen.on_show
en... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/ui/android/text_input.rb | flow/ui/android/text_input.rb | class FlowUITextInputTextChangedListener
def initialize(view)
@view = view
end
def afterTextChanged(s)
# Do nothing.
end
def beforeTextChanged(s, start, count, after)
# Do nothing.
end
def onTextChanged(s, start, before, count)
@view.trigger(:change, @view.text)
end
end
class FlowUIT... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/ui/android/gesture.rb | flow/ui/android/gesture.rb | class FlowUIGestureListener < Android::View::GestureDetector::SimpleOnGestureListener
attr_accessor :gestures
def onDown(e)
true
end
def onFling(e1, e2, velocity_x, velocity_y)
@gestures.any? { |x| x.on_fling(e1, e2) }
end
end
class FlowUIGestureTouchListener
def initialize(detector)
@detecto... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/ui/android/image.rb | flow/ui/android/image.rb | module UI
class Image < UI::View
attr_reader :source
def self._drawable_from_source(source)
if source.is_a?(Android::Graphics::Bitmap)
drawable = Android::Graphics::Drawable::BitmapDrawable.new(UI.context.resources, source)
else
candidates = [source]
if UI.density > 0
... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/ui/android/alert.rb | flow/ui/android/alert.rb | class FlowUIAlertClickListener
def initialize(alert)
@alert = alert
end
def onClick(alert_dialog, button_type)
type = case button_type
when Android::App::AlertDialog::BUTTON_NEGATIVE
:cancel
else
:default
end
@alert._clicked(type)
end
end
module UI
class Alert
... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/flow/ui/android/label.rb | flow/ui/android/label.rb | module UI
class Label < UI::View
include UI::SharedText
def initialize
super
calculate_measure(true)
self.text_alignment = :left
end
def height=(val)
super
calculate_measure(false)
end
def measure(width, height)
dimension = [width, height]
unless wi... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/samples/reddit/app/post_row.rb | samples/reddit/app/post_row.rb | class PostRow < UI::ListRow
def initialize
self.align_items = :flex_start
self.flex_direction = :row
self.add_child(thumbnail)
self.add_child(content)
content.add_child(subreddit)
content.add_child(title)
end
def update(post)
title.text = post.title
subreddit.text = "/r/#{pos... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/samples/reddit/app/posts_list.rb | samples/reddit/app/posts_list.rb | class PostsList < UI::List
def initialize
super
self.flex = 1
self.render_row do
PostRow
end
end
end
| ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/samples/reddit/app/post.rb | samples/reddit/app/post.rb | class Post
def initialize(post = {})
@post = post
end
def title
@post.fetch('title', "No title")
end
def thumbnail
thumbnail = @post.fetch('thumbnail', nil)
return nil unless thumbnail.start_with?('http')
thumbnail
end
def subreddit
@post.fetch('subreddit', nil)
end
end
| ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/samples/reddit/app/posts_screen.rb | samples/reddit/app/posts_screen.rb | class PostsScreen < UI::Screen
def on_load
self.navigation.title = "Reddit"
self.input.on(:change) { |text| fetch_posts(text) }
self.view.add_child(self.input)
self.view.add_child(self.list)
self.view.update_layout
fetch_posts("cats")
end
protected
def fetch_posts(query)
return i... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/samples/reddit/app/reddit_fetcher.rb | samples/reddit/app/reddit_fetcher.rb | class RedditFetcher
def self.fetch_posts(query, &block)
Net.get("https://www.reddit.com/search.json?q=#{query}") do |response|
if data = response.body['data']
if children = data['children']
posts = children.map do |t|
Post.new(t['data'])
end
end
end
... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/samples/reddit/app/osx/reddit_controller.rb | samples/reddit/app/osx/reddit_controller.rb | class RedditController
def initialize
@data = []
scroll_view = NSScrollView.alloc.initWithFrame(NSMakeRect(0, 0, 480, 322))
scroll_view.autoresizingMask = NSViewMinXMargin|NSViewMinYMargin|NSViewWidthSizable|NSViewHeightSizable
scroll_view.hasVerticalScroller = true
app.window.contentView.addSubv... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/samples/reddit/app/osx/menu.rb | samples/reddit/app/osx/menu.rb | class AppDelegate
def buildMenu
@mainMenu = NSMenu.new
appName = NSBundle.mainBundle.infoDictionary['CFBundleName']
find_menu = createMenu('Find') do
addItemWithTitle('Find...', action: 'performFindPanelAction:', keyEquivalent: 'f')
addItemWithTitle('Find Next', action: 'performFindPanelActi... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/samples/reddit/app/osx/app_delegate.rb | samples/reddit/app/osx/app_delegate.rb | class AppDelegate
attr_reader :window
def applicationDidFinishLaunching(notification)
buildMenu
buildWindow
@controller = RedditController.new
RedditFetcher.fetch_posts('cats') do |posts|
@controller.data = posts
end
end
def buildWindow
@window = NSWindow.alloc.initWithContentR... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/samples/reddit/app/android/timeline_adapter.rb | samples/reddit/app/android/timeline_adapter.rb | class TimelineAdapter < Android::Widget::ArrayAdapter
def posts=(posts)
@posts = posts
end
# Instead of a generic TextView, we return a custom view for each schedule item.
def getView(position, convertView, parent)
avatar_view = Android::Widget::ImageView.new(context)
layout_params = Android::Widge... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/samples/reddit/app/android/main_activity.rb | samples/reddit/app/android/main_activity.rb | class MainActivity < Android::App::Activity
def onCreate(savedInstanceState)
super
@contentLayout = Android::Widget::FrameLayout.new(self)
@contentLayout.setId(Android::View::View.generateViewId)
@list = Android::Widget::ListView.new(self)
@list.adapter = TimelineAdapter.new(self, Android::R::La... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/samples/reddit/app/ios/app_delegate.rb | samples/reddit/app/ios/app_delegate.rb | class AppDelegate
attr_accessor :window
def application(application, didFinishLaunchingWithOptions:launchOptions)
posts_screen = PostsScreen.new
navigation = UI::Navigation.new(posts_screen)
flow_app = UI::Application.new(navigation, self)
flow_app.start
end
end
| ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/samples/reddit/config/ios.rb | samples/reddit/config/ios.rb | # -*- coding: utf-8 -*-
Motion::Project::App.setup do |app|
# Use `rake ios:config' to see complete project settings.
app.name = 'Reddit'
app.info_plist['NSAppTransportSecurity'] = { 'NSAllowsArbitraryLoads' => true }
end
| ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/samples/reddit/config/osx.rb | samples/reddit/config/osx.rb | # -*- coding: utf-8 -*-
Motion::Project::App.setup do |app|
# Use `rake ios:config' to see complete project settings.
app.name = 'Reddit'
app.info_plist['NSAppTransportSecurity'] = { 'NSAllowsArbitraryLoads' => true }
end
| ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/samples/reddit/config/android.rb | samples/reddit/config/android.rb | # -*- coding: utf-8 -*-
Motion::Project::App.setup do |app|
# Use `rake android:config' to see complete project settings.
app.name = 'Reddit'
app.vm_debug_logs = true
app.permissions = ["android.permission.INTERNET"]
end
| ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/samples/ui_demo/app/welcome_screen.rb | samples/ui_demo/app/welcome_screen.rb | class WelcomeScreen < UI::Screen
def on_show
self.navigation.hide_bar
end
def on_load
$screen = self
background = UI::View.new
background.flex = 1
background.margin = 25
background.background_color = :white
self.view.add_child(background)
label = UI::Label.new
#label.height... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/samples/ui_demo/app/android/main_activity.rb | samples/ui_demo/app/android/main_activity.rb | class MainActivity < Android::Support::V7::App::AppCompatActivity
def onCreate(savedInstanceState)
super
UI.context = self
main_screen = WelcomeScreen.new
navigation = UI::Navigation.new(main_screen)
flow_app = UI::Application.new(navigation, self)
flow_app.start
end
end
| ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/samples/ui_demo/app/ios/app_delegate.rb | samples/ui_demo/app/ios/app_delegate.rb | class AppDelegate
attr_accessor :window #needed atm
def application(application, didFinishLaunchingWithOptions:launchOptions)
main_screen = WelcomeScreen.new
navigation = UI::Navigation.new(main_screen)
flow_app = UI::Application.new(navigation, self)
flow_app.start
end
end
| ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/samples/ui_demo/config/ios.rb | samples/ui_demo/config/ios.rb | # -*- coding: utf-8 -*-
Motion::Project::App.setup do |app|
# Use `rake ios:config' to see complete project settings.
app.name = 'uiapp'
end
| ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/samples/ui_demo/config/android.rb | samples/ui_demo/config/android.rb | # -*- coding: utf-8 -*-
Motion::Project::App.setup do |app|
# Use `rake android:config' to see complete project settings.
app.name = 'uiapp'
end
| ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/test/server.rb | test/server.rb | require 'sinatra'
require 'json'
require 'thin'
Thin::Logging.debug = true
Thin::Logging.trace = true
helpers do
def restricted_area
headers['WWW-Authenticate'] = 'Basic realm="Restricted Area"'
halt 401, "Not authorized\n"
end
def http_protect!
return if http_authorized?
restricted_area
end
... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/test/app/osx/app_delegate.rb | test/app/osx/app_delegate.rb | class AppDelegate
def applicationDidFinishLaunching(notification)
@mainWindow = NSWindow.alloc.initWithContentRect([[240, 180], [480, 360]],
styleMask: NSTitledWindowMask|NSClosableWindowMask|NSMiniaturizableWindowMask|NSResizableWindowMask,
... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/test/app/android/main_activity.rb | test/app/android/main_activity.rb | class MainActivity < Android::App::Activity
def onCreate(savedInstanceState)
Store.context = self
Net.context = self
super
end
end
| ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/test/app/ios/app_delegate.rb | test/app/ios/app_delegate.rb | class AppDelegate
def application(application, didFinishLaunchingWithOptions:launchOptions)
rootViewController = UIViewController.alloc.init
rootViewController.title = 'testios'
rootViewController.view.backgroundColor = UIColor.whiteColor
navigationController = UINavigationController.alloc.initWithRo... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/test/spec/base64_spec.rb | test/spec/base64_spec.rb | describe Base64 do
context "#decode" do
before do
@subject = Base64.decode("eHg=")
end
it "returns a base64 encoded string" do
@subject.should == "xx"
end
end
context "#encode" do
before do
@subject = Base64.encode("xx")
end
it "returns a base64 encoded string" do
... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/test/spec/net_spec.rb | test/spec/net_spec.rb | describe Net do
before do
@response = nil
end
# describe ".reachable?" do
# before do
# @reachable = false
# end
# # FIXME : Sometimes, this spec will be failed with "LocalJumpError: no block given"
# # it "tracks network reachability state" do
# # Net.reachable?("www.google.com"... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/test/spec/store_spec.rb | test/spec/store_spec.rb | describe Store do
before do
Store['string'] = 1
Store[:symbol] = 1
Store['hash'] = {'test' => 1}
Store['array'] = [1, 2, 3]
Store['complex'] = [1, 2, {'test' => 1}, "A", [{'test' => 2}]]
end
describe "hash methods" do
it "access a string key" do
Store['string'].should == 1
end
... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/test/spec/task_spec.rb | test/spec/task_spec.rb | class ProxyTestClass
attr_accessor :proof
end
describe Task do
before do
@proxy = ProxyTestClass.new
end
describe '.after' do
it 'schedules and executes timers' do
@proxy.proof = false
Task.after 0.5 do
@proxy.proof = true
end
wait 1 do
@proxy.proof.should == tr... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/test/spec/digest_spec.rb | test/spec/digest_spec.rb | digests = [
[Digest::MD5, '5eb63bbbe01eeed093cb22bb8f5acdc3'],
[Digest::SHA1, '2aae6c35c94fcfb415dbe95f408b9ce91ee846ed'],
[Digest::SHA224, '2f05477fc24bb4faefd86517156dafdecec45b8ad3cf2522a563582b'],
[Digest::SHA256, 'b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9'],
[Digest::SHA384, 'fdbd8... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/test/spec/json_spec.rb | test/spec/json_spec.rb | describe "JSON" do
it "can serialize empty arrays" do
txt = [].to_json
txt.should == '[]'
JSON.load(txt).should == []
end
it "can serialize complex arrays" do
ary = [1, 'two', {'three' => 3}, true, false, [5, 6.1, [7.2, 8]], 9, 10]
txt = ary.to_json
txt.class.should == String
ary2 = ... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/test/spec/helpers/cocoa/constants.rb | test/spec/helpers/cocoa/constants.rb | HTTP_SERVER = "http://localhost:4567"
| ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/test/spec/helpers/android/constants.rb | test/spec/helpers/android/constants.rb | HTTP_SERVER = "http://10.0.2.2:4567"
| ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/test/spec/net/response_spec.rb | test/spec/net/response_spec.rb | describe Net::Response do
before do
@subject = Net::Response.new({
status_code: 200,
status_message: :ok,
mime_type: "application/json",
body: ''
})
end
it ".status" do
@subject.status.should == 200
end
it ".status_message" do
@subject.status_message.should == :ok
e... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/test/spec/net/header_spec.rb | test/spec/net/header_spec.rb | describe Net::Header do
it "has a a field and a value" do
header = Net::Header.new('Content-Type', 'application/json')
header.field.should == 'Content-Type'
header.value.should == 'application/json'
end
it "rewrites shorthands" do
header = Net::Header.new(:content_type, :json)
header.field.sh... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
HipByte/Flow | https://github.com/HipByte/Flow/blob/ea2b52d8c14609fc26df7c661139e90b9600b218/test/spec/net/expectation_spec.rb | test/spec/net/expectation_spec.rb | describe Net::Expectation do
before do
@url = "http://www.example.com"
@subject = Net::Expectation.new(@url)
end
after do
Net::Expectation.clear
end
describe ".new" do
it "sets url" do
@subject.url.should == @url
end
end
describe ".all" do
context "when @expectations nil" ... | ruby | BSD-2-Clause | ea2b52d8c14609fc26df7c661139e90b9600b218 | 2026-01-04T17:39:37.532363Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.