noe 1.7.4 → 1.7.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,9 @@
1
+ # 1.7.5 / 2012-06-16
2
+
3
+ * Raise an error at noe go if a manifest entry is missing.
4
+ * Allow wlang-dialect to be explicitely set to nil (yaml ~) to prevent wlang for
5
+ being used on specific entries.
6
+
1
7
  # 1.7.4 / 2012-02-26
2
8
 
3
9
  * Avoid creating the project folder if 'noe prepare' is going to fail due to unknown
@@ -1,3 +1,4 @@
1
+ require 'fileutils'
1
2
  module Noe
2
3
  class Main
3
4
  #
@@ -296,11 +297,16 @@ module Noe
296
297
  class FileInstantiate < DoSomething
297
298
 
298
299
  def run
299
- relocated.open('w') do |out|
300
- dialect = entry.wlang_dialect
301
- braces = entry.wlang_braces
302
- variables.methodize!
303
- out << WLang::file_instantiate(entry.realpath.to_s, variables, dialect, braces)
300
+ source = entry.realpath.to_s
301
+ target = relocated
302
+ if dialect = entry.wlang_dialect
303
+ target.open('w') do |out|
304
+ braces = entry.wlang_braces
305
+ variables.methodize!
306
+ out << WLang::file_instantiate(source, variables, dialect, braces)
307
+ end
308
+ else
309
+ FileUtils.cp(source, target)
304
310
  end
305
311
  end
306
312
 
@@ -90,11 +90,16 @@ module Noe
90
90
 
91
91
  # Returns manifest Hash for a given entry
92
92
  def manifest_for(entry)
93
- manifest = spec['template-info']['manifest'] || {}
94
- manifest[entry.path.to_s] || {
93
+ path = entry.path.to_s
94
+ manifest = spec['template-info']['manifest']
95
+ manifest = manifest[path]
96
+ if manifest.nil? and Path(path).file?
97
+ raise "Missing manifest for #{entry.path}"
98
+ end
99
+ {
95
100
  'description' => "No description for #{entry.path}",
96
101
  'safe-override' => false
97
- }
102
+ }.merge(manifest || {})
98
103
  end
99
104
 
100
105
  # Visit the template
@@ -186,9 +191,11 @@ module Noe
186
191
 
187
192
  # Returns wlang dialect to use
188
193
  def wlang_dialect
189
- @wlang_dialect ||= begin
190
- default = template.main_wlang_dialect
191
- manifest['wlang-dialect'] || self.class.infer_wlang_dialect(relocate, default)
194
+ told = manifest['wlang-dialect']
195
+ if told.nil? && manifest.has_key?('wlang-dialect')
196
+ nil
197
+ else
198
+ told || self.class.infer_wlang_dialect(relocate, template.main_wlang_dialect)
192
199
  end
193
200
  end
194
201
 
@@ -3,7 +3,7 @@ module Noe
3
3
 
4
4
  MAJOR = 1
5
5
  MINOR = 7
6
- TINY = 4
6
+ TINY = 5
7
7
 
8
8
  def self.to_s
9
9
  [ MAJOR, MINOR, TINY ].join('.')
@@ -1,6 +1,6 @@
1
1
  template-info:
2
- name: ruby
3
- version: 1.7.3
2
+ name: rubygem.noe
3
+ version: 1.7.5
4
4
  author: Bernard Lambeau <blambeau@gmail.com>
5
5
  manifest:
6
6
  spec/spec_helper.rb:
@@ -10,7 +10,7 @@ template-info:
10
10
  variables:
11
11
  lower: noe
12
12
  upper: Noe
13
- version: 1.7.4
13
+ version: 1.7.5
14
14
  summary:
15
15
  Noe is a simple, general-purpose and extensible skeleton generator from project templates
16
16
  description:
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: noe
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.4
4
+ version: 1.7.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-26 00:00:00.000000000Z
12
+ date: 2012-06-16 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
16
- requirement: &70144303386380 !ruby/object:Gem::Requirement
16
+ requirement: &71969890 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 0.9.2
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70144303386380
24
+ version_requirements: *71969890
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rspec
27
- requirement: &70144303385840 !ruby/object:Gem::Requirement
27
+ requirement: &71965460 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '2.9'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70144303385840
35
+ version_requirements: *71965460
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: yard
38
- requirement: &70144303367700 !ruby/object:Gem::Requirement
38
+ requirement: &71965140 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 0.7.2
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70144303367700
46
+ version_requirements: *71965140
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: bluecloth
49
- requirement: &70144303367020 !ruby/object:Gem::Requirement
49
+ requirement: &71964820 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '2.2'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70144303367020
57
+ version_requirements: *71964820
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: wlang
60
- requirement: &70144303366320 !ruby/object:Gem::Requirement
60
+ requirement: &71964490 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: 0.10.2
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *70144303366320
68
+ version_requirements: *71964490
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: quickl
71
- requirement: &70144303365540 !ruby/object:Gem::Requirement
71
+ requirement: &71964200 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ~>
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: 0.4.1
77
77
  type: :runtime
