midwire_common 0.1.8 → 0.1.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 871c89e143b28415feefe826dae34869ead09e78
4
- data.tar.gz: b234e30af65a32a4317f3c0c35ede5babb866197
3
+ metadata.gz: 5da67bc5fb2262d2499c04aa0f873cb27ac6b2f4
4
+ data.tar.gz: 34b348ccd6c0026a7574ed73687199b98d392d70
5
5
  SHA512:
6
- metadata.gz: 0961001c8b0339de2e44cae4a184dcdbd5022db8a238c3ab3759d9882f4d217a4fd6b999900b51000dc23c030bdd61a111c5335f703dd8b49c1365f8c97640d6
7
- data.tar.gz: f7af2c6d9da7b77e206288d5b2a4bfeda7e0f6eac27f70295f298bf27a2fee1407021f6f33d369de966f7e7e0a1d0c7409f6a5ec9f93a28557ac28c922d54ea4
6
+ metadata.gz: 6b6f1d4ba80fb18e2c5c0e90a9106b22b27a880bef6bc922e04cfa6562c239617b10e6e08022e1be514004e962dda7c1493c8855194ea5ba308be5369dad7506
7
+ data.tar.gz: e748deb30355bab169231a6ef3a461691086c787d4772f17f4eb608f100173006698be066fa9f10147ab8cd24aafe0f167485dd4d875e6aa9ec2beef4bd21d03
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.1.2
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ *0.1.9* (September 19, 2014)
2
+
3
+ * Change space-padding for the hour to zero-padding, for the Time.timestamp method.
4
+
1
5
  *0.1.8* (March 19, 2014)
2
6
 
3
7
  * Changed String#here_with_pipe instance method to accept any delimeter instead of the boolean 'linefeeds'.
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Midwire Common Gem
2
2
 
3
- **Version: 0.1.8**
3
+ **Version: 0.1.9**
4
4
 
5
5
  A handy Ruby library for Midwire development
6
6
 
@@ -2,6 +2,8 @@ require 'thor'
2
2
  require 'midwire_common'
3
3
 
4
4
  module MidwireCommon
5
+
6
+ # RakeHelper helps to automate gem release and versioning tasks
5
7
  class RakeHelper
6
8
  include Rake::DSL if defined? Rake::DSL
7
9
 
@@ -2,7 +2,7 @@ class Time
2
2
 
3
3
  class << self
4
4
  def timestamp
5
- "#{Time.now.strftime("%Y%m%d%k%M%S")}"
5
+ "#{Time.now.strftime("%Y%m%d%H%M%S")}"
6
6
  end
7
7
  end
8
8
 
@@ -1,6 +1,6 @@
1
1
  original_verbosity = $VERBOSE
2
2
  $VERBOSE = nil
3
3
  module MidwireCommon
4
- VERSION = "0.1.8"
4
+ VERSION = "0.1.9"
5
5
  end
6
6
  $VERBOSE = original_verbosity
@@ -50,12 +50,12 @@ describe String do
50
50
  it "'trim!' removes whitespace from both sides of the string" do
51
51
  mystring = " \t \t a test is coming \t \t "
52
52
  mystring.trim!
53
- mystring.should == "a test is coming"
53
+ mystring.should == 'a test is coming'
54
54
  end
55
55
  end
56
56
 
57
- context "formatting and manipulation" do
58
- it "here_with_pipe - without linefeeds" do
57
+ context 'formatting and manipulation' do
58
+ it 'here_with_pipe - without linefeeds' do
59
59
  html = <<-STOP.here_with_pipe
60
60
  |<!-- Begin: comment -->
61
61
  |<script type="text/javascript">
@@ -64,7 +64,7 @@ describe String do
64
64
  html.should == "<!-- Begin: comment --> <script type=\"text/javascript\"> </script>"
65
65
  end
66
66
 
67
- it "here_with_pipe - with linefeeds" do
67
+ it 'here_with_pipe - with linefeeds' do
68
68
  html = <<-STOP.here_with_pipe("\n")
69
69
  |<!-- Begin: comment -->
70
70
  |<script type="text/javascript">
@@ -73,7 +73,7 @@ describe String do
73
73
  html.should == "<!-- Begin: comment -->\n<script type=\"text/javascript\">\n</script>"
