everscale-client-ruby 1.1.23

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: 8e4378aa3309111cae784451d25b433bbee3281a701c359b99b1d042c2d097b4
4
+ data.tar.gz: 45c712c85370b6e5357f9d424015595173562c5791c7ddabd484e6d5e28c9e7c
5
+ SHA512:
6
+ metadata.gz: bcd94078f6507d2ca3865125da0779f29430df1bfb32b915a89a2ef490f89dda2883a589ea0cb8747373a43bd7e1c2344d74ed2b7565112be19f3f8e66d517ad
7
+ data.tar.gz: 978db55faec424a07e0f5bc64633c7fd5fea4a98a254cfeeeaa6c19b644c87082b42c928de69c58963ef961a8a34f4507c924fecddda11dafa7dfe269a17f5bc
@@ -0,0 +1,50 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require File.dirname(__FILE__) + '/../lib/code_generator/api_converter.rb'
4
+ require File.dirname(__FILE__) + '/../lib/code_generator/code_generator.rb'
5
+ GEM_DIR = File.dirname(__FILE__) + '/..'
6
+
7
+ if ARGV[0] == 'update' && ARGV[1] == nil
8
+ script_file_path = File.expand_path(File.dirname(__FILE__))
9
+ `cd #{script_file_path}/.. && curl https://raw.githubusercontent.com/tonlabs/TON-SDK/master/tools/api.json > api.json`
10
+ api_json_path = "#{script_file_path}/../api.json"
11
+ json = ''
12
+ if File.exists?(api_json_path)
13
+ json = File.read(api_json_path)
14
+ else
15
+ p "File #{api_json_path} is not exist"
16
+ exit 0
17
+ end
18
+ converter = ApiConverter.new(json)
19
+ types = converter.convert
20
+ generator = CodeGenerator.new(types, GEM_DIR)
21
+ generator.generate_self_code
22
+ system(%{bash -lc 'ruby #{script_file_path}/../lib/code_generator/release.rb'})
23
+ elsif ARGV[0] == 'update'
24
+ api_json_path = ARGV[1]
25
+ json = ''
26
+ if File.exists?(api_json_path)
27
+ json = File.read(api_json_path)
28
+ else
29
+ p "Current directory: #{Dir.pwd}. File #{api_json_path} is not exist"
30
+ exit 0
31
+ end
32
+ converter = ApiConverter.new(json)
33
+ types = converter.convert
34
+ generator = CodeGenerator.new(types, GEM_DIR)
35
+ generator.generate_self_code
36
+ system(%{bash -lc 'ruby #{script_file_path}/../lib/code_generator/release.rb'})
37
+
38
+ elsif ARGV[0] == 'setup'
39
+ raise "\nPLEASE INSTALL RUST TO YOUR SYSTEM. \nTry this command: \ncurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh" if `which rustc`.strip.empty?
40
+ unless Dir.exist?("#{GEM_DIR}/TON-SDK")
41
+ system("cd #{GEM_DIR} && git clone https://github.com/tonlabs/TON-SDK ./TON-SDK")
42
+ end
43
+ system("cd #{GEM_DIR}/TON-SDK && git pull --ff-only")
44
+ system("cd #{GEM_DIR}/TON-SDK && cargo update")
45
+ system("cd #{GEM_DIR}/TON-SDK && cargo build --release")
46
+ puts ''
47
+ puts "PATH TO YOR DYNAMIC LIBRARY FOR MACOS IS: #{GEM_DIR}/TON-SDK/target/release/libton_client.dylib"
48
+ puts "PATH TO YOR DYNAMIC LIBRARY FOR LINUX IS: #{GEM_DIR}/TON-SDK/target/release/libton_client.so"
49
+ puts ''
50
+ end