Class: Kosmos::Package
Direct Known Subclasses
AIESAerospace, AMOKDynamicsStuffA, Achievements, ActiveTextureManagementAggressive, ActiveTextureManagementBasic, AdvancedAnimator, AdvancedJetEngine, AerojetKerbodyne, AmbientLightAdjustment, AntennaRange, AsmisECLSSMod, AstronomersVisualPackDefault, AstronomersVisualPackHigh, AstronomersVisualPackHigher, AstronomersVisualPackLow, AstronomersVisualPackPushIt, AtmosphericSoundEnhancement, AutoAsparagus, AutoUnlockPartModels, AviationLights, B9Aerospace0235Fix, B9AerospaceModZeroFix, B9AerospacePack, B9IVAExtension, B9S2CockpitExtended2RearSeats, BahaExtraplanetaryParts, BetterAtmospheresHighDef, BetterAtmospheresLowDef, BetterAtmospheresMediumDef, BetterRoveMates, BetterThanStartingManned, BobCatindSovietAmericanPacks, BoltOnMissionProbe, CELSSGreenhouse, Cacteye, CargoTransferBags, CelestialBodyScienceMultiplierEditor, Chatterer, CoffeeIndustriesModularAirliner, ConicsConfigurator, ConnectedLivingSpaceAPI, ConstellationEssentials, CoolRockets, CrossFeedEnabler, CustomAsteroids, DMagicOrbitalScienceProbeandRoverSciencePack, DangIt, DarkMultiPlayer, DavonSupply, DavonThrottleControlsystems, DeadlyReentry, DistantObjectEnhancement, DockingPortAlignmentIndicator, DownUnderAerospacePartySuppliesContinued, ECLSS, EditorExtensions, EditorPartHighlighter, EngineIgnitor, EnhancedNavball, EnvironmentalVisualEnhancementsHighRes, EnvironmentalVisualEnhancementsLowRes, FASA, FASAGeminiAlternateIVA, FerramAerospaceResearch, Firespitter, FlightManagerforReusableStages, FusTekStationParts, Fusebox, GimbalAutoTrim, GingerCorpStockalikeStationHubs, GlowStrips, HGRNewsphericalpodavailable, HabitatPack, HangarExtender, HooliganLabsAirships, HooliganLabsSquidLandingLegs, HooliganLabsSubmarines, HotRockets, HullcamVDS, Hyperedit, ImprovedChaseCamera, InfernalRobotics, KSPInterstellar, KWRocketry, KerbalAlarmClock, KerbalAttachmentSystem, KerbalEngineerRedux, KerbalEngineerReduxPatch, KerbalJointReinforcement, KerbalStockParteXpansion, KethanePack, LaunchCountDown, MechJeb, Mk2CockpitInterior, ModularFuelTanks, ModuleManager, NearFuturePropulsion, NearFuturePropulsionLowDef, NovaPunch, PartCatalog, PlanetaryEditingTools, PreciseNode, ProceduralFairings, RcsBuildAid, RealChute, RemoteTech2, SafeChute, Scansat, ScienceAlert, ServiceCompartmentTubes, SpacePlanePlus, TACFuelBalancer, TACLifeSupport, TextureReplacer, Toolbar, TweakScale, TweakableEverything, VanguardTechnologies, VanguardTechnologiesEVAParachutes, VesselOrbitalInformationalDisplay
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
-
#install!(ksp_path) ⇒ Object
Internal version of the ‘install` method, which handles procedures commong to all packages, such as saving work before and after installation, as well as downloading and unzipping packages and running post-processors.
Methods included from PackageDsl
#merge_directory
Instance Attribute Details
#download_dir ⇒ Object
Returns the value of attribute download_dir.
12
13
14
|
# File 'lib/kosmos/package.rb', line 12
def download_dir
@download_dir
end
|
#ksp_path ⇒ Object
Returns the value of attribute ksp_path.
12
13
14
|
# File 'lib/kosmos/package.rb', line 12
def ksp_path
@ksp_path
end
|
Class Method Details
.find(name) ⇒ Object
60
61
62
63
64
65
66
|
# File 'lib/kosmos/package.rb', line 60
def find(name)
@@packages.find do |package|
package.names.any? do |candidate_name|
normalize_for_find(candidate_name) == normalize_for_find(name)
end
end
end
|
.inherited(package) ⇒ Object
a callback for when a subclass of this class is created
48
49
50
|
# File 'lib/kosmos/package.rb', line 48
def inherited(package)
(@@packages ||= []) << package
end
|
.normalize_for_find(name) ⇒ Object
52
53
54
|
# File 'lib/kosmos/package.rb', line 52
def normalize_for_find(name)
name.downcase.gsub(' ', "-")
end
|
.normalized_title ⇒ Object
56
57
58
|
# File 'lib/kosmos/package.rb', line 56
def normalized_title
normalize_for_find(title)
end
|
.search(name) ⇒ Object
68
69
70
71
72
73
74
|
# File 'lib/kosmos/package.rb', line 68
def search(name)
@@packages.min_by do |package|
package.names.map do |candidate_name|
DamerauLevenshtein.distance(name, candidate_name)
end.min
end
end
|
Instance Method Details
#install!(ksp_path) ⇒ Object
Internal version of the ‘install` method, which handles procedures commong to all packages, such as saving work before and after installation, as well as downloading and unzipping packages and running post-processors.