cardano-up 0.1.0 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/lib/cardano-up.rb CHANGED
@@ -8,13 +8,18 @@ require 'file-tail'
8
8
  require 'json'
9
9
  require 'zlib'
10
10
  require 'zip'
11
+ require 'socket'
12
+ require 'timeout'
11
13
 
12
14
  require 'cardano-up/version'
13
15
  require 'cardano-up/err'
14
16
  require 'cardano-up/utils'
15
17
  require 'cardano-up/tar'
16
- require 'cardano-up/install'
17
- require 'cardano-up/start'
18
+ require 'cardano-up/bins'
19
+ require 'cardano-up/configs'
20
+ require 'cardano-up/launcher'
21
+ require 'cardano-up/session'
22
+ require 'cardano-up/ping'
18
23
  require 'cardano-up/tail'
19
24
 
20
25
  # Cardano Up!
@@ -74,24 +79,24 @@ module CardanoUp
74
79
  c = if configured?
75
80
  CardanoUp.config
76
81
  else
77
- { 'bin_dir' => File.join(@base_dir, 'bins'),
78
- 'state_dir' => File.join(@base_dir, 'state'),
79
- 'log_dir' => File.join(@base_dir, 'state'),
80
- 'config_dir' => File.join(@base_dir, 'configs') }
82
+ { bin_dir: File.join(@base_dir, 'bins'),
83
+ state_dir: File.join(@base_dir, 'state'),
84
+ log_dir: File.join(@base_dir, 'state'),
85
+ config_dir: File.join(@base_dir, 'configs') }
81
86
  end
82
- c['bin_dir'] = bin_dir if bin_dir
83
- c['state_dir'] = state_dir if state_dir
84
- c['log_dir'] = logs_dir if logs_dir
85
- c['config_dir'] = config_dir if config_dir
86
- File.write(@cardano_up_config, JSON.pretty_generate(c))
87
- JSON.parse(File.read(@cardano_up_config))
87
+ c[:bin_dir] = bin_dir if bin_dir
88
+ c[:state_dir] = state_dir if state_dir
89
+ c[:log_dir] = logs_dir if logs_dir
90
+ c[:config_dir] = config_dir if config_dir
91
+ CardanoUp::Utils.to_json(@cardano_up_config, c)
92
+ CardanoUp::Utils.from_json(@cardano_up_config)
88
93
  end
89
94
 
90
95
  # Get config values
91
96
  def self.config
92
97
  raise CardanoUp::ConfigNotSetError unless configured?
93
98
 
94
- JSON.parse(File.read(@cardano_up_config))
99
+ CardanoUp::Utils.from_json(@cardano_up_config)
95
100
  end
96
101
 
97
102
  # Remove configuration file
metadata CHANGED
@@ -1,69 +1,69 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cardano-up
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Stachyra
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-08 00:00:00.000000000 Z
11
+ date: 2022-10-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: docopt
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '='
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: 0.6.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '='
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.6.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: file-tail
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '='
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: 1.2.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '='
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: 1.2.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: httparty
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '='
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.20.0
47
+ version: 0.18.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '='
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 0.20.0
54
+ version: 0.18.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rubyzip
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '='
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: 2.3.2
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '='
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: 2.3.2
69
69
  - !ruby/object:Gem::Dependency
@@ -127,9 +127,12 @@ files:
127
127
  - bin/rebuild
128
128
  - bin/setup
129
129
  - lib/cardano-up.rb
130
+ - lib/cardano-up/bins.rb
131
+ - lib/cardano-up/configs.rb
130
132
  - lib/cardano-up/err.rb
131
- - lib/cardano-up/install.rb
132
- - lib/cardano-up/start.rb
133
+ - lib/cardano-up/launcher.rb
134
+ - lib/cardano-up/ping.rb
135
+ - lib/cardano-up/session.rb
133
136
  - lib/cardano-up/tail.rb
134
137
  - lib/cardano-up/tar.rb
135
138
  - lib/cardano-up/utils.rb