right_develop 2.0.1 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.1
1
+ 2.0.2
@@ -26,8 +26,6 @@ require "action_view"
26
26
 
27
27
  module RightDevelop::Commands
28
28
  class Git
29
- include ActionView::Helpers::DateHelper
30
-
31
29
  NAME_SPLIT_CHARS = /-|_|\//
32
30
  YES = /(ye?s?)/i
33
31
  NO = /(no?)/i
@@ -70,9 +68,9 @@ EOS
70
68
 
71
69
  case task
72
70
  when "prune"
73
- repo = ::RightGit::Repository.new(
71
+ repo = ::RightGit::Git::Repository.new(
74
72
  ::Dir.pwd,
75
- ::RightDevelop::Utility::Git::DEFALT_REPO_OPTIONS)
73
+ ::RightDevelop::Utility::Git::DEFAULT_REPO_OPTIONS)
76
74
  self.new(repo, :prune, options)
77
75
  else
78
76
  Trollop.die "unknown task #{task}"
@@ -88,15 +86,9 @@ EOS
88
86
  def initialize(repo, task, options)
89
87
  # Post-process "age" option; transform from natural-language expression into a timestamp.
90
88
  if (age = options.delete(:age))
91
- age = age.gsub(/\s+/, ".")
92
-
93
- if age =~ /^[0-9]+\.?(hours|days|weeks|months|years)$/
94
- age = eval(age).ago
95
- elsif age =~ /^[0-9]+$/
96
- age = age.to_i.months.ago
97
- else
98
- raise ArgumentError, "Can't parse age of '#{age}'"
99
- end
89
+ require 'ruby-debug'
90
+ debugger
91
+ age = parse_age(age)
100
92
  options[:age] = age
101
93
  end
102
94
 
@@ -212,5 +204,61 @@ EOS
212
204
  end
213
205
  end
214
206
  end
207
+
208
+ # An ordered list of time intervals of decreasing magnitude. Stored as Array and not Hash in
209
+ # order to ensure consistent traversal order between Ruby 1.8 and 1.9+.
210
+ TIME_INTERVALS = [
211
+ [31_557_600, 'year'],
212
+ [2_592_000, 'month'],
213
+ [604_800, 'week'],
214
+ [86_400, 'day'],
215
+ [3_600, 'hour'],
216
+ [60, 'minute'],
217
+ [1, 'second'],
218
+ ]
219
+
220
+ def time_ago_in_words(once_upon_a)
221
+ dt = Time.now.to_f - once_upon_a.to_f
222
+
223
+ words = nil
224
+
225
+ TIME_INTERVALS.each do |pair|
226
+ mag, term = pair.first, pair.last
227
+ if dt >= mag
228
+ units = dt / mag
229
+ words = "%d %s%s" % [units, term, units > 1 ? 's' : '']
230
+ break
231
+ end
232
+ end
233
+
234
+ if words
235
+ words
236
+ else
237
+ once_upon_a.strftime("%Y-%m-%d")
238
+ end
239
+ end
240
+
241
+ def parse_age(str)
242
+ ord, word = str.split(/[. ]+/, 2)
243
+ ord = Integer(ord)
244
+ word.gsub!(/s$/, '')
245
+
246
+ ago = nil
247
+
248
+ TIME_INTERVALS.each do |pair|
249
+ mag, term = pair.first, pair.last
250
+
251
+ if term == word
252
+ ago = Time.at(Time.now.to_i - ord * mag)
253
+ break
254
+ end
255
+ end
256
+
257
+ if ago
258
+ ago
259
+ else
260
+ raise ArgumentError, "Cannot parse '#{str}' as an age"
261
+ end
262
+ end
215
263
  end
216
264
  end
@@ -118,7 +118,7 @@ module RightDevelop
118
118
  executioner = super(executioner, options)
119
119
 
120
120
  # clean all bundler env vars, if requested.
121
- if options[:clean_bundler_env]
121
+ if options[:clean_bundler_env] && defined?(::Bundler)
122
122
  executioner = lambda do |e|
123
123
  lambda { ::Bundler.with_clean_env { e.call } }
124
124
  end.call(executioner)
@@ -4,20 +4,22 @@
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
- s.name = "right_develop"
8
- s.version = "2.0.1"
7
+ s.name = %q{right_develop}
8
+ s.version = "2.0.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Tony Spataro"]
12
- s.date = "2013-12-06"
13
- s.description = "A toolkit of development tools created by RightScale."
14
- s.email = "support@rightscale.com"
12
+ s.date = %q{2014-01-13}
13
+ s.default_executable = %q{right_develop}
14
+ s.description = %q{A toolkit of development tools created by RightScale.}
15
+ s.email = %q{support@rightscale.com}
15
16
  s.executables = ["right_develop"]
16
17
  s.extra_rdoc_files = [
17
18
  "LICENSE",
18
19
  "README.rdoc"
19
20
  ]
20
21
  s.files = [
22
+ ".ruby-version",
21
23
  "CHANGELOG.rdoc",
22
24
  "LICENSE",
23
25
  "README.rdoc",
@@ -48,11 +50,11 @@ Gem::Specification.new do |s|
48
50
  "right_develop.gemspec",
49
51
  "right_develop.rconf"
50
52
  ]
51
- s.homepage = "https://github.com/rightscale/right_develop"
53
+ s.homepage = %q{https://github.com/rightscale/right_develop}
52
54
  s.licenses = ["MIT"]
53
55
  s.require_paths = ["lib"]
54
- s.rubygems_version = "1.8.23"
55
- s.summary = "Reusable dev & test code."
56
+ s.rubygems_version = %q{1.6.2}
57
+ s.summary = %q{Reusable dev & test code.}
56
58
 
57
59
  if s.respond_to? :specification_version then
58
60
  s.specification_version = 3
@@ -64,7 +66,6 @@ Gem::Specification.new do |s|
64
66
  s.add_runtime_dependency(%q<rspec>, ["< 3.0", ">= 1.3"])
65
67
  s.add_runtime_dependency(%q<cucumber>, ["< 1.3.3", "~> 1.0"])
66
68
  s.add_runtime_dependency(%q<trollop>, ["< 3.0", ">= 1.0"])
67
- s.add_runtime_dependency(%q<actionpack>, ["< 4.0", ">= 2.3.0"])
68
69
  s.add_runtime_dependency(%q<right_git>, [">= 0"])
69
70
  s.add_runtime_dependency(%q<right_aws>, [">= 2.1.0"])
70
71
  s.add_development_dependency(%q<jeweler>, ["~> 1.8.3"])
@@ -76,7 +77,6 @@ Gem::Specification.new do |s|
76
77
  s.add_dependency(%q<rspec>, ["< 3.0", ">= 1.3"])
77
78
  s.add_dependency(%q<cucumber>, ["< 1.3.3", "~> 1.0"])
78
79
  s.add_dependency(%q<trollop>, ["< 3.0", ">= 1.0"])
79
- s.add_dependency(%q<actionpack>, ["< 4.0", ">= 2.3.0"])
80
80
  s.add_dependency(%q<right_git>, [">= 0"])
81
81
  s.add_dependency(%q<right_aws>, [">= 2.1.0"])
82
82
  s.add_dependency(%q<jeweler>, ["~> 1.8.3"])
@@ -89,7 +89,6 @@ Gem::Specification.new do |s|
89
89
  s.add_dependency(%q<rspec>, ["< 3.0", ">= 1.3"])
90
90
  s.add_dependency(%q<cucumber>, ["< 1.3.3", "~> 1.0"])
91
91
  s.add_dependency(%q<trollop>, ["< 3.0", ">= 1.0"])
92
- s.add_dependency(%q<actionpack>, ["< 4.0", ">= 2.3.0"])
93
92
  s.add_dependency(%q<right_git>, [">= 0"])
94
93
  s.add_dependency(%q<right_aws>, [">= 2.1.0"])
95
94
  s.add_dependency(%q<jeweler>, ["~> 1.8.3"])
metadata CHANGED
@@ -1,231 +1,215 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: right_develop
3
- version: !ruby/object:Gem::Version
4
- version: 2.0.1
3
+ version: !ruby/object:Gem::Version
4
+ hash: 11
5
5
  prerelease:
6
+ segments:
7
+ - 2
8
+ - 0
9
+ - 2
10
+ version: 2.0.2
6
11
  platform: ruby
7
- authors:
12
+ authors:
8
13
  - Tony Spataro
9
14
  autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
- date: 2013-12-06 00:00:00.000000000 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: rake
16
- requirement: !ruby/object:Gem::Requirement
17
- none: false
18
- requirements:
19
- - - <
20
- - !ruby/object:Gem::Version
21
- version: '0.10'
22
- - - ! '>='
23
- - !ruby/object:Gem::Version
24
- version: 0.8.7
17
+
18
+ date: 2014-01-13 00:00:00 -08:00
19
+ default_executable: right_develop
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
25
22
  type: :runtime
26
- prerelease: false
27
- version_requirements: !ruby/object:Gem::Requirement
23
+ version_requirements: &id001 !ruby/object:Gem::Requirement
28
24
  none: false
29
- requirements:
25
+ requirements:
30
26
  - - <
31
- - !ruby/object:Gem::Version
32
- version: '0.10'
33
- - - ! '>='
34
- - !ruby/object:Gem::Version
27
+ - !ruby/object:Gem::Version
28
+ hash: 31
29
+ segments:
30
+ - 0
31
+ - 10
32
+ version: "0.10"
33
+ - - ">="
34
+ - !ruby/object:Gem::Version
35
+ hash: 49
36
+ segments:
37
+ - 0
38
+ - 8
39
+ - 7
35
40
  version: 0.8.7
36
- - !ruby/object:Gem::Dependency
37
- name: right_support
38
- requirement: !ruby/object:Gem::Requirement
41
+ prerelease: false
42
+ requirement: *id001
43
+ name: rake
44
+ - !ruby/object:Gem::Dependency
45
+ type: :runtime
46
+ version_requirements: &id002 !ruby/object:Gem::Requirement
39
47
  none: false
40
- requirements:
48
+ requirements:
41
49
  - - ~>
42
- - !ruby/object:Gem::Version
43
- version: '2.0'
44
- type: :runtime
50
+ - !ruby/object:Gem::Version
51
+ hash: 3
52
+ segments:
53
+ - 2
54
+ - 0
55
+ version: "2.0"
45
56
  prerelease: false
46
- version_requirements: !ruby/object:Gem::Requirement
57
+ requirement: *id002
58
+ name: right_support
59
+ - !ruby/object:Gem::Dependency
60
+ type: :runtime
61
+ version_requirements: &id003 !ruby/object:Gem::Requirement
47
62
  none: false
48
- requirements:
63
+ requirements:
49
64
  - - ~>
50
- - !ruby/object:Gem::Version
51
- version: '2.0'
52
- - !ruby/object:Gem::Dependency
65
+ - !ruby/object:Gem::Version
66
+ hash: 7
67
+ segments:
68
+ - 3
69
+ - 0
70
+ version: "3.0"
71
+ prerelease: false
72
+ requirement: *id003
53
73
  name: builder
54
- requirement: !ruby/object:Gem::Requirement
55
- none: false
56
- requirements:
57
- - - ~>
58
- - !ruby/object:Gem::Version
59
- version: '3.0'
74
+ - !ruby/object:Gem::Dependency
60
75
  type: :runtime
61
- prerelease: false
62
- version_requirements: !ruby/object:Gem::Requirement
76
+ version_requirements: &id004 !ruby/object:Gem::Requirement
63
77
  none: false
64
- requirements:
65
- - - ~>
66
- - !ruby/object:Gem::Version
67
- version: '3.0'
68
- - !ruby/object:Gem::Dependency
69
- name: rspec
70
- requirement: !ruby/object:Gem::Requirement
71
- none: false
72
- requirements:
78
+ requirements:
73
79
  - - <
74
- - !ruby/object:Gem::Version
75
- version: '3.0'
76
- - - ! '>='
77
- - !ruby/object:Gem::Version
78
- version: '1.3'
79
- type: :runtime
80
+ - !ruby/object:Gem::Version
81
+ hash: 7
82
+ segments:
83
+ - 3
84
+ - 0
85
+ version: "3.0"
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ hash: 9
89
+ segments:
90
+ - 1
91
+ - 3
92
+ version: "1.3"
80
93
  prerelease: false
81
- version_requirements: !ruby/object:Gem::Requirement
82
- none: false
83
- requirements:
84
- - - <
85
- - !ruby/object:Gem::Version
86
- version: '3.0'
87
- - - ! '>='
88
- - !ruby/object:Gem::Version
89
- version: '1.3'
90
- - !ruby/object:Gem::Dependency
91
- name: cucumber
92
- requirement: !ruby/object:Gem::Requirement
94
+ requirement: *id004
95
+ name: rspec
96
+ - !ruby/object:Gem::Dependency
97
+ type: :runtime
98
+ version_requirements: &id005 !ruby/object:Gem::Requirement
93
99
  none: false
94
- requirements:
100
+ requirements:
95
101
  - - <
96
- - !ruby/object:Gem::Version
102
+ - !ruby/object:Gem::Version
103
+ hash: 29
104
+ segments:
105
+ - 1
106
+ - 3
107
+ - 3
97
108
  version: 1.3.3
98
109
  - - ~>
99
- - !ruby/object:Gem::Version
100
- version: '1.0'
101
- type: :runtime
110
+ - !ruby/object:Gem::Version
111
+ hash: 15
112
+ segments:
113
+ - 1
114
+ - 0
115
+ version: "1.0"
102
116
  prerelease: false
103
- version_requirements: !ruby/object:Gem::Requirement
117
+ requirement: *id005
118
+ name: cucumber
119
+ - !ruby/object:Gem::Dependency
120
+ type: :runtime
121
+ version_requirements: &id006 !ruby/object:Gem::Requirement
104
122
  none: false
105
- requirements:
123
+ requirements:
106
124
  - - <
107
- - !ruby/object:Gem::Version
108
- version: 1.3.3
109
- - - ~>
110
- - !ruby/object:Gem::Version
111
- version: '1.0'
112
- - !ruby/object:Gem::Dependency
125
+ - !ruby/object:Gem::Version
126
+ hash: 7
127
+ segments:
128
+ - 3
129
+ - 0
130
+ version: "3.0"
131
+ - - ">="
132
+ - !ruby/object:Gem::Version
133
+ hash: 15
134
+ segments:
135
+ - 1
136
+ - 0
137
+ version: "1.0"
138
+ prerelease: false
139
+ requirement: *id006
113
140
  name: trollop
114
- requirement: !ruby/object:Gem::Requirement
115
- none: false
116
- requirements:
117
- - - <
118
- - !ruby/object:Gem::Version
119
- version: '3.0'
120
- - - ! '>='
121
- - !ruby/object:Gem::Version
122
- version: '1.0'
141
+ - !ruby/object:Gem::Dependency
123
142
  type: :runtime
124
- prerelease: false
125
- version_requirements: !ruby/object:Gem::Requirement
126
- none: false
127
- requirements:
128
- - - <
129
- - !ruby/object:Gem::Version
130
- version: '3.0'
131
- - - ! '>='
132
- - !ruby/object:Gem::Version
133
- version: '1.0'
134
- - !ruby/object:Gem::Dependency
135
- name: actionpack
136
- requirement: !ruby/object:Gem::Requirement
143
+ version_requirements: &id007 !ruby/object:Gem::Requirement
137
144
  none: false
138
- requirements:
139
- - - <
140
- - !ruby/object:Gem::Version
141
- version: '4.0'
142
- - - ! '>='
143
- - !ruby/object:Gem::Version
144
- version: 2.3.0
145
- type: :runtime
145
+ requirements:
146
+ - - ">="
147
+ - !ruby/object:Gem::Version
148
+ hash: 3
149
+ segments:
150
+ - 0
151
+ version: "0"
146
152
  prerelease: false
147
- version_requirements: !ruby/object:Gem::Requirement
148
- none: false
149
- requirements:
150
- - - <
151
- - !ruby/object:Gem::Version
152
- version: '4.0'
153
- - - ! '>='
154
- - !ruby/object:Gem::Version
155
- version: 2.3.0
156
- - !ruby/object:Gem::Dependency
153
+ requirement: *id007
157
154
  name: right_git
158
- requirement: !ruby/object:Gem::Requirement
159
- none: false
160
- requirements:
161
- - - ! '>='
162
- - !ruby/object:Gem::Version
163
- version: '0'
155
+ - !ruby/object:Gem::Dependency
164
156
  type: :runtime
165
- prerelease: false
166
- version_requirements: !ruby/object:Gem::Requirement
167
- none: false
168
- requirements:
169
- - - ! '>='
170
- - !ruby/object:Gem::Version
171
- version: '0'
172
- - !ruby/object:Gem::Dependency
173
- name: right_aws
174
- requirement: !ruby/object:Gem::Requirement
157
+ version_requirements: &id008 !ruby/object:Gem::Requirement
175
158
  none: false
176
- requirements:
177
- - - ! '>='
178
- - !ruby/object:Gem::Version
159
+ requirements:
160
+ - - ">="
161
+ - !ruby/object:Gem::Version
162
+ hash: 11
163
+ segments:
164
+ - 2
165
+ - 1
166
+ - 0
179
167
  version: 2.1.0
180
- type: :runtime
181
168
  prerelease: false
182
- version_requirements: !ruby/object:Gem::Requirement
183
- none: false
184
- requirements:
185
- - - ! '>='
186
- - !ruby/object:Gem::Version
187
- version: 2.1.0
188
- - !ruby/object:Gem::Dependency
189
- name: jeweler
190
- requirement: !ruby/object:Gem::Requirement
191
- none: false
192
- requirements:
193
- - - ~>
194
- - !ruby/object:Gem::Version
195
- version: 1.8.3
169
+ requirement: *id008
170
+ name: right_aws
171
+ - !ruby/object:Gem::Dependency
196
172
  type: :development
197
- prerelease: false
198
- version_requirements: !ruby/object:Gem::Requirement
173
+ version_requirements: &id009 !ruby/object:Gem::Requirement
199
174
  none: false
200
- requirements:
175
+ requirements:
201
176
  - - ~>
202
- - !ruby/object:Gem::Version
177
+ - !ruby/object:Gem::Version
178
+ hash: 49
179
+ segments:
180
+ - 1
181
+ - 8
182
+ - 3
203
183
  version: 1.8.3
204
- - !ruby/object:Gem::Dependency
205
- name: rdoc
206
- requirement: !ruby/object:Gem::Requirement
207
- none: false
208
- requirements:
209
- - - ! '>='
210
- - !ruby/object:Gem::Version
211
- version: 2.4.2
212
- type: :development
213
184
  prerelease: false
214
- version_requirements: !ruby/object:Gem::Requirement
185
+ requirement: *id009
186
+ name: jeweler
187
+ - !ruby/object:Gem::Dependency
188
+ type: :development
189
+ version_requirements: &id010 !ruby/object:Gem::Requirement
215
190
  none: false
216
- requirements:
217
- - - ! '>='
218
- - !ruby/object:Gem::Version
191
+ requirements:
192
+ - - ">="
193
+ - !ruby/object:Gem::Version
194
+ hash: 27
195
+ segments:
196
+ - 2
197
+ - 4
198
+ - 2
219
199
  version: 2.4.2
200
+ prerelease: false
201
+ requirement: *id010
202
+ name: rdoc
220
203
  description: A toolkit of development tools created by RightScale.
221
204
  email: support@rightscale.com
222
- executables:
205
+ executables:
223
206
  - right_develop
224
207
  extensions: []
225
- extra_rdoc_files:
208
+
209
+ extra_rdoc_files:
226
210
  - LICENSE
227
211
  - README.rdoc
228
- files:
212
+ files:
229
213
  - .ruby-version
230
214
  - CHANGELOG.rdoc
231
215
  - LICENSE
@@ -256,32 +240,39 @@ files:
256
240
  - lib/right_develop/utility/versioning.rb
257
241
  - right_develop.gemspec
258
242
  - right_develop.rconf
243
+ has_rdoc: true
259
244
  homepage: https://github.com/rightscale/right_develop
260
- licenses:
245
+ licenses:
261
246
  - MIT
262
247
  post_install_message:
263
248
  rdoc_options: []
264
- require_paths:
249
+
250
+ require_paths:
265
251
  - lib
266
- required_ruby_version: !ruby/object:Gem::Requirement
252
+ required_ruby_version: !ruby/object:Gem::Requirement
267
253
  none: false
268
- requirements:
269
- - - ! '>='
270
- - !ruby/object:Gem::Version
271
- version: '0'
272
- segments:
254
+ requirements:
255
+ - - ">="
256
+ - !ruby/object:Gem::Version
257
+ hash: 3
258
+ segments:
273
259
  - 0
274
- hash: 1605047382053120041
275
- required_rubygems_version: !ruby/object:Gem::Requirement
260
+ version: "0"
261
+ required_rubygems_version: !ruby/object:Gem::Requirement
276
262
  none: false
277
- requirements:
278
- - - ! '>='
279
- - !ruby/object:Gem::Version
280
- version: '0'
263
+ requirements:
264
+ - - ">="
265
+ - !ruby/object:Gem::Version
266
+ hash: 3
267
+ segments:
268
+ - 0
269
+ version: "0"
281
270
  requirements: []
271
+
282
272
  rubyforge_project:
283
- rubygems_version: 1.8.23
273
+ rubygems_version: 1.6.2
284
274
  signing_key:
285
275
  specification_version: 3
286
276
  summary: Reusable dev & test code.
287
277
  test_files: []
278
+