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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a34daec01db5e9ca3ddb7356bb0662ca114e8b09
4
- data.tar.gz: 646e9451ec10386e9bbdd946e23c4df31df397f7
3
+ metadata.gz: 49b03e10f805d01363da641da4b6fe21fd0e85c6
4
+ data.tar.gz: 5dd316ba79d9f5341e9527d0549d2c0f7b2ba791
5
5
  SHA512:
6
- metadata.gz: b747ab81dccb758db968c81ff6e34633eab16d9af0c40beead51c2c0b8d74876fe9492b345b0a6de799841020d27ad0a98a7e39e44032ceb76344579e56208f6
7
- data.tar.gz: 7e454985a75a41b572b2a58c81e17187c831bccdaf693f59bba6bd59301dbae0b4f89aa59c7c5a63db1b6d093eb95cac070fa0433408c5b105174d8d7021538b
6
+ metadata.gz: 00267b25cab02516e97136634384f8f9c1b204ed7682350ebb4c7e946444fbba52508647ec64d0e9f6cf5cf544a04046cf74fc28a2b243d02c20ccb7aa2f4aa1
7
+ data.tar.gz: db8496b3fb5484d86ca5fbbc44eaa758b5c939f725a682bf55a3f2b215ca9030c39a150ce87b06357ed3697bc9ef60575b58225fbd4250e6716876464f02f565
data/History.txt CHANGED
@@ -1,3 +1,5 @@
1
+ #0.2.2
2
+ * Added update functionality
1
3
  #0.2.0
2
4
  * Pulls HEAD of gaudi from GitHub in the scaffold
3
5
 
@@ -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 = Dir.pwd
17
- options.verbose = false
18
- options.scaffold=false
19
- options.version="HEAD"
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 'git clone https://github.com/damphyr/gaudi gaudi'
120
- Dir.chdir('gaudi') do |d|
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}/gaudilib.tar #{version} lib/"
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 #{project_root}/tools/build"
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,'gaudilib.tar'), 'tools/build')
166
+ Archive::Tar::Minitar.unpack(File.join(project_root,'gaudicore.tar'), 'tools/build')
128
167
  end
129
- FileUtils.rm_rf(File.join(project_root,'gaudilib.tar'))
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
@@ -7,7 +7,7 @@ module Gaudi
7
7
  #Minor version
8
8
  MINOR=2
9
9
  #Tiny version
10
- TINY=1
10
+ TINY=2
11
11
  #All-in-one
12
12
  STRING=[MAJOR,MINOR,TINY].join('.')
13
13
  end
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.1
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-08-04 00:00:00.000000000 Z
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