gaudi 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.txt +2 -0
- data/lib/gaudi/scaffolding.rb +50 -11
- data/lib/gaudi/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 49b03e10f805d01363da641da4b6fe21fd0e85c6
|
4
|
+
data.tar.gz: 5dd316ba79d9f5341e9527d0549d2c0f7b2ba791
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 00267b25cab02516e97136634384f8f9c1b204ed7682350ebb4c7e946444fbba52508647ec64d0e9f6cf5cf544a04046cf74fc28a2b243d02c20ccb7aa2f4aa1
|
7
|
+
data.tar.gz: db8496b3fb5484d86ca5fbbc44eaa758b5c939f725a682bf55a3f2b215ca9030c39a150ce87b06357ed3697bc9ef60575b58225fbd4250e6716876464f02f565
|
data/History.txt
CHANGED
data/lib/gaudi/scaffolding.rb
CHANGED
@@ -9,14 +9,15 @@ module Gaudi
|
|
9
9
|
class Gem
|
10
10
|
MAIN_CONFIG="system.cfg"
|
11
11
|
PLATFORM_CONFIG="foo.cfg"
|
12
|
-
attr_reader :project_root
|
12
|
+
attr_reader :project_root,:gaudi_home
|
13
13
|
#:nodoc:
|
14
14
|
def self.options arguments
|
15
15
|
options = OpenStruct.new
|
16
|
-
options.project_root
|
17
|
-
options.verbose
|
18
|
-
options.scaffold=false
|
19
|
-
options.
|
16
|
+
options.project_root= Dir.pwd
|
17
|
+
options.verbose= false
|
18
|
+
options.scaffold= false
|
19
|
+
options.update= false
|
20
|
+
options.version= "HEAD"
|
20
21
|
|
21
22
|
opt_parser = OptionParser.new do |opts|
|
22
23
|
opts.banner = "Usage: gaudi [options]"
|
@@ -26,6 +27,12 @@ module Gaudi
|
|
26
27
|
opts.on("-s", "--scaffold PATH","Create a Gaudi scaffold in PATH") do |proot|
|
27
28
|
options.project_root=File.expand_path(proot)
|
28
29
|
options.scaffold=true
|
30
|
+
options.update=false
|
31
|
+
end
|
32
|
+
opts.on("-u", "--update PATH","Update Gaudi core from GitHub on project at PATH") do |proot|
|
33
|
+
options.project_root=File.expand_path(proot)
|
34
|
+
options.update=true
|
35
|
+
options.scaffold=false
|
29
36
|
end
|
30
37
|
opts.separator ""
|
31
38
|
opts.separator "Common options:"
|
@@ -50,11 +57,14 @@ module Gaudi
|
|
50
57
|
opts=options(args)
|
51
58
|
if opts.scaffold
|
52
59
|
Gaudi::Gem.new(opts.project_root).project(opts.version)
|
60
|
+
elsif opts.update
|
61
|
+
Gaudi::Gem.new(opts.project_root).update(opts.version)
|
53
62
|
end
|
54
63
|
end
|
55
64
|
|
56
65
|
def initialize project_root
|
57
66
|
@project_root=project_root
|
67
|
+
@gaudi_home=File.join(project_root,"tools","build")
|
58
68
|
end
|
59
69
|
|
60
70
|
def project version
|
@@ -65,6 +75,12 @@ module Gaudi
|
|
65
75
|
platform_config
|
66
76
|
gaudi(version)
|
67
77
|
end
|
78
|
+
|
79
|
+
def update version
|
80
|
+
raise "#{gaudi_home} is missing! Try creating a new Gaudi project first." unless File.exists?(gaudi_home)
|
81
|
+
FileUtils.rm_rf(File.join(gaudi_home,"lib/gaudi"))
|
82
|
+
core(version)
|
83
|
+
end
|
68
84
|
#:nodoc:
|
69
85
|
def directory_structure
|
70
86
|
puts "Creating Gaudi filesystem structure at #{project_root}"
|
@@ -116,17 +132,40 @@ module Gaudi
|
|
116
132
|
if File.exists?('gaudi')
|
117
133
|
FileUtils.rm_rf('gaudi')
|
118
134
|
end
|
119
|
-
system
|
120
|
-
|
135
|
+
if system "git clone https://github.com/damphyr/gaudi #{tmp}/gaudi"
|
136
|
+
Dir.chdir("#{tmp}/gaudi") do |d|
|
137
|
+
puts "Packing #{version} gaudi version"
|
138
|
+
cmdline="git archive --format=tar -o #{project_root}/gaudilib.tar #{version} lib/"
|
139
|
+
system(cmdline)
|
140
|
+
end
|
141
|
+
puts "Unpacking in #{gaudi_home}"
|
142
|
+
Dir.chdir(project_root) do |d|
|
143
|
+
Archive::Tar::Minitar.unpack(File.join(project_root,'gaudilib.tar'), 'tools/build')
|
144
|
+
end
|
145
|
+
FileUtils.rm_rf(File.join(project_root,'gaudilib.tar'))
|
146
|
+
FileUtils.rm_rf(File.join(project_root,'tools/build/pax_global_header'))
|
147
|
+
else
|
148
|
+
raise "Cloning the Gaudi repo failed. Check that git is on the PATH and that GitHub is accessible"
|
149
|
+
end
|
150
|
+
end
|
151
|
+
end
|
152
|
+
#:nodoc:
|
153
|
+
def core(version)
|
154
|
+
Dir.mktmpdir do |tmp|
|
155
|
+
if File.exists?('gaudi')
|
156
|
+
FileUtils.rm_rf('gaudi')
|
157
|
+
end
|
158
|
+
system "git clone https://github.com/damphyr/gaudi #{tmp}/gaudi"
|
159
|
+
Dir.chdir("#{tmp}/gaudi") do |d|
|
121
160
|
puts "Packing #{version} gaudi version"
|
122
|
-
cmdline="git archive --format=tar -o #{project_root}/
|
161
|
+
cmdline="git archive --format=tar -o #{project_root}/gaudicore.tar #{version} lib/gaudi"
|
123
162
|
system(cmdline)
|
124
163
|
end
|
125
|
-
puts "Unpacking in #{
|
164
|
+
puts "Unpacking core in #{gaudi_home}/lib/gaudi"
|
126
165
|
Dir.chdir(project_root) do |d|
|
127
|
-
Archive::Tar::Minitar.unpack(File.join(project_root,'
|
166
|
+
Archive::Tar::Minitar.unpack(File.join(project_root,'gaudicore.tar'), 'tools/build')
|
128
167
|
end
|
129
|
-
FileUtils.rm_rf(File.join(project_root,'
|
168
|
+
FileUtils.rm_rf(File.join(project_root,'gaudicore.tar'))
|
130
169
|
FileUtils.rm_rf(File.join(project_root,'tools/build/pax_global_header'))
|
131
170
|
end
|
132
171
|
end
|
data/lib/gaudi/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gaudi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vassilis Rizopoulos
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-10-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: archive-tar-minitar
|