gn 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/bin/gn +1 -1
  2. data/lib/gn.rb +6 -2
  3. data/lib/gn/dsl.rb +0 -5
  4. metadata +7 -17
data/bin/gn CHANGED
@@ -7,7 +7,7 @@ require "fileutils"
7
7
 
8
8
  module CLI
9
9
  README = File.expand_path("../README", File.dirname(__FILE__))
10
- GN_HOME = File.join(ENV["HOME"], ".gn")
10
+ GN_HOME = File.join(Dir.home, ".gn")
11
11
 
12
12
  # Display the README message and exit.
13
13
  def self.help
data/lib/gn.rb CHANGED
@@ -35,7 +35,7 @@ class Gn
35
35
  end
36
36
 
37
37
  def path(file)
38
- "#{ENV["HOME"]}/.gn/#{name}/#{file}"
38
+ File.join(Dir.home, ".gn", name, file)
39
39
  end
40
40
 
41
41
  def load!
@@ -45,7 +45,11 @@ class Gn
45
45
 
46
46
  edit(file)
47
47
 
48
- load file.path
48
+ if $?.success?
49
+ load file.path
50
+ else
51
+ exit 1
52
+ end
49
53
  end
50
54
 
51
55
  def editor
@@ -1,15 +1,10 @@
1
1
  class Gn
2
-
3
2
  module DSL
4
-
5
3
  def template(constant, dest, &block)
6
4
  klass = Class.new
7
5
  klass.send(:define_method, :destination) { dest }
8
6
  klass.class_eval(&block) if block_given?
9
7
  self.const_set constant, klass
10
8
  end
11
-
12
9
  end
13
-
14
10
  end
15
-
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,11 +11,11 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2012-07-23 00:00:00.000000000 Z
14
+ date: 2012-08-25 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: mote
18
- requirement: !ruby/object:Gem::Requirement
18
+ requirement: &2152091920 !ruby/object:Gem::Requirement
19
19
  none: false
20
20
  requirements:
21
21
  - - ! '>='
@@ -23,15 +23,10 @@ dependencies:
23
23
  version: '0'
24
24
  type: :runtime
25
25
  prerelease: false
26
- version_requirements: !ruby/object:Gem::Requirement
27
- none: false
28
- requirements:
29
- - - ! '>='
30
- - !ruby/object:Gem::Version
31
- version: '0'
26
+ version_requirements: *2152091920
32
27
  - !ruby/object:Gem::Dependency
33
28
  name: clap
34
- requirement: !ruby/object:Gem::Requirement
29
+ requirement: &2152091080 !ruby/object:Gem::Requirement
35
30
  none: false
36
31
  requirements:
37
32
  - - ! '>='
@@ -39,12 +34,7 @@ dependencies:
39
34
  version: '0'
40
35
  type: :runtime
41
36
  prerelease: false
42
- version_requirements: !ruby/object:Gem::Requirement
43
- none: false
44
- requirements:
45
- - - ! '>='
46
- - !ruby/object:Gem::Version
47
- version: '0'
37
+ version_requirements: *2152091080
48
38
  description: Simple Generator for the masses
49
39
  email:
50
40
  - michel@soveran.com
@@ -80,7 +70,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
80
70
  version: '0'
81
71
  requirements: []
82
72
  rubyforge_project:
83
- rubygems_version: 1.8.23
73
+ rubygems_version: 1.8.11
84
74
  signing_key:
85
75
  specification_version: 3
86
76
  summary: Simple Generator for the masses