abidoc 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: e04cd527574913ca48d6b137779994b1b8591e5f6fef541eb15bf8e3b6189b2c
4
+ data.tar.gz: f7ad37ae9775b095d34f74907fee9b84f6af5e574ff939de34090fe654ce98cf
5
+ SHA512:
6
+ metadata.gz: 9c60fab097d3b48c02367f98a4f64690c7679467b7c68ab0f7d50631d9da65a75b1546c03cba5644da23fd671643cfef9f9ba8ea89aa832d7926f623495b5aeb
7
+ data.tar.gz: c9aa02b3c23cc0b0bc147138726f352d70dedb5e9ecd09b6f4e0be479379d61522b5f15af1c3bccbc75d16ed0e36dded8fcc77356499266e1458928d7d234e12
data/CHANGELOG.md ADDED
@@ -0,0 +1,3 @@
1
+ ### 0.0.1 / 2022-12-26
2
+
3
+ * Everything is new. First release
data/Manifest.txt ADDED
@@ -0,0 +1,6 @@
1
+ CHANGELOG.md
2
+ Manifest.txt
3
+ README.md
4
+ Rakefile
5
+ lib/abidoc.rb
6
+ lib/abidoc/version.rb
data/README.md ADDED
@@ -0,0 +1,28 @@
1
+ # Application Binary Inteface (ABI) Documentation Generator For Ethereum & Co.
2
+
3
+ abidoc - application binary interface (abi) documentation generator for Ethereum & Co. (blockchain) contracts
4
+
5
+
6
+ * home :: [github.com/rubycocos/blockchain](https://github.com/rubycocos/blockchain)
7
+ * bugs :: [github.com/rubycocos/blockchain/issues](https://github.com/rubycocos/blockchain/issues)
8
+ * gem :: [rubygems.org/gems/abidoc](https://rubygems.org/gems/abidoc)
9
+ * rdoc :: [rubydoc.info/gems/abidoc](http://rubydoc.info/gems/abidoc)
10
+
11
+
12
+ ## Usage
13
+
14
+
15
+
16
+
17
+ ## License
18
+
19
+ The scripts are dedicated to the public domain.
20
+ Use it as you please with no restrictions whatsoever.
21
+
22
+
23
+ ## Questions? Comments?
24
+
25
+
26
+ Post them on the [D.I.Y. Punk (Pixel) Art reddit](https://old.reddit.com/r/DIYPunkArt). Thanks.
27
+
28
+
data/Rakefile ADDED
@@ -0,0 +1,32 @@
1
+ require 'hoe'
2
+ require './lib/abidoc/version.rb'
3
+
4
+
5
+ Hoe.spec 'abidoc' do
6
+
7
+ self.version = ABIDoc::VERSION
8
+
9
+ self.summary = "abidoc - application binary interface (abi) documentation generator for Ethereum & Co. (blockchain) contracts"
10
+ self.description = summary
11
+
12
+ self.urls = { home: 'https://github.com/rubycocos/blockchain' }
13
+
14
+ self.author = 'Gerald Bauer'
15
+ self.email = 'wwwmake@googlegroups.com'
16
+
17
+ # switch extension to .markdown for gihub formatting
18
+ self.readme_file = 'README.md'
19
+ self.history_file = 'CHANGELOG.md'
20
+
21
+ self.extra_deps = [
22
+ ['abiparser'],
23
+ ]
24
+
25
+ self.licenses = ['Public Domain']
26
+
27
+ self.spec_extras = {
28
+ required_ruby_version: '>= 2.3'
29
+ }
30
+
31
+ end
32
+
@@ -0,0 +1,25 @@
1
+
2
+ module ABIDoc
3
+
4
+ MAJOR = 0
5
+ MINOR = 0
6
+ PATCH = 1
7
+ VERSION = [MAJOR,MINOR,PATCH].join('.')
8
+
9
+ def self.version
10
+ VERSION
11
+ end
12
+
13
+ def self.banner
14
+ "abidoc/#{VERSION} on Ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}] in (#{root})"
15
+ end
16
+
17
+ def self.root
18
+ File.expand_path( File.dirname(File.dirname(File.dirname(__FILE__))) )
19
+ end
20
+
21
+ end # module ABIDoc
22
+
23
+ ## add convenience alternate spellings - why? why not?
24
+ AbiDoc = ABIDoc
25
+
data/lib/abidoc.rb ADDED
@@ -0,0 +1,64 @@
1
+ require 'abiparser'
2
+
3
+
4
+ ## our own code
5
+ require_relative 'abidoc/version' # note: let version always go first
6
+
7
+
8
+
9
+ module ABI
10
+ class Contract
11
+
12
+
13
+ def generate_doc( title: 'Contract ABI' )
14
+ buf = ''
15
+ buf << "# #{title}\n\n"
16
+
17
+ if @ctor
18
+ buf << "\n"
19
+ buf << "**Constructor**\n\n"
20
+ buf << "- #{@ctor.doc}\n"
21
+ ## buf << " - sig #{@ctor.sig} => 0x#{sig(@ctor.sig).hexdigest}\n"
22
+ end
23
+
24
+ if payable_functions.size > 0
25
+ buf << "\n"
26
+ buf << "**#{payable_functions.size} Payable Function(s)**\n\n"
27
+ payable_functions.each do |func|
28
+ buf << "- #{func.doc} _payable_\n"
29
+ ## buf << " - sig #{func.sig} => 0x#{sig(func.sig).hexdigest}\n"
30
+ end
31
+ end
32
+
33
+ if transact_functions.size > 0
34
+ buf << "\n"
35
+ buf << "**#{transact_functions.size} Transact Functions(s)**\n\n"
36
+ transact_functions.each do |func|
37
+ buf << "- #{func.doc}\n"
38
+ ## buf << " - sig #{func.sig} => 0x#{sig(func.sig).hexdigest}\n"
39
+ end
40
+ end
41
+
42
+ if query_functions.size > 0
43
+ buf << "\n"
44
+ buf << "**#{query_functions.size} Query Functions(s)**\n\n"
45
+ query_functions.each do |func|
46
+ buf << "- #{func.doc} _readonly_\n"
47
+ ## buf << " - sig #{func.sig} => 0x#{sig(func.sig).hexdigest}\n"
48
+ end
49
+ end
50
+
51
+ if helper_functions.size > 0
52
+ buf << "\n"
53
+ buf << "**#{helper_functions.size} Helper Functions(s)**\n\n"
54
+ helper_functions.each do |func|
55
+ buf << "- #{func.doc}\n"
56
+ ## buf << " - sig #{func.sig} => 0x#{sig(func.sig).hexdigest}\n"
57
+ end
58
+ end
59
+
60
+ buf
61
+ end
62
+
63
+ end ## class Contract
64
+ end ## module ABI
metadata ADDED
@@ -0,0 +1,103 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: abidoc
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Gerald Bauer
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2022-12-26 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: abiparser
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rdoc
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '4.0'
34
+ - - "<"
35
+ - !ruby/object:Gem::Version
36
+ version: '7'
37
+ type: :development
38
+ prerelease: false
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ version: '4.0'
44
+ - - "<"
45
+ - !ruby/object:Gem::Version
46
+ version: '7'
47
+ - !ruby/object:Gem::Dependency
48
+ name: hoe
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '3.23'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - "~>"
59
+ - !ruby/object:Gem::Version
60
+ version: '3.23'
61
+ description: abidoc - application binary interface (abi) documentation generator for
62
+ Ethereum & Co. (blockchain) contracts
63
+ email: wwwmake@googlegroups.com
64
+ executables: []
65
+ extensions: []
66
+ extra_rdoc_files:
67
+ - CHANGELOG.md
68
+ - Manifest.txt
69
+ - README.md
70
+ files:
71
+ - CHANGELOG.md
72
+ - Manifest.txt
73
+ - README.md
74
+ - Rakefile
75
+ - lib/abidoc.rb
76
+ - lib/abidoc/version.rb
77
+ homepage: https://github.com/rubycocos/blockchain
78
+ licenses:
79
+ - Public Domain
80
+ metadata: {}
81
+ post_install_message:
82
+ rdoc_options:
83
+ - "--main"
84
+ - README.md
85
+ require_paths:
86
+ - lib
87
+ required_ruby_version: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - ">="
90
+ - !ruby/object:Gem::Version
91
+ version: '2.3'
92
+ required_rubygems_version: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ requirements: []
98
+ rubygems_version: 3.3.7
99
+ signing_key:
100
+ specification_version: 4
101
+ summary: abidoc - application binary interface (abi) documentation generator for Ethereum
102
+ & Co. (blockchain) contracts
103
+ test_files: []