cocoapods-hmap-prebuilt 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d189ef8201c8798107aea9e91ed335cc4aeea99814cc78cfe053b89c97259ebf
|
4
|
+
data.tar.gz: e99400f4e44fe8ac3e64167493eb62d71826d5fdb1e58e89948c43dcd82bcfb2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a70c5f2440ffb93a27c6706b997067111ab6a16598e751354653d53c49dce4219a6e19a846ac3b54c0a22ceb84360a2830c7d98d35ae0b38d2dacb0dc5e3c103
|
7
|
+
data.tar.gz: 76b7ed93626493ca1385034f271bbfdcc4e98b3e700e09a0e708b9253bb56c6889c0f44f03f09ae535452127752b3a4855a924f5646765a93c64e19656761425
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module HMap
|
2
|
+
# A generic HMap error in execution.
|
3
|
+
class HMapError < RuntimeError
|
4
|
+
end
|
5
|
+
|
6
|
+
# Raised when a file is not a HMap.
|
7
|
+
class NotAHMapOError < HMapError
|
8
|
+
end
|
9
|
+
|
10
|
+
# Raised when a file is too short to be a valid HMap file.
|
11
|
+
class TruncatedFileError < NotAHMapOError
|
12
|
+
def initialize
|
13
|
+
super 'File is too short to be a valid HMap'
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
# Raised when a file's magic bytes are not valid HMap magic.
|
18
|
+
class MagicError < NotAHMapOError
|
19
|
+
def initialize(magic)
|
20
|
+
super format('Unrecognized HMap magic: 0x%02<magic>x', magic: magic)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
# Raised when a class is not the class of obj.
|
25
|
+
class ClassIncludedError < HMapError
|
26
|
+
def initialize(cls1, cls2)
|
27
|
+
super format('%<cls1>s must be the %<cls2>s of obj', cls1: cls1, cls2: cls2)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module HMap
|
2
|
+
class HMapFile
|
3
|
+
# @return mapfile string_table
|
4
|
+
attr_reader :string_table
|
5
|
+
|
6
|
+
# @return [Array<HMap::HMapBucketStr>] an array of the file's bucktes
|
7
|
+
# @note bucktes are provided in order of ascending offset.
|
8
|
+
attr_reader :buckets
|
9
|
+
|
10
|
+
# @api private
|
11
|
+
def initialize(strings, buckets)
|
12
|
+
@string_table = strings
|
13
|
+
@buckets = buckets
|
14
|
+
@map_data = HMapData.new(buckets)
|
15
|
+
end
|
16
|
+
|
17
|
+
# @return [String] the serialized fields of the mafile
|
18
|
+
def serialize
|
19
|
+
@map_data.serialize + @string_table
|
20
|
+
end
|
21
|
+
|
22
|
+
# Write all mafile data to the given filename.
|
23
|
+
# @param filename [String] the file to write to
|
24
|
+
# @return [void]
|
25
|
+
def write(path)
|
26
|
+
contents = serialize
|
27
|
+
Utils.update_changed_file(path, contents)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
data/lib/cocoapods_plugin.rb
CHANGED
@@ -1,11 +1,13 @@
|
|
1
1
|
require 'cocoapods-hmap-prebuilt/command/hmap_writer'
|
2
2
|
require 'cocoapods-hmap-prebuilt/command/hmap_reader'
|
3
3
|
|
4
|
-
module
|
4
|
+
module Pod
|
5
|
+
module CocoapodsHmapPrebuiltHook
|
5
6
|
Pod::HooksManager.register('cocoapods-hmap-prebuilt', :post_install) do
|
6
7
|
Command::HMapWriter.run(["--project-directory=#{Config.instance.installation_root}", "--nosave-origin-header-search-paths"])
|
7
8
|
end
|
8
9
|
Pod::HooksManager.register('cocoapods-hmap-prebuilt', :post_update) do
|
9
10
|
Command::HMapWriter.run(["--project-directory=#{Config.instance.installation_root}", "--nosave-origin-header-search-paths"])
|
10
11
|
end
|
12
|
+
end
|
11
13
|
end
|