|
| 1 | +# frozen_string_literal: true |
| 2 | + |
1 | 3 | require 'json'
|
2 | 4 | require 'open-uri'
|
3 | 5 |
|
4 |
| -VERSIONS_FILE_URL = "https://raw.githubusercontent.com/esrlabs/chipmunk/master/versions.json"; |
| 6 | +VERSIONS_FILE_URL = 'https://raw.githubusercontent.com/esrlabs/chipmunk/master/versions.json' |
5 | 7 |
|
6 | 8 | class Versions
|
| 9 | + def initialize |
| 10 | + puts "Reading versions file from \"#{VERSIONS_FILE_URL}\"" |
| 11 | + @versions_str = URI.open(VERSIONS_FILE_URL, &:read) |
| 12 | + @versions = JSON.parse(@versions_str) |
| 13 | + puts "Next versions of frameworks/modules will be used:\n" |
| 14 | + puts "\telectron: #{@versions['electron']}\n" |
| 15 | + puts "\telectron-rebuild: #{@versions['electron-rebuild']}\n" |
| 16 | + puts "\tchipmunk.client.toolkit: #{@versions['chipmunk.client.toolkit']}\n" |
| 17 | + puts "\tchipmunk.plugin.ipc: #{@versions['chipmunk.plugin.ipc']}\n" |
| 18 | + puts "\tchipmunk-client-material: #{@versions['chipmunk-client-material']}\n" |
| 19 | + puts "\tangular-core: #{@versions['angular-core']}\n" |
| 20 | + puts "\tangular-material: #{@versions['angular-material']}\n" |
| 21 | + puts "\tforce: #{@versions['force']}\n" |
| 22 | + end |
7 | 23 |
|
8 |
| - def initialize() |
9 |
| - puts "Reading versions file from \"#{VERSIONS_FILE_URL}\"" |
10 |
| - @versions_str = URI.open(VERSIONS_FILE_URL) { |f| f.read } |
11 |
| - @versions = JSON.parse(@versions_str) |
12 |
| - puts "Next versions of frameworks/modules will be used:\n" |
13 |
| - puts "\telectron: #{@versions['electron']}\n" |
14 |
| - puts "\telectron-rebuild: #{@versions['electron-rebuild']}\n" |
15 |
| - puts "\tchipmunk.client.toolkit: #{@versions['chipmunk.client.toolkit']}\n" |
16 |
| - puts "\tchipmunk.plugin.ipc: #{@versions['chipmunk.plugin.ipc']}\n" |
17 |
| - puts "\tchipmunk-client-material: #{@versions['chipmunk-client-material']}\n" |
18 |
| - puts "\tangular-core: #{@versions['angular-core']}\n" |
19 |
| - puts "\tangular-material: #{@versions['angular-material']}\n" |
20 |
| - puts "\tforce: #{@versions['force']}\n" |
21 |
| - end |
22 |
| - |
23 |
| - def get |
24 |
| - return @versions |
25 |
| - end |
| 24 | + def get |
| 25 | + @versions |
| 26 | + end |
26 | 27 |
|
27 |
| - def get_hash |
| 28 | + def get_hash |
28 | 29 | p = [
|
29 | 30 | @versions['electron'].split('.'),
|
30 | 31 | @versions['electron-rebuild'].split('.'),
|
|
0 commit comments