fig 0.1.53 → 0.1.54

Sign up to get free protection for your applications and to get access to all the features.
data/Changes CHANGED
@@ -1,3 +1,11 @@
1
+ v0.1.54
2
+
3
+ - Emits an error when you've got an "include" of another package without
4
+ specifying the version. It used to be the case that you could leave the
5
+ version off, but that would only work if there was a "current" version of
6
+ the depended upon package published. Which meant that you'd have to
7
+ --force the publication of the "current" version.
8
+
1
9
  v0.1.53
2
10
 
3
11
  - Fix bug in doing "fig -u" when the remote repository has a figrc file.
data/README.md CHANGED
@@ -504,6 +504,15 @@ https://github.com/oneclick/rubyinstaller/wiki/Development-Kit.
504
504
 
505
505
  rake build
506
506
 
507
+ ## Building a gem for ruby 1.8.7 on Windows ##
508
+
509
+ You can no longer use the rakefile to produce this specific gem. You will need
510
+ to create a fig.gemspec file manually. Use the list of gem dependencies found
511
+ in the rakefile as a guide. There are two specific gems that need to be
512
+ depended on: json v 1.4.2 and libarchive-static-ruby186. Also, the spec.files
513
+ should specificly list all the source files, pathed from the base directory
514
+ of the project.
515
+
507
516
  Community
508
517
  =========
509
518
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.53
1
+ 0.1.54
@@ -11,6 +11,7 @@ require 'fig/options'
11
11
  require 'fig/package'
12
12
  require 'fig/parser'
13
13
  require 'fig/repository'
14
+ require 'fig/repositoryerror'
14
15
  require 'fig/retriever'
15
16
  require 'fig/statement/configuration'
16
17
  require 'fig/statement/publish'
@@ -3,13 +3,15 @@ require 'json'
3
3
  require 'fig/applicationconfiguration'
4
4
  require 'fig/configfileerror'
5
5
  require 'fig/operatingsystem'
6
-
7
- REPOSITORY_CONFIGURATION = '_meta/figrc'
6
+ require 'fig/repository'
8
7
 
9
8
  module Fig
10
9
  # Parse multiple figrc files and assemble them into a single
11
10
  # ApplicationConfiguration object.
12
11
  class FigRC
12
+ REPOSITORY_CONFIGURATION =
13
+ "#{Repository::METADATA_SUBDIRECTORY}/figrc"
14
+
13
15
  def self.find(
14
16
  override_path, repository_url, login, fig_home, disable_figrc = false
15
17
  )
@@ -21,7 +21,10 @@ grammar Fig
21
21
  package_name,
22
22
  version_name,
23
23
  directory,
24
- statements.elements.map { |statement| statement.to_package_statement }
24
+ statements.elements.map do
25
+ |statement|
26
+ statement.to_package_statement(package_name)
27
+ end
25
28
  )
26
29
  end
27
30
  }
@@ -33,7 +36,7 @@ grammar Fig
33
36
 
34
37
  rule archive
35
38
  "archive" ws url {
36
- def to_package_statement
39
+ def to_package_statement(package_name)
37
40
  Statement::Archive.new(url.value.text_value)
38
41
  end
39
42
  }
@@ -41,7 +44,7 @@ grammar Fig
41
44
 
42
45
  rule resource
43
46
  "resource" ws url {
44
- def to_package_statement
47
+ def to_package_statement(package_name)
45
48
  Statement::Resource.new(url.value.text_value)
46
49
  end
47
50
  }
@@ -49,7 +52,7 @@ grammar Fig
49
52
 
50
53
  rule retrieve
51
54
  "retrieve" ws var:retrieve_variable "->" path:retrieve_path ws {
52
- def to_package_statement
55
+ def to_package_statement(package_name)
53
56
  Statement::Retrieve.new(var.text_value, path.text_value)
54
57
  end
55
58
  }
@@ -65,8 +68,14 @@ grammar Fig
65
68
 
66
69
  rule config