78
78
  prerelease: false
79
- version_requirements: *70144303365540
79
+ version_requirements: *71964200
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: highline
82
- requirement: &70144303364940 !ruby/object:Gem::Requirement
82
+ requirement: &71963860 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ~>
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: '1.6'
88
88
  type: :runtime
89
89
  prerelease: false
90
- version_requirements: *70144303364940
90
+ version_requirements: *71963860
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: epath
93
- requirement: &70144303364260 !ruby/object:Gem::Requirement
93
+ requirement: &71963540 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ~>
@@ -98,7 +98,7 @@ dependencies:
98
98
  version: 0.1.1
99
99
  type: :runtime
100
100
  prerelease: false
101
- version_requirements: *70144303364260
101
+ version_requirements: *71963540
102
102
  description: Noe is a tool that generates project skeletons from predefined templates.
103
103
  A template is designed for a specific product (a ruby library, a static or dynamic
104
104
  web site, ...). Noe instantiates templates and helps you maintaining your product
@@ -120,21 +120,21 @@ files:
120
120
  - CHANGELOG.md
121
121
  - Gemfile
122
122
  - Gemfile.lock
123
- - lib/noe/commons.rb
124
- - lib/noe/config.rb
125
- - lib/noe/config.yaml
126
- - lib/noe/default.yaml
127
- - lib/noe/ext/array.rb
128
- - lib/noe/ext/hash.rb
129
- - lib/noe/go.rb
130
123
  - lib/noe/help.rb
131
- - lib/noe/install.rb
132
- - lib/noe/list.rb
133
- - lib/noe/loader.rb
134
- - lib/noe/main.rb
135
124
  - lib/noe/prepare.rb
125
+ - lib/noe/go.rb
136
126
  - lib/noe/show_spec.rb
127
+ - lib/noe/main.rb
137
128
  - lib/noe/template.rb
129
+ - lib/noe/commons.rb
130
+ - lib/noe/list.rb
131
+ - lib/noe/install.rb
132
+ - lib/noe/config.rb
133
+ - lib/noe/loader.rb
134
+ - lib/noe/default.yaml
135
+ - lib/noe/ext/hash.rb
136
+ - lib/noe/ext/array.rb
137
+ - lib/noe/config.yaml
138
138
  - lib/noe/version.rb
139
139
  - lib/noe.rb
140
140
  - LICENCE.md
@@ -143,51 +143,51 @@ files:
143
143
  - noe.noespec
144
144
  - Rakefile
145
145
  - README.md
146
- - spec/fixtures/test.noespec
147
- - spec/fixtures/typitpl/noespec.yaml
148
- - spec/fixtures/typitpl/src/README.txt
146
+ - spec/spec_helper.rb
147
+ - spec/integration/spaces_spec.rb
148
+ - spec/integration/go/go_spec.rb
149
149
  - spec/integration/go/after_prepare/after_prepare.noespec
150
150
  - spec/integration/go/after_prepare/README.md
151
- - spec/integration/go/go_spec.rb
152
- - spec/integration/spaces_spec.rb
153
- - spec/spec_helper.rb
151
+ - spec/unit/template/entry/rename_one_spec.rb
152
+ - spec/unit/template/entry/relocate_spec.rb
153
+ - spec/unit/template/entry/infer_wlang_dialect_spec.rb
154
154
  - spec/unit/config/config1.yaml
155
155
  - spec/unit/config/new_spec.rb
156
156
  - spec/unit/config/templates_dir_spec.rb
157
- - spec/unit/ext/hash/methodize_spec.rb
158
- - spec/unit/ext/hash/noe_merge_spec.rb
159
157
  - spec/unit/noe_spec.rb
160
- - spec/unit/template/entry/infer_wlang_dialect_spec.rb
161
- - spec/unit/template/entry/relocate_spec.rb
162
- - spec/unit/template/entry/rename_one_spec.rb
158
+ - spec/unit/ext/hash/noe_merge_spec.rb
159
+ - spec/unit/ext/hash/methodize_spec.rb
160
+ - spec/fixtures/typitpl/noespec.yaml
161
+ - spec/fixtures/typitpl/src/README.txt
162
+ - spec/fixtures/test.noespec
163
163
  - tasks/debug_mail.rake
