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 |
|---|---|---|---|---|---|---|---|---|
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/hello/hello_tray_item.rb | samples/hello/hello_tray_item.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/hello/hello_text.rb | samples/hello/hello_text.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/clock.rb | samples/elaborate/clock.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/contact_manager.rb | samples/elaborate/contact_manager.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/mandelbrot_fractal.rb | samples/elaborate/mandelbrot_fractal.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/user_profile.rb | samples/elaborate/user_profile.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/stock_ticker.rb | samples/elaborate/stock_ticker.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/meta_sample.rb | samples/elaborate/meta_sample.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/tetris.rb | samples/elaborate/tetris.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/weather.rb | samples/elaborate/weather.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/metronome.rb | samples/elaborate/metronome.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/connect4.rb | samples/elaborate/connect4.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/login.rb | samples/elaborate/login.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/battleship.rb | samples/elaborate/battleship.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/quarto.rb | samples/elaborate/quarto.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/klondike_solitaire.rb | samples/elaborate/klondike_solitaire.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/game_of_life.rb | samples/elaborate/game_of_life.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/calculator.rb | samples/elaborate/calculator.rb | require 'glimmer-dsl-swt'
require 'bigdecimal'
require_relative 'calculator/model/presenter'
# This sample demonstrates use of MVP (Model-View-Presenter) Architectural Pattern
# to data-bind View widgets to object-oriented Models taking advantage of design patterns
# like Command Design Pattern.
class Calculator
in... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/timer.rb | samples/elaborate/timer.rb | require 'glimmer-dsl-swt'
require 'os'
class Timer
include Glimmer::UI::CustomShell
import 'javax.sound.sampled'
FILE_SOUND_ALARM = File.expand_path(File.join('timer', 'sounds', 'alarm1.wav'), __dir__)
COMMAND_KEY = OS.mac? ? :command : :ctrl
## Add options like the following to configure CustomSh... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/snake.rb | samples/elaborate/snake.rb | require 'glimmer-dsl-swt'
require_relative 'snake/presenter/grid'
class Snake
include Glimmer::UI::CustomShell
CELL_SIZE = 15
SNAKE_MOVE_DELAY = 100 # millis
before_body do
@game = Model::Game.new
@grid = Presenter::Grid.new(@game)
@game.start
@keypress_queue = []
display {
... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/parking.rb | samples/elaborate/parking.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/tic_tac_toe.rb | samples/elaborate/tic_tac_toe.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/battleship/model/ship_collection.rb | samples/elaborate/battleship/model/ship_collection.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/battleship/model/cell.rb | samples/elaborate/battleship/model/cell.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/battleship/model/game.rb | samples/elaborate/battleship/model/game.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/battleship/model/grid.rb | samples/elaborate/battleship/model/grid.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/battleship/model/ship.rb | samples/elaborate/battleship/model/ship.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/battleship/view/ship_collection.rb | samples/elaborate/battleship/view/ship_collection.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/battleship/view/cell.rb | samples/elaborate/battleship/view/cell.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/battleship/view/grid.rb | samples/elaborate/battleship/view/grid.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/battleship/view/ship.rb | samples/elaborate/battleship/view/ship.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/battleship/view/action_panel.rb | samples/elaborate/battleship/view/action_panel.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/klondike_solitaire/model/game.rb | samples/elaborate/klondike_solitaire/model/game.rb | require_relative 'playing_card'
require_relative 'dealt_pile'
require_relative 'dealing_pile'
require_relative 'column_pile'
require_relative 'foundation_pile'
class KlondikeSolitaire
module Model
class Game
COLUMN_PILE_COUNT = 7
attr_reader :deck, :dealing_pile, :dealt_pile, :column_piles, ... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/klondike_solitaire/model/playing_card.rb | samples/elaborate/klondike_solitaire/model/playing_card.rb | class KlondikeSolitaire
module Model
class PlayingCard
SUITS = [:spades, :hearts, :clubs, :diamonds]
BLACK_SUITS = [:spades, :clubs]
RED_SUITS = [:hearts, :diamonds]
RANK_COUNT = 13
class << self
def deck
suit_decks.flatten
end
def su... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/klondike_solitaire/model/dealt_pile.rb | samples/elaborate/klondike_solitaire/model/dealt_pile.rb | class KlondikeSolitaire
module Model
class DealtPile
def initialize(game)
@game = game
end
def reset!
playing_cards.clear
end
def push!(playing_card)
playing_cards.push(playing_card)
end
def remove!(card)
playing_cards.de... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/klondike_solitaire/model/column_pile.rb | samples/elaborate/klondike_solitaire/model/column_pile.rb | class KlondikeSolitaire
module Model
class ColumnPile
include Glimmer::DataBinding::ObservableModel
attr_reader :count
def initialize(game, count)
@game = game
@count = count
reset!
end
def reset!
playing_cards.clear
populate!(count... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/klondike_solitaire/model/foundation_pile.rb | samples/elaborate/klondike_solitaire/model/foundation_pile.rb | class KlondikeSolitaire
module Model
class FoundationPile
attr_reader :suit
def initialize(game, suit)
@game = game
@suit = suit
reset!
end
def reset!
playing_cards.clear
end
# adds a card
# validates if it is a card that b... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/klondike_solitaire/model/dealing_pile.rb | samples/elaborate/klondike_solitaire/model/dealing_pile.rb | class KlondikeSolitaire
module Model
class DealingPile
DEALING_INITIAL_COUNT = 24
def initialize(game)
@game = game
reset!
end
def reset!
playing_cards.clear
DEALING_INITIAL_COUNT.times { playing_cards << @game.deck.pop }
end
def d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/klondike_solitaire/view/action_panel.rb | samples/elaborate/klondike_solitaire/view/action_panel.rb | class KlondikeSolitaire
module View
class ActionPanel
include Glimmer::UI::CustomWidget
option :game
body {
composite {
grid_layout(1, false) {
margin_width 0
margin_height 0
}
background :dark_green
... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/klondike_solitaire/view/playing_card.rb | samples/elaborate/klondike_solitaire/view/playing_card.rb | class KlondikeSolitaire
module View
class PlayingCard
include Glimmer::UI::CustomShape
options :card_x, :card_y, :model, :parent_pile
before_body do
self.card_x ||= 0
self.card_y ||= 0
end
body {
rectangle(card_x, card_y, PLAYING_CARD_WIDTH - 1, P... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/klondike_solitaire/view/empty_playing_card.rb | samples/elaborate/klondike_solitaire/view/empty_playing_card.rb | require_relative '../model/playing_card'
class KlondikeSolitaire
module View
class EmptyPlayingCard
include Glimmer::UI::CustomShape
options :card_x, :card_y, :suit
before_body do
self.card_x ||= 0
self.card_y ||= 0
end
body {
rectangle(c... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/klondike_solitaire/view/klondike_solitaire_menu_bar.rb | samples/elaborate/klondike_solitaire/view/klondike_solitaire_menu_bar.rb | class KlondikeSolitaire
module View
class KlondikeSolitaireMenuBar
include Glimmer::UI::CustomWidget
option :game
before_body do
@display = display {
on_about do
display_about_dialog
end
on_preferences do
disp... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/klondike_solitaire/view/dealt_pile.rb | samples/elaborate/klondike_solitaire/view/dealt_pile.rb | require_relative '../model/dealt_pile'
require_relative 'empty_playing_card'
require_relative 'playing_card'
class KlondikeSolitaire
module View
class DealtPile
include Glimmer::UI::CustomShape
options :pile_x, :pile_y, :model
after_body do
observe(model, 'playing_cards.e... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/klondike_solitaire/view/column_pile.rb | samples/elaborate/klondike_solitaire/view/column_pile.rb | require_relative '../model/column_pile'
require_relative 'playing_card'
class KlondikeSolitaire
module View
class ColumnPile
include Glimmer::UI::CustomShape
options :pile_x, :pile_y, :model
after_body {
observe(model, 'playing_cards.last.hidden') do
build_column_pi... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/klondike_solitaire/view/foundation_pile.rb | samples/elaborate/klondike_solitaire/view/foundation_pile.rb | require_relative '../model/playing_card'
require_relative '../model/foundation_pile'
class KlondikeSolitaire
module View
class FoundationPile
include Glimmer::UI::CustomShape
options :pile_x, :pile_y, :game, :suit
attr_accessor :model
before_body do
self.model... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/klondike_solitaire/view/tableau.rb | samples/elaborate/klondike_solitaire/view/tableau.rb | require_relative 'dealing_pile'
require_relative 'dealt_pile'
require_relative 'column_pile'
require_relative 'foundation_pile'
require_relative '../model/game'
class KlondikeSolitaire
module View
class Tableau
include Glimmer::UI::CustomWidget
option :game
body {
canvas ... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/klondike_solitaire/view/dealing_pile.rb | samples/elaborate/klondike_solitaire/view/dealing_pile.rb | require_relative '../model/dealing_pile'
require_relative 'empty_playing_card'
require_relative 'hidden_playing_card'
class KlondikeSolitaire
module View
class DealingPile
include Glimmer::UI::CustomShape
options :pile_x, :pile_y, :model
after_body {
observe(model, 'playi... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/klondike_solitaire/view/hidden_playing_card.rb | samples/elaborate/klondike_solitaire/view/hidden_playing_card.rb | class KlondikeSolitaire
module View
class HiddenPlayingCard
include Glimmer::UI::CustomShape
options :card_x, :card_y
before_body do
self.card_x ||= 0
self.card_y ||= 0
end
body {
rectangle(card_x, card_y, PLAYING_CARD_WIDTH - 1, PLAYING_CARD_... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/tetris/model/game.rb | samples/elaborate/tetris/model/game.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/tetris/model/past_game.rb | samples/elaborate/tetris/model/past_game.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/tetris/model/tetromino.rb | samples/elaborate/tetris/model/tetromino.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/tetris/model/block.rb | samples/elaborate/tetris/model/block.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/tetris/view/playfield.rb | samples/elaborate/tetris/view/playfield.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/tetris/view/tetris_menu_bar.rb | samples/elaborate/tetris/view/tetris_menu_bar.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/tetris/view/high_score_dialog.rb | samples/elaborate/tetris/view/high_score_dialog.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/tetris/view/score_lane.rb | samples/elaborate/tetris/view/score_lane.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/tetris/view/bevel.rb | samples/elaborate/tetris/view/bevel.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/tetris/view/block.rb | samples/elaborate/tetris/view/block.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/snake/presenter/cell.rb | samples/elaborate/snake/presenter/cell.rb | class Snake
module Presenter
class Cell
COLOR_CLEAR = :white
COLOR_SNAKE = :green
COLOR_APPLE = :red
attr_reader :row, :column, :grid
attr_accessor :color
def initialize(grid: ,row: ,column: )
@row = row
@column = column
@grid = grid
en... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/snake/presenter/grid.rb | samples/elaborate/snake/presenter/grid.rb | require 'glimmer'
require_relative '../model/game'
require_relative 'cell'
class Snake
module Presenter
class Grid
include Glimmer
attr_reader :game, :cells
def initialize(game = Model::Game.new)
@game = game
@cells = @game.height.times.map do |row|
@game... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/snake/model/game.rb | samples/elaborate/snake/model/game.rb | require 'fileutils'
require_relative 'snake'
require_relative 'apple'
class Snake
module Model
class Game
WIDTH_DEFAULT = 20
HEIGHT_DEFAULT = 20
FILE_HIGH_SCORE = File.expand_path(File.join(Dir.home, '.glimmer-snake'))
attr_reader :width, :height
attr_accessor :snake, :apple... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/snake/model/apple.rb | samples/elaborate/snake/model/apple.rb | class Snake
module Model
class Apple
attr_reader :game
attr_accessor :row, :column
def initialize(game)
@game = game
end
# generates a new location from scratch or via dependency injection of what cell is (for testing purposes)
def generate(initial_row: ni... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/snake/model/vertebra.rb | samples/elaborate/snake/model/vertebra.rb | class Snake
module Model
class Vertebra
ORIENTATIONS = %i[north east south west]
# orientation is needed for snake occuppied cells (but not apple cells)
attr_reader :snake
attr_accessor :row, :column, :orientation
def initialize(snake: , row: , column: , orientation: )
... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/snake/model/snake.rb | samples/elaborate/snake/model/snake.rb | require_relative 'vertebra'
class Snake
module Model
class Snake
SCORE_EAT_APPLE = 50
RIGHT_TURN_MAP = {
north: :east,
east: :south,
south: :west,
west: :north
}
LEFT_TURN_MAP = RIGHT_TURN_MAP.invert
attr_accessor :collided
alias collid... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/calculator/model/command.rb | samples/elaborate/calculator/model/command.rb | class Calculator
module Model
class Command
class << self
attr_accessor :number1, :number2, :operation
# Keyword string representing calculator command (e.g. '+' for Add command)
# Subclasses must call to define a single keyword
def keyword(keyword_text)
... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/calculator/model/presenter.rb | samples/elaborate/calculator/model/presenter.rb | require_relative 'command'
class Calculator
module Model
class Presenter
FORMATTER = {
nil => '0',
'NaN' => 'Not a number'
}
attr_accessor :result
def initialize
self.result = '0'
end
def press(button)
command = Command.for(... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/calculator/model/command/equals.rb | samples/elaborate/calculator/model/command/equals.rb | class Calculator
module Model
class Command
class Equals < Command
keywords '=', "\r"
def execute
if number1 && number2 && operation
self.result = operation.calculate.to_s
self.number1 = self.result
else
self.result = last_result || '0... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/calculator/model/command/all_clear.rb | samples/elaborate/calculator/model/command/all_clear.rb | class Calculator
module Model
class Command
class AllClear < Command
keywords 'AC', 'c', 'C', 8.chr, 27.chr, 127.chr
def execute
self.result = '0'
self.number1 = nil
self.number2 = nil
self.operation = nil
command_history.clear
end... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/calculator/model/command/command_history.rb | samples/elaborate/calculator/model/command/command_history.rb | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false | |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/calculator/model/command/point.rb | samples/elaborate/calculator/model/command/point.rb | class Calculator
module Model
class Command
class Point < Command
keyword '.'
def execute
self.result = last_result.nil? || !last_command.is_a?(Number) ? '0.' : "#{last_result}."
if operation.nil? || last_command.is_a?(Equals)
self.number1 = self.result
... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/calculator/model/command/number.rb | samples/elaborate/calculator/model/command/number.rb | class Calculator
module Model
class Command
class Number < Command
keywords ('0'..'9').to_a
def execute
self.result = last_result.nil? || (!last_command.is_a?(Number) && !last_command.is_a?(Point)) ? button : last_result + button
if operation.nil? || last_c... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/calculator/model/command/operation.rb | samples/elaborate/calculator/model/command/operation.rb | class Calculator
module Model
class Command
class Operation < Command
def execute
if number1 && number2 && operation && !last_command.is_a?(Equals)
self.result = operation.calculate.to_s
self.number1 = self.result
else
self.result = last_result... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/calculator/model/command/operation/add.rb | samples/elaborate/calculator/model/command/operation/add.rb | class Calculator
module Model
class Command
class Operation < Command
class Add < Operation
keyword '+'
def operation_method
:+
end
end
end
end
end
end
| ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/calculator/model/command/operation/subtract.rb | samples/elaborate/calculator/model/command/operation/subtract.rb | class Calculator
module Model
class Command
class Operation < Command
class Subtract < Operation
keywords '−', '-'
def operation_method
:-
end
end
end
end
end
end
| ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/calculator/model/command/operation/multiply.rb | samples/elaborate/calculator/model/command/operation/multiply.rb | class Calculator
module Model
class Command
class Operation < Command
class Multiply < Operation
keywords '×', '*'
def operation_method
:*
end
end
end
end
end
end
| ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/calculator/model/command/operation/divide.rb | samples/elaborate/calculator/model/command/operation/divide.rb | class Calculator
module Model
class Command
class Operation < Command
class Divide < Operation
keywords '÷', '/'
def operation_method
:/
end
end
end
end
end
end
| ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/quarto/model/piece.rb | samples/elaborate/quarto/model/piece.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/quarto/model/game.rb | samples/elaborate/quarto/model/game.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/quarto/model/piece/cube.rb | samples/elaborate/quarto/model/piece/cube.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/quarto/model/piece/cylinder.rb | samples/elaborate/quarto/model/piece/cylinder.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/quarto/view/piece.rb | samples/elaborate/quarto/view/piece.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/quarto/view/cube.rb | samples/elaborate/quarto/view/cube.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/quarto/view/message_box_panel.rb | samples/elaborate/quarto/view/message_box_panel.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/quarto/view/cell.rb | samples/elaborate/quarto/view/cell.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/quarto/view/cylinder.rb | samples/elaborate/quarto/view/cylinder.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/quarto/view/board.rb | samples/elaborate/quarto/view/board.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/quarto/view/selected_piece_area.rb | samples/elaborate/quarto/view/selected_piece_area.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/quarto/view/available_pieces_area.rb | samples/elaborate/quarto/view/available_pieces_area.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/connect4/model/slot.rb | samples/elaborate/connect4/model/slot.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/connect4/model/grid.rb | samples/elaborate/connect4/model/grid.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/tic_tac_toe/cell.rb | samples/elaborate/tic_tac_toe/cell.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/tic_tac_toe/board.rb | samples/elaborate/tic_tac_toe/board.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/contact_manager/contact_manager_presenter.rb | samples/elaborate/contact_manager/contact_manager_presenter.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/contact_manager/contact_repository.rb | samples/elaborate/contact_manager/contact_repository.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/contact_manager/contact.rb | samples/elaborate/contact_manager/contact.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/game_of_life/model/cell.rb | samples/elaborate/game_of_life/model/cell.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/game_of_life/model/grid.rb | samples/elaborate/game_of_life/model/grid.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/parking/model/parking_floor.rb | samples/elaborate/parking/model/parking_floor.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/parking/model/parking_spot.rb | samples/elaborate/parking/model/parking_spot.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
AndyObtiva/glimmer-dsl-swt | https://github.com/AndyObtiva/glimmer-dsl-swt/blob/449cf07ada1ec965ae2ac91715ccdf22488df4ca/samples/elaborate/parking/model/parking_presenter.rb | samples/elaborate/parking/model/parking_presenter.rb | # Copyright (c) 2007-2025 Andy Maleh
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# d... | ruby | MIT | 449cf07ada1ec965ae2ac91715ccdf22488df4ca | 2026-01-04T17:52:38.125591Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.