74
74
  end
75
75
 
76
- it "here_with_pipe - with no space delimeter" do
76
+ it 'here_with_pipe - with no space delimeter' do
77
77
  html = <<-STOP.here_with_pipe("")
78
78
  |<!-- Begin: comment -->
79
79
  |<script type="text/javascript">
@@ -82,91 +82,91 @@ describe String do
82
82
  html.should == "<!-- Begin: comment --><script type=\"text/javascript\"></script>"
83
83
  end
84
84
 
85
- it "format_phone returns a formatted phone number string" do
86
- "9132329999".format_phone.should == "(913)232-9999"
87
- "913.232.9999".format_phone.should == "(913)232-9999"
88
- "913 232 9999".format_phone.should == "(913)232-9999"
89
- "913-232-9999".format_phone.should == "(913)232-9999"
85
+ it 'format_phone returns a formatted phone number string' do
86
+ '9132329999'.format_phone.should == '(913)232-9999'
87
+ '913.232.9999'.format_phone.should == '(913)232-9999'
88
+ '913 232 9999'.format_phone.should == '(913)232-9999'
89
+ '913-232-9999'.format_phone.should == '(913)232-9999'
90
90
  end
91
91
 
92
- it "sanitizes itself" do
93
- "|bogus|".sanitize.should == "bogus"
94
- "|∫|ß".sanitize.should == ""
95
- "ßogus".sanitize.should == "ogus"
96
- "<tag>bogus</tag>".sanitize.should == "tagbogustag"
97
- "<tag>.bogus.</tag>".sanitize.should == "tag.bogus.tag"
98
- s = "|∫|ß"
92
+ it 'sanitizes itself' do
93
+ '|bogus|'.sanitize.should == 'bogus'
94
+ '|∫|ß'.sanitize.should == ''
95
+ 'ßogus'.sanitize.should == 'ogus'
96
+ '<tag>bogus</tag>'.sanitize.should == 'tagbogustag'
97
+ '<tag>.bogus.</tag>'.sanitize.should == 'tag.bogus.tag'
98
+ s = '|∫|ß'
99
99
  s.sanitize!
100
- s.should == ""
100
+ s.should == ''
101
101
  end
102
102
 
103
- it "shortens itself with elipses at the end" do
104
- s = "this is my very long string which I will eventually shorten with the enhanced String class that we are now testing."
103
+ it 'shortens itself with elipses at the end' do
104
+ s = 'this is my very long string which I will eventually shorten with the enhanced String class that we are now testing.'
105
105
  short = s.shorten
106
- short.should == "this is my very long string..."
106
+ short.should == 'this is my very long string...'
107
107
  short.length.should == 30
108
108
 
109
- s = "1234567890123456789012345678901234567890"
109
+ s = '1234567890123456789012345678901234567890'
110
110
  short = s.shorten
111
- short.should == "123456789012345678901234567..."
111
+ short.should == '123456789012345678901234567...'
112
112
  short.length.should == 30
113
113
 
114
- s = "12345678901234567890"
114
+ s = '12345678901234567890'
115
115
  short = s.shorten
116
- short.should == "12345678901234567890"
116
+ short.should == '12345678901234567890'
117
117
  short.length.should == 20
118
118
  end
119
119
 
120
- context "quotes" do
121
- it "escapes single quotes" do
120
+ context 'quotes' do
121
+ it 'escapes single quotes' do
122
122
  "this is a 'test'".escape_single_quotes.should == "this is a \\'test\\'"
123
123
  end
124
124
 
125
- it "escapes double quotes" do
125
+ it 'escapes double quotes' do
126
126
  'this is a "test"'.escape_double_quotes.should == "this is a \\\\\"test\\\\\""
127
127
  end
128
128
  end
129
129
  end
130
130
 
131
- context "characterization" do
132
- it "knows if it is alpha-numeric or not" do
133
- "abcd-9191".is_alpha_numeric?.should be_false
134
- "abcd.9191".is_alpha_numeric?.should be_false
135
- "abcd91910".is_alpha_numeric?.should be_true
136
- "abcd_9191".is_alpha_numeric?.should be_false
137
- "abcd 9191".is_alpha_numeric?.should be_false
138
- end
139
-
140
- it "knows if it is an email address or not" do
141
- "abcd_9191".is_email_address?.should be_false
142
- "abcd@9191".is_email_address?.should be_false
143
- "abcd@9191.poop".is_email_address?.should be_false
144
- "abcd@9191.info".is_email_address?.should be_true
145
- "abcd-asdf@9191.com".is_email_address?.should be_true
146
- "abcd_asdf@9191.com".is_email_address?.should be_true
147
- "abcd.asdf@9191.com".is_email_address?.should be_true
148
- end
149
-
150
- it "knows if it is a zipcode or not" do
151
- "13922-2356".is_zipcode?.should be_true
152
- "13922.2343".is_zipcode?.should be_false
153
- "13922 2342".is_zipcode?.should be_false
154
- "ABSSD".is_zipcode?.should be_false
155
- "i3323".is_zipcode?.should be_false
156
- "13922".is_zipcode?.should be_true
157
- end
158
-
159
- it "knows if it is numeric or not" do
160
- "12341".is_numeric?.should be_true
161
- "12341.23".is_numeric?.should be_true
162
- "12341.00000000000000023".is_numeric?.should be_true
163
- "0.12341".is_numeric?.should be_true
164
- "0x2E".is_numeric?.should be_true
165
- " 0.12341".is_numeric?.should be_true
166
- " 0.12341 ".is_numeric?.should be_true
167
- ".12341".is_numeric?.should be_true
168
- " 12341.".is_numeric?.should be_false
169
- " 12341. ".is_numeric?.should be_false
131
+ context 'characterization' do
132
+ it 'knows if it is alpha-numeric or not' do
133
+ 'abcd-9191'.is_alpha_numeric?.should be_false
134
+ 'abcd.9191'.is_alpha_numeric?.should be_false
135
+ 'abcd91910'.is_alpha_numeric?.should be_true
136
+ 'abcd_9191'.is_alpha_numeric?.should be_false
137
+ 'abcd 9191'.is_alpha_numeric?.should be_false
138
+ end
139
+
140
+ it 'knows if it is an email address or not' do
141
+ 'abcd_9191'.is_email_address?.should be_false
142
+ 'abcd@9191'.is_email_address?.should be_false
143
+ 'abcd@9191.poop'.is_email_address?.should be_false
144
+ 'abcd@9191.info'.is_email_address?.should be_true
145
+ 'abcd-asdf@9191.com'.is_email_address?.should be_true
146
+ 'abcd_asdf@9191.com'.is_email_address?.should be_true
147
+ 'abcd.asdf@9191.com'.is_email_address?.should be_true
148
+ end
149
+
150
+ it 'knows if it is a zipcode or not' do
151
+ '13922-2356'.is_zipcode?.should be_true
152
+ '13922.2343'.is_zipcode?.should be_false
153
+ '13922 2342'.is_zipcode?.should be_false
154
+ 'ABSSD'.is_zipcode?.should be_false
155
+ 'i3323'.is_zipcode?.should be_false
156
+ '13922'.is_zipcode?.should be_true
157
+ end
158
+
159
+ it 'knows if it is numeric or not' do
160
+ '12341'.is_numeric?.should be_true
161
+ '12341.23'.is_numeric?.should be_true
162
+ '12341.00000000000000023'.is_numeric?.should be_true
163
+ '0.12341'.is_numeric?.should be_true
164
+ '0x2E'.is_numeric?.should be_true
165
+ ' 0.12341'.is_numeric?.should be_true
166
+ ' 0.12341 '.is_numeric?.should be_true
167
+ '.12341'.is_numeric?.should be_true
168
+ ' 12341.'.is_numeric?.should be_false
169
+ ' 12341. '.is_numeric?.should be_false
170
170
  end
171
171
  end
172
172
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: midwire_common
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Blackburn
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-19 00:00:00.000000000 Z
11
+ date: 2014-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -131,6 +131,7 @@ extra_rdoc_files: []
131
131
  files:
132
132
  - ".gitignore"
133
133
  - ".rspec"
134
+ - ".ruby-version"
134
135
  - CHANGELOG
135
136
  - Gemfile
136
137
  - Guardfile