67
70
  "config" ws config_name ws statements:config_statement* "end" ws {
68
- def to_package_statement
69
- Statement::Configuration.new(config_name.text_value, statements.elements.map { |statement| statement.to_config_statement })
71
+ def to_package_statement(package_name)
72
+ Statement::Configuration.new(
73
+ config_name.text_value,
74
+ statements.elements.map do
75
+ |statement|
76
+ statement.to_config_statement(package_name)
77
+ end
78
+ )
70
79
  end
71
80
  }
72
81
  end
@@ -77,10 +86,11 @@ grammar Fig
77
86
 
78
87
  rule include
79
88
  "include" ws descriptor overrides:(override*) {
80
- def to_config_statement
89
+ def to_config_statement(package_name)
81
90
  Statement::Include.new(
82
91
  PackageDescriptor.parse(descriptor.text_value.strip),
83
- overrides.elements.map{ |e| e.to_override }
92
+ overrides.elements.map{ |e| e.to_override },
93
+ package_name
84
94
  )
85
95
  end
86
96
  }
@@ -96,7 +106,7 @@ grammar Fig
96
106
 
97
107
  rule path
98
108
  ("append" / "path" / "add") ws name:path_name "=" value:path_value ws {
99
- def to_config_statement
109
+ def to_config_statement(package_name)
100
110
  Statement::Path.new(name.text_value, value.text_value)
101
111
  end
102
112
  }
@@ -112,7 +122,7 @@ grammar Fig
112
122
 
113
123
  rule set
114
124
  "set" ws name:set_name "=" value:set_value ws {
115
- def to_config_statement
125
+ def to_config_statement(package_name)
116
126
  Statement::Set.new(name.text_value, value.text_value)
117
127
  end
118
128
  }
@@ -128,7 +138,7 @@ grammar Fig
128
138
 
129
139
  rule command
130
140
  "command" ws string {
131
- def to_config_statement
141
+ def to_config_statement(package_name)
132
142
  Statement::Command.new(string.value.text_value)
133
143
  end
134
144
  }
@@ -365,7 +365,9 @@ Environment variables:
365
365
  'include package/version:config specified in DESCRIPTOR (with any variable prepends) in environment'
366
366
  ) do |descriptor|
367
367
  @options[:non_command_package_statements] <<
368
- Fig::Statement::Include.new(Fig::PackageDescriptor.parse(descriptor), {})
368
+ Fig::Statement::Include.new(
369
+ Fig::PackageDescriptor.parse(descriptor), {}, nil
370
+ )
369
371
  end
370
372
 
