sugar-high 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/sugar-high/file.rb +6 -2
- data/lib/sugar-high/regexp.rb +11 -0
- data/spec/sugar-high/regexp_spec.rb +19 -0
- data/sugar-high.gemspec +6 -3
- metadata +6 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.8
|
data/lib/sugar-high/file.rb
CHANGED
@@ -76,7 +76,7 @@ class File
|
|
76
76
|
# TODO: Needs spec
|
77
77
|
|
78
78
|
# insert_into 'my_file.txt', :after => 'Blip', :content => 'Hello
|
79
|
-
# insert_into 'my_file.txt', :after => 'Blip'
|
79
|
+
# insert_into 'my_file.txt', 'Hello', :after => 'Blip'
|
80
80
|
# insert_into 'my_file.txt', :after => 'Blip' do
|
81
81
|
# 'Hello'
|
82
82
|
# end
|
@@ -154,10 +154,14 @@ end
|
|
154
154
|
class String
|
155
155
|
def path
|
156
156
|
self.extend PathString
|
157
|
-
end
|
157
|
+
end
|
158
158
|
end
|
159
159
|
|
160
160
|
module PathString
|
161
|
+
def exists?
|
162
|
+
File.exist? self
|
163
|
+
end
|
164
|
+
|
161
165
|
def up lv
|
162
166
|
('../' * lv) + self
|
163
167
|
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'sugar-high/regexp'
|
3
|
+
|
4
|
+
describe "SugarHigh" do
|
5
|
+
describe 'Regexp pack' do
|
6
|
+
|
7
|
+
describe 'String#to_regexp' do
|
8
|
+
it "should convert string to Regexp" do
|
9
|
+
'hello'.to_regexp.should be_a_kind_of Regexp
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
describe 'Regexp#to_regexp' do
|
14
|
+
it "should return itself as a regexp" do
|
15
|
+
/hello/.to_regexp.should be_a_kind_of Regexp
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/sugar-high.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{sugar-high}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.8"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Kristian Mandrup"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-09-03}
|
13
13
|
s.description = %q{More Ruby sugar - inspired by the 'zuker' project}
|
14
14
|
s.email = %q{kmandrup@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -37,6 +37,7 @@ Gem::Specification.new do |s|
|
|
37
37
|
"lib/sugar-high/methods.rb",
|
38
38
|
"lib/sugar-high/module.rb",
|
39
39
|
"lib/sugar-high/not.rb",
|
40
|
+
"lib/sugar-high/regexp.rb",
|
40
41
|
"lib/sugar-high/rspec/configure.rb",
|
41
42
|
"lib/sugar-high/rspec/matchers/have_aliases.rb",
|
42
43
|
"spec/fixtures/empty.txt",
|
@@ -52,6 +53,7 @@ Gem::Specification.new do |s|
|
|
52
53
|
"spec/sugar-high/kind_of_spec.rb",
|
53
54
|
"spec/sugar-high/methods_spec.rb",
|
54
55
|
"spec/sugar-high/module_spec.rb",
|
56
|
+
"spec/sugar-high/regexp_spec.rb",
|
55
57
|
"sugar-high.gemspec"
|
56
58
|
]
|
57
59
|
s.homepage = %q{http://github.com/kristianmandrup/sugar-high}
|
@@ -70,7 +72,8 @@ Gem::Specification.new do |s|
|
|
70
72
|
"spec/sugar-high/includes_spec.rb",
|
71
73
|
"spec/sugar-high/kind_of_spec.rb",
|
72
74
|
"spec/sugar-high/methods_spec.rb",
|
73
|
-
"spec/sugar-high/module_spec.rb"
|
75
|
+
"spec/sugar-high/module_spec.rb",
|
76
|
+
"spec/sugar-high/regexp_spec.rb"
|
74
77
|
]
|
75
78
|
|
76
79
|
if s.respond_to? :specification_version then
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 8
|
9
|
+
version: 0.1.8
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Kristian Mandrup
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-
|
17
|
+
date: 2010-09-03 00:00:00 +02:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -77,6 +77,7 @@ files:
|
|
77
77
|
- lib/sugar-high/methods.rb
|
78
78
|
- lib/sugar-high/module.rb
|
79
79
|
- lib/sugar-high/not.rb
|
80
|
+
- lib/sugar-high/regexp.rb
|
80
81
|
- lib/sugar-high/rspec/configure.rb
|
81
82
|
- lib/sugar-high/rspec/matchers/have_aliases.rb
|
82
83
|
- spec/fixtures/empty.txt
|
@@ -92,6 +93,7 @@ files:
|
|
92
93
|
- spec/sugar-high/kind_of_spec.rb
|
93
94
|
- spec/sugar-high/methods_spec.rb
|
94
95
|
- spec/sugar-high/module_spec.rb
|
96
|
+
- spec/sugar-high/regexp_spec.rb
|
95
97
|
- sugar-high.gemspec
|
96
98
|
has_rdoc: true
|
97
99
|
homepage: http://github.com/kristianmandrup/sugar-high
|
@@ -137,3 +139,4 @@ test_files:
|
|
137
139
|
- spec/sugar-high/kind_of_spec.rb
|
138
140
|
- spec/sugar-high/methods_spec.rb
|
139
141
|
- spec/sugar-high/module_spec.rb
|
142
|
+
- spec/sugar-high/regexp_spec.rb
|