164
- - tasks/debug_mail.txt
164
+ - tasks/yard.rake
165
165
  - tasks/gem.rake
166
166
  - tasks/spec_test.rake
167
167
  - tasks/unit_test.rake
168
- - tasks/yard.rake
169
- - templates/ruby/CHANGELOG.md
168
+ - tasks/debug_mail.txt
170
169
  - templates/ruby/noespec.yaml
170
+ - templates/ruby/CHANGELOG.md
171
171
  - templates/ruby/README.md
172
- - templates/ruby/short.yaml
173
- - templates/ruby/src/__lower__.gemspec
174
172
  - templates/ruby/src/CHANGELOG.md
175
- - templates/ruby/src/Gemfile
173
+ - templates/ruby/src/README.md
174
+ - templates/ruby/src/Manifest.txt
175
+ - templates/ruby/src/Rakefile
176
+ - templates/ruby/src/__lower__.gemspec
177
+ - templates/ruby/src/lib/__lower__.rb
176
178
  - templates/ruby/src/lib/__lower__/loader.rb
177
179
  - templates/ruby/src/lib/__lower__/version.rb
178
- - templates/ruby/src/lib/__lower__.rb
179
180
  - templates/ruby/src/LICENCE.md
180
- - templates/ruby/src/Manifest.txt
181
- - templates/ruby/src/Rakefile
182
- - templates/ruby/src/README.md
183
181
  - templates/ruby/src/spec/spec_helper.rb
184
182
  - templates/ruby/src/spec/test___lower__.rb
185
183
  - templates/ruby/src/tasks/debug_mail.rake
186
- - templates/ruby/src/tasks/debug_mail.txt
184
+ - templates/ruby/src/tasks/yard.rake
187
185
  - templates/ruby/src/tasks/gem.rake
188
186
  - templates/ruby/src/tasks/spec_test.rake
189
187
  - templates/ruby/src/tasks/unit_test.rake
190
- - templates/ruby/src/tasks/yard.rake
188
+ - templates/ruby/src/tasks/debug_mail.txt
189
+ - templates/ruby/src/Gemfile
190
+ - templates/ruby/short.yaml
191
191
  - templates/ruby/src/.travis.yml
192
192
  - templates/ruby/src/.gitignore
193
193
  homepage: http://github.com/blambeau/noe
@@ -212,26 +212,26 @@ required_rubygems_version: !ruby/object:Gem::Requirement
212
212
  version: '0'
213
213
  requirements: []
214
214
  rubyforge_project:
215
- rubygems_version: 1.8.10
215
+ rubygems_version: 1.8.15
216
216
  signing_key:
217
217
  specification_version: 3
218
218
  summary: Noe is a simple, general-purpose and extensible skeleton generator from project
219
219
  templates
220
220
  test_files:
221
- - spec/fixtures/test.noespec
222
- - spec/fixtures/typitpl/noespec.yaml
223
- - spec/fixtures/typitpl/src/README.txt
221
+ - spec/spec_helper.rb
222
+ - spec/integration/spaces_spec.rb
223
+ - spec/integration/go/go_spec.rb
224
224
  - spec/integration/go/after_prepare/after_prepare.noespec
225
225
  - spec/integration/go/after_prepare/README.md
226
- - spec/integration/go/go_spec.rb
227
- - spec/integration/spaces_spec.rb
228
- - spec/spec_helper.rb
226
+ - spec/unit/template/entry/rename_one_spec.rb
227
+ - spec/unit/template/entry/relocate_spec.rb
228
+ - spec/unit/template/entry/infer_wlang_dialect_spec.rb
229
229
  - spec/unit/config/config1.yaml
230
230
  - spec/unit/config/new_spec.rb
231
231
  - spec/unit/config/templates_dir_spec.rb
232
- - spec/unit/ext/hash/methodize_spec.rb
233
- - spec/unit/ext/hash/noe_merge_spec.rb
234
232
  - spec/unit/noe_spec.rb
235
- - spec/unit/template/entry/infer_wlang_dialect_spec.rb
236
- - spec/unit/template/entry/relocate_spec.rb
237
- - spec/unit/template/entry/rename_one_spec.rb
233
+ - spec/unit/ext/hash/noe_merge_spec.rb
234
+ - spec/unit/ext/hash/methodize_spec.rb
235
+ - spec/fixtures/typitpl/noespec.yaml
236
+ - spec/fixtures/typitpl/src/README.txt
237
+ - spec/fixtures/test.noespec