sample_file 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/sample_file.rb +4 -4
- data/lib/sample_file/base.rb +10 -0
- data/lib/sample_file/version.rb +1 -1
- data/sample_file.gemspec +1 -1
- data/spec/sample_file_spec.rb +7 -7
- data/spec/support/sample_file.rb +1 -0
- metadata +2 -2
data/lib/sample_file.rb
CHANGED
@@ -6,19 +6,19 @@ require "sample_file/video"
|
|
6
6
|
module SampleFile
|
7
7
|
class << self
|
8
8
|
def image(type='png')
|
9
|
-
Image.
|
9
|
+
Image.file(type)
|
10
10
|
end
|
11
11
|
|
12
12
|
def image_path(type='png')
|
13
|
-
Image.
|
13
|
+
Image.file_path(type)
|
14
14
|
end
|
15
15
|
|
16
16
|
def video(type='h264')
|
17
|
-
Video.
|
17
|
+
Video.file(type)
|
18
18
|
end
|
19
19
|
|
20
20
|
def video_path(type='h264')
|
21
|
-
Video.
|
21
|
+
Video.file_path(type)
|
22
22
|
end
|
23
23
|
end
|
24
24
|
end
|
data/lib/sample_file/base.rb
CHANGED
@@ -13,5 +13,15 @@ module SampleFile
|
|
13
13
|
def base_path
|
14
14
|
@base_path ||= File.expand_path File.join(File.dirname(__FILE__), '..', 'files')
|
15
15
|
end
|
16
|
+
|
17
|
+
class << self
|
18
|
+
def method_missing method, *args
|
19
|
+
instance.send method, *args
|
20
|
+
end
|
21
|
+
|
22
|
+
def instance
|
23
|
+
@@instance ||= self.new
|
24
|
+
end
|
25
|
+
end
|
16
26
|
end
|
17
27
|
end
|
data/lib/sample_file/version.rb
CHANGED
data/sample_file.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ["maartencls@gmail.com"]
|
11
11
|
spec.description = %q{Sample files for testing purposes}
|
12
12
|
spec.summary = %q{Sample files for testing purposes}
|
13
|
-
spec.homepage = ""
|
13
|
+
spec.homepage = "https://github.com/mcls/sample_file"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
16
|
spec.files = `git ls-files`.split($/)
|
data/spec/sample_file_spec.rb
CHANGED
@@ -4,28 +4,28 @@ describe SampleFile do
|
|
4
4
|
|
5
5
|
describe :image do
|
6
6
|
it "should call #file on a new instance of Image" do
|
7
|
-
described_class::Image.
|
7
|
+
described_class::Image.should_receive(:file)
|
8
8
|
described_class.image
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
12
12
|
describe :image_path do
|
13
|
-
it "should call #file_path on
|
14
|
-
described_class::Image.
|
13
|
+
it "should call #file_path on Image" do
|
14
|
+
described_class::Image.should_receive(:file_path)
|
15
15
|
described_class.image_path
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
19
|
describe :video do
|
20
|
-
it "should call #file on
|
21
|
-
described_class::Video.
|
20
|
+
it "should call #file on Video" do
|
21
|
+
described_class::Video.should_receive(:file)
|
22
22
|
described_class.video
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
26
|
describe :video_path do
|
27
|
-
it "should call #file_path on
|
28
|
-
described_class::Video.
|
27
|
+
it "should call #file_path on Video" do
|
28
|
+
described_class::Video.should_receive(:file_path)
|
29
29
|
described_class.video_path
|
30
30
|
end
|
31
31
|
end
|
data/spec/support/sample_file.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sample_file
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -102,7 +102,7 @@ files:
|
|
102
102
|
- spec/sample_file_spec.rb
|
103
103
|
- spec/spec_helper.rb
|
104
104
|
- spec/support/sample_file.rb
|
105
|
-
homepage:
|
105
|
+
homepage: https://github.com/mcls/sample_file
|
106
106
|
licenses:
|
107
107
|
- MIT
|
108
108
|
post_install_message:
|