thor-scmversion 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/thor-scmversion/p4_version.rb +14 -10
  2. metadata +59 -19
@@ -1,4 +1,10 @@
1
1
  module ThorSCMVersion
2
+ class << self
3
+ def windows?
4
+ RbConfig::CONFIG["arch"] =~ /cygwin|mswin|mingw|bccwin|wince|emx/
5
+ end
6
+ end
7
+
2
8
  class MissingP4ConfigException < StandardError
3
9
  def initialize(config_option)
4
10
  @config_option = config_option
@@ -65,11 +71,13 @@ module ThorSCMVersion
65
71
  end
66
72
 
67
73
  def depot_path(path)
68
- `p4 dirs #{File.expand_path(path)}`.chomp
74
+ path = File.expand_path(path)
75
+ path = path.gsub(File::Separator, File::ALT_SEPARATOR) if ThorSCMVersion.windows?
76
+ `p4 where "#{path}/..."`.split(" ").first.gsub("/...", "")
69
77
  end
70
78
 
71
79
  def module_name(path)
72
- File.expand_path(path).split("/").last
80
+ depot_path(path).gsub("//", "").gsub("/", "-")
73
81
  end
74
82
 
75
83
  def parse_label(label, p4_module_name)
@@ -97,10 +105,10 @@ module ThorSCMVersion
97
105
  end
98
106
 
99
107
  def tag
100
- if windows?
101
- `type #{File.expand_path(get_p4_label_file).gsub(File::Separator, File::ALT_SEPARATOR)} | p4 label -i`
108
+ if ThorSCMVersion.windows?
109
+ `type "#{File.expand_path(get_p4_label_file).gsub(File::Separator, File::ALT_SEPARATOR)}" | p4 label -i`
102
110
  else
103
- `cat #{File.expand_path(get_p4_label_file)} | p4 label -i`
111
+ `cat "#{File.expand_path(get_p4_label_file)}" | p4 label -i`
104
112
  end
105
113
  end
106
114
 
@@ -143,9 +151,5 @@ View:
143
151
  file
144
152
  end
145
153
  end
146
-
147
- def windows?
148
- RbConfig::CONFIG["arch"] =~ /cygwin|mswin|mingw|bccwin|wince|emx/
149
- end
150
154
  end
151
- end
155
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thor-scmversion
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
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-10-15 00:00:00.000000000 Z
14
+ date: 2012-10-25 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: thor
18
- requirement: &70341045418340 !ruby/object:Gem::Requirement
18
+ requirement: !ruby/object:Gem::Requirement
19
19
  none: false
20
20
  requirements:
21
21
  - - ! '>='
@@ -23,10 +23,15 @@ dependencies:
23
23
  version: '0'
24
24
  type: :runtime
25
25
  prerelease: false
26
- version_requirements: *70341045418340
26
+ version_requirements: !ruby/object:Gem::Requirement
27
+ none: false
28
+ requirements:
29
+ - - ! '>='
30
+ - !ruby/object:Gem::Version
31
+ version: '0'
27
32
  - !ruby/object:Gem::Dependency
28
33
  name: webmock
29
- requirement: &70341045417740 !ruby/object:Gem::Requirement
34
+ requirement: !ruby/object:Gem::Requirement
30
35
  none: false
31
36
  requirements:
32
37
  - - ! '>='
@@ -34,10 +39,15 @@ dependencies:
34
39
  version: '0'
35
40
  type: :development
36
41
  prerelease: false
37
- version_requirements: *70341045417740
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ none: false
44
+ requirements:
45
+ - - ! '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
38
48
  - !ruby/object:Gem::Dependency
39
49
  name: geminabox
40
- requirement: &70341045417140 !ruby/object:Gem::Requirement
50
+ requirement: !ruby/object:Gem::Requirement
41
51
  none: false
42
52
  requirements:
43
53
  - - ! '>='
@@ -45,10 +55,15 @@ dependencies:
45
55
  version: '0'
46
56
  type: :development
47
57
  prerelease: false
