dev 1.0.17 → 1.0.18

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/dev/Project.rb +3 -2
  2. data/lib/dev/Svn.rb +9 -5
  3. metadata +15 -15
data/lib/dev/Project.rb CHANGED
@@ -176,8 +176,9 @@ class Project < Hash
176
176
 
177
177
  def pull
178
178
  array_method("pull")
179
- puts " updating revision variables"
180
- Dev::Svn::update_revision_variables("rakefile.rb")
179
+ filename=Dir.pwd + "/rakefile.rb"
180
+ puts " updating revision variables for " + filename
181
+ Dev::Svn::update_revision_variables(filename)
181
182
  end
182
183
 
183
184
  def info
data/lib/dev/Svn.rb CHANGED
@@ -16,11 +16,12 @@ class Svn
16
16
  if File.exist?(filename)
17
17
  revision=Dev::Svn::last_changed_revision(url)
18
18
  replace="#{variable_name}='#{revision}'"
19
+ puts " " + replace + " in " + filename unless revision=="0"
19
20
  text=File.read(filename)
20
21
  unless text.include?(replace)
21
22
  unless revision == "0"
22
23
  puts " updating " + filename + " with " + replace
23
- search=Regexp.new("#{variable_name}='[\\d]+'")
24
+ search=Regexp.new("#{variable_name}=['\"][\\d]+['\"]")
24
25
  Dev::Environment.replace_text_in_file(filename,search,"#{variable_name}='#{revision}'")
25
26
  end
26
27
  end
@@ -29,21 +30,24 @@ class Svn
29
30
 
30
31
  def self.update_revision_variables(filename)
31
32
  if File.exist?(filename)
33
+ puts_debug "scanning " + filename + " for revision variables"
32
34
  text=File.read(filename)
33
35
  # extract potential variable names of form
34
- text.scan(/([A-Z_]+)='[\d]+'/).each{ | var_match |
35
- #puts "found var_match: " + var_match[0].to_s
36
+ text.scan(/([\dA-Z_]+)=['"][\d]+['"]/).each{ | var_match |
37
+ puts_debug "found var_match: " + var_match[0].to_s
36
38
  varname = var_match[0].to_s
37
39
  # extract potential urls that use the variable name
38
40
  # '([.\w:\/-]+)@#{INTERFACE_REV}'
39
- uri_search=Regexp.new("'([.\\w:\\/-]+)@" + '#{' + "#{varname}" + '}' + "'")
41
+ uri_search=Regexp.new("['\"]([.\\w:\\/-]+)@" + '#{' + "#{varname}" + '}' + "['\"]")
40
42
  #puts uri_search.to_s
41
43
  text.scan(uri_search).each { |uri_match|
42
- #puts "found uri_match: " + uri_match.to_s
44
+ puts_debug "found uri_match: " + uri_match.to_s
43
45
  uri=uri_match[0].to_s
44
46
  update_revision_variable(filename,varname,uri)
45
47
  }
46
48
  }
49
+ else
50
+ puts " " + filename + " does not exist"
47
51
  end
48
52
  end
49
53
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dev
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.17
4
+ version: 1.0.18
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-02-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
16
- requirement: &3143628 !ruby/object:Gem::Requirement
16
+ requirement: &23903004 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *3143628
24
+ version_requirements: *23903004
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: semver
27
- requirement: &3142968 !ruby/object:Gem::Requirement
27
+ requirement: &23901096 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *3142968
35
+ version_requirements: *23901096
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: countloc
38
- requirement: &3142476 !ruby/object:Gem::Requirement
38
+ requirement: &23899896 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *3142476
46
+ version_requirements: *23899896
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rainbow
49
- requirement: &3141780 !ruby/object:Gem::Requirement
49
+ requirement: &23897796 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *3141780
57
+ version_requirements: *23897796
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: rspec
60
- requirement: &3140208 !ruby/object:Gem::Requirement
60
+ requirement: &23919888 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *3140208
68
+ version_requirements: *23919888
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: cucumber
71
- requirement: &3139200 !ruby/object:Gem::Requirement
71
+ requirement: &23918784 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *3139200
79
+ version_requirements: *23918784
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: bundler
82
- requirement: &3138528 !ruby/object:Gem::Requirement
82
+ requirement: &23917752 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,7 +87,7 @@ dependencies:
87
87
  version: '0'
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *3138528
90
+ version_requirements: *23917752
91
91
  description: development tasks
92
92
  email: lou.parslow@gmail.com
93
93
  executables: