fig 0.1.59 → 0.1.61

Sign up to get free protection for your applications and to get access to all the features.
data/Changes CHANGED
@@ -1,3 +1,24 @@
1
+ v0.1.61
2
+
3
+ New features:
4
+
5
+ - Constraints on the values of "resource", "append", "path", "add", and "set"
6
+ statements greatly relaxed (prompted by C++ libraries with "++" in their
7
+ names).
8
+
9
+ - The package name can now include a "_" for parsing. Previously you could
10
+ publish a package with an underscore in the name but would be unable to
11
+ subsequently use it.
12
+
13
+ Bug fixes:
14
+
15
+ - Removed dependency on the 'ftp' gem.
16
+
17
+ v0.1.60.alpha.2
18
+ v0.1.60.alpha.1
19
+
20
+ - Test releases
21
+
1
22
  v0.1.59
2
23
 
3
24
  Backwards incompatibilities:
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.59
1
+ 0.1.61
@@ -291,11 +291,12 @@ module Fig
291
291
 
292
292
  def expand_named_package_references(arg)
293
293
  return arg.gsub(
294
+ # TODO: Refactor package name regex into PackageDescriptor constant.
294
295
  %r<
295
296
  (?: ^ | \G) # Zero-width anchor.
296
297
  ( [^\\@]* (?:\\{2})*) # An even number of leading backslashes
297
298
  \@ # The package indicator
298
- ( [a-zA-Z0-9.-]+ ) # Package name
299
+ ( [a-zA-Z0-9_.-]+ ) # Package name
299
300
  >x
300
301
  ) do |match|
301
302
  backslashes = $1 || ''
@@ -36,27 +36,27 @@ grammar Fig
36
36
  end
37
37
 
38
38
  rule archive
