tealrb 0.2.0 → 0.4.0
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 +4 -4
- data/lib/tealrb/if_block.rb +4 -4
- data/lib/tealrb/opcode_modules.rb +32 -5
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa3ecdb5dd00d5242fc4606722bc6d6c80625f0dd042fe8a64aaec481fe4bb6d
|
4
|
+
data.tar.gz: 59ddc597857e55d7b0d6187325d0ff76e3e049403fcdf1ede00f2b3a9a1c2eaf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3757a7177af88cef08ab3c780fde484210dc5c2a9667a6733815b72b5dfef2e1aeaa176c65ab48be5010cf973c40c1af04b33e3516f14a8bc818a58f5972776b
|
7
|
+
data.tar.gz: b508d5fa005be7eaf3adf738542c38a053240ccfa73d0de0c2b6410a0ad4358d7a31e90d2899d35aeafc1407955ae5f0ab96ae8083ec1b0aabaf7ffbcd937547
|
data/lib/tealrb/if_block.rb
CHANGED
@@ -6,16 +6,16 @@ module TEALrb
|
|
6
6
|
attr_accessor :id
|
7
7
|
end
|
8
8
|
|
9
|
-
@id =
|
9
|
+
@id = {}.compare_by_identity
|
10
10
|
|
11
11
|
def initialize(teal, _cond, &blk)
|
12
|
+
self.class.id[teal] ||= 0
|
12
13
|
@teal = teal
|
13
14
|
@else_count = 0
|
14
|
-
@id = self.class.id
|
15
|
+
@id = self.class.id[@teal]
|
15
16
|
@end_label = "if#{@id}_end:"
|
16
17
|
|
17
|
-
|
18
|
-
self.class.id += 1
|
18
|
+
self.class.id[@teal] += 1
|
19
19
|
|
20
20
|
@teal << "bz if#{@id}_else0"
|
21
21
|
blk.call
|
@@ -664,13 +664,40 @@ module TEALrb
|
|
664
664
|
end
|
665
665
|
end
|
666
666
|
|
667
|
-
|
668
|
-
|
669
|
-
extend TxnFields
|
667
|
+
class TxnaField
|
668
|
+
include Opcodes
|
670
669
|
|
671
|
-
def
|
670
|
+
def initialize(field, index = nil)
|
671
|
+
@field = field
|
672
672
|
@teal = TEALrb::TEAL.current[Thread.current]
|
673
|
-
txna
|
673
|
+
txna(field, index) if index
|
674
|
+
end
|
675
|
+
|
676
|
+
def [](index)
|
677
|
+
@teal = TEALrb::TEAL.current[Thread.current]
|
678
|
+
txna @field, index
|
679
|
+
end
|
680
|
+
end
|
681
|
+
|
682
|
+
module Txna
|
683
|
+
def self.application_args(index = nil)
|
684
|
+
TxnaField.new('ApplicationArgs', index)
|
685
|
+
end
|
686
|
+
|
687
|
+
def self.accounts(index = nil)
|
688
|
+
TxnaField.new('Accounts', index)
|
689
|
+
end
|
690
|
+
|
691
|
+
def self.assets(index = nil)
|
692
|
+
TxnaField.new('Assets', index)
|
693
|
+
end
|
694
|
+
|
695
|
+
def self.applications(index = nil)
|
696
|
+
TxnaField.new('Applications', index)
|
697
|
+
end
|
698
|
+
|
699
|
+
def self.logs(index = nil)
|
700
|
+
TxnaField.new('Logs', index)
|
674
701
|
end
|
675
702
|
end
|
676
703
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tealrb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joe Polny
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-05-
|
11
|
+
date: 2022-05-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: method_source
|
@@ -108,6 +108,20 @@ dependencies:
|
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: 0.19.1
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: rubocop-rake
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: 0.6.0
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: 0.6.0
|
111
125
|
- !ruby/object:Gem::Dependency
|
112
126
|
name: yard
|
113
127
|
requirement: !ruby/object:Gem::Requirement
|