stamp 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- stamp (0.1.3)
4
+ stamp (0.1.4)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
data/README.md CHANGED
@@ -62,6 +62,15 @@ January 2009. More explicit examples include "12/31", "31/12", and "12/99".
62
62
  Using unambiguous values will also help people who read the code in the
63
63
  future understand your intent.
64
64
 
65
+ ### Aliases
66
+
67
+ You might be concerned that the method name "stamp" isn't descriptive enough
68
+ for developers reading your code who aren't familiar with this gem. If that's
69
+ the case, the following aliases are available:
70
+
71
+ * `stamp_like`
72
+ * `format_like`
73
+
65
74
  ### Limitations
66
75
 
67
76
  * Time zone support hasn't been implemented. Patches welcome!
@@ -65,6 +65,15 @@ Feature: Stamping a date
65
65
  When I stamp the example "Marilyn Monroe was born on January 1, 1999."
66
66
  Then I produce "Marilyn Monroe was born on June 1, 1926."
67
67
 
68
+ Scenario Outline: Aliases for the stamp method
69
+ Given the date December 9, 2011
70
+ When I call "<alias>" with "1999-01-31"
71
+ Then I produce "2011-12-09"
72
+
73
+ Examples:
74
+ | alias |
75
+ | stamp_like |
76
+ | format_like |
68
77
 
69
78
  @wip
70
79
  Scenario Outline: Examples that aren't supported yet
@@ -22,3 +22,7 @@ end
22
22
  Then /^I produce "([^"]*)"$/ do |expected|
23
23
  assert_equal expected.strip, @stamped.strip
24
24
  end
25
+
26
+ When /^I call "([^"]*)" with "([^"]*)"$/ do |method, arg|
27
+ @stamped = @target.send(method, arg)
28
+ end
data/lib/stamp.rb CHANGED
@@ -43,6 +43,8 @@ module Stamp
43
43
  strftime(strftime_format(example))
44
44
  end
45
45
 
46
+ alias :stamp_like :stamp
47
+ alias :format_like :stamp
46
48
 
47
49
  private
48
50
 
data/lib/stamp/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Stamp
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stamp
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 3
10
- version: 0.1.3
9
+ - 4
10
+ version: 0.1.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jeremy Weiskotten