zeno 0.1.0 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7e3ffb471e7920c26ef333a7c35cb55e50a5ef07
4
- data.tar.gz: 7702c7a067b4acaefcabae86da7a91a5f620709a
3
+ metadata.gz: 748f50dfbeeda0f7812b26e3b69e5c7f8ad50f9a
4
+ data.tar.gz: a81aaa37f68472b44229177bcebf41190066b388
5
5
  SHA512:
6
- metadata.gz: 9100ee4a02d0fde7d51195dbf4aa4bc2d12b88fa2e70bc806ee39a581cb00d6e3402b35209bde37e008ba1a93552edc58871f87a65cdf39efb02dbacc14b961d
7
- data.tar.gz: 52675e5957d46c692334254159eaa2d328a8feb6606355e3e64dcba78f160317e435e84e77ebde65f3e6dd39adc6492e5fe35de88f20c9b591f719cc6ac4674d
6
+ metadata.gz: e8996482f98ebfdaf8829c566339bb17323b806ffe52a85f8a5acfe04cd3780912adaba412d3dcd99a941d4b1e31539dac40b3926df7d85b232592014c5bc381
7
+ data.tar.gz: 0c7ee5dfa1564bc8fcd0c71a60e8b32ebf9a94f817b4e7d54db2fa25767315f211def9ff1492bbf79f97cda31b0aa95f0a07c5fca9fa1cedcb7068132920b96b
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Zeno module
3
- # Copyright (C) 2016 Michel Megens <dev@bietje.net>
3
+ # Copyright (C) 2017 Michel Megens <dev@bietje.net>
4
4
  #
5
5
  # This program is free software: you can redistribute it and/or modify
6
6
  # it under the terms of the GNU General Public License as published by
@@ -16,19 +16,15 @@
16
16
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
17
17
  #
18
18
 
19
- require 'fileutils'
20
-
21
19
  require 'zeno/makefile'
22
- require 'zeno/filegenerator'
23
- require 'zeno/applicationalreadyexistserror'
24
20
 
25
21
  module Zeno
26
- class Scaffolder
22
+ class Application
27
23
  attr_reader :dirname, :etaos_path, :arch, :libdir
28
24
 
29
25
  def initialize(name, path, libdir, arch)
30
26
  @dirname = name
31
- @etaos_path = path
27
+ @etaos_path = "../#{path}"
32
28
  @libdir = libdir
33
29
  @arch = arch
34
30
  end
@@ -59,6 +55,7 @@ module Zeno
59
55
  file = "#{@dirname}/Kbuild"
60
56
  gen = Zeno::FileGenerator.new file
61
57
  gen.add_var('obj-y', '# TODO: add source files', '+=')
58
+ gen.add_var('pyusrlib-y', '# TODO: add python libs or delete this line', '+=')
62
59
  gen.add_var('crurom-y', '# TODO: add crurom directory or delete this line', ':=')
63
60
  gen.add_var('crurom-obj', '# TODO: add crurom object file or delete this line', ':=')
64
61
  gen.add_var('ETAOS_LIBS', '-lc', '+=')
@@ -69,4 +66,3 @@ module Zeno
69
66
  end
70
67
  end
71
68
  end
72
-
@@ -29,7 +29,7 @@ module Zeno
29
29
  end
30
30
 
31
31
  def add_var(name, value, assign = '=')
32
- @vars[name] = value
32
+ @vars[name] = "#{assign} #{value}"
33
33
  end
34
34
 
35
35
  def del_var(name)
@@ -47,7 +47,7 @@ module Zeno
47
47
  def to_s
48
48
  output = ""
49
49
  @vars.each do |key, value|
50
- output += "#{key}=#{value}\n"
50
+ output += "#{key} #{value}\n"
51
51
  end
52
52
 
53
53
  output
@@ -0,0 +1,60 @@
1
+ #
2
+ # Zeno module
3
+ # Copyright (C) 2017 Michel Megens <dev@bietje.net>
4
+ #
5
+ # This program is free software: you can redistribute it and/or modify
6
+ # it under the terms of the GNU General Public License as published by
7
+ # the Free Software Foundation, either version 3 of the License, or
8
+ # (at your option) any later version.
9
+ #
10
+ # This program is distributed in the hope that it will be useful,
11
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ # GNU General Public License for more details.
14
+ #
15
+ # You should have received a copy of the GNU General Public License
16
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ #
18
+
19
+ module Zeno
20
+ class Solution
21
+ attr_reader :name, :path
22
+
23
+ @name = nil
24
+ @basepath = nil
25
+ @path = nil
26
+ @ref = nil
27
+ @libs = nil
28
+ @apps = nil
29
+ @target = nil
30
+
31
+ def initialize(opts)
32
+ @name = opts['name']
33
+ @basepath = opts['path']
34
+ @ref = opts['ref']
35
+ @libs = opts['libs']
36
+ @path = "#{@basepath}/#{@name}"
37
+ @apps = opts['apps']
38
+ @target = opts['target']
39
+
40
+ raise Zeno::ApplicationAlreadyExistsError if File.directory? @path
41
+ end
42
+
43
+ def create()
44
+ FileUtils.mkdir_p @path unless File.directory? @path
45
+ Dir.chdir @path
46
+
47
+ version = Zeno.parse_target(@ref)
48
+ etaos_path = "etaos-#{version}"
49
+ Zeno.download(@path, @ref)
50
+
51
+ # Create applications
52
+ @apps.each do |app|
53
+ application = Zeno::Application.new(app, etaos_path, @libs, @target)
54
+ application.create
55
+ application.generate
56
+ end
57
+ end
58
+ end
59
+ end
60
+
data/lib/zeno/version.rb CHANGED
@@ -1,3 +1,21 @@
1
+ #
2
+ # Zeno module
3
+ # Copyright (C) 2017 Michel Megens <dev@bietje.net>
4
+ #
5
+ # This program is free software: you can redistribute it and/or modify
6
+ # it under the terms of the GNU General Public License as published by
7
+ # the Free Software Foundation, either version 3 of the License, or
8
+ # (at your option) any later version.
9
+ #
10
+ # This program is distributed in the hope that it will be useful,
11
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ # GNU General Public License for more details.
14
+ #
15
+ # You should have received a copy of the GNU General Public License
16
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ #
18
+
1
19
  module Zeno
