source
stringclasses
1 value
repo
stringlengths
5
63
repo_url
stringlengths
24
82
path
stringlengths
5
167
language
stringclasses
1 value
license
stringclasses
5 values
stars
int64
10
51.4k
ref
stringclasses
23 values
size_bytes
int64
200
258k
text
stringlengths
137
258k
github
taw/paradox-tools
https://github.com/taw/paradox-tools
lib/property_list.rb
Ruby
mit
46
master
4,947
class PropertyList def initialize @entries = [] end def size @entries.size end def empty? @entries.empty? end def each_property(&blk) @entries.each(&blk) end def each(&blk) @entries.each do |prop| yield prop.key, prop.val end end def each_value(&blk) @entries...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
lib/fake_yaml.rb
Ruby
mit
46
master
1,867
require "pathname" require "yaml" class FakeYaml class << self # Mods are the worst, their files contain crazy number of errors # Game seems to be quite forgiving, but we need to clean that crap up def load(path) path = Pathname(path) data = path.read data = data.gsub(/\uFEFF/, "") # s...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
lib/paradox_game_modification.rb
Ruby
mit
46
master
262
require_relative "paradox" class ParadoxGameModification def initialize(builder) @builder = builder end def apply! raise "SubclassResponsibility" end def method_missing(*args, **kwargs, &blk) @builder.send(*args, **kwargs, &blk) end end
github
taw/paradox-tools
https://github.com/taw/paradox-tools
lib/paradox_mod_file.rb
Ruby
mit
46
master
6,876
require "date" require "pathname" require_relative "property" require_relative "property_list" class ParadoxModFile attr_reader :path def initialize(string: nil, path: nil) if string @data = string if path @path = Pathname(path) # Just for better exception message else @path =...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
lib/multi_range.rb
Ruby
mit
46
master
2,600
class MultiRange def initialize(*args) points = [] args.each do |arg| parse_arg(arg) do |s,e| raise ArgumentError, "MultiRange start #{s} > #{e}" if s and e and s > e next if s == e # Just fast skip, would get filtered later anyway points << [s ? 0 : -1, s, 1] points << ...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
ck2_mods/mods/brazil_invasion_events.rb
Ruby
mit
46
master
41,378
BrazilInvasionEvents = PropertyList[ "namespace", "BRAZIL", "province_event", PropertyList[ "id", "BRAZIL.1", "desc", "EVTDESC_BRAZIL_001", "picture", "GFX_evt_aztec_explorers", "border", "GFX_event_normal_frame_war", "trigger", PropertyList[ "has_dlc", "Sunset Invasion", "NOT", Prop...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
ck2_mods/mods/vassal_transfer.rb
Ruby
mit
46
master
2,846
require_relative "base" class VassalTransferGameModification < CK2GameModification def king_level_titles @king_level_titles ||= begin titles = parse("common/landed_titles/landed_titles.txt") empires = titles.keys.grep(/\Ae_/) [titles, *empires.map{|e| titles[e]}].map(&:keys).flatten(1).grep(/\...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
ck2_mods/mods/dynastic_decisions.rb
Ruby
mit
46
master
5,555
require_relative "base" class DynasticDecisionsGameModification < CK2GameModification def apply! # All these should be filtered etc. # Extremely basic functionality only # # These are meant for setting up scenarios, not for routine use targetted_decisions = PropertyList[ "switch_to_spouse_d...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
ck2_mods/mods/canada_invasion_events.rb
Ruby
mit
46
master
48,069
CanadaInvasionEvents = PropertyList[ "namespace", "CANADA", "province_event", PropertyList[ "id", "CANADA.1", "desc", "EVTDESC_CANADA_001", "picture", "GFX_evt_aztec_explorers", "border", "GFX_event_normal_frame_war", "trigger", PropertyList[ "has_dlc", "Sunset Invasion", "NOT", Prop...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
ck2_mods/mods/ukrainian_culture.rb
Ruby
mit
46
master
1,984
class UkrainianCultureGameModification < CK2GameModification def ukrainian_culture # Based on volhynian PropertyList[ "graphical_cultures", ["easternslavicgfx"], "color", [0.65, 0.8, 0.3], "male_names", ["Briachislav_Bretislaus", "Demid", "Dobrynia", "Fedot_Theodat", "Gleb", "Igor", "Iliya",...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
ck2_mods/mods/ui_tweaks.rb
Ruby
mit
46
master
1,773
require_relative "base" class UITweaksGameModification < CK2GameModification def mark_more_titles_as_high_priority! patch_mod_file!("common/minor_titles/00_minor_titles.txt") do |node| node.each do |title_name, title| next if title["is_high_prio"] # Already tagged # No special reason to be ...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
ck2_mods/mods/no_localized_landed_titles.rb
Ruby
mit
46
master
1,090
require_relative "base" class NoLocalizedTitlesGameModification < CK2GameModification def no_localized_landed_titles!(node) return unless node.is_a?(PropertyList) cultures.each do |culture_name| node.delete! culture_name end node.each do |key, val| next if val.is_a?(Numeric) or val == tr...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
ck2_mods/mods/brazilian_culture.rb
Ruby
mit
46
master
5,463
# TODO: cultural retinue [???] class BrazilianCultureGameModification < CK2GameModification def surnames # http://familypedia.wikia.com/wiki/List_of_most_common_surnames %Q[ Acquarone Alberton Alencar Alvin Álvares Amaral Andrade Antonelli Antunes Az...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
ck2_mods/mods/become_republic.rb
Ruby
mit
46
master
1,927
require_relative "base" class BecomeRepublicGameModification < CK2GameModification def apply! create_mod_file! "decisions/feudal_to_republic.txt", PropertyList[ "settlement_decisions", PropertyList[ "feudal_adopt_republicanism", PropertyList[ "filter", "sub_realm_owned", "ai_ta...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
ck2_mods/mods/faction_resistance.rb
Ruby
mit
46
master
1,448
require_relative "base" class FactionResistanceGameModification < CK2GameModification # AI folds to all factions way too easily beacuse faction power calculations are just dumb # It would be nice to setup proper calculations, but it's better if AI just never folds def apply! patch_mod_file!("events/plot_even...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
ck2_mods/mods/ck2_tweaks.rb
Ruby
mit
46
master
46,839
require_relative "base" class CK2TweaksGameModification < CK2GameModification def fix_gavelkind! # Bonus is not applied correctly and is far less than 30% claimed # Increase it to balance things out a bit override_defines_lua!("gavelkind", "NDiplomacy.GAVELKIND_MAX_SIZE_BONUS" => "0.50" ) end...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
ck2_mods/mods/adjust_character_religion.rb
Ruby
mit
46
master
5,099
require_relative "base" class AdjustCharacterReligionGameModification < CK2GameModification def title_religion unless @title_religion @title_religion = {} iterate_mod_files!("history/provinces/*.txt") do |node| religion = node["religion"] holdings = [ node["title"], ...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
ck2_mods/mods/canadian_culture.rb
Ruby
mit
46
master
4,177
# inherits to get #male_names and #female_names class CanadianCultureGameModification < AmericanCultureGameModification def surnames # Vancouver only, couldn't find all Canada # http://www.al6400.com/blog/100-most-common-surnames-in-vancouver/ %W[ Lee Wong Chan Smith Kim ...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
ck2_mods/mods/belarusian_culture.rb
Ruby
mit
46
master
1,990
class BelarusianCultureGameModification < CK2GameModification def belarusian_culture # Based on severian PropertyList[ "graphical_cultures", ["easternslavicgfx"], "color", [0.5, 0.8, 0.3], "male_names", ["Briachislav_Bretislaus", "Demid", "Dobrynia", "Fedot_Theodat", "Gleb", "Igor", "Iliya",...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
ck2_mods/mods/syntax_fixes.rb
Ruby
mit
46
master
1,777
require_relative "base" class SyntaxFixesGameModification < CK2GameModification # Not really deletion def delete_file!(path) patch_file!(path) do |content| "" end end def patch_by_regexp!(path, rx, replacement) patch_file!(path, reencode: "iso-8859-1") do |content| content.gsub(rx, rep...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
ck2_mods/mods/modern_times.rb
Ruby
mit
46
master
56,504
require "digest" require_relative "../modern_times/database" class Random def self.keyed(key) new(Digest::MD5.hexdigest(key).to_i(16)) end end # No idea if anything will ever come out of this class ModernTimesGameModification < CK2GameModification attr_reader :map, :character_manager, :db def reset_date ...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
ck2_mods/mods/no_localized_ranks.rb
Ruby
mit
46
master
1,446
require_relative "base" class NoLocalizedRanksGameModification < CK2GameModification def apply! cat = [ "", "city_", "vice_royalty_", "tribal_", "nomadic_", # No custom titles weirdly ] ranks = %W[ baron_ baron_female_ barony_ barony_of_ c...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
ck2_mods/mods/ruler_designer_reset.rb
Ruby
mit
46
master
1,213
require_relative "base" class RulerDesignerResetGameModification < CK2GameModification def apply! keys = %W[ COST_ATTRIB COST_SON COST_DAUGHTER COST_MARRIED COST_FERTILITY COST_HEALTH COST_MONTHLY_PRESTIGE COST_MONTHLY_PIETY COST_MONTHLY_WEALTH COST_GL...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
ck2_mods/mods/adjust_province_religion.rb
Ruby
mit
46
master
5,900
require_relative "base" class AdjustProvinceReligionGameModification < CK2GameModification # This method seems to be totally confused by one level, and yet it works... def deep_search(node, path=[], &blk) node.each do |key, val| if val.is_a?(PropertyList) deep_search(val, [*path, key], &blk) ...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
ck2_mods/mods/protestantism.rb
Ruby
mit
46
master
7,533
class ProtestantismGameModification < CK2GameModification def add_holy_sites!(sites) found = Set[] add_sites = proc do |node| node.each do |k, v| if sites[k] found << k # This is nasty but produces better looking output that add! entries = v.send(:entries) ...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
ck2_mods/mods/base.rb
Ruby
mit
46
master
1,635
require_relative "../../lib/paradox_game_modification" class CK2GameModification < ParadoxGameModification def cultures @cultures ||= begin culture_data = parse("common/cultures/00_cultures.txt") culture_data.keys + culture_data.values.flat_map(&:to_a).select{|prop| prop.val.is_a?(PropertyList)...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
ck2_mods/mods/no_dynastic_names.rb
Ruby
mit
46
master
497
require_relative "base" class NoDynasticNamesGameModification < CK2GameModification def apply! patch_mod_files!("common/cultures/*.txt") do |node| node.each do |group_name, group| group.each do |culture_name, culture| next if culture_name == "graphical_culture" next if culture_n...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
ck2_mods/mods/american_culture.rb
Ruby
mit
46
master
6,972
class AmericanCultureGameModification < CK2GameModification def surnames # https://en.wikipedia.org/wiki/List_of_most_common_surnames_in_North_America#United_States %W[ Smith Johnson Williams Brown Jones Miller Davis Garcia Rodriguez Wilson Mar...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
ck2_mods/mods/usa_invasion_events.rb
Ruby
mit
46
master
41,536
UsaInvasionEvents = PropertyList[ "namespace", "USA", "province_event", PropertyList[ "id", "USA.1", "desc", "EVTDESC_USA_001", "picture", "GFX_evt_aztec_explorers", "border", "GFX_event_normal_frame_war", "trigger", PropertyList[ "has_dlc", "Sunset Invasion", "NOT", PropertyList["ha...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
ck2_mods/mods/suez_canal.rb
Ruby
mit
46
master
640
require_relative "base" class SuezCanalGameModification < CK2GameModification # Because it's a portage, only use with allow_everyone_river_access! def apply! # 1382 - Gulf of Suez # 939 - Nile Delta # 789 - Pelusia patch_file!("map/adjacencies.csv", reencode: "iso-8859-1") do |content| [ ...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
ck2_mods/mods/ck2_custom_scenario.rb
Ruby
mit
46
master
2,799
require_relative "base" class CK2CustomScenarioGameModification < CK2GameModification def titles_to_clean_up # Do not destory papacy/patriarchy as they are important for game to function # Destroy caliphates as they are overly territorial and can be recreated quite easily @titles_to_clean_up ||= Set[*beg...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
ck2_mods/modern_times/holders_india.rb
Ruby
mit
46
master
11,683
ModernTimesDatabase::HOLDERS_INDIA = { e_offmap_china: { # Somewhat dubious when to start counting Qing, will only matter if we move back that far, which is unlikely # Wikipedia gives crowning dates leaving gaps, so we backdate everyone to death of their predecessor "1616.2.17" => {name: "Nurhaci | Qing",...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
ck2_mods/modern_times/character_manager.rb
Ruby
mit
46
master
4,746
# This class is one of the most painful parts of the code and desperately # needs refactoring class CharacterManager def initialize(builder) @main_namespace = 110_000_000 @reset_namespace = 100_000_000 @ruler_counts = Hash.new(0) @characters = {} @builder = builder @reset_date = builder.r...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
ck2_mods/modern_times/holders_scandinavia.rb
Ruby
mit
46
master
7,255
ModernTimesDatabase::HOLDERS_SCANDINAVIA = { k_denmark: { # All numbers below fake "1670.2.9" => { name: "Christian | Oldenburg", # 1, actually 5 lived: "1646.4.15 - 1699.8.25", }, "1699.8.25" => { name: "Frederik | Oldenburg", # 1, actually 4 lived: "1671.10.11 - 1730.10.12", ...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
ck2_mods/modern_times/bookmarks.rb
Ruby
mit
46
master
3,748
ModernTimesDatabase::BOOKMARKS = { ### History files testing: "1600.1.1" => { name: "Test 1600", }, "1648.10.24" => { name: "Peace of Westphalia", }, "1700.1.1" => { name: "Test 1700", }, "1750.1.1" => { name: "Test 1750", }, "1780.1.1" => { name: "Test 1780", }, ### Actual b...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
ck2_mods/modern_times/religions.rb
Ruby
mit
46
master
3,441
ModernTimesDatabase::RELIGIONS = { "k_england" => "protestant", "k_wales" => "protestant", "d_the_isles" => "protestant", "d_mecklemburg" => "protestant", "d_crimea" => "orthodox", "d_armenia" => "orthodox", "k_persia" => "shiite", "d_basra" => "shiite", "d_baghdad" => "shiite", "d_tripoli" => "shii...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
ck2_mods/modern_times/holders_balkans.rb
Ruby
mit
46
master
12,618
ModernTimesDatabase::HOLDERS_BALKANS = { d_krete: { # 21 December 1898, backdating to foundation "1898.12.13" => { # He's a royal but it was High Commissioner post name: "Georg | Schleswig-Holstein-Sonderburg-Glücksburg", lived: "1869.6.24 - 1957.11.25", }, "1906.10.1" => { nam...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
ck2_mods/modern_times/holders_britain.rb
Ruby
mit
46
master
4,948
ModernTimesDatabase::HOLDERS_BRITAIN = { # Dynasty changed names twice, but whatever e_britannia: { "1689.2.13" => { name: "William | Stuart", lived: "1650.11.4 - 1702.3.8", }, # From 1 May 1707 as UK, but let's not pretend Scotland mattered before "1702.3.8" => { name: "Anne | Stu...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
ck2_mods/modern_times/holders_italy.rb
Ruby
mit
46
master
13,696
ModernTimesDatabase::HOLDERS_ITALY = { k_italy: { "1773.2.20" => { name: "Vittorio Amadeo | Savoia", lived: "1726.6.26 - 1796.10.16", }, "1796.5.24" => { name: "Carlo Emanuele | Savoia", lived: "1751.5.24 - 1819.10.6", father: "Vittorio Amadeo" }, "1802.6.4" => { ...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
ck2_mods/modern_times/holders_russia.rb
Ruby
mit
46
master
16,104
ModernTimesDatabase::HOLDERS_RUSSIA = { e_russia: { "1645.6.12" => { name: "Aleksey | Romanov", #1 lived: "1629.5.9 - 1676.1.29", }, "1676.1.29" => { name: "Fyodor | Romanov", #1 lived: "1661.6.9 - 1682.5.7", father: "Aleksey" }, "1682.5.7" => { name: "Ivan | Ro...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
ck2_mods/modern_times/cultures.rb
Ruby
mit
46
master
3,199
ModernTimesDatabase::CULTURES = { "d_ascalon" => {forever_ago: "levantine_arabic", end_ww1: "ashkenazi"}, "c_jerusalem" => {forever_ago: "levantine_arabic", end_ww1: "ashkenazi"}, "c_acre" => {forever_ago: "levantine_arabic", end_ww1: "ashkenazi"}, "c_darum" => "levantine_arabic", "d_sevilla" => "castillan", ...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
ck2_mods/modern_times/holy_orders.rb
Ruby
mit
46
master
1,305
########################################## # HOLY ORDER BARONY HOLDINGS # (totally imaginary and bookmark independent) # # Names here are counties, but what they mean is first minor barony # Not sure if this order is better or reversing it to match Land DB # # It doesn't actually increase number of troops they can rais...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
ck2_mods/modern_times/titles.rb
Ruby
mit
46
master
25,889
ModernTimesDatabase::TITLES = { d_ferghana: { culture: :kirghiz, religion: :sunni, name: "Kyrgyzstan / Kyrgyz", liege: {end_ww1: "e_russia", fall_soviet_union: nil}, }, d_khuttal: { culture: :persian, religion: :sunni, name: "Tajikistan / Tajik", liege: {end_ww1: "e_russia", fall_s...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
ck2_mods/modern_times/land.rb
Ruby
mit
46
master
54,084
########################################################################### # TODO: k_england -> e_britannia / k_rus -> e_russia ModernTimesDatabase::LAND = { ######################################### # READY FOR 1600 BOOKMARK # Level of actualy Ottoman control was fairly minor d_sanaa: {times_immemorial: "e_...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
ck2_mods/modern_times/de_jure.rb
Ruby
mit
46
master
4,256
ModernTimesDatabase::DE_JURE = { "k_venice" => "e_italy", "k_sicily" => "e_italy", "d_aragon" => "k_aragon", "d_granada" => "k_castille", "d_brandenburg" => "k_pomerania", "k_ruthenia" => "e_wendish_empire", "k_galicia-volhynia" => "e_wendish_empire", "k_croatia" => "e_carpathia", "k_carinthia" => "e_...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
ck2_mods/modern_times/database.rb
Ruby
mit
46
master
18,792
class ModernTimesDatabase # builder currently used read only to get to MapManager def initialize(builder) @builder = builder end def min_date if ENV["DEBUG_HISTORY"] @min_date ||= Date.parse(ENV["DEBUG_HISTORY"]) else @min_date ||= resolve_date("1815.6.9") end end def title_de_...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
ck2_mods/modern_times/holders_middle_east.rb
Ruby
mit
46
master
11,918
ModernTimesDatabase::HOLDERS_MIDDLE_EAST = { k_persia: { "1785.2.18" => { name: "Jafar | Zand", lived: "- 1789.1.23", # wikipedia has no birth }, "1789.1.23" => { name: "Sayed Murad | Zand", lived: "- 1789.5.10", # wikipedia has no birth }, "1789.5.10" => { name: "Lot...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
ck2_mods/modern_times/technology.rb
Ruby
mit
46
master
3,557
ModernTimesDatabase::TECHNOLOGY = { # London tech group gets +1/+1/+1 over UK "d_bedford" => [5, 5, 5, 6, 6, 6, 7, 7, 7], # UK tech group "e_britannia" => [4, 4, 4, 5, 5, 5, 6, 6, 6], "k_frisia" => [4, 4, 4, 5, 5, 5, 6, 6, 6], "d_luxembourg" => [4, 4, 4, 5, 5, 5, 6, 6, 6], # Western Europe tech group "e...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
ck2_mods/modern_times/character.rb
Ruby
mit
46
master
2,694
class Character attr_reader :id, :historical_id, :name, :female, :birth, :death, :health, :father, :mother, :dynasty, :events, :culture, :religion, :culture, :traits, :events def initialize(**args) args.each do |k,v| send(:"#{k}=", v) end @traits = (@traits || []).to_s...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
ck2_mods/modern_times/holders_africa.rb
Ruby
mit
46
master
9,430
ModernTimesDatabase::HOLDERS_AFRICA = { k_mauretania: { "1757.11.10" => { name: "Mohammed | Alaouite", # 1 lived: "1710 - 1790.4.9", }, "1790.4.9" => { name: "Yazid | Alaouite", lived: "1750 - 1792.2.23", father: "Mohammed 1", }, "1792.2.23" => { name: "Slimane ...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
ck2_mods/modern_times/culture_manager.rb
Ruby
mit
46
master
1,461
class Random def sample(ary) ary[rand(ary.size)] end end class CultureManager def initialize(builder) @builder = builder @male_names = {} @female_names = {} @dynasties = {} @builder.glob("common/cultures/*.txt").each do |path| @builder.parse(path).each do |group_name, group| ...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
ck2_mods/modern_times/holders_western_europe.rb
Ruby
mit
46
master
10,795
ModernTimesDatabase::HOLDERS_WESTERN_EUROPE = { e_france: { "1799.11.10" => {name: "Napoleon | Bonaparte", lived: "1769.8.15 - 1821.5.5"}, # 7 July 1815, backdating to Congress of Vienna "1815.6.9" => {name: "Louis | Bourbon", lived: "1755.11.17 - 1824.9.16"}, "1824.9.16" => {name: "Charles | Bourbon...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
ck2_mods/modern_times/holders_central_europe.rb
Ruby
mit
46
master
8,023
ModernTimesDatabase::HOLDERS_CENTRAL_EUROPE = { e_carpathia: { "1804.8.11" => {name: "Franz | Habsburg", lived: "1768.2.12 - 1835.3.2"}, "1835.3.2" => {name: "Ferdinand | Habsburg", lived: "1793.4.19 - 1875.6.29", father: "Franz 1"}, # Can't find day date, just month "1848.12.1" => {name: "Franz Josep...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
ck2_mods/modern_times/holders_arabia.rb
Ruby
mit
46
master
10,197
ModernTimesDatabase::HOLDERS_ARABIA = { d_nefoud: { "1902.1.13" => {name: "Abdulaziz | Saud", lived: "1876.11.26 - 1953.11.9"}, end_ww1: nil, }, k_arabia: { # "Emirate of Nejd and Hasa" etc., maybe I should differentiate those titles # It's total bullshit backdating before "1902.1.13" when he got ...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
ck2_mods/modern_times/map_manager.rb
Ruby
mit
46
master
3,144
class MapManager attr_reader :title_capitals, :counties_in, :landed_titles_lookup, :baronies_in attr_reader :title_to_province_id def initialize(builder) @builder = builder @province_id_to_title = {} @title_to_province_id = {} @landed_titles_lookup = {} @title_capitals = {} @countie...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
ck2_mods/modern_times/holders_germany.rb
Ruby
mit
46
master
14,346
ModernTimesDatabase::HOLDERS_GERMANY = { d_brunswick: { congress_of_vienna: {use: "e_britannia George 3"}, "1820.1.29" => {use: "e_britannia George 4"}, "1830.6.26" => {use: "e_britannia William 2"}, "1837.6.20" => {name: "Ernest Augustus | Windsor", lived: "1771.6.5 - 1851.11.18", father: "e_britanni...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
ck2_mods/modern_times/dates.rb
Ruby
mit
46
master
9,874
# "Treaty of X" naming is a bit silly, as there are frequent conflicts # There were a lot of peace treaties at end of WW1 but it's easier to just do it in one go, at least for now # TODO: models both Balkan Wars properly module ModernTimesDatabase::Dates # Easy dates @dates = { ### Special tags reset_date:...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
fun_and_balance/mods/base.rb
Ruby
mit
46
master
1,666
require_relative "../../lib/paradox_game_modification" require "pry" class EU4GameModification < ParadoxGameModification def modify_node!(node, *modifications) modifications.each do |*path, expected, modified| actual = path.inject(node){|n,p| n ? n[p] : nil} raise "Node[#{path.join('/')}] expected `#...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
fun_and_balance/mods/fun_and_balance_1356.rb
Ruby
mit
46
master
2,211
require_relative "fun_and_balance_common" class FunAndBalance1356GameModification < FunAndBalanceCommonGameModification def apply! anyone_can_form_byzantium! buff_awful_idea_groups! can_convert_in_territories! cheaper_fort_maintenance! coalition_cb_defend_capital! custom_nation_tweaks! di...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
fun_and_balance/mods/religious_leagues.rb
Ruby
mit
46
master
21,189
require_relative "base" class ReligiousLeaguesGameModification < EU4GameModification # Event numbers: # Vanilla: # 1 - The Emperor Triumphant (Catholic) # 2 - Victory of the Protestant League # 3 - Victory of the Catholic League # 4 - Peace of Westphalia # 5 - The Evangelical Union # 6 - Th...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
fun_and_balance/mods/extra_formable_countries.rb
Ruby
mit
46
master
5,382
require_relative "base" class ExtraFormableCountriesGameModification < EU4GameModification def each_country_primary_culture glob("common/cultures/*.txt").each do |path| parse(path).each do |group_name, group| group = group.to_h group.delete "graphical_culture" group.delete "second_g...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
fun_and_balance/mods/fun_and_balance_common.rb
Ruby
mit
46
master
50,133
require_relative "base" require_relative "../../eu4_trade_graph/trade_graph" class FunAndBalanceCommonGameModification < EU4GameModification def anyone_can_form_byzantium! patch_mod_file!("decisions/RestoreByzantineEmpire.txt") do |node| node["country_decisions"]["restore_byzantine_empire"]["potential"].de...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
fun_and_balance/mods/nation_customizer.rb
Ruby
mit
46
master
3,320
require_relative "base" class NationCustomizerGameModification < EU4GameModification def fix_custom_idea_extra_ideas! # There used to be a list of extra custom ideas here, but all the meaningful ones are in game already anyway glob("common/custom_ideas/*.txt").each do |path| patch_mod_file!(path) do |...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
fun_and_balance/mods/achievements.rb
Ruby
mit
46
master
2,167
require_relative "base" class AchievementsGameModification < EU4GameModification # FIXME: ROOT is wrong in on_startup trigged, change to PREV or something def apply! triggers = [] init_script = PropertyList[] parse("common/achievements.txt").each do |name, achievement| id = achievement["id"] ...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
fun_and_balance/mods/fun_and_balance_vanilla.rb
Ruby
mit
46
master
7,090
require_relative "fun_and_balance_common" class FunAndBalanceGameModification < FunAndBalanceCommonGameModification def apply! anyone_can_form_byzantium! # buff_awful_idea_groups! # not even worth the change, it's awful either way, so either rebalance properly or don't bother coalition_cb_defend_capital!...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
fun_and_balance/mods/fun_and_balance_et.rb
Ruby
mit
46
master
2,242
require_relative "fun_and_balance_common" class FunAndBalanceETGameModification < FunAndBalanceCommonGameModification def apply! anyone_can_form_byzantium! buff_awful_idea_groups! cheaper_fort_maintenance! coalition_cb_defend_capital! custom_nation_tweaks! disable_call_for_peace! disable_...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
fun_and_balance/mods/disable_normal_or_historical_check.rb
Ruby
mit
46
master
394
require_relative "base" # This is a good change, but it conflicts with too many mods to be left as default class DisableNormalOrHistoricalCheck < EU4GameModification def apply! patch_files!("**/*.txt", reencode: true) do |content| next content unless content =~ /normal_or_historical_nations/ content...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
fun_and_balance/mods/religious_leagues_complex.rb
Ruby
mit
46
master
21,571
require_relative "base" # This is the two stage system, it's probably too much class ReligiousLeaguesComplexGameModification < EU4GameModification # Event numbers: # 10x - x emperor won # 20x - x diet # 3xy - victory in x-vs-y war # 40x - x league starts RELIGION = { "catholic" => 1, "protestant"...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
analysis_eu4_save/eu4_save.rb
Ruby
mit
46
master
14,038
require "set" class TradeNodeCountryInformation attr_reader :tag, :attrs def initialize(tag, node) @tag = tag @attrs = node.to_h @attrs.delete("max_demand") # Unclear what it even is @attrs.delete("trading_policy_date") # Totally uninteresting end def empty? @attrs.empty? end def tota...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
analysis_eu4_save/eu4_save_analysis.rb
Ruby
mit
46
master
2,187
require_relative "../lib/paradox_game" require_relative "eu4_save" require "pry" class EU4SaveAnalysis < ParadoxGame def initialize(save_game, *roots) super(*roots) if save_game.is_a?(EU4Save) @save = save_game else @save = EU4Save.new(save_game) end end def country_name(tag) @sa...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
visualization_eu4/image_generation.rb
Ruby
mit
46
master
2,368
require "RMagick" require_relative "../visualization_hoi4/blob_midpoint" module ImageGeneration def province_definitions @province_definitions ||= begin defs = {} parse_csv("map/definition.csv")[1..-1].each do |id, r, g, b, name, _| defs[id.to_i] = [[r.to_i, g.to_i, b.to_i].pack("CCC"), name]...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
visualization_eu4/timelapse_visualization.rb
Ruby
mit
46
master
1,732
#!/usr/bin/env ruby require "RMagick" require "pp" require_relative "../lib/paradox" require_relative "image_generation" require_relative "game_map" require_relative "world_history" class TimelapseVisualization < ParadoxGame include ImageGeneration include GameMap def initialize(save_game, *roots) @world =...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
visualization_eu4/visualization.rb
Ruby
mit
46
master
1,164
#!/usr/bin/env ruby require "RMagick" require_relative "../lib/paradox" require_relative "image_generation" require_relative "game_map" class Visualization < ParadoxGame include ImageGeneration include GameMap def generate_map_by_continent! continent_colors = { "europe" => [181, 72, 106], ...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
visualization_eu4/world_history.rb
Ruby
mit
46
master
2,337
#!/usr/bin/env ruby require_relative "../lib/paradox" class ProvinceState attr_reader :state def initialize @state = { "cores" => [], "claims" => [], "discovered_by" => [], } end def command!(key, val) case key when "add_core" @state["cores"] |= [val] when "add_cla...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
visualization_eu4/timelapse_visualization_new_world.rb
Ruby
mit
46
master
1,897
#!/usr/bin/env ruby require_relative "timelapse_visualization" class TimelapseVisualizationNewWorld < TimelapseVisualization def initialize(save_game, new_world_base, *roots) @provinces_image = Magick::Image.read(new_world_base).first super(save_game, *roots) end def new_world_religion_color(i) r =...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
visualization_eu4/game_map.rb
Ruby
mit
46
master
3,365
module GameMap def default_map @default_map ||= parse("map/default.map") end def land_province_ids @land_province_ids ||= begin (1...default_map["max_provinces"]).to_a - sea_province_ids end end def sea_province_ids @sea_province_ids ||= begin default_map["lakes"] | default_map["...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
visualization_hoi4/blob_midpoint.rb
Ruby
mit
46
master
434
# We assume there's no crossing x=0 line class BlobMidpoint def initialize @x_total = 0.0 @y_total = 0.0 @samples = 0 end def add(x,y) @x_total += x @y_total += y @samples += 1 end def x return if @samples == 0 (@x_total / @samples).round end def y return if @samples...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
visualization_hoi4/game_map.rb
Ruby
mit
46
master
4,879
require_relative "blob_midpoint" module GameMap def province_definitions @province_definitions ||= begin defs = {} parse_csv("map/definition.csv")[1..-1].each do |id, r, g, b, land_sea, *| defs[id.to_i] = [[r.to_i, g.to_i, b.to_i].pack("CCC"), land_sea] end defs end end d...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
visualization_ck2/image_generation.rb
Ruby
mit
46
master
2,456
require "RMagick" module ImageGeneration def province_definitions @province_definitions ||= begin defs = {} parse_csv("map/definition.csv")[1..-1].each do |id, r, g, b, name, _| defs[id.to_i] = [[r.to_i, g.to_i, b.to_i].pack("CCC"), name] end defs end end def provinces_im...
github
taw/paradox-tools
https://github.com/taw/paradox-tools
ck2_modpack/Rakefile
Ruby
mit
46
master
7,953
require "pathname" require "pathname-glob" require "pry" require "shellwords" # Explicit include list @included_mods = [ # UI only "!bigger_lists", # this is expected conflict with arumbamodpack but I don"t want to complicate things "animeportraits", "biggerinterface", # in arumbamodpack "blueduke", "color...
github
sidoh/ledenet_api
https://github.com/sidoh/ledenet_api
ledenet_api.gemspec
Ruby
mit
46
master
910
# coding: utf-8 $:.push File.expand_path('../lib', __FILE__) require "ledenet/version" Gem::Specification.new do |spec| spec.name = "ledenet_api" spec.version = LEDENET::VERSION spec.authors = ["Christopher Mullins"] spec.email = ["chris@sidoh.org"] spec.summary = %q{An A...
github
sidoh/ledenet_api
https://github.com/sidoh/ledenet_api
lib/ledenet/functions.rb
Ruby
mit
46
master
981
module LEDENET module Functions VALUES = [ SEVEN_COLOR_CROSS_FADE = 0x25, RED_GRADUAL_CHANGE = 0x26, GREEN_GRADUAL_CHANGE = 0x27, BLUE_GRADUAL_CHANGE = 0x28, YELLOW_GRADUAL_CHANGE = 0x29, CYAN_GRADUAL_CHANGE = 0x2A, PURPLE_GRADUAL_CHANGE = 0x2B, WHITE_GRADUAL_CHANGE...
github
sidoh/ledenet_api
https://github.com/sidoh/ledenet_api
lib/ledenet/device_discovery.rb
Ruby
mit
46
master
2,089
require 'socket' require 'timeout' require 'set' module LEDENET class Device attr_reader :ip, :hw_addr, :model def initialize(device_str) parts = device_str.split(',') @ip = parts[0] @hw_addr = parts[1] @model = parts[2] end end DEFAULT_OPTIONS = { expected_devices: 1...
github
sidoh/ledenet_api
https://github.com/sidoh/ledenet_api
lib/ledenet/function_speed.rb
Ruby
mit
46
master
918
module LEDENET class FunctionSpeed # Speed range exposed through API INTERFACE_SPEED_RANGE = (1..100) # Speed value is in [0x01, 0x1F], with 0x00 being the fastest. PACKET_SPEED_RANGE = (0x01..0x1F) attr_reader :value def initialize(value) @value = value end def packet_value ...
github
sidoh/ledenet_api
https://github.com/sidoh/ledenet_api
lib/ledenet/api.rb
Ruby
mit
46
master
4,098
require 'ledenet/packets/set_power_request' require 'ledenet/packets/status_request' require 'ledenet/packets/update_color_request' require 'ledenet/packets/set_function_request' module LEDENET class Api DEFAULT_OPTIONS = { reuse_connection: false, max_retries: 3, port: 5577 } de...
github
sidoh/ledenet_api
https://github.com/sidoh/ledenet_api
lib/ledenet/packets/set_power_request.rb
Ruby
mit
46
master
630
require 'bindata' require 'ledenet/packets/fields/checksum' require 'ledenet/packets/empty_response' module LEDENET::Packets class SetPowerRequest < BinData::Record mandatory_parameter :on? hide :checksum uint8 :packet_id, value: 0x71 uint8 :power_status, value: ->() { on? ? 0x23 : 0x24 } uint8...
github
sidoh/ledenet_api
https://github.com/sidoh/ledenet_api
lib/ledenet/packets/status_request.rb
Ruby
mit
46
master
426
require 'bindata' require 'ledenet/packets/fields/checksum' require 'ledenet/packets/status_response' module LEDENET::Packets class StatusRequest < BinData::Record hide :checksum uint8 :packet_id, value: 0x81 uint8 :payload1, value: 0x8A uint8 :payload2, value: 0x8B checksum :checksum, packet_...
github
sidoh/ledenet_api
https://github.com/sidoh/ledenet_api
lib/ledenet/packets/update_color_request.rb
Ruby
mit
46
master
590
require 'bindata' require 'ledenet/packets/fields/checksum' require 'ledenet/packets/empty_response' module LEDENET::Packets class UpdateColorRequest < BinData::Record hide :checksum uint8 :packet_id, value: 0x31 uint8 :red uint8 :green uint8 :blue uint8 :warm_white uint8 :unused_payl...
github
sidoh/ledenet_api
https://github.com/sidoh/ledenet_api
lib/ledenet/packets/status_response.rb
Ruby
mit
46
master
626
require 'bindata' require 'ledenet/packets/fields/checksum' module LEDENET::Packets class StatusResponse < BinData::Record hide :checksum uint8 :packet_id, value: 0x81 uint8 :device_name uint8 :power_status # I'm not sure these are the correct field labels. Basing it off of some # documen...
github
sidoh/ledenet_api
https://github.com/sidoh/ledenet_api
lib/ledenet/packets/set_function_request.rb
Ruby
mit
46
master
442
require 'bindata' require 'ledenet/packets/fields/checksum' require 'ledenet/packets/empty_response' module LEDENET::Packets class SetFunctionRequest < BinData::Record hide :checksum uint8 :packet_id, value: 0x61 uint8 :function_id uint8 :speed uint8 :remote_or_local, value: 0x0F checksum :...
github
repeatedly/fluent-plugin-beats
https://github.com/repeatedly/fluent-plugin-beats
Rakefile
Ruby
apache-2.0
46
master
277
require 'bundler' Bundler::GemHelper.install_tasks require 'rake/testtask' Rake::TestTask.new(:test) do |test| test.libs << 'lib' << 'test' test.test_files = FileList['test/plugin/test_*.rb'] test.verbose = false test.warning = false end task :default => [:build]
github
repeatedly/fluent-plugin-beats
https://github.com/repeatedly/fluent-plugin-beats
fluent-plugin-beats.gemspec
Ruby
apache-2.0
46
master
1,071
# encoding: utf-8 $:.push File.expand_path('../lib', __FILE__) Gem::Specification.new do |gem| gem.name = "fluent-plugin-beats" gem.description = "Elastic beats plugin for Fluentd event collector" gem.license = "Apache-2.0" gem.homepage = "https://github.com/repeatedly/fluent-plugin-beats" gem....
github
repeatedly/fluent-plugin-beats
https://github.com/repeatedly/fluent-plugin-beats
lib/fluent/plugin/in_beats.rb
Ruby
apache-2.0
46
master
4,323
# # Fluent # # Copyright (C) 2015 Masahiro Nakagawa # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ap...
github
repeatedly/fluent-plugin-beats
https://github.com/repeatedly/fluent-plugin-beats
lib/lumberjack/beats.rb
Ruby
apache-2.0
46
master
314
# encoding: utf-8 require "json" module Lumberjack module Beats SEQUENCE_MAX = (2**32-1).freeze @@json = Class.new do def self.load(blob) JSON.parse(blob) end def self.dump(v) v.to_json end end def self.json @@json end def self.json=(j) @@json = j end end; end
github
repeatedly/fluent-plugin-beats
https://github.com/repeatedly/fluent-plugin-beats
lib/lumberjack/beats/server.rb
Ruby
apache-2.0
46
master
12,790
# encoding: utf-8 require "lumberjack/beats" require "socket" require "thread" require "openssl" require "zlib" require "json" require "concurrent" module Lumberjack module Beats class Server SOCKET_TIMEOUT = 1 # seconds attr_reader :port # Create a new Lumberjack server. # # - options is a has...
github
repeatedly/fluent-plugin-beats
https://github.com/repeatedly/fluent-plugin-beats
lib/lumberjack/beats/client.rb
Ruby
apache-2.0
46
master
5,539
# encoding: utf-8 require "lumberjack/beats" require "socket" require "thread" require "openssl" require "zlib" module Lumberjack module Beats class Client def initialize(opts={}) @opts = { :port => 0, :addresses => [], :ssl_certificate => nil, :ssl => true, :json =>...
github
repeatedly/fluent-plugin-beats
https://github.com/repeatedly/fluent-plugin-beats
test/plugin/test_in_beats.rb
Ruby
apache-2.0
46
master
3,039
require 'fluent/test' require 'fluent/test/driver/input' require 'fluent/plugin/in_beats' require 'lumberjack/beats/client' require 'helper' class BeatsInputTest < Test::Unit::TestCase def setup Fluent::Test.setup end PORT = find_available_port CONFIG = %[ port #{PORT} bind 127.0.0.1 tag tes...
github
supertinou/livequiz
https://github.com/supertinou/livequiz
Gemfile
Ruby
mit
46
develop
1,450
source "https://rubygems.org" ruby "2.2.1" gem "airbrake" gem "bourbon", "~> 4.2.0" gem "coffee-rails", "~> 4.1.0" gem "delayed_job_active_record" gem "email_validator" gem "flutie" gem "high_voltage" gem "i18n-tasks" gem "jquery-rails" gem "neat", "~> 1.7.0" gem "newrelic_rpm", ">= 3.9.8" gem "normalize-rails", "~> ...
github
supertinou/livequiz
https://github.com/supertinou/livequiz
Rakefile
Ruby
mit
46
develop
436
# Add your own tasks in files placed in lib/tasks ending in .rake, # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. require File.expand_path('../config/application', __FILE__) Rails.application.load_tasks task(:default).clear task default: [:spec] if defined? RSpec task(:s...
github
supertinou/livequiz
https://github.com/supertinou/livequiz
spec/i18n_spec.rb
Ruby
mit
46
develop
519
require 'i18n/tasks' describe 'I18n' do let(:i18n) { I18n::Tasks::BaseTask.new } let(:missing_keys) { i18n.missing_keys } let(:unused_keys) { i18n.unused_keys } it 'does not have missing keys' do expect(missing_keys).to be_empty, "Missing #{missing_keys.leaves.count} i18n keys, run `i18n-tasks missi...