gaudi 0.2.2 → 0.2.3

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: 49b03e10f805d01363da641da4b6fe21fd0e85c6
4
- data.tar.gz: 5dd316ba79d9f5341e9527d0549d2c0f7b2ba791
3
+ metadata.gz: b9b197f80b0d158c7989932b7647260335aa6fa6
4
+ data.tar.gz: 5de078ebdd30971d0f0aca3e39347425a3397960
5
5
  SHA512:
6
- metadata.gz: 00267b25cab02516e97136634384f8f9c1b204ed7682350ebb4c7e946444fbba52508647ec64d0e9f6cf5cf544a04046cf74fc28a2b243d02c20ccb7aa2f4aa1
7
- data.tar.gz: db8496b3fb5484d86ca5fbbc44eaa758b5c939f725a682bf55a3f2b215ca9030c39a150ce87b06357ed3697bc9ef60575b58225fbd4250e6716876464f02f565
6
+ metadata.gz: 28d1f6c6b484da87410d5455a05cf807e272a51eb93f71605c06bf4ae02cce61da1f82ef7c0c7e1abc0b0bd2f0ef4537a6788a81000f871dfd4ad559a5c0f7a5
7
+ data.tar.gz: b2a25fbb283bc3aa72539bc62cad0812d7f727c43c68f341b904f9840500a3d60e6cc2b2c39733e082bb6e2f00ee14b0d1a3162d77e254628937cb0a2f523893
data/History.txt CHANGED
@@ -1,3 +1,7 @@
1
+ #0.2.3
2
+ * Check for git presence before removing old install when updating
3
+ * Check for git presence before attempting to create a new project
4
+ * Help message now indicates that https access and git are required
1
5
  #0.2.2
2
6
  * Added update functionality
3
7
  #0.2.0
@@ -6,6 +6,8 @@ require 'rubygems'
6
6
  require 'archive/tar/minitar'
7
7
 
8
8
  module Gaudi
9
+ class Error <RuntimeError
10
+ end
9
11
  class Gem
10
12
  MAIN_CONFIG="system.cfg"
11
13
  PLATFORM_CONFIG="foo.cfg"
@@ -21,15 +23,16 @@ module Gaudi
21
23
 
22
24
  opt_parser = OptionParser.new do |opts|
23
25
  opts.banner = "Usage: gaudi [options]"
26
+ opts.separator "Make sure GitHub is accessible via https and git is on the PATH environment"
24
27
  opts.separator ""
25
28
  opts.separator "Commands:"
26
29
 
27
- opts.on("-s", "--scaffold PATH","Create a Gaudi scaffold in PATH") do |proot|
30
+ opts.on("-s", "--scaffold PROJECT_PATH","Create a Gaudi scaffold in PROJECT_PATH") do |proot|
28
31
  options.project_root=File.expand_path(proot)
29
32
  options.scaffold=true
30
33
  options.update=false
31
34
  end
32
- opts.on("-u", "--update PATH","Update Gaudi core from GitHub on project at PATH") do |proot|
35
+ opts.on("-u", "--update PROJECT_PATH","Update Gaudi core from GitHub on project at PROJECT_PATH") do |proot|
33
36
  options.project_root=File.expand_path(proot)
34
37
  options.update=true
35
38
  options.scaffold=false
@@ -55,10 +58,15 @@ module Gaudi
55
58
  #:nodoc:
56
59
  def self.run args
57
60
  opts=options(args)
58
- if opts.scaffold
59
- Gaudi::Gem.new(opts.project_root).project(opts.version)
60
- elsif opts.update
61
- Gaudi::Gem.new(opts.project_root).update(opts.version)
61
+ begin
62
+ if opts.scaffold
63
+ Gaudi::Gem.new(opts.project_root).project(opts.version)
64
+ elsif opts.update
65
+ Gaudi::Gem.new(opts.project_root).update(opts.version)
66
+ end
67
+ rescue Gaudi::Error
68
+ puts $!.message
69
+ exit 1
62
70
  end
63
71
  end
64
72
 
@@ -68,7 +76,8 @@ module Gaudi
68
76
  end
69
77
 
70
78
  def project version
71
- raise "#{project_root} already exists!" if File.exists?(project_root) && project_root != Dir.pwd
79
+ raise Error, "#{project_root} already exists!" if File.exists?(project_root) && project_root != Dir.pwd
80
+ check_for_git
72
81
  directory_structure
73
82
  rakefile
74
83
  main_config
@@ -77,11 +86,17 @@ module Gaudi
77
86
  end
78
87
 
79
88
  def update version
80
- raise "#{gaudi_home} is missing! Try creating a new Gaudi project first." unless File.exists?(gaudi_home)
89
+ raise Error, "#{gaudi_home} is missing! Try creating a new Gaudi project first." unless File.exists?(gaudi_home)
90
+ check_for_git
91
+ puts "Removing old gaudi installation"
81
92
  FileUtils.rm_rf(File.join(gaudi_home,"lib/gaudi"))
82
93
  core(version)
83
94
  end
84
95
  #:nodoc:
96
+ def check_for_git
97
+ raise Error, "Could not find git. Make sure it is in the PATH" unless system("git --version")
98
+ end
99
+ #:nodoc:
85
100
  def directory_structure
86
101
  puts "Creating Gaudi filesystem structure at #{project_root}"
87
102
  structure=["doc","lib","src","test","tools/build","tools/templates"]
@@ -145,7 +160,7 @@ module Gaudi
145
160
  FileUtils.rm_rf(File.join(project_root,'gaudilib.tar'))
146
161
  FileUtils.rm_rf(File.join(project_root,'tools/build/pax_global_header'))
147
162
  else
148
- raise "Cloning the Gaudi repo failed. Check that git is on the PATH and that GitHub is accessible"
163
+ raise Error, "Cloning the Gaudi repo failed. Check that git is on the PATH and that GitHub is accessible"
149
164
  end
150
165
  end
151
166
  end
data/lib/gaudi/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Gaudi
2
- #Gaudi follows SemVer even so does it's gem, but the're two separate things
2
+ #Gaudi follows SemVer and so does it's gem, but they're two separate things
3
3
  class Gem
4
4
  module Version
5
5
  #Major version
@@ -7,7 +7,7 @@ module Gaudi
7
7
  #Minor version
8
8
  MINOR=2
9
9
  #Tiny version
10
- TINY=2
10
+ TINY=3
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.2
4
+ version: 0.2.3
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-10-02 00:00:00.000000000 Z
11
+ date: 2014-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: archive-tar-minitar