48
- version_requirements: *70341045417140
58
+ version_requirements: !ruby/object:Gem::Requirement
59
+ none: false
60
+ requirements:
61
+ - - ! '>='
62
+ - !ruby/object:Gem::Version
63
+ version: '0'
49
64
  - !ruby/object:Gem::Dependency
50
65
  name: spork
51
- requirement: &70341045416600 !ruby/object:Gem::Requirement
66
+ requirement: !ruby/object:Gem::Requirement
52
67
  none: false
53
68
  requirements:
54
69
  - - ! '>='
@@ -56,10 +71,15 @@ dependencies:
56
71
  version: '0'
57
72
  type: :development
58
73
  prerelease: false
59
- version_requirements: *70341045416600
74
+ version_requirements: !ruby/object:Gem::Requirement
75
+ none: false
76
+ requirements:
77
+ - - ! '>='
78
+ - !ruby/object:Gem::Version
79
+ version: '0'
60
80
  - !ruby/object:Gem::Dependency
61
81
  name: simplecov
62
- requirement: &70341045416120 !ruby/object:Gem::Requirement
82
+ requirement: !ruby/object:Gem::Requirement
63
83
  none: false
64
84
  requirements:
65
85
  - - ! '>='
@@ -67,10 +87,15 @@ dependencies:
67
87
  version: '0'
68
88
  type: :development
69
89
  prerelease: false
70
- version_requirements: *70341045416120
90
+ version_requirements: !ruby/object:Gem::Requirement
91
+ none: false
92
+ requirements:
93
+ - - ! '>='
94
+ - !ruby/object:Gem::Version
95
+ version: '0'
71
96
  - !ruby/object:Gem::Dependency
72
97
  name: vcr
73
- requirement: &70341045415700 !ruby/object:Gem::Requirement
98
+ requirement: !ruby/object:Gem::Requirement
74
99
  none: false
75
100
  requirements:
76
101
  - - ! '>='
@@ -78,10 +103,15 @@ dependencies:
78
103
  version: '0'
79
104
  type: :development
80
105
  prerelease: false
81
- version_requirements: *70341045415700
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ none: false
108
+ requirements:
109
+ - - ! '>='
110
+ - !ruby/object:Gem::Version
111
+ version: '0'
82
112
  - !ruby/object:Gem::Dependency
83
113
  name: aruba
84
- requirement: &70341045415280 !ruby/object:Gem::Requirement
114
+ requirement: !ruby/object:Gem::Requirement
85
115
  none: false
86
116
  requirements:
87
117
  - - ! '>='
@@ -89,10 +119,15 @@ dependencies:
89
119
  version: '0'
90
120
  type: :development
91
121
  prerelease: false
92
- version_requirements: *70341045415280
122
+ version_requirements: !ruby/object:Gem::Requirement
123
+ none: false
124
+ requirements:
125
+ - - ! '>='
126
+ - !ruby/object:Gem::Version
127
+ version: '0'
93
128
  - !ruby/object:Gem::Dependency
94
129
  name: rspec
95
- requirement: &70341045414860 !ruby/object:Gem::Requirement
130
+ requirement: !ruby/object:Gem::Requirement
96
131
  none: false
97
132
  requirements:
98
133
  - - ! '>='
@@ -100,7 +135,12 @@ dependencies:
100
135
  version: '0'
101
136
  type: :development
102
137
  prerelease: false
103
- version_requirements: *70341045414860
138
+ version_requirements: !ruby/object:Gem::Requirement
139
+ none: false
140
+ requirements:
141
+ - - ! '>='
142
+ - !ruby/object:Gem::Version
143
+ version: '0'
104
144
  description: Thor tasks to manage a VERSION file based on SCM tags
105
145
  email:
106
146
  - ivey@gweezlebur.com
@@ -156,7 +196,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
156
196
  version: '0'
157
197
  requirements: []
158
198
  rubyforge_project:
159
- rubygems_version: 1.8.11
199
+ rubygems_version: 1.8.21
160
200
  signing_key:
161
201
  specification_version: 3
162
202
  summary: A small set of Thor tasks you can include in your build scripts to manage