dtr_core 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d7262ad471060f31d350056263e7c7e7fef3a37451aa6e62dd8ec7fc6bc14ed6
4
- data.tar.gz: 72ab429eba23bbe05fe544a940c14b169460812abac111f789631c218dff9f9c
3
+ metadata.gz: 9594c7bac85d086ec888836ba17242023cadaccc4f6d4dc268520035324e682b
4
+ data.tar.gz: a9cb05cd8ac136ebaf433b7f7f6c6d2fc64f60e807588b59f435a056311a2374
5
5
  SHA512:
6
- metadata.gz: 4aa2e73de48f3fa830191fd343672aae42a2772508ec14a8934e9bcfe184d32eb6be6ae7b0f6aa10bd5374865b529fb79592aa61f03fb3ea0900dd369c6c846b
7
- data.tar.gz: af2b76f508014aadc00445fc9e942a4036579fdd7c2812f6b6b614e7d8539f0ea8a511b29e221fb87d4cfbb10b3551c07739596cd8fea35c71df84fec991ac93
6
+ metadata.gz: 189ffb27f3065aaa6d09bb5da75b693abe88236e073792aea4b0f33a609fa9383d187cbb12bf246e5bb470476bb767b4c74f60067f7cfa3e51a24383f742ff46
7
+ data.tar.gz: a261d658929cd4c9208f47ccebafc3d5b9b065fb328a184637fad60c843d6a000ec4cbbf736b57e9a4152be1e2433dd2bfb13b86319a653c7cec25a3d71b122a
@@ -17,6 +17,12 @@ module DTRCore
17
17
  new(parser.name_section, parser.state_section, parser.function_section)
18
18
  end
19
19
 
20
+ def self.from_dtr_raw(content)
21
+ parser = DTRCore::Parser.new('', content:)
22
+
23
+ new(parser.name_section, parser.state_section, parser.function_section)
24
+ end
25
+
20
26
  def ==(other)
21
27
  name == other.name &&
22
28
  state == other.state &&
@@ -7,10 +7,14 @@ module DTRCore
7
7
  class Parser
8
8
  include ::DTRCore::Common
9
9
 
10
- def initialize(file_path)
11
- raise "Unable to find file: #{file_path}." unless File.exist?(file_path)
10
+ def initialize(file_path, content: nil)
11
+ if content
12
+ @content = content
13
+ else
14
+ raise "Unable to find file: #{file_path}." unless File.exist?(file_path)
12
15
 
13
- @content = File.read(file_path)
16
+ @content = File.read(file_path)
17
+ end
14
18
  end
15
19
 
16
20
  attr_reader :content
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dtr_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rob Durst
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-05-11 00:00:00.000000000 Z
11
+ date: 2024-05-12 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Core smart contract intermediate language (Digicus Textual Representation)
14
14
  parser.