39
- statement_start:"archive" ws url {
39
+ statement_start:"archive" ws resource_url {
40
40
  def to_package_statement(descriptor)
41
41
  Statement::Archive.new(
42
- Parser.node_location(statement_start), url.value.text_value
42
+ Parser.node_location(statement_start), resource_url.value.text_value
43
43
  )
44
44
  end
45
45
  }
46
46
  end
47
47
 
48
48
  rule resource
49
- statement_start:"resource" ws url {
49
+ statement_start:"resource" ws resource_url {
50
50
  def to_package_statement(descriptor)
51
51
  Statement::Resource.new(
52
- Parser.node_location(statement_start), url.value.text_value
52
+ Parser.node_location(statement_start), resource_url.value.text_value
53
53
  )
54
54
  end
55
55
  }
56
56
  end
57
57
 
58
58
  rule retrieve
59
- statement_start:"retrieve" ws var:retrieve_variable "->" path:retrieve_path ws {
59
+ statement_start:"retrieve" ws var:retrieve_variable_name "->" path:retrieve_path ws {
60
60
  def to_package_statement(descriptor)
61
61
  Statement::Retrieve.new(
62
62
  Parser.node_location(statement_start),
@@ -67,7 +67,7 @@ grammar Fig
67
67
  }
68
68
  end
69
69
 
70
- rule retrieve_variable
70
+ rule retrieve_variable_name
71
71
  [@a-zA-Z0-9/._]+
72
72
  end
73
73
 
@@ -120,7 +120,7 @@ grammar Fig
120
120
  end
121
121
 
122
122
  rule path
123
- statement_start:("append" / "path" / "add") ws name:path_name "=" value:path_value ws {
123
+ statement_start:("append" / "path" / "add") ws name:environment_variable_name "=" value:path_value ws {
124
124
  def to_config_statement(descriptor)
125
125
  Statement::Path.new(
126
126
  Parser.node_location(statement_start),
@@ -131,16 +131,20 @@ grammar Fig
131
131
  }
132
132
  end
133
133
 
134
- rule path_name
134
+ rule environment_variable_name
135
135
  [a-zA-Z0-9_]+
136
136
  end
137
137
 
138
138
  rule path_value
139
- [@a-zA-Z0-9/\\._-]+
139
+ # Characters blocked in the value:
140
+ # ;: - Windows/*nix path separators
141
+ # "<>| - Characters not allowed in filenames on Windows
142
+ # \s - Necessary for the "ws" token to work
143
+ [^;:"<>|\s]+
140
144
  end
141
145
 
142
146
  rule set
143
- statement_start:"set" ws name:set_name "=" value:set_value ws {
147
+ statement_start:"set" ws name:environment_variable_name "=" value:set_value ws {
144
148
  def to_config_statement(descriptor)
145
149
  Statement::Set.new(
146
150
  Parser.node_location(statement_start),
@@ -151,12 +155,8 @@ grammar Fig
151
155
  }
152
156
  end
153
157
 
154
- rule set_name
155
- [a-zA-Z0-9_]+
156
- end
157
-
158
158
  rule set_value
159
- [@a-zA-Z0-9/\\._-]*
159
+ [\S]*
160
160
  end
161
161
 
162
162
  rule command
@@ -197,7 +197,7 @@ grammar Fig
197
197
  end
198
198
 
199
199
  rule package_name
200
- [a-zA-Z0-9.-]+
200
+ [a-zA-Z0-9_.-]+
201
201
  end
202
202
 
203
203
  rule version_name
@@ -208,8 +208,21 @@ grammar Fig
208
208
  [a-zA-Z0-9_.-]+
209
209
  end
210
210
 
211
- rule url
212
- (value:[a-zA-Z0-9:/\\._*-]+ ws) / ('"' value:[a-zA-Z0-9:/\\._-]+ '"' ws)
211
+ rule resource_url
212
+ # Unquoted allows globbing for files, quoted does not.
213
+ #
214
+ # Unquoted, anything but:
215
+ # @ - To allow for package substitution
216
+ # "<>| - Characters not allowed in filenames on Windows
217
+ # \s - Necessary for the "ws" token to work
218
+ (value:[^@"<>|\s]+ ws)
219
+
220
+ # Unquoted, anything but:
221
+ # @ - To allow for package substitution
222
+ # "<>| - Characters not allowed in filenames on Windows
223
+ # *?\[\]{} - Characters significant to Dir.glob()
224
+ # \s - We just don't want these. :] (May need to allow space.)
225
+ / ('"' value:[^@"<>|*?\[\]{}\s]+ '"' ws)
213
226
  end
214
227
 
215
228
  rule ws
@@ -37,6 +37,10 @@ class Fig::PackageDescriptor
37
37
  end
38
38
 
39
39
  def initialize(name, version, config)
40
+ validate_component name, 'name'
41
+ validate_component version, 'version'
42
+ validate_component config, 'config'
43
+
40
44
  @name = name
41
45
  @version = version
42
46
  @config = config
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.59
4
+ version: 0.1.61
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-03-09 00:00:00.000000000Z
12
+ date: 2012-03-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sys-admin
16
- requirement: &2152136260 !ruby/object:Gem::Requirement
16
+ requirement: &2153612420 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 1.5.6
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2152136260
24
+ version_requirements: *2153612420
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: libarchive-static
27
- requirement: &2152133060 !ruby/object:Gem::Requirement
27
+ requirement: &2153611940 !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: *2152133060
35
+ version_requirements: *2153611940
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: colorize
38
- requirement: &2152131860 !ruby/object:Gem::Requirement
38
+ requirement: &2153611480 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,21 +43,10 @@ dependencies:
43
43
  version: 0.5.8
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *2152131860
47
- - !ruby/object:Gem::Dependency
48
- name: ftp
49
- requirement: &2152129320 !ruby/object:Gem::Requirement
50
- none: false
51
- requirements:
52
- - - ! '>='
53
- - !ruby/object:Gem::Version
54
- version: '0.69'
55
- type: :runtime
56
- prerelease: false
57
- version_requirements: *2152129320
46
+ version_requirements: *2153611480
58
47
  - !ruby/object:Gem::Dependency
59
48
  name: highline
60
- requirement: &2152127980 !ruby/object:Gem::Requirement
49
+ requirement: &2153611000 !ruby/object:Gem::Requirement
61
50
  none: false
62
51
  requirements:
63
52
  - - ! '>='
@@ -65,10 +54,10 @@ dependencies:
65
54
  version: 1.6.2
66
55
  type: :runtime
67
56
  prerelease: false
68
- version_requirements: *2152127980
57
+ version_requirements: *2153611000
69
58
  - !ruby/object:Gem::Dependency
70
59
  name: json
71
- requirement: &2152126840 !ruby/object:Gem::Requirement
60
+ requirement: &2153610480 !ruby/object:Gem::Requirement
72
61
  none: false
73
62
  requirements:
74
63
  - - ! '>='
@@ -76,10 +65,10 @@ dependencies:
76
65
  version: 1.6.5
77
66
  type: :runtime
78
67
  prerelease: false
79
- version_requirements: *2152126840
68
+ version_requirements: *2153610480
80
69
  - !ruby/object:Gem::Dependency
81
70
  name: log4r
82
- requirement: &2152125760 !ruby/object:Gem::Requirement
71
+ requirement: &2153609680 !ruby/object:Gem::Requirement
83
72
  none: false
84
73
  requirements:
85
74
  - - ! '>='
@@ -87,10 +76,10 @@ dependencies:
87
76
  version: 1.1.5
88
77
  type: :runtime
89
78
  prerelease: false
90
- version_requirements: *2152125760
79
+ version_requirements: *2153609680
91
80
  - !ruby/object:Gem::Dependency
92
81
  name: net-netrc
93
- requirement: &2152117680 !ruby/object:Gem::Requirement
82
+ requirement: &2153609220 !ruby/object:Gem::Requirement
94
83
  none: false
95
84
  requirements:
96
85
  - - ! '>='
@@ -98,10 +87,10 @@ dependencies:
98
87
  version: 0.2.2
99
88
  type: :runtime
100
89
  prerelease: false
101
- version_requirements: *2152117680
90
+ version_requirements: *2153609220
102
91
  - !ruby/object:Gem::Dependency
103
92
  name: net-sftp
104
- requirement: &2152116660 !ruby/object:Gem::Requirement
93
+ requirement: &2153608240 !ruby/object:Gem::Requirement
105
94
  none: false
106
95
  requirements:
107
96
  - - ! '>='
@@ -109,10 +98,10 @@ dependencies:
109
98
  version: 2.0.4
110
99
  type: :runtime
111
100
  prerelease: false
112
- version_requirements: *2152116660
101
+ version_requirements: *2153608240
113
102
  - !ruby/object:Gem::Dependency
114
103
  name: net-ssh
115
- requirement: &2152115460 !ruby/object:Gem::Requirement
104
+ requirement: &2153606760 !ruby/object:Gem::Requirement
116
105
  none: false
117
106
  requirements:
118
107
  - - ! '>='
@@ -120,10 +109,10 @@ dependencies:
120
109
  version: 2.0.15
121
110
  type: :runtime
122
111
  prerelease: false
123
- version_requirements: *2152115460
112
+ version_requirements: *2153606760
124
113
  - !ruby/object:Gem::Dependency
125
114
  name: polyglot
126
- requirement: &2152114440 !ruby/object:Gem::Requirement
115
+ requirement: &2153605840 !ruby/object:Gem::Requirement
127
116
  none: false
128
117
  requirements:
129
118
  - - ! '>='
@@ -131,10 +120,10 @@ dependencies:
131
120
  version: 0.2.9
132
121
  type: :runtime
133
122
  prerelease: false
134
- version_requirements: *2152114440
123
+ version_requirements: *2153605840
135
124
  - !ruby/object:Gem::Dependency
136
125
  name: rdoc
137
- requirement: &2152113380 !ruby/object:Gem::Requirement
126
+ requirement: &2153605380 !ruby/object:Gem::Requirement
138
127
  none: false
139
128
  requirements:
140
129
  - - ! '>='
@@ -142,10 +131,10 @@ dependencies:
142
131
  version: '3.12'
143
132
  type: :runtime
144
133
  prerelease: false
145
- version_requirements: *2152113380
134
+ version_requirements: *2153605380
146
135
  - !ruby/object:Gem::Dependency
147
136
  name: treetop
148
- requirement: &2152112540 !ruby/object:Gem::Requirement
137
+ requirement: &2153604920 !ruby/object:Gem::Requirement
149
138
  none: false
150
139
  requirements:
151
140
  - - ! '>='
@@ -153,7 +142,7 @@ dependencies:
153
142
  version: 1.4.2
154
143
  type: :runtime
155
144
  prerelease: false
156
- version_requirements: *2152112540
145
+ version_requirements: *2153604920
157
146
  description: Fig is a utility for configuring environments and managing dependencies
158
147
  across a team of developers. Given a list of packages and a command to run, Fig
159
148
  builds environment variables named in those packages (e.g., CLASSPATH), then executes
@@ -233,7 +222,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
233
222
  version: '0'
234
223
  requirements: []
235
224
  rubyforge_project:
236
- rubygems_version: 1.8.15
225
+ rubygems_version: 1.8.11
237
226
  signing_key:
238
227
  specification_version: 3
239
228
  summary: Fig is a utility for configuring environments and managing dependencies across