371
373
  parser.on(
@@ -11,6 +11,8 @@ module Fig
11
11
  # Overall management of a repository. Handles local operations itself;
12
12
  # defers remote operations to others.
13
13
  class Repository
14
+ METADATA_SUBDIRECTORY = '_meta'
15
+
14
16
  def self.is_url?(url)
15
17
  not (/ftp:\/\/|http:\/\/|file:\/\/|ssh:\/\// =~ url).nil?
16
18
  end
@@ -44,11 +46,14 @@ module Fig
44
46
  end
45
47
  end
46
48
  end
47
- results
49
+
50
+ return results
48
51
  end
49
52
 
50
53
  def list_remote_packages
51
- @operating_system.download_list(@remote_repository_url)
54
+ paths = @operating_system.download_list(@remote_repository_url)
55
+
56
+ return paths.reject { |path| path =~ %r< ^ #{METADATA_SUBDIRECTORY} / >xs }
52
57
  end
53
58
 
54
59
  def get_package(package_name, version_name, disable_updating = false)
@@ -12,7 +12,18 @@ class Fig::Statement::Include
12
12
 
13
13
  attr_reader :descriptor, :overrides
14
14
 
15
- def initialize(descriptor, overrides)
15
+ def initialize(descriptor, overrides, containing_package_name)
16
+ if descriptor.name && ! descriptor.version
17
+ message =
18
+ %Q<Must specify a version in the package descriptor of "#{descriptor.name}" for an include statement>
19
+ if containing_package_name
20
+ message += %Q< in the .fig file for "#{containing_package_name}">
21
+ end
22
+ message += '.'
23
+
24
+ raise Fig::PackageError.new(message)
25
+ end
26
+
16
27
  @descriptor = descriptor
17
28
  @overrides = overrides
18
29
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fig
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.53
4
+ version: 0.1.54
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-01-24 00:00:00.000000000 Z
12
+ date: 2012-01-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: libarchive-static
16
- requirement: &21702760 !ruby/object:Gem::Requirement
16
+ requirement: &24818540 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 1.0.0
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *21702760
24
+ version_requirements: *24818540
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: libarchive-static
27
- requirement: &21702220 !ruby/object:Gem::Requirement
27
+ requirement: &24818040 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 1.0.0
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *21702220
35
+ version_requirements: *24818040
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: highline
38
- requirement: &21701700 !ruby/object:Gem::Requirement
38
+ requirement: &24817520 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 1.6.2
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *21701700
46
+ version_requirements: *24817520
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: log4r
49
- requirement: &21701160 !ruby/object:Gem::Requirement
49
+ requirement: &24817000 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 1.1.5
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *21701160
57
+ version_requirements: *24817000
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: net-netrc
60
- requirement: &21700600 !ruby/object:Gem::Requirement
60
+ requirement: &24816480 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: 0.2.2
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *21700600
68
+ version_requirements: *24816480
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: net-sftp
71
- requirement: &21700100 !ruby/object:Gem::Requirement
71
+ requirement: &24815960 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: 2.0.4
77
77
  type: :runtime
78
78
  prerelease: false
79
- version_requirements: *21700100
79
+ version_requirements: *24815960
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: net-ssh
82
- requirement: &21699560 !ruby/object:Gem::Requirement
82
+ requirement: &24815420 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: 2.0.15
88
88
  type: :runtime
89
89
  prerelease: false
90
- version_requirements: *21699560
90
+ version_requirements: *24815420
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: polyglot
93
- requirement: &21699060 !ruby/object:Gem::Requirement
93
+ requirement: &24814880 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ! '>='
@@ -98,10 +98,10 @@ dependencies:
98
98
  version: 0.2.9
99
99
  type: :runtime
100
100
  prerelease: false
101
- version_requirements: *21699060
101
+ version_requirements: *24814880
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: rdoc
104
- requirement: &21698480 !ruby/object:Gem::Requirement
104
+ requirement: &24814360 !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
107
107
  - - ! '>='
@@ -109,10 +109,10 @@ dependencies:
109
109
  version: '3.12'
110
110
  type: :runtime
111
111
  prerelease: false
112
- version_requirements: *21698480
112
+ version_requirements: *24814360
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: json
115
- requirement: &21714380 !ruby/object:Gem::Requirement
115
+ requirement: &24813840 !ruby/object:Gem::Requirement
116
116
  none: false
117
117
  requirements:
118
118
  - - ! '>='
@@ -120,10 +120,10 @@ dependencies:
120
120
  version: 1.6.5
121
121
  type: :runtime
122
122
  prerelease: false
123
- version_requirements: *21714380
123
+ version_requirements: *24813840
124
124
  - !ruby/object:Gem::Dependency
125
125
  name: treetop
126
- requirement: &21713860 !ruby/object:Gem::Requirement
126
+ requirement: &24813320 !ruby/object:Gem::Requirement
127
127
  none: false
128
128
  requirements:
129
129
  - - ! '>='
@@ -131,10 +131,10 @@ dependencies:
131
131
  version: 1.4.2
132
132
  type: :runtime
133
133
  prerelease: false
134
- version_requirements: *21713860
134
+ version_requirements: *24813320
135
135
  - !ruby/object:Gem::Dependency
136
136
  name: ftp
137
- requirement: &21713340 !ruby/object:Gem::Requirement
137
+ requirement: &24812820 !ruby/object:Gem::Requirement
138
138
  none: false
139
139
  requirements:
140
140
  - - ! '>='
@@ -142,10 +142,10 @@ dependencies:
142
142
  version: '0.69'
143
143
  type: :runtime
144
144
  prerelease: false
145
- version_requirements: *21713340
145
+ version_requirements: *24812820
146
146
  - !ruby/object:Gem::Dependency
147
147
  name: open4
148
- requirement: &21712800 !ruby/object:Gem::Requirement
148
+ requirement: &24812320 !ruby/object:Gem::Requirement
149
149
  none: false
150
150
  requirements:
151
151
  - - ! '>='
@@ -153,10 +153,10 @@ dependencies:
153
153
  version: 1.0.1
154
154
  type: :development
155
155
  prerelease: false
156
- version_requirements: *21712800
156
+ version_requirements: *24812320
157
157
  - !ruby/object:Gem::Dependency
158
158
  name: rspec
159
- requirement: &21712260 !ruby/object:Gem::Requirement
159
+ requirement: &24811840 !ruby/object:Gem::Requirement
160
160
  none: false
161
161
  requirements:
162
162
  - - ! '>='
@@ -164,10 +164,10 @@ dependencies:
164
164
  version: '2.8'
165
165
  type: :development
166
166
  prerelease: false
167
- version_requirements: *21712260
167
+ version_requirements: *24811840
168
168
  - !ruby/object:Gem::Dependency
169
169
  name: libarchive-static
170
- requirement: &21711720 !ruby/object:Gem::Requirement
170
+ requirement: &24811300 !ruby/object:Gem::Requirement
171
171
  none: false
172
172
  requirements:
173
173
  - - ! '>='
@@ -175,10 +175,10 @@ dependencies:
175
175
  version: 1.0.0
176
176
  type: :development
177
177
  prerelease: false
178
- version_requirements: *21711720
178
+ version_requirements: *24811300
179
179
  - !ruby/object:Gem::Dependency
180
180
  name: libarchive-static
181
- requirement: &21711160 !ruby/object:Gem::Requirement
181
+ requirement: &24818940 !ruby/object:Gem::Requirement
182
182
  none: false
183
183
  requirements:
184
184
  - - ! '>='
@@ -186,10 +186,10 @@ dependencies:
186
186
  version: 1.0.0
187
187
  type: :runtime
188
188
  prerelease: false
189
- version_requirements: *21711160
189
+ version_requirements: *24818940
190
190
  - !ruby/object:Gem::Dependency
191
191
  name: highline
192
- requirement: &21710540 !ruby/object:Gem::Requirement
192
+ requirement: &24818140 !ruby/object:Gem::Requirement
193
193
  none: false
194
194
  requirements:
195
195
  - - ! '>='
@@ -197,10 +197,10 @@ dependencies:
197
197
  version: 1.6.2
198
198
  type: :runtime
199
199
  prerelease: false
200
- version_requirements: *21710540
200
+ version_requirements: *24818140
201
201
  - !ruby/object:Gem::Dependency
202
202
  name: log4r
203
- requirement: &21710040 !ruby/object:Gem::Requirement
203
+ requirement: &24817400 !ruby/object:Gem::Requirement
204
204
  none: false
205
205
  requirements:
206
206
  - - ! '>='
@@ -208,10 +208,10 @@ dependencies:
208
208
  version: 1.1.5
209
209
  type: :runtime
210
210
  prerelease: false
211
- version_requirements: *21710040
211
+ version_requirements: *24817400
212
212
  - !ruby/object:Gem::Dependency
213
213
  name: net-netrc
214
- requirement: &21709520 !ruby/object:Gem::Requirement
214
+ requirement: &24816580 !ruby/object:Gem::Requirement
215
215
  none: false
216
216
  requirements:
217
217
  - - ! '>='
@@ -219,10 +219,10 @@ dependencies:
219
219
  version: 0.2.2
220
220
  type: :runtime
221
221
  prerelease: false
222
- version_requirements: *21709520
222
+ version_requirements: *24816580
223
223
  - !ruby/object:Gem::Dependency
224
224
  name: net-sftp
225
- requirement: &21708860 !ruby/object:Gem::Requirement
225
+ requirement: &24815840 !ruby/object:Gem::Requirement
226
226
  none: false
227
227
  requirements:
228
228
  - - ! '>='
@@ -230,10 +230,10 @@ dependencies:
230
230
  version: 2.0.4
231
231
  type: :runtime
232
232
  prerelease: false
233
- version_requirements: *21708860
233
+ version_requirements: *24815840
234
234
  - !ruby/object:Gem::Dependency
235
235
  name: net-ssh
236
- requirement: &21708160 !ruby/object:Gem::Requirement
236
+ requirement: &24815000 !ruby/object:Gem::Requirement
237
237
  none: false
238
238
  requirements:
239
239
  - - ! '>='
@@ -241,10 +241,10 @@ dependencies:
241
241
  version: 2.0.15
242
242
  type: :runtime
243
243
  prerelease: false
244
- version_requirements: *21708160
244
+ version_requirements: *24815000
245
245
  - !ruby/object:Gem::Dependency
246
246
  name: polyglot
247
- requirement: &21707660 !ruby/object:Gem::Requirement
247
+ requirement: &24814220 !ruby/object:Gem::Requirement
248
248
  none: false
249
249
  requirements:
250
250
  - - ! '>='
@@ -252,10 +252,10 @@ dependencies:
252
252
  version: 0.2.9
253
253
  type: :runtime
254
254
  prerelease: false
255
- version_requirements: *21707660
255
+ version_requirements: *24814220
256
256
  - !ruby/object:Gem::Dependency
257
257
  name: rdoc
258
- requirement: &21707140 !ruby/object:Gem::Requirement
258
+ requirement: &24813420 !ruby/object:Gem::Requirement
259
259
  none: false
260
260
  requirements:
261
261
  - - ! '>='
@@ -263,10 +263,10 @@ dependencies:
263
263
  version: '3.12'
264
264
  type: :runtime
265
265
  prerelease: false
266
- version_requirements: *21707140
266
+ version_requirements: *24813420
267
267
  - !ruby/object:Gem::Dependency
268
268
  name: json
269
- requirement: &21723040 !ruby/object:Gem::Requirement
269
+ requirement: &24812680 !ruby/object:Gem::Requirement
270
270
  none: false
271
271
  requirements:
272
272
  - - ! '>='
@@ -274,10 +274,10 @@ dependencies:
274
274
  version: 1.6.5
275
275
  type: :runtime
276
276
  prerelease: false
277
- version_requirements: *21723040
277
+ version_requirements: *24812680
278
278
  - !ruby/object:Gem::Dependency
279
279
  name: treetop
280
- requirement: &21722540 !ruby/object:Gem::Requirement
280
+ requirement: &24811940 !ruby/object:Gem::Requirement
281
281
  none: false
282
282
  requirements:
283
283
  - - ! '>='
@@ -285,10 +285,10 @@ dependencies:
285
285
  version: 1.4.2
286
286
  type: :runtime
287
287
  prerelease: false
288
- version_requirements: *21722540
288
+ version_requirements: *24811940
289
289
  - !ruby/object:Gem::Dependency
290
290
  name: ftp
291
- requirement: &21722020 !ruby/object:Gem::Requirement
291
+ requirement: &24809300 !ruby/object:Gem::Requirement
292
292
  none: false
293
293
  requirements:
294
294
  - - ! '>='
@@ -296,10 +296,10 @@ dependencies:
296
296
  version: '0.69'
297
297
  type: :runtime
298
298
  prerelease: false
299
- version_requirements: *21722020
299
+ version_requirements: *24809300
300
300
  - !ruby/object:Gem::Dependency
301
301
  name: open4
302
- requirement: &21721500 !ruby/object:Gem::Requirement
302
+ requirement: &24808520 !ruby/object:Gem::Requirement
303
303
  none: false
304
304
  requirements:
305
305
  - - ! '>='
@@ -307,10 +307,10 @@ dependencies:
307
307
  version: 1.0.1
308
308
  type: :development
309
309
  prerelease: false
310
- version_requirements: *21721500
310
+ version_requirements: *24808520
311
311
  - !ruby/object:Gem::Dependency
312
312
  name: rspec
313
- requirement: &21721020 !ruby/object:Gem::Requirement
313
+ requirement: &24807920 !ruby/object:Gem::Requirement
314
314
  none: false
315
315
  requirements:
316
316
  - - ! '>='
@@ -318,7 +318,7 @@ dependencies:
318
318
  version: '2.8'
319
319
  type: :development
320
320
  prerelease: false
321
- version_requirements: *21721020
321
+ version_requirements: *24807920
322
322
  description: Fig is a utility for configuring environments and managing dependencies
323
323
  across a team of developers. Given a list of packages and a command to run, Fig
324
324
  builds environment variables named in those packages (e.g., CLASSPATH), then executes