2
- VERSION = '0.1.0'
20
+ VERSION = '0.1.2'
3
21
  end
data/lib/zeno.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # Zeno module
3
- # Copyright (C) 2016 Michel Megens <dev@bietje.net>
3
+ # Copyright (C) 2016, 2017 Michel Megens <dev@bietje.net>
4
4
  #
5
5
  # This program is free software: you can redistribute it and/or modify
6
6
  # it under the terms of the GNU General Public License as published by
@@ -26,7 +26,8 @@ require 'zip'
26
26
  require 'net/http'
27
27
 
28
28
  require 'zeno/version'
29
- require 'zeno/scaffolder'
29
+ require 'zeno/application'
30
+ require 'zeno/solution'
30
31
  require 'zeno/applicationalreadyexistserror'
31
32
 
32
33
  # Zeno base module
@@ -52,7 +53,7 @@ module Zeno
52
53
  puts "Usage: zeno <command> <args>"
53
54
  puts ""
54
55
  puts "Available commands are:"
55
- puts " app\t\tScaffolder to create new ETA/OS applications"
56
+ puts " app\t\tApplication to create new ETA/OS applications"
56
57
  puts " get\t\tETA/OS download service"
57
58
  puts " solution\tCreate an ETA/OS solution"
58
59
  end
@@ -115,6 +116,7 @@ module Zeno
115
116
  options.libdir = nil
116
117
  options.target = nil
117
118
  options.version = nil
119
+ options.apps = nil
118
120
 
119
121
  parser = OptionParser.new do |opts|
120
122
  opts.banner = "Usage: zeno solution [options]"
@@ -138,6 +140,11 @@ module Zeno
138
140
  options.libdir = path
139
141
  end
140
142
 
143
+ opts.on("-a", "--apps APPS",
144
+ "List of applications to generate (comma separated") do |apps|
145
+ options.apps = apps.split(',')
146
+ end
147
+
141
148
  # Mandatory
142
149
  opts.on("-t", "--target TARGET",
143
150
  "ETA/OS target architecture") do |arch|
@@ -179,20 +186,16 @@ module Zeno
179
186
  exit
180
187
  end
181
188
 
182
- ref = Zeno.parse_target(options.version)
183
- etaos_path = "../etaos-#{ref}"
184
- Zeno.download(options.path, options.version)
189
+ opts = Hash.new
190
+ opts['apps'] = options.apps
191
+ opts['name'] = options.name
192
+ opts['ref'] = options.version
193
+ opts['libs'] = options.libdir
194
+ opts['path'] = options.path
195
+ opts['target'] = options.target
185
196
 
186
- begin
187
- Dir.chdir options.name
188
- scaffolder = Zeno::Scaffolder.new(options.name, etaos_path,
189
- options.libdir, options.target)
190
- scaffolder.create
191
- scaffolder.generate
192
- rescue ApplicationAlreadyExistsError => e
193
- puts "Error: #{e.message}"
194
- exit
195
- end
197
+ solution = Zeno::Solution.new(opts)
198
+ solution.create
196
199
  end
197
200
 
198
201
  # Start the app subcommand.
@@ -266,7 +269,7 @@ module Zeno
266
269
  end
267
270
 
268
271
  begin
269
- scaffolder = Zeno::Scaffolder.new(options.name, options.epath,
272
+ scaffolder = Zeno::Application.new(options.name, options.epath,
270
273
  options.libdir, options.target)
271
274
  scaffolder.create
272
275
  scaffolder.generate
@@ -311,7 +314,7 @@ module Zeno
311
314
  silly_name = nil
312
315
  ref = Zeno.parse_target(target)
313
316
  ref.strip!
314
- uri = URI("https://git.bietje.net/etaos/etaos/repository/archive.zip?ref=#{ref}")
317
+ uri = URI("https://git.bietje.net/etaos/etaos/archive/#{ref}.zip")
315
318
  http = Net::HTTP.new(uri.host, uri.port)
316
319
  http.use_ssl = true
317
320
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zeno
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
  - Michel Megens
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-13 00:00:00.000000000 Z
11
+ date: 2017-07-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -82,10 +82,11 @@ extra_rdoc_files: []
82
82
  files:
83
83
  - bin/zeno
84
84
  - lib/zeno.rb
85
+ - lib/zeno/application.rb
85
86
  - lib/zeno/applicationalreadyexistserror.rb
86
87
  - lib/zeno/filegenerator.rb
87
88
  - lib/zeno/makefile.rb
88
- - lib/zeno/scaffolder.rb
89
+ - lib/zeno/solution.rb
89
90
  - lib/zeno/version.rb
90
91
  homepage: http://bietje.net/zeno
91
92
  licenses:
@@ -107,9 +108,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
107
108
  version: '0'
108
109
  requirements: []
109
110
  rubyforge_project:
110
- rubygems_version: 2.4.8
111
+ rubygems_version: 2.2.2
111
112
  signing_key:
112
113
  specification_version: 4
113
114
  summary: ETA/OS scaffolder
114
115
  test_files: []
115
- has_rdoc: